Search Assets

Get standard and compressed NFTs created by a creator

Overview

This method returns a list of assets (standard and compressed NFTs) for the given creator address.

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

Search compressed NFTs in a wallet

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

const searchAssets = async () => {
  const response = await fetch(url, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      jsonrpc: '2.0',
      id: 'rpc-id',
      method: 'searchAssets',
      params: {
        ownerAddress: '2k5AXX4guW9XwRQ1AKCpAuUqgWDpQpwFfpVFh3hnm2Ha',
        compressed: true,
        page: 1, // Starts at 1
        limit: 1000
      },
    }),
  });
  const { result } = await response.json();
  console.log("Search Asset Result: ", result);
};
searchAssets();

MadLads Collection NFTs in Wallet

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

const searchAssets = async () => {
  const response = await fetch(url, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      jsonrpc: '2.0',
      id: 'my-id',
      method: 'searchAssets',
      params: {
        ownerAddress: '2k5AXX4guW9XwRQ1AKCpAuUqgWDpQpwFfpVFh3hnm2Ha',
        compressed: false,
        grouping: ["collection", "J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w"],
        page: 1, // Starts at 1
        limit: 1000
      },
    }),
  });
  const { result } = await response.json();
  console.log("Drip Haus Assets: ", result);
};
searchAssets();

Last updated