How to fetch all FT balances of EOA

Hello Klaytn Forum,

What would be the best practice to fetch all FT balances of a certain EOA? I have read through the caver-js API docs and apparently getting a list of FT in possession is not yet supported.

I would like to get the same result as Klaytnscope’s ‘Token Balance’ of a certain address.

So in practice, would I have to fetch all transfer history of the EOA > and then call caver.kct.kip7.balanceOf() for each recognized FT contracts within that history?

Please do tell me if there’s a better way for doing this as I could easily see myself calling dozens of KAS API calls per each EOA FT balance check.

Thanks!

+) I’ve just tried https://th-api.klaytnapi.com/v2/account/{address}/token from the API doc, with the EOA of KSP(0xc6a2ad8cc6e4a7e08fc37cc5954be07d499e7654) but only {KSP, KETH, KDAI, SKLAY, SSX, KXRP, HINT} is being responded. On Klaytnscope 43 FTs are recognized on the same EOA.

Is this due to KAS caching limits? Is it impossible to have all 43 FT list in one queue with KAS API?

Will I have to run my own EN to achieve my goal?

Hi :slight_smile:
Currently, only KIP-7, which implements KIP-13, is labeled as ‘FT’ in KAS Token History API.
Before labeling, it calls supportsInterface to see if it implements the KIP-7 interface and decides whether to label it based on that.
However, these results seem to occur because the labeling standards used in KAS and Klaytn Scope are different.

1 Like