main.go 749 B

123456789101112131415161718192021222324
  1. package main
  2. import (
  3. "log"
  4. "math/big"
  5. "sync-block/xrp"
  6. )
  7. func main() {
  8. log.SetFlags(log.LstdFlags | log.Lshortfile)
  9. client := xrp.New("http://localhost:3000")
  10. //log.Println(client.CreateWallet())
  11. balance, ownerCount, err := client.GetBalance("rwsSyWMQ1LVynsxeyLjvMmxCNbetf52TYW")
  12. log.Println(err)
  13. return
  14. reserveBase, reserveInc, _ := client.GetReserve()
  15. log.Println("balance:", balance, "owner count:", ownerCount)
  16. log.Println("reserve base:", reserveBase, "reserve inc", reserveInc)
  17. log.Println("available:", balance.Int64()-reserveBase.Int64()-(ownerCount*reserveInc.Int64()))
  18. err = client.SendToWithDestinationTag("sEdSxqpp78rECVAgFkKjwfYNsMPGKCk", "r4ZzCuyzuoaCQh7ELhYbyqkrgbnspw7nJx", big.NewInt(10), 12)
  19. log.Println(err)
  20. }