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

AccountStatus

An account's STX balance, locked amount, nonce and unlockHeight, from the node's /v2/accounts/<address> endpoint. Returned by fetchAccountStatus.


Usage

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

const account = await fetchAccountStatus({ address: stakerAddress, network: 'mainnet' });

const totalUstx = account.balance + account.locked; // micro-STX
const isLocked = account.unlockHeight !== 0;

Definition

export interface AccountStatus {
  /** Liquid micro-STX balance. */
  balance: bigint;
  /** Locked (stacked) micro-STX. */
  locked: bigint;
  /** Account nonce. */
  nonce: bigint;
  /** Burn height at which the locked STX unlocks. */
  unlockHeight: number;
}

Properties

Property

Type

From /v2/accounts

Description

balance

bigint

balance

Liquid micro-STX. fetchEligibleStake and fetchEligibleRegisterForBond check balance + locked against the amount to lock, as stake and register-for-bond do

locked

bigint

locked

Locked micro-STX

nonce

bigint

nonce

Account nonce

unlockHeight

number

unlock_height

Bitcoin block height at which the locked STX unlocks. 0 when no lock is active

Was this helpful?