Skip to content

feat: Add bitcoin-staking package - #1854

Merged
jannik-stacks merged 132 commits into
mainfrom
feat/bitcoin-staking
Jul 29, 2026
Merged

feat: Add bitcoin-staking package#1854
jannik-stacks merged 132 commits into
mainfrom
feat/bitcoin-staking

Conversation

@jannik-stacks

@jannik-stacks jannik-stacks commented Apr 9, 2026 •

Copy link
Copy Markdown
Collaborator

Add @stacks/bitcoin-staking package for PoX-5 staking flows

  • Adds a new packages/bitcoin-staking workspace package: unsigned transaction builders for every PoX-5 entrypoint (buildSetupBond, buildRegisterForBond with BTC/sBTC lockup shapes, buildStake/buildStakeUpdate/buildUnstake, buildAnnounceL1EarlyExit, rewards and signer-grant builders), plus read helpers covering PoX info, bonds, memberships, signer sets, and the full rewards ledger.
  • Ships client-side mirrors of the contract's consensus-critical logic: P2WSH lockup script construction and address derivation (buildLockScript, buildLockAddress), SPV proof assembly for L1 registrations (buildLockProof, computeMerkleBranch), reclaim transaction building/signing for expired or early-exited locks, and SIP-018 signer-key grant signing/verification — each pinned against on-chain results by golden-vector tests.
  • Adds an eligibility preflight layer (fetchEligible* per entrypoint) that re-runs the contract's guard chain off-chain and returns the abort reasons in contract evaluation order, plus cycle/bond timing math (bondStatus, isInPreparePhase, minUstxForSatsAmount) and a describePox5Error code dictionary.
  • Two small fixes outside the new package: hexToBigInt in @stacks/common accepts an optional 0x prefix, and Address.parse in @stacks/transactions returns Required<AddressRepr> (runtime shape unchanged).

Tests run in three layers, which is worth knowing when reviewing: pure offline unit tests, a dockerized regtest suite, and a suite against a hosted private testnet — the latter two record live HTTP fixtures once (RECORD=1) and replay them offline in CI, so fixture JSON dominates the diff line count. Flows that mutate one-shot chain state (e.g. reward claims) are live-only and skipped in replay.

Why

Integrators currently have to hand-roll PoX-5 contract calls, lockup scripts, and SPV proofs; this package provides those as tested, composable helpers.

Example

import {
  buildLockOutputScript,
  buildLockProof,
  buildRegisterForBond,
  buildUnlockScript,
  fetchEligibleRegisterForBond,
} from '@stacks/bitcoin-staking';

const unlockBytes = buildUnlockScript(stakerPublicKey);
const outputScript = buildLockOutputScript({ stxAddress, unlockHeight, unlockBytes, earlyUnlockBytes });

// SPV proof for the confirmed L1 lockup tx (inputs come from any Esplora API).
const lockupOutput = buildLockProof({ txHex, header, merkleProof, txCount, unlockHeight, outputScript });

const unsigned = await buildRegisterForBond({
  bondIndex,
  signerManager,
  amountUstx,
  lockup: { kind: 'btc', outputs: [lockupOutput], unlockBytes },
  publicKey: stakerPublicKey,
  fee,
  nonce,
  network,
  postConditionMode: 'allow', // register locks STX; Deny mode would abort it
});

// Optional preflight: returns the contract's abort reasons in evaluation order.
const { eligible, reasons } = await fetchEligibleRegisterForBond({ ... });

@jannik-stacks
jannik-stacks force-pushed the feat/bitcoin-staking branch from 9ba42bc to ef8b30e Compare May 11, 2026 13:49
@github-actions

github-actions Bot commented May 25, 2026 •

Copy link
Copy Markdown
Contributor

Public API Surface Changes

1 package affected · +196 added

@stacks/bitcoin-staking (+196)

Added

