Path
untyped stringPath is this realm's package path, which every denom it issues embeds.
Value
"gno.land/r/moul/x/nativeify/v0"
MinBase
untyped bigintMinBase and MaxBase bound a base denom name. The chain enforces exactly this (\`isValidBaseDenom\` in the banker stdlib): a lowercase letter, then 2 to 15 more lowercase letters or digits. Validating here rather than letting the banker abort is the difference between a usable error and a stack trace.
Value
(3 <untyped> bigint)
MaxBase
untyped bigintMinBase and MaxBase bound a base denom name. The chain enforces exactly this (\`isValidBaseDenom\` in the banker stdlib): a lowercase letter, then 2 to 15 more lowercase letters or digits. Validating here rather than letting the banker abort is the difference between a usable error and a stack trace.
Value
(16 <untyped> bigint)
pair
typeValue
v0.pair
byBase
*v0.Tree// base name -> \*pair
- OID
- 0d2f6e…2c96:4
byBase details
byKey
*v0.Tree// grc20reg key -> \*pair
- OID
- 0d2f6e…2c96:7
byKey details
bases
[]string// creation order, for a stable Render
Value
<zero>
home
.uverse.address// this realm's address: where every escrow sits
Value
<gnolang.StringValue>
init.8
func()- OID
- 0d2f6e…2c96:11
init.8 details
Home
func() .uverse.address- OID
- 0d2f6e…2c96:13
Home details
Nativeify
func(tokenKey string, base string) stringNativeify creates the native counterpart of a GRC20 registered in \`r/nt/grc20reg\`, and returns its denom. It issues nothing: [Wrap](#Wrap) does that. \`base\` is the part of the denom after the colon, yours to choose, unique in this realm and in the chain's charset. One native denom per underlying token: a second one would double the chain's per-denom storage for no new capability, and realm-denom balances live under their own store keys, which are not gas-metered.
- OID
- 0d2f6e…2c96:14
Nativeify details
Wrap
func(base string, amount int64) int64Wrap escrows \`amount\` of the underlying and issues the same number of native coins to the caller. You must \`Approve\` this realm's address on the underlying token first, through that token's own realm. Until you do, this realm has no authority over your balance at all, and Wrap fails with "insufficient allowance", which is the system working.
- OID
- 0d2f6e…2c96:15
Wrap details
Unwrap
func(base string) int64Unwrap destroys the native coins attached to this call and releases the same number of underlying GRC20 units to the caller. ### Why you have to send the coins rather than let this realm take them {#hdr-Why_you_have_to_send_the_coins_rather_than_let_this_realm_take_them} This realm holds a \`BankerTypeRealmIssue\` banker, and \`RemoveCoin\` takes an arbitrary address, so it could delete the caller's coins directly and save them a flag. It does not, and the reason is worth stating where somebody copying this will read it: a realm whose normal operation is to remove coins from addresses that did not hand them over has no way left to demonstrate that it only ever does so consensually. Every \`RemoveCoin\` here names this realm's own address, which anybody can check by reading the source, and the coins get to that address the only way a native coin ever moves, by their holder pushing them. So: attach them. -send <amount>/gno.land/r/moul/x/nativeify/v0:<base>
- OID
- 0d2f6e…2c96:16
Unwrap details
Denom
func(base string) stringDenom returns the denom this realm issues for a base name.
- OID
- 0d2f6e…2c96:17
Denom details
TokenKey
func(base string) stringTokenKey returns the grc20reg key of the underlying behind a base name.
- OID
- 0d2f6e…2c96:18
TokenKey details
Bases
func() []stringBases returns every base name this realm issues, in creation order.
- OID
- 0d2f6e…2c96:19
Bases details
Solvency
func(base string) (escrowed int64, issued int64)Solvency returns what is escrowed and what is issued for a base name. They are read from two different places on the chain, the GRC20 ledger and the bank, and this realm's own bookkeeping is not consulted for either: if they ever disagree, the disagreement is the answer.
- OID
- 0d2f6e…2c96:20
Solvency details
IsSolvent
func(base string) boolIsSolvent reports whether every coin issued for a base name is backed. It allows escrowed > issued, which is what a donation to this realm's address looks like and cannot hurt anybody, and refuses the reverse.
- OID
- 0d2f6e…2c96:21
IsSolvent details
Underlying
func(base string) *v0.TokenUnderlying returns the underlying token behind a base name, for a caller that wants its name, symbol or decimals.
- OID
- 0d2f6e…2c96:22
Underlying details
mustPair
func(base string) *v0.pair- OID
- 0d2f6e…2c96:23
mustPair details
assertBase
func(base string)assertBase applies the chain's own base-denom rule before the banker does, so the caller reads a sentence instead of a stack trace.
- OID
- 0d2f6e…2c96:24
assertBase details
Render
func(path string) stringRender lists the pairs. \`?\<base>\` shows one.
- OID
- 0d2f6e…2c96:25
Render details
renderIndex
func() string- OID
- 0d2f6e…2c96:27
renderIndex details
renderOne
func(base string) string- OID
- 0d2f6e…2c96:28