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-admindata-var through the node's/v2/data_varendpoint. pox-5 has no read-only accessor for it.pause-rewards(L489-L497) andset-pause-admin(L470-L484) fail withERR_UNAUTHORIZED (u1)unlesscontract-callerequals this principal. Read the pause state with fetchRewardsPaused.The value changes when
set-pause-adminsucceeds, 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
Errorwhose message starts withError fetching pause-admin.and includes the status code and URL.
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?