The client to use. AvalancheCoreClient
The addresses to get the balance of GetBalanceParameters
The balance information. GetBalanceReturnType
import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getBalance } from '@avalanche-sdk/client/methods/pChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const balance = await getBalance(client, {
addresses: ["P-custom18jma8ppw3nhx5r4ap8clazz0dps7rv5u9xde7p"]
})
Get the balance of AVAX controlled by a given address.