assertIsValidTokenURI
func(tid v0.TokenID)assertIsValidTokenURI panics if the token already has a URI set.
- OID
- 060c55…3242:3
assertIsValidTokenURI details
assertIsNonEmptyTokenURI
func(tURI string)assertIsNonEmptyTokenURI panics if the new URI is empty.
- OID
- 060c55…3242:5
assertIsNonEmptyTokenURI details
assertIsValidAddress
func(addr .uverse.address)assertIsValidAddress panics if the address is invalid.
- OID
- 060c55…3242:6
assertIsValidAddress details
assertFromIsValidAddress
func(from .uverse.address)assertFromIsValidAddress panics if the from address is invalid.
- OID
- 060c55…3242:7
assertFromIsValidAddress details
assertToIsValidAddress
func(to .uverse.address)assertToIsValidAddress panics if the to address is invalid.
- OID
- 060c55…3242:8
assertToIsValidAddress details
assertIsAllowedTransfer
func(caller .uverse.address, tid v0.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 ledger.
- OID
- 060c55…3242:9
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:10
makeErrorWithDetails details
token
*v0.Token- OID
- 060c55…3242:50
token details
ledger
*v0.PrivateLedger- OID
- 060c55…3242:52
ledger details
meta
*v0.Metadata- OID
- 060c55…3242:59
meta details
metaLedger
*v0.Ledger- OID
- 060c55…3242:65
metaLedger details
init.21
func()- OID
- 060c55…3242:16
init.21 details
Name
func() stringName returns the NFT collection name. Returns: - name: collection name
- OID
- 060c55…3242:18
Name details
Symbol
func() stringSymbol returns the NFT collection symbol. Returns: - symbol: collection symbol
- OID
- 060c55…3242:19
Symbol details
TotalSupply
func() int64TotalSupply returns the total number of NFTs minted. Returns: - supply: number of NFTs minted by the collection
- OID
- 060c55…3242:20
TotalSupply details
TokenURI
func(tid v0.TokenID) (string, .uverse.error)TokenURI returns the metadata URI for the specified token ID. Parameter-format values (x1,y1,x2,y2,color1,color2) are rendered as a base64-encoded SVG data URI; other non-empty stored URIs are returned unchanged. Parameters: - tid: token ID whose metadata URI is requested Returns: - uri: stored URI, or a generated SVG data URI for parameter-format metadata - error: metadata lookup error when tid has no retrievable metadata
- OID
- 060c55…3242:21
TokenURI details
BalanceOf
func(owner .uverse.address) (int64, .uverse.error)BalanceOf returns the number of NFTs owned by the specified address. Parameters: - owner: address whose NFT balance is queried Returns: - balance: number of NFTs owned by owner - error: token-ledger balance lookup error; an invalid owner address panics before the lookup
- OID
- 060c55…3242:22
BalanceOf details
OwnerOf
func(tid v0.TokenID) (.uverse.address, .uverse.error)- OID
- 060c55…3242:23
OwnerOf details
MustOwnerOf
func(tid v0.TokenID) .uverse.address- OID
- 060c55…3242:24
MustOwnerOf details
SetTokenURI
func(tid v0.TokenID, tURI string) (bool, .uverse.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.
- OID
- 060c55…3242:25
SetTokenURI details
TransferFrom
func(from .uverse.address, to .uverse.address, tid v0.TokenID) .uverse.errorTransferFrom transfers a token from one address to another. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. - from: current owner address - to: recipient address - tid: token ID to transfer Returns: - error: nil after a successful transfer; invalid addresses, authorization, ownership, or ledger failures panic through checkTransferErr 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:26
TransferFrom details
Approve
func(approved .uverse.address, tid v0.TokenID) .uverse.errorApprove grants permission to transfer a specific token ID to another address. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. - approved: address to approve - tid: token ID to approve for transfer Returns: - error: nil after approval is stored; invalid addresses, ownership, or ledger failures panic through checkApproveErr
- OID
- 060c55…3242:27
Approve details
SetApprovalForAll
func(operator .uverse.address, approved bool) .uverse.errorSetApprovalForAll enables/disables operator approval for all tokens. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. - operator: address to set approval for - approved: true to approve, false to revoke Returns: - error: nil after the operator approval is stored; ledger failures panic before a non-nil error can be returned
- OID
- 060c55…3242:28
SetApprovalForAll details
GetApproved
func(tid v0.TokenID) (.uverse.address, .uverse.error)- OID
- 060c55…3242:29
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: - approved: true when operator is approved for every token owned by owner
- OID
- 060c55…3242:30
IsApprovedForAll details
Mint
func(to .uverse.address, tid v0.TokenID) v0.TokenIDMint creates new NFT and transfers it to to. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. - to: recipient address - tid: token ID to mint Returns: - tokenID: minted token ID Only callable by position contract.
- OID
- 060c55…3242:31
Mint details
Exists
func(tid v0.TokenID) boolExists checks if token ID exists. Parameters: - tid: token ID to check Returns: - exists: true when the ledger can resolve an owner for tid; false otherwise
- OID
- 060c55…3242:32
Exists details
Burn
func(tid v0.TokenID)Burn removes a specific token ID. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. - tid: token ID to burn Only callable by position.
- OID
- 060c55…3242:33
Burn details
Render
func(path string) stringRender returns the HTML representation of the NFT. Parameters: - path: render path; the empty path selects the collection home page Returns: - html: collection HTML for the home path, or "404\\n" for unsupported paths
- OID
- 060c55…3242:34
Render details
setTokenURI
func(int, rlm .uverse.realm, tid v0.TokenID, tURI string) .uverse.errorsetTokenURI sets the metadata URI for a specific token ID.
- OID
- 060c55…3242:35
setTokenURI details
svgTemplate
[11]stringsvgTemplate holds pre-split template parts for efficient concatenation. Usage: svgTemplate\[0] + clipID + svgTemplate\[1] + paintID + ... + color2 + svgTemplate\[10]
- OID
- 060c55…3242:37
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:38
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:40
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:41
parseImageParams details
svgIDSuffix
func(tid v0.TokenID) string- OID
- 060c55…3242:42
svgIDSuffix details
isValidHexColor
func(color string) boolisValidHexColor checks if a string is a valid hex color in #XXXXXX format.
- OID
- 060c55…3242:43
isValidHexColor details
generateRandInstance
func() *rand.RandgenerateRandInstance generates a new random instance.
- OID
- 060c55…3242:44
generateRandInstance details
checkErr
func(err .uverse.error)checkErr panics if an error occurs.
- OID
- 060c55…3242:46
checkErr details
checkTransferErr
func(err .uverse.error, caller .uverse.address, from .uverse.address, to .uverse.address, tid v0.TokenID)checkTransferErr wraps transfer errors with more specific context.
- OID
- 060c55…3242:47
checkTransferErr details
checkApproveErr
func(err .uverse.error, caller .uverse.address, approved .uverse.address, tid v0.TokenID)checkApproveErr wraps approve errors with more specific context.
- OID
- 060c55…3242:48