Search Apps Documentation Source Content File Folder Download Copy Actions Download

grc20helper package

Functions

Allowance

func Allowance(tokenKey string, owner, spender address) int64

Params

Command

gnokey query vm/qeval -remote "https://rpc.betanet.testnets.gno.land" -data "gno.land/r/g12vx7dn3dqq89mz550zwunvg4qw6epq73d9csay/utils/grc20helper.Allowance(,,)"

Result

Approve

func Approve(cur realm, tokenKey string, spender address, amount int64)

Approve sets an allowance owned by the immediate caller. A direct user call uses the user's allowance; a realm cross-call uses the calling realm's.

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/g12vx7dn3dqq89mz550zwunvg4qw6epq73d9csay/utils/grc20helper" -func "Approve" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast -chainid "gnoland1" -remote "https://rpc.betanet.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.betanet.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g12vx7dn3dqq89mz550zwunvg4qw6epq73d9csay/utils/grc20helper" -func "Approve" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "gnoland1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.betanet.testnets.gno.land" call.tx
  

BalanceOf

func BalanceOf(tokenKey string, account address) int64

Params

Command

gnokey query vm/qeval -remote "https://rpc.betanet.testnets.gno.land" -data "gno.land/r/g12vx7dn3dqq89mz550zwunvg4qw6epq73d9csay/utils/grc20helper.BalanceOf(,)"

Result

GetDecimals

func GetDecimals(tokenKey string) int

Param

Command

gnokey query vm/qeval -remote "https://rpc.betanet.testnets.gno.land" -data "gno.land/r/g12vx7dn3dqq89mz550zwunvg4qw6epq73d9csay/utils/grc20helper.GetDecimals()"

Result

GetName

func GetName(tokenKey string) string

Param

Command

gnokey query vm/qeval -remote "https://rpc.betanet.testnets.gno.land" -data "gno.land/r/g12vx7dn3dqq89mz550zwunvg4qw6epq73d9csay/utils/grc20helper.GetName()"

Result

GetSymbol

func GetSymbol(tokenKey string) string

Param

Command

gnokey query vm/qeval -remote "https://rpc.betanet.testnets.gno.land" -data "gno.land/r/g12vx7dn3dqq89mz550zwunvg4qw6epq73d9csay/utils/grc20helper.GetSymbol()"

Result

TotalSupply

func TotalSupply(tokenKey string) int64

Param

Command

gnokey query vm/qeval -remote "https://rpc.betanet.testnets.gno.land" -data "gno.land/r/g12vx7dn3dqq89mz550zwunvg4qw6epq73d9csay/utils/grc20helper.TotalSupply()"

Result

Transfer

func Transfer(cur realm, tokenKey string, to address, amount int64)

Transfer moves tokens owned by the immediate caller. A direct user call spends the user's balance; a realm cross-call spends the calling realm's.

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/g12vx7dn3dqq89mz550zwunvg4qw6epq73d9csay/utils/grc20helper" -func "Transfer" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast -chainid "gnoland1" -remote "https://rpc.betanet.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.betanet.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g12vx7dn3dqq89mz550zwunvg4qw6epq73d9csay/utils/grc20helper" -func "Transfer" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "gnoland1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.betanet.testnets.gno.land" call.tx
  

TransferFrom

func TransferFrom(cur realm, tokenKey string, from, to address, amount int64)

TransferFrom spends an allowance as the immediate caller. A direct user is the spender; for a realm cross-call, the calling realm is the spender.

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/g12vx7dn3dqq89mz550zwunvg4qw6epq73d9csay/utils/grc20helper" -func "TransferFrom" -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast -chainid "gnoland1" -remote "https://rpc.betanet.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.betanet.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g12vx7dn3dqq89mz550zwunvg4qw6epq73d9csay/utils/grc20helper" -func "TransferFrom" -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "gnoland1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.betanet.testnets.gno.land" call.tx