@secondlayer/stacks 6.1.0 → 6.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/shared/stacks-esm-0pc6tmf0.js +50 -0
- package/dist/shared/{stacks-esm-743jfh10.js.map → stacks-esm-0pc6tmf0.js.map} +2 -2
- package/dist/shared/{stacks-esm-0rdxcta7.js → stacks-esm-16d82wyc.js} +10 -10
- package/dist/shared/{stacks-esm-0rdxcta7.js.map → stacks-esm-16d82wyc.js.map} +2 -2
- package/dist/shared/{stacks-esm-cvhazvhd.js → stacks-esm-7a0ehykf.js} +43 -43
- package/dist/shared/{stacks-esm-cvhazvhd.js.map → stacks-esm-7a0ehykf.js.map} +2 -2
- package/dist/shared/{stacks-esm-1jae0a3r.js → stacks-esm-7v18h5dk.js} +4 -4
- package/dist/shared/{stacks-esm-1jae0a3r.js.map → stacks-esm-7v18h5dk.js.map} +2 -2
- package/dist/shared/{stacks-esm-9rnx0zxr.js → stacks-esm-8f5catbf.js} +126 -126
- package/dist/shared/{stacks-esm-9rnx0zxr.js.map → stacks-esm-8f5catbf.js.map} +2 -2
- package/dist/shared/{stacks-esm-7fpqgtyx.js → stacks-esm-8jt6k8p3.js} +13 -13
- package/dist/shared/{stacks-esm-7fpqgtyx.js.map → stacks-esm-8jt6k8p3.js.map} +2 -2
- package/dist/shared/{stacks-esm-hr7fpxtj.js → stacks-esm-a20wyky3.js} +92 -92
- package/dist/shared/{stacks-esm-hr7fpxtj.js.map → stacks-esm-a20wyky3.js.map} +2 -2
- package/dist/shared/{stacks-esm-3pv5avgr.js → stacks-esm-b54n1jdx.js} +54 -54
- package/dist/shared/{stacks-esm-3pv5avgr.js.map → stacks-esm-b54n1jdx.js.map} +2 -2
- package/dist/shared/{stacks-esm-r9q4wnyw.js → stacks-esm-cmtj5vky.js} +162 -162
- package/dist/shared/{stacks-esm-r9q4wnyw.js.map → stacks-esm-cmtj5vky.js.map} +2 -2
- package/dist/shared/{stacks-esm-wv67m4g6.js → stacks-esm-e2qhfgke.js} +36 -36
- package/dist/shared/{stacks-esm-wv67m4g6.js.map → stacks-esm-e2qhfgke.js.map} +2 -2
- package/dist/shared/{stacks-esm-qk0p9fr6.js → stacks-esm-ea4m4bk7.js} +117 -117
- package/dist/shared/{stacks-esm-qk0p9fr6.js.map → stacks-esm-ea4m4bk7.js.map} +2 -2
- package/dist/shared/{stacks-esm-fcfdn2zx.js → stacks-esm-hkw1kvd4.js} +140 -140
- package/dist/shared/{stacks-esm-fcfdn2zx.js.map → stacks-esm-hkw1kvd4.js.map} +2 -2
- package/dist/shared/{stacks-esm-qkj67g80.js → stacks-esm-k108pemv.js} +4 -4
- package/dist/shared/{stacks-esm-qkj67g80.js.map → stacks-esm-k108pemv.js.map} +2 -2
- package/dist/shared/stacks-esm-kbz5s6v8.js +84 -0
- package/dist/shared/{stacks-esm-2mc7ebrm.js.map → stacks-esm-kbz5s6v8.js.map} +2 -2
- package/dist/shared/{stacks-esm-n53kvwmt.js → stacks-esm-mt1thm7k.js} +9 -9
- package/dist/shared/{stacks-esm-n53kvwmt.js.map → stacks-esm-mt1thm7k.js.map} +2 -2
- package/dist/shared/{stacks-esm-v45990hx.js → stacks-esm-n1mekwnb.js} +9 -9
- package/dist/shared/{stacks-esm-v45990hx.js.map → stacks-esm-n1mekwnb.js.map} +2 -2
- package/dist/shared/{stacks-esm-r6dejrgr.js → stacks-esm-nt5hf8ht.js} +34 -34
- package/dist/shared/{stacks-esm-r6dejrgr.js.map → stacks-esm-nt5hf8ht.js.map} +2 -2
- package/dist/shared/{stacks-esm-skmcf5n2.js → stacks-esm-phgy8yqf.js} +210 -210
- package/dist/shared/{stacks-esm-skmcf5n2.js.map → stacks-esm-phgy8yqf.js.map} +2 -2
- package/dist/shared/{stacks-esm-kds4n82p.js → stacks-esm-pxv6ny92.js} +116 -116
- package/dist/shared/{stacks-esm-kds4n82p.js.map → stacks-esm-pxv6ny92.js.map} +2 -2
- package/dist/shared/{stacks-esm-3g33bqsm.js → stacks-esm-qfzxhdqz.js} +19 -19
- package/dist/shared/{stacks-esm-3g33bqsm.js.map → stacks-esm-qfzxhdqz.js.map} +2 -2
- package/dist/shared/{stacks-esm-aw2mj3sj.js → stacks-esm-snj9s2q8.js} +43 -43
- package/dist/shared/{stacks-esm-aw2mj3sj.js.map → stacks-esm-snj9s2q8.js.map} +2 -2
- package/dist/shared/{stacks-esm-q19a17fd.js → stacks-esm-ss9ap75h.js} +28 -28
- package/dist/shared/{stacks-esm-q19a17fd.js.map → stacks-esm-ss9ap75h.js.map} +2 -2
- package/dist/shared/{stacks-esm-x1r01353.js → stacks-esm-t88hc019.js} +18 -18
- package/dist/shared/{stacks-esm-x1r01353.js.map → stacks-esm-t88hc019.js.map} +2 -2
- package/dist/shared/stacks-esm-tdrdye4y.js +48 -0
- package/dist/shared/{stacks-esm-pxhfqfff.js.map → stacks-esm-tdrdye4y.js.map} +2 -2
- package/dist/src/accounts/index.cjs +15 -13
- package/dist/src/accounts/index.cjs.map +2 -2
- package/dist/src/accounts/index.d.cts +1 -1
- package/dist/src/accounts/index.d.ts +1 -1
- package/dist/src/accounts/index.js +26 -26
- package/dist/src/accounts/index.js.map +2 -2
- package/dist/src/actions/index.cjs +83 -81
- package/dist/src/actions/index.cjs.map +2 -2
- package/dist/src/actions/index.d.cts +1 -1
- package/dist/src/actions/index.d.ts +1 -1
- package/dist/src/actions/index.js +102 -103
- package/dist/src/actions/index.js.map +1 -1
- package/dist/src/bitcoin/index.cjs +2035 -2036
- package/dist/src/bitcoin/index.cjs.map +8 -8
- package/dist/src/bitcoin/index.d.cts +92 -92
- package/dist/src/bitcoin/index.d.ts +92 -92
- package/dist/src/bitcoin/index.js +88 -90
- package/dist/src/bitcoin/index.js.map +2 -2
- package/dist/src/bns/index.cjs +3313 -3310
- package/dist/src/bns/index.cjs.map +13 -13
- package/dist/src/bns/index.d.cts +1 -1
- package/dist/src/bns/index.d.ts +1 -1
- package/dist/src/bns/index.js +39 -41
- package/dist/src/bns/index.js.map +2 -2
- package/dist/src/chains/index.cjs +14 -12
- package/dist/src/chains/index.cjs.map +2 -2
- package/dist/src/chains/index.d.cts +1 -1
- package/dist/src/chains/index.d.ts +1 -1
- package/dist/src/chains/index.js +12 -12
- package/dist/src/chains/index.js.map +1 -1
- package/dist/src/clarity/index.cjs +98 -96
- package/dist/src/clarity/index.cjs.map +2 -2
- package/dist/src/clarity/index.d.cts +1 -1
- package/dist/src/clarity/index.d.ts +1 -1
- package/dist/src/clarity/index.js +170 -171
- package/dist/src/clarity/index.js.map +1 -1
- package/dist/src/connect/index.cjs +19 -19
- package/dist/src/connect/index.cjs.map +2 -2
- package/dist/src/connect/index.d.cts +1 -1
- package/dist/src/connect/index.d.ts +1 -1
- package/dist/src/connect/index.js +19 -19
- package/dist/src/connect/index.js.map +2 -2
- package/dist/src/connect/walletconnect/index.cjs +6 -46
- package/dist/src/connect/walletconnect/index.cjs.map +3 -4
- package/dist/src/connect/walletconnect/index.d.cts +1 -1
- package/dist/src/connect/walletconnect/index.d.ts +1 -1
- package/dist/src/connect/walletconnect/index.js +6 -46
- package/dist/src/connect/walletconnect/index.js.map +3 -4
- package/dist/src/filters/index.cjs +22 -20
- package/dist/src/filters/index.cjs.map +2 -2
- package/dist/src/filters/index.d.cts +1 -1
- package/dist/src/filters/index.d.ts +1 -1
- package/dist/src/filters/index.js +30 -30
- package/dist/src/filters/index.js.map +1 -1
- package/dist/src/index.cjs +1411 -1410
- package/dist/src/index.cjs.map +11 -11
- package/dist/src/index.d.cts +724 -724
- package/dist/src/index.d.ts +724 -724
- package/dist/src/index.js +219 -219
- package/dist/src/index.js.map +2 -2
- package/dist/src/postconditions/index.cjs +26 -24
- package/dist/src/postconditions/index.cjs.map +2 -2
- package/dist/src/postconditions/index.d.cts +1 -1
- package/dist/src/postconditions/index.d.ts +1 -1
- package/dist/src/postconditions/index.js +16 -17
- package/dist/src/postconditions/index.js.map +1 -1
- package/dist/src/pox/index.cjs +722 -721
- package/dist/src/pox/index.cjs.map +9 -9
- package/dist/src/pox/index.d.cts +1 -1
- package/dist/src/pox/index.d.ts +1 -1
- package/dist/src/pox/index.js +40 -41
- package/dist/src/pox/index.js.map +2 -2
- package/dist/src/pox5/index.cjs +141 -137
- package/dist/src/pox5/index.cjs.map +3 -3
- package/dist/src/pox5/index.d.cts +9 -1
- package/dist/src/pox5/index.d.ts +9 -1
- package/dist/src/pox5/index.js +210 -209
- package/dist/src/pox5/index.js.map +3 -3
- package/dist/src/sbtc/index.cjs +71 -69
- package/dist/src/sbtc/index.cjs.map +2 -2
- package/dist/src/sbtc/index.d.cts +1 -1
- package/dist/src/sbtc/index.d.ts +1 -1
- package/dist/src/sbtc/index.js +39 -40
- package/dist/src/sbtc/index.js.map +2 -2
- package/dist/src/simnet/index.cjs +16 -16
- package/dist/src/simnet/index.cjs.map +2 -2
- package/dist/src/simnet/index.d.cts +1 -1
- package/dist/src/simnet/index.d.ts +1 -1
- package/dist/src/simnet/index.js +16 -16
- package/dist/src/simnet/index.js.map +2 -2
- package/dist/src/stackingdao/index.cjs +716 -715
- package/dist/src/stackingdao/index.cjs.map +9 -9
- package/dist/src/stackingdao/index.d.cts +1 -1
- package/dist/src/stackingdao/index.d.ts +1 -1
- package/dist/src/stackingdao/index.js +26 -27
- package/dist/src/stackingdao/index.js.map +2 -2
- package/dist/src/subscriptions/index.cjs +15 -13
- package/dist/src/subscriptions/index.cjs.map +2 -2
- package/dist/src/subscriptions/index.d.cts +1 -1
- package/dist/src/subscriptions/index.d.ts +1 -1
- package/dist/src/subscriptions/index.js +14 -15
- package/dist/src/subscriptions/index.js.map +1 -1
- package/dist/src/transactions/index.cjs +79 -77
- package/dist/src/transactions/index.cjs.map +2 -2
- package/dist/src/transactions/index.d.cts +1 -1
- package/dist/src/transactions/index.d.ts +1 -1
- package/dist/src/transactions/index.js +104 -105
- package/dist/src/transactions/index.js.map +1 -1
- package/dist/src/utils/index.cjs +76 -74
- package/dist/src/utils/index.cjs.map +2 -2
- package/dist/src/utils/index.d.cts +1 -1
- package/dist/src/utils/index.d.ts +1 -1
- package/dist/src/utils/index.js +131 -131
- package/dist/src/utils/index.js.map +2 -2
- package/package.json +1 -1
- package/dist/shared/stacks-esm-2mc7ebrm.js +0 -84
- package/dist/shared/stacks-esm-743jfh10.js +0 -50
- package/dist/shared/stacks-esm-pxhfqfff.js +0 -48
package/dist/src/pox5/index.cjs
CHANGED
|
@@ -19,13 +19,15 @@ var __toESM = (mod, isNodeMode, target) => {
|
|
|
19
19
|
return cached;
|
|
20
20
|
}
|
|
21
21
|
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
22
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
const to = isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
23
|
+
if (mod && typeof mod === "object" || typeof mod === "function") {
|
|
24
|
+
for (let key of __getOwnPropNames(mod))
|
|
25
|
+
if (!__hasOwnProp.call(to, key))
|
|
26
|
+
__defProp(to, key, {
|
|
27
|
+
get: __accessProp.bind(mod, key),
|
|
28
|
+
enumerable: true
|
|
29
|
+
});
|
|
30
|
+
}
|
|
29
31
|
if (canCache)
|
|
30
32
|
cache.set(mod, to);
|
|
31
33
|
return to;
|
|
@@ -64,72 +66,73 @@ var __export = (target, all) => {
|
|
|
64
66
|
// src/pox5/index.ts
|
|
65
67
|
var exports_pox5 = {};
|
|
66
68
|
__export(exports_pox5, {
|
|
67
|
-
|
|
68
|
-
stringifyBtcAddress: () => stringifyBtcAddress,
|
|
69
|
-
stakerPreimage: () => stakerPreimage,
|
|
70
|
-
stakerConsensusBuff: () => stakerConsensusBuff,
|
|
71
|
-
spvProofToL1LockupOutput: () => spvProofToL1LockupOutput,
|
|
72
|
-
signSignerGrant: () => signSignerGrant,
|
|
73
|
-
signReclaim: () => signReclaim,
|
|
74
|
-
serializeCScriptNum: () => serializeCScriptNum,
|
|
75
|
-
rewardCycleToBurnHeight: () => rewardCycleToBurnHeight,
|
|
76
|
-
reclaim: () => reclaim,
|
|
77
|
-
pushScriptBytes: () => pushScriptBytes,
|
|
78
|
-
pushCScriptNum: () => pushCScriptNum,
|
|
79
|
-
pox5ContractId: () => pox5ContractId,
|
|
80
|
-
pox5: () => pox5,
|
|
81
|
-
parseSignerCalldata: () => parseSignerCalldata,
|
|
82
|
-
parsePox5Error: () => parsePox5Error,
|
|
83
|
-
parseBtcAddress: () => parseBtcAddress,
|
|
84
|
-
isPox5Active: () => isPox5Active,
|
|
85
|
-
isInPreparePhase: () => isInPreparePhase,
|
|
86
|
-
getPoxInfo: () => getPoxInfo,
|
|
87
|
-
getPox5Activation: () => getPox5Activation,
|
|
88
|
-
finalizeReclaim: () => finalizeReclaim,
|
|
89
|
-
eligibleUnstakeSbtc: () => eligibleUnstakeSbtc,
|
|
90
|
-
eligibleUnstake: () => eligibleUnstake,
|
|
91
|
-
eligibleStake: () => eligibleStake,
|
|
92
|
-
eligibleSetBondAdmin: () => eligibleSetBondAdmin,
|
|
93
|
-
eligibleRegisterForBond: () => eligibleRegisterForBond,
|
|
94
|
-
eligiblePauseRewards: () => eligiblePauseRewards,
|
|
95
|
-
eligibleGrantSignerKey: () => eligibleGrantSignerKey,
|
|
96
|
-
eligibleClaimRewards: () => eligibleClaimRewards,
|
|
97
|
-
distributionCycleToBurnHeight: () => distributionCycleToBurnHeight,
|
|
98
|
-
describePox5Error: () => describePox5Error,
|
|
99
|
-
currentDistributionCycle: () => currentDistributionCycle,
|
|
100
|
-
computeSignerGrantHash: () => computeSignerGrantHash,
|
|
101
|
-
computeReclaimSighash: () => computeReclaimSighash,
|
|
102
|
-
computeBondUnlockHeight: () => computeBondUnlockHeight,
|
|
103
|
-
burnHeightToRewardCycle: () => burnHeightToRewardCycle,
|
|
104
|
-
burnHeightToDistributionIndex: () => burnHeightToDistributionIndex,
|
|
105
|
-
buildSignerCalldata: () => buildSignerCalldata,
|
|
106
|
-
buildRegisterMetadata: () => buildRegisterMetadata,
|
|
107
|
-
buildReclaim: () => buildReclaim,
|
|
108
|
-
buildPox5LockProof: () => buildPox5LockProof,
|
|
109
|
-
buildLockupScript: () => buildLockupScript,
|
|
110
|
-
buildLockupOutputScript: () => buildLockupOutputScript,
|
|
111
|
-
buildLockupAddress: () => buildLockupAddress,
|
|
112
|
-
buildDefaultStakerUnlockBytes: () => buildDefaultStakerUnlockBytes,
|
|
113
|
-
bondUnlockCycle: () => bondUnlockCycle,
|
|
114
|
-
bondStatusAtHeight: () => bondStatusAtHeight,
|
|
115
|
-
bondPhaseAtHeight: () => bondPhaseAtHeight,
|
|
116
|
-
bondPeriodToRewardCycle: () => bondPeriodToRewardCycle,
|
|
117
|
-
bondPeriodToBurnHeight: () => bondPeriodToBurnHeight,
|
|
118
|
-
assertPox5Active: () => assertPox5Active,
|
|
119
|
-
Pox5ErrorCode: () => Pox5ErrorCode,
|
|
120
|
-
POX5_SIGNER_DOMAIN: () => POX5_SIGNER_DOMAIN,
|
|
121
|
-
POX5_EVENT_TOPICS: () => POX5_EVENT_TOPICS,
|
|
122
|
-
POX5_ERROR_NAMES: () => POX5_ERROR_NAMES,
|
|
123
|
-
POX5_CONTRACT_NAME: () => POX5_CONTRACT_NAME,
|
|
124
|
-
POX5_CONTRACT_ID_MAINNET: () => POX5_CONTRACT_ID_MAINNET,
|
|
125
|
-
POX5_ACTIVATION_BURN_HEIGHT_MAINNET: () => POX5_ACTIVATION_BURN_HEIGHT_MAINNET,
|
|
126
|
-
POX5_ABI: () => POX5_ABI,
|
|
127
|
-
MAX_NUM_CYCLES: () => MAX_NUM_CYCLES,
|
|
128
|
-
C_SCRIPT_NUM_MAX: () => C_SCRIPT_NUM_MAX,
|
|
129
|
-
BtcAddress: () => BtcAddress,
|
|
130
|
-
BOND_LENGTH_CYCLES: () => BOND_LENGTH_CYCLES,
|
|
69
|
+
BITCOIN_LOCKTIME_THRESHOLD: () => BITCOIN_LOCKTIME_THRESHOLD,
|
|
131
70
|
BOND_GAP_CYCLES: () => BOND_GAP_CYCLES,
|
|
132
|
-
|
|
71
|
+
BOND_LENGTH_CYCLES: () => BOND_LENGTH_CYCLES,
|
|
72
|
+
BtcAddress: () => BtcAddress,
|
|
73
|
+
C_SCRIPT_NUM_MAX: () => C_SCRIPT_NUM_MAX,
|
|
74
|
+
MAINNET_PREPARE_CYCLE_LENGTH: () => MAINNET_PREPARE_CYCLE_LENGTH,
|
|
75
|
+
MAX_NUM_CYCLES: () => MAX_NUM_CYCLES,
|
|
76
|
+
POX5_ABI: () => POX5_ABI,
|
|
77
|
+
POX5_ACTIVATION_BURN_HEIGHT_MAINNET: () => POX5_ACTIVATION_BURN_HEIGHT_MAINNET,
|
|
78
|
+
POX5_CONTRACT_ID_MAINNET: () => POX5_CONTRACT_ID_MAINNET,
|
|
79
|
+
POX5_CONTRACT_NAME: () => POX5_CONTRACT_NAME,
|
|
80
|
+
POX5_ERROR_NAMES: () => POX5_ERROR_NAMES,
|
|
81
|
+
POX5_EVENT_TOPICS: () => POX5_EVENT_TOPICS,
|
|
82
|
+
POX5_SIGNER_DOMAIN: () => POX5_SIGNER_DOMAIN,
|
|
83
|
+
Pox5ErrorCode: () => Pox5ErrorCode,
|
|
84
|
+
assertPox5Active: () => assertPox5Active,
|
|
85
|
+
bondPeriodToBurnHeight: () => bondPeriodToBurnHeight,
|
|
86
|
+
bondPeriodToRewardCycle: () => bondPeriodToRewardCycle,
|
|
87
|
+
bondPhaseAtHeight: () => bondPhaseAtHeight,
|
|
88
|
+
bondStatusAtHeight: () => bondStatusAtHeight,
|
|
89
|
+
bondUnlockCycle: () => bondUnlockCycle,
|
|
90
|
+
buildDefaultStakerUnlockBytes: () => buildDefaultStakerUnlockBytes,
|
|
91
|
+
buildLockupAddress: () => buildLockupAddress,
|
|
92
|
+
buildLockupOutputScript: () => buildLockupOutputScript,
|
|
93
|
+
buildLockupScript: () => buildLockupScript,
|
|
94
|
+
buildPox5LockProof: () => buildPox5LockProof,
|
|
95
|
+
buildReclaim: () => buildReclaim,
|
|
96
|
+
buildRegisterMetadata: () => buildRegisterMetadata,
|
|
97
|
+
buildSignerCalldata: () => buildSignerCalldata,
|
|
98
|
+
burnHeightToDistributionIndex: () => burnHeightToDistributionIndex,
|
|
99
|
+
burnHeightToRewardCycle: () => burnHeightToRewardCycle,
|
|
100
|
+
computeBondUnlockHeight: () => computeBondUnlockHeight,
|
|
101
|
+
computeReclaimSighash: () => computeReclaimSighash,
|
|
102
|
+
computeSignerGrantHash: () => computeSignerGrantHash,
|
|
103
|
+
currentDistributionCycle: () => currentDistributionCycle,
|
|
104
|
+
describePox5Error: () => describePox5Error,
|
|
105
|
+
distributionCycleToBurnHeight: () => distributionCycleToBurnHeight,
|
|
106
|
+
eligibleClaimRewards: () => eligibleClaimRewards,
|
|
107
|
+
eligibleGrantSignerKey: () => eligibleGrantSignerKey,
|
|
108
|
+
eligiblePauseRewards: () => eligiblePauseRewards,
|
|
109
|
+
eligibleRegisterForBond: () => eligibleRegisterForBond,
|
|
110
|
+
eligibleSetBondAdmin: () => eligibleSetBondAdmin,
|
|
111
|
+
eligibleStake: () => eligibleStake,
|
|
112
|
+
eligibleUnstake: () => eligibleUnstake,
|
|
113
|
+
eligibleUnstakeSbtc: () => eligibleUnstakeSbtc,
|
|
114
|
+
finalizeReclaim: () => finalizeReclaim,
|
|
115
|
+
getPox5Activation: () => getPox5Activation,
|
|
116
|
+
getPoxInfo: () => getPoxInfo,
|
|
117
|
+
isInPreparePhase: () => isInPreparePhase,
|
|
118
|
+
isPox5Active: () => isPox5Active,
|
|
119
|
+
parseBtcAddress: () => parseBtcAddress,
|
|
120
|
+
parsePox5Error: () => parsePox5Error,
|
|
121
|
+
parseSignerCalldata: () => parseSignerCalldata,
|
|
122
|
+
pox5: () => pox5,
|
|
123
|
+
pox5ContractId: () => pox5ContractId,
|
|
124
|
+
pushCScriptNum: () => pushCScriptNum,
|
|
125
|
+
pushScriptBytes: () => pushScriptBytes,
|
|
126
|
+
reclaim: () => reclaim,
|
|
127
|
+
rewardCycleToBurnHeight: () => rewardCycleToBurnHeight,
|
|
128
|
+
serializeCScriptNum: () => serializeCScriptNum,
|
|
129
|
+
signReclaim: () => signReclaim,
|
|
130
|
+
signSignerGrant: () => signSignerGrant,
|
|
131
|
+
spvProofToL1LockupOutput: () => spvProofToL1LockupOutput,
|
|
132
|
+
stakerConsensusBuff: () => stakerConsensusBuff,
|
|
133
|
+
stakerPreimage: () => stakerPreimage,
|
|
134
|
+
stringifyBtcAddress: () => stringifyBtcAddress,
|
|
135
|
+
verifySignerGrant: () => verifySignerGrant
|
|
133
136
|
});
|
|
134
137
|
module.exports = __toCommonJS(exports_pox5);
|
|
135
138
|
|
|
@@ -161,6 +164,7 @@ var POX5_EVENT_TOPICS = [
|
|
|
161
164
|
"revoke-signer-grant"
|
|
162
165
|
];
|
|
163
166
|
var POX5_ACTIVATION_BURN_HEIGHT_MAINNET = EPOCH_4_ACTIVATION_BURN_HEIGHT_MAINNET;
|
|
167
|
+
var MAINNET_PREPARE_CYCLE_LENGTH = 100;
|
|
164
168
|
var BOND_LENGTH_CYCLES = 12;
|
|
165
169
|
var BOND_GAP_CYCLES = 2;
|
|
166
170
|
var MAX_NUM_CYCLES = 96;
|
|
@@ -902,8 +906,8 @@ function withTypeId(type, bytes) {
|
|
|
902
906
|
return concatBytes(new Uint8Array([typeIdByte(type)]), bytes);
|
|
903
907
|
}
|
|
904
908
|
function serializeAddress(c32Address) {
|
|
905
|
-
const [version,
|
|
906
|
-
return concatBytes(new Uint8Array([version]), hexToBytes(
|
|
909
|
+
const [version, hash160] = c32addressDecode(c32Address);
|
|
910
|
+
return concatBytes(new Uint8Array([version]), hexToBytes(hash160));
|
|
907
911
|
}
|
|
908
912
|
function serializeLPString(str, prefixBytes = 1) {
|
|
909
913
|
const content = utf8ToBytes(str);
|
|
@@ -1010,13 +1014,13 @@ function bufferCV(buffer) {
|
|
|
1010
1014
|
return { type: "buffer", value: bytesToHex(buffer) };
|
|
1011
1015
|
}
|
|
1012
1016
|
function standardPrincipalCV(address) {
|
|
1013
|
-
const [version,
|
|
1014
|
-
const normalized = c32address(version,
|
|
1017
|
+
const [version, hash160] = c32addressDecode(address);
|
|
1018
|
+
const normalized = c32address(version, hash160);
|
|
1015
1019
|
return { type: "address", value: normalized };
|
|
1016
1020
|
}
|
|
1017
1021
|
function contractPrincipalCV(address, contractName) {
|
|
1018
|
-
const [version,
|
|
1019
|
-
const normalized = c32address(version,
|
|
1022
|
+
const [version, hash160] = c32addressDecode(address);
|
|
1023
|
+
const normalized = c32address(version, hash160);
|
|
1020
1024
|
if (utf8ToBytes(contractName).byteLength >= 128) {
|
|
1021
1025
|
throw new Error("Contract name must be less than 128 bytes");
|
|
1022
1026
|
}
|
|
@@ -1087,8 +1091,8 @@ var Cl = {
|
|
|
1087
1091
|
// src/clarity/deserialize.ts
|
|
1088
1092
|
function readAddress(reader) {
|
|
1089
1093
|
const version = reader.readUInt8();
|
|
1090
|
-
const
|
|
1091
|
-
return c32address(version,
|
|
1094
|
+
const hash160 = bytesToHex(reader.readBytes(20));
|
|
1095
|
+
return c32address(version, hash160);
|
|
1092
1096
|
}
|
|
1093
1097
|
function readLPString(reader, prefixBytes = 1) {
|
|
1094
1098
|
let length = 0;
|
|
@@ -1831,8 +1835,8 @@ function deserializeTransaction(input, meta) {
|
|
|
1831
1835
|
|
|
1832
1836
|
// src/transactions/wire/serialize.ts
|
|
1833
1837
|
function serializeAddress2(c32Address) {
|
|
1834
|
-
const [version,
|
|
1835
|
-
return concatBytes(new Uint8Array([version]), hexToBytes(
|
|
1838
|
+
const [version, hash160] = c32addressDecode(c32Address);
|
|
1839
|
+
return concatBytes(new Uint8Array([version]), hexToBytes(hash160));
|
|
1836
1840
|
}
|
|
1837
1841
|
function serializeLPString2(str, prefixBytes = 1) {
|
|
1838
1842
|
const content = utf8ToBytes(str);
|
|
@@ -1871,8 +1875,8 @@ function serializeSpendingCondition(condition) {
|
|
|
1871
1875
|
}
|
|
1872
1876
|
function serializeAuthField(field) {
|
|
1873
1877
|
if (field.type === "publicKey") {
|
|
1874
|
-
const
|
|
1875
|
-
return concatBytes(writeUInt8(
|
|
1878
|
+
const typeId = field.pubKeyEncoding === 0 ? 0 : 1;
|
|
1879
|
+
return concatBytes(writeUInt8(typeId), hexToBytes(field.data));
|
|
1876
1880
|
}
|
|
1877
1881
|
const typeId = field.pubKeyEncoding === 0 ? 2 : 3;
|
|
1878
1882
|
return concatBytes(writeUInt8(typeId), hexToBytes(field.data));
|
|
@@ -2342,11 +2346,11 @@ function replayMultiSigSigHash(tx) {
|
|
|
2342
2346
|
const condition = tx.auth.spendingCondition;
|
|
2343
2347
|
if (isNonSequential(condition.hashMode)) {
|
|
2344
2348
|
const preSign = nonSequentialPreSignHash(tx);
|
|
2345
|
-
let
|
|
2349
|
+
let curSigHash = preSign;
|
|
2346
2350
|
for (const field of condition.fields) {
|
|
2347
|
-
|
|
2351
|
+
curSigHash = sigHashPostSign(curSigHash, field.pubKeyEncoding, field.data);
|
|
2348
2352
|
}
|
|
2349
|
-
return
|
|
2353
|
+
return curSigHash;
|
|
2350
2354
|
}
|
|
2351
2355
|
let curSigHash = initialSigHash(tx);
|
|
2352
2356
|
for (const field of condition.fields) {
|
|
@@ -2467,8 +2471,8 @@ async function signSequentialWithAccount(tx, condition, account, publicKeys, sig
|
|
|
2467
2471
|
const fields = [...condition.fields];
|
|
2468
2472
|
let curSigHash = initialSigHash(tx);
|
|
2469
2473
|
for (const field of fields) {
|
|
2470
|
-
const
|
|
2471
|
-
curSigHash = sigHashPostSign(
|
|
2474
|
+
const preSign = sigHashPreSign(curSigHash, AuthType.Standard, condition.fee, condition.nonce);
|
|
2475
|
+
curSigHash = sigHashPostSign(preSign, field.pubKeyEncoding, field.data);
|
|
2472
2476
|
}
|
|
2473
2477
|
for (let i = fields.length;i < signerIndex; i++) {
|
|
2474
2478
|
const pubKeyField = {
|
|
@@ -2477,8 +2481,8 @@ async function signSequentialWithAccount(tx, condition, account, publicKeys, sig
|
|
|
2477
2481
|
data: publicKeys[i]
|
|
2478
2482
|
};
|
|
2479
2483
|
fields.push(pubKeyField);
|
|
2480
|
-
const
|
|
2481
|
-
curSigHash = sigHashPostSign(
|
|
2484
|
+
const preSign = sigHashPreSign(curSigHash, AuthType.Standard, condition.fee, condition.nonce);
|
|
2485
|
+
curSigHash = sigHashPostSign(preSign, pubKeyField.pubKeyEncoding, pubKeyField.data);
|
|
2482
2486
|
}
|
|
2483
2487
|
const preSign = sigHashPreSign(curSigHash, AuthType.Standard, condition.fee, condition.nonce);
|
|
2484
2488
|
const sigBytes = await account.sign(hexToBytes(preSign));
|
|
@@ -2749,9 +2753,9 @@ function getOriginSigHash(tx) {
|
|
|
2749
2753
|
if ("fields" in condition) {
|
|
2750
2754
|
return replayMultiSigSigHash(tx);
|
|
2751
2755
|
}
|
|
2752
|
-
const
|
|
2756
|
+
const initialSigHash = signBegin(tx);
|
|
2753
2757
|
const sc = condition;
|
|
2754
|
-
const preSign = sigHashPreSign(
|
|
2758
|
+
const preSign = sigHashPreSign(initialSigHash, AuthType.Standard, sc.fee, sc.nonce);
|
|
2755
2759
|
return sigHashPostSign(preSign, sc.keyEncoding, sc.signature);
|
|
2756
2760
|
}
|
|
2757
2761
|
function signSponsor(tx, privateKey) {
|
|
@@ -3055,8 +3059,8 @@ function indexNotFound(error, sourceName) {
|
|
|
3055
3059
|
}
|
|
3056
3060
|
return true;
|
|
3057
3061
|
}
|
|
3058
|
-
function normalizeTxid(
|
|
3059
|
-
return
|
|
3062
|
+
function normalizeTxid(txid) {
|
|
3063
|
+
return txid.startsWith("0x") ? txid : `0x${txid}`;
|
|
3060
3064
|
}
|
|
3061
3065
|
function decodeResultHex(hex) {
|
|
3062
3066
|
if (!hex)
|
|
@@ -3080,10 +3084,10 @@ function normalizeStatus(txStatus) {
|
|
|
3080
3084
|
}
|
|
3081
3085
|
function extendedApiSource() {
|
|
3082
3086
|
return {
|
|
3083
|
-
async get({ client, txid
|
|
3087
|
+
async get({ client, txid }) {
|
|
3084
3088
|
let data;
|
|
3085
3089
|
try {
|
|
3086
|
-
data = await client.request(`/extended/v1/tx/${encodeURIComponent(normalizeTxid(
|
|
3090
|
+
data = await client.request(`/extended/v1/tx/${encodeURIComponent(normalizeTxid(txid))}`, { method: "GET" });
|
|
3087
3091
|
} catch (error) {
|
|
3088
3092
|
if (error instanceof HttpRequestError && error.status === 404) {
|
|
3089
3093
|
return { receipt: null };
|
|
@@ -3098,7 +3102,7 @@ function extendedApiSource() {
|
|
|
3098
3102
|
return { receipt: null };
|
|
3099
3103
|
return {
|
|
3100
3104
|
receipt: {
|
|
3101
|
-
txid: normalizeTxid(
|
|
3105
|
+
txid: normalizeTxid(txid),
|
|
3102
3106
|
status,
|
|
3103
3107
|
blockHeight: typeof data.block_height === "number" && data.block_height > 0 ? data.block_height : undefined,
|
|
3104
3108
|
blockHash: data.block_hash ?? undefined,
|
|
@@ -3114,11 +3118,11 @@ function indexTxSource(params = {}) {
|
|
|
3114
3118
|
const headers = params.apiKey ? { authorization: `Bearer ${params.apiKey}` } : undefined;
|
|
3115
3119
|
return {
|
|
3116
3120
|
canonicalOnly: true,
|
|
3117
|
-
async get({ client, txid
|
|
3121
|
+
async get({ client, txid }) {
|
|
3118
3122
|
const request = indexRequestFn(client, params.baseUrl, "indexTxSource");
|
|
3119
3123
|
let data;
|
|
3120
3124
|
try {
|
|
3121
|
-
data = await request(`/v1/index/transactions/${normalizeTxid(
|
|
3125
|
+
data = await request(`/v1/index/transactions/${normalizeTxid(txid)}`, {
|
|
3122
3126
|
method: "GET",
|
|
3123
3127
|
headers
|
|
3124
3128
|
});
|
|
@@ -3167,7 +3171,7 @@ async function getBlockHeight(client) {
|
|
|
3167
3171
|
var sleep2 = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
3168
3172
|
async function waitForTransactionReceipt(client, params) {
|
|
3169
3173
|
const {
|
|
3170
|
-
txid
|
|
3174
|
+
txid,
|
|
3171
3175
|
confirmations = 1,
|
|
3172
3176
|
timeout = 180000,
|
|
3173
3177
|
pollingInterval = 3000
|
|
@@ -3178,21 +3182,21 @@ async function waitForTransactionReceipt(client, params) {
|
|
|
3178
3182
|
let unknownSince = null;
|
|
3179
3183
|
let everPending = false;
|
|
3180
3184
|
while (true) {
|
|
3181
|
-
const snapshot = await source.get({ client, txid
|
|
3185
|
+
const snapshot = await source.get({ client, txid });
|
|
3182
3186
|
const receipt = snapshot.receipt;
|
|
3183
3187
|
if (receipt === null) {
|
|
3184
3188
|
unknownSince ??= Date.now();
|
|
3185
3189
|
if (Date.now() - unknownSince >= droppedGracePeriod) {
|
|
3186
|
-
throw new TransactionDroppedError(everPending ? `Transaction ${
|
|
3190
|
+
throw new TransactionDroppedError(everPending ? `Transaction ${txid} left the mempool without being mined` : `Transaction ${txid} was never observed by the status source`, { txid });
|
|
3187
3191
|
}
|
|
3188
3192
|
} else {
|
|
3189
3193
|
unknownSince = null;
|
|
3190
3194
|
switch (receipt.status) {
|
|
3191
3195
|
case "dropped":
|
|
3192
|
-
throw new TransactionDroppedError(`Transaction ${
|
|
3196
|
+
throw new TransactionDroppedError(`Transaction ${txid} was dropped from the mempool`, { txid });
|
|
3193
3197
|
case "abort_by_response":
|
|
3194
3198
|
case "abort_by_post_condition":
|
|
3195
|
-
throw new TransactionAbortedError(`Transaction ${
|
|
3199
|
+
throw new TransactionAbortedError(`Transaction ${txid} aborted (${receipt.status})`, { receipt });
|
|
3196
3200
|
case "pending":
|
|
3197
3201
|
everPending = true;
|
|
3198
3202
|
break;
|
|
@@ -3209,7 +3213,7 @@ async function waitForTransactionReceipt(client, params) {
|
|
|
3209
3213
|
}
|
|
3210
3214
|
}
|
|
3211
3215
|
if (Date.now() - startedAt >= timeout) {
|
|
3212
|
-
throw new WaitForTransactionTimeoutError(`Timed out after ${timeout}ms waiting for transaction ${
|
|
3216
|
+
throw new WaitForTransactionTimeoutError(`Timed out after ${timeout}ms waiting for transaction ${txid}`, { txid });
|
|
3213
3217
|
}
|
|
3214
3218
|
await sleep2(pollingInterval);
|
|
3215
3219
|
}
|
|
@@ -3237,11 +3241,11 @@ async function sendTransaction(client, params) {
|
|
|
3237
3241
|
throw error;
|
|
3238
3242
|
}
|
|
3239
3243
|
} else if (error instanceof TimeoutError) {
|
|
3240
|
-
const
|
|
3241
|
-
const receipt = await getTransaction(client, { txid
|
|
3244
|
+
const txid = getTransactionId(params.transaction);
|
|
3245
|
+
const receipt = await getTransaction(client, { txid }).catch(() => null);
|
|
3242
3246
|
if (receipt === null)
|
|
3243
3247
|
throw error;
|
|
3244
|
-
data = { txid
|
|
3248
|
+
data = { txid };
|
|
3245
3249
|
} else {
|
|
3246
3250
|
throw error;
|
|
3247
3251
|
}
|
|
@@ -3253,16 +3257,16 @@ async function sendTransaction(client, params) {
|
|
|
3253
3257
|
txid: data.txid ?? getTransactionId(params.transaction)
|
|
3254
3258
|
});
|
|
3255
3259
|
}
|
|
3256
|
-
const
|
|
3260
|
+
const txid = typeof data === "string" ? data.replace(/"/g, "") : data.txid ?? getTransactionId(params.transaction);
|
|
3257
3261
|
if (params.wait) {
|
|
3258
3262
|
const confirmations = params.wait === true ? 1 : params.wait;
|
|
3259
3263
|
const receipt = await waitForTransactionReceipt(client, {
|
|
3260
|
-
txid
|
|
3264
|
+
txid,
|
|
3261
3265
|
confirmations
|
|
3262
3266
|
});
|
|
3263
|
-
return { txid
|
|
3267
|
+
return { txid, receipt };
|
|
3264
3268
|
}
|
|
3265
|
-
return { txid
|
|
3269
|
+
return { txid };
|
|
3266
3270
|
}
|
|
3267
3271
|
|
|
3268
3272
|
// src/actions/wallet/nonceManager.ts
|
|
@@ -5117,8 +5121,8 @@ function stripWitness(rawTx) {
|
|
|
5117
5121
|
return scanTx(rawTx).legacy;
|
|
5118
5122
|
}
|
|
5119
5123
|
function bitcoinTxid(rawTx, { display = false } = {}) {
|
|
5120
|
-
const
|
|
5121
|
-
return display ? reverseBytes(
|
|
5124
|
+
const txid = doubleSha256(scanTx(rawTx).legacy);
|
|
5125
|
+
return display ? reverseBytes(txid) : txid;
|
|
5122
5126
|
}
|
|
5123
5127
|
function parseBlockHeader(header) {
|
|
5124
5128
|
if (header.length !== 80) {
|
|
@@ -5436,8 +5440,8 @@ function rootFromProof(leafInternal, proof) {
|
|
|
5436
5440
|
}
|
|
5437
5441
|
|
|
5438
5442
|
// src/bitcoin/proof.ts
|
|
5439
|
-
function normalizeTxid2(
|
|
5440
|
-
return without0x(
|
|
5443
|
+
function normalizeTxid2(txid) {
|
|
5444
|
+
return without0x(txid).toLowerCase();
|
|
5441
5445
|
}
|
|
5442
5446
|
function assembleBlockForTx(args) {
|
|
5443
5447
|
const txIndex = args.txidsDisplay.indexOf(normalizeTxid2(args.txid));
|
|
@@ -5452,11 +5456,11 @@ function assembleBlockForTx(args) {
|
|
|
5452
5456
|
};
|
|
5453
5457
|
}
|
|
5454
5458
|
async function buildTxProof(source, params) {
|
|
5455
|
-
const { txid
|
|
5456
|
-
const want = normalizeTxid2(
|
|
5459
|
+
const { txid, vout } = params;
|
|
5460
|
+
const want = normalizeTxid2(txid);
|
|
5457
5461
|
const [rawTx, block] = await Promise.all([
|
|
5458
|
-
source.getRawTx(
|
|
5459
|
-
source.getBlockForTx(
|
|
5462
|
+
source.getRawTx(txid),
|
|
5463
|
+
source.getBlockForTx(txid)
|
|
5460
5464
|
]);
|
|
5461
5465
|
const parsed = parseBitcoinTx(rawTx);
|
|
5462
5466
|
const gotDisplay = bytesToHex(reverseBytes(parsed.txidInternal));
|
|
@@ -5498,8 +5502,8 @@ function fallbackProofSource(sources) {
|
|
|
5498
5502
|
throw lastError;
|
|
5499
5503
|
}
|
|
5500
5504
|
return {
|
|
5501
|
-
getRawTx: (
|
|
5502
|
-
getBlockForTx: (
|
|
5505
|
+
getRawTx: (txid) => firstSuccess((s) => s.getRawTx(txid)),
|
|
5506
|
+
getBlockForTx: (txid) => firstSuccess((s) => s.getBlockForTx(txid))
|
|
5503
5507
|
};
|
|
5504
5508
|
}
|
|
5505
5509
|
function bitcoinRpcSource(config) {
|
|
@@ -5532,16 +5536,16 @@ function bitcoinRpcSource(config) {
|
|
|
5532
5536
|
return json.result;
|
|
5533
5537
|
}
|
|
5534
5538
|
return {
|
|
5535
|
-
async getRawTx(
|
|
5536
|
-
return hexToBytes(await rpc("getrawtransaction", [
|
|
5539
|
+
async getRawTx(txid) {
|
|
5540
|
+
return hexToBytes(await rpc("getrawtransaction", [txid, false]));
|
|
5537
5541
|
},
|
|
5538
|
-
async getBlockForTx(
|
|
5542
|
+
async getBlockForTx(txid) {
|
|
5539
5543
|
const tx = await rpc("getrawtransaction", [
|
|
5540
|
-
|
|
5544
|
+
txid,
|
|
5541
5545
|
true
|
|
5542
5546
|
]);
|
|
5543
5547
|
if (!tx.blockhash) {
|
|
5544
|
-
throw new Error(`tx ${
|
|
5548
|
+
throw new Error(`tx ${txid} is not in a block (node needs -txindex, or the tx is unconfirmed)`);
|
|
5545
5549
|
}
|
|
5546
5550
|
const block = await rpc("getblock", [
|
|
5547
5551
|
tx.blockhash,
|
|
@@ -5549,7 +5553,7 @@ function bitcoinRpcSource(config) {
|
|
|
5549
5553
|
]);
|
|
5550
5554
|
const header = await rpc("getblockheader", [tx.blockhash, false]);
|
|
5551
5555
|
return assembleBlockForTx({
|
|
5552
|
-
txid
|
|
5556
|
+
txid,
|
|
5553
5557
|
blockId: tx.blockhash,
|
|
5554
5558
|
headerHex: header,
|
|
5555
5559
|
height: block.height,
|
|
@@ -5569,19 +5573,19 @@ function esploraSource(config) {
|
|
|
5569
5573
|
return res;
|
|
5570
5574
|
}
|
|
5571
5575
|
return {
|
|
5572
|
-
async getRawTx(
|
|
5573
|
-
return hexToBytes((await (await get(`/tx/${
|
|
5576
|
+
async getRawTx(txid) {
|
|
5577
|
+
return hexToBytes((await (await get(`/tx/${txid}/hex`)).text()).trim());
|
|
5574
5578
|
},
|
|
5575
|
-
async getBlockForTx(
|
|
5576
|
-
const status = await (await get(`/tx/${
|
|
5579
|
+
async getBlockForTx(txid) {
|
|
5580
|
+
const status = await (await get(`/tx/${txid}`)).json();
|
|
5577
5581
|
if (!status.status.confirmed) {
|
|
5578
|
-
throw new Error(`tx ${
|
|
5582
|
+
throw new Error(`tx ${txid} is unconfirmed`);
|
|
5579
5583
|
}
|
|
5580
5584
|
const blockHashHex = status.status.block_hash;
|
|
5581
5585
|
const header = (await (await get(`/block/${blockHashHex}/header`)).text()).trim();
|
|
5582
5586
|
const txids = await (await get(`/block/${blockHashHex}/txids`)).json();
|
|
5583
5587
|
return assembleBlockForTx({
|
|
5584
|
-
txid
|
|
5588
|
+
txid,
|
|
5585
5589
|
blockId: blockHashHex,
|
|
5586
5590
|
headerHex: header,
|
|
5587
5591
|
height: status.status.block_height,
|
|
@@ -5654,7 +5658,7 @@ async function buildPox5LockProof(opts) {
|
|
|
5654
5658
|
}
|
|
5655
5659
|
// src/pox5/reclaim.ts
|
|
5656
5660
|
var import_sha28 = require("@noble/hashes/sha2.js");
|
|
5657
|
-
var btc = __toESM(require("@scure/btc-signer"));
|
|
5661
|
+
var btc = __toESM(require("@scure/btc-signer"), 1);
|
|
5658
5662
|
var import_utils5 = require("@scure/btc-signer/utils.js");
|
|
5659
5663
|
var SIGHASH_ALL = 1;
|
|
5660
5664
|
var DUST_LIMIT_SATS = 546n;
|
|
@@ -6121,5 +6125,5 @@ function parseSignerCalldata(calldata) {
|
|
|
6121
6125
|
};
|
|
6122
6126
|
}
|
|
6123
6127
|
|
|
6124
|
-
//# debugId=
|
|
6128
|
+
//# debugId=4C601AE15AFDE5D164756E2164756E21
|
|
6125
6129
|
//# sourceMappingURL=index.cjs.map
|