getCollateralForStorage
Get the size of the collateral storage of a given address, in bytes.
import { publicClient } from "./client";
const balance = await publicClient.getCollateralForStorage({
address: "cfx:...",
});import { http, createPublicClient } from 'cive'
import { mainnet } from 'cive/chains'
export const publicClient = createPublicClient({
chain: mainnet,
transport: http(),
})Returns
bigint
The size of the collateral storage in bytes.
Parameters
address
- Type:
Address
The address to check for collateral storage
const balance = await publicClient.getCollateralForStorage({
address: "cfx:...",
});epochTag (optional)
- Type:
latest_state|latest_confirmed|latest_checkpoint|earliest - Defaut:
latest_state
const balance = await publicClient.getCollateralForStorage({
address: "cfx:...",
epochTag: "latest_state",
});epochNumber (optional)
- Type:
bigint
const balance = await publicClient.getCollateralForStorage({
address: "cfx:...",
epochNumber: 1n,
});