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-membershipreturnsnone, andfetchBondMembershipreturnsundefined, once the bond's first reward cycle plusBOND_LENGTH_CYCLES(12) is at or before the current cycle.register-for-bondwrites the entry.update-bond-registrationchangessigner,unstake-sbtclowersamountSats, andannounce-l1-early-exitsets it to0.
Definition
Properties
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?