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 state

Back to all declarations

assertIsValidTokenURI

func(tid grc721.TokenID)

assertIsValidTokenURI panics if the token already has a URI set.

Open
OID
060c55…3242:3
assertIsValidTokenURI details

Inspect func

assertIsValidAddress

func(addr .uverse.address)

assertIsValidAddress panics if the address is invalid.

Open
OID
060c55…3242:5
assertIsValidAddress details

Inspect func

assertFromIsValidAddress

func(from .uverse.address)

assertFromIsValidAddress panics if the from address is invalid.

Open
OID
060c55…3242:6
assertFromIsValidAddress details

Inspect func

assertToIsValidAddress

func(to .uverse.address)

assertToIsValidAddress panics if the to address is invalid.

Open
OID
060c55…3242:7
assertToIsValidAddress details

Inspect func

assertIsAllowedTransfer

func(caller .uverse.address, tid grc721.TokenID)

assertIsAllowedTransfer enforces that NFTs held by the staker (i.e. currently staked) can only be moved by the staker itself. Other tokens fall through to the standard GRC721 owner/approval checks performed inside nft.

Open
OID
060c55…3242:8
assertIsAllowedTransfer details

Inspect func

errCannotSetURI

untyped string

Value

"[GNOSWAP-GNFT-001] cannot set URI"

errInvalidAddress

untyped string

Value

"[GNOSWAP-GNFT-002] invalid address"

errNotOwnerOrApproved

untyped string

Value

"[GNOSWAP-GNFT-003] caller is not token owner or approved"

errTokenNotExists

untyped string

Value

"[GNOSWAP-GNFT-004] token does not exist"

errTransferToSelf

untyped string

Value

"[GNOSWAP-GNFT-005] cannot transfer to self"

errInvalidTokenParams

untyped string

Value

"[GNOSWAP-GNFT-006] invalid token parameters"

errInvalidTokenParamsRange

untyped string

Value

"[GNOSWAP-GNFT-007] token parameters out of range"

errInvalidColorFormat

untyped string

Value

"[GNOSWAP-GNFT-008] invalid color format"

errStakedTokenLocked

untyped string

Value

"[GNOSWAP-GNFT-009] staked token is locked"

errSpoofedRealm

untyped string

Value

"[GNOSWAP-GNFT-010] rlm does not match the current crossing frame"

makeErrorWithDetails

func(message string, details string) .uverse.error

makeErrorWithDetails creates an error with additional context.

Open
OID
060c55…3242:9
makeErrorWithDetails details

Inspect func

Name

func() string

Name returns the NFT collection name.

Open
OID
060c55…3242:14
Name details

Inspect func

Symbol

func() string

Symbol returns the NFT symbol.

Open
OID
060c55…3242:15
Symbol details

Inspect func

TotalSupply

func() int64

TotalSupply returns the total number of NFTs minted.

Open
OID
060c55…3242:16
TotalSupply details

Inspect func

TokenURI

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

TokenURI returns the metadata URI for the specified token ID. If stored value is in parameter format (x1,y1,x2,y2,color1,color2), it converts to full base64-encoded SVG image URI on read.

Open
OID
060c55…3242:17
TokenURI details

Inspect func

BalanceOf

func(owner .uverse.address) (int64, .uverse.error)

BalanceOf returns the number of NFTs owned by the specified address.

Open
OID
060c55…3242:18
BalanceOf details

Inspect func

OwnerOf

func(tid grc721.TokenID) (.uverse.address, .uverse.error)
Open
OID
060c55…3242:19
OwnerOf details

Inspect func

MustOwnerOf

func(tid grc721.TokenID) .uverse.address
Open
OID
060c55…3242:20
MustOwnerOf details

Inspect func

SetTokenURI

func(tid grc721.TokenID, tURI grc721.TokenURI) (bool, .uverse.error)

SetTokenURI sets the metadata URI for the specified token. Parameters: - tid: token ID - tURI: token URI Only callable by position contract.

