Quantcast
Channel: Recent Questions - Solana Stack Exchange
Viewing all articles
Browse latest Browse all 7906

How to filter out closed accounts from the Helius DAS API response when the showZeroBalance display option is true

$
0
0

I'm working on a Next.js app and trying to list the content of my wallet using the getAssetsByOwner DAS API method. I have a question regarding the response content when applying display options.

I want to show accounts with a zero balance but exclude closed accounts. I tried the showZeroBalance option in the DisplayOptions and set it to true, which works fine for zero-balance accounts. However, it also returns closed accounts.

After checking the Helius SDK, I noticed a showClosedAccounts key in the DisplayOptions type, so I tried this setup:

{  showZeroBalance: true,  showClosedAccounts: false}

Unfortunately, it doesn't seem to affect the response (closed accounts still show up), and I couldn't find showClosedAccounts in the official documentation, so I might be using it incorrectly.

Has anyone successfully filtered out closed accounts using the DAS API? If not, what would be an efficient way to manually filter these accounts from the response?

Thanks for any help!

ps: i've changed my mind and i would rather use searchAssets because it has an option to return fungible tokens only, the getAssetsByOwner only has nft or nft + fungible which would add another step to filter out the nft-s and i think its a waste of computing power to send it in the response when its not needed


Viewing all articles
Browse latest Browse all 7906

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>