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

EarnedRewards

The rewards a signer-manager has earned for one reward cycle and one leg, in sats of sBTC. Returned by fetchEarned, which wraps the pox-5 get-earned read-only.


Usage

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

// Bond leg of bond 1; omit bondIndex for the STX-only leg
const earnedSats = await fetchEarned({
  signerManager: 'SP2C2YFP12AJZB4MABJBAJ55XECVS7E4PMMZ89YZR.my-signer-manager',
  rewardCycle,
  bondIndex: 1,
  network: 'mainnet',
});

Notes

  • The amount is in sats. pox-5 accrues rewards from its sBTC balance (get-rewards) and claim-rewards pays them out as an sBTC transfer.

  • The amount can change between this read and a later claim-rewards. A post condition on buildClaimRewards built from it can come in low and abort the claim with abort_by_post_condition.


Definition

Was this helpful?