assertIsValidTokenURI
func(tid grc721.TokenID)assertIsValidTokenURI panics if the token already has a URI set.
- OID
- 060c55…3242:3
assertIsValidTokenURI details
assertIsValidAddress
func(addr .uverse.address)assertIsValidAddress panics if the address is invalid.
- OID
- 060c55…3242:5
assertIsValidAddress details
assertFromIsValidAddress
func(from .uverse.address)assertFromIsValidAddress panics if the from address is invalid.
- OID
- 060c55…3242:6
assertFromIsValidAddress details
assertToIsValidAddress
func(to .uverse.address)assertToIsValidAddress panics if the to address is invalid.
- OID
- 060c55…3242:7
assertToIsValidAddress details
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.
- OID
- 060c55…3242:8
assertIsAllowedTransfer details
errCannotSetURI
untyped stringValue
"[GNOSWAP-GNFT-001] cannot set URI"
errInvalidAddress
untyped stringValue
"[GNOSWAP-GNFT-002] invalid address"
errNotOwnerOrApproved
untyped stringValue
"[GNOSWAP-GNFT-003] caller is not token owner or approved"
errTokenNotExists
untyped stringValue
"[GNOSWAP-GNFT-004] token does not exist"
errTransferToSelf
untyped stringValue
"[GNOSWAP-GNFT-005] cannot transfer to self"
errInvalidTokenParams
untyped stringValue
"[GNOSWAP-GNFT-006] invalid token parameters"
errInvalidTokenParamsRange
untyped stringValue
"[GNOSWAP-GNFT-007] token parameters out of range"
errInvalidColorFormat
untyped stringValue
"[GNOSWAP-GNFT-008] invalid color format"
errStakedTokenLocked
untyped stringValue
"[GNOSWAP-GNFT-009] staked token is locked"
errSpoofedRealm
untyped stringValue
"[GNOSWAP-GNFT-010] rlm does not match the current crossing frame"
makeErrorWithDetails
func(message string, details string) .uverse.errormakeErrorWithDetails creates an error with additional context.
- OID
- 060c55…3242:9
makeErrorWithDetails details
nft
*grc721.BasicNFT- OID
- 060c55…3242:46
nft details
init.17
func()- OID
- 060c55…3242:12
init.17 details
Name
func() stringName returns the NFT collection name.
- OID
- 060c55…3242:14
Name details
Symbol
func() stringSymbol returns the NFT symbol.
- OID
- 060c55…3242:15
Symbol details
TotalSupply
func() int64TotalSupply returns the total number of NFTs minted.
- OID
- 060c55…3242:16
TotalSupply details
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.
- OID
- 060c55…3242:17
TokenURI details
BalanceOf
func(owner .uverse.address) (int64, .uverse.error)BalanceOf returns the number of NFTs owned by the specified address.
- OID
- 060c55…3242:18
BalanceOf details
OwnerOf
func(tid grc721.TokenID) (.uverse.address, .uverse.error)- OID
- 060c55…3242:19
OwnerOf details
MustOwnerOf
func(tid grc721.TokenID) .uverse.address- OID
- 060c55…3242:20
MustOwnerOf details
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.
- OID
- 060c55…3242:21
SetTokenURI details
SafeTransferFrom
func(from .uverse.address, to .uverse.address, tid grc721.TokenID) .uverse.errorSafeTransferFrom 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).
- OID
- 060c55…3242:22
SafeTransferFrom details
TransferFrom
func(from .uverse.address, to .uverse.address, tid grc721.TokenID) .uverse.errorTransferFrom 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).
- OID
- 060c55…3242:23
TransferFrom details
Approve
func(approved .uverse.address, tid grc721.TokenID) .uverse.errorApprove 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.
- OID
- 060c55…3242:24
Approve details
SetApprovalForAll
func(operator .uverse.address, approved bool) .uverse.errorSetApprovalForAll 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.
- OID
- 060c55…3242:25
SetApprovalForAll details
GetApproved
func(tid grc721.TokenID) (.uverse.address, .uverse.error)- OID
- 060c55…3242:26
GetApproved details
IsApprovedForAll
func(owner .uverse.address, operator .uverse.address) boolIsApprovedForAll 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.
- OID
- 060c55…3242:27
IsApprovedForAll details
Mint
func(to .uverse.address, tid grc721.TokenID) grc721.TokenIDMint creates new NFT and transfers to address. Parameters: - to: recipient address - tid: token ID Returns minted token ID. Only callable by position contract.
- OID
- 060c55…3242:28
Mint details
Exists
func(tid grc721.TokenID) boolExists checks if token ID exists.
- OID
- 060c55…3242:29
Exists details
Burn
func(tid grc721.TokenID)Burn removes a specific token ID. Parameters: - tid: token ID to burn Only callable by position.
- OID
- 060c55…3242:30
Burn details
Render
func(path string) stringRender returns the HTML representation of the NFT.
- OID
- 060c55…3242:31
Render details
setTokenURI
func(int, rlm .uverse.realm, tid grc721.TokenID, tURI grc721.TokenURI) .uverse.errorsetTokenURI sets the metadata URI for a specific token ID.
- OID
- 060c55…3242:32
setTokenURI details
svgTemplate
[7]stringsvgTemplate holds pre-split template parts for efficient concatenation. Usage: svgTemplate\[0] + x1 + svgTemplate\[1] + y1 + ... + color2 + svgTemplate\[6]
- OID
- 060c55…3242:34
svgTemplate details
charset
untyped stringcharset contains valid hex digits for color generation.
Value
"0123456789ABCDEF"
x1Min
untyped bigintParameter range constants for gradient coordinates.
Value
(7 <untyped> bigint)
x1Max
untyped bigintParameter range constants for gradient coordinates.
Value
(13 <untyped> bigint)
y1Min
untyped bigintParameter range constants for gradient coordinates.
Value
(7 <untyped> bigint)
y1Max
untyped bigintParameter range constants for gradient coordinates.
Value
(13 <untyped> bigint)
x2Min
untyped bigintParameter range constants for gradient coordinates.
Value
(121 <untyped> bigint)
x2Max
untyped bigintParameter range constants for gradient coordinates.
Value
(126 <untyped> bigint)
y2Min
untyped bigintParameter range constants for gradient coordinates.
Value
(121 <untyped> bigint)
y2Max
untyped bigintParameter range constants for gradient coordinates.
Value
(126 <untyped> bigint)
x1Range
untyped bigintParameter range constants for gradient coordinates.
Value
(7 <untyped> bigint)
y1Range
untyped bigintParameter range constants for gradient coordinates.
Value
(7 <untyped> bigint)
x2Range
untyped bigintParameter range constants for gradient coordinates.
Value
(6 <untyped> bigint)
y2Range
untyped bigintParameter range constants for gradient coordinates.
Value
(6 <untyped> bigint)
genImageParamsString
func(r *rand.Rand) stringgenImageParamsString 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")
- OID
- 060c55…3242:35
genImageParamsString details
ImageParams
typeImageParams holds parsed and validated image parameters.
Value
gnft.ImageParams
validateCoordinate
func(value int, min int, max int, name string) .uverse.errorvalidateCoordinate checks if a coordinate value is within valid range. Returns error with details about which coordinate failed if out of range.
- OID
- 060c55…3242:37
validateCoordinate details
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"
- OID
- 060c55…3242:38
parseImageParams details
isValidHexColor
func(color string) boolisValidHexColor checks if a string is a valid hex color in #XXXXXX format.
- OID
- 060c55…3242:39
isValidHexColor details
generateRandInstance
func() *rand.RandgenerateRandInstance generates a new random instance.
- OID
- 060c55…3242:40
generateRandInstance details
checkErr
func(err .uverse.error)checkErr panics if an error occurs.
- OID
- 060c55…3242:42
checkErr details
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.
- OID
- 060c55…3242:43
checkTransferErr details
checkApproveErr
func(err .uverse.error, caller .uverse.address, approved .uverse.address, tid grc721.TokenID)checkApproveErr wraps approve errors with more specific context.
- OID
- 060c55…3242:44