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

Functions

Approve

func Approve(cur realm, to address, tid grc721.TokenID)

Approve always fails, Settlers are soulbound.

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

BalanceOf

func BalanceOf(owner address) (int64, error)

BalanceOf returns the number of Settlers of an account, 0 or 1.

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/g17khqpukees4237dtn3astzapmp462vjhsz6st4/settlers/nft.BalanceOf()"

Result

Cap

func Cap() int

Cap returns the number of Settlers that can be minted.

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/g17khqpukees4237dtn3astzapmp462vjhsz6st4/settlers/nft.Cap()"

Result

ClearNotice

func ClearNotice(cur realm)

ClearNotice removes the current notice.

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/g17khqpukees4237dtn3astzapmp462vjhsz6st4/settlers/nft" -func "ClearNotice" -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "gnoland-1" -remote "https://rpc.gno.land" ADDRESSgnokey query -remote "https://rpc.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g17khqpukees4237dtn3astzapmp462vjhsz6st4/settlers/nft" -func "ClearNotice" -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "gnoland-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.gno.land" call.tx
  

ExternalURL

func ExternalURL(tid grc721.TokenID) string

ExternalURL returns the URL to a Settler profile page.

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/g17khqpukees4237dtn3astzapmp462vjhsz6st4/settlers/nft.ExternalURL()"

Result

GetName

func GetName() string

GetName returns the name of the collection.

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/g17khqpukees4237dtn3astzapmp462vjhsz6st4/settlers/nft.GetName()"

Result

GetSymbol

func GetSymbol() string

GetSymbol returns the symbol of the collection.

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/g17khqpukees4237dtn3astzapmp462vjhsz6st4/settlers/nft.GetSymbol()"

Result

ID

func ID() string

ID returns the ID of the collection.

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/g17khqpukees4237dtn3astzapmp462vjhsz6st4/settlers/nft.ID()"

Result

IsApprovedForAll

func IsApprovedForAll(owner, operator address) bool

IsApprovedForAll reports whether an account is allowed to move the Settler of another account. Settlers are soulbound, so it is always false.

Params

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/g17khqpukees4237dtn3astzapmp462vjhsz6st4/settlers/nft.IsApprovedForAll(,)"

Result

MerkleRoot

func MerkleRoot() string

MerkleRoot returns the Merkle root of the list of eligible accounts, in hex.

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/g17khqpukees4237dtn3astzapmp462vjhsz6st4/settlers/nft.MerkleRoot()"

Result

Mint

func Mint(cur realm, proof string) grc721.TokenID

Mint mints a Settler to the caller and returns its ID.

The proof shows that the caller is in the list of eligible accounts. Proof format is "<index>.<aunts>". Only user accounts can mint, either with a call or a run transaction, realms can't.

Param

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

Render

func Render(path string) string

Render renders the realm.

By default renders the state of the mint and the last minted Settlers.

Paths:

  • `token/{id}`: A Settler with its traits and its owner.
  • `addr/{address}`: The Settler of an account.

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/g17khqpukees4237dtn3astzapmp462vjhsz6st4/settlers/nft.Render()"

Result

SetApprovalForAll

func SetApprovalForAll(cur realm, operator address, approved bool)

SetApprovalForAll always fails, Settlers are soulbound.

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

SetNotice

func SetNotice(cur realm, alertType mdalert.Type, msg string)

SetNotice posts a realm-wide message, shown at the top of the page.

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

SetSnapshot

func SetSnapshot(cur realm, rootHex string, count int)

SetSnapshot opens the mint. It sets the Merkle root of the list of eligible accounts, in hex, and the number of accounts in the list. Only the owner can call it. It can be called again to correct a mistake until the first Settler is minted, from then on the list is frozen.

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

Token

func Token() grc721.Teller

Token returns the collection as a read-only GRC721 teller.

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/g17khqpukees4237dtn3astzapmp462vjhsz6st4/settlers/nft.Token()"

Result

TokenMetadata

func TokenMetadata(tid grc721.TokenID) (string, error)

TokenMetadata returns a JSON string with the metadata of a Settler in the format the Adena wallet can understand.

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/g17khqpukees4237dtn3astzapmp462vjhsz6st4/settlers/nft.TokenMetadata()"

Result

TokenOf

func TokenOf(addr address) grc721.TokenID

TokenOf returns the ID of the Settler of an account, or an empty ID if it has none.

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/g17khqpukees4237dtn3astzapmp462vjhsz6st4/settlers/nft.TokenOf()"

Result

TokenURI

func TokenURI(tid grc721.TokenID) (string, error)

TokenURI returns the Settler image as an SVG data URI. Wallets such as Adena read TokenURI directly as the token image, so this must be the image itself. The metadata lives in TokenMetadata.

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/g17khqpukees4237dtn3astzapmp462vjhsz6st4/settlers/nft.TokenURI()"

Result

Total

func Total() int

Total returns the number of eligible accounts in the list.

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/g17khqpukees4237dtn3astzapmp462vjhsz6st4/settlers/nft.Total()"

Result

TotalSupply

func TotalSupply() int64

TotalSupply returns the number of Settlers minted so far.

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/g17khqpukees4237dtn3astzapmp462vjhsz6st4/settlers/nft.TotalSupply()"

Result

TraitsOf

func TraitsOf(tid grc721.TokenID) (nft.Traits, error)

TraitsOf returns the traits of a Settler.

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/g17khqpukees4237dtn3astzapmp462vjhsz6st4/settlers/nft.TraitsOf()"

Result

TransferAdmin

func TransferAdmin(cur realm, newAdmin address)

TransferAdmin makes another account the admin. Only the admin can call it.

Param

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

TransferFrom

func TransferFrom(cur realm, from, to address, tid grc721.TokenID)

TransferFrom always fails, Settlers are soulbound.

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