@getsafle/nft-controller
v2.3.1
Published
Library to enable detection of Non Fungible Tokens (NFT) for any public address across the supported chains.
Downloads
5
Keywords
Readme
Safle NFT Controller
This library enables the developer to detect Non Fungible Tokens (NFT) for any public address across the supported chains.
Installation and Usage
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');
Initialization
Initialise the class using,
const nftController = new safleNftController.NftController();
Methods
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.