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

BondMembership

A staker's protocol bond membership: the pox-5 protocol-bond-memberships map value, decoded. fetchBondMembership returns it while the membership is active, and fetchProtocolBondMemberships returns the raw entry, including after the bond has ended.


Usage

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

const membership = await fetchBondMembership({ address: stakerAddress, network: 'mainnet' });

if (membership) {
  membership.bondIndex; // number
  membership.isL1Lock; // true: L1 BTC lockup, false: sBTC
  membership.amountSats; // bigint, sats
}

Notes

  • get-bond-membership returns none, and fetchBondMembership returns undefined, once the bond's first reward cycle plus BOND_LENGTH_CYCLES (12) is at or before the current cycle.

  • register-for-bond writes the entry. update-bond-registration changes signer, unstake-sbtc lowers amountSats, and announce-l1-early-exit sets it to 0.


Definition


Properties

Property
Type
Description

bondIndex

number

Index of the bond the staker registered for, from bond-index

amountUstx

bigint

Micro-STX locked for the bond, from amount-ustx

signer

string

Contract principal of the signer-manager the membership is bound to, from signer

isL1Lock

boolean

true if the BTC side is an L1 BTC lockup, false if it is sBTC, from is-l1-lock

amountSats

bigint

Sats attributed to the membership, from amount-sats

Was this helpful?