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

gnft package

Overview

Package gnft implements the position-NFT surface used by GnoSwap.

It provides GRC721-compatible ownership, transfer, approval, and metadata operations for LP positions. Generated parameter-format URIs become SVG data URIs on read; custom non-empty URIs are returned unchanged. Enumeration and safeTransferFrom are not exposed by this package.

Function

SetTokenURI

func SetTokenURI(cur realm, tid grc721.TokenID, tURI string) (bool, error)

SetTokenURI sets the metadata URI for the specified token.

Parameters:

  • cur: Current realm context; callers use cross(cur) when crossing into this realm.
  • tid: token ID whose metadata URI is replaced
  • tURI: non-empty metadata URI or parameter-format image description

Returns:

  • updated: true after the URI is stored and re-read successfully
  • error: nil on success; validation and storage failures panic before a non-nil error can be returned

Only callable by position contract.

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/gnoswap/gnft" -func "SetTokenURI" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "gnoland-1" -remote "http://127.0.0.1:26657" ADDRESSgnokey query -remote "http://127.0.0.1:26657" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/gnft" -func "SetTokenURI" -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 "http://127.0.0.1:26657" call.tx