You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It may be possible to detect if PoX-2 is ready by checking if GET /v2/pox returns {"contract_id":"ST000000000000000000002AMW42H.pox-2"}, but that appears to be unimplemented as of opening this issue: stacks-network/stacks-core#3262
In the meantime, something like this should work:
asyncfunctionisPoX2Ready(): Promise<boolean>{constreq=awaitfetch(`/v2/data_var/ST000000000000000000002AMW42H/pox-2/configured?proof=0`);constbody=awaitreq.text();if(req.ok){returnJSON.parse(body)['data']==='0x03';// Clarity boolean-true}elseif(req.status===404&&body==='Data var not found'){returnfalse;}else{thrownewError(`Unexpected response: ${req.status} - ${body}`);}}
The text was updated successfully, but these errors were encountered:
A PoX-2 contract will be deployed after the Stacks 2.1 hardfork goes live. Several new functions will be available:
stack-extend
/delegate-stack-extend
Stacks 2.1: PoX 2stack-extend
,delegate-stack-extend
stacks-network/stacks-core#2755stack-unlock
PoX Updates:stack-unlock
stacks-network/stacks-core#2534stack-increase
2.1: Feature:stack-increase
for PoX-2 stacks-network/stacks-core#3282This changes the signatures for functions (e.g.
stack-stx
,delegate-stack-stx
, etc) to use 32 bytes rather than 20 for address hashbytes, and expands the number of valid address version bytes. For for context see PoX: native segwit support stacks-network/stacks-core#2586 and Feat/get pox addrs stacks-network/stacks-core#3245).It probably makes sense to create a new set of sister function calls for PoX-2, and detect if the new functions should be used via an RPC call to determine if PoX-2 is live. The library needs to detect if
Period 3
has activated -- this is after the 2.1 fork, and after PoX cycle (N+1), see https://github.com/stacksgov/sips/blob/c0fb33e0fc2b62e8e6d4ed85fb4b4aa289bb6042/sips/sip-015/sip-015-network-upgrade.md#specificationIt may be possible to detect if PoX-2 is ready by checking if
GET /v2/pox
returns{"contract_id":"ST000000000000000000002AMW42H.pox-2"}
, but that appears to be unimplemented as of opening this issue: stacks-network/stacks-core#3262In the meantime, something like this should work:
The text was updated successfully, but these errors were encountered: