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

fetchPauseAdmin

Reads the pox-5 pause-admin data-var and returns the principal that can permanently pause signer reward claims and transfer the role.


Usage

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

const pauseAdmin = await fetchPauseAdmin({ network: 'mainnet' });

Notes

  • Reads the pause-admin data-var through the node's /v2/data_var endpoint. pox-5 has no read-only accessor for it.

  • pause-rewards (L489-L497) and set-pause-admin (L470-L484) fail with ERR_UNAUTHORIZED (u1) unless contract-caller equals this principal. Read the pause state with fetchRewardsPaused.

  • The value changes when set-pause-admin succeeds, so read it rather than caching it. On networks other than mainnet, the node sets the initial value from its configuration before deploying pox-5.

  • A non-2xx response throws an Error whose message starts with Error fetching pause-admin. and includes the status code and URL.

Reference Link


Signature

function fetchPauseAdmin(opts?: NetworkClientParam): Promise<string>;

opts is a NetworkClientParam.


Returns

Promise<string>

The pause-admin principal as a Stacks address string. A contract principal comes back as <address>.<contract-name>.


Parameters

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?