attributesByContract

Returns a list of token items (metadata) which match the contract id and passed filters.

attributesByContract(contractId: string, network?: "testnet" | "mainnet"): Promise

Example:

getAttributes.ts
import { attributesByContract } from "@mintbase-js/data";

const { data, error } = await attributesByContract(
  'some-nfts.contract.near',
  'mainnet'
);

if (error) {
  console.log("error", error);
}

console.log(data);
/* => "{
  eyes: [
    { name: 'green', count: 30 } // 30 tokens with green eyes
    { name: 'blue', count: 3 } // 3 tokens with green eyes
  ],
  face: [
    { name: 'funny', count: 5 } // 5 funny faces
  ]
}"

*/

Last updated