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

transfer state

Back to all declarations

App

type

Value

transfer.App

PortID

untyped string

Value

"transfer"

V1

untyped string

Value

"ics20-1"

EncodingProtobuf

untyped string

Value

"application/x-protobuf"

denomPrefix

untyped string

Value

"ibc"

escrowAddressVersion

untyped string

Value

"ics20-1"

consumePendingVoucherSend

func(sender string, sourceClient string, denom string, amount int64) .uverse.error
Open
OID
0ab808…9bb6:5
consumePendingVoucherSend details

Inspect func

consumePendingGRC20Send

func(sender string, sourceClient string, denom string, amount int64) .uverse.error
Open
OID
0ab808…9bb6:6
consumePendingGRC20Send details

Inspect func

validatePendingSend

func(expected *transfer.pendingSend, sender string, sourceClient string, denom string, amount int64) .uverse.error
Open
OID
0ab808…9bb6:7
validatePendingSend details

Inspect func

validateBaseDenomNoSlash

func(token transfer.Token) .uverse.error

validateBaseDenomNoSlash rejects base denominations containing a slash. IBC v2 packets do not carry channel identifiers, so denomination traces cannot be unambiguously separated from a slashed base denomination.

Open
OID
0ab808…9bb6:8
validateBaseDenomNoSlash details

Inspect func

unmarshalPayload

func(bz []uint8) (transfer.FungibleTokenPacketData, transfer.Token, .uverse.error)
Open
OID
0ab808…9bb6:9
unmarshalPayload details

Inspect func

Denom

type

Denom holds the base denom of a Token and a trace of the chains it was sent through.

Value

transfer.Denom

NewDenom

func(base string, trace []transfer.Hop) transfer.Denom

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

Open
OID
0ab808…9bb6:10
NewDenom details

Inspect func

ExtractDenomFromPath

func(fullPath string) transfer.Denom

ExtractDenomFromPath returns the denom from the full path.

Open
OID
0ab808…9bb6:12
ExtractDenomFromPath details

Inspect func

Hop

type

Hop defines a port ID, client ID pair specifying a unique "hop" in a trace

Value

transfer.Hop

NewHop

func(portID string, clientID string) transfer.Hop

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

Open
OID
0ab808…9bb6:13
NewHop details

Inspect func

EventTypeTimeout

untyped string

IBC transfer events

Value

"timeout"

EventTypePacket

untyped string

IBC transfer events

Value

"fungible_token_packet"

EventTypeTransfer

untyped string

IBC transfer events

Value

"ibc_transfer"

EventTypeDenom

untyped string

IBC transfer events

Value

"denomination"

AttributeKeySender

untyped string

IBC transfer events

Value

"sender"

AttributeKeyReceiver

untyped string

IBC transfer events

Value

"receiver"

AttributeKeyDenom

untyped string

IBC transfer events

Value

"denom"

AttributeKeyDenomHash

untyped string

IBC transfer events

Value

"denom_hash"

AttributeKeyAmount

untyped string

IBC transfer events

Value

"amount"

AttributeKeyRefundReceiver

untyped string

IBC transfer events

Value

"refund_receiver"

AttributeKeyRefundTokens

untyped string

IBC transfer events

Value

"refund_tokens"

AttributeKeyAckSuccess

untyped string

IBC transfer events

Value

"success"

AttributeKeyAck

untyped string

IBC transfer events

Value

"acknowledgement"

AttributeKeyAckError

untyped string

IBC transfer events

Value

"error"

AttributeKeyMemo

untyped string

IBC transfer events

Value

"memo"

FungibleTokenPacketData

type

FungibleTokenPacketData defines a struct for the packet payload See FungibleTokenPacketData spec: [https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures](https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures)

Value

transfer.FungibleTokenPacketData

NewFungibleTokenPacketData

func(denom string, amount string, sender string, receiver string, memo string) transfer.FungibleTokenPacketData

NewFungibleTokenPacketData constructs a new FungibleTokenPacketData instance

