Skip to Content

🚧 These packages are still in development and may change rapidly as they are developed.

TypeScriptfetchBalance

fetchBalance

This function is used to fetch the asset balance of an account.

Usage

import { AptosJSProClient } from "@aptos-labs/js-pro"; const client = new AptosJSProClient({ /* ... */ }); const balance = await client.fetchBalance({ address: "0x926ff619e85bdb5b02680f27bea5ea3302c71f86be4b16fa0d63df213add927a", asset: "0xa", });

Parameters

NameTypeDefault
addressAccountAddressInput

The address to fetch the asset balance for.

assetstring

The asset to fetch the balance for. This can be a coin type or Fungible Asset metadata address.

networkNetworkInfo

The network to use for the request. If not set, the network of the AptosJSProClient instance will be used.

Return Type

The fetchBalance function will return a bigint of the balance.

Last updated on