Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

getBalances

Read a paginated map of every balance held by an address.

Signature

function getBalances(
  client: Client,
  parameters: {
    address: Address
    startAfter?: Denom
    limit?: number
    height?: number
  },
): Promise<Coins>

Example

import { createPublicClient, createTransport, testnet } from "@left-curve/sdk"
import type { Address } from "@left-curve/sdk"
 
const client = createPublicClient({ chain: testnet, transport: createTransport() })
const address: Address = "0x1234567890abcdef1234567890abcdef12345678"
 
const balances = await client.getBalances({ address, limit: 50 })
// { dango: "1500000000", "bridge/usdc": "1000000", ... }

Parameters

addressAddress. The account to query.

startAfterDenom, optional. Denom to start after (exclusive). Use the last denom from the previous page.

limitnumber, optional. Maximum entries to return.

heightnumber, optional. Block height to query at. Default 0 (latest).

Returns

CoinsRecord<Denom, string>. Each value is base units as a string. Safe for arbitrary precision.

See also