+ AccountStatus: interface = AccountStatus
+ B58_ADDR_PREFIXES: value = RegExp
+ BITCOIN_LOCKTIME_THRESHOLD: value = 500000000n
+ BitcoinNetworkVersion: value = { readonly mainnet: { readonly P2PKH: 0; readonly P2SH: 5; }; readonly testnet: { readonly P2PKH: 111; readonly P2SH: 196; }; readonly devnet: { readonly P2PKH: 111; readonly P2SH: 196; }; readonly mocknet: { readonly P2PKH: 111; readonly P2SH: 196; }; }
+ Bond: interface = Bond
+ BOND_END_OFFSET_PERIODS: value = number
+ BOND_GAP_CYCLES: value = 2
+ BOND_LENGTH_CYCLES: value = 12
+ BondL1LockupOutput: interface = BondL1LockupOutput
+ BondLockup: type = BondLockup
+ BondMembership: interface = BondMembership
+ bondPeriodToBurnHeight: function = (opts: { bondIndex: number; poxInfo: PoxInfo; }) => number
+ bondPeriodToRewardCycle: function = (opts: { bondIndex: number; poxInfo: PoxInfo; }) => number
+ BondPhaseName: type = BondPhaseName
+ BondPhaseRange: interface = BondPhaseRange
+ bondPhaseRanges: function = (opts: { bondIndex: number; poxInfo: PoxInfo; }) => BondPhaseRange[]
+ bondRegisterRanges: function = (opts: { bondIndex: number; poxInfo: PoxInfo; }) => BurnHeightRange[]
+ bondStatus: function = (opts: { bondIndex: number; poxInfo: PoxInfo; isBondSetup: boolean; }) => BondStatusName
+ BondStatusName: type = BondStatusName
+ BtcAddress: namespace = namespace
+ BtcAddressRepr: interface = BtcAddressRepr
+ btcNetworkFrom: function = (network: "mainnet" | "testnet" | "devnet" | "mocknet" | StacksNetwork) => BTC_NETWORK
+ buildAnnounceL1EarlyExit: function = (args: { staker: string; oldSignerManager: string; } & TxParams) => Promise<StacksTransactionWire>
+ buildCalculateRewards: function = (args: { bondIndices: number[]; } & TxParams) => Promise<StacksTransactionWire>
+ buildClaimRewards: function = (args: { rewardCycle: number; bondIndices: number[]; } & TxParams) => Promise<StacksTransactionWire>
+ buildClaimStakerRewardsForSigner: function = (args: { staker: string; rewardCycle: number; bondIndex?: number; } & TxParams) => Promise<StacksTransactionWire>
+ buildGrantSignerKey: function = (args: BuildGrantSignerKeyTxArgs) => Promise<StacksTransactionWire>
+ BuildGrantSignerKeyTxArgs: type = BuildGrantSignerKeyTxArgs
+ buildLockAddress: function = (opts: { stxAddress: string; unlockHeight: IntegerType; publicKey: Uint8Array | string; earlyUnlockBytes: Uint8Array | string; network: StacksNetworkName | StacksNetwork; validateEarlyUnlockBytes?: boolean; }) => string
+ buildLockAddress: function = (opts: { stxAddress: string; unlockHeight: IntegerType; unlockBytes: Uint8Array | string; earlyUnlockBytes: Uint8Array | string; network: StacksNetworkName | StacksNetwork; validateEarlyUnlockBytes?: boolean; }) => string
+ buildLockOutputScript: function = (opts: { stxAddress: string; unlockHeight: IntegerType; unlockBytes: Uint8Array | string; earlyUnlockBytes: Uint8Array | string; }) => Uint8Array<ArrayBufferLike>
+ buildLockProof: function = (input: { txHex: string; header: Uint8Array | string; merkleProof: EsploraMerkleProof; txCount: number; unlockHeight: IntegerType; outputIndex?: number; } & ExpectedScriptInput) => BondL1LockupOutput
+ buildLockProofFromBlock: function = (input: { txHex: string; header: Uint8Array | string; blockHeight: number; txids: string[]; unlockHeight: IntegerType; outputIndex?: number; } & ExpectedScriptInput) => BondL1LockupOutput
+ buildLockScript: function = (opts: { stxAddress: string; unlockHeight: IntegerType; unlockBytes: Uint8Array | string; earlyUnlockBytes: Uint8Array | string; validateEarlyUnlockBytes?: boolean; }) => Uint8Array<ArrayBufferLike>
+ buildPauseRewards: function = (args: TxParams) => Promise<StacksTransactionWire>
+ buildReclaim: function = (opts: BuildReclaimOpts) => btc.Transaction
+ BuildReclaimOpts: interface = BuildReclaimOpts
+ buildRegisterForBond: function = (args: { bondIndex: number; signerManager: string; amountUstx: IntegerType; lockup: BondLockup; signerCalldata?: Uint8Array | string; } & TxParams) => Promise<StacksTransactionWire>
+ buildRegisterMetadata: function = (opts: { bondIndex: number; poxInfo: PoxInfo; bitcoinPublicKey: Uint8Array | string; stxAddress: string; earlyUnlockBytes: Uint8Array | string; network: StacksNetworkName | StacksNetwork; validateEarlyUnlockBytes?: boolean; }) => RegisterMetadata
+ buildRevokeSignerGrant: function = (args: BuildRevokeSignerKeyTxArgs) => Promise<StacksTransactionWire>
+ BuildRevokeSignerKeyTxArgs: type = BuildRevokeSignerKeyTxArgs
+ buildSetBondAdmin: function = (args: BuildSetBondAdminArgs & TxParams) => Promise<StacksTransactionWire>
+ BuildSetBondAdminArgs: interface = BuildSetBondAdminArgs
+ buildSetPauseAdmin: function = (args: BuildSetPauseAdminArgs & TxParams) => Promise<StacksTransactionWire>
+ BuildSetPauseAdminArgs: interface = BuildSetPauseAdminArgs
+ buildSetupBond: function = (args: { bondIndex: number; targetRateBps: IntegerType; stxValueRatio: IntegerType; minUstxRatioBps: IntegerType; earlyUnlockBytes: Uint8Array | string; allowlist: { staker: string; maxSats: IntegerType; }[]; } & TxParams) => Promise<StacksTransactionWire>
+ buildSignerCalldata: function = (opts: SignerCalldataL1Payout) => Uint8Array<ArrayBufferLike>
+ buildSignerGrantMessage: function = (opts: SignerKeyGrantOptions) => { message: ClarityValue; domain: ClarityValue; }
+ buildStake: function = (args: { signerManager: string; amountUstx: IntegerType; numCycles: number; startBurnHt: number; signerCalldata?: Uint8Array | string; } & TxParams) => Promise<StacksTransactionWire>
+ buildStakeUpdate: function = (args: { signerManager: string; oldSignerManager: string; cyclesToExtend?: number; amountIncrease?: IntegerType; signerCalldata?: Uint8Array | string; } & TxParams) => Promise<StacksTransactionWire>
+ buildUnlockScript: function = (publicKey: string | Uint8Array<ArrayBufferLike>) => Uint8Array<ArrayBufferLike>
+ buildUnstake: function = (args: { oldSignerManager: string; } & TxParams) => Promise<StacksTransactionWire>
+ buildUnstakeSbtc: function = (args: { signerManager: string; amountToWithdrawSats: IntegerType; } & TxParams) => Promise<StacksTransactionWire>
+ buildUpdateBondRegistration: function = (args: { signerManager: string; oldSignerManager: string; signerCalldata?: Uint8Array | string; } & TxParams) => Promise<StacksTransactionWire>
+ BurnHeightRange: interface = BurnHeightRange
+ burnHeightToDistributionIndex: function = (opts: { burnHeight: number; poxInfo: PoxInfo; }) => number
+ burnHeightToRewardCycle: function = (opts: { burnHeight: number; poxInfo: PoxInfo; }) => number
+ C_SCRIPT_NUM_MAX: value = 549755813888n
+ computeBitcoinTxid: function = (rawTx: Uint8Array<ArrayBufferLike>) => Uint8Array<ArrayBufferLike>
+ computeBondUnlockHeight: function = (opts: { bondIndex: number; poxInfo: PoxInfo; }) => number
+ computeMerkleBranch: function = (txids: string[], pos: number) => string[]
+ computeReclaimSighash: function = (tx: btc.Transaction, opts?: { witnessScript?: Uint8Array | string; amountSats?: IntegerType; } | undefined) => Uint8Array<ArrayBufferLike>
+ computeRegisterPreimage: function = (stxAddress: string) => Uint8Array<ArrayBufferLike>
+ computeSignerGrantHash: function = (opts: SignerKeyGrantOptions) => Uint8Array<ArrayBufferLike>
+ ConstructLockupParams: interface = ConstructLockupParams
+ currentDistributionCycle: function = (poxInfo: PoxInfo) => number
+ CycleInfo: interface = CycleInfo
+ describePox5Error: function = (code: number | bigint) => { code: number; name: string; description: string; } | undefined
+ distributionCycleToBurnHeight: function = (opts: { distributionCycle: number; poxInfo: PoxInfo; }) => number
+ EarnedRewards: type = bigint
+ EligibilityResult: type = EligibilityResult
+ EsploraMerkleProof: interface = EsploraMerkleProof
+ ExpectedScriptInput: type = ExpectedScriptInput
+ fetchAccountStatus: function = (opts: { address: string; } & NetworkParam & ClientParam) => Promise<AccountStatus>
+ fetchAmountDelegatedForSigner: function = (opts: { signerManager: string; rewardCycle: number; } & NetworkParam & ClientParam) => Promise<bigint>
+ fetchBond: function = (opts: { bondIndex: number; } & NetworkParam & ClientParam) => Promise<Bond | undefined>
+ fetchBondAdmin: function = (opts?: NetworkClientParam) => Promise<string>
+ fetchBondAllowance: function = (opts: { bondIndex: number; address: string; } & NetworkParam & ClientParam) => Promise<bigint | undefined>
+ fetchBondL1UnlockHeight: function = (opts: { bondIndex: number; } & NetworkParam & ClientParam) => Promise<bigint>
+ fetchBondMembership: function = (opts: { address: string; } & NetworkParam & ClientParam) => Promise<BondMembership | undefined>
+ fetchBondOverlapsNewPosition: function = (opts: { membership: BondMembership | undefined; newFirstRewardCycle: number; } & NetworkParam & ClientParam) => Promise<boolean>
+ fetchBondStatus: function = (opts: { bondIndex: number; poxInfo?: PoxInfo; isBondSetup?: boolean; } & NetworkParam & ClientParam) => Promise<BondStatusName>
+ fetchBurnBlockHeaderHash: function = (opts: { burnHeight: number; } & NetworkParam & ClientParam) => Promise<Uint8Array<ArrayBufferLike> | undefined>
+ fetchConstructLockupOutputScript: function = (opts: ConstructLockupParams & NetworkParam & ClientParam) => Promise<Uint8Array<ArrayBufferLike>>
+ fetchConstructLockupScript: function = (opts: ConstructLockupParams & NetworkParam & ClientParam) => Promise<Uint8Array<ArrayBufferLike>>
+ fetchEarned: function = (opts: { signerManager: string; rewardCycle: number; bondIndex?: number; } & NetworkParam & ClientParam) => Promise<bigint>
+ fetchEarnedStakerRewards: function = (opts: { signerManager: string; rewardCycle: number; bondIndex?: number; staker: string; } & NetworkParam & ClientParam) => Promise<bigint>
+ fetchEligibleAnnounceL1EarlyExit: function = (opts: { staker: string; oldSignerManager: string; poxInfo?: PoxInfo; } & NetworkParam & ClientParam) => Promise<EligibilityResult>
+ fetchEligibleCalculateRewards: function = (opts: { bondIndices: number[]; poxInfo?: PoxInfo; } & NetworkParam & ClientParam) => Promise<EligibilityResult>
+ fetchEligibleClaimRewards: function = (opts: { signerManager: string; rewardCycle: number; bondIndices: number[]; } & NetworkParam & ClientParam) => Promise<EligibilityResult>
+ fetchEligibleGrantSignerKey: function = (opts: { signerKey: Uint8Array | string; signerManager: string; authId: IntegerType; signerSignature: Uint8Array | string; } & NetworkParam & ClientParam) => Promise<EligibilityResult>
+ fetchEligibleRegisterForBond: function = (opts: { bondIndex: number; staker: string; amountUstx: IntegerType; lockup: BondLockup; signerManager: string; poxInfo?: PoxInfo; } & NetworkParam & ClientParam) => Promise<EligibilityResult>
+ fetchEligibleRevokeSignerGrant: function = (opts: { signerKey: Uint8Array | string; caller: string; } & NetworkParam & ClientParam) => Promise<EligibilityResult>
+ fetchEligibleSetBondAdmin: function = (opts: { caller: string; } & NetworkParam & ClientParam) => Promise<EligibilityResult>
+ fetchEligibleSetupBond: function = (opts: { bondIndex: number; allowlist: { staker: string; maxSats: IntegerType; }[]; caller: string; poxInfo?: PoxInfo; } & NetworkParam & ClientParam) => Promise<EligibilityResult>
+ fetchEligibleStake: function = (opts: { staker: string; signerManager: string; amountUstx: IntegerType; numCycles: number; startBurnHt: number; poxInfo?: PoxInfo; } & NetworkParam & ClientParam) => Promise<EligibilityResult>
+ fetchEligibleStakeUpdate: function = (opts: { staker: string; signerManager: string; oldSignerManager: string; cyclesToExtend?: number; amountIncrease?: IntegerType; poxInfo?: PoxInfo; } & NetworkParam & ClientParam) => Promise<EligibilityResult>
+ fetchEligibleUnstake: function = (opts: { staker: string; oldSignerManager: string; poxInfo?: PoxInfo; } & NetworkParam & ClientParam) => Promise<EligibilityResult>
+ fetchEligibleUnstakeSbtc: function = (opts: { staker: string; signerManager: string; amountToWithdrawSats: IntegerType; poxInfo?: PoxInfo; } & NetworkParam & ClientParam) => Promise<EligibilityResult>
+ fetchEligibleUpdateBondRegistration: function = (opts: { staker: string; signerManager: string; oldSignerManager: string; poxInfo?: PoxInfo; } & NetworkParam & ClientParam) => Promise<EligibilityResult>
+ fetchHasAnnouncedL1EarlyExit: function = (opts: { bondIndex: number; staker: string; } & NetworkParam & ClientParam) => Promise<boolean>
+ fetchLastAccountedRewards: function = (opts?: NetworkClientParam) => Promise<bigint>
+ fetchLastRewardComputeHeight: function = (opts?: NetworkClientParam) => Promise<number>
+ fetchNewRewards: function = (opts?: NetworkClientParam) => Promise<bigint>
+ fetchParseBlockHeader: function = (opts: { header: Uint8Array | string; } & NetworkParam & ClientParam) => Promise<ParsedBlockHeader>
+ fetchPauseAdmin: function = (opts?: NetworkClientParam) => Promise<string>
+ fetchPoxInfo: function = (opts?: NetworkClientParam) => Promise<PoxInfo>
+ fetchProtocolBond: function = (opts: { bondIndex: number; } & NetworkParam & ClientParam) => Promise<Bond | undefined>
+ fetchProtocolBondMemberships: function = (opts: { address: string; } & NetworkParam & ClientParam) => Promise<BondMembership | undefined>
+ fetchPushCScriptNum: function = (opts: { n: number | bigint; } & NetworkParam & ClientParam) => Promise<Uint8Array<ArrayBufferLike>>
+ fetchPushScriptBytes: function = (opts: { bytes: Uint8Array | string; } & NetworkParam & ClientParam) => Promise<Uint8Array<ArrayBufferLike>>
+ fetchReserveBalance: function = (opts?: NetworkClientParam) => Promise<bigint>
+ fetchReverseBuff32: function = (opts: { input: Uint8Array | string; } & NetworkParam & ClientParam) => Promise<Uint8Array<ArrayBufferLike>>
+ fetchReversedTxid: function = (opts: { tx: Uint8Array | string; } & NetworkParam & ClientParam) => Promise<Uint8Array<ArrayBufferLike>>
+ fetchRewards: function = (opts?: NetworkClientParam) => Promise<bigint>
+ fetchRewardsPaused: function = (opts?: NetworkClientParam) => Promise<boolean>
+ fetchRewardsPerTokenForCycle: function = (opts: { rewardCycle: number; bondIndex?: number; } & NetworkParam & ClientParam) => Promise<bigint>
+ fetchSerializeCScriptNum: function = (opts: { n: number | bigint; } & NetworkParam & ClientParam) => Promise<Uint8Array<ArrayBufferLike>>
+ fetchSignerCycleMembership: function = (opts: { staker: string; rewardCycle: number; } & NetworkParam & ClientParam) => Promise<{ amountUstx: bigint; signer: string; } | undefined>
+ fetchSignerGrantMessageHash: function = (opts: { signerManager: string; authId: IntegerType; } & NetworkParam & ClientParam) => Promise<string>
+ fetchSignerInfo: function = (opts: { signerManager: string; } & NetworkParam & ClientParam) => Promise<{ signerKey: string; } | undefined>
+ fetchSignerKeyGrantUsed: function = (opts: { signerKey: Uint8Array | string; signerManager: string; authId: IntegerType; } & NetworkParam & ClientParam) => Promise<boolean>
+ fetchSignerPendingStakedUstx: function = (opts: { signerManager: string; rewardCycle: number; } & NetworkParam & ClientParam) => Promise<bigint>
+ fetchSignerRewardsPerTokenForCycle: function = (opts: { signerManager: string; rewardCycle: number; bondIndex?: number; } & NetworkParam & ClientParam) => Promise<bigint>
+ fetchSignerRewardsPerTokenSettled: function = (opts: { signerManager: string; rewardCycle: number; bondIndex?: number; } & NetworkParam & ClientParam) => Promise<bigint>
+ fetchSignerSetContainsForCycle: function = (opts: { signer: string; rewardCycle: number; } & NetworkParam & ClientParam) => Promise<boolean>
+ fetchSignerSetFirstItem: function = (opts: { rewardCycle: number; } & NetworkParam & ClientParam) => Promise<string | undefined>
+ fetchSignerSetItem: function = (opts: { signer: string; rewardCycle: number; } & NetworkParam & ClientParam) => Promise<{ prev: string | undefined; next: string | undefined; } | undefined>
+ fetchSignerSetLastItem: function = (opts: { rewardCycle: number; } & NetworkParam & ClientParam) => Promise<string | undefined>
+ fetchSignerSetNextItem: function = (opts: { signer: string; rewardCycle: number; } & NetworkParam & ClientParam) => Promise<string | undefined>
+ fetchSignerSetPrevItem: function = (opts: { signer: string; rewardCycle: number; } & NetworkParam & ClientParam) => Promise<string | undefined>
+ fetchSignerSharesStakedForCycle: function = (opts: { signerManager: string; rewardCycle: number; bondIndex?: number; } & NetworkParam & ClientParam) => Promise<bigint>
+ fetchSignerUnclaimedRewards: function = (opts: { signerManager: string; rewardCycle: number; bondIndex?: number; } & NetworkParam & ClientParam) => Promise<bigint>
+ fetchStakerCustodiedSbtc: function = (opts: { staker: string; } & NetworkParam & ClientParam) => Promise<bigint>
+ fetchStakerInfo: function = (opts: { address: string; } & NetworkParam & ClientParam) => Promise<StakerInfo>
+ fetchStakerRewardsPerTokenSettled: function = (opts: { signerManager: string; rewardCycle: number; bondIndex?: number; staker: string; } & NetworkParam & ClientParam) => Promise<bigint>
+ fetchStakerSharesStakedForCycle: function = (opts: { staker: string; signer: string; rewardCycle: number; bondIndex?: number; } & NetworkParam & ClientParam) => Promise<bigint>
+ fetchStakerUnclaimedRewards: function = (opts: { signerManager: string; rewardCycle: number; bondIndex?: number; staker: string; } & NetworkParam & ClientParam) => Promise<bigint>
+ fetchTotalSbtcStaked: function = (opts?: NetworkClientParam) => Promise<bigint>
+ fetchTotalSbtcStakedForBond: function = (opts: { bondIndex: number; } & NetworkParam & ClientParam) => Promise<bigint>
+ fetchTotalSharesStakedForCycle: function = (opts: { rewardCycle: number; bondIndex?: number; } & NetworkParam & ClientParam) => Promise<bigint>
+ fetchTotalUstxStacked: function = (opts: { rewardCycle: number; } & NetworkParam & ClientParam) => Promise<bigint>
+ fetchUintToBuffLe: function = (opts: { n: number | bigint; } & NetworkParam & ClientParam) => Promise<Uint8Array<ArrayBufferLike>>
+ fetchUstxDelegatedForCycle: function = (opts: { rewardCycle: number; } & NetworkParam & ClientParam) => Promise<bigint>
+ fetchVerifyBlockHeader: function = (opts: { header: Uint8Array | string; burnHeight: number; } & NetworkParam & ClientParam) => Promise<boolean>
+ fetchVerifySignerKeyGrant: function = (opts: { signerKey: Uint8Array | string; signerManager: string; } & NetworkParam & ClientParam) => Promise<boolean>
+ finalizeReclaim: function = (opts: FinalizeReclaimOpts) => { txHex: string; txid: string; }
+ FinalizeReclaimOpts: type = FinalizeReclaimOpts
+ firstPox5RewardCycle: function = (poxInfo: PoxInfo) => number | undefined
+ isBondActiveAtHeight: function = (opts: { bondIndex: number; burnHeight: number; poxInfo: PoxInfo; }) => boolean
+ isInPreparePhase: function = (opts: { burnHeight: number; poxInfo: PoxInfo; }) => boolean
+ MAX_NUM_CYCLES: value = 96
+ minUstxForSatsAmount: function = (opts: { sats: IntegerType; stxValueRatio: IntegerType; minUstxRatioBps: IntegerType; }) => bigint
+ MultiSigTxParams: type = MultiSigTxParams
+ networkNameFrom: function = (network: "mainnet" | "testnet" | "devnet" | "mocknet" | StacksNetwork) => "mainnet" | "testnet" | "devnet" | "mocknet"
+ NextCycleInfo: interface = NextCycleInfo
+ ParsedBlockHeader: interface = ParsedBlockHeader
+ parsePox5Error: function = (result: string | ClarityValue | undefined) => number | undefined
+ parseSignerCalldata: function = (calldata: string | Uint8Array<ArrayBufferLike>) => { poxAddress: BtcAddressRepr; maxFeeSats: bigint; }
+ POX_ADDR_DATA_LENGTH: value = Record<PoXAddressVersion, number>
+ POX5_CONTRACT_NAME: value = "pox-5"
+ POX5_ERROR_DESCRIPTIONS: value = Record<Pox5ErrorCode, string>
+ POX5_ERROR_NAMES: value = Record<Pox5ErrorCode, string>
+ Pox5ErrorCode: enum = { Unauthorized = 1, CannotSetupBondTooSoon = 2, CannotSetupBondTooLate = 3, BondAlreadySetup = 4, StakerAlreadyAdded = 5, BondNotFound = 7, InsufficientStx = 8, AlreadyRegistered = 9, TooMuchSats = 10, NotAllowlisted = 11, SignerKeyGrantUsed = 12, InvalidSignatureRecover = 13, InvalidSignaturePubkey = 14, SignerKeyGrantNotFound = 17, AlreadyStaked = 19, InvalidNumCycles = 20, SignerNotFound = 23, InvalidStartBurnHeight = 24, UnauthorizedSignerRegistration = 26, NotStaking = 27, UnstakeInPreparePhase = 28, InvalidBondPeriodOrdering = 29, DistributionAlreadyComputed = 30, BondNotActive = 31, NoClaimableRewards = 32, ActiveBondNotIncluded = 33, NotBondParticipant = 34, CannotAnnounceL1EarlyUnlock = 35, InvalidOldSignerManager = 36, InvalidUnstakeSbtcAmount = 37, CannotUnstakeSbtc = 38, ReadTxOutOfBounds = 39, InvalidBtcHeader = 40, InvalidMerkleProof = 41, InvalidLockupScript = 42, BondAlreadyStarted = 43, UpdateBondSameSigner = 44, InvalidLockupAmount = 45, DuplicateLockupOutpoint = 46, StakeInPreparePhase = 47, RolloverTooEarly = 48, ReentrantCall = 49, L1EarlyExitAlreadyAnnounced = 50, InsufficientReserveBalance = 51, InvalidUnlockHeight = 52, RewardsPaused = 53 }
+ PoXAddressVersion: enum = { P2PKH = 0, P2SH = 1, P2SHP2WPKH = 2, P2SHP2WSH = 3, P2WPKH = 4, P2WSH = 5, P2TR = 6 }
+ PoxContractVersion: interface = PoxContractVersion
+ PoxInfo: interface = PoxInfo
+ pushCScriptNum: function = (n: number | bigint) => Uint8Array<ArrayBufferLike>
+ pushScriptBytes: function = (bytes: Uint8Array<ArrayBufferLike>) => Uint8Array<ArrayBufferLike>
+ ReclaimPath: type = ReclaimPath
+ RegisterMetadata: interface = RegisterMetadata
+ rewardCycleToBurnHeight: function = (opts: { rewardCycle: number; poxInfo: PoxInfo; }) => number
+ scriptToAddress: function = (script: Uint8Array<ArrayBufferLike>, network: "mainnet" | "testnet" | "devnet" | "mocknet" | StacksNetwork) => string
+ scriptToWshOutput: function = (script: Uint8Array<ArrayBufferLike>) => Uint8Array<ArrayBufferLike>
+ SEGWIT_ADDR_PREFIXES: value = RegExp
+ SEGWIT_V0: value = 0
+ SEGWIT_V0_ADDR_PREFIX: value = RegExp
+ SEGWIT_V1: value = 1
+ SEGWIT_V1_ADDR_PREFIX: value = RegExp
+ SegwitPrefix: value = { readonly mainnet: "bc"; readonly testnet: "tb"; readonly devnet: "bcrt"; readonly mocknet: "bcrt"; }
+ serializeBitcoinHeader: function = (header: string | Uint8Array<ArrayBufferLike>) => Uint8Array<ArrayBufferLike>
+ serializeBitcoinTx: function = (tx: string | Uint8Array<ArrayBufferLike>) => Uint8Array<ArrayBufferLike>
+ serializeCScriptNum: function = (n: number | bigint) => Uint8Array<ArrayBufferLike>
+ SignerCalldataL1Payout: interface = SignerCalldataL1Payout
+ SignerKeyGrantOptions: interface = SignerKeyGrantOptions
+ signReclaim: function = (sighash: Uint8Array<ArrayBufferLike>, privateKey: PrivateKey, opts?: { lowR?: boolean; } | undefined) => Uint8Array<ArrayBufferLike>
+ signSignerGrant: function = (opts: SignerKeyGrantOptions & { privateKey: PrivateKey; }) => string
+ SingleSigTxParams: interface = SingleSigTxParams
+ StakerInfo: type = StakerInfo
+ StakerInfoDetails: interface = StakerInfoDetails
+ toConsensusBuff: function = (addr: string) => Uint8Array<ArrayBufferLike>
+ TxParams: type = TxParams
+ TxParamsBase: interface = TxParamsBase
+ Utxo: interface = Utxo
+ validateEarlyUnlockBytes: function = (earlyUnlockBytes: string | Uint8Array<ArrayBufferLike>, opts?: { shape?: boolean; }) => Uint8Array<ArrayBufferLike>
+ verifySignerGrant: function = (opts: SignerKeyGrantOptions & { publicKey: string | Uint8Array; signature: string | Uint8Array; }) => boolean
View full JSONL diff
+ ["@stacks/bitcoin-staking",".","named","AccountStatus","interface","AccountStatus"]
+ ["@stacks/bitcoin-staking",".","named","B58_ADDR_PREFIXES","value","RegExp"]
+ ["@stacks/bitcoin-staking",".","named","BITCOIN_LOCKTIME_THRESHOLD","value","500000000n"]
+ ["@stacks/bitcoin-staking",".","named","BitcoinNetworkVersion","value","{ readonly mainnet: { readonly P2PKH: 0; readonly P2SH: 5; }; readonly testnet: { readonly P2PKH: 111; readonly P2SH: 196; }; readonly devnet: { readonly P2PKH: 111; readonly P2SH: 196; }; readonly mocknet: { readonly P2PKH: 111; readonly P2SH: 196; }; }"]
+ ["@stacks/bitcoin-staking",".","named","Bond","interface","Bond"]
+ ["@stacks/bitcoin-staking",".","named","BOND_END_OFFSET_PERIODS","value","number"]
+ ["@stacks/bitcoin-staking",".","named","BOND_GAP_CYCLES","value","2"]
+ ["@stacks/bitcoin-staking",".","named","BOND_LENGTH_CYCLES","value","12"]
+ ["@stacks/bitcoin-staking",".","named","BondL1LockupOutput","interface","BondL1LockupOutput"]
+ ["@stacks/bitcoin-staking",".","named","BondLockup","type","BondLockup"]
+ ["@stacks/bitcoin-staking",".","named","BondMembership","interface","BondMembership"]
+ ["@stacks/bitcoin-staking",".","named","bondPeriodToBurnHeight","function","(opts: { bondIndex: number; poxInfo: PoxInfo; }) => number"]
+ ["@stacks/bitcoin-staking",".","named","bondPeriodToRewardCycle","function","(opts: { bondIndex: number; poxInfo: PoxInfo; }) => number"]
+ ["@stacks/bitcoin-staking",".","named","BondPhaseName","type","BondPhaseName"]
+ ["@stacks/bitcoin-staking",".","named","BondPhaseRange","interface","BondPhaseRange"]
+ ["@stacks/bitcoin-staking",".","named","bondPhaseRanges","function","(opts: { bondIndex: number; poxInfo: PoxInfo; }) => BondPhaseRange[]"]
+ ["@stacks/bitcoin-staking",".","named","bondRegisterRanges","function","(opts: { bondIndex: number; poxInfo: PoxInfo; }) => BurnHeightRange[]"]
+ ["@stacks/bitcoin-staking",".","named","bondStatus","function","(opts: { bondIndex: number; poxInfo: PoxInfo; isBondSetup: boolean; }) => BondStatusName"]
+ ["@stacks/bitcoin-staking",".","named","BondStatusName","type","BondStatusName"]
+ ["@stacks/bitcoin-staking",".","named","BtcAddress","namespace","namespace"]
+ ["@stacks/bitcoin-staking",".","named","BtcAddressRepr","interface","BtcAddressRepr"]
+ ["@stacks/bitcoin-staking",".","named","btcNetworkFrom","function","(network: \"mainnet\" | \"testnet\" | \"devnet\" | \"mocknet\" | StacksNetwork) => BTC_NETWORK"]
+ ["@stacks/bitcoin-staking",".","named","buildAnnounceL1EarlyExit","function","(args: { staker: string; oldSignerManager: string; } & TxParams) => Promise<StacksTransactionWire>"]
+ ["@stacks/bitcoin-staking",".","named","buildCalculateRewards","function","(args: { bondIndices: number[]; } & TxParams) => Promise<StacksTransactionWire>"]
+ ["@stacks/bitcoin-staking",".","named","buildClaimRewards","function","(args: { rewardCycle: number; bondIndices: number[]; } & TxParams) => Promise<StacksTransactionWire>"]
+ ["@stacks/bitcoin-staking",".","named","buildClaimStakerRewardsForSigner","function","(args: { staker: string; rewardCycle: number; bondIndex?: number; } & TxParams) => Promise<StacksTransactionWire>"]
+ ["@stacks/bitcoin-staking",".","named","buildGrantSignerKey","function","(args: BuildGrantSignerKeyTxArgs) => Promise<StacksTransactionWire>"]
+ ["@stacks/bitcoin-staking",".","named","BuildGrantSignerKeyTxArgs","type","BuildGrantSignerKeyTxArgs"]
+ ["@stacks/bitcoin-staking",".","named","buildLockAddress","function","(opts: { stxAddress: string; unlockHeight: IntegerType; publicKey: Uint8Array | string; earlyUnlockBytes: Uint8Array | string; network: StacksNetworkName | StacksNetwork; validateEarlyUnlockBytes?: boolean; }) => string"]
+ ["@stacks/bitcoin-staking",".","named","buildLockAddress","function","(opts: { stxAddress: string; unlockHeight: IntegerType; unlockBytes: Uint8Array | string; earlyUnlockBytes: Uint8Array | string; network: StacksNetworkName | StacksNetwork; validateEarlyUnlockBytes?: boolean; }) => string"]
+ ["@stacks/bitcoin-staking",".","named","buildLockOutputScript","function","(opts: { stxAddress: string; unlockHeight: IntegerType; unlockBytes: Uint8Array | string; earlyUnlockBytes: Uint8Array | string; }) => Uint8Array<ArrayBufferLike>"]
+ ["@stacks/bitcoin-staking",".","named","buildLockProof","function","(input: { txHex: string; header: Uint8Array | string; merkleProof: EsploraMerkleProof; txCount: number; unlockHeight: IntegerType; outputIndex?: number; } & ExpectedScriptInput) => BondL1LockupOutput"]
+ ["@stacks/bitcoin-staking",".","named","buildLockProofFromBlock","function","(input: { txHex: string; header: Uint8Array | string; blockHeight: number; txids: string[]; unlockHeight: IntegerType; outputIndex?: number; } & ExpectedScriptInput) => BondL1LockupOutput"]
+ ["@stacks/bitcoin-staking",".","named","buildLockScript","function","(opts: { stxAddress: string; unlockHeight: IntegerType; unlockBytes: Uint8Array | string; earlyUnlockBytes: Uint8Array | string; validateEarlyUnlockBytes?: boolean; }) => Uint8Array<ArrayBufferLike>"]
+ ["@stacks/bitcoin-staking",".","named","buildPauseRewards","function","(args: TxParams) => Promise<StacksTransactionWire>"]
+ ["@stacks/bitcoin-staking",".","named","buildReclaim","function","(opts: BuildReclaimOpts) => btc.Transaction"]
+ ["@stacks/bitcoin-staking",".","named","BuildReclaimOpts","interface","BuildReclaimOpts"]
+ ["@stacks/bitcoin-staking",".","named","buildRegisterForBond","function","(args: { bondIndex: number; signerManager: string; amountUstx: IntegerType; lockup: BondLockup; signerCalldata?: Uint8Array | string; } & TxParams) => Promise<StacksTransactionWire>"]
+ ["@stacks/bitcoin-staking",".","named","buildRegisterMetadata","function","(opts: { bondIndex: number; poxInfo: PoxInfo; bitcoinPublicKey: Uint8Array | string; stxAddress: string; earlyUnlockBytes: Uint8Array | string; network: StacksNetworkName | StacksNetwork; validateEarlyUnlockBytes?: boolean; }) => RegisterMetadata"]
+ ["@stacks/bitcoin-staking",".","named","buildRevokeSignerGrant","function","(args: BuildRevokeSignerKeyTxArgs) => Promise<StacksTransactionWire>"]
+ ["@stacks/bitcoin-staking",".","named","BuildRevokeSignerKeyTxArgs","type","BuildRevokeSignerKeyTxArgs"]
+ ["@stacks/bitcoin-staking",".","named","buildSetBondAdmin","function","(args: BuildSetBondAdminArgs & TxParams) => Promise<StacksTransactionWire>"]
+ ["@stacks/bitcoin-staking",".","named","BuildSetBondAdminArgs","interface","BuildSetBondAdminArgs"]
+ ["@stacks/bitcoin-staking",".","named","buildSetPauseAdmin","function","(args: BuildSetPauseAdminArgs & TxParams) => Promise<StacksTransactionWire>"]
+ ["@stacks/bitcoin-staking",".","named","BuildSetPauseAdminArgs","interface","BuildSetPauseAdminArgs"]
+ ["@stacks/bitcoin-staking",".","named","buildSetupBond","function","(args: { bondIndex: number; targetRateBps: IntegerType; stxValueRatio: IntegerType; minUstxRatioBps: IntegerType; earlyUnlockBytes: Uint8Array | string; allowlist: { staker: string; maxSats: IntegerType; }[]; } & TxParams) => Promise<StacksTransactionWire>"]
+ ["@stacks/bitcoin-staking",".","named","buildSignerCalldata","function","(opts: SignerCalldataL1Payout) => Uint8Array<ArrayBufferLike>"]
+ ["@stacks/bitcoin-staking",".","named","buildSignerGrantMessage","function","(opts: SignerKeyGrantOptions) => { message: ClarityValue; domain: ClarityValue; }"]
+ ["@stacks/bitcoin-staking",".","named","buildStake","function","(args: { signerManager: string; amountUstx: IntegerType; numCycles: number; startBurnHt: number; signerCalldata?: Uint8Array | string; } & TxParams) => Promise<StacksTransactionWire>"]
+ ["@stacks/bitcoin-staking",".","named","buildStakeUpdate","function","(args: { signerManager: string; oldSignerManager: string; cyclesToExtend?: number; amountIncrease?: IntegerType; signerCalldata?: Uint8Array | string; } & TxParams) => Promise<StacksTransactionWire>"]
+ ["@stacks/bitcoin-staking",".","named","buildUnlockScript","function","(publicKey: string | Uint8Array<ArrayBufferLike>) => Uint8Array<ArrayBufferLike>"]
+ ["@stacks/bitcoin-staking",".","named","buildUnstake","function","(args: { oldSignerManager: string; } & TxParams) => Promise<StacksTransactionWire>"]
+ ["@stacks/bitcoin-staking",".","named","buildUnstakeSbtc","function","(args: { signerManager: string; amountToWithdrawSats: IntegerType; } & TxParams) => Promise<StacksTransactionWire>"]
+ ["@stacks/bitcoin-staking",".","named","buildUpdateBondRegistration","function","(args: { signerManager: string; oldSignerManager: string; signerCalldata?: Uint8Array | string; } & TxParams) => Promise<StacksTransactionWire>"]
+ ["@stacks/bitcoin-staking",".","named","BurnHeightRange","interface","BurnHeightRange"]
+ ["@stacks/bitcoin-staking",".","named","burnHeightToDistributionIndex","function","(opts: { burnHeight: number; poxInfo: PoxInfo; }) => number"]
+ ["@stacks/bitcoin-staking",".","named","burnHeightToRewardCycle","function","(opts: { burnHeight: number; poxInfo: PoxInfo; }) => number"]
+ ["@stacks/bitcoin-staking",".","named","C_SCRIPT_NUM_MAX","value","549755813888n"]
+ ["@stacks/bitcoin-staking",".","named","computeBitcoinTxid","function","(rawTx: Uint8Array<ArrayBufferLike>) => Uint8Array<ArrayBufferLike>"]
+ ["@stacks/bitcoin-staking",".","named","computeBondUnlockHeight","function","(opts: { bondIndex: number; poxInfo: PoxInfo; }) => number"]
+ ["@stacks/bitcoin-staking",".","named","computeMerkleBranch","function","(txids: string[], pos: number) => string[]"]
+ ["@stacks/bitcoin-staking",".","named","computeReclaimSighash","function","(tx: btc.Transaction, opts?: { witnessScript?: Uint8Array | string; amountSats?: IntegerType; } | undefined) => Uint8Array<ArrayBufferLike>"]
+ ["@stacks/bitcoin-staking",".","named","computeRegisterPreimage","function","(stxAddress: string) => Uint8Array<ArrayBufferLike>"]
+ ["@stacks/bitcoin-staking",".","named","computeSignerGrantHash","function","(opts: SignerKeyGrantOptions) => Uint8Array<ArrayBufferLike>"]
+ ["@stacks/bitcoin-staking",".","named","ConstructLockupParams","interface","ConstructLockupParams"]
+ ["@stacks/bitcoin-staking",".","named","currentDistributionCycle","function","(poxInfo: PoxInfo) => number"]
+ ["@stacks/bitcoin-staking",".","named","CycleInfo","interface","CycleInfo"]
+ ["@stacks/bitcoin-staking",".","named","describePox5Error","function","(code: number | bigint) => { code: number; name: string; description: string; } | undefined"]
+ ["@stacks/bitcoin-staking",".","named","distributionCycleToBurnHeight","function","(opts: { distributionCycle: number; poxInfo: PoxInfo; }) => number"]
+ ["@stacks/bitcoin-staking",".","named","EarnedRewards","type","bigint"]
+ ["@stacks/bitcoin-staking",".","named","EligibilityResult","type","EligibilityResult"]
+ ["@stacks/bitcoin-staking",".","named","EsploraMerkleProof","interface","EsploraMerkleProof"]
+ ["@stacks/bitcoin-staking",".","named","ExpectedScriptInput","type","ExpectedScriptInput"]
+ ["@stacks/bitcoin-staking",".","named","fetchAccountStatus","function","(opts: { address: string; } & NetworkParam & ClientParam) => Promise<AccountStatus>"]
+ ["@stacks/bitcoin-staking",".","named","fetchAmountDelegatedForSigner","function","(opts: { signerManager: string; rewardCycle: number; } & NetworkParam & ClientParam) => Promise<bigint>"]
+ ["@stacks/bitcoin-staking",".","named","fetchBond","function","(opts: { bondIndex: number; } & NetworkParam & ClientParam) => Promise<Bond | undefined>"]
+ ["@stacks/bitcoin-staking",".","named","fetchBondAdmin","function","(opts?: NetworkClientParam) => Promise<string>"]
+ ["@stacks/bitcoin-staking",".","named","fetchBondAllowance","function","(opts: { bondIndex: number; address: string; } & NetworkParam & ClientParam) => Promise<bigint | undefined>"]
+ ["@stacks/bitcoin-staking",".","named","fetchBondL1UnlockHeight","function","(opts: { bondIndex: number; } & NetworkParam & ClientParam) => Promise<bigint>"]
+ ["@stacks/bitcoin-staking",".","named","fetchBondMembership","function","(opts: { address: string; } & NetworkParam & ClientParam) => Promise<BondMembership | undefined>"]
+ ["@stacks/bitcoin-staking",".","named","fetchBondOverlapsNewPosition","function","(opts: { membership: BondMembership | undefined; newFirstRewardCycle: number; } & NetworkParam & ClientParam) => Promise<boolean>"]
+ ["@stacks/bitcoin-staking",".","named","fetchBondStatus","function","(opts: { bondIndex: number; poxInfo?: PoxInfo; isBondSetup?: boolean; } & NetworkParam & ClientParam) => Promise<BondStatusName>"]
+ ["@stacks/bitcoin-staking",".","named","fetchBurnBlockHeaderHash","function","(opts: { burnHeight: number; } & NetworkParam & ClientParam) => Promise<Uint8Array<ArrayBufferLike> | undefined>"]
+ ["@stacks/bitcoin-staking",".","named","fetchConstructLockupOutputScript","function","(opts: ConstructLockupParams & NetworkParam & ClientParam) => Promise<Uint8Array<ArrayBufferLike>>"]
+ ["@stacks/bitcoin-staking",".","named","fetchConstructLockupScript","function","(opts: ConstructLockupParams & NetworkParam & ClientParam) => Promise<Uint8Array<ArrayBufferLike>>"]
+ ["@stacks/bitcoin-staking",".","named","fetchEarned","function","(opts: { signerManager: string; rewardCycle: number; bondIndex?: number; } & NetworkParam & ClientParam) => Promise<bigint>"]
+ ["@stacks/bitcoin-staking",".","named","fetchEarnedStakerRewards","function","(opts: { signerManager: string; rewardCycle: number; bondIndex?: number; staker: string; } & NetworkParam & ClientParam) => Promise<bigint>"]
+ ["@stacks/bitcoin-staking",".","named","fetchEligibleAnnounceL1EarlyExit","function","(opts: { staker: string; oldSignerManager: string; poxInfo?: PoxInfo; } & NetworkParam & ClientParam) => Promise<EligibilityResult>"]
+ ["@stacks/bitcoin-staking",".","named","fetchEligibleCalculateRewards","function","(opts: { bondIndices: number[]; poxInfo?: PoxInfo; } & NetworkParam & ClientParam) => Promise<EligibilityResult>"]
+ ["@stacks/bitcoin-staking",".","named","fetchEligibleClaimRewards","function","(opts: { signerManager: string; rewardCycle: number; bondIndices: number[]; } & NetworkParam & ClientParam) => Promise<EligibilityResult>"]
+ ["@stacks/bitcoin-staking",".","named","fetchEligibleGrantSignerKey","function","(opts: { signerKey: Uint8Array | string; signerManager: string; authId: IntegerType; signerSignature: Uint8Array | string; } & NetworkParam & ClientParam) => Promise<EligibilityResult>"]
+ ["@stacks/bitcoin-staking",".","named","fetchEligibleRegisterForBond","function","(opts: { bondIndex: number; staker: string; amountUstx: IntegerType; lockup: BondLockup; signerManager: string; poxInfo?: PoxInfo; } & NetworkParam & ClientParam) => Promise<EligibilityResult>"]
+ ["@stacks/bitcoin-staking",".","named","fetchEligibleRevokeSignerGrant","function","(opts: { signerKey: Uint8Array | string; caller: string; } & NetworkParam & ClientParam) => Promise<EligibilityResult>"]
+ ["@stacks/bitcoin-staking",".","named","fetchEligibleSetBondAdmin","function","(opts: { caller: string; } & NetworkParam & ClientParam) => Promise<EligibilityResult>"]
+ ["@stacks/bitcoin-staking",".","named","fetchEligibleSetupBond","function","(opts: { bondIndex: number; allowlist: { staker: string; maxSats: IntegerType; }[]; caller: string; poxInfo?: PoxInfo; } & NetworkParam & ClientParam) => Promise<EligibilityResult>"]
+ ["@stacks/bitcoin-staking",".","named","fetchEligibleStake","function","(opts: { staker: string; signerManager: string; amountUstx: IntegerType; numCycles: number; startBurnHt: number; poxInfo?: PoxInfo; } & NetworkParam & ClientParam) => Promise<EligibilityResult>"]
+ ["@stacks/bitcoin-staking",".","named","fetchEligibleStakeUpdate","function","(opts: { staker: string; signerManager: string; oldSignerManager: string; cyclesToExtend?: number; amountIncrease?: IntegerType; poxInfo?: PoxInfo; } & NetworkParam & ClientParam) => Promise<EligibilityResult>"]
+ ["@stacks/bitcoin-staking",".","named","fetchEligibleUnstake","function","(opts: { staker: string; oldSignerManager: string; poxInfo?: PoxInfo; } & NetworkParam & ClientParam) => Promise<EligibilityResult>"]
+ ["@stacks/bitcoin-staking",".","named","fetchEligibleUnstakeSbtc","function","(opts: { staker: string; signerManager: string; amountToWithdrawSats: IntegerType; poxInfo?: PoxInfo; } & NetworkParam & ClientParam) => Promise<EligibilityResult>"]
+ ["@stacks/bitcoin-staking",".","named","fetchEligibleUpdateBondRegistration","function","(opts: { staker: string; signerManager: string; oldSignerManager: string; poxInfo?: PoxInfo; } & NetworkParam & ClientParam) => Promise<EligibilityResult>"]
+ ["@stacks/bitcoin-staking",".","named","fetchHasAnnouncedL1EarlyExit","function","(opts: { bondIndex: number; staker: string; } & NetworkParam & ClientParam) => Promise<boolean>"]
+ ["@stacks/bitcoin-staking",".","named","fetchLastAccountedRewards","function","(opts?: NetworkClientParam) => Promise<bigint>"]
+ ["@stacks/bitcoin-staking",".","named","fetchLastRewardComputeHeight","function","(opts?: NetworkClientParam) => Promise<number>"]
+ ["@stacks/bitcoin-staking",".","named","fetchNewRewards","function","(opts?: NetworkClientParam) => Promise<bigint>"]
+ ["@stacks/bitcoin-staking",".","named","fetchParseBlockHeader","function","(opts: { header: Uint8Array | string; } & NetworkParam & ClientParam) => Promise<ParsedBlockHeader>"]
+ ["@stacks/bitcoin-staking",".","named","fetchPauseAdmin","function","(opts?: NetworkClientParam) => Promise<string>"]
+ ["@stacks/bitcoin-staking",".","named","fetchPoxInfo","function","(opts?: NetworkClientParam) => Promise<PoxInfo>"]
+ ["@stacks/bitcoin-staking",".","named","fetchProtocolBond","function","(opts: { bondIndex: number; } & NetworkParam & ClientParam) => Promise<Bond | undefined>"]
+ ["@stacks/bitcoin-staking",".","named","fetchProtocolBondMemberships","function","(opts: { address: string; } & NetworkParam & ClientParam) => Promise<BondMembership | undefined>"]
+ ["@stacks/bitcoin-staking",".","named","fetchPushCScriptNum","function","(opts: { n: number | bigint; } & NetworkParam & ClientParam) => Promise<Uint8Array<ArrayBufferLike>>"]
+ ["@stacks/bitcoin-staking",".","named","fetchPushScriptBytes","function","(opts: { bytes: Uint8Array | string; } & NetworkParam & ClientParam) => Promise<Uint8Array<ArrayBufferLike>>"]
+ ["@stacks/bitcoin-staking",".","named","fetchReserveBalance","function","(opts?: NetworkClientParam) => Promise<bigint>"]
+ ["@stacks/bitcoin-staking",".","named","fetchReverseBuff32","function","(opts: { input: Uint8Array | string; } & NetworkParam & ClientParam) => Promise<Uint8Array<ArrayBufferLike>>"]
+ ["@stacks/bitcoin-staking",".","named","fetchReversedTxid","function","(opts: { tx: Uint8Array | string; } & NetworkParam & ClientParam) => Promise<Uint8Array<ArrayBufferLike>>"]
+ ["@stacks/bitcoin-staking",".","named","fetchRewards","function","(opts?: NetworkClientParam) => Promise<bigint>"]
+ ["@stacks/bitcoin-staking",".","named","fetchRewardsPaused","function","(opts?: NetworkClientParam) => Promise<boolean>"]
+ ["@stacks/bitcoin-staking",".","named","fetchRewardsPerTokenForCycle","function","(opts: { rewardCycle: number; bondIndex?: number; } & NetworkParam & ClientParam) => Promise<bigint>"]
+ ["@stacks/bitcoin-staking",".","named","fetchSerializeCScriptNum","function","(opts: { n: number | bigint; } & NetworkParam & ClientParam) => Promise<Uint8Array<ArrayBufferLike>>"]
+ ["@stacks/bitcoin-staking",".","named","fetchSignerCycleMembership","function","(opts: { staker: string; rewardCycle: number; } & NetworkParam & ClientParam) => Promise<{ amountUstx: bigint; signer: string; } | undefined>"]
+ ["@stacks/bitcoin-staking",".","named","fetchSignerGrantMessageHash","function","(opts: { signerManager: string; authId: IntegerType; } & NetworkParam & ClientParam) => Promise<string>"]
+ ["@stacks/bitcoin-staking",".","named","fetchSignerInfo","function","(opts: { signerManager: string; } & NetworkParam & ClientParam) => Promise<{ signerKey: string; } | undefined>"]
+ ["@stacks/bitcoin-staking",".","named","fetchSignerKeyGrantUsed","function","(opts: { signerKey: Uint8Array | string; signerManager: string; authId: IntegerType; } & NetworkParam & ClientParam) => Promise<boolean>"]
+ ["@stacks/bitcoin-staking",".","named","fetchSignerPendingStakedUstx","function","(opts: { signerManager: string; rewardCycle: number; } & NetworkParam & ClientParam) => Promise<bigint>"]
+ ["@stacks/bitcoin-staking",".","named","fetchSignerRewardsPerTokenForCycle","function","(opts: { signerManager: string; rewardCycle: number; bondIndex?: number; } & NetworkParam & ClientParam) => Promise<bigint>"]
+ ["@stacks/bitcoin-staking",".","named","fetchSignerRewardsPerTokenSettled","function","(opts: { signerManager: string; rewardCycle: number; bondIndex?: number; } & NetworkParam & ClientParam) => Promise<bigint>"]
+ ["@stacks/bitcoin-staking",".","named","fetchSignerSetContainsForCycle","function","(opts: { signer: string; rewardCycle: number; } & NetworkParam & ClientParam) => Promise<boolean>"]
+ ["@stacks/bitcoin-staking",".","named","fetchSignerSetFirstItem","function","(opts: { rewardCycle: number; } & NetworkParam & ClientParam) => Promise<string | undefined>"]
+ ["@stacks/bitcoin-staking",".","named","fetchSignerSetItem","function","(opts: { signer: string; rewardCycle: number; } & NetworkParam & ClientParam) => Promise<{ prev: string | undefined; next: string | undefined; } | undefined>"]
+ ["@stacks/bitcoin-staking",".","named","fetchSignerSetLastItem","function","(opts: { rewardCycle: number; } & NetworkParam & ClientParam) => Promise<string | undefined>"]
+ ["@stacks/bitcoin-staking",".","named","fetchSignerSetNextItem","function","(opts: { signer: string; rewardCycle: number; } & NetworkParam & ClientParam) => Promise<string | undefined>"]
+ ["@stacks/bitcoin-staking",".","named","fetchSignerSetPrevItem","function","(opts: { signer: string; rewardCycle: number; } & NetworkParam & ClientParam) => Promise<string | undefined>"]
+ ["@stacks/bitcoin-staking",".","named","fetchSignerSharesStakedForCycle","function","(opts: { signerManager: string; rewardCycle: number; bondIndex?: number; } & NetworkParam & ClientParam) => Promise<bigint>"]
+ ["@stacks/bitcoin-staking",".","named","fetchSignerUnclaimedRewards","function","(opts: { signerManager: string; rewardCycle: number; bondIndex?: number; } & NetworkParam & ClientParam) => Promise<bigint>"]
+ ["@stacks/bitcoin-staking",".","named","fetchStakerCustodiedSbtc","function","(opts: { staker: string; } & NetworkParam & ClientParam) => Promise<bigint>"]
+ ["@stacks/bitcoin-staking",".","named","fetchStakerInfo","function","(opts: { address: string; } & NetworkParam & ClientParam) => Promise<StakerInfo>"]
+ ["@stacks/bitcoin-staking",".","named","fetchStakerRewardsPerTokenSettled","function","(opts: { signerManager: string; rewardCycle: number; bondIndex?: number; staker: string; } & NetworkParam & ClientParam) => Promise<bigint>"]
+ ["@stacks/bitcoin-staking",".","named","fetchStakerSharesStakedForCycle","function","(opts: { staker: string; signer: string; rewardCycle: number; bondIndex?: number; } & NetworkParam & ClientParam) => Promise<bigint>"]
+ ["@stacks/bitcoin-staking",".","named","fetchStakerUnclaimedRewards","function","(opts: { signerManager: string; rewardCycle: number; bondIndex?: number; staker: string; } & NetworkParam & ClientParam) => Promise<bigint>"]
+ ["@stacks/bitcoin-staking",".","named","fetchTotalSbtcStaked","function","(opts?: NetworkClientParam) => Promise<bigint>"]
+ ["@stacks/bitcoin-staking",".","named","fetchTotalSbtcStakedForBond","function","(opts: { bondIndex: number; } & NetworkParam & ClientParam) => Promise<bigint>"]
+ ["@stacks/bitcoin-staking",".","named","fetchTotalSharesStakedForCycle","function","(opts: { rewardCycle: number; bondIndex?: number; } & NetworkParam & ClientParam) => Promise<bigint>"]
+ ["@stacks/bitcoin-staking",".","named","fetchTotalUstxStacked","function","(opts: { rewardCycle: number; } & NetworkParam & ClientParam) => Promise<bigint>"]
+ ["@stacks/bitcoin-staking",".","named","fetchUintToBuffLe","function","(opts: { n: number | bigint; } & NetworkParam & ClientParam) => Promise<Uint8Array<ArrayBufferLike>>"]
+ ["@stacks/bitcoin-staking",".","named","fetchUstxDelegatedForCycle","function","(opts: { rewardCycle: number; } & NetworkParam & ClientParam) => Promise<bigint>"]
+ ["@stacks/bitcoin-staking",".","named","fetchVerifyBlockHeader","function","(opts: { header: Uint8Array | string; burnHeight: number; } & NetworkParam & ClientParam) => Promise<boolean>"]
+ ["@stacks/bitcoin-staking",".","named","fetchVerifySignerKeyGrant","function","(opts: { signerKey: Uint8Array | string; signerManager: string; } & NetworkParam & ClientParam) => Promise<boolean>"]
+ ["@stacks/bitcoin-staking",".","named","finalizeReclaim","function","(opts: FinalizeReclaimOpts) => { txHex: string; txid: string; }"]
+ ["@stacks/bitcoin-staking",".","named","FinalizeReclaimOpts","type","FinalizeReclaimOpts"]
+ ["@stacks/bitcoin-staking",".","named","firstPox5RewardCycle","function","(poxInfo: PoxInfo) => number | undefined"]
+ ["@stacks/bitcoin-staking",".","named","isBondActiveAtHeight","function","(opts: { bondIndex: number; burnHeight: number; poxInfo: PoxInfo; }) => boolean"]
+ ["@stacks/bitcoin-staking",".","named","isInPreparePhase","function","(opts: { burnHeight: number; poxInfo: PoxInfo; }) => boolean"]
+ ["@stacks/bitcoin-staking",".","named","MAX_NUM_CYCLES","value","96"]
+ ["@stacks/bitcoin-staking",".","named","minUstxForSatsAmount","function","(opts: { sats: IntegerType; stxValueRatio: IntegerType; minUstxRatioBps: IntegerType; }) => bigint"]
+ ["@stacks/bitcoin-staking",".","named","MultiSigTxParams","type","MultiSigTxParams"]
+ ["@stacks/bitcoin-staking",".","named","networkNameFrom","function","(network: \"mainnet\" | \"testnet\" | \"devnet\" | \"mocknet\" | StacksNetwork) => \"mainnet\" | \"testnet\" | \"devnet\" | \"mocknet\""]
+ ["@stacks/bitcoin-staking",".","named","NextCycleInfo","interface","NextCycleInfo"]
+ ["@stacks/bitcoin-staking",".","named","ParsedBlockHeader","interface","ParsedBlockHeader"]
+ ["@stacks/bitcoin-staking",".","named","parsePox5Error","function","(result: string | ClarityValue | undefined) => number | undefined"]
+ ["@stacks/bitcoin-staking",".","named","parseSignerCalldata","function","(calldata: string | Uint8Array<ArrayBufferLike>) => { poxAddress: BtcAddressRepr; maxFeeSats: bigint; }"]
+ ["@stacks/bitcoin-staking",".","named","POX_ADDR_DATA_LENGTH","value","Record<PoXAddressVersion, number>"]
+ ["@stacks/bitcoin-staking",".","named","POX5_CONTRACT_NAME","value","\"pox-5\""]
+ ["@stacks/bitcoin-staking",".","named","POX5_ERROR_DESCRIPTIONS","value","Record<Pox5ErrorCode, string>"]
+ ["@stacks/bitcoin-staking",".","named","POX5_ERROR_NAMES","value","Record<Pox5ErrorCode, string>"]
+ ["@stacks/bitcoin-staking",".","named","Pox5ErrorCode","enum","{ Unauthorized = 1, CannotSetupBondTooSoon = 2, CannotSetupBondTooLate = 3, BondAlreadySetup = 4, StakerAlreadyAdded = 5, BondNotFound = 7, InsufficientStx = 8, AlreadyRegistered = 9, TooMuchSats = 10, NotAllowlisted = 11, SignerKeyGrantUsed = 12, InvalidSignatureRecover = 13, InvalidSignaturePubkey = 14, SignerKeyGrantNotFound = 17, AlreadyStaked = 19, InvalidNumCycles = 20, SignerNotFound = 23, InvalidStartBurnHeight = 24, UnauthorizedSignerRegistration = 26, NotStaking = 27, UnstakeInPreparePhase = 28, InvalidBondPeriodOrdering = 29, DistributionAlreadyComputed = 30, BondNotActive = 31, NoClaimableRewards = 32, ActiveBondNotIncluded = 33, NotBondParticipant = 34, CannotAnnounceL1EarlyUnlock = 35, InvalidOldSignerManager = 36, InvalidUnstakeSbtcAmount = 37, CannotUnstakeSbtc = 38, ReadTxOutOfBounds = 39, InvalidBtcHeader = 40, InvalidMerkleProof = 41, InvalidLockupScript = 42, BondAlreadyStarted = 43, UpdateBondSameSigner = 44, InvalidLockupAmount = 45, DuplicateLockupOutpoint = 46, StakeInPreparePhase = 47, RolloverTooEarly = 48, ReentrantCall = 49, L1EarlyExitAlreadyAnnounced = 50, InsufficientReserveBalance = 51, InvalidUnlockHeight = 52, RewardsPaused = 53 }"]
+ ["@stacks/bitcoin-staking",".","named","PoXAddressVersion","enum","{ P2PKH = 0, P2SH = 1, P2SHP2WPKH = 2, P2SHP2WSH = 3, P2WPKH = 4, P2WSH = 5, P2TR = 6 }"]
+ ["@stacks/bitcoin-staking",".","named","PoxContractVersion","interface","PoxContractVersion"]
+ ["@stacks/bitcoin-staking",".","named","PoxInfo","interface","PoxInfo"]
+ ["@stacks/bitcoin-staking",".","named","pushCScriptNum","function","(n: number | bigint) => Uint8Array<ArrayBufferLike>"]
+ ["@stacks/bitcoin-staking",".","named","pushScriptBytes","function","(bytes: Uint8Array<ArrayBufferLike>) => Uint8Array<ArrayBufferLike>"]
+ ["@stacks/bitcoin-staking",".","named","ReclaimPath","type","ReclaimPath"]
+ ["@stacks/bitcoin-staking",".","named","RegisterMetadata","interface","RegisterMetadata"]
+ ["@stacks/bitcoin-staking",".","named","rewardCycleToBurnHeight","function","(opts: { rewardCycle: number; poxInfo: PoxInfo; }) => number"]
+ ["@stacks/bitcoin-staking",".","named","scriptToAddress","function","(script: Uint8Array<ArrayBufferLike>, network: \"mainnet\" | \"testnet\" | \"devnet\" | \"mocknet\" | StacksNetwork) => string"]
+ ["@stacks/bitcoin-staking",".","named","scriptToWshOutput","function","(script: Uint8Array<ArrayBufferLike>) => Uint8Array<ArrayBufferLike>"]
+ ["@stacks/bitcoin-staking",".","named","SEGWIT_ADDR_PREFIXES","value","RegExp"]
+ ["@stacks/bitcoin-staking",".","named","SEGWIT_V0","value","0"]
+ ["@stacks/bitcoin-staking",".","named","SEGWIT_V0_ADDR_PREFIX","value","RegExp"]
+ ["@stacks/bitcoin-staking",".","named","SEGWIT_V1","value","1"]
+ ["@stacks/bitcoin-staking",".","named","SEGWIT_V1_ADDR_PREFIX","value","RegExp"]
+ ["@stacks/bitcoin-staking",".","named","SegwitPrefix","value","{ readonly mainnet: \"bc\"; readonly testnet: \"tb\"; readonly devnet: \"bcrt\"; readonly mocknet: \"bcrt\"; }"]
+ ["@stacks/bitcoin-staking",".","named","serializeBitcoinHeader","function","(header: string | Uint8Array<ArrayBufferLike>) => Uint8Array<ArrayBufferLike>"]
+ ["@stacks/bitcoin-staking",".","named","serializeBitcoinTx","function","(tx: string | Uint8Array<ArrayBufferLike>) => Uint8Array<ArrayBufferLike>"]
+ ["@stacks/bitcoin-staking",".","named","serializeCScriptNum","function","(n: number | bigint) => Uint8Array<ArrayBufferLike>"]
+ ["@stacks/bitcoin-staking",".","named","SignerCalldataL1Payout","interface","SignerCalldataL1Payout"]
+ ["@stacks/bitcoin-staking",".","named","SignerKeyGrantOptions","interface","SignerKeyGrantOptions"]
+ ["@stacks/bitcoin-staking",".","named","signReclaim","function","(sighash: Uint8Array<ArrayBufferLike>, privateKey: PrivateKey, opts?: { lowR?: boolean; } | undefined) => Uint8Array<ArrayBufferLike>"]
+ ["@stacks/bitcoin-staking",".","named","signSignerGrant","function","(opts: SignerKeyGrantOptions & { privateKey: PrivateKey; }) => string"]
+ ["@stacks/bitcoin-staking",".","named","SingleSigTxParams","interface","SingleSigTxParams"]
+ ["@stacks/bitcoin-staking",".","named","StakerInfo","type","StakerInfo"]
+ ["@stacks/bitcoin-staking",".","named","StakerInfoDetails","interface","StakerInfoDetails"]
+ ["@stacks/bitcoin-staking",".","named","toConsensusBuff","function","(addr: string) => Uint8Array<ArrayBufferLike>"]
+ ["@stacks/bitcoin-staking",".","named","TxParams","type","TxParams"]
+ ["@stacks/bitcoin-staking",".","named","TxParamsBase","interface","TxParamsBase"]
+ ["@stacks/bitcoin-staking",".","named","Utxo","interface","Utxo"]
+ ["@stacks/bitcoin-staking",".","named","validateEarlyUnlockBytes","function","(earlyUnlockBytes: string | Uint8Array<ArrayBufferLike>, opts?: { shape?: boolean; }) => Uint8Array<ArrayBufferLike>"]
+ ["@stacks/bitcoin-staking",".","named","verifySignerGrant","function","(opts: SignerKeyGrantOptions & { publicKey: string | Uint8Array; signature: string | Uint8Array; }) => boolean"]

Updated 2026-07-28 12:27:32 UTC

@jannik-stacks
jannik-stacks dismissed stale reviews from edgar-stacks and rafa-stacks via f82929c July 22, 2026 09:08
edgar-stacks
edgar-stacks previously approved these changes Jul 28, 2026
@jannik-stacks
jannik-stacks merged commit 162cdef into main Jul 29, 2026
7 checks passed
@jannik-stacks
jannik-stacks deleted the feat/bitcoin-staking branch July 29, 2026 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants