DareNFT Protocol
API Reference
Get List Collection

Get List Collection

Request

In order to get collections information on-chain, SDK provides you with a getCollections endpoint to do so

try {
  const bnbContract = nft2Client.getNFT2Contract(56);
 
  const { collections, total } = await bnbContract.getCollections({
    limit: 20,
    offset: 0
  });
 
  console.log(collections, total)
} catch (e) {
  console.error(e);
}

Parameters

  • Pagination:
    • limit (number): Pagination limit.
    • offset (number): Pagination offset.
    • sort ({field: 'deployAt'; order: 'DESC' | 'ASC'}): Optional. Only support sort on collection deploy time. Default order DESC.
  • chainIds: Which chains to get from. Optional. Multi Chain only

Response

{
  collections: Array<{
    name: string;
    symbol: string;
    imageUrl: string;
    contractAddress: string;
    ownerAddress: string;
    creatorAddress: string;
    chainId: number;
    type: number;
    deployedAt: Date;
    totalNfts: number;
    totalOwners: number;
    kind: number;
    defaultRoyalty: number;
  }>;
  total: number;
}