For the complete documentation index, see llms.txt. This page is also available as Markdown.

StakerInfoDetails

The fields of an active STX-only stake: the pox-5 staker-info map value, decoded. It is the details of a StakerInfo with staked: true, returned by fetchStakerInfo.


Usage

import { fetchStakerInfo } from '@stacks/bitcoin-staking';

const info = await fetchStakerInfo({ address: stakerAddress, network: 'mainnet' });

if (info.staked) {
  const { amountUstx, firstRewardCycle, numCycles, signer } = info.details;
  const unlockCycle = firstRewardCycle + numCycles; // first cycle the STX is no longer locked
}

Definition

export interface StakerInfoDetails {
  /** Locked micro-STX. */
  amountUstx: bigint;
  /** First reward cycle the lock applies to. */
  firstRewardCycle: number;
  /** Number of cycles locked. */
  numCycles: number;
  /** Stacks principal of the signer the staker is delegated to. */
  signer: string;
}

Properties

Property
Type
Description

amountUstx

bigint

Locked micro-STX, from amount-ustx

firstRewardCycle

number

First reward cycle of the lock, from first-reward-cycle. stake-update keeps it

numCycles

number

Cycles locked, from num-cycles. stake-update adds the extension to it; unstake shortens it so the lock ends after the current cycle

signer

string

Contract principal of the signer-manager the stake is registered with, from signer. pox-5 records it as contract-of the signer-manager passed to stake

Was this helpful?