Skip to content

Latest commit

 

History

History
38 lines (27 loc) · 767 Bytes

File metadata and controls

38 lines (27 loc) · 767 Bytes

attributesByContract

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

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

Example:

{% code title="getAttributes.ts" overflow="wrap" lineNumbers="true" %}

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
  ]
}"

*/

{% endcode %}