Skip to content

This controller returns the details of a NFT for a user.

License

Notifications You must be signed in to change notification settings

getsafle/nft-controller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

This controller returns the details of a NFT for a user.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •