Using hooks to get the marketplace data

The SDK provides a set of hooks that you can use to get the marketplace data. Here is the list of hooks provided by the SDK:

useAllNftsInCollection

This hook returns all the NFTs in a collection. You can use this hook to get all the NFTs in a collection.

import { Networks, useAllNftsInCollection } from '@lyncworld/fuel-marketplace';

const { fetching, data, error } = useAllNftsInCollection({
  network: Networks.Testnet,
  // Select from "NFT" or "SEMI_FT" according to actual token standard
  nftStandard: 'SEMI_FT',
  // Replace this demo contract address with actual contract address
  contractAddress: '0x...',
});
  • Returns -

{
  fetching: boolean;
  data: TokensInCollection[];
  error: unknown
}
  • Types -

useCollections

This hook returns all the collections whose at least one token is listed on the marketplace.

  • Returns -

  • Types -

useListings

This hook returns all the tokens listed on the marketplace for buying.

  • Returns -

  • Types -

useNft

This hook return all the listing details of a specific token by its contract address, token standard, and token ID.

  • Returns -

  • Types -

Last updated