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

nft package

Overview

Package nft holds GnoRadio's concert tickets as GRC721 NFTs. It is permanent, like the data realm: a tickets release changes the rules, never this ledger, so no ticket ever moves to a new contract.

Only the realm that writes the tickets role now (data.Writer("tickets")) mints and transfers, only while that role is not paused, and only for the wallet that signs the transaction (OriginCaller): a release can never move the ticket of a holder who signs nothing. That is the whole guarantee. The signature proves the holder sent some transaction through the tickets writer, not that they asked for this move: a malicious tickets release (it takes over only after the data realm's public 72 h window, which the guardian can cancel) could move every ticket of a holder who then signs any call to it. This realm cannot see further up the call stack. Anyone reads.

A ticket's metadata and artwork are drawn on the fly from the tickets data (art.gno), whose record layout below is frozen for that reason.

Functions

ArtistName

func ArtistName(id int) string

ArtistName is a visible artist's name, "" otherwise (one data read: the catalog's artist record, through the frozen layout).

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/nym-alexiscolin000/gnoradio/tickets/nft.ArtistName()"

Result

BalanceOf

func BalanceOf(owner address) int64

BalanceOf is how many tickets owner holds.

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/nym-alexiscolin000/gnoradio/tickets/nft.BalanceOf()"

Result

EventSVG

func EventSVG(id int) string

EventSVG is the specimen ticket of a visible concert as a markdown image, or "" when the concert is not visible.

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/nym-alexiscolin000/gnoradio/tickets/nft.EventSVG()"

Result

Mint

func Mint(cur realm, to address, id int)

Mint creates ticket id for to, the wallet that signed the transaction. The tickets writer only.

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/nym-alexiscolin000/gnoradio/tickets/nft" -func "Mint" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/nym-alexiscolin000/gnoradio/tickets/nft" -func "Mint" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx
  

Name

func Name() string

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/nym-alexiscolin000/gnoradio/tickets/nft.Name()"

Result

Render

func Render(_ string) string

Render shows the collection.

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/nym-alexiscolin000/gnoradio/tickets/nft.Render()"

Result

Symbol

func Symbol() string

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/nym-alexiscolin000/gnoradio/tickets/nft.Symbol()"

Result

TicketSVG

func TicketSVG(id int) string

TicketSVG is a ticket as a markdown image, or "" if unknown.

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/nym-alexiscolin000/gnoradio/tickets/nft.TicketSVG()"

Result

TokenURI

func TokenURI(tokenID string) string

TokenURI is a ticket's GRC721 metadata as a data URI, its artwork drawn on the fly. It panics for an unknown ticket.

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/nym-alexiscolin000/gnoradio/tickets/nft.TokenURI()"

Result

TotalSupply

func TotalSupply() int64

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/nym-alexiscolin000/gnoradio/tickets/nft.TotalSupply()"

Result

Transfer

func Transfer(cur realm, from, to address, id int)

Transfer moves ticket id from its holder from to to. The tickets writer only, and only in a transaction from signed: no release moves the tickets of a holder who signs nothing (see the package comment for what a malicious release could still do). The rules decide who may gift.

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/nym-alexiscolin000/gnoradio/tickets/nft" -func "Transfer" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/nym-alexiscolin000/gnoradio/tickets/nft" -func "Transfer" -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 "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx