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

v1 source realm

Package tokens creates registered Launchpad GRC20 ledgers for the issuer realms listed in config. A token belongs to ...

Overview

Package tokens creates registered Launchpad GRC20 ledgers for the issuer realms listed in config. A token belongs to the issuer that created it: no other realm, and no admin, can mint into it.

Constants 1

Functions 21

func Count

Action
1func Count() int64
source

Count is the number of tokens created: ids are T1 to T<Count>, none removed.

func Create

crossing Action
1func Create(cur realm, creator address, mode, name, ticker string,
2	decimals int, initialSupply, maxSupply int64,
3	currencyKey string, expectedVersion int64,
4	description, image, website, xHandle, telegram string) string
source

Create registers exactly one new GRC20 for a listed issuer, which must authenticate the creator, reserve the launch terms and collect payment before this crossing call. The currency key names the config action currency: creation-fee currency for a direct token, quote currency for a fair sale; the issuer binds it to the corresponding payment route. The public symbol T<n> is distinct from the nonunique creator-selected ticker. The whole initial mint lands in the issuer's custody for atomic allocation and escrow setup, and the token stays bound to that issuer.

func ListTokensJSON

Action
1func ListTokensJSON(page, size int64) string
source

ListTokensJSON returns a zero-based page; page size is strictly 1..100.

func MintCapped

crossing Action
1func MintCapped(cur realm, id string, authority address, amount int64)
source

MintCapped can only be reached through the issuer that created the token. That issuer authenticates the live caller as the current mint authority and must partition the newly minted balance into recorded allocations in this same transaction. The ledger independently rechecks the authority and the immutable cap, and takes no mint while the direct lane is closed: the pauser stops every issuer here, whatever each one checks by itself.

func ProposeMintAuthority

crossing Action
1func ProposeMintAuthority(cur realm, id string, next address)
source

A capped token's authority moves only through its own two-step handoff. The issuer checks this live authority before each later mint.

func SetMetadata

crossing Action
1func SetMetadata(cur realm, id, description, image, website, xHandle, telegram string)
source

func Transfer

crossing Action
1func Transfer(cur realm, id string, to address, amount int64)
source

Standard wrappers operate only on the immediate caller's balance or allowance, accept no coins, and take an address only as the chain writes one. A realm can also move its own balance, or an allowance it holds, through the token in the registry, where the GRC20 library alone checks the receiver. A script an account runs is such a realm with the account's address, so these wrappers are an account's only way in only while the chain does not let that account submit scripts.

Types 2

type Info

struct
 1type Info struct {
 2	ID              string
 3	RegistryKey     string
 4	GRC20ID         string
 5	Issuer          address
 6	Creator         address
 7	Mode            string
 8	Name            string
 9	Ticker          string
10	Decimals        int
11	InitialSupply   int64
12	MaxSupply       int64
13	ConfigVersion   int64
14	CurrencyKey     string
15	Metadata        Metadata
16	MetadataFrozen  bool
17	MintAuthority   address
18	PendingMintAuth address
19	MintRenounced   bool
20}
source

Info excludes the private ledger capability and can be returned safely.

type Metadata

struct
1type Metadata struct {
2	Description string
3	Image       string
4	Website     string
5	XHandle     string
6	Telegram    string
7}
source

Metadata is editable only by the original creator until frozen.

Imports 11

Source Files 3