Open
OID
060c55…3242:21
SetTokenURI details

Inspect func

SafeTransferFrom

func(from .uverse.address, to .uverse.address, tid grc721.TokenID) .uverse.error

SafeTransferFrom transfers token ownership with receiver validation. Parameters: - from: current owner address - to: recipient address - tid: token ID to transfer Returns error if transfer fails. Permission model: - Tokens held by the staker contract (i.e. currently staked) can only be moved by the staker itself; the underlying staked LP position is non-transferable. - Otherwise, ownership and approval are enforced by the GRC721 layer (owner / approved-for-token / approved-for-all).

Open
OID
060c55…3242:22
SafeTransferFrom details

Inspect func

TransferFrom

func(from .uverse.address, to .uverse.address, tid grc721.TokenID) .uverse.error

TransferFrom transfers a token from one address to another. Parameters: - from: current owner address - to: recipient address - tid: token ID Returns error if transfer fails. Permission model: - Tokens held by the staker contract (i.e. currently staked) can only be moved by the staker itself; the underlying staked LP position is non-transferable. - Otherwise, ownership and approval are enforced by the GRC721 layer (owner / approved-for-token / approved-for-all).

Open
OID
060c55…3242:23
TransferFrom details

Inspect func

Approve

func(approved .uverse.address, tid grc721.TokenID) .uverse.error

Approve grants permission to transfer a specific token ID to another address. Parameters: - approved: address to approve - tid: token ID to approve for transfer Returns error if approval fails.

Open
OID
060c55…3242:24
Approve details

Inspect func

SetApprovalForAll

func(operator .uverse.address, approved bool) .uverse.error

SetApprovalForAll enables/disables operator approval for all tokens. Parameters: - operator: address to set approval for - approved: true to approve, false to revoke Returns error if operation fails.

Open
OID
060c55…3242:25
SetApprovalForAll details

Inspect func

GetApproved

func(tid grc721.TokenID) (.uverse.address, .uverse.error)
Open
OID
060c55…3242:26
GetApproved details

Inspect func

IsApprovedForAll

func(owner .uverse.address, operator .uverse.address) bool

IsApprovedForAll checks if operator can manage all owner's tokens. Parameters: - owner: token owner address - operator: operator address to check Returns true if operator is approved for all owner's tokens.

Open
OID
060c55…3242:27
IsApprovedForAll details

Inspect func

Mint

func(to .uverse.address, tid grc721.TokenID) grc721.TokenID

Mint creates new NFT and transfers to address. Parameters: - to: recipient address - tid: token ID Returns minted token ID. Only callable by position contract.

Open
OID
060c55…3242:28
Mint details

Inspect func

Exists

func(tid grc721.TokenID) bool

Exists checks if token ID exists.

Open
OID
060c55…3242:29
Exists details

Inspect func

Burn

func(tid grc721.TokenID)

Burn removes a specific token ID. Parameters: - tid: token ID to burn Only callable by position.

Open
OID
060c55…3242:30
Burn details

Inspect func

Render

func(path string) string

Render returns the HTML representation of the NFT.

Open
OID
060c55…3242:31
Render details

Inspect func

setTokenURI

func(int, rlm .uverse.realm, tid grc721.TokenID, tURI grc721.TokenURI) .uverse.error

setTokenURI sets the metadata URI for a specific token ID.

Open
OID
060c55…3242:32
setTokenURI details

Inspect func

svgTemplate

[7]string

svgTemplate holds pre-split template parts for efficient concatenation. Usage: svgTemplate\[0] + x1 + svgTemplate\[1] + y1 + ... + color2 + svgTemplate\[6]

Open
OID
060c55…3242:34
svgTemplate details

Inspect array

charset

untyped string

charset contains valid hex digits for color generation.

Value

"0123456789ABCDEF"

x1Min

untyped bigint

Parameter range constants for gradient coordinates.

Value

(7 <untyped> bigint)

x1Max

untyped bigint

Parameter range constants for gradient coordinates.

Value

