Skip to content

Latest commit

 

History

History
41 lines (25 loc) · 1.1 KB

File metadata and controls

41 lines (25 loc) · 1.1 KB

tokenOwnersByMetadataId

{% hint style="warning" %}

This is a work in progress, please reach out to us on Telegram for support. For the most reliable data, reference our existing graphql docs.

{% endhint %}

Returns token owners by metadataId with limit and offset pagination..

tokenOwnersByMetadataId({metadataId: string, pagination?: Pagination, network?: "testnet" | "mainnet"})

This is an example of a data api method.

Example:

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

import { tokenOwnersByMetadataId } from "@mintbase-js/data";

const props = {
  metadataId: "teammintbase.mintbase1.near:0fd038b1fc7d86de6f8c816d5669accc",
  pagination: { limit:10, offset: 0},
  network: "mainnet",
}

const { data, error } = await tokenOwnersByMetadataId(props);

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

console.log(data.mb_views_nft_tokens) // => token data with token_id and owner
console.log(data.mb_views_nft_tokens_aggregate.aggregate.count) // => token counter

{% endcode %}