package wallet import ( "errors" "fmt" "math/big" "strings" "github.com/nspcc-dev/neo-go/cli/flags" "github.com/nspcc-dev/neo-go/cli/options" "github.com/nspcc-dev/neo-go/cli/paramcontext" "github.com/nspcc-dev/neo-go/pkg/encoding/address" "github.com/nspcc-dev/neo-go/pkg/encoding/fixedn" "github.com/nspcc-dev/neo-go/pkg/rpc/client" "github.com/nspcc-dev/neo-go/pkg/util" "github.com/nspcc-dev/neo-go/pkg/wallet" "github.com/urfave/cli" ) var ( tokenFlag = cli.StringFlag{ Name: "token", Usage: "Token to use (hash or name (for NEO/GAS or imported tokens))", } gasFlag = flags.Fixed8Flag{ Name: "gas", Usage: "Amount of GAS to attach to a tx", } ) func newNEP17Commands() []cli.Command { balanceFlags := []cli.Flag{ walletPathFlag, tokenFlag, cli.StringFlag{ Name: "address, a", 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