get Account Coin Amount From Smart Contract
abstract suspend fun getAccountCoinAmountFromSmartContract(accountAddress: AccountAddressInput, coinType: MoveValue.MoveStructId? = null, faMetadataAddress: AccountAddressInput? = null): Result<Long, AptosSdkError>
Queries an account's coin balance directly from on-chain smart contracts using a view call.
This mirrors the TS SDK's smart-contract path:
0x1::coin::balance<T>whencoinTypeis provided (or inferred for APT FA metadata)0x1::primary_fungible_store::balancewhen onlyfaMetadataAddressis provided
Return
The balance amount, or an AptosSdkError when the view call fails/inputs are invalid.
Parameters
account Address
The account address to query.
coin Type
Optional coin type (e.g. 0x1::aptos_coin::AptosCoin).
fa Metadata Address
Optional fungible asset metadata address.