Hook: useAllCollectionNFT

Fetch an entire NFT Collection with its metadata and all NFT's metadata in that collection.

Fetch all NFTs and contracts metadata for a given ERC-721 and ERC-1155 contract and takes in a contractAddress and chainId.

Interface

function useAllCollectionNFT( 
contractAddress?:string, 
chainId?: string )

Response

type useAllCollectionNFTType = {
  allNfts: [{Object}];
  isLoading?: bool;
  contractMetadata?: any;
};

Example Code:

import {ChainConfig, useAllCollectionNFT} from "@lyncworld/nft-marketplace";

function App() {
    const { allNfts, isLoading, contractMetadata } = 
    useAllCollectionNFT(
        "0x9342b1039949d536b2eb456de198c26362daa523", 
        ChainConfig.MATIC_MUMBAI
    );
}

Not ready to create your own UI yet, don't worry we have got you covered!! Example Code:

Last updated