(13 <untyped> bigint)

y1Min

untyped bigint

Parameter range constants for gradient coordinates.

Value

(7 <untyped> bigint)

y1Max

untyped bigint

Parameter range constants for gradient coordinates.

Value

(13 <untyped> bigint)

x2Min

untyped bigint

Parameter range constants for gradient coordinates.

Value

(121 <untyped> bigint)

x2Max

untyped bigint

Parameter range constants for gradient coordinates.

Value

(126 <untyped> bigint)

y2Min

untyped bigint

Parameter range constants for gradient coordinates.

Value

(121 <untyped> bigint)

y2Max

untyped bigint

Parameter range constants for gradient coordinates.

Value

(126 <untyped> bigint)

x1Range

untyped bigint

Parameter range constants for gradient coordinates.

Value

(7 <untyped> bigint)

y1Range

untyped bigint

Parameter range constants for gradient coordinates.

Value

(7 <untyped> bigint)

x2Range

untyped bigint

Parameter range constants for gradient coordinates.

Value

(6 <untyped> bigint)

y2Range

untyped bigint

Parameter range constants for gradient coordinates.

Value

(6 <untyped> bigint)

genImageParamsString

func(r *rand.Rand) string

genImageParamsString generates random gradient parameters and returns them as a compact string. Format: "x1,y1,x2,y2,color1,color2" (e.g., "10,12,125,123,#AABBCC,#DDEEFF")

Open
OID
060c55…3242:35
genImageParamsString details

Inspect func

ImageParams

type

ImageParams holds parsed and validated image parameters.

Value

gnft.ImageParams

validateCoordinate

func(value int, min int, max int, name string) .uverse.error

validateCoordinate checks if a coordinate value is within valid range. Returns error with details about which coordinate failed if out of range.

Open
OID
060c55…3242:37
validateCoordinate details

Inspect func

parseImageParams

func(s string) (*gnft.ImageParams, .uverse.error)

parseImageParams parses and validates parameters in one step. Returns parsed ImageParams pointer or error. Returns nil on error to avoid allocating zero-value struct. Expected format: "x1,y1,x2,y2,color1,color2"

Open
OID
060c55…3242:38
parseImageParams details

Inspect func

isValidHexColor

func(color string) bool

isValidHexColor checks if a string is a valid hex color in #XXXXXX format.

Open
OID
060c55…3242:39
isValidHexColor details

Inspect func

generateRandInstance

func() *rand.Rand

generateRandInstance generates a new random instance.

Open
OID
060c55…3242:40
generateRandInstance details

Inspect func

checkErr

func(err .uverse.error)

checkErr panics if an error occurs.

Open
OID
060c55…3242:42
checkErr details

Inspect func

checkTransferErr

func(err .uverse.error, caller .uverse.address, from .uverse.address, to .uverse.address, tid grc721.TokenID)

checkTransferErr wraps transfer errors with more specific context.

Open
OID
060c55…3242:43
checkTransferErr details

Inspect func

checkApproveErr

func(err .uverse.error, caller .uverse.address, approved .uverse.address, tid grc721.TokenID)

checkApproveErr wraps approve errors with more specific context.

Open
OID
060c55…3242:44
checkApproveErr details

