LYNC
  • 👋INTRODUCTION
    • 👋Introducing LYNC
    • ⚙️Pre-Requisites
  • Products
    • LYNC Account Abstraction SDK
    • Metamask Wallet
    • OKX Wallet
    • LYNC In-Game Marketplace SDK
    • NFT Fetcher
    • LYNC Portal: Game Launcher
    • LYNC NFT Deployer
  • FEVM Support
    • LYNC Wallet SDK supporting FEVM
    • NFT Deployer -> FEVM
  • NPM Packages
    • Marketplace
      • Hook: useAllCollectionNFT
      • Hook: useAllBuyNFT
      • Hook: useAllOwnerNFT
      • Hook: useNFTDetails
      • Hook: useAllNFTForRent
Powered by GitBook
On this page
  1. NPM Packages
  2. Marketplace

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:

import {LyncCollection, ChainConfig} from "@lyncworld/nft-marketplace";
<LyncCollection
    bannerImageUrl={
    "https://helpx.adobe.com/content/dam/help/en/photoshop/using/convert-color-image-black-white/jcr_content/main-pars/before_and_after/image-before/Landscape-Color.jpg"
    }
    collectionDescription={"Welcome"}
    contractAddress={"0xa879c01913f56419605fde494b5c140a6d146a1b"}
    chainId={ChainConfig.MATIC_MUMBAI}
/>
PreviousMarketplaceNextHook: useAllBuyNFT

Last updated 1 year ago