Documentation
¶
Index ¶
Constants ¶
const ABIERC721 = `` /* 3286-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func PackPayloadForErc721 ¶
PackPayloadForErc721 encodes the calldata for one of the ERC-721 functions the ABI above declares. Returns hex without the 0x prefix so callers can concatenate with a tx payload builder that adds its own prefix.
Unsupported function names return an error rather than a silent empty payload — an accidentally-mistyped function name would otherwise sign an empty tx that costs gas but does nothing.
func UnpackReturnsForErc721 ¶
UnpackReturnsForErc721 decodes the return payload of a view function into a string. Non-view functions (transferFrom etc.) don't return anything meaningful — call with those returns an "unsupported function" error rather than an empty string, to catch callers that mis-wire read vs write paths.
Types ¶
type CallErc721In ¶
type CallErc721In struct {
// Address is the owner / balanceOf target for read functions.
Address string `json:"address,omitempty"`
// Owner + Operator for isApprovedForAll.
Owner string `json:"owner,omitempty"`
Operator string `json:"operator,omitempty"`
// Approved is the isApprovedForAll flag (true = grant, false = revoke).
Approved bool `json:"approved,omitempty"`
// From / To for transfer* functions.
From string `json:"from,omitempty"`
To string `json:"to,omitempty"`
// Recipient for approve (approve grants To one specific tokenId;
// setApprovalForAll grants Operator every tokenId).
Recipient string `json:"recipient,omitempty"`
// TokenId is the NFT id, decimal string. Big enough for uint256.
TokenId string `json:"tokenId,omitempty"`
// Index for tokenByIndex / tokenOfOwnerByIndex.
Index string `json:"index,omitempty"`
// Data is the onERC721Received callback payload for
// safeTransferFromWithData; hex-encoded (with or without 0x).
Data string `json:"data,omitempty"`
}
CallErc721In accepts every field any packed ERC-721 function can need; unused ones stay zero. Address / TokenId / Operator fields are strings on the wire so bindings can use a single JSON payload (mobile / TS FE) without depending on big.Int marshalers.