Get Assets By Owner

Gets standard and compressed NFTs owned by a wallet address

Overview

This method returns standard and compressed NFTs owned by a wallet address.

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

Example

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

const getAssetsByOwner = async () => {
  const response = await fetch(url, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      jsonrpc: '2.0',
      id: 'rpc-id',
      method: 'getAssetsByOwner',
      params: {
        ownerAddress: '9koepu1KGbWGvZLFiRzTQRqHzqjKGZULxSkQpqoRnChv',
        page: 1, // Starts at 1
        limit: 1000
      },
    }),
  });
  const { result } = await response.json();
  console.log("Assets owned by a wallet: ", result.items);
};
getAssetsByOwner();   

Last updated