@secondlayer/stacks 6.4.1 → 6.5.0
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-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-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-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-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/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/pox/index.cjs +7 -3
- package/dist/src/pox/index.cjs.map +3 -3
- package/dist/src/pox/index.js +2 -2
- package/dist/src/pox5/index.cjs +7 -3
- package/dist/src/pox5/index.cjs.map +3 -3
- package/dist/src/pox5/index.js +7 -5
- package/dist/src/pox5/index.js.map +2 -2
- package/dist/src/sbtc/index.cjs +173 -15
- package/dist/src/sbtc/index.cjs.map +10 -7
- package/dist/src/sbtc/index.d.cts +117 -5
- package/dist/src/sbtc/index.d.ts +117 -5
- package/dist/src/sbtc/index.js +152 -9
- package/dist/src/sbtc/index.js.map +7 -6
- package/package.json +1 -1
- /package/dist/shared/{stacks-esm-ss9ap75h.js.map → stacks-esm-47b3bb9e.js.map} +0 -0
package/dist/src/pox/index.js
CHANGED
|
@@ -7,14 +7,14 @@ import"../../shared/stacks-esm-hv11fdgy.js";
|
|
|
7
7
|
import {
|
|
8
8
|
Pc2
|
|
9
9
|
} from "../../shared/stacks-esm-w36fvdxx.js";
|
|
10
|
-
import"../../shared/stacks-esm-
|
|
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
|
package/dist/src/pox5/index.cjs
CHANGED
|
@@ -5191,10 +5191,12 @@ function formatBitcoinAddress(parsed, network = "mainnet") {
|
|
|
5191
5191
|
function toPubkeyBytes(publicKey) {
|
|
5192
5192
|
return typeof publicKey === "string" ? hexToBytes(publicKey) : publicKey;
|
|
5193
5193
|
}
|
|
5194
|
-
function taprootTweakPubkey(xonly) {
|
|
5194
|
+
function taprootTweakPubkey(xonly, merkleRoot) {
|
|
5195
5195
|
if (xonly.length !== 32)
|
|
5196
5196
|
throw new Error(`Expected 32-byte x-only pubkey, got ${xonly.length}`);
|
|
5197
|
-
|
|
5197
|
+
if (merkleRoot && merkleRoot.length !== 32)
|
|
5198
|
+
throw new Error(`Expected 32-byte merkle root, got ${merkleRoot.length}`);
|
|
5199
|
+
const tweak = merkleRoot ? import_secp256k13.schnorr.utils.taggedHash("TapTweak", xonly, merkleRoot) : import_secp256k13.schnorr.utils.taggedHash("TapTweak", xonly);
|
|
5198
5200
|
const t = BigInt(`0x${Array.from(tweak, (b) => b.toString(16).padStart(2, "0")).join("")}`);
|
|
5199
5201
|
if (t >= import_secp256k13.secp256k1.Point.Fn.ORDER)
|
|
5200
5202
|
throw new Error("Invalid tap tweak (exceeds curve order)");
|
|
@@ -5214,6 +5216,8 @@ function publicKeyToP2trAddress(publicKey, network = "mainnet") {
|
|
|
5214
5216
|
const xonly = pubkey.length === 33 ? pubkey.slice(1) : pubkey.length === 32 ? pubkey : undefined;
|
|
5215
5217
|
if (!xonly)
|
|
5216
5218
|
throw new Error(`Expected 33-byte compressed or 32-byte x-only pubkey, got ${pubkey.length}`);
|
|
5219
|
+
if (pubkey.length === 33 && pubkey[0] !== 2 && pubkey[0] !== 3)
|
|
5220
|
+
throw new Error(`Expected a compressed pubkey prefix 0x02 or 0x03, got 0x${pubkey[0]?.toString(16).padStart(2, "0")}`);
|
|
5217
5221
|
const params = NETWORK_PARAMS[network];
|
|
5218
5222
|
const outputKey = taprootTweakPubkey(xonly);
|
|
5219
5223
|
return import_base5.bech32m.encode(params.hrp, [1, ...import_base5.bech32m.toWords(outputKey)]);
|
|
@@ -6163,5 +6167,5 @@ function parseSignerCalldata(calldata) {
|
|
|
6163
6167
|
};
|
|
6164
6168
|
}
|
|
6165
6169
|
|
|
6166
|
-
//# debugId=
|
|
6170
|
+
//# debugId=095F4FE8EAB36A7364756E2164756E21
|
|
6167
6171
|
//# sourceMappingURL=index.cjs.map
|