Non Fungible Tokens (NFTs)
The Komodo DeFi Framework API supports ERC1155 and ERC721 NFTs via the Moralis API on the Avalanche (AVAX), BNB Smart Chain (BNB), Ethereum (ETH), Fantom (FTM), Polygon (MATIC) networks.
To interact with NFTs, you will first need to activate the coin for the network the NFT is on, and initialise NFT support for the network.
This can be done with either the enable_eth_with_tokens method (if including the nft_req
param) or the enable_nft method (if the network is already activated without NFT support).
Before using other NFT methods, you should first call the update_nft method to populate/refresh the local database.
- Get a list of your tokens with get_nft_list
- Get a list of token transfers with get_nft_transfers
- Get token metadata with get_nft_metadata
- Update NFT update_nft
- Refresh NFT metadata with refresh_nft_metadata
- Withdraw ERC721 tokens with withdraw_nft
- Withdraw ERC1155 tokens with withdraw_nft
- Clear local NFT data with clear_nft\db
View the source code at: https://github.com/KomodoPlatform/komodo-defi-framework/blob/main/mm2src/coins/nft.rs