package wallet import ( "encoding/json" "errors" "fmt" "io/ioutil" "strings" "github.com/nspcc-dev/neo-go/cli/flags" "github.com/nspcc-dev/neo-go/cli/options" "github.com/nspcc-dev/neo-go/pkg/encoding/address" "github.com/nspcc-dev/neo-go/pkg/rpc/client" "github.com/nspcc-dev/neo-go/pkg/smartcontract/context" "github.com/nspcc-dev/neo-go/pkg/util" "github.com/nspcc-dev/neo-go/pkg/wallet" "github.com/urfave/cli" ) // validUntilBlockIncrement is the number of extra blocks to add to an exported transaction const validUntilBlockIncrement = 50 var ( neoToken = wallet.NewToken(client.NeoContractHash, "NEO", "neo", 0) gasToken = wallet.NewToken(client.GasContractHash, "GAS", "gas", 8) ) var ( tokenFlag = cli.StringFlag{ Name: "token", Usage: "Token to use", } gasFlag = flags.Fixed8Flag{ Name: "gas", Usage: "Amount of GAS to attach to a tx", } ) func newNEP5Commands() []cli.Command { balanceFlags := []cli.Flag{ walletPathFlag, tokenFlag, cli.StringFlag{ Name: "addr", Usage: "Address to use", }, } balanceFlags = append(balanceFlags, options.RPC...) importFlags := []cli.Flag{ walletPathFlag, cli.StringFlag{ Name: "token", Usage: "Token contract hash in LE", }, } importFlags = append(importFlags, options.RPC...) transferFlags := []cli.Flag{ walletPathFlag, outFlag, fromAddrFlag, toAddrFlag, tokenFlag, gasFlag, cli.StringFlag{ Name: "amount", Usage: "Amount of asset to send", }, } transferFlags = append(transferFlags, options.RPC...) multiTransferFlags := []cli.Flag{ walletPathFlag, outFlag, fromAddrFlag, gasFlag, } multiTransferFlags = append(multiTransferFlags, options.RPC...) return []cli.Command{ { Name: "balance", Usage: "get address balance", UsageText: "balance --wallet --rpc-endpoint --timeout