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

fetchSignerSetNextItem

Reads the signer-manager after a given one in a reward cycle's signer set. Wraps the pox-5 read-only get-signer-set-next-item-for-cycle, which reads the signer-set-ll-for-cycle map.


Usage

import { fetchPoxInfo, fetchSignerSetFirstItem, fetchSignerSetNextItem } from '@stacks/bitcoin-staking';

const { rewardCycleId: rewardCycle } = await fetchPoxInfo({ network: 'mainnet' });

const signers: string[] = [];
let signer = await fetchSignerSetFirstItem({ rewardCycle, network: 'mainnet' });
while (signer) {
  signers.push(signer);
  signer = await fetchSignerSetNextItem({ signer, rewardCycle, network: 'mainnet' });
}

Notes


Signature

opts is a NetworkClientParam plus signer and rewardCycle.


Returns

Promise<string | undefined>

Resolves to the contract principal of the next signer-manager, or undefined.


Parameters

opts.signer (required)

  • Type: string

Contract principal of the signer-manager, in the form <address>.<contract-name>.

opts.rewardCycle (required)

  • Type: number

Reward cycle to read.

opts.network (optional)

  • Type: StacksNetworkName | StacksNetwork

The network to query: a name such as 'mainnet' or 'testnet', or a StacksNetwork object. Defaults to 'mainnet'.

opts.client (optional)

  • Type: { baseUrl?: string; fetch?: FetchFn }

Overrides the API base URL or the fetch function, for example to query your own node. Fields you set replace the network's defaults.

Was this helpful?