This library enables the developer to detect Non Fungible Tokens (NFT) for any public address across the supported chains.
Installation
Install the package by running the command,
npm install @getsafle/nft-controller
Import the package into your project using,
const safleNftController = require('@getsafle/nft-controller');
Initialise the class using,
const nftController = new safleNftController.NftController();
Discover the NFTs and get their details
const nfts = await nftController.detectNFTs({ publicAddress, chain, ETHNFTContinuation, PolygonNFTContinuation });
publicAddress
- Public address to detect NFTs.chain
(optional) - Optional chain parameter to detect the NFTs. Supported chains :Ethereum
,Polygon
.
Get Price Data
const price = await nftController.getPriceData([{ publicAddress, contractAddress, tokenId, chain }]);
publicAddress
- Public address of the NFT holder.chain
- Chain where the NFT was minted. Supported chains :Ethereum
,Polygon
.tokenId
- TokenId of the NFT to get the price data.contractAddress
- Contract address of the NFT collection to get the price data.