A proposervm API Client. ProposervmApiClient
Returns the current epoch information for the requested chain (C-Chain, P-Chain, X-Chain).
import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const cChainEpoch = await client.proposervm.cChain.getCurrentEpoch()
const pChainEpoch = await client.proposervm.pChain.getCurrentEpoch()
const xChainEpoch = await client.proposervm.xChain.getCurrentEpoch()
Returns this node's current proposer VM height for the requested chain (C-Chain, P-Chain, X-Chain).
import { createAvalancheClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const client = createAvalancheClient({
chain: avalanche,
transport: {
type: "http",
},
})
const cChainHeight = await client.proposervm.cChain.getProposedHeight()
const pChainHeight = await client.proposervm.pChain.getProposedHeight()
const xChainHeight = await client.proposervm.xChain.getProposedHeight()
import { createProposervmApiClient} from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
const cChainClient = createProposervmApiClient({
chain: avalanche,
transport: {
type: "http",
},
clientType: "proposervmCChain",
})
// Get proposer VM height for C-Chain
const cChainHeight = await cChainClient.getProposedHeight()
const pChainClient = createProposervmApiClient({
chain: avalanche,
transport: {
type: "http",
},
clientType: "proposervmPChain",
})
// Get proposer VM height for P-Chain
const pChainHeight = await pChainClient.getProposedHeight()
Creates a proposervm API Client with a given transport configured for a Chain.
The proposervm API Client is an interface to interact with the proposervm API through Avalanche-specific JSON-RPC API methods.