Inspect func
assertIsValidTokenURI : func(tid grc721.TokenID) Inspect
assertIsValidAddress : func(addr .uverse.address) Inspect
assertFromIsValidAddress : func(from .uverse.address) Inspect
assertToIsValidAddress : func(to .uverse.address) Inspect
assertIsAllowedTransfer : func(caller .uverse.address, tid grc721.TokenID) Inspect
errCannotSetURI : untyped string ="[GNOSWAP-GNFT-001] cannot set URI"
errInvalidAddress : untyped string ="[GNOSWAP-GNFT-002] invalid address"
errNotOwnerOrApproved : untyped string ="[GNOSWAP-GNFT-003] caller is not token owner or approved"
errTokenNotExists : untyped string ="[GNOSWAP-GNFT-004] token does not exist"
errTransferToSelf : untyped string ="[GNOSWAP-GNFT-005] cannot transfer to self"
errInvalidTokenParams : untyped string ="[GNOSWAP-GNFT-006] invalid token parameters"
errInvalidTokenParamsRange : untyped string ="[GNOSWAP-GNFT-007] token parameters out of range"
errInvalidColorFormat : untyped string ="[GNOSWAP-GNFT-008] invalid color format"
errStakedTokenLocked : untyped string ="[GNOSWAP-GNFT-009] staked token is locked"
errSpoofedRealm : untyped string ="[GNOSWAP-GNFT-010] rlm does not match the current crossing frame"
makeErrorWithDetails : func(message string, details string) .uverse.error Inspect
nft : *grc721.BasicNFT Inspect
init.17 : func() Inspect
Name : func() string Inspect
Symbol : func() string Inspect
TotalSupply : func() int64 Inspect
TokenURI : func(tid grc721.TokenID) (string, .uverse.error) Inspect
BalanceOf : func(owner .uverse.address) (int64, .uverse.error) Inspect
OwnerOf : func(tid grc721.TokenID) (.uverse.address, .uverse.error) Inspect
MustOwnerOf : func(tid grc721.TokenID) .uverse.address Inspect
SetTokenURI : func(tid grc721.TokenID, tURI grc721.TokenURI) (bool, .uverse.error) Inspect
SafeTransferFrom : func(from .uverse.address, to .uverse.address, tid grc721.TokenID) .uverse.error Inspect
TransferFrom : func(from .uverse.address, to .uverse.address, tid grc721.TokenID) .uverse.error Inspect
Approve : func(approved .uverse.address, tid grc721.TokenID) .uverse.error Inspect
SetApprovalForAll : func(operator .uverse.address, approved bool) .uverse.error Inspect
GetApproved : func(tid grc721.TokenID) (.uverse.address, .uverse.error) Inspect
IsApprovedForAll : func(owner .uverse.address, operator .uverse.address) bool Inspect
Mint : func(to .uverse.address, tid grc721.TokenID) grc721.TokenID Inspect
Exists : func(tid grc721.TokenID) bool Inspect
Burn : func(tid grc721.TokenID) Inspect
Render : func(path string) string Inspect
setTokenURI : func(int, rlm .uverse.realm, tid grc721.TokenID, tURI grc721.TokenURI) .uverse.error Inspect
svgTemplate : [7]string Inspect
charset : untyped string ="0123456789ABCDEF"
x1Min : untyped bigint =(7 <untyped> bigint)
x1Max : untyped bigint =(13 <untyped> bigint)
y1Min : untyped bigint =(7 <untyped> bigint)
y1Max : untyped bigint =(13 <untyped> bigint)
x2Min : untyped bigint =(121 <untyped> bigint)
x2Max : untyped bigint =(126 <untyped> bigint)
y2Min : untyped bigint =(121 <untyped> bigint)
y2Max : untyped bigint =(126 <untyped> bigint)
x1Range : untyped bigint =(7 <untyped> bigint)
y1Range : untyped bigint =(7 <untyped> bigint)
x2Range : untyped bigint =(6 <untyped> bigint)
y2Range : untyped bigint =(6 <untyped> bigint)
genImageParamsString : func(r *rand.Rand) string Inspect
ImageParams : type =gnft.ImageParams
validateCoordinate : func(value int, min int, max int, name string) .uverse.error Inspect
parseImageParams : func(s string) (*gnft.ImageParams, .uverse.error) Inspect
isValidHexColor : func(color string) bool Inspect
generateRandInstance : func() *rand.Rand Inspect
checkErr : func(err .uverse.error) Inspect
checkTransferErr : func(err .uverse.error, caller .uverse.address, from .uverse.address, to .uverse.address, tid grc721.TokenID) Inspect
checkApproveErr : func(err .uverse.error, caller .uverse.address, approved .uverse.address, tid grc721.TokenID) Inspect