package wallet import ( "encoding/hex" "errors" "fmt" "slices" "strconv" "github.com/nspcc-dev/neo-go/cli/cmdargs" "github.com/nspcc-dev/neo-go/cli/flags" "github.com/nspcc-dev/neo-go/cli/options" "github.com/nspcc-dev/neo-go/cli/txctx" "github.com/nspcc-dev/neo-go/pkg/config" "github.com/nspcc-dev/neo-go/pkg/encoding/address" "github.com/nspcc-dev/neo-go/pkg/neorpc/result" "github.com/nspcc-dev/neo-go/pkg/rpcclient" "github.com/nspcc-dev/neo-go/pkg/rpcclient/nep11" "github.com/nspcc-dev/neo-go/pkg/smartcontract/manifest" "github.com/nspcc-dev/neo-go/pkg/util" "github.com/nspcc-dev/neo-go/pkg/vm/stackitem" "github.com/nspcc-dev/neo-go/pkg/wallet" "github.com/urfave/cli/v2" ) func newNEP11Commands() []*cli.Command { maxIters := strconv.Itoa(config.DefaultMaxIteratorResultItems) tokenAddressFlag := &flags.AddressFlag{ Name: "token", Usage: "Token contract address or hash in LE", Required: true, } ownerAddressFlag := &flags.AddressFlag{ Name: "address", Usage: "NFT owner address or hash in LE", Required: true, } tokenID := &cli.StringFlag{ Name: "id", Usage: "Hex-encoded token ID", } balanceFlags := slices.Clone(baseBalanceFlags) balanceFlags = append(balanceFlags, tokenID) balanceFlags = append(balanceFlags, options.RPC...) transferFlags := slices.Clone(baseTransferFlags) transferFlags = append(transferFlags, tokenID) transferFlags = append(transferFlags, options.RPC...) return []*cli.Command{ { Name: "balance", Usage: "Get address balance", UsageText: "balance -w wallet [--wallet-config path] --rpc-endpoint [--timeout