const url = `https://rpc.shyft.to/?api_key={api_key}`
const getAssetsByAuthority = async () => {
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
jsonrpc: '2.0',
id: 'rpc-id',
method: 'getAssetsByAuthority',
params: {
authorityAddress: '2RtGg6fsFiiF1EQzHqbd66AhW7R5bWeQGpTbv2UMkCdW',
page: 1, // Starts at 1
limit: 1000
},
}),
});
const { result } = await response.json();
console.log("Assets by Authority Address: ", result.items);
};
getAssetsByAuthority();