StakerInfo
A staker's STX-only stake, or its absence, as returned by fetchStakerInfo. It wraps the pox-5 get-staker-info read-only, which returns the staker-info map entry. Protocol bond memberships are a separate record: see BondMembership.
Usage
import { fetchStakerInfo } from '@stacks/bitcoin-staking';
const info = await fetchStakerInfo({ address: 'SP2C2YFP12AJZB4MABJBAJ55XECVS7E4PMMZ89YZR' });
if (info.staked) {
info.details.amountUstx; // bigint, micro-STX
info.details.signer; // signer-manager contract principal
}Definition
export type StakerInfo = { staked: false } | { staked: true; details: StakerInfoDetails };Values
Value
Description
{ staked: false }
No active STX-only stake. get-staker-info returns none both when no entry exists and when the stake has expired, meaning its first reward cycle plus num-cycles is at or before the current cycle
{ staked: true; details: StakerInfoDetails }
Active STX-only stake. details is a StakerInfoDetails
Was this helpful?