aptos-labs / aptos-ts-sdk

An SDK for accessing the Aptos blockchain data, submitting transactions, and more!
https://aptos-labs.github.io/aptos-ts-sdk/
Apache License 2.0
67 stars 37 forks source link

[Feature Request] Decouple `getAccountCoinAmount` from indexer #459

Open 0xbe1 opened 1 month ago

0xbe1 commented 1 month ago

🚀 Feature Request Description

Instead we can simply call view function and fetch the exact same result, and view function is more reliable than indexer

Motivation

Is your feature request related to a problem? Please describe you use case.

We ran into an issue that we call getAccountCoinAmount that returned 0 incorrectly due to indexer issue. This can be avoided if getAccountCoinAmount calls into view function 0x1::coin::balance or 0x1::fungible_asset::balance directly.

0xmaayan commented 1 month ago

agreed. wanted to make that change but didnt have the bandwidth for that, also need to think on how we handle coin vs fungible asset correctly.

Are you willing to create a PR with a change?

SamuelQZQ commented 1 month ago

@0xmaayan sure, we will create a PR.