Open
OID
0ab808…9bb6:14
NewFungibleTokenPacketData details

Inspect func

transferRealmPath

untyped string

transferRealmPath is the package path of this realm; used to compute per-voucher GRC20 registry keys. Hardcoded because we cannot read it from runtime.CurrentRealm() in v2 without the unsafe package, and Render needs it from a non-crossing render handler.

Value

"gno.land/r/aib/ibc/apps/transfer"

renderHome

func(w *v0.ResponseWriter, r *v0.Request)
Open
OID
0ab808…9bb6:18
renderHome details

Inspect func

renderDenoms

func(w *v0.ResponseWriter, r *v0.Request)
Open
OID
0ab808…9bb6:19
renderDenoms details

Inspect func

renderDenom

func(w *v0.ResponseWriter, r *v0.Request)
Open
OID
0ab808…9bb6:20
renderDenom details

Inspect func

renderTotalEscrowForDenom

func(w *v0.ResponseWriter, r *v0.Request)
Open
OID
0ab808…9bb6:21
renderTotalEscrowForDenom details

Inspect func

renderVouchers

func(w *v0.ResponseWriter, r *v0.Request)
Open
OID
0ab808…9bb6:22
renderVouchers details

Inspect func

renderVoucher

func(w *v0.ResponseWriter, r *v0.Request)
Open
OID
0ab808…9bb6:23
renderVoucher details

Inspect func

renderVoucherBalance

func(w *v0.ResponseWriter, r *v0.Request)
Open
OID
0ab808…9bb6:24
renderVoucherBalance details

Inspect func

denomsByClientOrder

func() []transfer.Denom

denomsByClientOrder returns the stored voucher denoms ordered to match the "Pick the client" listing (core.ClientIDs() order): each voucher is grouped under its source client (Trace\[0].ClientId), following the same client order as the client list, so the vouchers table lines up with it. Within a client, the underlying b+tree order is preserved. Denoms whose source client is not (or no longer) registered are appended last, in b+tree order, so nothing is dropped. Every stored denom is a minted voucher with a non-empty trace, so Trace\[0] is always safe to read.

Open
OID
0ab808…9bb6:25
denomsByClientOrder details

Inspect func

stripDomain

func(path string) string

stripDomain removes the domain from a gno pkg path for use in URLs. "gno.land/r/demo/foo" → "/r/demo/foo"

Open
OID
0ab808…9bb6:30
stripDomain details

Inspect func

shortDenom

func(ibcDenom string) string

shortDenom shortens an IBC denom hash for display. "ibc/CAEF9CABC…9D0F" (ibc/ + first 4 + … + last 4)

Open
OID
0ab808…9bb6:31
shortDenom details

Inspect func

renderNode

func(w *v0.ResponseWriter, n *json.Node)
Open
OID
0ab808…9bb6:32
renderNode details

Inspect func

grc20regKey

func(ibcDenom string) string

grc20regKey returns the grc20reg key for a voucher ibc denom. e.g. "ibc/CAEF9C..." → "gno.land/r/aib/ibc/apps/transfer.CAEF9C..."

Open
OID
0ab808…9bb6:33
grc20regKey details

Inspect func

nodeError

func(msg string, args []interface{...}) *json.Node
Open
OID
0ab808…9bb6:34
nodeError details

Inspect func

totalEscrow

*v0.BPTree

// denom:chain.Coin

Open
OID
0ab808…9bb6:71
totalEscrow details

Inspect pointer

voucherTokens

*v0.BPTree

// ibcDenom:\*voucher

Open
OID
0ab808…9bb6:73
voucherTokens details

Inspect pointer

nextVoucherID

v0.ID

Value

<zero>

voucher

type

voucher holds a voucher token and its private ledger for mint/burn.

Value

transfer.voucher

hasDenom

func(voucherDenom string) bool
Open
OID
0ab808…9bb6:41
hasDenom details

Inspect func

setDenom

func(denom transfer.Denom)
Open
OID
0ab808…9bb6:42
setDenom details

