Skip to content

getStakingBalance

Get the stacking balance of the accout, identified by its address.

Usage

example.ts
import { publicClient } from "./client";

const balance = await publicClient.getStakingBalance({
  address: "cfx:...",
});

Returns

bigint

The staking balance in drip.

Parameters

address

  • address: Address
const balance = await publicClient.getStakingBalance({
  address: "cfx:...", 
});

epochTag (optional)

  • Type: latest_state| latest_confirmed| latest_checkpoint | earliest
  • Defaut: latest_state
const balance = await publicClient.getStakingBalance({
  address: "cfx:...",
  epochTag: "latest_state", 
});

epochNumber (optional)

  • Type: bigint
const balance = await publicClient.getStakingBalance({
  address: "cfx:...",
  epochNumber: 1n, 
});

JSON-RPC Method

cfx_getStakingBalance