Search Apps Documentation Source Content File Folder Download Copy Actions Download

tokenhub package

Functions

GetAllMultiTokens

func GetAllMultiTokens() string

GetAllMultiTokens returns a string of all the multi-tokens registered

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/matijamarjanovic/tokenhub.GetAllMultiTokens()"

Result

GetAllNFTs

func GetAllNFTs() string

GetAllNFTs returns a string of all the NFTs registered

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/matijamarjanovic/tokenhub.GetAllNFTs()"

Result

GetAllRegistered

func GetAllRegistered() string

GetAllRegistered returns a string of all the registered tokens, NFTs and multi-tokens

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/matijamarjanovic/tokenhub.GetAllRegistered()"

Result

GetAllTokenWithDetails

func GetAllTokenWithDetails() string

GetAllTokenWithDetails returns a string of all the tokens registered with their details

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/matijamarjanovic/tokenhub.GetAllTokenWithDetails()"

Result

GetAllTokens

func GetAllTokens() string

GetAllTokens returns a string of all the tokens registered

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/matijamarjanovic/tokenhub.GetAllTokens()"

Result

GetMultiToken

func GetMultiToken(key string) grc1155.IGRC1155

GetMultiToken returns a multi-token instance for a given key

Param

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/matijamarjanovic/tokenhub.GetMultiToken()"

Result

GetNFT

func GetNFT(key string) grc721.IGRC721

GetNFT returns an NFT instance for a given key

Param

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/matijamarjanovic/tokenhub.GetNFT()"

Result

GetToken

func GetToken(key string) *grc20.Token

GetToken returns a token instance for a given key

Param

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/matijamarjanovic/tokenhub.GetToken()"

Result

GetUserMultiTokenBalances

func GetUserMultiTokenBalances(userNameOrAddress string) string

GetUserMultiTokenBalances returns a string of all the multi-tokens the user owns

Param

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/matijamarjanovic/tokenhub.GetUserMultiTokenBalances()"

Result

GetUserMultiTokenBalancesNonZero

func GetUserMultiTokenBalancesNonZero(userNameOrAddress string) string

GetUserMultiTokenBalancesNonZero returns a string of all the multi-tokens the user owns, but only the ones that have a balance greater than 0

Param

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/matijamarjanovic/tokenhub.GetUserMultiTokenBalancesNonZero()"

Result

GetUserNFTBalances

func GetUserNFTBalances(userNameOrAddress string) string

GetUserNFTBalances returns a string of all the NFTs the user owns

Param

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/matijamarjanovic/tokenhub.GetUserNFTBalances()"

Result

GetUserTokenBalances

func GetUserTokenBalances(userNameOrAddress string) string

GetUserTokenBalances returns a string of all the grc20 tokens the user owns

Param

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/matijamarjanovic/tokenhub.GetUserTokenBalances()"

Result

GetUserTokenBalancesNonZero

func GetUserTokenBalancesNonZero(userNameOrAddress string) string

GetUserTokenBalancesNonZero returns a string of all the grc20 tokens the user owns, but only the ones that have a balance greater than 0

Param

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/matijamarjanovic/tokenhub.GetUserTokenBalancesNonZero()"

Result

MustGetMultiToken

func MustGetMultiToken(key string) grc1155.IGRC1155

MustGetMultiToken returns a multi-token instance for a given key, panics if the multi-token is not found

Param

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/matijamarjanovic/tokenhub.MustGetMultiToken()"

Result

MustGetNFT

func MustGetNFT(key string) grc721.IGRC721

MustGetNFT returns an NFT instance for a given key, panics if the NFT is not found

Param

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/matijamarjanovic/tokenhub.MustGetNFT()"

Result

MustGetToken

func MustGetToken(key string) *grc20.Token

MustGetToken returns a token instance for a given key, panics if the token is not found

Param

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/matijamarjanovic/tokenhub.MustGetToken()"

Result

RegisterMultiToken

func RegisterMultiToken(cur realm, mtGetter grc1155.MultiTokenGetter, tokenID string) error

RegisterMultiToken is a function that registers a multi-token in an avl.Tree The avl.Tree value is a struct defined in this realm. It contains not only the getter (like other token types) but also the tokenID

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/matijamarjanovic/tokenhub" -func "RegisterMultiToken" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "dev" -remote "https://api.gno.berty.io:443" ADDRESSgnokey query -remote "https://api.gno.berty.io:443" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/matijamarjanovic/tokenhub" -func "RegisterMultiToken" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "dev" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://api.gno.berty.io:443" call.tx
  

RegisterNFT

func RegisterNFT(cur realm, nftGetter grc721.NFTGetter, collection string, tokenId string) error

RegisterNFT is a function that registers an NFT in an avl.Tree

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/matijamarjanovic/tokenhub" -func "RegisterNFT" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "dev" -remote "https://api.gno.berty.io:443" ADDRESSgnokey query -remote "https://api.gno.berty.io:443" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/matijamarjanovic/tokenhub" -func "RegisterNFT" -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 "dev" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://api.gno.berty.io:443" call.tx
  

RegisterToken

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

RegisterToken is a function that uses gno.land/r/demo/defi/grc20reg to register a token RegisterToken registers a token in grc20reg with the given slug. Returns the registry key that can be used to retrieve the token.

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/matijamarjanovic/tokenhub" -func "RegisterToken" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "dev" -remote "https://api.gno.berty.io:443" ADDRESSgnokey query -remote "https://api.gno.berty.io:443" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/matijamarjanovic/tokenhub" -func "RegisterToken" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "dev" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://api.gno.berty.io:443" call.tx
  

Render

func Render(path string) string

Param

Command

gnokey query vm/qeval -remote "https://api.gno.berty.io:443" -data "gno.land/r/matijamarjanovic/tokenhub.Render()"

Result