The client to use. AvalancheCoreClient
The addresses to get balances for. GetAllBalancesParameters
The balances of all assets. GetAllBalancesReturnType
import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getAllBalances } from '@avalanche-sdk/client/methods/xChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const balances = await getAllBalances(client, {
addresses: ["X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5"]
})
Get the balances of all assets controlled by given addresses.