On this page

latest contributor to this doc

Last Edit:

@smk762↗

NFT Common Structures

structuresnfts_common_structures

The following structures are used in the Komodo DeFi SDK for non-fungible tokens (NFTs).

ParameterTypeRequiredDefaultDescription
receiveboolean✗falseIf true, only transfers where user received NFTs are included in the response.
sendboolean✗falseIf true, only transfers where user sent NFTs are included in the response.
from_dateinteger✗-A timestamp in unix epoch format. If true, filter includes transfers from this date onwards (inclusive).
to_dateinteger✗-A timestamp in unix epoch format. If true, filter includes transfers up to this date (inclusive).
exclude_spamboolean✗falseIf true, only transfers which have param possible_spam:false are included in the response.
exclude_phishingboolean✗falseIf true, only transfers which have param possible_phishing:false are included in the response.

The NftFilter object includes the following items for a given coin or token:

ParameterTypeRequiredDefaultDescription
exclude_spamboolean✗falseIf true, only tokens which have param possible_spam:false are included in the response.
exclude_phishingboolean✗falseIf true, only tokens which have param possible_phishing:false are included in the response.

The NftInfoBasic object includes the following items for a given token:

ParameterTypeRequiredDescription
amountstring✓The amount of this NFT the user owns (used by ERC1155).
chainstring✓Chain name. One of AVALANCHE, BSC, ETH, FANTOM, or POLYGON.
contract_typestring✓The type of NFT contract standard. One of ERC721 or ERC1155.
token_addressstring✓The address of the NFT contract.
token_idstring✓The token ID of the NFT.

The NftInfo object includes the following items for a given token:

ParameterTypeRequiredDescription
amountstring✓The amount of this NFT the user owns (used by ERC1155).
block_number_mintedinteger✗The block height when the NFT was minted. May be null.
block_numberinteger✓The block height when the amount or owner changed.
chainstring✓Chain name. One of AVALANCHE, BSC, ETH, FANTOM, or POLYGON.
contract_typestring✓The type of NFT contract standard. One of ERC721 or ERC1155.
last_token_uri_syncstring✓When the token_uri was last updated.
last_metadata_syncstring✓When the metadata was last updated.
metadataobject✗A JSON object containing NFT metadata. May be null.
minter_addressstring✗Minter address. May be null.
owner_ofstring✓The wallet address of the owner of the NFT.
possible_spamboolean✓If true, the contract address has been identified as associated with spam or suspicious activities.
possible_phishingboolean✓If true, the token has been identified as associated with phishing, as at least one of domain fields is found in database with phishing domains.
synced_atstring✓When the token was last synced with the node.
token_addressstring✓The address of the NFT contract.
token_idstring✓The token ID of the NFT.
token_hashstring✗The token hash. May be null.
token_uristring✗The URI to the metadata of the token. May be null.
token_domainstring✗Token domain. May be null.
uri_metaobject✓A standard NftMetadata object.

The NftMetadata object includes the following items for a given coin or token:

ParameterTypeRequiredDefaultDescription
imagestring✗-Direct URL to the NFT's image.
image_urlstring✗-Url to the NFT's image. Derived from the image or image_url fields to prioritize the non-null value. Can be null if neither is provided.
image_domainstring✗-Extracted domain from the 'image_url', if valid.
namestring✗-Name of the token.
descriptionstring✗-Description of the token.
attributesobject or array of objects✗-The values within this parameter will vary, and are set by the creator. Often used to store traits.
animation_urlstring✗-Url to an animation to be displayed instead of a static image.
animation_domainstring✗-Extracted domain from the animation_url, if valid.
external_urlstring✗-URL to the external source related to the token.
external_domainstring✗-Extracted domain from the external_url, if valid.
image_detailsobject✗-JSON containing additional details or attributes of the image.

The NftProvider object is used in the 'enable_nft' RPC method. It defines the NFT providers that are avaialable and their configuration.

ParameterTypeRequiredDefaultDescription
typestring✓-Specifies the type of the provider.
infoobject✓-Additional information about the provider
info.urlstring✓-URL of the provider's endpoint
info.komodo_proxyboolean✗-Indicates whether proxy authentication is enabled for the endpoint

The NftTransfer object includes the following items for each token transaction:

