getNFTs
The following set of functions will be used to showcase nfts on your marketplace
Getting list of tokens
import NiftySDK from 'nifty-protocol';
const niftySDK = new NiftySDK({ key: 'key', env: Nifty.envs.TESTNET });
const options = {
chains: [1, 56],
sort: 'listed_desc',
search: '',
contracts: [],
}
niftySDK.getNFTs(options)
.then((res) => {
setTokens(res.data);
})
.catch((e) => {
console.log('e', e);
});
const chains = [
{ chainId: '', name: 'All' },
{ chainId: 1, name: 'Ethereum' },
{ chainId: 137, name: 'Polygon' },
{ chainId: 56, name: 'BNB' },
{ chainId: 43114, name: 'Avalanche' },
{ chainId: 1285, name: 'Moonriver' },
{ chainId: 4, name: 'rinkeby' },
];
const sortOptions = [
{ value: 'listed_desc', label: 'Recently Listed' },
{ value: 'created_desc', label: 'Recently Minted' },
{ value: 'sold_desc', label: 'Recently Sold' },
{ value: 'price_asc', label: 'Price (Lowest to highest)' },
{ value: 'price_desc', label: 'Price (Highest to lowest)' },
{ value: 'last_sell_desc', label: 'Highest Last Sale' },
];
Options
Param
Value / Explanation
Type
Response
Last updated