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 v0.TokenID)

assertIsValidTokenURI panics if the token already has a URI set.

Open
OID
060c55…3242:3
assertIsValidTokenURI details

Inspect func

assertIsNonEmptyTokenURI

func(tURI string)

assertIsNonEmptyTokenURI panics if the new URI is empty.

Open
OID
060c55…3242:5
assertIsNonEmptyTokenURI details

Inspect func

assertIsValidAddress

func(addr .uverse.address)

assertIsValidAddress panics if the address is invalid.

Open
OID
060c55…3242:6
assertIsValidAddress details

Inspect func

assertFromIsValidAddress

func(from .uverse.address)

assertFromIsValidAddress panics if the from address is invalid.

Open
OID
060c55…3242:7
assertFromIsValidAddress details

Inspect func

assertToIsValidAddress

func(to .uverse.address)

assertToIsValidAddress panics if the to address is invalid.

Open
OID
060c55…3242:8
assertToIsValidAddress details

Inspect func

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.

Open
OID
060c55…3242:9
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:10
makeErrorWithDetails details

Inspect func

Name

func() string

Name returns the NFT collection name. Returns: - name: collection name

Open
OID
060c55…3242:18
Name details

Inspect func

Symbol

func() string

Symbol returns the NFT collection symbol. Returns: - symbol: collection symbol

Open
OID
060c55…3242:19
Symbol details

Inspect func

TotalSupply

func() int64

TotalSupply returns the total number of NFTs minted. Returns: - supply: number of NFTs minted by the collection

Open
OID
060c55…3242:20
TotalSupply details

Inspect func

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

Open
OID
060c55…3242:21
TokenURI details

Inspect func

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

Open
OID
060c55…3242:22
BalanceOf details

Inspect func

OwnerOf

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

Inspect func

MustOwnerOf

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

Inspect func

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.

Open
OID
060c55…3242:25
SetTokenURI details

Inspect func

TransferFrom

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

TransferFrom 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).

Open
OID
060c55…3242:26
TransferFrom details

Inspect func

Approve

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

Approve 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

Open
OID
060c55…3242:27
Approve details

Inspect func

SetApprovalForAll

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

SetApprovalForAll 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

Open
OID
060c55…3242:28
SetApprovalForAll details

Inspect func

GetApproved

func(tid v0.TokenID) (.uverse.address, .uverse.error)
Open
OID
060c55…3242:29
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: - approved: true when operator is approved for every token owned by owner

Open
OID
060c55…3242:30
IsApprovedForAll details

Inspect func

Mint

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

Mint 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.

Open
OID
060c55…3242:31
Mint details

Inspect func

Exists

func(tid v0.TokenID) bool

Exists 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

Open
OID
060c55…3242:32
Exists details

Inspect func

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.

Open
OID
060c55…3242:33
Burn details

Inspect func

Render

func(path string) string

Render 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

Open
OID
060c55…3242:34
Render details

Inspect func

setTokenURI

func(int, rlm .uverse.realm, tid v0.TokenID, tURI string) .uverse.error

setTokenURI sets the metadata URI for a specific token ID.

Open
OID
060c55…3242:35
setTokenURI details

Inspect func

svgTemplate

[11]string

svgTemplate holds pre-split template parts for efficient concatenation. Usage: svgTemplate\[0] + clipID + svgTemplate\[1] + paintID + ... + color2 + svgTemplate\[10]

Open
OID
060c55…3242:37
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:38
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:40
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:41
parseImageParams details

Inspect func

svgIDSuffix

func(tid v0.TokenID) string
Open
OID
060c55…3242:42
svgIDSuffix 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:43
isValidHexColor details

Inspect func

generateRandInstance

func() *rand.Rand

generateRandInstance generates a new random instance.

Open
OID
060c55…3242:44
generateRandInstance details

Inspect func

checkErr

func(err .uverse.error)

checkErr panics if an error occurs.

Open
OID
060c55…3242:46
checkErr details

Inspect func

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.

Open
OID
060c55…3242:47
checkTransferErr details

Inspect func

checkApproveErr

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

checkApproveErr wraps approve errors with more specific context.

Open
OID
060c55…3242:48
checkApproveErr details

Inspect func
assertIsValidTokenURI : func(tid v0.TokenID) Inspect
assertIsNonEmptyTokenURI : func(tURI string) 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 v0.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
token : *v0.Token Inspect
ledger : *v0.PrivateLedger Inspect
meta : *v0.Metadata Inspect
metaLedger : *v0.Ledger Inspect
init.21 : func() Inspect
Name : func() string Inspect
Symbol : func() string Inspect
TotalSupply : func() int64 Inspect
TokenURI : func(tid v0.TokenID) (string, .uverse.error) Inspect
BalanceOf : func(owner .uverse.address) (int64, .uverse.error) Inspect
OwnerOf : func(tid v0.TokenID) (.uverse.address, .uverse.error) Inspect
MustOwnerOf : func(tid v0.TokenID) .uverse.address Inspect
SetTokenURI : func(tid v0.TokenID, tURI string) (bool, .uverse.error) Inspect
TransferFrom : func(from .uverse.address, to .uverse.address, tid v0.TokenID) .uverse.error Inspect
Approve : func(approved .uverse.address, tid v0.TokenID) .uverse.error Inspect
SetApprovalForAll : func(operator .uverse.address, approved bool) .uverse.error Inspect
GetApproved : func(tid v0.TokenID) (.uverse.address, .uverse.error) Inspect
IsApprovedForAll : func(owner .uverse.address, operator .uverse.address) bool Inspect
Mint : func(to .uverse.address, tid v0.TokenID) v0.TokenID Inspect
Exists : func(tid v0.TokenID) bool Inspect
Burn : func(tid v0.TokenID) Inspect
Render : func(path string) string Inspect
setTokenURI : func(int, rlm .uverse.realm, tid v0.TokenID, tURI string) .uverse.error Inspect
svgTemplate : [11]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
svgIDSuffix : func(tid v0.TokenID) string 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 v0.TokenID) Inspect
checkApproveErr : func(err .uverse.error, caller .uverse.address, approved .uverse.address, tid v0.TokenID) Inspect