Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

grc20reg/v0 package

Functions

Approve

func Approve(_ int, rlm realm, tokenKey string, spender address, amount int64)

Approve sets an allowance owned by the CALLING REALM, letting `spender` draw on the calling realm's balance. It does not touch the signing user's allowances.

Params

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/nt/grc20reg/v0.Approve(,,,,)"

Result

Get

func Get(key string) *grc20.Token

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/nt/grc20reg/v0.Get()"

Result

GetRegistry

func GetRegistry() *rotree.ReadOnlyTree

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/nt/grc20reg/v0.GetRegistry()"

Result

MustGet

func MustGet(key string) *grc20.Token

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/nt/grc20reg/v0.MustGet()"

Result

Register

func Register(cur realm, token *grc20.Token, slug string) string

Register records token under its rlmPath.symbol key and returns that key. Token.ID() carries a trailing sequence id (rlmPath.symbol.<id>) that keeps token identities/events unique, but the registry deliberately keys by rlmPath.symbol so lookups don't need to know the id, and so a realm cannot register two tokens under the same symbol (overwrite/alias guard).

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/nt/grc20reg/v0" -func "Register" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "gnoland-1" -remote "https://rpc.gno.land" ADDRESSgnokey query -remote "https://rpc.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/nt/grc20reg/v0" -func "Register" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "gnoland-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.gno.land" call.tx
  

Render

func Render(path string) string

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/nt/grc20reg/v0.Render()"

Result

Transfer

func Transfer(_ int, rlm realm, tokenKey string, to address, amount int64)

Transfer moves `amount` out of the CALLING REALM's own balance.

Call it non-crossing, forwarding your own `cur`:

Example
1grc20reg.Transfer(0, cur, "gno.land/r/demo/defi/foo20.FOO", to, 100)

Params

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/nt/grc20reg/v0.Transfer(,,,,)"

Result

TransferFrom

func TransferFrom(_ int, rlm realm, tokenKey string, from, to address, amount int64)

TransferFrom spends an allowance with the CALLING REALM as the spender.

Note the allowance direction this implies: `from` must have approved the calling realm, not the signing user. That is the supported way for a realm to move a user's funds — the user grants the realm an allowance, and the realm draws on it as itself, so every debit is one the owner authorized against that specific realm.

Params

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/nt/grc20reg/v0.TransferFrom(,,,,,)"

Result