@omnity/ree-client-ts-sdk 0.2.6 → 0.2.7
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/index.d.ts +1 -1
- package/dist/ree-sdk.cjs.js +5 -5
- package/dist/ree-sdk.es.js +274 -274
- package/package.json +3 -3
package/dist/ree-sdk.es.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as Ze from "bitcoinjs-lib";
|
|
2
2
|
import "@dfinity/candid";
|
|
3
|
-
import
|
|
3
|
+
import Dn from "axios";
|
|
4
4
|
import { Actor as Dt, HttpAgent as en } from "@dfinity/agent";
|
|
5
|
-
import { RuneId as
|
|
6
|
-
import { Kind as
|
|
7
|
-
import { jsx as
|
|
8
|
-
import { createContext as
|
|
9
|
-
function
|
|
5
|
+
import { RuneId as er, Edict as tn, Runestone as tr, none as St } from "runelib";
|
|
6
|
+
import { Kind as nr, print as rr, parse as ir } from "graphql";
|
|
7
|
+
import { jsx as or } from "react/jsx-runtime";
|
|
8
|
+
import { createContext as sr, useState as Se, useCallback as We, useMemo as nn, useContext as cr, useEffect as Ge } from "react";
|
|
9
|
+
function ar(e, t) {
|
|
10
10
|
for (var r = 0; r < t.length; r++) {
|
|
11
11
|
const i = t[r];
|
|
12
12
|
if (typeof i != "string" && !Array.isArray(i)) {
|
|
@@ -26,7 +26,7 @@ function Cn(e) {
|
|
|
26
26
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
27
27
|
}
|
|
28
28
|
var Nt = {}, ct = {}, rn;
|
|
29
|
-
function
|
|
29
|
+
function ur() {
|
|
30
30
|
if (rn) return ct;
|
|
31
31
|
rn = 1, ct.byteLength = a, ct.toByteArray = d, ct.fromByteArray = B;
|
|
32
32
|
for (var e = [], t = [], r = typeof Uint8Array < "u" ? Uint8Array : Array, i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", c = 0, s = i.length; c < s; ++c)
|
|
@@ -76,7 +76,7 @@ function ar() {
|
|
|
76
76
|
var pt = {};
|
|
77
77
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
78
78
|
var on;
|
|
79
|
-
function
|
|
79
|
+
function fr() {
|
|
80
80
|
return on || (on = 1, pt.read = function(e, t, r, i, c) {
|
|
81
81
|
var s, u, a = c * 8 - i - 1, h = (1 << a) - 1, d = h >> 1, w = -7, y = r ? c - 1 : 0, B = r ? -1 : 1, _ = e[t + y];
|
|
82
82
|
for (y += B, s = _ & (1 << -w) - 1, _ >>= -w, w += a; w > 0; s = s * 256 + e[t + y], y += B, w -= 8)
|
|
@@ -107,9 +107,9 @@ function ur() {
|
|
|
107
107
|
* @license MIT
|
|
108
108
|
*/
|
|
109
109
|
var sn;
|
|
110
|
-
function
|
|
110
|
+
function lr() {
|
|
111
111
|
return sn || (sn = 1, (function(e) {
|
|
112
|
-
const t =
|
|
112
|
+
const t = ur(), r = fr(), i = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
|
|
113
113
|
e.Buffer = a, e.SlowBuffer = D, e.INSPECT_MAX_BYTES = 50;
|
|
114
114
|
const c = 2147483647;
|
|
115
115
|
e.kMaxLength = c, a.TYPED_ARRAY_SUPPORT = s(), !a.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
|
|
@@ -357,7 +357,7 @@ function fr() {
|
|
|
357
357
|
return E(this, n, o);
|
|
358
358
|
case "utf8":
|
|
359
359
|
case "utf-8":
|
|
360
|
-
return
|
|
360
|
+
return I(this, n, o);
|
|
361
361
|
case "ascii":
|
|
362
362
|
return x(this, n, o);
|
|
363
363
|
case "latin1":
|
|
@@ -403,7 +403,7 @@ function fr() {
|
|
|
403
403
|
return this;
|
|
404
404
|
}, a.prototype.toString = function() {
|
|
405
405
|
const n = this.length;
|
|
406
|
-
return n === 0 ? "" : arguments.length === 0 ?
|
|
406
|
+
return n === 0 ? "" : arguments.length === 0 ? I(this, 0, n) : te.apply(this, arguments);
|
|
407
407
|
}, a.prototype.toLocaleString = a.prototype.toString, a.prototype.equals = function(n) {
|
|
408
408
|
if (!a.isBuffer(n)) throw new TypeError("Argument must be a Buffer");
|
|
409
409
|
return this === n ? !0 : a.compare(this, n) === 0;
|
|
@@ -434,7 +434,7 @@ function fr() {
|
|
|
434
434
|
}
|
|
435
435
|
return O < ae ? -1 : ae < O ? 1 : 0;
|
|
436
436
|
};
|
|
437
|
-
function
|
|
437
|
+
function F(f, n, o, l, b) {
|
|
438
438
|
if (f.length === 0) return -1;
|
|
439
439
|
if (typeof o == "string" ? (l = o, o = 0) : o > 2147483647 ? o = 2147483647 : o < -2147483648 && (o = -2147483648), o = +o, Ee(o) && (o = b ? 0 : f.length - 1), o < 0 && (o = f.length + o), o >= f.length) {
|
|
440
440
|
if (b) return -1;
|
|
@@ -481,9 +481,9 @@ function fr() {
|
|
|
481
481
|
a.prototype.includes = function(n, o, l) {
|
|
482
482
|
return this.indexOf(n, o, l) !== -1;
|
|
483
483
|
}, a.prototype.indexOf = function(n, o, l) {
|
|
484
|
-
return
|
|
484
|
+
return F(this, n, o, l, !0);
|
|
485
485
|
}, a.prototype.lastIndexOf = function(n, o, l) {
|
|
486
|
-
return
|
|
486
|
+
return F(this, n, o, l, !1);
|
|
487
487
|
};
|
|
488
488
|
function Z(f, n, o, l) {
|
|
489
489
|
o = Number(o) || 0;
|
|
@@ -558,7 +558,7 @@ function fr() {
|
|
|
558
558
|
function C(f, n, o) {
|
|
559
559
|
return n === 0 && o === f.length ? t.fromByteArray(f) : t.fromByteArray(f.slice(n, o));
|
|
560
560
|
}
|
|
561
|
-
function
|
|
561
|
+
function I(f, n, o) {
|
|
562
562
|
o = Math.min(f.length, o);
|
|
563
563
|
const l = [];
|
|
564
564
|
let b = n;
|
|
@@ -1047,8 +1047,8 @@ function fr() {
|
|
|
1047
1047
|
}
|
|
1048
1048
|
})(Nt)), Nt;
|
|
1049
1049
|
}
|
|
1050
|
-
var
|
|
1051
|
-
function
|
|
1050
|
+
var dr = lr(), Rt = { exports: {} }, cn;
|
|
1051
|
+
function hr() {
|
|
1052
1052
|
if (cn) return Rt.exports;
|
|
1053
1053
|
cn = 1;
|
|
1054
1054
|
var e = Rt.exports = {}, t, r;
|
|
@@ -1143,13 +1143,13 @@ function dr() {
|
|
|
1143
1143
|
return 0;
|
|
1144
1144
|
}, Rt.exports;
|
|
1145
1145
|
}
|
|
1146
|
-
var
|
|
1147
|
-
const
|
|
1146
|
+
var pr = hr();
|
|
1147
|
+
const gr = /* @__PURE__ */ Cn(pr);
|
|
1148
1148
|
typeof globalThis > "u" && (globalThis.global = globalThis);
|
|
1149
|
-
typeof globalThis.Buffer > "u" && (globalThis.Buffer =
|
|
1150
|
-
typeof globalThis.process > "u" && (globalThis.process =
|
|
1149
|
+
typeof globalThis.Buffer > "u" && (globalThis.Buffer = dr.Buffer);
|
|
1150
|
+
typeof globalThis.process > "u" && (globalThis.process = gr);
|
|
1151
1151
|
var Ae = {}, Ht = {}, Be = {}, Pe = {}, Ut = {}, at = {}, an;
|
|
1152
|
-
function
|
|
1152
|
+
function wr() {
|
|
1153
1153
|
return an || (an = 1, Object.defineProperty(at, "__esModule", { value: !0 }), at.crypto = void 0, at.crypto = typeof globalThis == "object" && "crypto" in globalThis ? globalThis.crypto : void 0), at;
|
|
1154
1154
|
}
|
|
1155
1155
|
var un;
|
|
@@ -1157,7 +1157,7 @@ function tt() {
|
|
|
1157
1157
|
return un || (un = 1, (function(e) {
|
|
1158
1158
|
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
1159
1159
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.wrapXOFConstructorWithOpts = e.wrapConstructorWithOpts = e.wrapConstructor = e.Hash = e.nextTick = e.swap32IfBE = e.byteSwapIfBE = e.swap8IfBE = e.isLE = void 0, e.isBytes = r, e.anumber = i, e.abytes = c, e.ahash = s, e.aexists = u, e.aoutput = a, e.u8 = h, e.u32 = d, e.clean = w, e.createView = y, e.rotr = B, e.rotl = _, e.byteSwap = T, e.byteSwap32 = S, e.bytesToHex = D, e.hexToBytes = J, e.asyncLoop = P, e.utf8ToBytes = Z, e.bytesToUtf8 = H, e.toBytes = q, e.kdfInputToBytes = k, e.concatBytes = ee, e.checkOpts = C, e.createHasher = m, e.createOptHasher = N, e.createXOFer = x, e.randomBytes = p;
|
|
1160
|
-
const t = /* @__PURE__ */
|
|
1160
|
+
const t = /* @__PURE__ */ wr();
|
|
1161
1161
|
function r(E) {
|
|
1162
1162
|
return E instanceof Uint8Array || ArrayBuffer.isView(E) && E.constructor.name === "Uint8Array";
|
|
1163
1163
|
}
|
|
@@ -1255,9 +1255,9 @@ function tt() {
|
|
|
1255
1255
|
}
|
|
1256
1256
|
return v;
|
|
1257
1257
|
}
|
|
1258
|
-
const
|
|
1258
|
+
const F = async () => {
|
|
1259
1259
|
};
|
|
1260
|
-
e.nextTick =
|
|
1260
|
+
e.nextTick = F;
|
|
1261
1261
|
async function P(E, U, g) {
|
|
1262
1262
|
let v = Date.now();
|
|
1263
1263
|
for (let R = 0; R < E; R++) {
|
|
@@ -1298,9 +1298,9 @@ function tt() {
|
|
|
1298
1298
|
throw new Error("options should be object or undefined");
|
|
1299
1299
|
return Object.assign(E, U);
|
|
1300
1300
|
}
|
|
1301
|
-
class
|
|
1301
|
+
class I {
|
|
1302
1302
|
}
|
|
1303
|
-
e.Hash =
|
|
1303
|
+
e.Hash = I;
|
|
1304
1304
|
function m(E) {
|
|
1305
1305
|
const U = (v) => E().update(q(v)).digest(), g = E();
|
|
1306
1306
|
return U.outputLen = g.outputLen, U.blockLen = g.blockLen, U.create = () => E(), U;
|
|
@@ -1324,7 +1324,7 @@ function tt() {
|
|
|
1324
1324
|
})(Ut)), Ut;
|
|
1325
1325
|
}
|
|
1326
1326
|
var fn;
|
|
1327
|
-
function
|
|
1327
|
+
function mr() {
|
|
1328
1328
|
if (fn) return Pe;
|
|
1329
1329
|
fn = 1, Object.defineProperty(Pe, "__esModule", { value: !0 }), Pe.SHA512_IV = Pe.SHA384_IV = Pe.SHA224_IV = Pe.SHA256_IV = Pe.HashMD = void 0, Pe.setBigUint64 = t, Pe.Chi = r, Pe.Maj = i;
|
|
1330
1330
|
const e = /* @__PURE__ */ tt();
|
|
@@ -1446,7 +1446,7 @@ function wr() {
|
|
|
1446
1446
|
]), Pe;
|
|
1447
1447
|
}
|
|
1448
1448
|
var me = {}, ln;
|
|
1449
|
-
function
|
|
1449
|
+
function yr() {
|
|
1450
1450
|
if (ln) return me;
|
|
1451
1451
|
ln = 1, Object.defineProperty(me, "__esModule", { value: !0 }), me.toBig = me.shrSL = me.shrSH = me.rotrSL = me.rotrSH = me.rotrBL = me.rotrBH = me.rotr32L = me.rotr32H = me.rotlSL = me.rotlSH = me.rotlBL = me.rotlBH = me.add5L = me.add5H = me.add4L = me.add4H = me.add3L = me.add3H = void 0, me.add = Q, me.fromBig = r, me.split = i;
|
|
1452
1452
|
const e = /* @__PURE__ */ BigInt(2 ** 32 - 1), t = /* @__PURE__ */ BigInt(32);
|
|
@@ -1456,9 +1456,9 @@ function mr() {
|
|
|
1456
1456
|
function i(H, q = !1) {
|
|
1457
1457
|
const k = H.length;
|
|
1458
1458
|
let ee = new Uint32Array(k), C = new Uint32Array(k);
|
|
1459
|
-
for (let
|
|
1460
|
-
const { h: m, l: N } = r(H[
|
|
1461
|
-
[ee[
|
|
1459
|
+
for (let I = 0; I < k; I++) {
|
|
1460
|
+
const { h: m, l: N } = r(H[I], q);
|
|
1461
|
+
[ee[I], C[I]] = [m, N];
|
|
1462
1462
|
}
|
|
1463
1463
|
return [ee, C];
|
|
1464
1464
|
}
|
|
@@ -1500,9 +1500,9 @@ function mr() {
|
|
|
1500
1500
|
me.add4L = te;
|
|
1501
1501
|
const J = (H, q, k, ee, C) => q + k + ee + C + (H / 2 ** 32 | 0) | 0;
|
|
1502
1502
|
me.add4H = J;
|
|
1503
|
-
const
|
|
1504
|
-
me.add5L =
|
|
1505
|
-
const P = (H, q, k, ee, C,
|
|
1503
|
+
const F = (H, q, k, ee, C) => (H >>> 0) + (q >>> 0) + (k >>> 0) + (ee >>> 0) + (C >>> 0);
|
|
1504
|
+
me.add5L = F;
|
|
1505
|
+
const P = (H, q, k, ee, C, I) => q + k + ee + C + I + (H / 2 ** 32 | 0) | 0;
|
|
1506
1506
|
me.add5H = P;
|
|
1507
1507
|
const Z = {
|
|
1508
1508
|
fromBig: r,
|
|
@@ -1526,15 +1526,15 @@ function mr() {
|
|
|
1526
1526
|
add4L: te,
|
|
1527
1527
|
add4H: J,
|
|
1528
1528
|
add5H: P,
|
|
1529
|
-
add5L:
|
|
1529
|
+
add5L: F
|
|
1530
1530
|
};
|
|
1531
1531
|
return me.default = Z, me;
|
|
1532
1532
|
}
|
|
1533
1533
|
var dn;
|
|
1534
|
-
function
|
|
1534
|
+
function br() {
|
|
1535
1535
|
if (dn) return Be;
|
|
1536
1536
|
dn = 1, Object.defineProperty(Be, "__esModule", { value: !0 }), Be.sha512_224 = Be.sha512_256 = Be.sha384 = Be.sha512 = Be.sha224 = Be.sha256 = Be.SHA512_256 = Be.SHA512_224 = Be.SHA384 = Be.SHA512 = Be.SHA224 = Be.SHA256 = void 0;
|
|
1537
|
-
const e = /* @__PURE__ */
|
|
1537
|
+
const e = /* @__PURE__ */ mr(), t = /* @__PURE__ */ yr(), r = /* @__PURE__ */ tt(), i = /* @__PURE__ */ Uint32Array.from([
|
|
1538
1538
|
1116352408,
|
|
1539
1539
|
1899447441,
|
|
1540
1540
|
3049323471,
|
|
@@ -1605,26 +1605,26 @@ function yr() {
|
|
|
1605
1605
|
super(64, $, 8, !1), this.A = e.SHA256_IV[0] | 0, this.B = e.SHA256_IV[1] | 0, this.C = e.SHA256_IV[2] | 0, this.D = e.SHA256_IV[3] | 0, this.E = e.SHA256_IV[4] | 0, this.F = e.SHA256_IV[5] | 0, this.G = e.SHA256_IV[6] | 0, this.H = e.SHA256_IV[7] | 0;
|
|
1606
1606
|
}
|
|
1607
1607
|
get() {
|
|
1608
|
-
const { A: $, B: te, C: J, D:
|
|
1609
|
-
return [$, te, J,
|
|
1608
|
+
const { A: $, B: te, C: J, D: F, E: P, F: Z, G: H, H: q } = this;
|
|
1609
|
+
return [$, te, J, F, P, Z, H, q];
|
|
1610
1610
|
}
|
|
1611
1611
|
// prettier-ignore
|
|
1612
|
-
set($, te, J,
|
|
1613
|
-
this.A = $ | 0, this.B = te | 0, this.C = J | 0, this.D =
|
|
1612
|
+
set($, te, J, F, P, Z, H, q) {
|
|
1613
|
+
this.A = $ | 0, this.B = te | 0, this.C = J | 0, this.D = F | 0, this.E = P | 0, this.F = Z | 0, this.G = H | 0, this.H = q | 0;
|
|
1614
1614
|
}
|
|
1615
1615
|
process($, te) {
|
|
1616
1616
|
for (let C = 0; C < 16; C++, te += 4)
|
|
1617
1617
|
c[C] = $.getUint32(te, !1);
|
|
1618
1618
|
for (let C = 16; C < 64; C++) {
|
|
1619
|
-
const
|
|
1619
|
+
const I = c[C - 15], m = c[C - 2], N = (0, r.rotr)(I, 7) ^ (0, r.rotr)(I, 18) ^ I >>> 3, x = (0, r.rotr)(m, 17) ^ (0, r.rotr)(m, 19) ^ m >>> 10;
|
|
1620
1620
|
c[C] = x + c[C - 7] + N + c[C - 16] | 0;
|
|
1621
1621
|
}
|
|
1622
|
-
let { A: J, B:
|
|
1622
|
+
let { A: J, B: F, C: P, D: Z, E: H, F: q, G: k, H: ee } = this;
|
|
1623
1623
|
for (let C = 0; C < 64; C++) {
|
|
1624
|
-
const
|
|
1625
|
-
ee = k, k = q, q = H, H = Z + m | 0, Z = P, P =
|
|
1624
|
+
const I = (0, r.rotr)(H, 6) ^ (0, r.rotr)(H, 11) ^ (0, r.rotr)(H, 25), m = ee + I + (0, e.Chi)(H, q, k) + i[C] + c[C] | 0, x = ((0, r.rotr)(J, 2) ^ (0, r.rotr)(J, 13) ^ (0, r.rotr)(J, 22)) + (0, e.Maj)(J, F, P) | 0;
|
|
1625
|
+
ee = k, k = q, q = H, H = Z + m | 0, Z = P, P = F, F = J, J = m + x | 0;
|
|
1626
1626
|
}
|
|
1627
|
-
J = J + this.A | 0,
|
|
1627
|
+
J = J + this.A | 0, F = F + this.B | 0, P = P + this.C | 0, Z = Z + this.D | 0, H = H + this.E | 0, q = q + this.F | 0, k = k + this.G | 0, ee = ee + this.H | 0, this.set(J, F, P, Z, H, q, k, ee);
|
|
1628
1628
|
}
|
|
1629
1629
|
roundClean() {
|
|
1630
1630
|
(0, r.clean)(c);
|
|
@@ -1728,12 +1728,12 @@ function yr() {
|
|
|
1728
1728
|
}
|
|
1729
1729
|
// prettier-ignore
|
|
1730
1730
|
get() {
|
|
1731
|
-
const { Ah: $, Al: te, Bh: J, Bl:
|
|
1732
|
-
return [$, te, J,
|
|
1731
|
+
const { Ah: $, Al: te, Bh: J, Bl: F, Ch: P, Cl: Z, Dh: H, Dl: q, Eh: k, El: ee, Fh: C, Fl: I, Gh: m, Gl: N, Hh: x, Hl: p } = this;
|
|
1732
|
+
return [$, te, J, F, P, Z, H, q, k, ee, C, I, m, N, x, p];
|
|
1733
1733
|
}
|
|
1734
1734
|
// prettier-ignore
|
|
1735
|
-
set($, te, J,
|
|
1736
|
-
this.Ah = $ | 0, this.Al = te | 0, this.Bh = J | 0, this.Bl =
|
|
1735
|
+
set($, te, J, F, P, Z, H, q, k, ee, C, I, m, N, x, p) {
|
|
1736
|
+
this.Ah = $ | 0, this.Al = te | 0, this.Bh = J | 0, this.Bl = F | 0, this.Ch = P | 0, this.Cl = Z | 0, this.Dh = H | 0, this.Dl = q | 0, this.Eh = k | 0, this.El = ee | 0, this.Fh = C | 0, this.Fl = I | 0, this.Gh = m | 0, this.Gl = N | 0, this.Hh = x | 0, this.Hl = p | 0;
|
|
1737
1737
|
}
|
|
1738
1738
|
process($, te) {
|
|
1739
1739
|
for (let g = 0; g < 16; g++, te += 4)
|
|
@@ -1742,14 +1742,14 @@ function yr() {
|
|
|
1742
1742
|
const v = w[g - 15] | 0, R = y[g - 15] | 0, V = t.rotrSH(v, R, 1) ^ t.rotrSH(v, R, 8) ^ t.shrSH(v, R, 7), Y = t.rotrSL(v, R, 1) ^ t.rotrSL(v, R, 8) ^ t.shrSL(v, R, 7), ne = w[g - 2] | 0, ie = y[g - 2] | 0, z = t.rotrSH(ne, ie, 19) ^ t.rotrBH(ne, ie, 61) ^ t.shrSH(ne, ie, 6), X = t.rotrSL(ne, ie, 19) ^ t.rotrBL(ne, ie, 61) ^ t.shrSL(ne, ie, 6), re = t.add4L(Y, X, y[g - 7], y[g - 16]), le = t.add4H(re, V, z, w[g - 7], w[g - 16]);
|
|
1743
1743
|
w[g] = le | 0, y[g] = re | 0;
|
|
1744
1744
|
}
|
|
1745
|
-
let { Ah: J, Al:
|
|
1745
|
+
let { Ah: J, Al: F, Bh: P, Bl: Z, Ch: H, Cl: q, Dh: k, Dl: ee, Eh: C, El: I, Fh: m, Fl: N, Gh: x, Gl: p, Hh: E, Hl: U } = this;
|
|
1746
1746
|
for (let g = 0; g < 80; g++) {
|
|
1747
|
-
const v = t.rotrSH(C,
|
|
1748
|
-
E = x | 0, U = p | 0, x = m | 0, p = N | 0, m = C | 0, N =
|
|
1747
|
+
const v = t.rotrSH(C, I, 14) ^ t.rotrSH(C, I, 18) ^ t.rotrBH(C, I, 41), R = t.rotrSL(C, I, 14) ^ t.rotrSL(C, I, 18) ^ t.rotrBL(C, I, 41), V = C & m ^ ~C & x, Y = I & N ^ ~I & p, ne = t.add5L(U, R, Y, d[g], y[g]), ie = t.add5H(ne, E, v, V, h[g], w[g]), z = ne | 0, X = t.rotrSH(J, F, 28) ^ t.rotrBH(J, F, 34) ^ t.rotrBH(J, F, 39), re = t.rotrSL(J, F, 28) ^ t.rotrBL(J, F, 34) ^ t.rotrBL(J, F, 39), le = J & P ^ J & H ^ P & H, ce = F & Z ^ F & q ^ Z & q;
|
|
1748
|
+
E = x | 0, U = p | 0, x = m | 0, p = N | 0, m = C | 0, N = I | 0, { h: C, l: I } = t.add(k | 0, ee | 0, ie | 0, z | 0), k = H | 0, ee = q | 0, H = P | 0, q = Z | 0, P = J | 0, Z = F | 0;
|
|
1749
1749
|
const j = t.add3L(z, re, ce);
|
|
1750
|
-
J = t.add3H(j, ie, X, le),
|
|
1750
|
+
J = t.add3H(j, ie, X, le), F = j | 0;
|
|
1751
1751
|
}
|
|
1752
|
-
({ h: J, l:
|
|
1752
|
+
({ h: J, l: F } = t.add(this.Ah | 0, this.Al | 0, J | 0, F | 0)), { h: P, l: Z } = t.add(this.Bh | 0, this.Bl | 0, P | 0, Z | 0), { h: H, l: q } = t.add(this.Ch | 0, this.Cl | 0, H | 0, q | 0), { h: k, l: ee } = t.add(this.Dh | 0, this.Dl | 0, k | 0, ee | 0), { h: C, l: I } = t.add(this.Eh | 0, this.El | 0, C | 0, I | 0), { h: m, l: N } = t.add(this.Fh | 0, this.Fl | 0, m | 0, N | 0), { h: x, l: p } = t.add(this.Gh | 0, this.Gl | 0, x | 0, p | 0), { h: E, l: U } = t.add(this.Hh | 0, this.Hl | 0, E | 0, U | 0), this.set(J, F, P, Z, H, q, k, ee, C, I, m, N, x, p, E, U);
|
|
1753
1753
|
}
|
|
1754
1754
|
roundClean() {
|
|
1755
1755
|
(0, r.clean)(w, y);
|
|
@@ -1814,7 +1814,7 @@ function yr() {
|
|
|
1814
1814
|
return Be.SHA512_256 = Q, Be.sha256 = (0, r.createHasher)(() => new s()), Be.sha224 = (0, r.createHasher)(() => new u()), Be.sha512 = (0, r.createHasher)(() => new B()), Be.sha384 = (0, r.createHasher)(() => new _()), Be.sha512_256 = (0, r.createHasher)(() => new Q()), Be.sha512_224 = (0, r.createHasher)(() => new M()), Be;
|
|
1815
1815
|
}
|
|
1816
1816
|
var ut = {}, Ot = {}, qt = {}, hn;
|
|
1817
|
-
function
|
|
1817
|
+
function Er() {
|
|
1818
1818
|
return hn || (hn = 1, (function(e) {
|
|
1819
1819
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.hmac = e.HMAC = void 0;
|
|
1820
1820
|
const t = /* @__PURE__ */ tt();
|
|
@@ -1864,7 +1864,7 @@ function br() {
|
|
|
1864
1864
|
var Ct = {}, pn;
|
|
1865
1865
|
function st() {
|
|
1866
1866
|
return pn || (pn = 1, (function(e) {
|
|
1867
|
-
Object.defineProperty(e, "__esModule", { value: !0 }), e.notImplemented = e.bitMask = e.utf8ToBytes = e.randomBytes = e.isBytes = e.hexToBytes = e.concatBytes = e.bytesToUtf8 = e.bytesToHex = e.anumber = e.abytes = void 0, e.abool = s, e._abool2 = u, e._abytes2 = a, e.numberToHexUnpadded = h, e.hexToNumber = d, e.bytesToNumberBE = w, e.bytesToNumberLE = y, e.numberToBytesBE = B, e.numberToBytesLE = _, e.numberToVarBytesBE = T, e.ensureBytes = S, e.equalBytes = M, e.copyBytes = Q, e.asciiToBytes = D, e.inRange = te, e.aInRange = J, e.bitLen =
|
|
1867
|
+
Object.defineProperty(e, "__esModule", { value: !0 }), e.notImplemented = e.bitMask = e.utf8ToBytes = e.randomBytes = e.isBytes = e.hexToBytes = e.concatBytes = e.bytesToUtf8 = e.bytesToHex = e.anumber = e.abytes = void 0, e.abool = s, e._abool2 = u, e._abytes2 = a, e.numberToHexUnpadded = h, e.hexToNumber = d, e.bytesToNumberBE = w, e.bytesToNumberLE = y, e.numberToBytesBE = B, e.numberToBytesLE = _, e.numberToVarBytesBE = T, e.ensureBytes = S, e.equalBytes = M, e.copyBytes = Q, e.asciiToBytes = D, e.inRange = te, e.aInRange = J, e.bitLen = F, e.bitGet = P, e.bitSet = Z, e.createHmacDrbg = q, e.validateObject = ee, e.isHash = C, e._validateObject = I, e.memoized = N;
|
|
1868
1868
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
1869
1869
|
const t = /* @__PURE__ */ tt();
|
|
1870
1870
|
var r = /* @__PURE__ */ tt();
|
|
@@ -1975,7 +1975,7 @@ function st() {
|
|
|
1975
1975
|
if (!te(p, E, U))
|
|
1976
1976
|
throw new Error("expected valid " + x + ": " + E + " <= n < " + U + ", got " + p);
|
|
1977
1977
|
}
|
|
1978
|
-
function
|
|
1978
|
+
function F(x) {
|
|
1979
1979
|
let p;
|
|
1980
1980
|
for (p = 0; x > i; x >>= c, p += 1)
|
|
1981
1981
|
;
|
|
@@ -2051,7 +2051,7 @@ function st() {
|
|
|
2051
2051
|
function C(x) {
|
|
2052
2052
|
return typeof x == "function" && Number.isSafeInteger(x.outputLen);
|
|
2053
2053
|
}
|
|
2054
|
-
function
|
|
2054
|
+
function I(x, p, E = {}) {
|
|
2055
2055
|
if (!x || typeof x != "object")
|
|
2056
2056
|
throw new Error("expected valid options object");
|
|
2057
2057
|
function U(g, v, R) {
|
|
@@ -2083,7 +2083,7 @@ function st() {
|
|
|
2083
2083
|
var Ve = {}, ve = {}, gn;
|
|
2084
2084
|
function dt() {
|
|
2085
2085
|
if (gn) return ve;
|
|
2086
|
-
gn = 1, Object.defineProperty(ve, "__esModule", { value: !0 }), ve.isNegativeLE = void 0, ve.mod = y, ve.pow = B, ve.pow2 = _, ve.invert = T, ve.tonelliShanks = $, ve.FpSqrt = te, ve.validateField = P, ve.FpPow = Z, ve.FpInvertBatch = H, ve.FpDiv = q, ve.FpLegendre = k, ve.FpIsSquare = ee, ve.nLength = C, ve.Field =
|
|
2086
|
+
gn = 1, Object.defineProperty(ve, "__esModule", { value: !0 }), ve.isNegativeLE = void 0, ve.mod = y, ve.pow = B, ve.pow2 = _, ve.invert = T, ve.tonelliShanks = $, ve.FpSqrt = te, ve.validateField = P, ve.FpPow = Z, ve.FpInvertBatch = H, ve.FpDiv = q, ve.FpLegendre = k, ve.FpIsSquare = ee, ve.nLength = C, ve.Field = I, ve.FpSqrtOdd = m, ve.FpSqrtEven = N, ve.hashToPrivateScalar = x, ve.getFieldBytesLength = p, ve.getMinHashLength = E, ve.mapHashToField = U;
|
|
2087
2087
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
2088
2088
|
const e = /* @__PURE__ */ st(), t = BigInt(0), r = BigInt(1), i = /* @__PURE__ */ BigInt(2), c = /* @__PURE__ */ BigInt(3), s = /* @__PURE__ */ BigInt(4), u = /* @__PURE__ */ BigInt(5), a = /* @__PURE__ */ BigInt(7), h = /* @__PURE__ */ BigInt(8), d = /* @__PURE__ */ BigInt(9), w = /* @__PURE__ */ BigInt(16);
|
|
2089
2089
|
function y(g, v) {
|
|
@@ -2091,7 +2091,7 @@ function dt() {
|
|
|
2091
2091
|
return R >= t ? R : v + R;
|
|
2092
2092
|
}
|
|
2093
2093
|
function B(g, v, R) {
|
|
2094
|
-
return Z(
|
|
2094
|
+
return Z(I(R), g, v);
|
|
2095
2095
|
}
|
|
2096
2096
|
function _(g, v, R) {
|
|
2097
2097
|
let V = g;
|
|
@@ -2126,7 +2126,7 @@ function dt() {
|
|
|
2126
2126
|
return S(g, z, v), z;
|
|
2127
2127
|
}
|
|
2128
2128
|
function D(g) {
|
|
2129
|
-
const v =
|
|
2129
|
+
const v = I(g), R = $(g), V = R(v, v.neg(v.ONE)), Y = R(v, V), ne = R(v, v.neg(V)), ie = (g + a) / w;
|
|
2130
2130
|
return (z, X) => {
|
|
2131
2131
|
let re = z.pow(X, ie), le = z.mul(re, V);
|
|
2132
2132
|
const ce = z.mul(re, Y), j = z.mul(re, ne), oe = z.eql(z.sqr(le), X), ye = z.eql(z.sqr(ce), X);
|
|
@@ -2142,7 +2142,7 @@ function dt() {
|
|
|
2142
2142
|
for (; v % i === t; )
|
|
2143
2143
|
v /= i, R++;
|
|
2144
2144
|
let V = i;
|
|
2145
|
-
const Y =
|
|
2145
|
+
const Y = I(g);
|
|
2146
2146
|
for (; k(Y, V) === 1; )
|
|
2147
2147
|
if (V++ > 1e3)
|
|
2148
2148
|
throw new Error("Cannot find square root: probably non-prime P");
|
|
@@ -2174,7 +2174,7 @@ function dt() {
|
|
|
2174
2174
|
}
|
|
2175
2175
|
const J = (g, v) => (y(g, v) & r) === r;
|
|
2176
2176
|
ve.isNegativeLE = J;
|
|
2177
|
-
const
|
|
2177
|
+
const F = [
|
|
2178
2178
|
"create",
|
|
2179
2179
|
"isValid",
|
|
2180
2180
|
"is0",
|
|
@@ -2199,7 +2199,7 @@ function dt() {
|
|
|
2199
2199
|
MASK: "bigint",
|
|
2200
2200
|
BYTES: "number",
|
|
2201
2201
|
BITS: "number"
|
|
2202
|
-
}, R =
|
|
2202
|
+
}, R = F.reduce((V, Y) => (V[Y] = "function", V), v);
|
|
2203
2203
|
return (0, e._validateObject)(g, R), g;
|
|
2204
2204
|
}
|
|
2205
2205
|
function Z(g, v, R) {
|
|
@@ -2235,7 +2235,7 @@ function dt() {
|
|
|
2235
2235
|
const R = v !== void 0 ? v : g.toString(2).length, V = Math.ceil(R / 8);
|
|
2236
2236
|
return { nBitLength: R, nByteLength: V };
|
|
2237
2237
|
}
|
|
2238
|
-
function
|
|
2238
|
+
function I(g, v, R = !1, V = {}) {
|
|
2239
2239
|
if (g <= t)
|
|
2240
2240
|
throw new Error("invalid field: expected ORDER > 0, got " + g);
|
|
2241
2241
|
let Y, ne, ie = !1, z;
|
|
@@ -2347,57 +2347,57 @@ function dt() {
|
|
|
2347
2347
|
return ve;
|
|
2348
2348
|
}
|
|
2349
2349
|
var wn;
|
|
2350
|
-
function
|
|
2350
|
+
function Br() {
|
|
2351
2351
|
if (wn) return Ve;
|
|
2352
2352
|
wn = 1, Object.defineProperty(Ve, "__esModule", { value: !0 }), Ve.wNAF = void 0, Ve.negateCt = c, Ve.normalizeZ = s, Ve.mulEndoUnsafe = M, Ve.pippenger = Q, Ve.precomputeMSMUnsafe = D, Ve.validateBasic = $, Ve._createCurveFields = J;
|
|
2353
2353
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
2354
2354
|
const e = /* @__PURE__ */ st(), t = /* @__PURE__ */ dt(), r = BigInt(0), i = BigInt(1);
|
|
2355
|
-
function c(
|
|
2355
|
+
function c(F, P) {
|
|
2356
2356
|
const Z = P.negate();
|
|
2357
|
-
return
|
|
2357
|
+
return F ? Z : P;
|
|
2358
2358
|
}
|
|
2359
|
-
function s(
|
|
2360
|
-
const Z = (0, t.FpInvertBatch)(
|
|
2361
|
-
return P.map((H, q) =>
|
|
2359
|
+
function s(F, P) {
|
|
2360
|
+
const Z = (0, t.FpInvertBatch)(F.Fp, P.map((H) => H.Z));
|
|
2361
|
+
return P.map((H, q) => F.fromAffine(H.toAffine(Z[q])));
|
|
2362
2362
|
}
|
|
2363
|
-
function u(
|
|
2364
|
-
if (!Number.isSafeInteger(
|
|
2365
|
-
throw new Error("invalid window size, expected [1.." + P + "], got W=" +
|
|
2363
|
+
function u(F, P) {
|
|
2364
|
+
if (!Number.isSafeInteger(F) || F <= 0 || F > P)
|
|
2365
|
+
throw new Error("invalid window size, expected [1.." + P + "], got W=" + F);
|
|
2366
2366
|
}
|
|
2367
|
-
function a(
|
|
2368
|
-
u(
|
|
2369
|
-
const Z = Math.ceil(P /
|
|
2367
|
+
function a(F, P) {
|
|
2368
|
+
u(F, P);
|
|
2369
|
+
const Z = Math.ceil(P / F) + 1, H = 2 ** (F - 1), q = 2 ** F, k = (0, e.bitMask)(F), ee = BigInt(F);
|
|
2370
2370
|
return { windows: Z, windowSize: H, mask: k, maxNumber: q, shiftBy: ee };
|
|
2371
2371
|
}
|
|
2372
|
-
function h(
|
|
2372
|
+
function h(F, P, Z) {
|
|
2373
2373
|
const { windowSize: H, mask: q, maxNumber: k, shiftBy: ee } = Z;
|
|
2374
|
-
let C = Number(
|
|
2375
|
-
C > H && (C -= k,
|
|
2374
|
+
let C = Number(F & q), I = F >> ee;
|
|
2375
|
+
C > H && (C -= k, I += i);
|
|
2376
2376
|
const m = P * H, N = m + Math.abs(C) - 1, x = C === 0, p = C < 0, E = P % 2 !== 0;
|
|
2377
|
-
return { nextN:
|
|
2377
|
+
return { nextN: I, offset: N, isZero: x, isNeg: p, isNegF: E, offsetF: m };
|
|
2378
2378
|
}
|
|
2379
|
-
function d(
|
|
2380
|
-
if (!Array.isArray(
|
|
2379
|
+
function d(F, P) {
|
|
2380
|
+
if (!Array.isArray(F))
|
|
2381
2381
|
throw new Error("array expected");
|
|
2382
|
-
|
|
2382
|
+
F.forEach((Z, H) => {
|
|
2383
2383
|
if (!(Z instanceof P))
|
|
2384
2384
|
throw new Error("invalid point at index " + H);
|
|
2385
2385
|
});
|
|
2386
2386
|
}
|
|
2387
|
-
function w(
|
|
2388
|
-
if (!Array.isArray(
|
|
2387
|
+
function w(F, P) {
|
|
2388
|
+
if (!Array.isArray(F))
|
|
2389
2389
|
throw new Error("array of scalars expected");
|
|
2390
|
-
|
|
2390
|
+
F.forEach((Z, H) => {
|
|
2391
2391
|
if (!P.isValid(Z))
|
|
2392
2392
|
throw new Error("invalid scalar at index " + H);
|
|
2393
2393
|
});
|
|
2394
2394
|
}
|
|
2395
2395
|
const y = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new WeakMap();
|
|
2396
|
-
function _(
|
|
2397
|
-
return B.get(
|
|
2396
|
+
function _(F) {
|
|
2397
|
+
return B.get(F) || 1;
|
|
2398
2398
|
}
|
|
2399
|
-
function T(
|
|
2400
|
-
if (
|
|
2399
|
+
function T(F) {
|
|
2400
|
+
if (F !== r)
|
|
2401
2401
|
throw new Error("invalid wNAF");
|
|
2402
2402
|
}
|
|
2403
2403
|
class S {
|
|
@@ -2427,7 +2427,7 @@ function Er() {
|
|
|
2427
2427
|
precomputeWindow(P, Z) {
|
|
2428
2428
|
const { windows: H, windowSize: q } = a(Z, this.bits), k = [];
|
|
2429
2429
|
let ee = P, C = ee;
|
|
2430
|
-
for (let
|
|
2430
|
+
for (let I = 0; I < H; I++) {
|
|
2431
2431
|
C = ee, k.push(C);
|
|
2432
2432
|
for (let m = 1; m < q; m++)
|
|
2433
2433
|
C = C.add(ee), k.push(C);
|
|
@@ -2447,8 +2447,8 @@ function Er() {
|
|
|
2447
2447
|
let q = this.ZERO, k = this.BASE;
|
|
2448
2448
|
const ee = a(P, this.bits);
|
|
2449
2449
|
for (let C = 0; C < ee.windows; C++) {
|
|
2450
|
-
const { nextN:
|
|
2451
|
-
H =
|
|
2450
|
+
const { nextN: I, offset: m, isZero: N, isNeg: x, isNegF: p, offsetF: E } = h(H, C, ee);
|
|
2451
|
+
H = I, N ? k = k.add(c(p, Z[E])) : q = q.add(c(x, Z[m]));
|
|
2452
2452
|
}
|
|
2453
2453
|
return T(H), { p: q, f: k };
|
|
2454
2454
|
}
|
|
@@ -2460,9 +2460,9 @@ function Er() {
|
|
|
2460
2460
|
wNAFUnsafe(P, Z, H, q = this.ZERO) {
|
|
2461
2461
|
const k = a(P, this.bits);
|
|
2462
2462
|
for (let ee = 0; ee < k.windows && H !== r; ee++) {
|
|
2463
|
-
const { nextN: C, offset:
|
|
2463
|
+
const { nextN: C, offset: I, isZero: m, isNeg: N } = h(H, ee, k);
|
|
2464
2464
|
if (H = C, !m) {
|
|
2465
|
-
const x = Z[
|
|
2465
|
+
const x = Z[I];
|
|
2466
2466
|
q = q.add(N ? x.negate() : x);
|
|
2467
2467
|
}
|
|
2468
2468
|
}
|
|
@@ -2491,23 +2491,23 @@ function Er() {
|
|
|
2491
2491
|
}
|
|
2492
2492
|
}
|
|
2493
2493
|
Ve.wNAF = S;
|
|
2494
|
-
function M(
|
|
2495
|
-
let q = P, k =
|
|
2494
|
+
function M(F, P, Z, H) {
|
|
2495
|
+
let q = P, k = F.ZERO, ee = F.ZERO;
|
|
2496
2496
|
for (; Z > r || H > r; )
|
|
2497
2497
|
Z & i && (k = k.add(q)), H & i && (ee = ee.add(q)), q = q.double(), Z >>= i, H >>= i;
|
|
2498
2498
|
return { p1: k, p2: ee };
|
|
2499
2499
|
}
|
|
2500
|
-
function Q(
|
|
2501
|
-
d(Z,
|
|
2500
|
+
function Q(F, P, Z, H) {
|
|
2501
|
+
d(Z, F), w(H, P);
|
|
2502
2502
|
const q = Z.length, k = H.length;
|
|
2503
2503
|
if (q !== k)
|
|
2504
2504
|
throw new Error("arrays of points and scalars must have equal length");
|
|
2505
|
-
const ee =
|
|
2506
|
-
let
|
|
2507
|
-
C > 12 ?
|
|
2508
|
-
const m = (0, e.bitMask)(
|
|
2505
|
+
const ee = F.ZERO, C = (0, e.bitLen)(BigInt(q));
|
|
2506
|
+
let I = 1;
|
|
2507
|
+
C > 12 ? I = C - 3 : C > 4 ? I = C - 2 : C > 0 && (I = 2);
|
|
2508
|
+
const m = (0, e.bitMask)(I), N = new Array(Number(m) + 1).fill(ee), x = Math.floor((P.BITS - 1) / I) * I;
|
|
2509
2509
|
let p = ee;
|
|
2510
|
-
for (let E = x; E >= 0; E -=
|
|
2510
|
+
for (let E = x; E >= 0; E -= I) {
|
|
2511
2511
|
N.fill(ee);
|
|
2512
2512
|
for (let g = 0; g < k; g++) {
|
|
2513
2513
|
const v = H[g], R = Number(v >> BigInt(E) & m);
|
|
@@ -2517,14 +2517,14 @@ function Er() {
|
|
|
2517
2517
|
for (let g = N.length - 1, v = ee; g > 0; g--)
|
|
2518
2518
|
v = v.add(N[g]), U = U.add(v);
|
|
2519
2519
|
if (p = p.add(U), E !== 0)
|
|
2520
|
-
for (let g = 0; g <
|
|
2520
|
+
for (let g = 0; g < I; g++)
|
|
2521
2521
|
p = p.double();
|
|
2522
2522
|
}
|
|
2523
2523
|
return p;
|
|
2524
2524
|
}
|
|
2525
|
-
function D(
|
|
2526
|
-
u(H, P.BITS), d(Z,
|
|
2527
|
-
const q =
|
|
2525
|
+
function D(F, P, Z, H) {
|
|
2526
|
+
u(H, P.BITS), d(Z, F);
|
|
2527
|
+
const q = F.ZERO, k = 2 ** H - 1, ee = Math.ceil(P.BITS / H), C = (0, e.bitMask)(H), I = Z.map((m) => {
|
|
2528
2528
|
const N = [];
|
|
2529
2529
|
for (let x = 0, p = m; x < k; x++)
|
|
2530
2530
|
N.push(p), p = p.add(m);
|
|
@@ -2541,14 +2541,14 @@ function Er() {
|
|
|
2541
2541
|
const p = BigInt(ee * H - (x + 1) * H);
|
|
2542
2542
|
for (let E = 0; E < m.length; E++) {
|
|
2543
2543
|
const U = m[E], g = Number(U >> p & C);
|
|
2544
|
-
g && (N = N.add(
|
|
2544
|
+
g && (N = N.add(I[E][g - 1]));
|
|
2545
2545
|
}
|
|
2546
2546
|
}
|
|
2547
2547
|
return N;
|
|
2548
2548
|
};
|
|
2549
2549
|
}
|
|
2550
|
-
function $(
|
|
2551
|
-
return (0, t.validateField)(
|
|
2550
|
+
function $(F) {
|
|
2551
|
+
return (0, t.validateField)(F.Fp), (0, e.validateObject)(F, {
|
|
2552
2552
|
n: "bigint",
|
|
2553
2553
|
h: "bigint",
|
|
2554
2554
|
Gx: "field",
|
|
@@ -2557,31 +2557,31 @@ function Er() {
|
|
|
2557
2557
|
nBitLength: "isSafeInteger",
|
|
2558
2558
|
nByteLength: "isSafeInteger"
|
|
2559
2559
|
}), Object.freeze({
|
|
2560
|
-
...(0, t.nLength)(
|
|
2561
|
-
...
|
|
2562
|
-
p:
|
|
2560
|
+
...(0, t.nLength)(F.n, F.nBitLength),
|
|
2561
|
+
...F,
|
|
2562
|
+
p: F.Fp.ORDER
|
|
2563
2563
|
});
|
|
2564
2564
|
}
|
|
2565
|
-
function te(
|
|
2565
|
+
function te(F, P, Z) {
|
|
2566
2566
|
if (P) {
|
|
2567
|
-
if (P.ORDER !==
|
|
2567
|
+
if (P.ORDER !== F)
|
|
2568
2568
|
throw new Error("Field.ORDER must match order: Fp == p, Fn == n");
|
|
2569
2569
|
return (0, t.validateField)(P), P;
|
|
2570
2570
|
} else
|
|
2571
|
-
return (0, t.Field)(
|
|
2571
|
+
return (0, t.Field)(F, { isLE: Z });
|
|
2572
2572
|
}
|
|
2573
|
-
function J(
|
|
2574
|
-
if (H === void 0 && (H =
|
|
2575
|
-
throw new Error(`expected valid ${
|
|
2576
|
-
for (const
|
|
2577
|
-
const m = P[
|
|
2573
|
+
function J(F, P, Z = {}, H) {
|
|
2574
|
+
if (H === void 0 && (H = F === "edwards"), !P || typeof P != "object")
|
|
2575
|
+
throw new Error(`expected valid ${F} CURVE object`);
|
|
2576
|
+
for (const I of ["p", "n", "h"]) {
|
|
2577
|
+
const m = P[I];
|
|
2578
2578
|
if (!(typeof m == "bigint" && m > r))
|
|
2579
|
-
throw new Error(`CURVE.${
|
|
2579
|
+
throw new Error(`CURVE.${I} must be positive bigint`);
|
|
2580
2580
|
}
|
|
2581
|
-
const q = te(P.p, Z.Fp, H), k = te(P.n, Z.Fn, H), C = ["Gx", "Gy", "a",
|
|
2582
|
-
for (const
|
|
2583
|
-
if (!q.isValid(P[
|
|
2584
|
-
throw new Error(`CURVE.${
|
|
2581
|
+
const q = te(P.p, Z.Fp, H), k = te(P.n, Z.Fn, H), C = ["Gx", "Gy", "a", F === "weierstrass" ? "b" : "d"];
|
|
2582
|
+
for (const I of C)
|
|
2583
|
+
if (!q.isValid(P[I]))
|
|
2584
|
+
throw new Error(`CURVE.${I} must be valid field element of CURVE.Fp`);
|
|
2585
2585
|
return P = Object.freeze(Object.assign({}, P)), { CURVE: P, Fp: q, Fn: k };
|
|
2586
2586
|
}
|
|
2587
2587
|
return Ve;
|
|
@@ -2589,9 +2589,9 @@ function Er() {
|
|
|
2589
2589
|
var mn;
|
|
2590
2590
|
function Pn() {
|
|
2591
2591
|
return mn || (mn = 1, (function(e) {
|
|
2592
|
-
Object.defineProperty(e, "__esModule", { value: !0 }), e.DER = e.DERErr = void 0, e._splitEndoScalar = a, e._normFnElement = M, e.weierstrassN = Q, e.SWUFpSqrtRatio = $, e.mapToCurveSimpleSWU = te, e.ecdh =
|
|
2592
|
+
Object.defineProperty(e, "__esModule", { value: !0 }), e.DER = e.DERErr = void 0, e._splitEndoScalar = a, e._normFnElement = M, e.weierstrassN = Q, e.SWUFpSqrtRatio = $, e.mapToCurveSimpleSWU = te, e.ecdh = F, e.ecdsa = P, e.weierstrassPoints = Z, e._legacyHelperEquat = k, e.weierstrass = I;
|
|
2593
2593
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
2594
|
-
const t = /* @__PURE__ */
|
|
2594
|
+
const t = /* @__PURE__ */ Er(), r = /* @__PURE__ */ tt(), i = /* @__PURE__ */ st(), c = /* @__PURE__ */ Br(), s = /* @__PURE__ */ dt(), u = (m, N) => (m + (m >= 0 ? N : -N) / _) / N;
|
|
2595
2595
|
function a(m, N, x) {
|
|
2596
2596
|
const [[p, E], [U, g]] = N, v = u(g * m, x), R = u(-E * m, x);
|
|
2597
2597
|
let V = m - v * p - R * U, Y = -v * E - R * g;
|
|
@@ -2916,10 +2916,10 @@ function Pn() {
|
|
|
2916
2916
|
const { X: W, Y: K, Z: f } = this, { X: n, Y: o, Z: l } = L;
|
|
2917
2917
|
let b = p.ZERO, A = p.ZERO, O = p.ZERO;
|
|
2918
2918
|
const ae = U.a, he = p.mul(U.b, T);
|
|
2919
|
-
let ue = p.mul(W, n), we = p.mul(K, o), pe = p.mul(f, l),
|
|
2920
|
-
|
|
2919
|
+
let ue = p.mul(W, n), we = p.mul(K, o), pe = p.mul(f, l), Ie = p.add(W, K), Te = p.add(n, o);
|
|
2920
|
+
Ie = p.mul(Ie, Te), Te = p.add(ue, we), Ie = p.sub(Ie, Te), Te = p.add(W, f);
|
|
2921
2921
|
let Ce = p.add(n, l);
|
|
2922
|
-
return Te = p.mul(Te, Ce), Ce = p.add(ue, pe), Te = p.sub(Te, Ce), Ce = p.add(K, f), b = p.add(o, l), Ce = p.mul(Ce, b), b = p.add(we, pe), Ce = p.sub(Ce, b), O = p.mul(ae, Te), b = p.mul(he, pe), O = p.add(b, O), b = p.sub(we, O), O = p.add(we, O), A = p.mul(b, O), we = p.add(ue, ue), we = p.add(we, ue), pe = p.mul(ae, pe), Te = p.mul(he, Te), we = p.add(we, pe), pe = p.sub(ue, pe), pe = p.mul(ae, pe), Te = p.add(Te, pe), ue = p.mul(we, Te), A = p.add(A, ue), ue = p.mul(Ce, Te), b = p.mul(
|
|
2922
|
+
return Te = p.mul(Te, Ce), Ce = p.add(ue, pe), Te = p.sub(Te, Ce), Ce = p.add(K, f), b = p.add(o, l), Ce = p.mul(Ce, b), b = p.add(we, pe), Ce = p.sub(Ce, b), O = p.mul(ae, Te), b = p.mul(he, pe), O = p.add(b, O), b = p.sub(we, O), O = p.add(we, O), A = p.mul(b, O), we = p.add(ue, ue), we = p.add(we, ue), pe = p.mul(ae, pe), Te = p.mul(he, Te), we = p.add(we, pe), pe = p.sub(ue, pe), pe = p.mul(ae, pe), Te = p.add(Te, pe), ue = p.mul(we, Te), A = p.add(A, ue), ue = p.mul(Ce, Te), b = p.mul(Ie, b), b = p.sub(b, ue), ue = p.mul(Ie, we), O = p.mul(Ce, O), O = p.add(O, ue), new be(b, A, O);
|
|
2923
2923
|
}
|
|
2924
2924
|
subtract(L) {
|
|
2925
2925
|
return this.add(L.negate());
|
|
@@ -3107,7 +3107,7 @@ function Pn() {
|
|
|
3107
3107
|
signature: 2 * N.BYTES
|
|
3108
3108
|
};
|
|
3109
3109
|
}
|
|
3110
|
-
function
|
|
3110
|
+
function F(m, N = {}) {
|
|
3111
3111
|
const { Fn: x } = m, p = N.randomBytes || i.randomBytes, E = Object.assign(J(m.Fp, x), { seed: (0, s.getMinHashLength)(x.ORDER) });
|
|
3112
3112
|
function U(z) {
|
|
3113
3113
|
try {
|
|
@@ -3175,7 +3175,7 @@ function Pn() {
|
|
|
3175
3175
|
bits2int: "function",
|
|
3176
3176
|
bits2int_modN: "function"
|
|
3177
3177
|
});
|
|
3178
|
-
const p = x.randomBytes || i.randomBytes, E = x.hmac || ((W, ...K) => (0, t.hmac)(N, W, (0, i.concatBytes)(...K))), { Fp: U, Fn: g } = m, { ORDER: v, BITS: R } = g, { keygen: V, getPublicKey: Y, getSharedSecret: ne, utils: ie, lengths: z } =
|
|
3178
|
+
const p = x.randomBytes || i.randomBytes, E = x.hmac || ((W, ...K) => (0, t.hmac)(N, W, (0, i.concatBytes)(...K))), { Fp: U, Fn: g } = m, { ORDER: v, BITS: R } = g, { keygen: V, getPublicKey: Y, getSharedSecret: ne, utils: ie, lengths: z } = F(m, x), X = {
|
|
3179
3179
|
prehash: !1,
|
|
3180
3180
|
lowS: typeof x.lowS == "boolean" ? x.lowS : !1,
|
|
3181
3181
|
format: void 0,
|
|
@@ -3226,10 +3226,10 @@ function Pn() {
|
|
|
3226
3226
|
const A = l === 2 || l === 3 ? n + v : n;
|
|
3227
3227
|
if (!U.isValid(A))
|
|
3228
3228
|
throw new Error("recovery id 2 or 3 invalid");
|
|
3229
|
-
const O = U.toBytes(A), ae = m.fromBytes((0, i.concatBytes)(D((l & 1) === 0), O)), he = g.inv(A), ue = _e((0, i.ensureBytes)("msgHash", K)), we = g.create(-ue * he), pe = g.create(o * he),
|
|
3230
|
-
if (
|
|
3229
|
+
const O = U.toBytes(A), ae = m.fromBytes((0, i.concatBytes)(D((l & 1) === 0), O)), he = g.inv(A), ue = _e((0, i.ensureBytes)("msgHash", K)), we = g.create(-ue * he), pe = g.create(o * he), Ie = m.BASE.multiplyUnsafe(we).add(ae.multiplyUnsafe(pe));
|
|
3230
|
+
if (Ie.is0())
|
|
3231
3231
|
throw new Error("point at infinify");
|
|
3232
|
-
return
|
|
3232
|
+
return Ie.assertValidity(), Ie;
|
|
3233
3233
|
}
|
|
3234
3234
|
// Signatures should be low-s, to prevent malleability.
|
|
3235
3235
|
hasHighS() {
|
|
@@ -3303,10 +3303,10 @@ function Pn() {
|
|
|
3303
3303
|
const pe = ye(we);
|
|
3304
3304
|
if (!g.isValidNot0(pe))
|
|
3305
3305
|
return;
|
|
3306
|
-
const
|
|
3306
|
+
const Ie = g.inv(pe), Te = m.BASE.multiply(pe).toAffine(), Ce = g.create(Te.x);
|
|
3307
3307
|
if (Ce === y)
|
|
3308
3308
|
return;
|
|
3309
|
-
const ht = g.create(
|
|
3309
|
+
const ht = g.create(Ie * g.create(he + Ce * A));
|
|
3310
3310
|
if (ht === y)
|
|
3311
3311
|
return;
|
|
3312
3312
|
let Jt = (Te.x === Ce ? 0 : 2) | Number(Te.y & B), Lt = ht;
|
|
@@ -3353,7 +3353,7 @@ function Pn() {
|
|
|
3353
3353
|
const O = m.fromBytes(f);
|
|
3354
3354
|
if (o && A.hasHighS())
|
|
3355
3355
|
return !1;
|
|
3356
|
-
const { r: ae, s: he } = A, ue = _e(K), we = g.inv(he), pe = g.create(ue * we),
|
|
3356
|
+
const { r: ae, s: he } = A, ue = _e(K), we = g.inv(he), pe = g.create(ue * we), Ie = g.create(ae * we), Te = m.BASE.multiplyUnsafe(pe).add(O.multiplyUnsafe(Ie));
|
|
3357
3357
|
return Te.is0() ? !1 : g.create(Te.x) === ae;
|
|
3358
3358
|
} catch {
|
|
3359
3359
|
return !1;
|
|
@@ -3447,14 +3447,14 @@ function Pn() {
|
|
|
3447
3447
|
CURVE: Object.assign({}, m, (0, s.nLength)(x.Fn.ORDER, x.Fn.BITS))
|
|
3448
3448
|
});
|
|
3449
3449
|
}
|
|
3450
|
-
function
|
|
3450
|
+
function I(m) {
|
|
3451
3451
|
const { CURVE: N, curveOpts: x, hash: p, ecdsaOpts: E } = q(m), U = Q(N, x), g = P(U, p, E);
|
|
3452
3452
|
return C(m, g);
|
|
3453
3453
|
}
|
|
3454
3454
|
})(Ot)), Ot;
|
|
3455
3455
|
}
|
|
3456
3456
|
var yn;
|
|
3457
|
-
function
|
|
3457
|
+
function xr() {
|
|
3458
3458
|
if (yn) return ut;
|
|
3459
3459
|
yn = 1, Object.defineProperty(ut, "__esModule", { value: !0 }), ut.getHash = t, ut.createCurve = r;
|
|
3460
3460
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
@@ -3469,7 +3469,7 @@ function Br() {
|
|
|
3469
3469
|
return ut;
|
|
3470
3470
|
}
|
|
3471
3471
|
var Pt = {}, bn;
|
|
3472
|
-
function
|
|
3472
|
+
function _r() {
|
|
3473
3473
|
return bn || (bn = 1, (function(e) {
|
|
3474
3474
|
Object.defineProperty(e, "__esModule", { value: !0 }), e._DST_scalar = void 0, e.expand_message_xmd = h, e.expand_message_xof = d, e.hash_to_field = w, e.isogenyMap = y, e.createHasher = B;
|
|
3475
3475
|
const t = /* @__PURE__ */ st(), r = /* @__PURE__ */ dt(), i = t.bytesToNumberBE;
|
|
@@ -3501,7 +3501,7 @@ function xr() {
|
|
|
3501
3501
|
const { outputLen: Q, blockLen: D } = M, $ = Math.ceil(S / Q);
|
|
3502
3502
|
if (S > 65535 || $ > 255)
|
|
3503
3503
|
throw new Error("expand_message_xmd: invalid lenInBytes");
|
|
3504
|
-
const te = (0, t.concatBytes)(T, c(T.length, 1)), J = c(0, D),
|
|
3504
|
+
const te = (0, t.concatBytes)(T, c(T.length, 1)), J = c(0, D), F = c(S, 2), P = new Array($), Z = M((0, t.concatBytes)(J, _, F, c(0, 1), te));
|
|
3505
3505
|
P[0] = M((0, t.concatBytes)(Z, c(1, 1), te));
|
|
3506
3506
|
for (let q = 1; q <= $; q++) {
|
|
3507
3507
|
const k = [s(Z, P[q - 1]), c(q + 1, 1), te];
|
|
@@ -3529,7 +3529,7 @@ function xr() {
|
|
|
3529
3529
|
if (!(0, t.isHash)(S.hash))
|
|
3530
3530
|
throw new Error("expected valid hash");
|
|
3531
3531
|
(0, t.abytes)(_), u(T);
|
|
3532
|
-
const
|
|
3532
|
+
const F = M.toString(2).length, P = Math.ceil((F + Q) / 8), Z = T * D * P;
|
|
3533
3533
|
let H;
|
|
3534
3534
|
if (te === "xmd")
|
|
3535
3535
|
H = h(_, J, Z, $);
|
|
@@ -3543,7 +3543,7 @@ function xr() {
|
|
|
3543
3543
|
for (let k = 0; k < T; k++) {
|
|
3544
3544
|
const ee = new Array(D);
|
|
3545
3545
|
for (let C = 0; C < D; C++) {
|
|
3546
|
-
const
|
|
3546
|
+
const I = P * (C + k * D), m = H.subarray(I, I + P);
|
|
3547
3547
|
ee[C] = (0, r.mod)(i(m), M);
|
|
3548
3548
|
}
|
|
3549
3549
|
q[k] = ee;
|
|
@@ -3553,8 +3553,8 @@ function xr() {
|
|
|
3553
3553
|
function y(_, T) {
|
|
3554
3554
|
const S = T.map((M) => Array.from(M).reverse());
|
|
3555
3555
|
return (M, Q) => {
|
|
3556
|
-
const [D, $, te, J] = S.map((Z) => Z.reduce((H, q) => _.add(_.mul(H, M), q))), [
|
|
3557
|
-
return M = _.mul(D,
|
|
3556
|
+
const [D, $, te, J] = S.map((Z) => Z.reduce((H, q) => _.add(_.mul(H, M), q))), [F, P] = (0, r.FpInvertBatch)(_, [$, J], !0);
|
|
3557
|
+
return M = _.mul(D, F), Q = _.mul(Q, _.mul(te, P)), { x: M, y: Q };
|
|
3558
3558
|
};
|
|
3559
3559
|
}
|
|
3560
3560
|
e._DST_scalar = (0, t.utf8ToBytes)("HashToScalar-");
|
|
@@ -3571,11 +3571,11 @@ function xr() {
|
|
|
3571
3571
|
return {
|
|
3572
3572
|
defaults: S,
|
|
3573
3573
|
hashToCurve(D, $) {
|
|
3574
|
-
const te = Object.assign({}, S, $), J = w(D, 2, te),
|
|
3575
|
-
return Q(
|
|
3574
|
+
const te = Object.assign({}, S, $), J = w(D, 2, te), F = M(J[0]), P = M(J[1]);
|
|
3575
|
+
return Q(F.add(P));
|
|
3576
3576
|
},
|
|
3577
3577
|
encodeToCurve(D, $) {
|
|
3578
|
-
const te = S.encodeDST ? { DST: S.encodeDST } : {}, J = Object.assign({}, S, te, $),
|
|
3578
|
+
const te = S.encodeDST ? { DST: S.encodeDST } : {}, J = Object.assign({}, S, te, $), F = w(D, 1, J), P = M(F[0]);
|
|
3579
3579
|
return Q(P);
|
|
3580
3580
|
},
|
|
3581
3581
|
/** See {@link H2CHasher} */
|
|
@@ -3598,11 +3598,11 @@ function xr() {
|
|
|
3598
3598
|
})(Pt)), Pt;
|
|
3599
3599
|
}
|
|
3600
3600
|
var En;
|
|
3601
|
-
function
|
|
3601
|
+
function vr() {
|
|
3602
3602
|
return En || (En = 1, (function(e) {
|
|
3603
3603
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.encodeToCurve = e.hashToCurve = e.secp256k1_hasher = e.schnorr = e.secp256k1 = void 0;
|
|
3604
3604
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
3605
|
-
const t = /* @__PURE__ */
|
|
3605
|
+
const t = /* @__PURE__ */ br(), r = /* @__PURE__ */ tt(), i = /* @__PURE__ */ xr(), c = /* @__PURE__ */ _r(), s = /* @__PURE__ */ dt(), u = /* @__PURE__ */ Pn(), a = /* @__PURE__ */ st(), h = {
|
|
3606
3606
|
p: BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),
|
|
3607
3607
|
n: BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),
|
|
3608
3608
|
h: BigInt(1),
|
|
@@ -3618,7 +3618,7 @@ function _r() {
|
|
|
3618
3618
|
]
|
|
3619
3619
|
}, w = /* @__PURE__ */ BigInt(0), y = /* @__PURE__ */ BigInt(1), B = /* @__PURE__ */ BigInt(2);
|
|
3620
3620
|
function _(C) {
|
|
3621
|
-
const
|
|
3621
|
+
const I = h.p, m = BigInt(3), N = BigInt(6), x = BigInt(11), p = BigInt(22), E = BigInt(23), U = BigInt(44), g = BigInt(88), v = C * C * C % I, R = v * v * C % I, V = (0, s.pow2)(R, m, I) * R % I, Y = (0, s.pow2)(V, m, I) * R % I, ne = (0, s.pow2)(Y, B, I) * v % I, ie = (0, s.pow2)(ne, x, I) * ne % I, z = (0, s.pow2)(ie, p, I) * ie % I, X = (0, s.pow2)(z, U, I) * z % I, re = (0, s.pow2)(X, g, I) * X % I, le = (0, s.pow2)(re, U, I) * z % I, ce = (0, s.pow2)(le, m, I) * R % I, j = (0, s.pow2)(ce, E, I) * ie % I, oe = (0, s.pow2)(j, N, I) * v % I, ye = (0, s.pow2)(oe, B, I);
|
|
3622
3622
|
if (!T.eql(T.sqr(ye), C))
|
|
3623
3623
|
throw new Error("Cannot find square root");
|
|
3624
3624
|
return ye;
|
|
@@ -3626,49 +3626,49 @@ function _r() {
|
|
|
3626
3626
|
const T = (0, s.Field)(h.p, { sqrt: _ });
|
|
3627
3627
|
e.secp256k1 = (0, i.createCurve)({ ...h, Fp: T, lowS: !0, endo: d }, t.sha256);
|
|
3628
3628
|
const S = {};
|
|
3629
|
-
function M(C, ...
|
|
3629
|
+
function M(C, ...I) {
|
|
3630
3630
|
let m = S[C];
|
|
3631
3631
|
if (m === void 0) {
|
|
3632
3632
|
const N = (0, t.sha256)((0, a.utf8ToBytes)(C));
|
|
3633
3633
|
m = (0, a.concatBytes)(N, N), S[C] = m;
|
|
3634
3634
|
}
|
|
3635
|
-
return (0, t.sha256)((0, a.concatBytes)(m, ...
|
|
3635
|
+
return (0, t.sha256)((0, a.concatBytes)(m, ...I));
|
|
3636
3636
|
}
|
|
3637
3637
|
const Q = (C) => C.toBytes(!0).slice(1), D = e.secp256k1.Point, $ = (C) => C % B === w;
|
|
3638
3638
|
function te(C) {
|
|
3639
|
-
const { Fn:
|
|
3640
|
-
return { scalar: $(x.y) ? N :
|
|
3639
|
+
const { Fn: I, BASE: m } = D, N = (0, u._normFnElement)(I, C), x = m.multiply(N);
|
|
3640
|
+
return { scalar: $(x.y) ? N : I.neg(N), bytes: Q(x) };
|
|
3641
3641
|
}
|
|
3642
3642
|
function J(C) {
|
|
3643
|
-
const
|
|
3644
|
-
if (!
|
|
3643
|
+
const I = T;
|
|
3644
|
+
if (!I.isValidNot0(C))
|
|
3645
3645
|
throw new Error("invalid x: Fail if x ≥ p");
|
|
3646
|
-
const m =
|
|
3647
|
-
let x =
|
|
3648
|
-
$(x) || (x =
|
|
3646
|
+
const m = I.create(C * C), N = I.create(m * C + BigInt(7));
|
|
3647
|
+
let x = I.sqrt(N);
|
|
3648
|
+
$(x) || (x = I.neg(x));
|
|
3649
3649
|
const p = D.fromAffine({ x: C, y: x });
|
|
3650
3650
|
return p.assertValidity(), p;
|
|
3651
3651
|
}
|
|
3652
|
-
const
|
|
3652
|
+
const F = a.bytesToNumberBE;
|
|
3653
3653
|
function P(...C) {
|
|
3654
|
-
return D.Fn.create(
|
|
3654
|
+
return D.Fn.create(F(M("BIP0340/challenge", ...C)));
|
|
3655
3655
|
}
|
|
3656
3656
|
function Z(C) {
|
|
3657
3657
|
return te(C).bytes;
|
|
3658
3658
|
}
|
|
3659
|
-
function H(C,
|
|
3660
|
-
const { Fn: N } = D, x = (0, a.ensureBytes)("message", C), { bytes: p, scalar: E } = te(
|
|
3659
|
+
function H(C, I, m = (0, r.randomBytes)(32)) {
|
|
3660
|
+
const { Fn: N } = D, x = (0, a.ensureBytes)("message", C), { bytes: p, scalar: E } = te(I), U = (0, a.ensureBytes)("auxRand", m, 32), g = N.toBytes(E ^ F(M("BIP0340/aux", U))), v = M("BIP0340/nonce", g, p, x), { bytes: R, scalar: V } = te(v), Y = P(R, p, x), ne = new Uint8Array(64);
|
|
3661
3661
|
if (ne.set(R, 0), ne.set(N.toBytes(N.create(V + Y * E)), 32), !q(ne, x, p))
|
|
3662
3662
|
throw new Error("sign: Invalid signature produced");
|
|
3663
3663
|
return ne;
|
|
3664
3664
|
}
|
|
3665
|
-
function q(C,
|
|
3666
|
-
const { Fn: N, BASE: x } = D, p = (0, a.ensureBytes)("signature", C, 64), E = (0, a.ensureBytes)("message",
|
|
3665
|
+
function q(C, I, m) {
|
|
3666
|
+
const { Fn: N, BASE: x } = D, p = (0, a.ensureBytes)("signature", C, 64), E = (0, a.ensureBytes)("message", I), U = (0, a.ensureBytes)("publicKey", m, 32);
|
|
3667
3667
|
try {
|
|
3668
|
-
const g = J(
|
|
3668
|
+
const g = J(F(U)), v = F(p.subarray(0, 32));
|
|
3669
3669
|
if (!(0, a.inRange)(v, y, h.p))
|
|
3670
3670
|
return !1;
|
|
3671
|
-
const R =
|
|
3671
|
+
const R = F(p.subarray(32, 64));
|
|
3672
3672
|
if (!(0, a.inRange)(R, y, h.n))
|
|
3673
3673
|
return !1;
|
|
3674
3674
|
const V = P(N.toBytes(v), Q(g), E), Y = x.multiplyUnsafe(R).add(g.multiplyUnsafe(N.neg(V))), { x: ne, y: ie } = Y.toAffine();
|
|
@@ -3740,14 +3740,14 @@ function _r() {
|
|
|
3740
3740
|
"0x0000000000000000000000000000000000000000000000000000000000000001"
|
|
3741
3741
|
// LAST 1
|
|
3742
3742
|
]
|
|
3743
|
-
].map((C) => C.map((
|
|
3743
|
+
].map((C) => C.map((I) => BigInt(I)))), ee = (0, u.mapToCurveSimpleSWU)(T, {
|
|
3744
3744
|
A: BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),
|
|
3745
3745
|
B: BigInt("1771"),
|
|
3746
3746
|
Z: T.create(BigInt("-11"))
|
|
3747
3747
|
});
|
|
3748
3748
|
e.secp256k1_hasher = (0, c.createHasher)(e.secp256k1.Point, (C) => {
|
|
3749
|
-
const { x:
|
|
3750
|
-
return k(
|
|
3749
|
+
const { x: I, y: m } = ee(T.create(C[0]));
|
|
3750
|
+
return k(I, m);
|
|
3751
3751
|
}, {
|
|
3752
3752
|
DST: "secp256k1_XMD:SHA-256_SSWU_RO_",
|
|
3753
3753
|
encodeDST: "secp256k1_XMD:SHA-256_SSWU_NU_",
|
|
@@ -3760,17 +3760,17 @@ function _r() {
|
|
|
3760
3760
|
})(Ht)), Ht;
|
|
3761
3761
|
}
|
|
3762
3762
|
var se = {}, Bn;
|
|
3763
|
-
function
|
|
3763
|
+
function Ar() {
|
|
3764
3764
|
if (Bn) return se;
|
|
3765
3765
|
Bn = 1, Object.defineProperty(se, "__esModule", { value: !0 }), se.isHash = se.validateObject = se.memoized = se.notImplemented = se.createHmacDrbg = se.bitMask = se.bitSet = se.bitGet = se.bitLen = se.aInRange = se.inRange = se.asciiToBytes = se.copyBytes = se.equalBytes = se.ensureBytes = se.numberToVarBytesBE = se.numberToBytesLE = se.numberToBytesBE = se.bytesToNumberLE = se.bytesToNumberBE = se.hexToNumber = se.numberToHexUnpadded = se.abool = se.utf8ToBytes = se.randomBytes = se.isBytes = se.hexToBytes = se.concatBytes = se.bytesToUtf8 = se.bytesToHex = se.anumber = se.abytes = void 0;
|
|
3766
3766
|
const e = /* @__PURE__ */ st();
|
|
3767
3767
|
return se.abytes = e.abytes, se.anumber = e.anumber, se.bytesToHex = e.bytesToHex, se.bytesToUtf8 = e.bytesToUtf8, se.concatBytes = e.concatBytes, se.hexToBytes = e.hexToBytes, se.isBytes = e.isBytes, se.randomBytes = e.randomBytes, se.utf8ToBytes = e.utf8ToBytes, se.abool = e.abool, se.numberToHexUnpadded = e.numberToHexUnpadded, se.hexToNumber = e.hexToNumber, se.bytesToNumberBE = e.bytesToNumberBE, se.bytesToNumberLE = e.bytesToNumberLE, se.numberToBytesBE = e.numberToBytesBE, se.numberToBytesLE = e.numberToBytesLE, se.numberToVarBytesBE = e.numberToVarBytesBE, se.ensureBytes = e.ensureBytes, se.equalBytes = e.equalBytes, se.copyBytes = e.copyBytes, se.asciiToBytes = e.asciiToBytes, se.inRange = e.inRange, se.aInRange = e.aInRange, se.bitLen = e.bitLen, se.bitGet = e.bitGet, se.bitSet = e.bitSet, se.bitMask = e.bitMask, se.createHmacDrbg = e.createHmacDrbg, se.notImplemented = e.notImplemented, se.memoized = e.memoized, se.validateObject = e.validateObject, se.isHash = e.isHash, se;
|
|
3768
3768
|
}
|
|
3769
3769
|
var xn;
|
|
3770
|
-
function
|
|
3770
|
+
function Tr() {
|
|
3771
3771
|
if (xn) return Ae;
|
|
3772
3772
|
xn = 1;
|
|
3773
|
-
var e = /* @__PURE__ */
|
|
3773
|
+
var e = /* @__PURE__ */ vr(), t = /* @__PURE__ */ dt(), r = /* @__PURE__ */ Ar();
|
|
3774
3774
|
function i(n) {
|
|
3775
3775
|
var o = /* @__PURE__ */ Object.create(null);
|
|
3776
3776
|
return n && Object.keys(n).forEach(function(l) {
|
|
@@ -3853,7 +3853,7 @@ function Ar() {
|
|
|
3853
3853
|
186,
|
|
3854
3854
|
238
|
|
3855
3855
|
]), J = BigInt(1);
|
|
3856
|
-
function
|
|
3856
|
+
function F(n) {
|
|
3857
3857
|
return n instanceof Uint8Array;
|
|
3858
3858
|
}
|
|
3859
3859
|
function P(n, o) {
|
|
@@ -3872,7 +3872,7 @@ function Ar() {
|
|
|
3872
3872
|
return n instanceof Uint8Array && n.length === 64 && P(n.subarray(0, 32), Q) < 0 && P(n.subarray(32, 64), Q) < 0;
|
|
3873
3873
|
}
|
|
3874
3874
|
function k(n) {
|
|
3875
|
-
return
|
|
3875
|
+
return F(n) && n.length === 64 && P(n.subarray(0, 32), te) < 0;
|
|
3876
3876
|
}
|
|
3877
3877
|
function ee(n) {
|
|
3878
3878
|
return !(Z(n.subarray(0, 32)) || Z(n.subarray(32, 64)));
|
|
@@ -3880,7 +3880,7 @@ function Ar() {
|
|
|
3880
3880
|
function C(n) {
|
|
3881
3881
|
return n instanceof Uint8Array && n.length === S;
|
|
3882
3882
|
}
|
|
3883
|
-
function
|
|
3883
|
+
function I(n) {
|
|
3884
3884
|
return n === void 0 || n instanceof Uint8Array && n.length === D;
|
|
3885
3885
|
}
|
|
3886
3886
|
function m(n) {
|
|
@@ -4044,7 +4044,7 @@ function Ar() {
|
|
|
4044
4044
|
throw new Error(a);
|
|
4045
4045
|
if (!C(n))
|
|
4046
4046
|
throw new Error(_);
|
|
4047
|
-
if (!
|
|
4047
|
+
if (!I(l))
|
|
4048
4048
|
throw new Error(B);
|
|
4049
4049
|
return e.secp256k1.sign(n, o, { extraEntropy: l }).toCompactRawBytes();
|
|
4050
4050
|
}
|
|
@@ -4053,7 +4053,7 @@ function Ar() {
|
|
|
4053
4053
|
throw new Error(a);
|
|
4054
4054
|
if (!C(n))
|
|
4055
4055
|
throw new Error(_);
|
|
4056
|
-
if (!
|
|
4056
|
+
if (!I(l))
|
|
4057
4057
|
throw new Error(B);
|
|
4058
4058
|
const b = e.secp256k1.sign(n, o, { extraEntropy: l });
|
|
4059
4059
|
return {
|
|
@@ -4066,7 +4066,7 @@ function Ar() {
|
|
|
4066
4066
|
throw new Error(a);
|
|
4067
4067
|
if (!C(n))
|
|
4068
4068
|
throw new Error(_);
|
|
4069
|
-
if (!
|
|
4069
|
+
if (!I(l))
|
|
4070
4070
|
throw new Error(B);
|
|
4071
4071
|
return e.schnorr.sign(n, o, l);
|
|
4072
4072
|
}
|
|
@@ -4103,20 +4103,20 @@ function Ar() {
|
|
|
4103
4103
|
}
|
|
4104
4104
|
return Ae.isPoint = ie, Ae.isPointCompressed = z, Ae.isPrivate = X, Ae.isXOnlyPoint = re, Ae.pointAdd = Ne, Ae.pointAddScalar = Ue, Ae.pointCompress = ye, Ae.pointFromScalar = j, Ae.pointMultiply = _e, Ae.privateAdd = qe, Ae.privateNegate = je, Ae.privateSub = be, Ae.recover = W, Ae.sign = Re, Ae.signRecoverable = Ee, Ae.signSchnorr = L, Ae.verify = K, Ae.verifySchnorr = f, Ae.xOnlyPointAddTweak = le, Ae.xOnlyPointFromPoint = ce, Ae.xOnlyPointFromScalar = oe, Ae;
|
|
4105
4105
|
}
|
|
4106
|
-
var kn =
|
|
4107
|
-
const
|
|
4106
|
+
var kn = Tr();
|
|
4107
|
+
const Sr = /* @__PURE__ */ Cn(kn), Nr = /* @__PURE__ */ ar({
|
|
4108
4108
|
__proto__: null,
|
|
4109
|
-
default:
|
|
4109
|
+
default: Sr
|
|
4110
4110
|
}, [kn]);
|
|
4111
|
-
Ze.initEccLib(
|
|
4111
|
+
Ze.initEccLib(Nr);
|
|
4112
4112
|
const Et = {
|
|
4113
4113
|
Mainnet: "mainnet",
|
|
4114
4114
|
Testnet: "testnet"
|
|
4115
4115
|
};
|
|
4116
|
-
class
|
|
4116
|
+
class Rr {
|
|
4117
4117
|
axios;
|
|
4118
4118
|
constructor(t) {
|
|
4119
|
-
this.axios =
|
|
4119
|
+
this.axios = Dn.create({
|
|
4120
4120
|
baseURL: t.baseUrl,
|
|
4121
4121
|
headers: {
|
|
4122
4122
|
Accept: "application/json",
|
|
@@ -4146,7 +4146,7 @@ class Nr {
|
|
|
4146
4146
|
).then((s) => s.data);
|
|
4147
4147
|
}
|
|
4148
4148
|
}
|
|
4149
|
-
function
|
|
4149
|
+
function In(e) {
|
|
4150
4150
|
if (e.length % 2 !== 0)
|
|
4151
4151
|
throw new Error("Hex string must have even length");
|
|
4152
4152
|
const t = new Uint8Array(e.length / 2);
|
|
@@ -4194,7 +4194,7 @@ const eo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4194
4194
|
bytesToHex: Vt,
|
|
4195
4195
|
getAddressType: ft,
|
|
4196
4196
|
getScriptByAddress: Mt,
|
|
4197
|
-
hexToBytes:
|
|
4197
|
+
hexToBytes: In,
|
|
4198
4198
|
toBitcoinNetwork: zt
|
|
4199
4199
|
}, Symbol.toStringTag, { value: "Module" })), Hr = "kqs64-paaaa-aaaar-qamza-cai", Ur = "hvyp5-5yaaa-aaaao-qjxha-cai", gt = BigInt(546), wt = "0:0", Or = "https://runescan-hasura-mainnet.omnity.network/v1/graphql", qr = "https://runescan-hasura-testnet.omnity.network/v1/graphql";
|
|
4200
4200
|
class Cr {
|
|
@@ -4225,8 +4225,8 @@ class Cr {
|
|
|
4225
4225
|
hash: t.txid,
|
|
4226
4226
|
index: t.vout,
|
|
4227
4227
|
witnessUtxo: {
|
|
4228
|
-
value:
|
|
4229
|
-
script:
|
|
4228
|
+
value: BigInt(t.satoshis),
|
|
4229
|
+
script: In(t.scriptPk)
|
|
4230
4230
|
}
|
|
4231
4231
|
}), this.inputAddressTypes.push(ft(r)), this.inputUtxos.push(t), (r === this.config.address || r === this.config.paymentAddress) && t.runes.length !== 0 && (this.userInputUtxoDusts += BigInt(t.satoshis));
|
|
4232
4232
|
}
|
|
@@ -4238,7 +4238,7 @@ class Cr {
|
|
|
4238
4238
|
addOutput(t, r) {
|
|
4239
4239
|
this.psbt.addOutput({
|
|
4240
4240
|
address: t,
|
|
4241
|
-
value:
|
|
4241
|
+
value: r
|
|
4242
4242
|
}), this.outputAddressTypes.push(ft(t));
|
|
4243
4243
|
}
|
|
4244
4244
|
/**
|
|
@@ -4248,7 +4248,7 @@ class Cr {
|
|
|
4248
4248
|
addScriptOutput(t) {
|
|
4249
4249
|
this.psbt.addOutput({
|
|
4250
4250
|
script: t,
|
|
4251
|
-
value: 0
|
|
4251
|
+
value: BigInt(0)
|
|
4252
4252
|
}), this.outputAddressTypes.push({ OpReturn: BigInt(t.length) });
|
|
4253
4253
|
}
|
|
4254
4254
|
/**
|
|
@@ -4343,7 +4343,7 @@ class Cr {
|
|
|
4343
4343
|
throw new Error("Insufficient UTXO(s)");
|
|
4344
4344
|
B > gt ? this.psbt.addOutput({
|
|
4345
4345
|
address: i,
|
|
4346
|
-
value:
|
|
4346
|
+
value: B
|
|
4347
4347
|
}) : B > BigInt(0) && (d = B), this.txFee = d + u;
|
|
4348
4348
|
}
|
|
4349
4349
|
/**
|
|
@@ -4429,7 +4429,7 @@ class Cr {
|
|
|
4429
4429
|
const u = Array.from(c), a = [], h = [];
|
|
4430
4430
|
let d = 1;
|
|
4431
4431
|
u.forEach((y) => {
|
|
4432
|
-
const B = new
|
|
4432
|
+
const B = new er(
|
|
4433
4433
|
Number(y.split(":")[0]),
|
|
4434
4434
|
Number(y.split(":")[1])
|
|
4435
4435
|
), _ = t[y] ?? BigInt(0);
|
|
@@ -4438,8 +4438,8 @@ class Cr {
|
|
|
4438
4438
|
S > BigInt(0) && (a.push(new tn(B, S, d)), h.push(T), d++);
|
|
4439
4439
|
});
|
|
4440
4440
|
}), console.log("edicts", a);
|
|
4441
|
-
const w = new
|
|
4442
|
-
return this.addScriptOutput(w.encipher()), h.forEach((y) => {
|
|
4441
|
+
const w = new tr(a, St(), St(), St());
|
|
4442
|
+
return this.addScriptOutput(new Uint8Array(w.encipher())), h.forEach((y) => {
|
|
4443
4443
|
let B = gt;
|
|
4444
4444
|
!i[y] || y === this.config.address ? this.additionalDustNeeded += gt : (B = i[y], delete i[y]), this.addOutput(y, B);
|
|
4445
4445
|
}), i;
|
|
@@ -4600,13 +4600,13 @@ const _n = (e) => e.toUpperCase(), kt = (e) => typeof e == "function" ? e() : e,
|
|
|
4600
4600
|
}, kr = (e) => {
|
|
4601
4601
|
try {
|
|
4602
4602
|
const t = e();
|
|
4603
|
-
return
|
|
4603
|
+
return Ir(t) ? t.catch((r) => vn(r)) : t;
|
|
4604
4604
|
} catch (t) {
|
|
4605
4605
|
return vn(t);
|
|
4606
4606
|
}
|
|
4607
|
-
}, vn = (e) => e instanceof Error ? e : new Error(String(e)),
|
|
4607
|
+
}, vn = (e) => e instanceof Error ? e : new Error(String(e)), Ir = (e) => typeof e == "object" && e !== null && "then" in e && typeof e.then == "function" && "catch" in e && typeof e.catch == "function" && "finally" in e && typeof e.finally == "function", Xt = (e) => {
|
|
4608
4608
|
throw new Error(`Unhandled case: ${String(e)}`);
|
|
4609
|
-
}, mt = (e) => typeof e == "object" && e !== null && !Array.isArray(e),
|
|
4609
|
+
}, mt = (e) => typeof e == "object" && e !== null && !Array.isArray(e), Fr = (e, t) => e.documents ? e : {
|
|
4610
4610
|
documents: e,
|
|
4611
4611
|
requestHeaders: t,
|
|
4612
4612
|
signal: void 0
|
|
@@ -4615,9 +4615,9 @@ const _n = (e) => e.toUpperCase(), kt = (e) => typeof e == "function" ? e() : e,
|
|
|
4615
4615
|
variables: t,
|
|
4616
4616
|
requestHeaders: r,
|
|
4617
4617
|
signal: void 0
|
|
4618
|
-
}, An = "Accept", jt = "Content-Type", $t = "application/json",
|
|
4618
|
+
}, An = "Accept", jt = "Content-Type", $t = "application/json", Vn = "application/graphql-response+json", Tn = (e) => e.replace(/([\s,]|#[^\n\r]+)+/g, " ").trim(), Mr = (e) => {
|
|
4619
4619
|
const t = e.toLowerCase();
|
|
4620
|
-
return t.includes(
|
|
4620
|
+
return t.includes(Vn) || t.includes($t);
|
|
4621
4621
|
}, Sn = (e) => {
|
|
4622
4622
|
try {
|
|
4623
4623
|
if (Array.isArray(e))
|
|
@@ -4660,22 +4660,22 @@ ${String(e)}`);
|
|
|
4660
4660
|
errors: t,
|
|
4661
4661
|
extensions: i
|
|
4662
4662
|
};
|
|
4663
|
-
}, jr = (e) => e._tag === "Batch" ? e.executionResults.some(Rn) : Rn(e.executionResult), Rn = (e) => Array.isArray(e.errors) ? e.errors.length > 0 : !!e.errors,
|
|
4663
|
+
}, jr = (e) => e._tag === "Batch" ? e.executionResults.some(Rn) : Rn(e.executionResult), Rn = (e) => Array.isArray(e.errors) ? e.errors.length > 0 : !!e.errors, Mn = (e) => typeof e == "object" && e !== null && "kind" in e && e.kind === nr.OPERATION_DEFINITION, $r = (e) => {
|
|
4664
4664
|
let t;
|
|
4665
|
-
const r = e.definitions.filter(
|
|
4665
|
+
const r = e.definitions.filter(Mn);
|
|
4666
4666
|
return r.length === 1 && (t = r[0].name?.value), t;
|
|
4667
4667
|
}, Zr = (e) => {
|
|
4668
4668
|
let t = !1;
|
|
4669
|
-
const r = e.definitions.filter(
|
|
4669
|
+
const r = e.definitions.filter(Mn);
|
|
4670
4670
|
return r.length === 1 && (t = r[0].operation === "mutation"), t;
|
|
4671
|
-
},
|
|
4672
|
-
const r = typeof e == "string" ? e :
|
|
4671
|
+
}, It = (e, t) => {
|
|
4672
|
+
const r = typeof e == "string" ? e : rr(e);
|
|
4673
4673
|
let i = !1, c;
|
|
4674
4674
|
if (t)
|
|
4675
4675
|
return { expression: r, isMutation: i, operationName: c };
|
|
4676
|
-
const s = kr(() => typeof e == "string" ?
|
|
4676
|
+
const s = kr(() => typeof e == "string" ? ir(e) : e);
|
|
4677
4677
|
return s instanceof Error ? { expression: r, isMutation: i, operationName: c } : (c = $r(s), i = Zr(s), { expression: r, operationName: c, isMutation: i });
|
|
4678
|
-
}, Yt = JSON,
|
|
4678
|
+
}, Yt = JSON, Ft = async (e) => {
|
|
4679
4679
|
const t = {
|
|
4680
4680
|
...e,
|
|
4681
4681
|
method: e.request._tag === "Single" ? e.request.document.isMutation ? "POST" : _n(e.method ?? "post") : e.request.hasMutations ? "POST" : _n(e.method ?? "post"),
|
|
@@ -4730,7 +4730,7 @@ ${String(e)}`);
|
|
|
4730
4730
|
}, Wr = (e) => async (t) => {
|
|
4731
4731
|
const r = new Headers(t.headers);
|
|
4732
4732
|
let i = null, c;
|
|
4733
|
-
r.has(An) || r.set(An, [
|
|
4733
|
+
r.has(An) || r.set(An, [Vn, $t].join(", ")), e === "POST" ? (c = (t.fetchOptions.jsonSerializer ?? Yt).stringify(Gr(t)), typeof c == "string" && !r.has(jt) && r.set(jt, $t)) : i = zr(t);
|
|
4734
4734
|
const s = { method: e, headers: r, body: c, ...t.fetchOptions };
|
|
4735
4735
|
let u = new URL(t.url), a = s;
|
|
4736
4736
|
if (t.middleware) {
|
|
@@ -4789,7 +4789,7 @@ class Xr {
|
|
|
4789
4789
|
rawRequest = async (...t) => {
|
|
4790
4790
|
const [r, i, c] = t, s = Vr(r, i, c), { headers: u, fetch: a = globalThis.fetch, method: h = "POST", requestMiddleware: d, responseMiddleware: w, excludeOperationName: y, ...B } = this.requestConfig, { url: _ } = this;
|
|
4791
4791
|
s.signal !== void 0 && (B.signal = s.signal);
|
|
4792
|
-
const T =
|
|
4792
|
+
const T = It(s.query, y), S = await Ft({
|
|
4793
4793
|
url: _,
|
|
4794
4794
|
request: {
|
|
4795
4795
|
_tag: "Single",
|
|
@@ -4816,7 +4816,7 @@ class Xr {
|
|
|
4816
4816
|
async request(t, ...r) {
|
|
4817
4817
|
const [i, c] = r, s = Yr(t, i, c), { headers: u, fetch: a = globalThis.fetch, method: h = "POST", requestMiddleware: d, responseMiddleware: w, excludeOperationName: y, ...B } = this.requestConfig, { url: _ } = this;
|
|
4818
4818
|
s.signal !== void 0 && (B.signal = s.signal);
|
|
4819
|
-
const T =
|
|
4819
|
+
const T = It(s.document, y), S = await Ft({
|
|
4820
4820
|
url: _,
|
|
4821
4821
|
request: {
|
|
4822
4822
|
_tag: "Single",
|
|
@@ -4841,9 +4841,9 @@ class Xr {
|
|
|
4841
4841
|
return S.data;
|
|
4842
4842
|
}
|
|
4843
4843
|
async batchRequests(t, r) {
|
|
4844
|
-
const i =
|
|
4844
|
+
const i = Fr(t, r), { headers: c, excludeOperationName: s, ...u } = this.requestConfig;
|
|
4845
4845
|
i.signal !== void 0 && (u.signal = i.signal);
|
|
4846
|
-
const a = i.documents.map(({ document: B }) =>
|
|
4846
|
+
const a = i.documents.map(({ document: B }) => It(B, s)), h = a.map(({ expression: B }) => B), d = a.some(({ isMutation: B }) => B), w = i.documents.map(({ variables: B }) => B), y = await Ft({
|
|
4847
4847
|
url: this.url,
|
|
4848
4848
|
request: {
|
|
4849
4849
|
_tag: "Batch",
|
|
@@ -4957,7 +4957,7 @@ var rt = 9e15, Le = 1e9, Zt = "0123456789abcdef", Bt = "2.3025850929940456840179
|
|
|
4957
4957
|
// Whether to use cryptographically-secure random number generation, if available.
|
|
4958
4958
|
crypto: !1
|
|
4959
4959
|
// true/false
|
|
4960
|
-
},
|
|
4960
|
+
}, jn, Xe, ge = !0, vt = "[DecimalError] ", Je = vt + "Invalid argument: ", $n = vt + "Precision limit exceeded", Zn = vt + "crypto unavailable", Kn = "[object Decimal]", ke = Math.floor, He = Math.pow, Jr = /^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i, Lr = /^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i, Dr = /^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i, Wn = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i, $e = 1e7, de = 7, ei = 9007199254740991, ti = Bt.length - 1, Wt = xt.length - 1, G = { toStringTag: Kn };
|
|
4961
4961
|
G.absoluteValue = G.abs = function() {
|
|
4962
4962
|
var e = new this.constructor(this);
|
|
4963
4963
|
return e.s < 0 && (e.s = 1), fe(e);
|
|
@@ -4984,7 +4984,7 @@ G.comparedTo = G.cmp = function(e) {
|
|
|
4984
4984
|
};
|
|
4985
4985
|
G.cosine = G.cos = function() {
|
|
4986
4986
|
var e, t, r = this, i = r.constructor;
|
|
4987
|
-
return r.d ? r.d[0] ? (e = i.precision, t = i.rounding, i.precision = e + Math.max(r.e, r.sd()) + de, i.rounding = 1, r = ni(i,
|
|
4987
|
+
return r.d ? r.d[0] ? (e = i.precision, t = i.rounding, i.precision = e + Math.max(r.e, r.sd()) + de, i.rounding = 1, r = ni(i, Qn(i, r)), i.precision = e, i.rounding = t, fe(Xe == 2 || Xe == 3 ? r.neg() : r, e, t, !0)) : new i(1) : new i(NaN);
|
|
4988
4988
|
};
|
|
4989
4989
|
G.cubeRoot = G.cbrt = function() {
|
|
4990
4990
|
var e, t, r, i, c, s, u, a, h, d, w = this, y = w.constructor;
|
|
@@ -5212,7 +5212,7 @@ G.plus = G.add = function(e) {
|
|
|
5212
5212
|
G.precision = G.sd = function(e) {
|
|
5213
5213
|
var t, r = this;
|
|
5214
5214
|
if (e !== void 0 && e !== !!e && e !== 1 && e !== 0) throw Error(Je + e);
|
|
5215
|
-
return r.d ? (t =
|
|
5215
|
+
return r.d ? (t = Gn(r.d), e && r.e + 1 > t && (t = r.e + 1)) : t = NaN, t;
|
|
5216
5216
|
};
|
|
5217
5217
|
G.round = function() {
|
|
5218
5218
|
var e = this, t = e.constructor;
|
|
@@ -5220,7 +5220,7 @@ G.round = function() {
|
|
|
5220
5220
|
};
|
|
5221
5221
|
G.sine = G.sin = function() {
|
|
5222
5222
|
var e, t, r = this, i = r.constructor;
|
|
5223
|
-
return r.isFinite() ? r.isZero() ? new i(r) : (e = i.precision, t = i.rounding, i.precision = e + Math.max(r.e, r.sd()) + de, i.rounding = 1, r = ii(i,
|
|
5223
|
+
return r.isFinite() ? r.isZero() ? new i(r) : (e = i.precision, t = i.rounding, i.precision = e + Math.max(r.e, r.sd()) + de, i.rounding = 1, r = ii(i, Qn(i, r)), i.precision = e, i.rounding = t, fe(Xe > 2 ? r.neg() : r, e, t, !0)) : new i(NaN);
|
|
5224
5224
|
};
|
|
5225
5225
|
G.squareRoot = G.sqrt = function() {
|
|
5226
5226
|
var e, t, r, i, c, s, u = this, a = u.d, h = u.e, d = u.s, w = u.constructor;
|
|
@@ -5262,20 +5262,20 @@ G.toBinary = function(e, t) {
|
|
|
5262
5262
|
};
|
|
5263
5263
|
G.toDecimalPlaces = G.toDP = function(e, t) {
|
|
5264
5264
|
var r = this, i = r.constructor;
|
|
5265
|
-
return r = new i(r), e === void 0 ? r : (
|
|
5265
|
+
return r = new i(r), e === void 0 ? r : (Fe(e, 0, Le), t === void 0 ? t = i.rounding : Fe(t, 0, 8), fe(r, e + r.e + 1, t));
|
|
5266
5266
|
};
|
|
5267
5267
|
G.toExponential = function(e, t) {
|
|
5268
5268
|
var r, i = this, c = i.constructor;
|
|
5269
|
-
return e === void 0 ? r = ze(i, !0) : (
|
|
5269
|
+
return e === void 0 ? r = ze(i, !0) : (Fe(e, 0, Le), t === void 0 ? t = c.rounding : Fe(t, 0, 8), i = fe(new c(i), e + 1, t), r = ze(i, !0, e + 1)), i.isNeg() && !i.isZero() ? "-" + r : r;
|
|
5270
5270
|
};
|
|
5271
5271
|
G.toFixed = function(e, t) {
|
|
5272
5272
|
var r, i, c = this, s = c.constructor;
|
|
5273
|
-
return e === void 0 ? r = ze(c) : (
|
|
5273
|
+
return e === void 0 ? r = ze(c) : (Fe(e, 0, Le), t === void 0 ? t = s.rounding : Fe(t, 0, 8), i = fe(new s(c), e + c.e + 1, t), r = ze(i, !1, e + i.e + 1)), c.isNeg() && !c.isZero() ? "-" + r : r;
|
|
5274
5274
|
};
|
|
5275
5275
|
G.toFraction = function(e) {
|
|
5276
5276
|
var t, r, i, c, s, u, a, h, d, w, y, B, _ = this, T = _.d, S = _.constructor;
|
|
5277
5277
|
if (!T) return new S(_);
|
|
5278
|
-
if (d = r = new S(1), i = h = new S(0), t = new S(i), s = t.e =
|
|
5278
|
+
if (d = r = new S(1), i = h = new S(0), t = new S(i), s = t.e = Gn(T) - _.e - 1, u = s % de, t.d[0] = He(10, u < 0 ? de + u : u), e == null)
|
|
5279
5279
|
e = s > 0 ? t : d;
|
|
5280
5280
|
else {
|
|
5281
5281
|
if (a = new S(e), !a.isInt() || a.lt(d)) throw Error(Je + a);
|
|
@@ -5294,7 +5294,7 @@ G.toNearest = function(e, t) {
|
|
|
5294
5294
|
if (!r.d) return r;
|
|
5295
5295
|
e = new i(1), t = i.rounding;
|
|
5296
5296
|
} else {
|
|
5297
|
-
if (e = new i(e), t === void 0 ? t = i.rounding :
|
|
5297
|
+
if (e = new i(e), t === void 0 ? t = i.rounding : Fe(t, 0, 8), !r.d) return e.s ? r : e;
|
|
5298
5298
|
if (!e.d)
|
|
5299
5299
|
return e.s && (e.s = r.s), e;
|
|
5300
5300
|
}
|
|
@@ -5312,7 +5312,7 @@ G.toPower = G.pow = function(e) {
|
|
|
5312
5312
|
if (a = new h(a), a.eq(1)) return a;
|
|
5313
5313
|
if (i = h.precision, s = h.rounding, e.eq(1)) return fe(a, i, s);
|
|
5314
5314
|
if (t = ke(e.e / de), t >= e.d.length - 1 && (r = d < 0 ? -d : d) <= ei)
|
|
5315
|
-
return c =
|
|
5315
|
+
return c = zn(h, a, r, i), e.s < 0 ? new h(1).div(c) : fe(c, i, s);
|
|
5316
5316
|
if (u = a.s, u < 0) {
|
|
5317
5317
|
if (t < e.d.length - 1) return new h(NaN);
|
|
5318
5318
|
if ((e.d[t] & 1) == 0 && (u = 1), a.e == 0 && a.d[0] == 1 && a.d.length == 1)
|
|
@@ -5322,11 +5322,11 @@ G.toPower = G.pow = function(e) {
|
|
|
5322
5322
|
};
|
|
5323
5323
|
G.toPrecision = function(e, t) {
|
|
5324
5324
|
var r, i = this, c = i.constructor;
|
|
5325
|
-
return e === void 0 ? r = ze(i, i.e <= c.toExpNeg || i.e >= c.toExpPos) : (
|
|
5325
|
+
return e === void 0 ? r = ze(i, i.e <= c.toExpNeg || i.e >= c.toExpPos) : (Fe(e, 1, Le), t === void 0 ? t = c.rounding : Fe(t, 0, 8), i = fe(new c(i), e, t), r = ze(i, e <= i.e || i.e <= c.toExpNeg, e)), i.isNeg() && !i.isZero() ? "-" + r : r;
|
|
5326
5326
|
};
|
|
5327
5327
|
G.toSignificantDigits = G.toSD = function(e, t) {
|
|
5328
5328
|
var r = this, i = r.constructor;
|
|
5329
|
-
return e === void 0 ? (e = i.precision, t = i.rounding) : (
|
|
5329
|
+
return e === void 0 ? (e = i.precision, t = i.rounding) : (Fe(e, 1, Le), t === void 0 ? t = i.rounding : Fe(t, 0, 8)), fe(new i(r), e, t);
|
|
5330
5330
|
};
|
|
5331
5331
|
G.toString = function() {
|
|
5332
5332
|
var e = this, t = e.constructor, r = ze(e, e.e <= t.toExpNeg || e.e >= t.toExpPos);
|
|
@@ -5350,7 +5350,7 @@ function Oe(e) {
|
|
|
5350
5350
|
for (; u % 10 === 0; ) u /= 10;
|
|
5351
5351
|
return s + u;
|
|
5352
5352
|
}
|
|
5353
|
-
function
|
|
5353
|
+
function Fe(e, t, r) {
|
|
5354
5354
|
if (e !== ~~e || e < t || e > r)
|
|
5355
5355
|
throw Error(Je + e);
|
|
5356
5356
|
}
|
|
@@ -5402,21 +5402,21 @@ var xe = /* @__PURE__ */ (function() {
|
|
|
5402
5402
|
for (; !i[0] && i.length > 1; ) i.shift();
|
|
5403
5403
|
}
|
|
5404
5404
|
return function(i, c, s, u, a, h) {
|
|
5405
|
-
var d, w, y, B, _, T, S, M, Q, D, $, te, J,
|
|
5405
|
+
var d, w, y, B, _, T, S, M, Q, D, $, te, J, F, P, Z, H, q, k, ee, C = i.constructor, I = i.s == c.s ? 1 : -1, m = i.d, N = c.d;
|
|
5406
5406
|
if (!m || !m[0] || !N || !N[0])
|
|
5407
5407
|
return new C(
|
|
5408
5408
|
// Return NaN if either NaN, or both Infinity or 0.
|
|
5409
5409
|
!i.s || !c.s || (m ? N && m[0] == N[0] : !N) ? NaN : (
|
|
5410
5410
|
// Return ±0 if x is 0 or y is ±Infinity, or return ±Infinity as y is 0.
|
|
5411
|
-
m && m[0] == 0 || !N ?
|
|
5411
|
+
m && m[0] == 0 || !N ? I * 0 : I / 0
|
|
5412
5412
|
)
|
|
5413
5413
|
);
|
|
5414
|
-
for (h ? (_ = 1, w = i.e - c.e) : (h = $e, _ = de, w = ke(i.e / _) - ke(c.e / _)), k = N.length, H = m.length, Q = new C(
|
|
5415
|
-
if (N[y] > (m[y] || 0) && w--, s == null ? (
|
|
5414
|
+
for (h ? (_ = 1, w = i.e - c.e) : (h = $e, _ = de, w = ke(i.e / _) - ke(c.e / _)), k = N.length, H = m.length, Q = new C(I), D = Q.d = [], y = 0; N[y] == (m[y] || 0); y++) ;
|
|
5415
|
+
if (N[y] > (m[y] || 0) && w--, s == null ? (F = s = C.precision, u = C.rounding) : a ? F = s + (i.e - c.e) + 1 : F = s, F < 0)
|
|
5416
5416
|
D.push(1), T = !0;
|
|
5417
5417
|
else {
|
|
5418
|
-
if (
|
|
5419
|
-
for (B = 0, N = N[0],
|
|
5418
|
+
if (F = F / _ + 2 | 0, y = 0, k == 1) {
|
|
5419
|
+
for (B = 0, N = N[0], F++; (y < H || B) && F--; y++)
|
|
5420
5420
|
P = B * h + (m[y] || 0), D[y] = P / N | 0, B = P % N | 0;
|
|
5421
5421
|
T = B || y < H;
|
|
5422
5422
|
} else {
|
|
@@ -5424,13 +5424,13 @@ var xe = /* @__PURE__ */ (function() {
|
|
|
5424
5424
|
ee = N.slice(), ee.unshift(0), q = N[0], N[1] >= h / 2 && ++q;
|
|
5425
5425
|
do
|
|
5426
5426
|
B = 0, d = t(N, $, k, te), d < 0 ? (J = $[0], k != te && (J = J * h + ($[1] || 0)), B = J / q | 0, B > 1 ? (B >= h && (B = h - 1), S = e(N, B, h), M = S.length, te = $.length, d = t(S, $, M, te), d == 1 && (B--, r(S, k < M ? ee : N, M, h))) : (B == 0 && (d = B = 1), S = N.slice()), M = S.length, M < te && S.unshift(0), r($, S, te, h), d == -1 && (te = $.length, d = t(N, $, k, te), d < 1 && (B++, r($, k < te ? ee : N, te, h))), te = $.length) : d === 0 && (B++, $ = [0]), D[y++] = B, d && $[0] ? $[te++] = m[Z] || 0 : ($ = [m[Z]], te = 1);
|
|
5427
|
-
while ((Z++ < H || $[0] !== void 0) &&
|
|
5427
|
+
while ((Z++ < H || $[0] !== void 0) && F--);
|
|
5428
5428
|
T = $[0] !== void 0;
|
|
5429
5429
|
}
|
|
5430
5430
|
D[0] || D.shift();
|
|
5431
5431
|
}
|
|
5432
5432
|
if (_ == 1)
|
|
5433
|
-
Q.e = w,
|
|
5433
|
+
Q.e = w, jn = T;
|
|
5434
5434
|
else {
|
|
5435
5435
|
for (y = 1, B = D[0]; B >= 10; B /= 10) y++;
|
|
5436
5436
|
Q.e = y + w * _ - 1, fe(Q, a ? s + Q.e + 1 : s, u, T);
|
|
@@ -5474,7 +5474,7 @@ function fe(e, t, r, i) {
|
|
|
5474
5474
|
return ge && (e.e > _.maxE ? (e.d = null, e.e = NaN) : e.e < _.minE && (e.e = 0, e.d = [0])), e;
|
|
5475
5475
|
}
|
|
5476
5476
|
function ze(e, t, r) {
|
|
5477
|
-
if (!e.isFinite()) return
|
|
5477
|
+
if (!e.isFinite()) return Yn(e);
|
|
5478
5478
|
var i, c = e.e, s = Oe(e.d), u = s.length;
|
|
5479
5479
|
return t ? (r && (i = r - u) > 0 ? s = s.charAt(0) + "." + s.slice(1) + Ye(i) : u > 1 && (s = s.charAt(0) + "." + s.slice(1)), s = s + (e.e < 0 ? "e" : "e+") + e.e) : c < 0 ? (s = "0." + Ye(-c - 1) + s, r && (i = r - u) > 0 && (s += Ye(i))) : c >= u ? (s += Ye(c + 1 - u), r && (i = r - c - 1) > 0 && (s = s + "." + Ye(i))) : ((i = c + 1) < u && (s = s.slice(0, i) + "." + s.slice(i)), r && (i = r - u) > 0 && (c + 1 === u && (s += "."), s += Ye(i))), s;
|
|
5480
5480
|
}
|
|
@@ -5485,14 +5485,14 @@ function At(e, t) {
|
|
|
5485
5485
|
}
|
|
5486
5486
|
function _t(e, t, r) {
|
|
5487
5487
|
if (t > ti)
|
|
5488
|
-
throw ge = !0, r && (e.precision = r), Error(
|
|
5488
|
+
throw ge = !0, r && (e.precision = r), Error($n);
|
|
5489
5489
|
return fe(new e(Bt), t, 1, !0);
|
|
5490
5490
|
}
|
|
5491
5491
|
function Ke(e, t, r) {
|
|
5492
|
-
if (t > Wt) throw Error(
|
|
5492
|
+
if (t > Wt) throw Error($n);
|
|
5493
5493
|
return fe(new e(xt), t, r, !0);
|
|
5494
5494
|
}
|
|
5495
|
-
function
|
|
5495
|
+
function Gn(e) {
|
|
5496
5496
|
var t = e.length - 1, r = t * de + 1;
|
|
5497
5497
|
if (t = e[t], t) {
|
|
5498
5498
|
for (; t % 10 == 0; t /= 10) r--;
|
|
@@ -5504,7 +5504,7 @@ function Ye(e) {
|
|
|
5504
5504
|
for (var t = ""; e--; ) t += "0";
|
|
5505
5505
|
return t;
|
|
5506
5506
|
}
|
|
5507
|
-
function
|
|
5507
|
+
function zn(e, t, r, i) {
|
|
5508
5508
|
var c, s = new e(1), u = Math.ceil(i / de + 4);
|
|
5509
5509
|
for (ge = !1; ; ) {
|
|
5510
5510
|
if (r % 2 && (s = s.times(t), On(s.d, u) && (c = !0)), r = ke(r / 2), r === 0) {
|
|
@@ -5518,7 +5518,7 @@ function Gn(e, t, r, i) {
|
|
|
5518
5518
|
function Un(e) {
|
|
5519
5519
|
return e.d[e.d.length - 1] & 1;
|
|
5520
5520
|
}
|
|
5521
|
-
function
|
|
5521
|
+
function Xn(e, t, r) {
|
|
5522
5522
|
for (var i, c, s = new e(t[0]), u = 0; ++u < t.length; ) {
|
|
5523
5523
|
if (c = new e(t[u]), !c.s) {
|
|
5524
5524
|
s = c;
|
|
@@ -5570,7 +5570,7 @@ function Qe(e, t) {
|
|
|
5570
5570
|
h = d, c += 2;
|
|
5571
5571
|
}
|
|
5572
5572
|
}
|
|
5573
|
-
function
|
|
5573
|
+
function Yn(e) {
|
|
5574
5574
|
return String(e.s * e.s / 0);
|
|
5575
5575
|
}
|
|
5576
5576
|
function bt(e, t) {
|
|
@@ -5592,7 +5592,7 @@ function bt(e, t) {
|
|
|
5592
5592
|
function ri(e, t) {
|
|
5593
5593
|
var r, i, c, s, u, a, h, d, w;
|
|
5594
5594
|
if (t.indexOf("_") > -1) {
|
|
5595
|
-
if (t = t.replace(/(\d)_(?=\d)/g, "$1"),
|
|
5595
|
+
if (t = t.replace(/(\d)_(?=\d)/g, "$1"), Wn.test(t)) return bt(e, t);
|
|
5596
5596
|
} else if (t === "Infinity" || t === "NaN")
|
|
5597
5597
|
return +t || (e.s = NaN), e.e = NaN, e.d = null, e;
|
|
5598
5598
|
if (Lr.test(t))
|
|
@@ -5603,7 +5603,7 @@ function ri(e, t) {
|
|
|
5603
5603
|
r = 8;
|
|
5604
5604
|
else
|
|
5605
5605
|
throw Error(Je + t);
|
|
5606
|
-
for (s = t.search(/p/i), s > 0 ? (h = +t.slice(s + 1), t = t.substring(2, s)) : t = t.slice(2), s = t.indexOf("."), u = s >= 0, i = e.constructor, u && (t = t.replace(".", ""), a = t.length, s = a - s, c =
|
|
5606
|
+
for (s = t.search(/p/i), s > 0 ? (h = +t.slice(s + 1), t = t.substring(2, s)) : t = t.slice(2), s = t.indexOf("."), u = s >= 0, i = e.constructor, u && (t = t.replace(".", ""), a = t.length, s = a - s, c = zn(i, new i(r), s, s * 2)), d = yt(t, r, $e), w = d.length - 1, s = w; d[s] === 0; --s) d.pop();
|
|
5607
5607
|
return s < 0 ? new i(e.s * 0) : (e.e = At(d, w), e.d = d, ge = !1, u && (e = xe(e, c, a * 4)), h && (e = e.times(Math.abs(h) < 54 ? He(2, h) : et.pow(2, h))), ge = !0, e);
|
|
5608
5608
|
}
|
|
5609
5609
|
function ii(e, t) {
|
|
@@ -5630,7 +5630,7 @@ function Tt(e, t) {
|
|
|
5630
5630
|
for (var r = e; --t; ) r *= e;
|
|
5631
5631
|
return r;
|
|
5632
5632
|
}
|
|
5633
|
-
function
|
|
5633
|
+
function Qn(e, t) {
|
|
5634
5634
|
var r, i = t.s < 0, c = Ke(e, e.precision, 1), s = c.times(0.5);
|
|
5635
5635
|
if (t = t.abs(), t.lte(s))
|
|
5636
5636
|
return Xe = i ? 4 : 1, t;
|
|
@@ -5645,14 +5645,14 @@ function Yn(e, t) {
|
|
|
5645
5645
|
}
|
|
5646
5646
|
function Qt(e, t, r, i) {
|
|
5647
5647
|
var c, s, u, a, h, d, w, y, B, _ = e.constructor, T = r !== void 0;
|
|
5648
|
-
if (T ? (
|
|
5649
|
-
w =
|
|
5648
|
+
if (T ? (Fe(r, 1, Le), i === void 0 ? i = _.rounding : Fe(i, 0, 8)) : (r = _.precision, i = _.rounding), !e.isFinite())
|
|
5649
|
+
w = Yn(e);
|
|
5650
5650
|
else {
|
|
5651
5651
|
for (w = ze(e), u = w.indexOf("."), T ? (c = 2, t == 16 ? r = r * 4 - 3 : t == 8 && (r = r * 3 - 2)) : c = t, u >= 0 && (w = w.replace(".", ""), B = new _(1), B.e = w.length - u, B.d = yt(ze(B), 10, c), B.e = B.d.length), y = yt(w, 10, c), s = h = y.length; y[--h] == 0; ) y.pop();
|
|
5652
5652
|
if (!y[0])
|
|
5653
5653
|
w = T ? "0p+0" : "0";
|
|
5654
5654
|
else {
|
|
5655
|
-
if (u < 0 ? s-- : (e = new _(e), e.d = y, e.e = s, e = xe(e, B, r, i, 0, c), y = e.d, s = e.e, d =
|
|
5655
|
+
if (u < 0 ? s-- : (e = new _(e), e.d = y, e.e = s, e = xe(e, B, r, i, 0, c), y = e.d, s = e.e, d = jn), u = y[r], a = c / 2, d = d || y[r + 1] !== void 0, d = i < 4 ? (u !== void 0 || d) && (i === 0 || i === (e.s < 0 ? 3 : 2)) : u > a || u === a && (i === 4 || d || i === 6 && y[r - 1] & 1 || i === (e.s < 0 ? 8 : 7)), y.length = r, d)
|
|
5656
5656
|
for (; ++y[--r] > c - 1; )
|
|
5657
5657
|
y[r] = 0, r || (++s, y.unshift(1));
|
|
5658
5658
|
for (h = y.length; !y[h - 1]; --h) ;
|
|
@@ -5753,7 +5753,7 @@ function mi(e) {
|
|
|
5753
5753
|
if (typeof crypto < "u" && crypto && (crypto.getRandomValues || crypto.randomBytes))
|
|
5754
5754
|
this[r] = !0;
|
|
5755
5755
|
else
|
|
5756
|
-
throw Error(
|
|
5756
|
+
throw Error(Zn);
|
|
5757
5757
|
else
|
|
5758
5758
|
this[r] = !1;
|
|
5759
5759
|
else
|
|
@@ -5766,7 +5766,7 @@ function yi(e) {
|
|
|
5766
5766
|
function bi(e) {
|
|
5767
5767
|
return new this(e).cosh();
|
|
5768
5768
|
}
|
|
5769
|
-
function
|
|
5769
|
+
function Jn(e) {
|
|
5770
5770
|
var t, r, i;
|
|
5771
5771
|
function c(s) {
|
|
5772
5772
|
var u, a, h, d = this;
|
|
@@ -5792,12 +5792,12 @@ function Qn(e) {
|
|
|
5792
5792
|
return bt(d, s.toString());
|
|
5793
5793
|
}
|
|
5794
5794
|
if (h === "string")
|
|
5795
|
-
return (a = s.charCodeAt(0)) === 45 ? (s = s.slice(1), d.s = -1) : (a === 43 && (s = s.slice(1)), d.s = 1),
|
|
5795
|
+
return (a = s.charCodeAt(0)) === 45 ? (s = s.slice(1), d.s = -1) : (a === 43 && (s = s.slice(1)), d.s = 1), Wn.test(s) ? bt(d, s) : ri(d, s);
|
|
5796
5796
|
if (h === "bigint")
|
|
5797
5797
|
return s < 0 ? (s = -s, d.s = -1) : d.s = 1, bt(d, s.toString());
|
|
5798
5798
|
throw Error(Je + s);
|
|
5799
5799
|
}
|
|
5800
|
-
if (c.prototype = G, c.ROUND_UP = 0, c.ROUND_DOWN = 1, c.ROUND_CEIL = 2, c.ROUND_FLOOR = 3, c.ROUND_HALF_UP = 4, c.ROUND_HALF_DOWN = 5, c.ROUND_HALF_EVEN = 6, c.ROUND_HALF_CEIL = 7, c.ROUND_HALF_FLOOR = 8, c.EUCLID = 9, c.config = c.set = mi, c.clone =
|
|
5800
|
+
if (c.prototype = G, c.ROUND_UP = 0, c.ROUND_DOWN = 1, c.ROUND_CEIL = 2, c.ROUND_FLOOR = 3, c.ROUND_HALF_UP = 4, c.ROUND_HALF_DOWN = 5, c.ROUND_HALF_EVEN = 6, c.ROUND_HALF_CEIL = 7, c.ROUND_HALF_FLOOR = 8, c.EUCLID = 9, c.config = c.set = mi, c.clone = Jn, c.isDecimal = qn, c.abs = oi, c.acos = si, c.acosh = ci, c.add = ai, c.asin = ui, c.asinh = fi, c.atan = li, c.atanh = di, c.atan2 = hi, c.cbrt = pi, c.ceil = gi, c.clamp = wi, c.cos = yi, c.cosh = bi, c.div = Ei, c.exp = Bi, c.floor = xi, c.hypot = _i, c.ln = vi, c.log = Ai, c.log10 = Si, c.log2 = Ti, c.max = Ni, c.min = Ri, c.mod = Hi, c.mul = Ui, c.pow = Oi, c.random = qi, c.round = Ci, c.sign = Pi, c.sin = ki, c.sinh = Ii, c.sqrt = Fi, c.sub = Vi, c.sum = Mi, c.tan = ji, c.tanh = $i, c.trunc = Zi, e === void 0 && (e = {}), e && e.defaults !== !0)
|
|
5801
5801
|
for (i = ["precision", "rounding", "toExpNeg", "toExpPos", "maxE", "minE", "modulo", "crypto"], t = 0; t < i.length; ) e.hasOwnProperty(r = i[t++]) || (e[r] = this[r]);
|
|
5802
5802
|
return c.config(e), c;
|
|
5803
5803
|
}
|
|
@@ -5823,7 +5823,7 @@ function _i() {
|
|
|
5823
5823
|
return ge = !0, r.sqrt();
|
|
5824
5824
|
}
|
|
5825
5825
|
function qn(e) {
|
|
5826
|
-
return e instanceof et || e && e.toStringTag ===
|
|
5826
|
+
return e instanceof et || e && e.toStringTag === Kn || !1;
|
|
5827
5827
|
}
|
|
5828
5828
|
function vi(e) {
|
|
5829
5829
|
return new this(e).ln();
|
|
@@ -5838,10 +5838,10 @@ function Si(e) {
|
|
|
5838
5838
|
return new this(e).log(10);
|
|
5839
5839
|
}
|
|
5840
5840
|
function Ni() {
|
|
5841
|
-
return
|
|
5841
|
+
return Xn(this, arguments, -1);
|
|
5842
5842
|
}
|
|
5843
5843
|
function Ri() {
|
|
5844
|
-
return
|
|
5844
|
+
return Xn(this, arguments, 1);
|
|
5845
5845
|
}
|
|
5846
5846
|
function Hi(e, t) {
|
|
5847
5847
|
return new this(e).mod(t);
|
|
@@ -5854,7 +5854,7 @@ function Oi(e, t) {
|
|
|
5854
5854
|
}
|
|
5855
5855
|
function qi(e) {
|
|
5856
5856
|
var t, r, i, c, s = 0, u = new this(1), a = [];
|
|
5857
|
-
if (e === void 0 ? e = this.precision :
|
|
5857
|
+
if (e === void 0 ? e = this.precision : Fe(e, 1, Le), i = Math.ceil(e / de), this.crypto)
|
|
5858
5858
|
if (crypto.getRandomValues)
|
|
5859
5859
|
for (t = crypto.getRandomValues(new Uint32Array(i)); s < i; )
|
|
5860
5860
|
c = t[s], c >= 429e7 ? t[s] = crypto.getRandomValues(new Uint32Array(1))[0] : a[s++] = c % 1e7;
|
|
@@ -5863,7 +5863,7 @@ function qi(e) {
|
|
|
5863
5863
|
c = t[s] + (t[s + 1] << 8) + (t[s + 2] << 16) + ((t[s + 3] & 127) << 24), c >= 214e7 ? crypto.randomBytes(4).copy(t, s) : (a.push(c % 1e7), s += 4);
|
|
5864
5864
|
s = i / 4;
|
|
5865
5865
|
} else
|
|
5866
|
-
throw Error(
|
|
5866
|
+
throw Error(Zn);
|
|
5867
5867
|
else for (; s < i; ) a[s++] = Math.random() * 1e7 | 0;
|
|
5868
5868
|
for (i = a[--s], e %= de, i && e && (c = He(10, de - e), a[s] = (i / c | 0) * c); a[s] === 0; s--) a.pop();
|
|
5869
5869
|
if (s < 0)
|
|
@@ -5884,10 +5884,10 @@ function Pi(e) {
|
|
|
5884
5884
|
function ki(e) {
|
|
5885
5885
|
return new this(e).sin();
|
|
5886
5886
|
}
|
|
5887
|
-
function
|
|
5887
|
+
function Ii(e) {
|
|
5888
5888
|
return new this(e).sinh();
|
|
5889
5889
|
}
|
|
5890
|
-
function
|
|
5890
|
+
function Fi(e) {
|
|
5891
5891
|
return new this(e).sqrt();
|
|
5892
5892
|
}
|
|
5893
5893
|
function Vi(e, t) {
|
|
@@ -5909,7 +5909,7 @@ function Zi(e) {
|
|
|
5909
5909
|
}
|
|
5910
5910
|
G[Symbol.for("nodejs.util.inspect.custom")] = G.toString;
|
|
5911
5911
|
G[Symbol.toStringTag] = "Decimal";
|
|
5912
|
-
var et = G.constructor =
|
|
5912
|
+
var et = G.constructor = Jn(Kt);
|
|
5913
5913
|
Bt = new et(Bt);
|
|
5914
5914
|
xt = new et(xt);
|
|
5915
5915
|
const Ki = ({ IDL: e }) => {
|
|
@@ -5987,7 +5987,7 @@ const Ki = ({ IDL: e }) => {
|
|
|
5987
5987
|
}), J = e.Record({
|
|
5988
5988
|
block_hash: e.Text,
|
|
5989
5989
|
block_height: e.Nat32
|
|
5990
|
-
}),
|
|
5990
|
+
}), F = e.Record({
|
|
5991
5991
|
processing_results: e.Vec(e.Text),
|
|
5992
5992
|
block_basic: J,
|
|
5993
5993
|
txids: e.Vec(e.Text),
|
|
@@ -6030,7 +6030,7 @@ const Ki = ({ IDL: e }) => {
|
|
|
6030
6030
|
Enabled: e.Null,
|
|
6031
6031
|
Disabled: e.Null,
|
|
6032
6032
|
AllowEmpty: e.Null
|
|
6033
|
-
}),
|
|
6033
|
+
}), I = e.Record({
|
|
6034
6034
|
last_block: e.Opt(J),
|
|
6035
6035
|
pending_tx_count: e.Nat64,
|
|
6036
6036
|
mempool_tx_fee_rate: ee,
|
|
@@ -6116,7 +6116,7 @@ const Ki = ({ IDL: e }) => {
|
|
|
6116
6116
|
),
|
|
6117
6117
|
get_received_blocks: e.Func(
|
|
6118
6118
|
[e.Opt(e.Bool)],
|
|
6119
|
-
[e.Vec(
|
|
6119
|
+
[e.Vec(F)],
|
|
6120
6120
|
["query"]
|
|
6121
6121
|
),
|
|
6122
6122
|
get_registered_exchanges: e.Func([], [e.Vec(Z)], ["query"]),
|
|
@@ -6126,7 +6126,7 @@ const Ki = ({ IDL: e }) => {
|
|
|
6126
6126
|
["query"]
|
|
6127
6127
|
),
|
|
6128
6128
|
get_settings: e.Func([], [k], ["query"]),
|
|
6129
|
-
get_status: e.Func([], [
|
|
6129
|
+
get_status: e.Func([], [I], ["query"]),
|
|
6130
6130
|
get_tx_for_outpoint: e.Func(
|
|
6131
6131
|
[e.Text],
|
|
6132
6132
|
[e.Opt(N)],
|
|
@@ -6198,7 +6198,7 @@ class Wi {
|
|
|
6198
6198
|
constructor(t) {
|
|
6199
6199
|
this.config = t;
|
|
6200
6200
|
const r = t.network === Et.Testnet, i = r ? "https://xbt-testnet.gomaestro-api.org/v0" : "https://xbt-mainnet.gomaestro-api.org/v0";
|
|
6201
|
-
this.maestro = new
|
|
6201
|
+
this.maestro = new Rr({
|
|
6202
6202
|
baseUrl: i,
|
|
6203
6203
|
apiKey: t.maestroApiKey
|
|
6204
6204
|
});
|
|
@@ -6459,7 +6459,7 @@ class Wi {
|
|
|
6459
6459
|
);
|
|
6460
6460
|
}
|
|
6461
6461
|
}
|
|
6462
|
-
const
|
|
6462
|
+
const Ln = sr(null);
|
|
6463
6463
|
function to({ children: e, config: t }) {
|
|
6464
6464
|
if (!t)
|
|
6465
6465
|
throw new Error("ReeProvider: config is required");
|
|
@@ -6500,10 +6500,10 @@ function to({ children: e, config: t }) {
|
|
|
6500
6500
|
}),
|
|
6501
6501
|
[s, r, c, u]
|
|
6502
6502
|
);
|
|
6503
|
-
return /* @__PURE__ */
|
|
6503
|
+
return /* @__PURE__ */ or(Ln.Provider, { value: a, children: e });
|
|
6504
6504
|
}
|
|
6505
6505
|
function De() {
|
|
6506
|
-
const e =
|
|
6506
|
+
const e = cr(Ln);
|
|
6507
6507
|
if (!e)
|
|
6508
6508
|
throw new Error("useRee must be used within ReeProvider");
|
|
6509
6509
|
return e;
|