On this page

latest contributor to this doc

Last Edit:

@gcharang

Non-Fungible Token Structures

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

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

ParameterTypeDescription
amountstringThe amount of this NFT the user owns (used by ERC1155).
chainstringChain name. One of AVALANCHE, BSC, ETH, FANTOM, or POLYGON.
contract_typestringThe type of NFT contract standard. One of ERC721 or ERC1155.
token_addressstringThe address of the NFT contract.
token_idstringThe token ID of the NFT.

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

ParameterTypeDescription
amountstringThe amount of this NFT the user owns (used by ERC1155).
block_number_mintedintegerThe block height when the NFT was minted. May be null.
block_numberintegerThe block height when the amount or owner changed.
chainstringChain name. One of AVALANCHE, BSC, ETH, FANTOM, or POLYGON.
namestringMay be null. An NFT collection name.
contract_typestringThe type of NFT contract standard. One of ERC721 or ERC1155.
last_token_uri_syncstringWhen the token_uri was last updated.
last_metadata_syncstringWhen the metadata was last updated.
metadatastringThe metadata of the token. May be null.
minter_addressstringMinter address. May be null.
owner_ofstringThe wallet address of the owner of the NFT.
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.
symbolstringMay be null. The symbol of the NFT contract.
token_addressstringThe address of the NFT contract.
token_idstringThe token ID of the NFT.
token_hashstringThe token hash. May be null.
token_uristringThe URI to the metadata of the token. May be null.
token_domainstringToken domain. May be null.
uri_metaobjectA standard NftMetadata object.

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

ParameterTypeDescription
exclude_spambooleanOptional, defaults to false. If true, only tokens which have param possible_spam:false are included in the response.
exclude_phishingbooleanOptional, defaults to false. If true, only tokens which have param possible_phishing:false are included in the response.

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 transfer of given coin or token:

ParameterTypeDescription
receivebooleanOptional, defaults to false. If true, only transfers where user received NFTs are included in the response.
sendbooleanOptional, defaults to false. If true, only transfers where user sent NFTs are included in the response.
from_dateintegerOptional. A timestamp in unix epoch format. If true, filter includes transfers from this date onwards (inclusive).
to_dateintegerOptional. A timestamp in unix epoch format. If true, filter includes transfers up to this date (inclusive).
exclude_spambooleanOptional, defaults to false. If true, only transfers which have param possible_spam:false are included in the response.
exclude_phishingbooleanOptional, defaults to false. If true, only transfers which have param possible_phishing:false are included in the response.

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

ParameterTypeDescription
imagestringOptional. Direct URL to the NFT's image.
image_urlstringOptional. Optional. 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_domainstringOptional. Extracted domain from the 'image_url', if valid.
namestringOptional. Name of the token.
descriptionstringOptional. Description of the token.
attributesobject or array of objectsOptional. The values within this parameter will vary, and are set by the creator. Often used to store traits.
animation_urlstringOptional. Url to an animation to be displayed instead of a static image.
animation_domainstringOptional. Extracted domain from the animation_url, if valid.
external_urlstringOptional. URL to the external source related to the token.
external_domainstringOptional. Extracted domain from the external_url, if valid.
image_detailsobjectOptional. JSON containing additional details or attributes of the image.

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:

ParameterTypeDescription
chainstringThe token chain. Chain must be activated first.
tostringDestination address to withdraw the token to.
token_addressstringToken address.
token_idstringToken ID.
feeobjectA standard WithdrawFee object. May be missing for older transfers.
amountstringOptional, ERC1155 only. Defaults to 1. Amount of NFTs to withdraw. Ignored if max is true.
maxbooleanOptional, ERC1155 only. Defaults to false. If true, amount parameter will be ignored and all NFTs with this token_id will be sent.

When the type parameter in a withdraw_nft request is withdraw_erc721, it means the NFT is absolutely unique, and it has only 1 owner and the owner can own only 1 NFT with this token_id in its token_address (also referred to as contract address). When the type parameter in a withdraw_nft request is withdraw_erc1155, it means that it is possible for more than 1 user to own one or more of the same NFT (with an identical token_id). Due to this difference, the amount and max fields are only used the when the type value is withdraw_erc1155.

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

ParameterTypeDescription
typestringSpecifies the type of the provider.
infoobjectAdditional information about the provider
info.urlstringURL of the provider's endpoint
info.komodo_proxybooleanOptional. Indicates whether proxy authentication is enabled for the endpoint