Search Apps Documentation Source Content File Folder Download Copy Actions Download

transfer package

Functions

GRC20Alias

func GRC20Alias(grc20regKey string) string

GRC20Alias returns a slash-free alias for a GRC20 denom (grc20reg key) by replacing "/" with ":". This is safe because grc20reg slugs are alphanumeric (enforced by grc20reg.Register), so colons never appear in grc20reg keys, making the replacement reversible. Examples:

Example
1"gno.land/r/demo/foo"      → "gno.land:r:demo:foo"
2"gno.land/r/demo/foo.FOO"  → "gno.land:r:demo:foo.FOO"

Param

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/aib/ibc/apps/transfer.GRC20Alias()"

Result

Render

func Render(path string) string

Param

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/aib/ibc/apps/transfer.Render()"

Result

Transfer

func Transfer(cur realm, clientID, receiver, denom string, amount int64, timeoutTimestamp uint64, memo string) ( packet types.MsgSendPacket, sequence uint64, )

Transfer is the entry point for sending tokens to another chain using the IBC protocol. It supports three token types, detected automatically from the denom argument:

  • IBC voucher (denom starts with "ibc/"): burns the voucher GRC20 token.
  • Non-IBC GRC20 token (registered in grc20reg): escrows via TransferFrom.
  • Native coin (everything else): the coin must be sent with the transaction via the send field, and must match denom and amount.

memo is included in the IBC packet payload.

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/aib/ibc/apps/transfer" -func "Transfer" -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "test-13" -remote "https://rpc.test13.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test13.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/aib/ibc/apps/transfer" -func "Transfer" -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test-13" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test13.testnets.gno.land" call.tx
  

VoucherApprove

func VoucherApprove(cur realm, ibcDenom string, spender address, amount int64)

VoucherApprove is a convenience helper to set a spender allowance for an IBC voucher token on behalf of the caller.

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/aib/ibc/apps/transfer" -func "VoucherApprove" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "test-13" -remote "https://rpc.test13.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test13.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/aib/ibc/apps/transfer" -func "VoucherApprove" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test-13" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test13.testnets.gno.land" call.tx
  

VoucherBalanceOf

func VoucherBalanceOf(ibcDenom string, addr address) int64

VoucherBalanceOf returns the balance of a voucher token for a given address. Returns 0 if the token does not exist.

Params

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/aib/ibc/apps/transfer.VoucherBalanceOf(,)"

Result

VoucherSend

func VoucherSend(cur realm, ibcDenom string, to address, amount int64)

VoucherSend is a convenience helper to send an IBC voucher token from the caller to the provided recipient.

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/aib/ibc/apps/transfer" -func "VoucherSend" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "test-13" -remote "https://rpc.test13.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test13.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/aib/ibc/apps/transfer" -func "VoucherSend" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test-13" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test13.testnets.gno.land" call.tx
  

ExtractDenomFromPath

func ExtractDenomFromPath(fullPath string) Denom

ExtractDenomFromPath returns the denom from the full path.

Param

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/aib/ibc/apps/transfer.ExtractDenomFromPath()"

Result

NewDenom

func NewDenom(base string, trace ...Hop) Denom

NewDenom creates a new Denom instance given the base denomination and a variable number of hops.

Params

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/aib/ibc/apps/transfer.NewDenom(,)"

Result

NewFungibleTokenPacketData

func NewFungibleTokenPacketData( denom string, amount string, sender, receiver string, memo string, ) FungibleTokenPacketData

NewFungibleTokenPacketData constructs a new FungibleTokenPacketData instance

Params

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/aib/ibc/apps/transfer.NewFungibleTokenPacketData(,,,,)"

Result

NewHop

func NewHop(portID, clientID string) Hop

NewHop creates a Hop with the given port ID and client ID.

Params

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/aib/ibc/apps/transfer.NewHop(,)"

Result

NewToken

func NewToken(baseDenom, amount string) Token

NewToken constructs a Token with the given native base denom and amount (no trace, no prefix hops). Provided so external callers — which cannot construct foreign-stamped composite literals under v2 borrow rule #1 — can still build Token values for tests and packet assembly.

Params

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/aib/ibc/apps/transfer.NewToken(,)"

Result