Inspect func

getDenom

func(ibcDenom string) (transfer.Denom, bool)
Open
OID
0ab808…9bb6:43
getDenom details

Inspect func

addEscrowForDenom

func(c chain.Coin)
Open
OID
0ab808…9bb6:44
addEscrowForDenom details

Inspect func

subEscrowForDenom

func(c chain.Coin)
Open
OID
0ab808…9bb6:45
subEscrowForDenom details

Inspect func

VoucherSymbol

func(ibcDenom string) string

VoucherSymbol returns the grc20 token symbol for an IBC voucher denom: the IBC hash truncated to grc20's MaxSymbolLen. The full voucherDenom ("ibc/\<64-hex- hash>") can't be a symbol because v2 grc20 enforces MaxSymbolLen and \[A-Za-z0-9\_-] only. Since grc20reg keys tokens by rlmpath.symbol, this is also the symbol component of a voucher's registry key, so callers locate a voucher via grc20reg.Get(\<this realm's pkgpath> + "." + VoucherSymbol(ibcDenom)).

Open
OID
0ab808…9bb6:46
VoucherSymbol details

Inspect func

getOrCreateVoucher

func(int, rlm .uverse.realm, baseDenom string, voucherDenom string) *transfer.voucher

getOrCreateVoucher returns the existing voucher instance for the given IBC denom, or creates a new one and registers it in grc20reg for DeFi discoverability. Non-crossing helper; rlm is needed to issue the cross call into grc20reg.Register from this realm's frame. The token symbol is a truncated IBC hash (see VoucherSymbol); its name is the base denom, and nextVoucherID keeps each token's grc20 id distinct. grc20reg keys the token by rlmpath.symbol (not the slug), so the full-hash slug is retained only as event metadata. Because the key is the truncated symbol, two vouchers whose hashes share an 11-char prefix would collide on the registry key (astronomically unlikely, but no longer guarded by the slug).

Open
OID
0ab808…9bb6:47
getOrCreateVoucher details

Inspect func

getVoucher

func(ibcDenom string) *transfer.voucher

getVoucher returns the voucher instance for the given IBC denom, or nil if not found.

Open
OID
0ab808…9bb6:48
getVoucher details

Inspect func

VoucherBalanceOf

func(ibcDenom string, addr .uverse.address) int64

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

Open
OID
0ab808…9bb6:49
VoucherBalanceOf details

Inspect func

GRC20Alias

