@secondlayer/stacks 6.4.1 → 6.5.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-w8kswk0r.js → stacks-esm-2g7h9sbq.js} +3 -3
- package/dist/shared/{stacks-esm-ss9ap75h.js → stacks-esm-47b3bb9e.js} +2 -2
- package/dist/shared/stacks-esm-51sysw9g.js +7 -0
- package/dist/shared/stacks-esm-51sysw9g.js.map +10 -0
- package/dist/shared/{stacks-esm-w36fvdxx.js → stacks-esm-5w6zn26c.js} +2 -2
- package/dist/shared/{stacks-esm-hcjqgrtm.js → stacks-esm-60wsk8b7.js} +3 -3
- package/dist/shared/{stacks-esm-zwbhghxb.js → stacks-esm-90bwm9ng.js} +3 -4
- package/dist/shared/{stacks-esm-zwbhghxb.js.map → stacks-esm-90bwm9ng.js.map} +3 -3
- package/dist/shared/{stacks-esm-z0rq3ejt.js → stacks-esm-fb1gh99a.js} +4 -7
- package/dist/shared/{stacks-esm-z0rq3ejt.js.map → stacks-esm-fb1gh99a.js.map} +4 -5
- package/dist/shared/{stacks-esm-hv11fdgy.js → stacks-esm-kd5gn8v3.js} +2 -2
- package/dist/shared/{stacks-esm-e2qhfgke.js → stacks-esm-ph2fd7hg.js} +8 -4
- package/dist/shared/{stacks-esm-e2qhfgke.js.map → stacks-esm-ph2fd7hg.js.map} +3 -3
- package/dist/shared/{stacks-esm-bragecm9.js → stacks-esm-s6tybkrn.js} +4 -4
- package/dist/shared/stacks-esm-zvpv6a06.js +28 -0
- package/dist/shared/stacks-esm-zvpv6a06.js.map +10 -0
- package/dist/src/accounts/index.cjs +7 -3
- package/dist/src/accounts/index.cjs.map +3 -3
- package/dist/src/accounts/index.js +1 -1
- package/dist/src/actions/index.cjs +2 -3
- package/dist/src/actions/index.cjs.map +3 -3
- package/dist/src/actions/index.js +5 -5
- package/dist/src/bitcoin/index.cjs +7 -3
- package/dist/src/bitcoin/index.cjs.map +3 -3
- package/dist/src/bitcoin/index.d.cts +6 -5
- package/dist/src/bitcoin/index.d.ts +6 -5
- package/dist/src/bitcoin/index.js +12 -23
- package/dist/src/bitcoin/index.js.map +3 -4
- package/dist/src/bns/index.cjs +2 -3
- package/dist/src/bns/index.cjs.map +3 -3
- package/dist/src/bns/index.js +5 -5
- package/dist/src/index.cjs +2 -3
- package/dist/src/index.cjs.map +3 -3
- package/dist/src/index.js +4 -4
- package/dist/src/postconditions/index.cjs +2 -3
- package/dist/src/postconditions/index.cjs.map +3 -3
- package/dist/src/postconditions/index.js +2 -2
- package/dist/src/pox/index.cjs +8 -5
- package/dist/src/pox/index.cjs.map +4 -4
- package/dist/src/pox/index.js +7 -7
- package/dist/src/pox5/index.cjs +8 -5
- package/dist/src/pox5/index.cjs.map +4 -4
- package/dist/src/pox5/index.js +11 -9
- package/dist/src/pox5/index.js.map +2 -2
- package/dist/src/sbtc/index.cjs +174 -17
- package/dist/src/sbtc/index.cjs.map +11 -8
- package/dist/src/sbtc/index.d.cts +117 -5
- package/dist/src/sbtc/index.d.ts +117 -5
- package/dist/src/sbtc/index.js +156 -13
- package/dist/src/sbtc/index.js.map +7 -6
- package/dist/src/simnet/index.cjs +2 -3
- package/dist/src/simnet/index.cjs.map +3 -3
- package/dist/src/simnet/index.js +2 -3
- package/dist/src/simnet/index.js.map +3 -3
- package/dist/src/stackingdao/index.cjs +2 -3
- package/dist/src/stackingdao/index.cjs.map +3 -3
- package/dist/src/stackingdao/index.js +5 -5
- package/dist/src/transactions/index.cjs +2 -3
- package/dist/src/transactions/index.cjs.map +3 -3
- package/dist/src/transactions/index.js +2 -2
- package/package.json +1 -1
- /package/dist/shared/{stacks-esm-w8kswk0r.js.map → stacks-esm-2g7h9sbq.js.map} +0 -0
- /package/dist/shared/{stacks-esm-ss9ap75h.js.map → stacks-esm-47b3bb9e.js.map} +0 -0
- /package/dist/shared/{stacks-esm-w36fvdxx.js.map → stacks-esm-5w6zn26c.js.map} +0 -0
- /package/dist/shared/{stacks-esm-hcjqgrtm.js.map → stacks-esm-60wsk8b7.js.map} +0 -0
- /package/dist/shared/{stacks-esm-hv11fdgy.js.map → stacks-esm-kd5gn8v3.js.map} +0 -0
- /package/dist/shared/{stacks-esm-bragecm9.js.map → stacks-esm-s6tybkrn.js.map} +0 -0
package/dist/src/pox/index.js
CHANGED
|
@@ -2,24 +2,24 @@ import"../../shared/stacks-esm-7a0ehykf.js";
|
|
|
2
2
|
import"../../shared/stacks-esm-kbz5s6v8.js";
|
|
3
3
|
import"../../shared/stacks-esm-gs60rd15.js";
|
|
4
4
|
import"../../shared/stacks-esm-896kv9yv.js";
|
|
5
|
-
import"../../shared/stacks-esm-
|
|
6
|
-
import"../../shared/stacks-esm-
|
|
5
|
+
import"../../shared/stacks-esm-90bwm9ng.js";
|
|
6
|
+
import"../../shared/stacks-esm-kd5gn8v3.js";
|
|
7
7
|
import {
|
|
8
8
|
Pc2
|
|
9
|
-
} from "../../shared/stacks-esm-
|
|
10
|
-
import"../../shared/stacks-esm-
|
|
9
|
+
} from "../../shared/stacks-esm-5w6zn26c.js";
|
|
10
|
+
import"../../shared/stacks-esm-ph2fd7hg.js";
|
|
11
11
|
import {
|
|
12
12
|
POX_CONTRACTS2,
|
|
13
13
|
MIN_LOCK_PERIOD2,
|
|
14
14
|
MAX_LOCK_PERIOD2,
|
|
15
15
|
POX_ADDRESS_VERSION2,
|
|
16
16
|
parseBtcAddress2
|
|
17
|
-
} from "../../shared/stacks-esm-
|
|
17
|
+
} from "../../shared/stacks-esm-47b3bb9e.js";
|
|
18
18
|
import {
|
|
19
19
|
getContract2,
|
|
20
20
|
resolveNetworkContract
|
|
21
|
-
} from "../../shared/stacks-esm-
|
|
22
|
-
import"../../shared/stacks-esm-
|
|
21
|
+
} from "../../shared/stacks-esm-2g7h9sbq.js";
|
|
22
|
+
import"../../shared/stacks-esm-60wsk8b7.js";
|
|
23
23
|
import"../../shared/stacks-esm-x8gjr2v6.js";
|
|
24
24
|
|
|
25
25
|
// src/pox/abi.ts
|
package/dist/src/pox5/index.cjs
CHANGED
|
@@ -1594,11 +1594,10 @@ function readSpendingCondition(r) {
|
|
|
1594
1594
|
for (let i = 0;i < fieldCount; i++) {
|
|
1595
1595
|
const fieldType = r.readUInt8();
|
|
1596
1596
|
if (fieldType <= 1) {
|
|
1597
|
-
const keyLen = fieldType === 0 ? 33 : 65;
|
|
1598
1597
|
fields.push({
|
|
1599
1598
|
type: "publicKey",
|
|
1600
1599
|
pubKeyEncoding: fieldType,
|
|
1601
|
-
data: bytesToHex(r.readBytes(
|
|
1600
|
+
data: bytesToHex(r.readBytes(33))
|
|
1602
1601
|
});
|
|
1603
1602
|
} else {
|
|
1604
1603
|
fields.push({
|
|
@@ -5191,10 +5190,12 @@ function formatBitcoinAddress(parsed, network = "mainnet") {
|
|
|
5191
5190
|
function toPubkeyBytes(publicKey) {
|
|
5192
5191
|
return typeof publicKey === "string" ? hexToBytes(publicKey) : publicKey;
|
|
5193
5192
|
}
|
|
5194
|
-
function taprootTweakPubkey(xonly) {
|
|
5193
|
+
function taprootTweakPubkey(xonly, merkleRoot) {
|
|
5195
5194
|
if (xonly.length !== 32)
|
|
5196
5195
|
throw new Error(`Expected 32-byte x-only pubkey, got ${xonly.length}`);
|
|
5197
|
-
|
|
5196
|
+
if (merkleRoot && merkleRoot.length !== 32)
|
|
5197
|
+
throw new Error(`Expected 32-byte merkle root, got ${merkleRoot.length}`);
|
|
5198
|
+
const tweak = merkleRoot ? import_secp256k13.schnorr.utils.taggedHash("TapTweak", xonly, merkleRoot) : import_secp256k13.schnorr.utils.taggedHash("TapTweak", xonly);
|
|
5198
5199
|
const t = BigInt(`0x${Array.from(tweak, (b) => b.toString(16).padStart(2, "0")).join("")}`);
|
|
5199
5200
|
if (t >= import_secp256k13.secp256k1.Point.Fn.ORDER)
|
|
5200
5201
|
throw new Error("Invalid tap tweak (exceeds curve order)");
|
|
@@ -5214,6 +5215,8 @@ function publicKeyToP2trAddress(publicKey, network = "mainnet") {
|
|
|
5214
5215
|
const xonly = pubkey.length === 33 ? pubkey.slice(1) : pubkey.length === 32 ? pubkey : undefined;
|
|
5215
5216
|
if (!xonly)
|
|
5216
5217
|
throw new Error(`Expected 33-byte compressed or 32-byte x-only pubkey, got ${pubkey.length}`);
|
|
5218
|
+
if (pubkey.length === 33 && pubkey[0] !== 2 && pubkey[0] !== 3)
|
|
5219
|
+
throw new Error(`Expected a compressed pubkey prefix 0x02 or 0x03, got 0x${pubkey[0]?.toString(16).padStart(2, "0")}`);
|
|
5217
5220
|
const params = NETWORK_PARAMS[network];
|
|
5218
5221
|
const outputKey = taprootTweakPubkey(xonly);
|
|
5219
5222
|
return import_base5.bech32m.encode(params.hrp, [1, ...import_base5.bech32m.toWords(outputKey)]);
|
|
@@ -6163,5 +6166,5 @@ function parseSignerCalldata(calldata) {
|
|
|
6163
6166
|
};
|
|
6164
6167
|
}
|
|
6165
6168
|
|
|
6166
|
-
//# debugId=
|
|
6169
|
+
//# debugId=0C3339AEA1AAF38B64756E2164756E21
|
|
6167
6170
|
//# sourceMappingURL=index.cjs.map
|