ParameterTypeDescription
amountstringAmount of tokens transferred.
block_hashstringMay be null. Hash of block in which transfer occurred.
block_numberintegerHeight of block in which transfer occurred.
block_timestampintegerBlock time in unix epoch format.
chainstringChain name. One of AVALANCHE, BSC, ETH, FANTOM, or POLYGON.
token_uristringMay be null. The URI to the metadata of the token.
token_domainstringMay be null. Extracted domain from the token_uri, if valid.
collection_namestringMay be null. Name of collection which token belongs to.
image_urlstringMay be null. The URI to the token image.
image_domainstringMay be null. Extracted domain from the image_url, if valid.
token_namestringMay be null. Name of the token.
contract_typestringContract type. ERC721 or ERC1155.
token_addressstringAddress of token transferred.
token_idstringToken ID.
possible_spambooleanIf true, the contract address has been identified as associated with spam or suspicious activities.
possible_phishingbooleanIf true, the token has been identified as associated with phishing, as at least one of domain fields is found in database with phishing domains.
transaction_hashstringTransaction ID of the transfer.
transaction_indexstringMay be null. Transaction index of the transfer.
log_indexstringLog index of the transfer.
valuestringMay be null. Tranfer value.
transaction_typestringMay be null. Transaction type. Possible values are Single.
from_addressstringAddress of previous owner which sent the token(s).
to_addressstringAddress of new owner which received the token(s).
statusstringTransfer status. Will be either Send or Receive. When the from_address and to_address are the same (i.e. sending to yourself), this value will be Receive.
verifiedintegerMay be null. A deprecated field which will be removed in future.
operatorstringMay be null.
fee_detailsobjectOptional. A standard FeeInfo object.
confirmationsintegerThe count of blocks produced since this transaction was confirmed.

The NftTransferFilter object includes the following items for a given coin or token:

ParameterTypeRequiredDefaultDescription
receiveboolean✗falseIf true, only transfers where user received NFTs are included in the response.
sendboolean✗falseIf true, only transfers where user sent NFTs are included in the response.
from_dateinteger✗-A timestamp in unix epoch format. If true, filter includes transfers from this date onwards (inclusive).
to_dateinteger✗-A timestamp in unix epoch format. If true, filter includes transfers up to this date (inclusive).
exclude_spamboolean✗falseIf true, only transfers which have param possible_spam:false are included in the response.
exclude_phishingboolean✗falseIf true, only transfers which have param possible_phishing:false are included in the response.

ParameterTypeRequiredDescription
amountstring✓The amount of this NFT the user owns (used by ERC1155).
block_number_mintedinteger✗The block height when the NFT was minted. May be null.
block_numberinteger✓The block height when the amount or owner changed.
chainstring✓Chain name. One of AVALANCHE, BSC, ETH, FANTOM, or POLYGON.
namestring✗May be null. An NFT collection name.
contract_typestring✓The type of NFT contract standard. One of ERC721 or ERC1155.
last_token_uri_syncstring✓When the token_uri was last updated.
metadatastring✗May be null or a JSON stringified object containing NFT metadata.
normalized_metadataobject✗A JSON object containing NFT metadata.
possible_spamboolean✓Indicates if the NFT collection is flagged as spam.
symbolstring✗May be null. The symbol of the NFT collection.
synced_atstring✓When the NFT was last synced with the node.
token_addressstring✓The smart contract address of this NFT.
token_hashstring✓A hash uniquely identifying this NFT's metadata.
token_idstring✓The token ID of this NFT.
token_uristring✗May be null. A URI to the NFT metadata (Usually an IPFS link).
possible_phishingboolean✓Indicates if the NFT is flagged as phishing.

Standard object structure used in token information methods like get_token_info.

ParameterTypeRequiredDescription
typestring✓Token type - e.g ERC20 for tokens on the Ethereum network
protocol_dataobject✓Protocol-specific data object

Sub-object of TokenProtocol containing platform-specific token information.

ParameterTypeRequiredDescription
platformstring✓The parent coin of the token's platform - e.g MATIC for PLG20 tokens
contract_addressstring✓Must be mixed case The identifying hex string for the token's contract. Can be found on sites like EthScan, BscScan & PolygonScan

The WithdrawNftData object is used for withdrawals of NFTs on ERC721 and ERC1155 contracts. It includes the following items for a given coin or token:

ParameterTypeRequiredDefaultDescription
token_addressstring✓-The contract address of the NFT
token_idstring✓-The ID of the NFT
tostring✓-The recipient's address
amountstring✗-The amount to withdraw (for ERC1155 NFTs). For ERC721 NFTs, this is always 1 and can be omitted.