The client to use. AvalancheCoreClient
The subnet ID GetTotalStakeParameters
The total stake amount. GetTotalStakeReturnType
import { createAvalancheCoreClient } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { getTotalStake } from '@avalanche-sdk/client/methods/pChain'
const client = createAvalancheCoreClient({
chain: avalanche,
transport: {
type: "http",
url: "<url>",
},
})
const totalStake = await getTotalStake(client, {
subnetID: "11111111111111111111111111111111LpoYY"
})
Get the total stake amount for a subnet.