func(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: "gno.land/r/demo/foo" → "gno.land:r:demo:foo" "gno.land/r/demo/foo.FOO" → "gno.land:r:demo:foo.FOO"

Open
OID
0ab808…9bb6:50
GRC20Alias details

Inspect func

resolveGRC20Alias

func(alias string) string

resolveGRC20Alias converts a GRC20 alias back to the grc20reg key by replacing ":" with "/".

Open
OID
0ab808…9bb6:51
resolveGRC20Alias details

Inspect func

isGRC20Alias

func(denom string) bool

isGRC20Alias returns true if the denom is a GRC20 alias. GRC20 aliases always start with "gno.land:" (the colon form of "gno.land/").

Open
OID
0ab808…9bb6:52
isGRC20Alias details

Inspect func

Token

type

Token defines a struct which represents a token to be transferred.

Value

transfer.Token

NewToken

func(baseDenom string, amount string) transfer.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.

Open
OID
0ab808…9bb6:53
NewToken details

Inspect func

Transfer

func(clientID string, receiver string, 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.

Open
OID
0ab808…9bb6:55
Transfer details

Inspect func

VoucherSend

func(ibcDenom string, to .uverse.address, amount int64)

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

Open
OID
0ab808…9bb6:57
VoucherSend details

Inspect func

VoucherApprove

func(ibcDenom string, spender .uverse.address, amount int64)

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

Open
OID
0ab808…9bb6:58
VoucherApprove details

Inspect func

transfer

func(clientID string, receiver string, denom string, amount int64, timeoutTimestamp uint64, memo string) (packet types.MsgSendPacket, sequence uint64)
Open
OID
0ab808…9bb6:59
transfer details

Inspect func

refundPacketToken

func(int, rlm .uverse.realm, sourcePort string, sourceClient string, sender string, token transfer.Token) .uverse.error

refundPacketToken is a non-crossing helper; rlm is the caller's live cur, needed only by unescrowNative which constructs a Banker.

Open
OID
0ab808…9bb6:60
refundPacketToken details

Inspect func

unescrowGRC20

func(int, rlm .uverse.realm, receiver string, coin chain.Coin) .uverse.error

unescrowGRC20 resolves the GRC20 alias and transfers the escrowed tokens back to the receiver via the token's RealmTeller. Non-crossing helper; rlm is needed by the grc20 teller API.

Open
OID
0ab808…9bb6:61
unescrowGRC20 details

Inspect func

unescrowNative

func(int, rlm .uverse.realm, receiver string, coin chain.Coin) .uverse.error

unescrowNative sends the escrowed native coins back to the receiver via the banker. Non-crossing helper; rlm is the caller's live cur (transfer realm's own frame), needed to construct a Banker.

Open
OID
0ab808…9bb6:62
unescrowNative details

Inspect func

pendingSend

type

pendingSend records the token send that Transfer authorized for OnSendPacket.

Value

transfer.pendingSend

pendingNativeEscrow

*chain.Coin

Gno persists package-level vars to the realm store at end of tx. These pending values must be cleared before Transfer returns to avoid leaking state into the next tx. Transfer uses defers to guarantee the reset on every exit path.

Value

<zero>

pendingVoucherSend

*transfer.pendingSend

Gno persists package-level vars to the realm store at end of tx. These pending values must be cleared before Transfer returns to avoid leaking state into the next tx. Transfer uses defers to guarantee the reset on every exit path.

Value

<zero>

pendingGRC20Send

*transfer.pendingSend

Gno persists package-level vars to the realm store at end of tx. These pending values must be cleared before Transfer returns to avoid leaking state into the next tx. Transfer uses defers to guarantee the reset on every exit path.

Value

<zero>
App : type =transfer.App
PortID : untyped string ="transfer"
V1 : untyped string ="ics20-1"
EncodingProtobuf : untyped string ="application/x-protobuf"
denomPrefix : untyped string ="ibc"
escrowAddressVersion : untyped string ="ics20-1"
init.6 : func() Inspect
consumePendingVoucherSend : func(sender string, sourceClient string, denom string, amount int64) .uverse.error Inspect
consumePendingGRC20Send : func(sender string, sourceClient string, denom string, amount int64) .uverse.error Inspect
validatePendingSend : func(expected *transfer.pendingSend, sender string, sourceClient string, denom string, amount int64) .uverse.error Inspect
validateBaseDenomNoSlash : func(token transfer.Token) .uverse.error Inspect
unmarshalPayload : func(bz []uint8) (transfer.FungibleTokenPacketData, transfer.Token, .uverse.error) Inspect
Denom : type =transfer.Denom
NewDenom : func(base string, trace []transfer.Hop) transfer.Denom Inspect
ExtractDenomFromPath : func(fullPath string) transfer.Denom Inspect
Hop : type =transfer.Hop
NewHop : func(portID string, clientID string) transfer.Hop Inspect
EventTypeTimeout : untyped string ="timeout"
EventTypePacket : untyped string ="fungible_token_packet"
EventTypeTransfer : untyped string ="ibc_transfer"
EventTypeDenom : untyped string ="denomination"
AttributeKeySender : untyped string ="sender"
AttributeKeyReceiver : untyped string ="receiver"
AttributeKeyDenom : untyped string ="denom"
AttributeKeyDenomHash : untyped string ="denom_hash"
AttributeKeyAmount : untyped string ="amount"
AttributeKeyRefundReceiver : untyped string ="refund_receiver"
AttributeKeyRefundTokens : untyped string ="refund_tokens"
AttributeKeyAckSuccess : untyped string ="success"
AttributeKeyAck : untyped string ="acknowledgement"
AttributeKeyAckError : untyped string ="error"
AttributeKeyMemo : untyped string ="memo"
FungibleTokenPacketData : type =transfer.FungibleTokenPacketData
NewFungibleTokenPacketData : func(denom string, amount string, sender string, receiver string, memo string) transfer.FungibleTokenPacketData Inspect
transferRealmPath : untyped string ="gno.land/r/aib/ibc/apps/transfer"
Render : func(path string) string Inspect
renderHome : func(w *v0.ResponseWriter, r *v0.Request) Inspect
renderDenoms : func(w *v0.ResponseWriter, r *v0.Request) Inspect
renderDenom : func(w *v0.ResponseWriter, r *v0.Request) Inspect
renderTotalEscrowForDenom : func(w *v0.ResponseWriter, r *v0.Request) Inspect
renderVouchers : func(w *v0.ResponseWriter, r *v0.Request) Inspect
renderVoucher : func(w *v0.ResponseWriter, r *v0.Request) Inspect
renderVoucherBalance : func(w *v0.ResponseWriter, r *v0.Request) Inspect
denomsByClientOrder : func() []transfer.Denom Inspect
stripDomain : func(path string) string Inspect
shortDenom : func(ibcDenom string) string Inspect
renderNode : func(w *v0.ResponseWriter, n *json.Node) Inspect
grc20regKey : func(ibcDenom string) string Inspect
nodeError : func(msg string, args []interface{...}) *json.Node Inspect
denoms : *v0.BPTree Inspect
totalEscrow : *v0.BPTree Inspect
voucherTokens : *v0.BPTree Inspect
nextVoucherID : v0.ID =<zero>
voucher : type =transfer.voucher
init.58 : func() Inspect
hasDenom : func(voucherDenom string) bool Inspect
setDenom : func(denom transfer.Denom) Inspect
getDenom : func(ibcDenom string) (transfer.Denom, bool) Inspect
addEscrowForDenom : func(c chain.Coin) Inspect
subEscrowForDenom : func(c chain.Coin) Inspect
VoucherSymbol : func(ibcDenom string) string Inspect
getOrCreateVoucher : func(int, rlm .uverse.realm, baseDenom string, voucherDenom string) *transfer.voucher Inspect
getVoucher : func(ibcDenom string) *transfer.voucher Inspect
VoucherBalanceOf : func(ibcDenom string, addr .uverse.address) int64 Inspect
GRC20Alias : func(grc20regKey string) string Inspect
resolveGRC20Alias : func(alias string) string Inspect
isGRC20Alias : func(denom string) bool Inspect
Token : type =transfer.Token
NewToken : func(baseDenom string, amount string) transfer.Token Inspect
Transfer : func(clientID string, receiver string, denom string, amount int64, timeoutTimestamp uint64, memo string) (packet types.MsgSendPacket, sequence uint64) Inspect
VoucherSend : func(ibcDenom string, to .uverse.address, amount int64) Inspect
VoucherApprove : func(ibcDenom string, spender .uverse.address, amount int64) Inspect
transfer : func(clientID string, receiver string, denom string, amount int64, timeoutTimestamp uint64, memo string) (packet types.MsgSendPacket, sequence uint64) Inspect
refundPacketToken : func(int, rlm .uverse.realm, sourcePort string, sourceClient string, sender string, token transfer.Token) .uverse.error Inspect
unescrowGRC20 : func(int, rlm .uverse.realm, receiver string, coin chain.Coin) .uverse.error Inspect
unescrowNative : func(int, rlm .uverse.realm, receiver string, coin chain.Coin) .uverse.error Inspect
pendingSend : type =transfer.pendingSend
pendingNativeEscrow : *chain.Coin =<zero>
pendingVoucherSend : *transfer.pendingSend =<zero>
pendingGRC20Send : *transfer.pendingSend =<zero>