0

For context, I'm trying to get all NFTs with a policy id, but only from a wallet address. I'm using BlockFrost OpenAPI, and it seems that I can only get assets with a policy id from the entire blockchain?? Using this url : 'https://cardano-mainnet.blockfrost.io/api/v0/assets/policy/{policy_id}'

I tried to filter the assets from this url response : https://cardano-mainnet.blockfrost.io/api/v0/accounts/{stake_address}/addresses/assets but I only can get 100 assets per page, and I get no info about how much page there is. They explicitly says on the doc that the count is from 0 to 100.

1 Answer 1

1

You could do something like:

let assets = [];
let final = false;
let page = 1;

while (final !== true) {
  const req = await get_function(url, page);
  assets = [...assets, ...req.data];
  page++;
  if (req.data.length < 100) {
    final = true;
  }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.