getNFTs(contract, factHash?, limit?, offset?, reverse?)

Feature

get information about every NFT of certain contract. If the optional parameter factHash of mint operation is given, only the nft created by the operation is searched.

Parameters

string contract address, string | undefined factHash, number | undefined limit, // limit the number of items to import

number | undefined offset, // offset for nftid true | undefined reverse

data of SuccessResponse

array of NFT information

example

const contractAddress = "0x07469989b2562afF5E5C3B116CD3AA5Ef814e5a1fca";
const factHash = "EG1idZ3RNdkY8qc8HWSe5xupz399fcbYw57zFmgRhshg"

// Note: an asynchronous request.
const NFTsInfo = async () => {
    // set the query paramter factHash, offset as 2
    const info = await mitum.nft.getNFTs(contractAddress, factHash, undefined, 2);
    console.log(info.data);
};
NFTsInfo();

// output
[
  {
    _hint: 'mitum-currency-hal-v0.0.1',
    _embedded: {
      _hint: 'mitum-nft-nft-v0.0.1',
      nft_idx: 3,
      active: true,
      owner: '0x41EFb6902ADcb1214a7123b01af66b1D13b89864fca',
      hash: 'AAABBBCCC5',
      uri: 'www.abcd_efgh.com',
      approved: '0x4874C17C354c498cf44D2946612DBe47fBcE7E87fca',
      creators: [Object]
    },
    _links: { self: [Object] }
  },
  {
    _hint: 'mitum-currency-hal-v0.0.1',
    _embedded: {
      _hint: 'mitum-nft-nft-v0.0.1',
      nft_idx: 4,
      active: true,
      owner: '0x41EFb6902ADcb1214a7123b01af66b1D13b89864fca',
      hash: 'AAABBBCCC5',
      uri: 'www.abcd_efgh.com',
      approved: '0x4874C17C354c498cf44D2946612DBe47fBcE7E87fca',
      creators: [Object]
    },
    _links: { self: [Object] }
  }
  ... (8 more items)
]

Last updated