@btc-vision/transaction 1.7.24 → 1.7.25
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/browser/_version.d.ts +1 -1
- package/browser/btc-vision-logger.js +73 -260
- package/browser/index.js +67 -67
- package/browser/polyfills.js +3732 -3370
- package/browser/vendors.js +10697 -7231
- package/build/_version.d.ts +1 -1
- package/build/_version.js +1 -1
- package/build/transaction/builders/ChallengeSolutionTransaction.d.ts +1 -0
- package/build/transaction/builders/ChallengeSolutionTransaction.js +1 -1
- package/build/tsconfig.build.tsbuildinfo +1 -0
- package/package.json +20 -18
- package/src/_version.ts +1 -1
- package/src/shims/vm-browser.js +19 -0
- package/src/shims/zlib-browser.js +24 -0
- package/tsconfig.build.json +5 -0
- package/vite.config.browser.ts +4 -2
- package/build/crypto/crypto-browser.d.ts +0 -11
- package/build/crypto/crypto-browser.js +0 -56
- package/gulpfile.js +0 -42
package/browser/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { z as Te,
|
|
1
|
+
import { z as Te, o as Jt, s as vi } from "./vendors.js";
|
|
2
2
|
import { B as a, a as I } from "./polyfills.js";
|
|
3
|
-
import { i as at, b as T, p as
|
|
3
|
+
import { i as at, b as T, p as Li, a as dt, c as te, t as O, d as st, e as rt, f as k, g as ve, h as ee, j as St, k as Ie, l as ki, o as g, m as F, n as Dt, q as jt, r as Le, s as Ui, u as G, v as ft, w as _i, x as Ki, y as ke, z as xt, A as Yt, B as Ue, C as Di, D as _e, P as v, E as Ci, F as Pe, G as Ri, H as Ee, I as Fi, J as Wi, K as Mi, L as Ni, M as _, T as ie, N as Hi } from "./btc-vision-bitcoin.js";
|
|
4
4
|
import { f as Q, s as Vi, d as Ct, g as Ft, b as zi, c as qi, e as $i } from "./bitcoin-utils.js";
|
|
5
5
|
import { b as Ae, c as P } from "./btc-vision-bip32.js";
|
|
6
6
|
import { s as Xi, m as Yi, e as Gi } from "./noble-curves.js";
|
|
7
7
|
import { A as Qi, z as oe, x as ji, u as Zi } from "./noble-hashes.js";
|
|
8
|
-
import {
|
|
8
|
+
import { L as Ke } from "./btc-vision-logger.js";
|
|
9
9
|
import { s as gt } from "./bip39.js";
|
|
10
|
-
const Ji = "1.7.
|
|
10
|
+
const Ji = "1.7.25";
|
|
11
11
|
class N {
|
|
12
12
|
static {
|
|
13
13
|
this.zlibOptions = {
|
|
@@ -93,7 +93,7 @@ class A {
|
|
|
93
93
|
static generateMultiSigAddress(t, e, i = T) {
|
|
94
94
|
const r = this.verifyPubKeys(t, i);
|
|
95
95
|
if (r.length !== t.length) throw new Error("Contains invalid public keys");
|
|
96
|
-
const s =
|
|
96
|
+
const s = Li({
|
|
97
97
|
m: e,
|
|
98
98
|
pubkeys: r,
|
|
99
99
|
network: i
|
|
@@ -171,7 +171,7 @@ class A {
|
|
|
171
171
|
]);
|
|
172
172
|
if (r.length < 2 || r.length > 40)
|
|
173
173
|
throw new Error("Witness program must be 2-40 bytes.");
|
|
174
|
-
const s =
|
|
174
|
+
const s = k([g.OP_16, r]);
|
|
175
175
|
return ve(s, e);
|
|
176
176
|
}
|
|
177
177
|
/**
|
|
@@ -315,7 +315,7 @@ class A {
|
|
|
315
315
|
* @returns {string} - The legacy address
|
|
316
316
|
*/
|
|
317
317
|
static getP2PKAddress(t, e = T) {
|
|
318
|
-
const i =
|
|
318
|
+
const i = ki({ pubkey: a.from(t.publicKey), network: e });
|
|
319
319
|
if (!i.output)
|
|
320
320
|
throw new Error("Failed to generate wallet");
|
|
321
321
|
return "0x" + i.output.toString("hex");
|
|
@@ -518,7 +518,7 @@ class q {
|
|
|
518
518
|
static generateP2WDAAddress(t, e) {
|
|
519
519
|
if (t.length !== 33)
|
|
520
520
|
throw new Error("Public key must be 33 bytes (compressed)");
|
|
521
|
-
const i =
|
|
521
|
+
const i = k([
|
|
522
522
|
g.OP_2DROP,
|
|
523
523
|
g.OP_2DROP,
|
|
524
524
|
g.OP_2DROP,
|
|
@@ -1043,8 +1043,8 @@ class M {
|
|
|
1043
1043
|
return s.address;
|
|
1044
1044
|
}
|
|
1045
1045
|
static generateTimeLockScript(t, e = M.CSV_BLOCKS) {
|
|
1046
|
-
return
|
|
1047
|
-
|
|
1046
|
+
return k([
|
|
1047
|
+
Le.encode(e),
|
|
1048
1048
|
g.OP_CHECKSEQUENCEVERIFY,
|
|
1049
1049
|
g.OP_DROP,
|
|
1050
1050
|
t,
|
|
@@ -1052,7 +1052,7 @@ class M {
|
|
|
1052
1052
|
]);
|
|
1053
1053
|
}
|
|
1054
1054
|
}
|
|
1055
|
-
class
|
|
1055
|
+
class L extends Uint8Array {
|
|
1056
1056
|
#t;
|
|
1057
1057
|
#e;
|
|
1058
1058
|
#s;
|
|
@@ -1120,7 +1120,7 @@ class k extends Uint8Array {
|
|
|
1120
1120
|
return this.#u;
|
|
1121
1121
|
}
|
|
1122
1122
|
static dead() {
|
|
1123
|
-
return
|
|
1123
|
+
return L.fromString(
|
|
1124
1124
|
"0x0000000000000000000000000000000000000000000000000000000000000000",
|
|
1125
1125
|
// DEAD ADDRESS
|
|
1126
1126
|
"0x04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f"
|
|
@@ -1147,7 +1147,7 @@ class k extends Uint8Array {
|
|
|
1147
1147
|
);
|
|
1148
1148
|
i = a.from(e, "hex");
|
|
1149
1149
|
}
|
|
1150
|
-
return new
|
|
1150
|
+
return new L(a.from(t, "hex"), i);
|
|
1151
1151
|
}
|
|
1152
1152
|
/**
|
|
1153
1153
|
* Create an address from a public key
|
|
@@ -1155,7 +1155,7 @@ class k extends Uint8Array {
|
|
|
1155
1155
|
* @param {ArrayLike<number>} bytes The public key
|
|
1156
1156
|
*/
|
|
1157
1157
|
static wrap(t) {
|
|
1158
|
-
return new
|
|
1158
|
+
return new L(t);
|
|
1159
1159
|
}
|
|
1160
1160
|
static uncompressedToCompressed(t) {
|
|
1161
1161
|
const e = Uint8Array.from(t), i = e.slice(1, 33), r = e.slice(33), s = a.alloc(33);
|
|
@@ -1182,7 +1182,7 @@ class k extends Uint8Array {
|
|
|
1182
1182
|
*/
|
|
1183
1183
|
static fromBigInt(t) {
|
|
1184
1184
|
const e = new Uint8Array(32), i = new DataView(e.buffer);
|
|
1185
|
-
return i.setBigUint64(0, t >> 192n & 0xffffffffffffffffn, !1), i.setBigUint64(8, t >> 128n & 0xffffffffffffffffn, !1), i.setBigUint64(16, t >> 64n & 0xffffffffffffffffn, !1), i.setBigUint64(24, t & 0xffffffffffffffffn, !1), new
|
|
1185
|
+
return i.setBigUint64(0, t >> 192n & 0xffffffffffffffffn, !1), i.setBigUint64(8, t >> 128n & 0xffffffffffffffffn, !1), i.setBigUint64(16, t >> 64n & 0xffffffffffffffffn, !1), i.setBigUint64(24, t & 0xffffffffffffffffn, !1), new L(e);
|
|
1186
1186
|
}
|
|
1187
1187
|
/**
|
|
1188
1188
|
* Creates an Address instance from four 64-bit unsigned integers.
|
|
@@ -1212,7 +1212,7 @@ class k extends Uint8Array {
|
|
|
1212
1212
|
*/
|
|
1213
1213
|
static fromUint64Array(t, e, i, r) {
|
|
1214
1214
|
const s = new Uint8Array(32), o = new DataView(s.buffer);
|
|
1215
|
-
return o.setBigUint64(0, t, !1), o.setBigUint64(8, e, !1), o.setBigUint64(16, i, !1), o.setBigUint64(24, r, !1), new
|
|
1215
|
+
return o.setBigUint64(0, t, !1), o.setBigUint64(8, e, !1), o.setBigUint64(16, i, !1), o.setBigUint64(24, r, !1), new L(s);
|
|
1216
1216
|
}
|
|
1217
1217
|
/**
|
|
1218
1218
|
* Converts the address to four 64-bit unsigned integers.
|
|
@@ -1594,7 +1594,7 @@ class k extends Uint8Array {
|
|
|
1594
1594
|
*/
|
|
1595
1595
|
autoFormat(t) {
|
|
1596
1596
|
const e = t[0];
|
|
1597
|
-
e === 3 || e === 2 || (e === 4 || e === 6 || e === 7) && (t =
|
|
1597
|
+
e === 3 || e === 2 || (e === 4 || e === 6 || e === 7) && (t = L.uncompressedToCompressed(t)), this.#i = Uint8Array.from(t), this.#u = A.fromPublicKey(this.#i), this.#r = Ui(this.#i);
|
|
1598
1598
|
const i = O(
|
|
1599
1599
|
A.tweakPublicKey(a.from(this.#i))
|
|
1600
1600
|
);
|
|
@@ -1699,11 +1699,11 @@ class Re {
|
|
|
1699
1699
|
*/
|
|
1700
1700
|
*entries() {
|
|
1701
1701
|
for (const [t, e] of this.items.entries())
|
|
1702
|
-
yield [
|
|
1702
|
+
yield [L.fromBigInt(t), e];
|
|
1703
1703
|
}
|
|
1704
1704
|
*keys() {
|
|
1705
1705
|
for (const t of this.items.keys())
|
|
1706
|
-
yield
|
|
1706
|
+
yield L.fromBigInt(t);
|
|
1707
1707
|
}
|
|
1708
1708
|
*values() {
|
|
1709
1709
|
for (const t of this.items.values())
|
|
@@ -1711,7 +1711,7 @@ class Re {
|
|
|
1711
1711
|
}
|
|
1712
1712
|
forEach(t, e) {
|
|
1713
1713
|
for (const [i, r] of this.items.entries()) {
|
|
1714
|
-
const s =
|
|
1714
|
+
const s = L.fromBigInt(i);
|
|
1715
1715
|
t.call(e, r, s, this);
|
|
1716
1716
|
}
|
|
1717
1717
|
}
|
|
@@ -1859,7 +1859,7 @@ class Gt {
|
|
|
1859
1859
|
*/
|
|
1860
1860
|
readAddress() {
|
|
1861
1861
|
const t = Array.from(this.readBytes(D));
|
|
1862
|
-
return new
|
|
1862
|
+
return new L(t);
|
|
1863
1863
|
}
|
|
1864
1864
|
/**
|
|
1865
1865
|
* Reads bytes written as [u32 length][bytes].
|
|
@@ -2240,7 +2240,7 @@ class $ {
|
|
|
2240
2240
|
const i = new C();
|
|
2241
2241
|
i.writeU16(Object.keys(t.data).length);
|
|
2242
2242
|
for (const r in t.data) {
|
|
2243
|
-
const s =
|
|
2243
|
+
const s = L.fromString(r), o = t.data[r];
|
|
2244
2244
|
i.writeAddress(s), i.writeU32(o.length);
|
|
2245
2245
|
for (const c of o) {
|
|
2246
2246
|
const u = a.from(c, "base64");
|
|
@@ -2352,7 +2352,7 @@ class ae extends $ {
|
|
|
2352
2352
|
g.OP_1,
|
|
2353
2353
|
g.OP_ENDIF
|
|
2354
2354
|
);
|
|
2355
|
-
const l = h.flat(), d =
|
|
2355
|
+
const l = h.flat(), d = k(l);
|
|
2356
2356
|
if (!F(d))
|
|
2357
2357
|
throw new Error("Failed to decompile script??");
|
|
2358
2358
|
return d;
|
|
@@ -2369,7 +2369,7 @@ class Fe extends $ {
|
|
|
2369
2369
|
* @throws {Error} - If something goes wrong
|
|
2370
2370
|
*/
|
|
2371
2371
|
compile(t) {
|
|
2372
|
-
const e = t.flat(), i =
|
|
2372
|
+
const e = t.flat(), i = k(e);
|
|
2373
2373
|
if (!F(i))
|
|
2374
2374
|
throw new Error("Failed to decompile script??");
|
|
2375
2375
|
return i;
|
|
@@ -2398,7 +2398,7 @@ class Nt extends $ {
|
|
|
2398
2398
|
r,
|
|
2399
2399
|
s,
|
|
2400
2400
|
o
|
|
2401
|
-
), u =
|
|
2401
|
+
), u = k(c);
|
|
2402
2402
|
if (!F(u))
|
|
2403
2403
|
throw new Error("Failed to decompile script??");
|
|
2404
2404
|
return u;
|
|
@@ -2681,7 +2681,7 @@ class E extends Ke {
|
|
|
2681
2681
|
const e = [];
|
|
2682
2682
|
for (let i = t.length - 1; i >= 0; i--)
|
|
2683
2683
|
e.push(g.OP_HASH160), e.push(t[i]), e.push(g.OP_EQUALVERIFY);
|
|
2684
|
-
return e.push(this.publicKey), e.push(g.OP_CHECKSIG),
|
|
2684
|
+
return e.push(this.publicKey), e.push(g.OP_CHECKSIG), k(e);
|
|
2685
2685
|
}
|
|
2686
2686
|
/**
|
|
2687
2687
|
* Generate a P2WSH address from a witness script.
|
|
@@ -2822,7 +2822,7 @@ class dr extends $ {
|
|
|
2822
2822
|
g.OP_1,
|
|
2823
2823
|
g.OP_ENDIF
|
|
2824
2824
|
);
|
|
2825
|
-
const l = h.flat(), d =
|
|
2825
|
+
const l = h.flat(), d = k(l);
|
|
2826
2826
|
if (!F(d))
|
|
2827
2827
|
throw new Error("Failed to decompile script??");
|
|
2828
2828
|
return d;
|
|
@@ -2865,7 +2865,7 @@ class At {
|
|
|
2865
2865
|
r,
|
|
2866
2866
|
g.OP_NUMEQUAL
|
|
2867
2867
|
// Use NUMEQUALVERIFY to ensure the correct number of signatures
|
|
2868
|
-
].flat(), h =
|
|
2868
|
+
].flat(), h = k(u);
|
|
2869
2869
|
if (!F(h))
|
|
2870
2870
|
throw new Error("Failed to decompile script.");
|
|
2871
2871
|
return h;
|
|
@@ -2975,7 +2975,7 @@ class et {
|
|
|
2975
2975
|
t.priorityFee,
|
|
2976
2976
|
t.calldata,
|
|
2977
2977
|
t.features
|
|
2978
|
-
), s =
|
|
2978
|
+
), s = k([
|
|
2979
2979
|
O(t.deployerPubKey),
|
|
2980
2980
|
g.OP_CHECKSIG
|
|
2981
2981
|
]), o = [
|
|
@@ -3002,7 +3002,7 @@ class et {
|
|
|
3002
3002
|
t.priorityFee,
|
|
3003
3003
|
t.calldata,
|
|
3004
3004
|
t.features
|
|
3005
|
-
), o =
|
|
3005
|
+
), o = k([
|
|
3006
3006
|
O(t.deployerPubKey),
|
|
3007
3007
|
g.OP_CHECKSIG
|
|
3008
3008
|
]), c = [
|
|
@@ -3065,7 +3065,7 @@ function Ne(n) {
|
|
|
3065
3065
|
}
|
|
3066
3066
|
class fr {
|
|
3067
3067
|
sha256(t) {
|
|
3068
|
-
return
|
|
3068
|
+
return ke(a.from(t));
|
|
3069
3069
|
}
|
|
3070
3070
|
/**
|
|
3071
3071
|
* Attempts to sign a message using OP_WALLET if available in browser environment.
|
|
@@ -3324,7 +3324,7 @@ class J {
|
|
|
3324
3324
|
);
|
|
3325
3325
|
} else
|
|
3326
3326
|
this._mldsaKeypair = P.QuantumBIP32Factory.fromBase58(c), this._chainCode = a.from(this._mldsaKeypair.chainCode), this._securityLevel = this._mldsaKeypair.securityLevel;
|
|
3327
|
-
this._bufferPubKey = this._keypair.publicKey, this._address = new
|
|
3327
|
+
this._bufferPubKey = this._keypair.publicKey, this._address = new L(this._mldsaKeypair.publicKey, this._keypair.publicKey), this._p2tr = this._address.p2tr(this.network), this._p2wpkh = this._address.p2wpkh(this.network), this._legacy = this._address.p2pkh(this.network), this._segwitLegacy = this._address.p2shp2wpkh(this.network), this._p2wda = this._address.p2wda(this.network), this._tweakedKey = this._address.tweakedPublicKeyToBuffer();
|
|
3328
3328
|
}
|
|
3329
3329
|
/**
|
|
3330
3330
|
* Get the address for the wallet
|
|
@@ -3893,9 +3893,9 @@ function yr() {
|
|
|
3893
3893
|
signerMap: /* @__PURE__ */ new Map()
|
|
3894
3894
|
};
|
|
3895
3895
|
}
|
|
3896
|
-
var y = /* @__PURE__ */ ((n) => (n[n.GENERIC = 0] = "GENERIC", n[n.FUNDING = 1] = "FUNDING", n[n.DEPLOYMENT = 2] = "DEPLOYMENT", n[n.INTERACTION = 3] = "INTERACTION", n[n.MULTI_SIG = 4] = "MULTI_SIG", n[n.CUSTOM_CODE = 5] = "CUSTOM_CODE", n[n.CANCEL = 6] = "CANCEL", n[n.CONSOLIDATED_SETUP = 7] = "CONSOLIDATED_SETUP", n[n.CONSOLIDATED_REVEAL = 8] = "CONSOLIDATED_REVEAL", n))(y || {}),
|
|
3896
|
+
var y = /* @__PURE__ */ ((n) => (n[n.GENERIC = 0] = "GENERIC", n[n.FUNDING = 1] = "FUNDING", n[n.DEPLOYMENT = 2] = "DEPLOYMENT", n[n.INTERACTION = 3] = "INTERACTION", n[n.MULTI_SIG = 4] = "MULTI_SIG", n[n.CUSTOM_CODE = 5] = "CUSTOM_CODE", n[n.CANCEL = 6] = "CANCEL", n[n.CONSOLIDATED_SETUP = 7] = "CONSOLIDATED_SETUP", n[n.CONSOLIDATED_REVEAL = 8] = "CONSOLIDATED_REVEAL", n))(y || {}), Lt = /* @__PURE__ */ ((n) => (n[n.Roswell = 0] = "Roswell", n[n.Rachel = 1] = "Rachel", n[n.Kecksburg = 2] = "Kecksburg", n[n.Phoenix = 3] = "Phoenix", n[n.Aurora = 4] = "Aurora", n[n.Rendlesham = 5] = "Rendlesham", n[n.Lazar = 6] = "Lazar", n[n.ShagHarbor = 7] = "ShagHarbor", n[n.Exeter = 8] = "Exeter", n[n.Stephenville = 9] = "Stephenville", n[n.Valensole = 10] = "Valensole", n[n.Socorro = 11] = "Socorro", n[n.Pascagoula = 12] = "Pascagoula", n[n.Tehran = 13] = "Tehran", n[n.Westall = 14] = "Westall", n[n.Hopkinsville = 15] = "Hopkinsville", n[n.Belgium = 16] = "Belgium", n[n.Breeze = 17] = "Breeze", n[n.Flatwoods = 18] = "Flatwoods", n[n.Maury = 20] = "Maury", n[n.Varginha = 21] = "Varginha", n[n.Trindade = 22] = "Trindade", n[n.Levelland = 23] = "Levelland", n[n.Wanaque = 24] = "Wanaque", n[n.Coyame = 25] = "Coyame", n[n.Delphos = 26] = "Delphos", n))(Lt || {});
|
|
3897
3897
|
const qe = {
|
|
3898
|
-
CONSENSUS:
|
|
3898
|
+
CONSENSUS: Lt.Roswell,
|
|
3899
3899
|
CONSENSUS_NAME: "Roswell",
|
|
3900
3900
|
// The block height at which this consensus was enabled.
|
|
3901
3901
|
ENABLED_AT_BLOCK: 0n
|
|
@@ -3912,8 +3912,8 @@ const qe = {
|
|
|
3912
3912
|
// Equivalent to 56500 satoshis, calculated from UNWRAP_CONSOLIDATION_PREPAID_FEES.
|
|
3913
3913
|
//UNWRAP_CONSOLIDATION_PREPAID_FEES_SAT: 56500n,
|
|
3914
3914
|
}, $e = {
|
|
3915
|
-
[
|
|
3916
|
-
}, Qt =
|
|
3915
|
+
[Lt.Roswell]: qe
|
|
3916
|
+
}, Qt = Lt.Roswell, mr = $e[Qt];
|
|
3917
3917
|
function le(n) {
|
|
3918
3918
|
return n && !!(n.tapInternalKey || n.tapMerkleRoot || n.tapLeafScript && n.tapLeafScript.length || n.tapBip32Derivation && n.tapBip32Derivation.length || n.witnessUtxo && Ue(n.witnessUtxo.script));
|
|
3919
3919
|
}
|
|
@@ -3930,14 +3930,14 @@ function fe(n, t) {
|
|
|
3930
3930
|
return Di(n, t) !== -1;
|
|
3931
3931
|
}
|
|
3932
3932
|
var Xe = /* @__PURE__ */ ((n) => (n[n.REPLACE_BY_FEE = 4294967293] = "REPLACE_BY_FEE", n[n.FINAL = 4294967295] = "FINAL", n))(Xe || {}), Ye = /* @__PURE__ */ ((n) => (n[n.BLOCKS = 0] = "BLOCKS", n[n.TIMESTAMPS = 1] = "TIMESTAMPS", n))(Ye || {});
|
|
3933
|
-
class
|
|
3933
|
+
class kt extends Ke {
|
|
3934
3934
|
constructor(t) {
|
|
3935
3935
|
super(), this.logColor = "#00ffe1", this.finalized = !1, this.signed = !1, this.scriptData = null, this.tapData = null, this.inputs = [], this.sequence = 4294967293, this.tapLeafScript = null, this.isBrowser = !1, this.csvInputIndices = /* @__PURE__ */ new Set(), this.anchorInputIndices = /* @__PURE__ */ new Set(), this.regenerated = !1, this.ignoreSignatureErrors = !1, this.noSignatures = !1, this.txVersion = 2, this._mldsaSigner = null, this._hashedPublicKey = null, this.addressRotationEnabled = !1, this.signerMap = /* @__PURE__ */ new Map(), this.inputSignerMap = /* @__PURE__ */ new Map(), this.tweakedSignerCache = /* @__PURE__ */ new Map(), this.customFinalizerP2SH = (e, i, r, s, o, c) => {
|
|
3936
3936
|
const u = this.inputs[e];
|
|
3937
3937
|
if (o && i.partialSig && u && u.redeemScript) {
|
|
3938
3938
|
const h = i.partialSig.map((d) => d.signature) || [];
|
|
3939
3939
|
return {
|
|
3940
|
-
finalScriptSig:
|
|
3940
|
+
finalScriptSig: k([...h, u.redeemScript]),
|
|
3941
3941
|
finalScriptWitness: void 0
|
|
3942
3942
|
};
|
|
3943
3943
|
}
|
|
@@ -4326,13 +4326,13 @@ class Lt extends Ke {
|
|
|
4326
4326
|
}).output;
|
|
4327
4327
|
}
|
|
4328
4328
|
generateP2SHRedeemScriptLegacy(t) {
|
|
4329
|
-
const e = ft(this.signer.publicKey), i =
|
|
4329
|
+
const e = ft(this.signer.publicKey), i = k([
|
|
4330
4330
|
g.OP_DUP,
|
|
4331
4331
|
g.OP_HASH160,
|
|
4332
4332
|
e,
|
|
4333
4333
|
g.OP_EQUALVERIFY,
|
|
4334
4334
|
g.OP_CHECKSIG
|
|
4335
|
-
]), r = ft(i), s =
|
|
4335
|
+
]), r = ft(i), s = k([
|
|
4336
4336
|
g.OP_HASH160,
|
|
4337
4337
|
r,
|
|
4338
4338
|
g.OP_EQUAL
|
|
@@ -4419,7 +4419,7 @@ class Lt extends Ke {
|
|
|
4419
4419
|
t.nonWitnessUtxo && (s.nonWitnessUtxo = I.isBuffer(t.nonWitnessUtxo) ? t.nonWitnessUtxo : I.from(t.nonWitnessUtxo, "hex")), Pe(u) ? delete s.nonWitnessUtxo : Ee(u) ? (delete s.nonWitnessUtxo, this.processP2WSHInput(t, s, e)) : delete s.witnessUtxo;
|
|
4420
4420
|
} else if (Ue(r)) {
|
|
4421
4421
|
if (this.sighashTypes) {
|
|
4422
|
-
const o =
|
|
4422
|
+
const o = kt.calculateSignHash(this.sighashTypes);
|
|
4423
4423
|
o && (s.sighashType = o);
|
|
4424
4424
|
}
|
|
4425
4425
|
this.addressRotationEnabled ? s.tapInternalKey = this.internalPubKeyToXOnlyForInput(e) : (this.tweakSigner(), s.tapInternalKey = this.internalPubKeyToXOnly());
|
|
@@ -4506,7 +4506,7 @@ class Lt extends Ke {
|
|
|
4506
4506
|
if (t[e] === g.OP_CHECKSEQUENCEVERIFY && e > 0) {
|
|
4507
4507
|
const i = t[e - 1];
|
|
4508
4508
|
if (I.isBuffer(i))
|
|
4509
|
-
return
|
|
4509
|
+
return Le.decode(i);
|
|
4510
4510
|
if (typeof i == "number") {
|
|
4511
4511
|
if (i === g.OP_0 || i === g.OP_FALSE)
|
|
4512
4512
|
return 0;
|
|
@@ -4582,7 +4582,7 @@ const xe = Uint8Array.from(
|
|
|
4582
4582
|
);
|
|
4583
4583
|
at(Q);
|
|
4584
4584
|
const z = 330n, wt = 297n, ne = a.from("51024e73", "hex");
|
|
4585
|
-
class m extends
|
|
4585
|
+
class m extends kt {
|
|
4586
4586
|
constructor(t) {
|
|
4587
4587
|
if (super(t), this.logColor = "#785def", this.debugFees = !1, this.overflowFees = 0n, this.transactionFee = 0n, this.estimatedFees = 0n, this.updateInputs = [], this.outputs = [], this.feeOutput = null, this._maximumFeeRate = 1e8, this.optionalOutputsAdded = !1, t.estimatedFees && (this.estimatedFees = t.estimatedFees), this.signer = t.signer, this.network = t.network, this.feeRate = t.feeRate, this.priorityFee = t.priorityFee ?? 0n, this.gasSatFee = t.gasSatFee ?? 0n, this.utxos = t.utxos, this.optionalInputs = t.optionalInputs || [], this.to = t.to || void 0, this.debugFees = t.debugFees || !1, this.LOCK_LEAF_SCRIPT = this.defineLockScript(), t.note && (typeof t.note == "string" ? this.note = a.from(t.note, "utf8") : this.note = t.note), this.anchor = t.anchor ?? !1, this.isPubKeyDestination = this.to ? H.isValidPublicKey(this.to, this.network) : !1, this.optionalOutputs = t.optionalOutputs, this.from = m.getFrom(t.from, this.signer, this.network), this.totalInputAmount = this.calculateTotalUTXOAmount(), this.calculateTotalVOutAmount() < this.totalInputAmount)
|
|
4588
4588
|
throw new Error("Vout value is less than the value to send");
|
|
@@ -4621,7 +4621,7 @@ class m extends Lt {
|
|
|
4621
4621
|
return o(t), e;
|
|
4622
4622
|
}
|
|
4623
4623
|
addOPReturn(t) {
|
|
4624
|
-
const e =
|
|
4624
|
+
const e = k([g.OP_RETURN, t]);
|
|
4625
4625
|
this.addOutput({
|
|
4626
4626
|
value: 0,
|
|
4627
4627
|
script: e
|
|
@@ -4964,7 +4964,7 @@ class m extends Lt {
|
|
|
4964
4964
|
tapInternalKey: this.internalPubKeyToXOnly()
|
|
4965
4965
|
};
|
|
4966
4966
|
else if (H.isValidPublicKey(this.from, this.network)) {
|
|
4967
|
-
const h =
|
|
4967
|
+
const h = k([
|
|
4968
4968
|
a.from(this.from.replace("0x", ""), "hex"),
|
|
4969
4969
|
g.OP_CHECKSIG
|
|
4970
4970
|
]);
|
|
@@ -4998,7 +4998,7 @@ class m extends Lt {
|
|
|
4998
4998
|
);
|
|
4999
4999
|
}
|
|
5000
5000
|
defineLockScript() {
|
|
5001
|
-
return
|
|
5001
|
+
return k([O(a.from(this.signer.publicKey)), g.OP_CHECKSIG]);
|
|
5002
5002
|
}
|
|
5003
5003
|
/**
|
|
5004
5004
|
* @description Adds the value to the output
|
|
@@ -5780,7 +5780,7 @@ class pt extends m {
|
|
|
5780
5780
|
this.calldata,
|
|
5781
5781
|
this.generateFeatures(t)
|
|
5782
5782
|
);
|
|
5783
|
-
this.scriptTree = this.getScriptTree(), this.internalInit(), this._contractPubKey = "0x" + this.contractSeed.toString("hex"), this._contractAddress = new
|
|
5783
|
+
this.scriptTree = this.getScriptTree(), this.internalInit(), this._contractPubKey = "0x" + this.contractSeed.toString("hex"), this._contractAddress = new L(this.contractSeed);
|
|
5784
5784
|
}
|
|
5785
5785
|
static {
|
|
5786
5786
|
this.MAXIMUM_CONTRACT_SIZE = 128 * 1024;
|
|
@@ -6016,7 +6016,7 @@ class zt extends m {
|
|
|
6016
6016
|
if (this.addInputsFromUTXO(), this.splitInputsInto > 1)
|
|
6017
6017
|
this.splitInputs(this.amount);
|
|
6018
6018
|
else if (this.isPubKeyDestination) {
|
|
6019
|
-
const e =
|
|
6019
|
+
const e = k([
|
|
6020
6020
|
a.from(this.to.replace("0x", ""), "hex"),
|
|
6021
6021
|
g.OP_CHECKSIG
|
|
6022
6022
|
]);
|
|
@@ -7221,7 +7221,7 @@ class Qe {
|
|
|
7221
7221
|
* @returns {Promise<{finalTransaction: T, estimatedAmount: bigint, challenge: ChallengeSolution | null}>} - The final transaction and estimated amount
|
|
7222
7222
|
*/
|
|
7223
7223
|
async iterateFundingAmount(t, e, i, r) {
|
|
7224
|
-
const s = "randomBytes" in t ? t.randomBytes ?? K.rndBytes() : K.rndBytes(), o =
|
|
7224
|
+
const s = "randomBytes" in t ? t.randomBytes ?? K.rndBytes() : K.rndBytes(), o = L.dead().p2tr(t.network);
|
|
7225
7225
|
let c = this.INITIAL_FUNDING_ESTIMATE, u = 0n, h = 0, l = null, d = null;
|
|
7226
7226
|
for (; h < this.MAX_ITERATIONS && c !== u; ) {
|
|
7227
7227
|
u = c;
|
|
@@ -7307,7 +7307,7 @@ class x extends m {
|
|
|
7307
7307
|
if (super({
|
|
7308
7308
|
...t,
|
|
7309
7309
|
signer: A.fromPrivateKey(
|
|
7310
|
-
|
|
7310
|
+
ke(a.from("aaaaaaaa", "utf-8"))
|
|
7311
7311
|
),
|
|
7312
7312
|
priorityFee: 0n,
|
|
7313
7313
|
gasSatFee: 0n
|
|
@@ -7326,7 +7326,7 @@ class x extends m {
|
|
|
7326
7326
|
), this.scriptTree = this.getScriptTree(), this.internalInit();
|
|
7327
7327
|
}
|
|
7328
7328
|
static {
|
|
7329
|
-
this.LOCK_LEAF_SCRIPT =
|
|
7329
|
+
this.LOCK_LEAF_SCRIPT = k([
|
|
7330
7330
|
g.OP_XOR,
|
|
7331
7331
|
g.OP_NOP,
|
|
7332
7332
|
g.OP_CODESEPARATOR
|
|
@@ -8554,7 +8554,7 @@ class ii {
|
|
|
8554
8554
|
}
|
|
8555
8555
|
class ri {
|
|
8556
8556
|
constructor(t, e) {
|
|
8557
|
-
this.epochNumber = e, this.publicKey =
|
|
8557
|
+
this.epochNumber = e, this.publicKey = L.fromString(t.mldsaPublicKey, t.legacyPublicKey), this.solution = V(t.solution), this.graffiti = t.graffiti ? V(t.graffiti) : void 0, this.signature = V(t.signature);
|
|
8558
8558
|
}
|
|
8559
8559
|
verifySignature() {
|
|
8560
8560
|
const t = new C();
|
|
@@ -8569,7 +8569,7 @@ class ri {
|
|
|
8569
8569
|
}
|
|
8570
8570
|
class $t {
|
|
8571
8571
|
constructor(t) {
|
|
8572
|
-
this.epochNumber = BigInt(t.epochNumber), this.publicKey =
|
|
8572
|
+
this.epochNumber = BigInt(t.epochNumber), this.publicKey = L.fromString(t.mldsaPublicKey, t.legacyPublicKey), this.solution = V(t.solution), this.salt = V(t.salt), this.graffiti = V(t.graffiti), this.difficulty = t.difficulty, this.verification = new ii(t.verification), this.submission = t.submission ? new ri(t.submission, this.epochNumber + 2n) : t.submission;
|
|
8573
8573
|
}
|
|
8574
8574
|
/**
|
|
8575
8575
|
* Static method to validate from raw data directly
|
|
@@ -9487,7 +9487,7 @@ class Pr {
|
|
|
9487
9487
|
return new UnwrapGeneration(result as UnwrappedGenerationParameters);
|
|
9488
9488
|
}*/
|
|
9489
9489
|
}
|
|
9490
|
-
class Tt extends
|
|
9490
|
+
class Tt extends kt {
|
|
9491
9491
|
constructor(t) {
|
|
9492
9492
|
super(t), this.logColor = "#00ffe1", this.feesAddition = 10000n, this.sighashTypes = [], this.signer = t.signer, this.network = t.network, this.transaction = t.psbt, this.ignoreSignatureError(), this.tweakSigner(), this.internalInit();
|
|
9493
9493
|
}
|
|
@@ -10056,7 +10056,7 @@ function vr(n, t) {
|
|
|
10056
10056
|
if (r === null) throw new Error("Unknown script error");
|
|
10057
10057
|
return r.findIndex((s) => typeof s == "number" ? !1 : a.isBuffer(s) && (s.equals(n) || s.equals(e) || s.equals(i)));
|
|
10058
10058
|
}
|
|
10059
|
-
class
|
|
10059
|
+
class Lr extends be {
|
|
10060
10060
|
constructor() {
|
|
10061
10061
|
if (super(), this.isInitialized = !1, !window)
|
|
10062
10062
|
throw new Error("XverseSigner can only be used in a browser environment");
|
|
@@ -10246,7 +10246,7 @@ class kr extends be {
|
|
|
10246
10246
|
}
|
|
10247
10247
|
var ui = /* @__PURE__ */ ((n) => (n.mainnet = "mainnet", n.testnet = "testnet", n.signet = "Signet", n))(ui || {}), hi = /* @__PURE__ */ ((n) => (n.ECDSA = "ECDSA", n.BIP322 = "BIP322", n))(hi || {});
|
|
10248
10248
|
function R() {
|
|
10249
|
-
return
|
|
10249
|
+
return L.dead();
|
|
10250
10250
|
}
|
|
10251
10251
|
const li = R(), di = R(), fi = R(), pi = R(), gi = R(), Si = R(), wi = R(), yi = R(), mi = R(), bi = R(), Ti = R(), Ii = R(), Pi = R(), Ei = R(), Ai = R();
|
|
10252
10252
|
var Oi = /* @__PURE__ */ ((n) => (n.Mainnet = "mainnet", n.Testnet = "testnet", n.Regtest = "regtest", n))(Oi || {});
|
|
@@ -10321,7 +10321,7 @@ class Bi {
|
|
|
10321
10321
|
return i;
|
|
10322
10322
|
}
|
|
10323
10323
|
}
|
|
10324
|
-
const
|
|
10324
|
+
const kr = new Bi();
|
|
10325
10325
|
class Xt {
|
|
10326
10326
|
constructor() {
|
|
10327
10327
|
this._size = 0, this.capacity = Xt.INITIAL_CAPACITY, this.#t = new Array(this.capacity), this.#e = new Array(this.capacity), this.deleted = new Array(this.capacity).fill(!1);
|
|
@@ -10488,7 +10488,7 @@ const Nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
10488
10488
|
ABIDataTypes: ni,
|
|
10489
10489
|
ADDRESS_BYTE_LENGTH: D,
|
|
10490
10490
|
ANCHOR_SCRIPT: ne,
|
|
10491
|
-
Address:
|
|
10491
|
+
Address: L,
|
|
10492
10492
|
AddressGenerator: ce,
|
|
10493
10493
|
AddressMap: Re,
|
|
10494
10494
|
AddressSet: we,
|
|
@@ -10508,7 +10508,7 @@ const Nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
10508
10508
|
ChallengeSubmission: ri,
|
|
10509
10509
|
ChallengeVerification: ii,
|
|
10510
10510
|
Compressor: N,
|
|
10511
|
-
Consensus:
|
|
10511
|
+
Consensus: Lt,
|
|
10512
10512
|
ConsolidatedInteractionTransaction: Ge,
|
|
10513
10513
|
ContractAddress: re,
|
|
10514
10514
|
ContractBaseMetadata: Sr,
|
|
@@ -10557,7 +10557,7 @@ const Nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
10557
10557
|
OPNET_DEPLOYMENT_VERSION: We,
|
|
10558
10558
|
OPNetConsensusConfig: $e,
|
|
10559
10559
|
OPNetLimitedProvider: Pr,
|
|
10560
|
-
OPNetMetadata:
|
|
10560
|
+
OPNetMetadata: kr,
|
|
10561
10561
|
OPNetNetwork: Oi,
|
|
10562
10562
|
OPNetTokenAddressManager: Bi,
|
|
10563
10563
|
OfflineTransactionManager: Ir,
|
|
@@ -10595,7 +10595,7 @@ const Nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
10595
10595
|
TransactionStateCapture: X,
|
|
10596
10596
|
TransactionType: y,
|
|
10597
10597
|
TweakedSigner: ue,
|
|
10598
|
-
TweakedTransaction:
|
|
10598
|
+
TweakedTransaction: kt,
|
|
10599
10599
|
U128_BYTE_LENGTH: yt,
|
|
10600
10600
|
U16_BYTE_LENGTH: Et,
|
|
10601
10601
|
U256_BYTE_LENGTH: Pt,
|
|
@@ -10610,7 +10610,7 @@ const Nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
10610
10610
|
WBTC_ADDRESS_TESTNET: yi,
|
|
10611
10611
|
Wallet: J,
|
|
10612
10612
|
XverseNetwork: ui,
|
|
10613
|
-
XverseSigner:
|
|
10613
|
+
XverseSigner: Lr,
|
|
10614
10614
|
buildBIPPath: He,
|
|
10615
10615
|
createAddressRotation: wr,
|
|
10616
10616
|
createSignerMap: ze,
|
|
@@ -10635,7 +10635,7 @@ export {
|
|
|
10635
10635
|
ni as ABIDataTypes,
|
|
10636
10636
|
D as ADDRESS_BYTE_LENGTH,
|
|
10637
10637
|
ne as ANCHOR_SCRIPT,
|
|
10638
|
-
|
|
10638
|
+
L as Address,
|
|
10639
10639
|
ce as AddressGenerator,
|
|
10640
10640
|
Re as AddressMap,
|
|
10641
10641
|
we as AddressSet,
|
|
@@ -10655,7 +10655,7 @@ export {
|
|
|
10655
10655
|
ri as ChallengeSubmission,
|
|
10656
10656
|
ii as ChallengeVerification,
|
|
10657
10657
|
N as Compressor,
|
|
10658
|
-
|
|
10658
|
+
Lt as Consensus,
|
|
10659
10659
|
Ge as ConsolidatedInteractionTransaction,
|
|
10660
10660
|
re as ContractAddress,
|
|
10661
10661
|
Sr as ContractBaseMetadata,
|
|
@@ -10704,7 +10704,7 @@ export {
|
|
|
10704
10704
|
We as OPNET_DEPLOYMENT_VERSION,
|
|
10705
10705
|
$e as OPNetConsensusConfig,
|
|
10706
10706
|
Pr as OPNetLimitedProvider,
|
|
10707
|
-
|
|
10707
|
+
kr as OPNetMetadata,
|
|
10708
10708
|
Oi as OPNetNetwork,
|
|
10709
10709
|
Bi as OPNetTokenAddressManager,
|
|
10710
10710
|
Ir as OfflineTransactionManager,
|
|
@@ -10742,7 +10742,7 @@ export {
|
|
|
10742
10742
|
X as TransactionStateCapture,
|
|
10743
10743
|
y as TransactionType,
|
|
10744
10744
|
ue as TweakedSigner,
|
|
10745
|
-
|
|
10745
|
+
kt as TweakedTransaction,
|
|
10746
10746
|
yt as U128_BYTE_LENGTH,
|
|
10747
10747
|
Et as U16_BYTE_LENGTH,
|
|
10748
10748
|
Pt as U256_BYTE_LENGTH,
|
|
@@ -10757,7 +10757,7 @@ export {
|
|
|
10757
10757
|
yi as WBTC_ADDRESS_TESTNET,
|
|
10758
10758
|
J as Wallet,
|
|
10759
10759
|
ui as XverseNetwork,
|
|
10760
|
-
|
|
10760
|
+
Lr as XverseSigner,
|
|
10761
10761
|
He as buildBIPPath,
|
|
10762
10762
|
wr as createAddressRotation,
|
|
10763
10763
|
ze as createSignerMap,
|