Get Assets By Group

Get standard and compressed NFTs by group key and value

Overview

This method returns a list of assets (standard and compressed NFTs) based on group key and value. For example: this can be used to fetch collection NFTs and mint lists.

getAssetsByGroup() function supported in Shyft SDK for easy access.

Example

const url = `https://rpc.shyft.to/?api_key={api_key}`

const getAssetsByGroup = async () => {
    const response = await fetch(url, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        jsonrpc: '2.0',
        id: 'rpc-id',
        method: 'getAssetsByGroup',
        params: {
          groupKey: 'collection',
          groupValue: 'J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w',
          page: 1, // Starts at 1
          limit: 1000,
        },
      }),
    });
    const { result } = await response.json();
    console.log("Assets by Group Address: ", result.items);
};
getAssetsByGroup();

Last updated