123456789101112131415161718192021222324 |
- package main
- import (
- "log"
- "math/big"
- "sync-block/xrp"
- )
- func main() {
- log.SetFlags(log.LstdFlags | log.Lshortfile)
- client := xrp.New("http://localhost:3000")
- //log.Println(client.CreateWallet())
- balance, ownerCount, err := client.GetBalance("rwsSyWMQ1LVynsxeyLjvMmxCNbetf52TYW")
- log.Println(err)
- return
- reserveBase, reserveInc, _ := client.GetReserve()
- log.Println("balance:", balance, "owner count:", ownerCount)
- log.Println("reserve base:", reserveBase, "reserve inc", reserveInc)
- log.Println("available:", balance.Int64()-reserveBase.Int64()-(ownerCount*reserveInc.Int64()))
- err = client.SendToWithDestinationTag("sEdSxqpp78rECVAgFkKjwfYNsMPGKCk", "r4ZzCuyzuoaCQh7ELhYbyqkrgbnspw7nJx", big.NewInt(10), 12)
- log.Println(err)
- }
|