@fuel-ts/account 0.0.0-rc-2037-20240429115810 → 0.0.0-rc-2152-20240429145747
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.
Potentially problematic release.
This version of @fuel-ts/account might be problematic. Click here for more details.
- package/dist/index.global.js +126 -1074
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +128 -218
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +39 -123
- package/dist/index.mjs.map +1 -1
- package/dist/predicate/predicate.d.ts +2 -9
- package/dist/predicate/predicate.d.ts.map +1 -1
- package/dist/providers/provider.d.ts +0 -9
- package/dist/providers/provider.d.ts.map +1 -1
- package/dist/providers/transaction-request/index.d.ts +0 -1
- package/dist/providers/transaction-request/index.d.ts.map +1 -1
- package/dist/providers/transaction-request/transaction-request.d.ts +0 -2
- package/dist/providers/transaction-request/transaction-request.d.ts.map +1 -1
- package/dist/test-utils/index.d.ts +0 -1
- package/dist/test-utils/index.d.ts.map +1 -1
- package/dist/test-utils/seedTestWallet.d.ts +1 -1
- package/dist/test-utils/seedTestWallet.d.ts.map +1 -1
- package/dist/test-utils.global.js +136 -1073
- package/dist/test-utils.global.js.map +1 -1
- package/dist/test-utils.js +125 -205
- package/dist/test-utils.js.map +1 -1
- package/dist/test-utils.mjs +42 -119
- package/dist/test-utils.mjs.map +1 -1
- package/dist/wallet/base-wallet-unlocked.d.ts +2 -2
- package/dist/wallet/base-wallet-unlocked.d.ts.map +1 -1
- package/package.json +15 -15
- package/dist/providers/transaction-request/helpers.d.ts +0 -10
- package/dist/providers/transaction-request/helpers.d.ts.map +0 -1
- package/dist/test-utils/resources.d.ts +0 -4
- package/dist/test-utils/resources.d.ts.map +0 -1
- package/dist/test-utils/transactionRequest.d.ts +0 -5
- package/dist/test-utils/transactionRequest.d.ts.map +0 -1
package/dist/index.global.js
CHANGED
@@ -182,13 +182,13 @@
|
|
182
182
|
if (str !== lowered && str !== uppered)
|
183
183
|
return "Mixed-case string " + str;
|
184
184
|
str = lowered;
|
185
|
-
const
|
186
|
-
if (
|
185
|
+
const split2 = str.lastIndexOf("1");
|
186
|
+
if (split2 === -1)
|
187
187
|
return "No separator character for " + str;
|
188
|
-
if (
|
188
|
+
if (split2 === 0)
|
189
189
|
return "Missing prefix for " + str;
|
190
|
-
const prefix = str.slice(0,
|
191
|
-
const wordChars = str.slice(
|
190
|
+
const prefix = str.slice(0, split2);
|
191
|
+
const wordChars = str.slice(split2 + 1);
|
192
192
|
if (wordChars.length < 6)
|
193
193
|
return "Data too short";
|
194
194
|
let chk = prefixChk(prefix);
|
@@ -1089,7 +1089,7 @@
|
|
1089
1089
|
}
|
1090
1090
|
return this;
|
1091
1091
|
};
|
1092
|
-
BN2.prototype.add = function
|
1092
|
+
BN2.prototype.add = function add(num) {
|
1093
1093
|
var res;
|
1094
1094
|
if (num.negative !== 0 && this.negative === 0) {
|
1095
1095
|
num.negative = 0;
|
@@ -2803,7 +2803,7 @@
|
|
2803
2803
|
}
|
2804
2804
|
return r;
|
2805
2805
|
};
|
2806
|
-
MPrime.prototype.split = function
|
2806
|
+
MPrime.prototype.split = function split2(input, out) {
|
2807
2807
|
input.iushrn(this.n, 0, out);
|
2808
2808
|
};
|
2809
2809
|
MPrime.prototype.imulK = function imulK(num) {
|
@@ -2817,7 +2817,7 @@
|
|
2817
2817
|
);
|
2818
2818
|
}
|
2819
2819
|
inherits(K256, MPrime);
|
2820
|
-
K256.prototype.split = function
|
2820
|
+
K256.prototype.split = function split2(input, output3) {
|
2821
2821
|
var mask2 = 4194303;
|
2822
2822
|
var outLen = Math.min(input.length, 9);
|
2823
2823
|
for (var i = 0; i < outLen; i++) {
|
@@ -2953,7 +2953,7 @@
|
|
2953
2953
|
}
|
2954
2954
|
return this.m.sub(a)._forceRed(this);
|
2955
2955
|
};
|
2956
|
-
Red.prototype.add = function
|
2956
|
+
Red.prototype.add = function add(a, b) {
|
2957
2957
|
this._verify2(a, b);
|
2958
2958
|
var res = a.add(b);
|
2959
2959
|
if (res.cmp(this.m) >= 0) {
|
@@ -20417,7 +20417,7 @@ spurious results.`);
|
|
20417
20417
|
}
|
20418
20418
|
return instance.ptr;
|
20419
20419
|
}
|
20420
|
-
function
|
20420
|
+
function add(dst, lhs, rhs) {
|
20421
20421
|
const ret3 = wasm$1.add(dst, lhs, rhs);
|
20422
20422
|
return Instruction.__wrap(ret3);
|
20423
20423
|
}
|
@@ -27996,7 +27996,7 @@ spurious results.`);
|
|
27996
27996
|
exports.WQOP = WQOP;
|
27997
27997
|
exports.XOR = XOR;
|
27998
27998
|
exports.XORI = XORI;
|
27999
|
-
exports.add =
|
27999
|
+
exports.add = add;
|
28000
28000
|
exports.addi = addi2;
|
28001
28001
|
exports.aloc = aloc;
|
28002
28002
|
exports.and = and;
|
@@ -28236,9 +28236,9 @@ spurious results.`);
|
|
28236
28236
|
function setBigUint64(view, byteOffset, value, isLE3) {
|
28237
28237
|
if (typeof view.setBigUint64 === "function")
|
28238
28238
|
return view.setBigUint64(byteOffset, value, isLE3);
|
28239
|
-
const
|
28239
|
+
const _32n2 = BigInt(32);
|
28240
28240
|
const _u32_max = BigInt(4294967295);
|
28241
|
-
const wh = Number(value >>
|
28241
|
+
const wh = Number(value >> _32n2 & _u32_max);
|
28242
28242
|
const wl = Number(value & _u32_max);
|
28243
28243
|
const h = isLE3 ? 4 : 0;
|
28244
28244
|
const l = isLE3 ? 0 : 4;
|
@@ -29249,7 +29249,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
29249
29249
|
}
|
29250
29250
|
|
29251
29251
|
// ../crypto/dist/index.mjs
|
29252
|
-
var
|
29252
|
+
var import_crypto7 = __toESM(__require("crypto"), 1);
|
29253
29253
|
|
29254
29254
|
// ../../node_modules/.pnpm/ethers@6.7.1/node_modules/ethers/lib.esm/_version.js
|
29255
29255
|
var version = "6.7.1";
|
@@ -29416,18 +29416,6 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
29416
29416
|
function getBytes(value, name) {
|
29417
29417
|
return _getBytes(value, name, false);
|
29418
29418
|
}
|
29419
|
-
function isHexString(value, length) {
|
29420
|
-
if (typeof value !== "string" || !value.match(/^0x[0-9A-Fa-f]*$/)) {
|
29421
|
-
return false;
|
29422
|
-
}
|
29423
|
-
if (typeof length === "number" && value.length !== 2 + 2 * length) {
|
29424
|
-
return false;
|
29425
|
-
}
|
29426
|
-
if (length === true && value.length % 2 !== 0) {
|
29427
|
-
return false;
|
29428
|
-
}
|
29429
|
-
return true;
|
29430
|
-
}
|
29431
29419
|
var HexCharacters2 = "0123456789abcdef";
|
29432
29420
|
function hexlify2(data) {
|
29433
29421
|
const bytes3 = getBytes(data);
|
@@ -29788,74 +29776,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
29788
29776
|
};
|
29789
29777
|
var assert_default = assert2;
|
29790
29778
|
|
29791
|
-
// ../../node_modules/.pnpm/@noble+hashes@1.1.2/node_modules/@noble/hashes/esm/_u64.js
|
29792
|
-
var U32_MASK642 = BigInt(2 ** 32 - 1);
|
29793
|
-
var _32n2 = BigInt(32);
|
29794
|
-
function fromBig2(n, le = false) {
|
29795
|
-
if (le)
|
29796
|
-
return { h: Number(n & U32_MASK642), l: Number(n >> _32n2 & U32_MASK642) };
|
29797
|
-
return { h: Number(n >> _32n2 & U32_MASK642) | 0, l: Number(n & U32_MASK642) | 0 };
|
29798
|
-
}
|
29799
|
-
function split2(lst, le = false) {
|
29800
|
-
let Ah = new Uint32Array(lst.length);
|
29801
|
-
let Al = new Uint32Array(lst.length);
|
29802
|
-
for (let i = 0; i < lst.length; i++) {
|
29803
|
-
const { h, l } = fromBig2(lst[i], le);
|
29804
|
-
[Ah[i], Al[i]] = [h, l];
|
29805
|
-
}
|
29806
|
-
return [Ah, Al];
|
29807
|
-
}
|
29808
|
-
var toBig = (h, l) => BigInt(h >>> 0) << _32n2 | BigInt(l >>> 0);
|
29809
|
-
var shrSH = (h, l, s) => h >>> s;
|
29810
|
-
var shrSL = (h, l, s) => h << 32 - s | l >>> s;
|
29811
|
-
var rotrSH = (h, l, s) => h >>> s | l << 32 - s;
|
29812
|
-
var rotrSL = (h, l, s) => h << 32 - s | l >>> s;
|
29813
|
-
var rotrBH = (h, l, s) => h << 64 - s | l >>> s - 32;
|
29814
|
-
var rotrBL = (h, l, s) => h >>> s - 32 | l << 64 - s;
|
29815
|
-
var rotr32H = (h, l) => l;
|
29816
|
-
var rotr32L = (h, l) => h;
|
29817
|
-
var rotlSH2 = (h, l, s) => h << s | l >>> 32 - s;
|
29818
|
-
var rotlSL2 = (h, l, s) => l << s | h >>> 32 - s;
|
29819
|
-
var rotlBH2 = (h, l, s) => l << s - 32 | h >>> 64 - s;
|
29820
|
-
var rotlBL2 = (h, l, s) => h << s - 32 | l >>> 64 - s;
|
29821
|
-
function add(Ah, Al, Bh, Bl) {
|
29822
|
-
const l = (Al >>> 0) + (Bl >>> 0);
|
29823
|
-
return { h: Ah + Bh + (l / 2 ** 32 | 0) | 0, l: l | 0 };
|
29824
|
-
}
|
29825
|
-
var add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);
|
29826
|
-
var add3H = (low, Ah, Bh, Ch) => Ah + Bh + Ch + (low / 2 ** 32 | 0) | 0;
|
29827
|
-
var add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);
|
29828
|
-
var add4H = (low, Ah, Bh, Ch, Dh) => Ah + Bh + Ch + Dh + (low / 2 ** 32 | 0) | 0;
|
29829
|
-
var add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);
|
29830
|
-
var add5H = (low, Ah, Bh, Ch, Dh, Eh) => Ah + Bh + Ch + Dh + Eh + (low / 2 ** 32 | 0) | 0;
|
29831
|
-
var u64 = {
|
29832
|
-
fromBig: fromBig2,
|
29833
|
-
split: split2,
|
29834
|
-
toBig,
|
29835
|
-
shrSH,
|
29836
|
-
shrSL,
|
29837
|
-
rotrSH,
|
29838
|
-
rotrSL,
|
29839
|
-
rotrBH,
|
29840
|
-
rotrBL,
|
29841
|
-
rotr32H,
|
29842
|
-
rotr32L,
|
29843
|
-
rotlSH: rotlSH2,
|
29844
|
-
rotlSL: rotlSL2,
|
29845
|
-
rotlBH: rotlBH2,
|
29846
|
-
rotlBL: rotlBL2,
|
29847
|
-
add,
|
29848
|
-
add3L,
|
29849
|
-
add3H,
|
29850
|
-
add4L,
|
29851
|
-
add4H,
|
29852
|
-
add5H,
|
29853
|
-
add5L
|
29854
|
-
};
|
29855
|
-
var u64_default = u64;
|
29856
|
-
|
29857
29779
|
// ../../node_modules/.pnpm/@noble+hashes@1.1.2/node_modules/@noble/hashes/esm/utils.js
|
29858
|
-
var u322 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
|
29859
29780
|
var createView2 = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
|
29860
29781
|
var isLE2 = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
|
29861
29782
|
if (!isLE2)
|
@@ -29888,224 +29809,14 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
29888
29809
|
hashC.create = () => hashConstructor();
|
29889
29810
|
return hashC;
|
29890
29811
|
}
|
29891
|
-
function wrapConstructorWithOpts(hashCons) {
|
29892
|
-
const hashC = (msg, opts) => hashCons(opts).update(toBytes2(msg)).digest();
|
29893
|
-
const tmp = hashCons({});
|
29894
|
-
hashC.outputLen = tmp.outputLen;
|
29895
|
-
hashC.blockLen = tmp.blockLen;
|
29896
|
-
hashC.create = (opts) => hashCons(opts);
|
29897
|
-
return hashC;
|
29898
|
-
}
|
29899
|
-
|
29900
|
-
// ../../node_modules/.pnpm/@noble+hashes@1.1.2/node_modules/@noble/hashes/esm/sha3.js
|
29901
|
-
var [SHA3_PI2, SHA3_ROTL2, _SHA3_IOTA2] = [[], [], []];
|
29902
|
-
var _0n2 = BigInt(0);
|
29903
|
-
var _1n2 = BigInt(1);
|
29904
|
-
var _2n2 = BigInt(2);
|
29905
|
-
var _7n2 = BigInt(7);
|
29906
|
-
var _256n2 = BigInt(256);
|
29907
|
-
var _0x71n2 = BigInt(113);
|
29908
|
-
for (let round = 0, R = _1n2, x = 1, y = 0; round < 24; round++) {
|
29909
|
-
[x, y] = [y, (2 * x + 3 * y) % 5];
|
29910
|
-
SHA3_PI2.push(2 * (5 * y + x));
|
29911
|
-
SHA3_ROTL2.push((round + 1) * (round + 2) / 2 % 64);
|
29912
|
-
let t = _0n2;
|
29913
|
-
for (let j = 0; j < 7; j++) {
|
29914
|
-
R = (R << _1n2 ^ (R >> _7n2) * _0x71n2) % _256n2;
|
29915
|
-
if (R & _2n2)
|
29916
|
-
t ^= _1n2 << (_1n2 << BigInt(j)) - _1n2;
|
29917
|
-
}
|
29918
|
-
_SHA3_IOTA2.push(t);
|
29919
|
-
}
|
29920
|
-
var [SHA3_IOTA_H2, SHA3_IOTA_L2] = u64_default.split(_SHA3_IOTA2, true);
|
29921
|
-
var rotlH2 = (h, l, s) => s > 32 ? u64_default.rotlBH(h, l, s) : u64_default.rotlSH(h, l, s);
|
29922
|
-
var rotlL2 = (h, l, s) => s > 32 ? u64_default.rotlBL(h, l, s) : u64_default.rotlSL(h, l, s);
|
29923
|
-
function keccakP2(s, rounds = 24) {
|
29924
|
-
const B = new Uint32Array(5 * 2);
|
29925
|
-
for (let round = 24 - rounds; round < 24; round++) {
|
29926
|
-
for (let x = 0; x < 10; x++)
|
29927
|
-
B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40];
|
29928
|
-
for (let x = 0; x < 10; x += 2) {
|
29929
|
-
const idx1 = (x + 8) % 10;
|
29930
|
-
const idx0 = (x + 2) % 10;
|
29931
|
-
const B0 = B[idx0];
|
29932
|
-
const B1 = B[idx0 + 1];
|
29933
|
-
const Th = rotlH2(B0, B1, 1) ^ B[idx1];
|
29934
|
-
const Tl = rotlL2(B0, B1, 1) ^ B[idx1 + 1];
|
29935
|
-
for (let y = 0; y < 50; y += 10) {
|
29936
|
-
s[x + y] ^= Th;
|
29937
|
-
s[x + y + 1] ^= Tl;
|
29938
|
-
}
|
29939
|
-
}
|
29940
|
-
let curH = s[2];
|
29941
|
-
let curL = s[3];
|
29942
|
-
for (let t = 0; t < 24; t++) {
|
29943
|
-
const shift = SHA3_ROTL2[t];
|
29944
|
-
const Th = rotlH2(curH, curL, shift);
|
29945
|
-
const Tl = rotlL2(curH, curL, shift);
|
29946
|
-
const PI = SHA3_PI2[t];
|
29947
|
-
curH = s[PI];
|
29948
|
-
curL = s[PI + 1];
|
29949
|
-
s[PI] = Th;
|
29950
|
-
s[PI + 1] = Tl;
|
29951
|
-
}
|
29952
|
-
for (let y = 0; y < 50; y += 10) {
|
29953
|
-
for (let x = 0; x < 10; x++)
|
29954
|
-
B[x] = s[y + x];
|
29955
|
-
for (let x = 0; x < 10; x++)
|
29956
|
-
s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10];
|
29957
|
-
}
|
29958
|
-
s[0] ^= SHA3_IOTA_H2[round];
|
29959
|
-
s[1] ^= SHA3_IOTA_L2[round];
|
29960
|
-
}
|
29961
|
-
B.fill(0);
|
29962
|
-
}
|
29963
|
-
var Keccak2 = class extends Hash2 {
|
29964
|
-
// NOTE: we accept arguments in bytes instead of bits here.
|
29965
|
-
constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {
|
29966
|
-
super();
|
29967
|
-
this.blockLen = blockLen;
|
29968
|
-
this.suffix = suffix;
|
29969
|
-
this.outputLen = outputLen;
|
29970
|
-
this.enableXOF = enableXOF;
|
29971
|
-
this.rounds = rounds;
|
29972
|
-
this.pos = 0;
|
29973
|
-
this.posOut = 0;
|
29974
|
-
this.finished = false;
|
29975
|
-
this.destroyed = false;
|
29976
|
-
assert_default.number(outputLen);
|
29977
|
-
if (0 >= this.blockLen || this.blockLen >= 200)
|
29978
|
-
throw new Error("Sha3 supports only keccak-f1600 function");
|
29979
|
-
this.state = new Uint8Array(200);
|
29980
|
-
this.state32 = u322(this.state);
|
29981
|
-
}
|
29982
|
-
keccak() {
|
29983
|
-
keccakP2(this.state32, this.rounds);
|
29984
|
-
this.posOut = 0;
|
29985
|
-
this.pos = 0;
|
29986
|
-
}
|
29987
|
-
update(data) {
|
29988
|
-
assert_default.exists(this);
|
29989
|
-
const { blockLen, state } = this;
|
29990
|
-
data = toBytes2(data);
|
29991
|
-
const len = data.length;
|
29992
|
-
for (let pos = 0; pos < len; ) {
|
29993
|
-
const take = Math.min(blockLen - this.pos, len - pos);
|
29994
|
-
for (let i = 0; i < take; i++)
|
29995
|
-
state[this.pos++] ^= data[pos++];
|
29996
|
-
if (this.pos === blockLen)
|
29997
|
-
this.keccak();
|
29998
|
-
}
|
29999
|
-
return this;
|
30000
|
-
}
|
30001
|
-
finish() {
|
30002
|
-
if (this.finished)
|
30003
|
-
return;
|
30004
|
-
this.finished = true;
|
30005
|
-
const { state, suffix, pos, blockLen } = this;
|
30006
|
-
state[pos] ^= suffix;
|
30007
|
-
if ((suffix & 128) !== 0 && pos === blockLen - 1)
|
30008
|
-
this.keccak();
|
30009
|
-
state[blockLen - 1] ^= 128;
|
30010
|
-
this.keccak();
|
30011
|
-
}
|
30012
|
-
writeInto(out) {
|
30013
|
-
assert_default.exists(this, false);
|
30014
|
-
assert_default.bytes(out);
|
30015
|
-
this.finish();
|
30016
|
-
const bufferOut = this.state;
|
30017
|
-
const { blockLen } = this;
|
30018
|
-
for (let pos = 0, len = out.length; pos < len; ) {
|
30019
|
-
if (this.posOut >= blockLen)
|
30020
|
-
this.keccak();
|
30021
|
-
const take = Math.min(blockLen - this.posOut, len - pos);
|
30022
|
-
out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos);
|
30023
|
-
this.posOut += take;
|
30024
|
-
pos += take;
|
30025
|
-
}
|
30026
|
-
return out;
|
30027
|
-
}
|
30028
|
-
xofInto(out) {
|
30029
|
-
if (!this.enableXOF)
|
30030
|
-
throw new Error("XOF is not possible for this instance");
|
30031
|
-
return this.writeInto(out);
|
30032
|
-
}
|
30033
|
-
xof(bytes3) {
|
30034
|
-
assert_default.number(bytes3);
|
30035
|
-
return this.xofInto(new Uint8Array(bytes3));
|
30036
|
-
}
|
30037
|
-
digestInto(out) {
|
30038
|
-
assert_default.output(out, this);
|
30039
|
-
if (this.finished)
|
30040
|
-
throw new Error("digest() was already called");
|
30041
|
-
this.writeInto(out);
|
30042
|
-
this.destroy();
|
30043
|
-
return out;
|
30044
|
-
}
|
30045
|
-
digest() {
|
30046
|
-
return this.digestInto(new Uint8Array(this.outputLen));
|
30047
|
-
}
|
30048
|
-
destroy() {
|
30049
|
-
this.destroyed = true;
|
30050
|
-
this.state.fill(0);
|
30051
|
-
}
|
30052
|
-
_cloneInto(to) {
|
30053
|
-
const { blockLen, suffix, outputLen, rounds, enableXOF } = this;
|
30054
|
-
to || (to = new Keccak2(blockLen, suffix, outputLen, enableXOF, rounds));
|
30055
|
-
to.state32.set(this.state32);
|
30056
|
-
to.pos = this.pos;
|
30057
|
-
to.posOut = this.posOut;
|
30058
|
-
to.finished = this.finished;
|
30059
|
-
to.rounds = rounds;
|
30060
|
-
to.suffix = suffix;
|
30061
|
-
to.outputLen = outputLen;
|
30062
|
-
to.enableXOF = enableXOF;
|
30063
|
-
to.destroyed = this.destroyed;
|
30064
|
-
return to;
|
30065
|
-
}
|
30066
|
-
};
|
30067
|
-
var gen2 = (suffix, blockLen, outputLen) => wrapConstructor2(() => new Keccak2(blockLen, suffix, outputLen));
|
30068
|
-
var sha3_2242 = gen2(6, 144, 224 / 8);
|
30069
|
-
var sha3_2562 = gen2(6, 136, 256 / 8);
|
30070
|
-
var sha3_3842 = gen2(6, 104, 384 / 8);
|
30071
|
-
var sha3_5122 = gen2(6, 72, 512 / 8);
|
30072
|
-
var keccak_2242 = gen2(1, 144, 224 / 8);
|
30073
|
-
var keccak_2562 = gen2(1, 136, 256 / 8);
|
30074
|
-
var keccak_3842 = gen2(1, 104, 384 / 8);
|
30075
|
-
var keccak_5122 = gen2(1, 72, 512 / 8);
|
30076
|
-
var genShake2 = (suffix, blockLen, outputLen) => wrapConstructorWithOpts((opts = {}) => new Keccak2(blockLen, suffix, opts.dkLen === void 0 ? outputLen : opts.dkLen, true));
|
30077
|
-
var shake1282 = genShake2(31, 168, 128 / 8);
|
30078
|
-
var shake2562 = genShake2(31, 136, 256 / 8);
|
30079
|
-
|
30080
|
-
// ../../node_modules/.pnpm/ethers@6.7.1/node_modules/ethers/lib.esm/crypto/keccak.js
|
30081
|
-
var locked2 = false;
|
30082
|
-
var _keccak256 = function(data) {
|
30083
|
-
return keccak_2562(data);
|
30084
|
-
};
|
30085
|
-
var __keccak256 = _keccak256;
|
30086
|
-
function keccak256(_data) {
|
30087
|
-
const data = getBytes(_data, "data");
|
30088
|
-
return hexlify2(__keccak256(data));
|
30089
|
-
}
|
30090
|
-
keccak256._ = _keccak256;
|
30091
|
-
keccak256.lock = function() {
|
30092
|
-
locked2 = true;
|
30093
|
-
};
|
30094
|
-
keccak256.register = function(func) {
|
30095
|
-
if (locked2) {
|
30096
|
-
throw new TypeError("keccak256 is locked");
|
30097
|
-
}
|
30098
|
-
__keccak256 = func;
|
30099
|
-
};
|
30100
|
-
Object.freeze(keccak256);
|
30101
29812
|
|
30102
29813
|
// ../../node_modules/.pnpm/@noble+hashes@1.1.2/node_modules/@noble/hashes/esm/_sha2.js
|
30103
29814
|
function setBigUint642(view, byteOffset, value, isLE3) {
|
30104
29815
|
if (typeof view.setBigUint64 === "function")
|
30105
29816
|
return view.setBigUint64(byteOffset, value, isLE3);
|
30106
|
-
const
|
29817
|
+
const _32n2 = BigInt(32);
|
30107
29818
|
const _u32_max = BigInt(4294967295);
|
30108
|
-
const wh = Number(value >>
|
29819
|
+
const wh = Number(value >> _32n2 & _u32_max);
|
30109
29820
|
const wl = Number(value & _u32_max);
|
30110
29821
|
const h = isLE3 ? 4 : 0;
|
30111
29822
|
const l = isLE3 ? 0 : 4;
|
@@ -30277,7 +29988,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
30277
29988
|
var ripemd160 = wrapConstructor2(() => new RIPEMD160());
|
30278
29989
|
|
30279
29990
|
// ../../node_modules/.pnpm/ethers@6.7.1/node_modules/ethers/lib.esm/crypto/ripemd160.js
|
30280
|
-
var
|
29991
|
+
var locked2 = false;
|
30281
29992
|
var _ripemd160 = function(data) {
|
30282
29993
|
return ripemd160(data);
|
30283
29994
|
};
|
@@ -30288,10 +29999,10 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
30288
29999
|
}
|
30289
30000
|
ripemd1602._ = _ripemd160;
|
30290
30001
|
ripemd1602.lock = function() {
|
30291
|
-
|
30002
|
+
locked2 = true;
|
30292
30003
|
};
|
30293
30004
|
ripemd1602.register = function(func) {
|
30294
|
-
if (
|
30005
|
+
if (locked2) {
|
30295
30006
|
throw new TypeError("ripemd160 is locked");
|
30296
30007
|
}
|
30297
30008
|
__ripemd160 = func;
|
@@ -30299,7 +30010,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
30299
30010
|
Object.freeze(ripemd1602);
|
30300
30011
|
|
30301
30012
|
// ../../node_modules/.pnpm/ethers@6.7.1/node_modules/ethers/lib.esm/crypto/pbkdf2.js
|
30302
|
-
var
|
30013
|
+
var locked3 = false;
|
30303
30014
|
var _pbkdf2 = function(password, salt, iterations, keylen, algo) {
|
30304
30015
|
return (0, import_crypto2.pbkdf2Sync)(password, salt, iterations, keylen, algo);
|
30305
30016
|
};
|
@@ -30311,602 +30022,19 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
30311
30022
|
}
|
30312
30023
|
pbkdf22._ = _pbkdf2;
|
30313
30024
|
pbkdf22.lock = function() {
|
30314
|
-
|
30025
|
+
locked3 = true;
|
30315
30026
|
};
|
30316
30027
|
pbkdf22.register = function(func) {
|
30317
|
-
if (
|
30028
|
+
if (locked3) {
|
30318
30029
|
throw new Error("pbkdf2 is locked");
|
30319
30030
|
}
|
30320
30031
|
__pbkdf2 = func;
|
30321
30032
|
};
|
30322
30033
|
Object.freeze(pbkdf22);
|
30323
30034
|
|
30324
|
-
// ../../node_modules/.pnpm/ethers@6.7.1/node_modules/ethers/lib.esm/address/address.js
|
30325
|
-
var BN_03 = BigInt(0);
|
30326
|
-
var BN_36 = BigInt(36);
|
30327
|
-
function getChecksumAddress(address) {
|
30328
|
-
address = address.toLowerCase();
|
30329
|
-
const chars = address.substring(2).split("");
|
30330
|
-
const expanded = new Uint8Array(40);
|
30331
|
-
for (let i = 0; i < 40; i++) {
|
30332
|
-
expanded[i] = chars[i].charCodeAt(0);
|
30333
|
-
}
|
30334
|
-
const hashed = getBytes(keccak256(expanded));
|
30335
|
-
for (let i = 0; i < 40; i += 2) {
|
30336
|
-
if (hashed[i >> 1] >> 4 >= 8) {
|
30337
|
-
chars[i] = chars[i].toUpperCase();
|
30338
|
-
}
|
30339
|
-
if ((hashed[i >> 1] & 15) >= 8) {
|
30340
|
-
chars[i + 1] = chars[i + 1].toUpperCase();
|
30341
|
-
}
|
30342
|
-
}
|
30343
|
-
return "0x" + chars.join("");
|
30344
|
-
}
|
30345
|
-
var ibanLookup = {};
|
30346
|
-
for (let i = 0; i < 10; i++) {
|
30347
|
-
ibanLookup[String(i)] = String(i);
|
30348
|
-
}
|
30349
|
-
for (let i = 0; i < 26; i++) {
|
30350
|
-
ibanLookup[String.fromCharCode(65 + i)] = String(10 + i);
|
30351
|
-
}
|
30352
|
-
var safeDigits = 15;
|
30353
|
-
function ibanChecksum(address) {
|
30354
|
-
address = address.toUpperCase();
|
30355
|
-
address = address.substring(4) + address.substring(0, 2) + "00";
|
30356
|
-
let expanded = address.split("").map((c) => {
|
30357
|
-
return ibanLookup[c];
|
30358
|
-
}).join("");
|
30359
|
-
while (expanded.length >= safeDigits) {
|
30360
|
-
let block2 = expanded.substring(0, safeDigits);
|
30361
|
-
expanded = parseInt(block2, 10) % 97 + expanded.substring(block2.length);
|
30362
|
-
}
|
30363
|
-
let checksum = String(98 - parseInt(expanded, 10) % 97);
|
30364
|
-
while (checksum.length < 2) {
|
30365
|
-
checksum = "0" + checksum;
|
30366
|
-
}
|
30367
|
-
return checksum;
|
30368
|
-
}
|
30369
|
-
var Base36 = function() {
|
30370
|
-
;
|
30371
|
-
const result = {};
|
30372
|
-
for (let i = 0; i < 36; i++) {
|
30373
|
-
const key = "0123456789abcdefghijklmnopqrstuvwxyz"[i];
|
30374
|
-
result[key] = BigInt(i);
|
30375
|
-
}
|
30376
|
-
return result;
|
30377
|
-
}();
|
30378
|
-
function fromBase36(value) {
|
30379
|
-
value = value.toLowerCase();
|
30380
|
-
let result = BN_03;
|
30381
|
-
for (let i = 0; i < value.length; i++) {
|
30382
|
-
result = result * BN_36 + Base36[value[i]];
|
30383
|
-
}
|
30384
|
-
return result;
|
30385
|
-
}
|
30386
|
-
function getAddress(address) {
|
30387
|
-
assertArgument(typeof address === "string", "invalid address", "address", address);
|
30388
|
-
if (address.match(/^(0x)?[0-9a-fA-F]{40}$/)) {
|
30389
|
-
if (!address.startsWith("0x")) {
|
30390
|
-
address = "0x" + address;
|
30391
|
-
}
|
30392
|
-
const result = getChecksumAddress(address);
|
30393
|
-
assertArgument(!address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) || result === address, "bad address checksum", "address", address);
|
30394
|
-
return result;
|
30395
|
-
}
|
30396
|
-
if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {
|
30397
|
-
assertArgument(address.substring(2, 4) === ibanChecksum(address), "bad icap checksum", "address", address);
|
30398
|
-
let result = fromBase36(address.substring(4)).toString(16);
|
30399
|
-
while (result.length < 40) {
|
30400
|
-
result = "0" + result;
|
30401
|
-
}
|
30402
|
-
return getChecksumAddress("0x" + result);
|
30403
|
-
}
|
30404
|
-
assertArgument(false, "invalid address", "address", address);
|
30405
|
-
}
|
30406
|
-
|
30407
|
-
// ../../node_modules/.pnpm/ethers@6.7.1/node_modules/ethers/lib.esm/transaction/accesslist.js
|
30408
|
-
function accessSetify(addr, storageKeys) {
|
30409
|
-
return {
|
30410
|
-
address: getAddress(addr),
|
30411
|
-
storageKeys: storageKeys.map((storageKey, index) => {
|
30412
|
-
assertArgument(isHexString(storageKey, 32), "invalid slot", `storageKeys[${index}]`, storageKey);
|
30413
|
-
return storageKey.toLowerCase();
|
30414
|
-
})
|
30415
|
-
};
|
30416
|
-
}
|
30417
|
-
function accessListify(value) {
|
30418
|
-
if (Array.isArray(value)) {
|
30419
|
-
return value.map((set, index) => {
|
30420
|
-
if (Array.isArray(set)) {
|
30421
|
-
assertArgument(set.length === 2, "invalid slot set", `value[${index}]`, set);
|
30422
|
-
return accessSetify(set[0], set[1]);
|
30423
|
-
}
|
30424
|
-
assertArgument(set != null && typeof set === "object", "invalid address-slot set", "value", value);
|
30425
|
-
return accessSetify(set.address, set.storageKeys);
|
30426
|
-
});
|
30427
|
-
}
|
30428
|
-
assertArgument(value != null && typeof value === "object", "invalid access list", "value", value);
|
30429
|
-
const result = Object.keys(value).map((addr) => {
|
30430
|
-
const storageKeys = value[addr].reduce((accum, storageKey) => {
|
30431
|
-
accum[storageKey] = true;
|
30432
|
-
return accum;
|
30433
|
-
}, {});
|
30434
|
-
return accessSetify(addr, Object.keys(storageKeys).sort());
|
30435
|
-
});
|
30436
|
-
result.sort((a, b) => a.address.localeCompare(b.address));
|
30437
|
-
return result;
|
30438
|
-
}
|
30439
|
-
|
30440
|
-
// ../../node_modules/.pnpm/ethers@6.7.1/node_modules/ethers/lib.esm/providers/plugins-network.js
|
30441
|
-
var EnsAddress = "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";
|
30442
|
-
var NetworkPlugin = class {
|
30443
|
-
/**
|
30444
|
-
* The name of the plugin.
|
30445
|
-
*
|
30446
|
-
* It is recommended to use reverse-domain-notation, which permits
|
30447
|
-
* unique names with a known authority as well as hierarchal entries.
|
30448
|
-
*/
|
30449
|
-
name;
|
30450
|
-
/**
|
30451
|
-
* Creates a new **NetworkPlugin**.
|
30452
|
-
*/
|
30453
|
-
constructor(name) {
|
30454
|
-
defineProperties(this, { name });
|
30455
|
-
}
|
30456
|
-
/**
|
30457
|
-
* Creates a copy of this plugin.
|
30458
|
-
*/
|
30459
|
-
clone() {
|
30460
|
-
return new NetworkPlugin(this.name);
|
30461
|
-
}
|
30462
|
-
};
|
30463
|
-
var GasCostPlugin = class extends NetworkPlugin {
|
30464
|
-
/**
|
30465
|
-
* The block number to treat these values as valid from.
|
30466
|
-
*
|
30467
|
-
* This allows a hardfork to have updated values included as well as
|
30468
|
-
* mulutiple hardforks to be supported.
|
30469
|
-
*/
|
30470
|
-
effectiveBlock;
|
30471
|
-
/**
|
30472
|
-
* The transactions base fee.
|
30473
|
-
*/
|
30474
|
-
txBase;
|
30475
|
-
/**
|
30476
|
-
* The fee for creating a new account.
|
30477
|
-
*/
|
30478
|
-
txCreate;
|
30479
|
-
/**
|
30480
|
-
* The fee per zero-byte in the data.
|
30481
|
-
*/
|
30482
|
-
txDataZero;
|
30483
|
-
/**
|
30484
|
-
* The fee per non-zero-byte in the data.
|
30485
|
-
*/
|
30486
|
-
txDataNonzero;
|
30487
|
-
/**
|
30488
|
-
* The fee per storage key in the [[link-eip-2930]] access list.
|
30489
|
-
*/
|
30490
|
-
txAccessListStorageKey;
|
30491
|
-
/**
|
30492
|
-
* The fee per address in the [[link-eip-2930]] access list.
|
30493
|
-
*/
|
30494
|
-
txAccessListAddress;
|
30495
|
-
/**
|
30496
|
-
* Creates a new GasCostPlugin from %%effectiveBlock%% until the
|
30497
|
-
* latest block or another GasCostPlugin supercedes that block number,
|
30498
|
-
* with the associated %%costs%%.
|
30499
|
-
*/
|
30500
|
-
constructor(effectiveBlock, costs) {
|
30501
|
-
if (effectiveBlock == null) {
|
30502
|
-
effectiveBlock = 0;
|
30503
|
-
}
|
30504
|
-
super(`org.ethers.network.plugins.GasCost#${effectiveBlock || 0}`);
|
30505
|
-
const props = { effectiveBlock };
|
30506
|
-
function set(name, nullish) {
|
30507
|
-
let value = (costs || {})[name];
|
30508
|
-
if (value == null) {
|
30509
|
-
value = nullish;
|
30510
|
-
}
|
30511
|
-
assertArgument(typeof value === "number", `invalud value for ${name}`, "costs", costs);
|
30512
|
-
props[name] = value;
|
30513
|
-
}
|
30514
|
-
set("txBase", 21e3);
|
30515
|
-
set("txCreate", 32e3);
|
30516
|
-
set("txDataZero", 4);
|
30517
|
-
set("txDataNonzero", 16);
|
30518
|
-
set("txAccessListStorageKey", 1900);
|
30519
|
-
set("txAccessListAddress", 2400);
|
30520
|
-
defineProperties(this, props);
|
30521
|
-
}
|
30522
|
-
clone() {
|
30523
|
-
return new GasCostPlugin(this.effectiveBlock, this);
|
30524
|
-
}
|
30525
|
-
};
|
30526
|
-
var EnsPlugin = class extends NetworkPlugin {
|
30527
|
-
/**
|
30528
|
-
* The ENS Registrty Contract address.
|
30529
|
-
*/
|
30530
|
-
address;
|
30531
|
-
/**
|
30532
|
-
* The chain ID that the ENS contract lives on.
|
30533
|
-
*/
|
30534
|
-
targetNetwork;
|
30535
|
-
/**
|
30536
|
-
* Creates a new **EnsPlugin** connected to %%address%% on the
|
30537
|
-
* %%targetNetwork%%. The default ENS address and mainnet is used
|
30538
|
-
* if unspecified.
|
30539
|
-
*/
|
30540
|
-
constructor(address, targetNetwork) {
|
30541
|
-
super("org.ethers.plugins.network.Ens");
|
30542
|
-
defineProperties(this, {
|
30543
|
-
address: address || EnsAddress,
|
30544
|
-
targetNetwork: targetNetwork == null ? 1 : targetNetwork
|
30545
|
-
});
|
30546
|
-
}
|
30547
|
-
clone() {
|
30548
|
-
return new EnsPlugin(this.address, this.targetNetwork);
|
30549
|
-
}
|
30550
|
-
};
|
30551
|
-
var FetchUrlFeeDataNetworkPlugin = class extends NetworkPlugin {
|
30552
|
-
#url;
|
30553
|
-
#processFunc;
|
30554
|
-
/**
|
30555
|
-
* The URL to initialize the FetchRequest with in %%processFunc%%.
|
30556
|
-
*/
|
30557
|
-
get url() {
|
30558
|
-
return this.#url;
|
30559
|
-
}
|
30560
|
-
/**
|
30561
|
-
* The callback to use when computing the FeeData.
|
30562
|
-
*/
|
30563
|
-
get processFunc() {
|
30564
|
-
return this.#processFunc;
|
30565
|
-
}
|
30566
|
-
/**
|
30567
|
-
* Creates a new **FetchUrlFeeDataNetworkPlugin** which will
|
30568
|
-
* be used when computing the fee data for the network.
|
30569
|
-
*/
|
30570
|
-
constructor(url, processFunc) {
|
30571
|
-
super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");
|
30572
|
-
this.#url = url;
|
30573
|
-
this.#processFunc = processFunc;
|
30574
|
-
}
|
30575
|
-
// We are immutable, so we can serve as our own clone
|
30576
|
-
clone() {
|
30577
|
-
return this;
|
30578
|
-
}
|
30579
|
-
};
|
30580
|
-
|
30581
|
-
// ../../node_modules/.pnpm/ethers@6.7.1/node_modules/ethers/lib.esm/providers/network.js
|
30582
|
-
var Networks = /* @__PURE__ */ new Map();
|
30583
|
-
var Network = class {
|
30584
|
-
#name;
|
30585
|
-
#chainId;
|
30586
|
-
#plugins;
|
30587
|
-
/**
|
30588
|
-
* Creates a new **Network** for %%name%% and %%chainId%%.
|
30589
|
-
*/
|
30590
|
-
constructor(name, chainId) {
|
30591
|
-
this.#name = name;
|
30592
|
-
this.#chainId = getBigInt(chainId);
|
30593
|
-
this.#plugins = /* @__PURE__ */ new Map();
|
30594
|
-
}
|
30595
|
-
/**
|
30596
|
-
* Returns a JSON-compatible representation of a Network.
|
30597
|
-
*/
|
30598
|
-
toJSON() {
|
30599
|
-
return { name: this.name, chainId: String(this.chainId) };
|
30600
|
-
}
|
30601
|
-
/**
|
30602
|
-
* The network common name.
|
30603
|
-
*
|
30604
|
-
* This is the canonical name, as networks migh have multiple
|
30605
|
-
* names.
|
30606
|
-
*/
|
30607
|
-
get name() {
|
30608
|
-
return this.#name;
|
30609
|
-
}
|
30610
|
-
set name(value) {
|
30611
|
-
this.#name = value;
|
30612
|
-
}
|
30613
|
-
/**
|
30614
|
-
* The network chain ID.
|
30615
|
-
*/
|
30616
|
-
get chainId() {
|
30617
|
-
return this.#chainId;
|
30618
|
-
}
|
30619
|
-
set chainId(value) {
|
30620
|
-
this.#chainId = getBigInt(value, "chainId");
|
30621
|
-
}
|
30622
|
-
/**
|
30623
|
-
* Returns true if %%other%% matches this network. Any chain ID
|
30624
|
-
* must match, and if no chain ID is present, the name must match.
|
30625
|
-
*
|
30626
|
-
* This method does not currently check for additional properties,
|
30627
|
-
* such as ENS address or plug-in compatibility.
|
30628
|
-
*/
|
30629
|
-
matches(other) {
|
30630
|
-
if (other == null) {
|
30631
|
-
return false;
|
30632
|
-
}
|
30633
|
-
if (typeof other === "string") {
|
30634
|
-
try {
|
30635
|
-
return this.chainId === getBigInt(other);
|
30636
|
-
} catch (error) {
|
30637
|
-
}
|
30638
|
-
return this.name === other;
|
30639
|
-
}
|
30640
|
-
if (typeof other === "number" || typeof other === "bigint") {
|
30641
|
-
try {
|
30642
|
-
return this.chainId === getBigInt(other);
|
30643
|
-
} catch (error) {
|
30644
|
-
}
|
30645
|
-
return false;
|
30646
|
-
}
|
30647
|
-
if (typeof other === "object") {
|
30648
|
-
if (other.chainId != null) {
|
30649
|
-
try {
|
30650
|
-
return this.chainId === getBigInt(other.chainId);
|
30651
|
-
} catch (error) {
|
30652
|
-
}
|
30653
|
-
return false;
|
30654
|
-
}
|
30655
|
-
if (other.name != null) {
|
30656
|
-
return this.name === other.name;
|
30657
|
-
}
|
30658
|
-
return false;
|
30659
|
-
}
|
30660
|
-
return false;
|
30661
|
-
}
|
30662
|
-
/**
|
30663
|
-
* Returns the list of plugins currently attached to this Network.
|
30664
|
-
*/
|
30665
|
-
get plugins() {
|
30666
|
-
return Array.from(this.#plugins.values());
|
30667
|
-
}
|
30668
|
-
/**
|
30669
|
-
* Attach a new %%plugin%% to this Network. The network name
|
30670
|
-
* must be unique, excluding any fragment.
|
30671
|
-
*/
|
30672
|
-
attachPlugin(plugin) {
|
30673
|
-
if (this.#plugins.get(plugin.name)) {
|
30674
|
-
throw new Error(`cannot replace existing plugin: ${plugin.name} `);
|
30675
|
-
}
|
30676
|
-
this.#plugins.set(plugin.name, plugin.clone());
|
30677
|
-
return this;
|
30678
|
-
}
|
30679
|
-
/**
|
30680
|
-
* Return the plugin, if any, matching %%name%% exactly. Plugins
|
30681
|
-
* with fragments will not be returned unless %%name%% includes
|
30682
|
-
* a fragment.
|
30683
|
-
*/
|
30684
|
-
getPlugin(name) {
|
30685
|
-
return this.#plugins.get(name) || null;
|
30686
|
-
}
|
30687
|
-
/**
|
30688
|
-
* Gets a list of all plugins that match %%name%%, with otr without
|
30689
|
-
* a fragment.
|
30690
|
-
*/
|
30691
|
-
getPlugins(basename) {
|
30692
|
-
return this.plugins.filter((p) => p.name.split("#")[0] === basename);
|
30693
|
-
}
|
30694
|
-
/**
|
30695
|
-
* Create a copy of this Network.
|
30696
|
-
*/
|
30697
|
-
clone() {
|
30698
|
-
const clone4 = new Network(this.name, this.chainId);
|
30699
|
-
this.plugins.forEach((plugin) => {
|
30700
|
-
clone4.attachPlugin(plugin.clone());
|
30701
|
-
});
|
30702
|
-
return clone4;
|
30703
|
-
}
|
30704
|
-
/**
|
30705
|
-
* Compute the intrinsic gas required for a transaction.
|
30706
|
-
*
|
30707
|
-
* A GasCostPlugin can be attached to override the default
|
30708
|
-
* values.
|
30709
|
-
*/
|
30710
|
-
computeIntrinsicGas(tx) {
|
30711
|
-
const costs = this.getPlugin("org.ethers.plugins.network.GasCost") || new GasCostPlugin();
|
30712
|
-
let gas = costs.txBase;
|
30713
|
-
if (tx.to == null) {
|
30714
|
-
gas += costs.txCreate;
|
30715
|
-
}
|
30716
|
-
if (tx.data) {
|
30717
|
-
for (let i = 2; i < tx.data.length; i += 2) {
|
30718
|
-
if (tx.data.substring(i, i + 2) === "00") {
|
30719
|
-
gas += costs.txDataZero;
|
30720
|
-
} else {
|
30721
|
-
gas += costs.txDataNonzero;
|
30722
|
-
}
|
30723
|
-
}
|
30724
|
-
}
|
30725
|
-
if (tx.accessList) {
|
30726
|
-
const accessList = accessListify(tx.accessList);
|
30727
|
-
for (const addr in accessList) {
|
30728
|
-
gas += costs.txAccessListAddress + costs.txAccessListStorageKey * accessList[addr].storageKeys.length;
|
30729
|
-
}
|
30730
|
-
}
|
30731
|
-
return gas;
|
30732
|
-
}
|
30733
|
-
/**
|
30734
|
-
* Returns a new Network for the %%network%% name or chainId.
|
30735
|
-
*/
|
30736
|
-
static from(network) {
|
30737
|
-
injectCommonNetworks();
|
30738
|
-
if (network == null) {
|
30739
|
-
return Network.from("mainnet");
|
30740
|
-
}
|
30741
|
-
if (typeof network === "number") {
|
30742
|
-
network = BigInt(network);
|
30743
|
-
}
|
30744
|
-
if (typeof network === "string" || typeof network === "bigint") {
|
30745
|
-
const networkFunc = Networks.get(network);
|
30746
|
-
if (networkFunc) {
|
30747
|
-
return networkFunc();
|
30748
|
-
}
|
30749
|
-
if (typeof network === "bigint") {
|
30750
|
-
return new Network("unknown", network);
|
30751
|
-
}
|
30752
|
-
assertArgument(false, "unknown network", "network", network);
|
30753
|
-
}
|
30754
|
-
if (typeof network.clone === "function") {
|
30755
|
-
const clone4 = network.clone();
|
30756
|
-
return clone4;
|
30757
|
-
}
|
30758
|
-
if (typeof network === "object") {
|
30759
|
-
assertArgument(typeof network.name === "string" && typeof network.chainId === "number", "invalid network object name or chainId", "network", network);
|
30760
|
-
const custom = new Network(network.name, network.chainId);
|
30761
|
-
if (network.ensAddress || network.ensNetwork != null) {
|
30762
|
-
custom.attachPlugin(new EnsPlugin(network.ensAddress, network.ensNetwork));
|
30763
|
-
}
|
30764
|
-
return custom;
|
30765
|
-
}
|
30766
|
-
assertArgument(false, "invalid network", "network", network);
|
30767
|
-
}
|
30768
|
-
/**
|
30769
|
-
* Register %%nameOrChainId%% with a function which returns
|
30770
|
-
* an instance of a Network representing that chain.
|
30771
|
-
*/
|
30772
|
-
static register(nameOrChainId, networkFunc) {
|
30773
|
-
if (typeof nameOrChainId === "number") {
|
30774
|
-
nameOrChainId = BigInt(nameOrChainId);
|
30775
|
-
}
|
30776
|
-
const existing = Networks.get(nameOrChainId);
|
30777
|
-
if (existing) {
|
30778
|
-
assertArgument(false, `conflicting network for ${JSON.stringify(existing.name)}`, "nameOrChainId", nameOrChainId);
|
30779
|
-
}
|
30780
|
-
Networks.set(nameOrChainId, networkFunc);
|
30781
|
-
}
|
30782
|
-
};
|
30783
|
-
function parseUnits(_value, decimals) {
|
30784
|
-
const value = String(_value);
|
30785
|
-
if (!value.match(/^[0-9.]+$/)) {
|
30786
|
-
throw new Error(`invalid gwei value: ${_value}`);
|
30787
|
-
}
|
30788
|
-
const comps = value.split(".");
|
30789
|
-
if (comps.length === 1) {
|
30790
|
-
comps.push("");
|
30791
|
-
}
|
30792
|
-
if (comps.length !== 2) {
|
30793
|
-
throw new Error(`invalid gwei value: ${_value}`);
|
30794
|
-
}
|
30795
|
-
while (comps[1].length < decimals) {
|
30796
|
-
comps[1] += "0";
|
30797
|
-
}
|
30798
|
-
if (comps[1].length > 9) {
|
30799
|
-
let frac = BigInt(comps[1].substring(0, 9));
|
30800
|
-
if (!comps[1].substring(9).match(/^0+$/)) {
|
30801
|
-
frac++;
|
30802
|
-
}
|
30803
|
-
comps[1] = frac.toString();
|
30804
|
-
}
|
30805
|
-
return BigInt(comps[0] + comps[1]);
|
30806
|
-
}
|
30807
|
-
function getGasStationPlugin(url) {
|
30808
|
-
return new FetchUrlFeeDataNetworkPlugin(url, async (fetchFeeData, provider, request) => {
|
30809
|
-
request.setHeader("User-Agent", "ethers");
|
30810
|
-
let response;
|
30811
|
-
try {
|
30812
|
-
const [_response, _feeData] = await Promise.all([
|
30813
|
-
request.send(),
|
30814
|
-
fetchFeeData()
|
30815
|
-
]);
|
30816
|
-
response = _response;
|
30817
|
-
const payload = response.bodyJson.standard;
|
30818
|
-
const feeData = {
|
30819
|
-
gasPrice: _feeData.gasPrice,
|
30820
|
-
maxFeePerGas: parseUnits(payload.maxFee, 9),
|
30821
|
-
maxPriorityFeePerGas: parseUnits(payload.maxPriorityFee, 9)
|
30822
|
-
};
|
30823
|
-
return feeData;
|
30824
|
-
} catch (error) {
|
30825
|
-
assert(false, `error encountered with polygon gas station (${JSON.stringify(request.url)})`, "SERVER_ERROR", { request, response, error });
|
30826
|
-
}
|
30827
|
-
});
|
30828
|
-
}
|
30829
|
-
function getPriorityFeePlugin(maxPriorityFeePerGas) {
|
30830
|
-
return new FetchUrlFeeDataNetworkPlugin("data:", async (fetchFeeData, provider, request) => {
|
30831
|
-
const feeData = await fetchFeeData();
|
30832
|
-
if (feeData.maxFeePerGas == null || feeData.maxPriorityFeePerGas == null) {
|
30833
|
-
return feeData;
|
30834
|
-
}
|
30835
|
-
const baseFee = feeData.maxFeePerGas - feeData.maxPriorityFeePerGas;
|
30836
|
-
return {
|
30837
|
-
gasPrice: feeData.gasPrice,
|
30838
|
-
maxFeePerGas: baseFee + maxPriorityFeePerGas,
|
30839
|
-
maxPriorityFeePerGas
|
30840
|
-
};
|
30841
|
-
});
|
30842
|
-
}
|
30843
|
-
var injected = false;
|
30844
|
-
function injectCommonNetworks() {
|
30845
|
-
if (injected) {
|
30846
|
-
return;
|
30847
|
-
}
|
30848
|
-
injected = true;
|
30849
|
-
function registerEth(name, chainId, options) {
|
30850
|
-
const func = function() {
|
30851
|
-
const network = new Network(name, chainId);
|
30852
|
-
if (options.ensNetwork != null) {
|
30853
|
-
network.attachPlugin(new EnsPlugin(null, options.ensNetwork));
|
30854
|
-
}
|
30855
|
-
network.attachPlugin(new GasCostPlugin());
|
30856
|
-
(options.plugins || []).forEach((plugin) => {
|
30857
|
-
network.attachPlugin(plugin);
|
30858
|
-
});
|
30859
|
-
return network;
|
30860
|
-
};
|
30861
|
-
Network.register(name, func);
|
30862
|
-
Network.register(chainId, func);
|
30863
|
-
if (options.altNames) {
|
30864
|
-
options.altNames.forEach((name2) => {
|
30865
|
-
Network.register(name2, func);
|
30866
|
-
});
|
30867
|
-
}
|
30868
|
-
}
|
30869
|
-
registerEth("mainnet", 1, { ensNetwork: 1, altNames: ["homestead"] });
|
30870
|
-
registerEth("ropsten", 3, { ensNetwork: 3 });
|
30871
|
-
registerEth("rinkeby", 4, { ensNetwork: 4 });
|
30872
|
-
registerEth("goerli", 5, { ensNetwork: 5 });
|
30873
|
-
registerEth("kovan", 42, { ensNetwork: 42 });
|
30874
|
-
registerEth("sepolia", 11155111, {});
|
30875
|
-
registerEth("classic", 61, {});
|
30876
|
-
registerEth("classicKotti", 6, {});
|
30877
|
-
registerEth("arbitrum", 42161, {
|
30878
|
-
ensNetwork: 1
|
30879
|
-
});
|
30880
|
-
registerEth("arbitrum-goerli", 421613, {});
|
30881
|
-
registerEth("bnb", 56, { ensNetwork: 1 });
|
30882
|
-
registerEth("bnbt", 97, {});
|
30883
|
-
registerEth("linea", 59144, { ensNetwork: 1 });
|
30884
|
-
registerEth("linea-goerli", 59140, {});
|
30885
|
-
registerEth("matic", 137, {
|
30886
|
-
ensNetwork: 1,
|
30887
|
-
plugins: [
|
30888
|
-
getGasStationPlugin("https://gasstation.polygon.technology/v2")
|
30889
|
-
]
|
30890
|
-
});
|
30891
|
-
registerEth("matic-mumbai", 80001, {
|
30892
|
-
altNames: ["maticMumbai", "maticmum"],
|
30893
|
-
plugins: [
|
30894
|
-
getGasStationPlugin("https://gasstation-testnet.polygon.technology/v2")
|
30895
|
-
]
|
30896
|
-
});
|
30897
|
-
registerEth("optimism", 10, {
|
30898
|
-
ensNetwork: 1,
|
30899
|
-
plugins: [
|
30900
|
-
getPriorityFeePlugin(BigInt("1000000"))
|
30901
|
-
]
|
30902
|
-
});
|
30903
|
-
registerEth("optimism-goerli", 420, {});
|
30904
|
-
registerEth("xdai", 100, { ensNetwork: 1 });
|
30905
|
-
}
|
30906
|
-
|
30907
30035
|
// ../crypto/dist/index.mjs
|
30036
|
+
var import_crypto8 = __toESM(__require("crypto"), 1);
|
30908
30037
|
var import_crypto9 = __toESM(__require("crypto"), 1);
|
30909
|
-
var import_crypto10 = __toESM(__require("crypto"), 1);
|
30910
30038
|
var scrypt3 = (params) => {
|
30911
30039
|
const { password, salt, n, p, r, dklen } = params;
|
30912
30040
|
const derivedKey = scrypt(password, salt, { N: n, r, p, dkLen: dklen });
|
@@ -30915,7 +30043,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
30915
30043
|
var keccak2562 = (data) => keccak_256(data);
|
30916
30044
|
var bufferFromString = (string, encoding = "base64") => Uint8Array.from(Buffer.from(string, encoding));
|
30917
30045
|
var randomBytes4 = (length) => {
|
30918
|
-
const randomValues = Uint8Array.from(
|
30046
|
+
const randomValues = Uint8Array.from(import_crypto8.default.randomBytes(length));
|
30919
30047
|
return randomValues;
|
30920
30048
|
};
|
30921
30049
|
var stringFromBuffer = (buffer, encoding = "base64") => Buffer.from(buffer).toString(encoding);
|
@@ -30930,7 +30058,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
30930
30058
|
const salt = randomBytes4(32);
|
30931
30059
|
const secret = keyFromPassword(password, salt);
|
30932
30060
|
const dataBuffer = Uint8Array.from(Buffer.from(JSON.stringify(data), "utf-8"));
|
30933
|
-
const cipher = await
|
30061
|
+
const cipher = await import_crypto7.default.createCipheriv(ALGORITHM, secret, iv);
|
30934
30062
|
let cipherData = cipher.update(dataBuffer);
|
30935
30063
|
cipherData = Buffer.concat([cipherData, cipher.final()]);
|
30936
30064
|
return {
|
@@ -30944,7 +30072,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
30944
30072
|
const salt = bufferFromString(keystore.salt);
|
30945
30073
|
const secret = keyFromPassword(password, salt);
|
30946
30074
|
const encryptedText = bufferFromString(keystore.data);
|
30947
|
-
const decipher = await
|
30075
|
+
const decipher = await import_crypto7.default.createDecipheriv(ALGORITHM, secret, iv);
|
30948
30076
|
const decrypted = decipher.update(encryptedText);
|
30949
30077
|
const deBuff = Buffer.concat([decrypted, decipher.final()]);
|
30950
30078
|
const decryptedData = Buffer.from(deBuff).toString("utf-8");
|
@@ -30955,12 +30083,12 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
30955
30083
|
}
|
30956
30084
|
};
|
30957
30085
|
async function encryptJsonWalletData(data, key, iv) {
|
30958
|
-
const cipher = await
|
30086
|
+
const cipher = await import_crypto9.default.createCipheriv("aes-128-ctr", key.subarray(0, 16), iv);
|
30959
30087
|
const encrypted = Buffer.concat([cipher.update(data), cipher.final()]);
|
30960
30088
|
return new Uint8Array(encrypted);
|
30961
30089
|
}
|
30962
30090
|
async function decryptJsonWalletData(data, key, iv) {
|
30963
|
-
const decipher =
|
30091
|
+
const decipher = import_crypto9.default.createDecipheriv("aes-128-ctr", key.subarray(0, 16), iv);
|
30964
30092
|
const decrypted = await Buffer.concat([decipher.update(data), decipher.final()]);
|
30965
30093
|
return new Uint8Array(decrypted);
|
30966
30094
|
}
|
@@ -34578,9 +33706,9 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
34578
33706
|
utf8ToBytes: () => utf8ToBytes3,
|
34579
33707
|
validateObject: () => validateObject
|
34580
33708
|
});
|
34581
|
-
var
|
34582
|
-
var
|
34583
|
-
var
|
33709
|
+
var _0n2 = BigInt(0);
|
33710
|
+
var _1n2 = BigInt(1);
|
33711
|
+
var _2n2 = BigInt(2);
|
34584
33712
|
function isBytes3(a) {
|
34585
33713
|
return a instanceof Uint8Array || a != null && typeof a === "object" && a.constructor.name === "Uint8Array";
|
34586
33714
|
}
|
@@ -34699,17 +33827,17 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
34699
33827
|
}
|
34700
33828
|
function bitLen(n) {
|
34701
33829
|
let len;
|
34702
|
-
for (len = 0; n >
|
33830
|
+
for (len = 0; n > _0n2; n >>= _1n2, len += 1)
|
34703
33831
|
;
|
34704
33832
|
return len;
|
34705
33833
|
}
|
34706
33834
|
function bitGet(n, pos) {
|
34707
|
-
return n >> BigInt(pos) &
|
33835
|
+
return n >> BigInt(pos) & _1n2;
|
34708
33836
|
}
|
34709
33837
|
var bitSet = (n, pos, value) => {
|
34710
|
-
return n | (value ?
|
33838
|
+
return n | (value ? _1n2 : _0n2) << BigInt(pos);
|
34711
33839
|
};
|
34712
|
-
var bitMask = (n) => (
|
33840
|
+
var bitMask = (n) => (_2n2 << BigInt(n - 1)) - _1n2;
|
34713
33841
|
var u8n = (data) => new Uint8Array(data);
|
34714
33842
|
var u8fr = (arr) => Uint8Array.from(arr);
|
34715
33843
|
function createHmacDrbg(hashLen, qByteLen, hmacFn) {
|
@@ -34736,7 +33864,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
34736
33864
|
k = h(u8fr([1]), seed);
|
34737
33865
|
v = h();
|
34738
33866
|
};
|
34739
|
-
const
|
33867
|
+
const gen2 = () => {
|
34740
33868
|
if (i++ >= 1e3)
|
34741
33869
|
throw new Error("drbg: tried 1000 values");
|
34742
33870
|
let len = 0;
|
@@ -34753,7 +33881,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
34753
33881
|
reset();
|
34754
33882
|
reseed(seed);
|
34755
33883
|
let res = void 0;
|
34756
|
-
while (!(res = pred(
|
33884
|
+
while (!(res = pred(gen2())))
|
34757
33885
|
reseed();
|
34758
33886
|
reset();
|
34759
33887
|
return res;
|
@@ -39638,27 +38766,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
39638
38766
|
name = "NoWitnessByOwnerError";
|
39639
38767
|
};
|
39640
38768
|
|
39641
|
-
// src/providers/transaction-request/helpers.ts
|
39642
|
-
var isRequestInputCoin = (input) => input.type === InputType.Coin;
|
39643
|
-
var isRequestInputMessage = (input) => input.type === InputType.Message;
|
39644
|
-
var isRequestInputResource = (input) => isRequestInputCoin(input) || isRequestInputMessage(input);
|
39645
|
-
var getRequestInputResourceOwner = (input) => isRequestInputCoin(input) ? input.owner : input.recipient;
|
39646
|
-
var isRequestInputResourceFromOwner = (input, owner) => getRequestInputResourceOwner(input) === owner.toB256();
|
39647
|
-
var cacheResources = (resources) => resources.reduce(
|
39648
|
-
(cache2, resource) => {
|
39649
|
-
if (isCoin(resource)) {
|
39650
|
-
cache2.utxos.push(resource.id);
|
39651
|
-
} else {
|
39652
|
-
cache2.messages.push(resource.nonce);
|
39653
|
-
}
|
39654
|
-
return cache2;
|
39655
|
-
},
|
39656
|
-
{
|
39657
|
-
utxos: [],
|
39658
|
-
messages: []
|
39659
|
-
}
|
39660
|
-
);
|
39661
|
-
|
39662
38769
|
// src/providers/transaction-request/witness.ts
|
39663
38770
|
var witnessify = (value) => {
|
39664
38771
|
const data = arrayify(value);
|
@@ -39897,7 +39004,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
39897
39004
|
* @param coin - Coin resource.
|
39898
39005
|
*/
|
39899
39006
|
addCoinInput(coin) {
|
39900
|
-
const { assetId, owner, amount
|
39007
|
+
const { assetId, owner, amount } = coin;
|
39901
39008
|
let witnessIndex;
|
39902
39009
|
if (coin.predicate) {
|
39903
39010
|
witnessIndex = 0;
|
@@ -39908,14 +39015,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
39908
39015
|
}
|
39909
39016
|
}
|
39910
39017
|
const input = {
|
39911
|
-
|
39018
|
+
...coin,
|
39912
39019
|
type: InputType.Coin,
|
39913
39020
|
owner: owner.toB256(),
|
39914
39021
|
amount,
|
39915
39022
|
assetId,
|
39916
39023
|
txPointer: "0x00000000000000000000000000000000",
|
39917
|
-
witnessIndex
|
39918
|
-
predicate
|
39024
|
+
witnessIndex
|
39919
39025
|
};
|
39920
39026
|
this.pushInput(input);
|
39921
39027
|
this.addChangeOutput(owner, assetId);
|
@@ -39927,7 +39033,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
39927
39033
|
* @param message - Message resource.
|
39928
39034
|
*/
|
39929
39035
|
addMessageInput(message) {
|
39930
|
-
const { recipient, sender, amount,
|
39036
|
+
const { recipient, sender, amount, assetId } = message;
|
39931
39037
|
let witnessIndex;
|
39932
39038
|
if (message.predicate) {
|
39933
39039
|
witnessIndex = 0;
|
@@ -39938,13 +39044,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
39938
39044
|
}
|
39939
39045
|
}
|
39940
39046
|
const input = {
|
39941
|
-
|
39047
|
+
...message,
|
39942
39048
|
type: InputType.Message,
|
39943
39049
|
sender: sender.toB256(),
|
39944
39050
|
recipient: recipient.toB256(),
|
39945
39051
|
amount,
|
39946
|
-
witnessIndex
|
39947
|
-
predicate
|
39052
|
+
witnessIndex
|
39948
39053
|
};
|
39949
39054
|
this.pushInput(input);
|
39950
39055
|
this.addChangeOutput(recipient, assetId);
|
@@ -40128,17 +39233,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
40128
39233
|
toJSON() {
|
40129
39234
|
return normalizeJSON(this);
|
40130
39235
|
}
|
40131
|
-
removeWitness(index) {
|
40132
|
-
this.witnesses.splice(index, 1);
|
40133
|
-
this.adjustWitnessIndexes(index);
|
40134
|
-
}
|
40135
|
-
adjustWitnessIndexes(removedIndex) {
|
40136
|
-
this.inputs.filter(isRequestInputResource).forEach((input) => {
|
40137
|
-
if (input.witnessIndex > removedIndex) {
|
40138
|
-
input.witnessIndex -= 1;
|
40139
|
-
}
|
40140
|
-
});
|
40141
|
-
}
|
40142
39236
|
updatePredicateGasUsed(inputs) {
|
40143
39237
|
this.inputs.forEach((i) => {
|
40144
39238
|
let correspondingInput;
|
@@ -41327,7 +40421,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
41327
40421
|
}
|
41328
40422
|
|
41329
40423
|
// src/providers/transaction-response/transaction-response.ts
|
41330
|
-
var
|
40424
|
+
var TransactionResponse = class {
|
41331
40425
|
/** Transaction ID */
|
41332
40426
|
id;
|
41333
40427
|
/** Current provider */
|
@@ -41357,7 +40451,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
41357
40451
|
* @param provider - The provider.
|
41358
40452
|
*/
|
41359
40453
|
static async create(id, provider, abis) {
|
41360
|
-
const response = new
|
40454
|
+
const response = new TransactionResponse(id, provider, abis);
|
41361
40455
|
await response.fetch();
|
41362
40456
|
return response;
|
41363
40457
|
}
|
@@ -41751,21 +40845,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
41751
40845
|
} = await this.operations.getVersion();
|
41752
40846
|
return nodeVersion;
|
41753
40847
|
}
|
41754
|
-
/**
|
41755
|
-
* @hidden
|
41756
|
-
*
|
41757
|
-
* Returns the network configuration of the connected Fuel node.
|
41758
|
-
*
|
41759
|
-
* @returns A promise that resolves to the network configuration object
|
41760
|
-
*/
|
41761
|
-
async getNetwork() {
|
41762
|
-
const {
|
41763
|
-
name,
|
41764
|
-
consensusParameters: { chainId }
|
41765
|
-
} = await this.getChain();
|
41766
|
-
const network = new Network(name, chainId.toNumber());
|
41767
|
-
return Promise.resolve(network);
|
41768
|
-
}
|
41769
40848
|
/**
|
41770
40849
|
* Returns the block number.
|
41771
40850
|
*
|
@@ -41859,14 +40938,14 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
41859
40938
|
}
|
41860
40939
|
}
|
41861
40940
|
const transactionId2 = transactionRequest.getTransactionId(this.getChainId());
|
41862
|
-
const response = new
|
40941
|
+
const response = new TransactionResponse(transactionId2, this, abis);
|
41863
40942
|
await response.fetch();
|
41864
40943
|
return response;
|
41865
40944
|
}
|
41866
40945
|
const {
|
41867
40946
|
submit: { id: transactionId }
|
41868
40947
|
} = await this.operations.submit({ encodedTransaction });
|
41869
|
-
return new
|
40948
|
+
return new TransactionResponse(transactionId, this, abis);
|
41870
40949
|
}
|
41871
40950
|
/**
|
41872
40951
|
* Executes a transaction without actually submitting it to the chain.
|
@@ -42614,7 +41693,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
42614
41693
|
}
|
42615
41694
|
// eslint-disable-next-line @typescript-eslint/require-await
|
42616
41695
|
async getTransactionResponse(transactionId) {
|
42617
|
-
return new
|
41696
|
+
return new TransactionResponse(transactionId, this);
|
42618
41697
|
}
|
42619
41698
|
};
|
42620
41699
|
var Provider = _Provider;
|
@@ -43313,9 +42392,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43313
42392
|
};
|
43314
42393
|
|
43315
42394
|
// ../../node_modules/.pnpm/@noble+curves@1.3.0/node_modules/@noble/curves/esm/abstract/modular.js
|
43316
|
-
var
|
43317
|
-
var
|
43318
|
-
var
|
42395
|
+
var _0n3 = BigInt(0);
|
42396
|
+
var _1n3 = BigInt(1);
|
42397
|
+
var _2n3 = BigInt(2);
|
43319
42398
|
var _3n = BigInt(3);
|
43320
42399
|
var _4n = BigInt(4);
|
43321
42400
|
var _5n = BigInt(5);
|
@@ -43324,38 +42403,38 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43324
42403
|
var _16n = BigInt(16);
|
43325
42404
|
function mod(a, b) {
|
43326
42405
|
const result = a % b;
|
43327
|
-
return result >=
|
42406
|
+
return result >= _0n3 ? result : b + result;
|
43328
42407
|
}
|
43329
42408
|
function pow(num, power, modulo) {
|
43330
|
-
if (modulo <=
|
42409
|
+
if (modulo <= _0n3 || power < _0n3)
|
43331
42410
|
throw new Error("Expected power/modulo > 0");
|
43332
|
-
if (modulo ===
|
43333
|
-
return
|
43334
|
-
let res =
|
43335
|
-
while (power >
|
43336
|
-
if (power &
|
42411
|
+
if (modulo === _1n3)
|
42412
|
+
return _0n3;
|
42413
|
+
let res = _1n3;
|
42414
|
+
while (power > _0n3) {
|
42415
|
+
if (power & _1n3)
|
43337
42416
|
res = res * num % modulo;
|
43338
42417
|
num = num * num % modulo;
|
43339
|
-
power >>=
|
42418
|
+
power >>= _1n3;
|
43340
42419
|
}
|
43341
42420
|
return res;
|
43342
42421
|
}
|
43343
42422
|
function pow2(x, power, modulo) {
|
43344
42423
|
let res = x;
|
43345
|
-
while (power-- >
|
42424
|
+
while (power-- > _0n3) {
|
43346
42425
|
res *= res;
|
43347
42426
|
res %= modulo;
|
43348
42427
|
}
|
43349
42428
|
return res;
|
43350
42429
|
}
|
43351
42430
|
function invert(number3, modulo) {
|
43352
|
-
if (number3 ===
|
42431
|
+
if (number3 === _0n3 || modulo <= _0n3) {
|
43353
42432
|
throw new Error(`invert: expected positive integers, got n=${number3} mod=${modulo}`);
|
43354
42433
|
}
|
43355
42434
|
let a = mod(number3, modulo);
|
43356
42435
|
let b = modulo;
|
43357
|
-
let x =
|
43358
|
-
while (a !==
|
42436
|
+
let x = _0n3, y = _1n3, u = _1n3, v = _0n3;
|
42437
|
+
while (a !== _0n3) {
|
43359
42438
|
const q = b / a;
|
43360
42439
|
const r = b % a;
|
43361
42440
|
const m = x - u * q;
|
@@ -43363,19 +42442,19 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43363
42442
|
b = a, a = r, x = u, y = v, u = m, v = n;
|
43364
42443
|
}
|
43365
42444
|
const gcd = b;
|
43366
|
-
if (gcd !==
|
42445
|
+
if (gcd !== _1n3)
|
43367
42446
|
throw new Error("invert: does not exist");
|
43368
42447
|
return mod(x, modulo);
|
43369
42448
|
}
|
43370
42449
|
function tonelliShanks(P) {
|
43371
|
-
const legendreC = (P -
|
42450
|
+
const legendreC = (P - _1n3) / _2n3;
|
43372
42451
|
let Q, S, Z;
|
43373
|
-
for (Q = P -
|
42452
|
+
for (Q = P - _1n3, S = 0; Q % _2n3 === _0n3; Q /= _2n3, S++)
|
43374
42453
|
;
|
43375
|
-
for (Z =
|
42454
|
+
for (Z = _2n3; Z < P && pow(Z, legendreC, P) !== P - _1n3; Z++)
|
43376
42455
|
;
|
43377
42456
|
if (S === 1) {
|
43378
|
-
const p1div4 = (P +
|
42457
|
+
const p1div4 = (P + _1n3) / _4n;
|
43379
42458
|
return function tonelliFast(Fp2, n) {
|
43380
42459
|
const root = Fp2.pow(n, p1div4);
|
43381
42460
|
if (!Fp2.eql(Fp2.sqr(root), n))
|
@@ -43383,7 +42462,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43383
42462
|
return root;
|
43384
42463
|
};
|
43385
42464
|
}
|
43386
|
-
const Q1div2 = (Q +
|
42465
|
+
const Q1div2 = (Q + _1n3) / _2n3;
|
43387
42466
|
return function tonelliSlow(Fp2, n) {
|
43388
42467
|
if (Fp2.pow(n, legendreC) === Fp2.neg(Fp2.ONE))
|
43389
42468
|
throw new Error("Cannot find square root");
|
@@ -43400,7 +42479,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43400
42479
|
break;
|
43401
42480
|
t2 = Fp2.sqr(t2);
|
43402
42481
|
}
|
43403
|
-
const ge = Fp2.pow(g,
|
42482
|
+
const ge = Fp2.pow(g, _1n3 << BigInt(r - m - 1));
|
43404
42483
|
g = Fp2.sqr(ge);
|
43405
42484
|
x = Fp2.mul(x, ge);
|
43406
42485
|
b = Fp2.mul(b, g);
|
@@ -43411,7 +42490,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43411
42490
|
}
|
43412
42491
|
function FpSqrt(P) {
|
43413
42492
|
if (P % _4n === _3n) {
|
43414
|
-
const p1div4 = (P +
|
42493
|
+
const p1div4 = (P + _1n3) / _4n;
|
43415
42494
|
return function sqrt3mod4(Fp2, n) {
|
43416
42495
|
const root = Fp2.pow(n, p1div4);
|
43417
42496
|
if (!Fp2.eql(Fp2.sqr(root), n))
|
@@ -43422,10 +42501,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43422
42501
|
if (P % _8n === _5n) {
|
43423
42502
|
const c1 = (P - _5n) / _8n;
|
43424
42503
|
return function sqrt5mod8(Fp2, n) {
|
43425
|
-
const n2 = Fp2.mul(n,
|
42504
|
+
const n2 = Fp2.mul(n, _2n3);
|
43426
42505
|
const v = Fp2.pow(n2, c1);
|
43427
42506
|
const nv = Fp2.mul(n, v);
|
43428
|
-
const i = Fp2.mul(Fp2.mul(nv,
|
42507
|
+
const i = Fp2.mul(Fp2.mul(nv, _2n3), v);
|
43429
42508
|
const root = Fp2.mul(nv, Fp2.sub(i, Fp2.ONE));
|
43430
42509
|
if (!Fp2.eql(Fp2.sqr(root), n))
|
43431
42510
|
throw new Error("Cannot find square root");
|
@@ -43469,19 +42548,19 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43469
42548
|
return validateObject(field, opts);
|
43470
42549
|
}
|
43471
42550
|
function FpPow(f2, num, power) {
|
43472
|
-
if (power <
|
42551
|
+
if (power < _0n3)
|
43473
42552
|
throw new Error("Expected power > 0");
|
43474
|
-
if (power ===
|
42553
|
+
if (power === _0n3)
|
43475
42554
|
return f2.ONE;
|
43476
|
-
if (power ===
|
42555
|
+
if (power === _1n3)
|
43477
42556
|
return num;
|
43478
42557
|
let p = f2.ONE;
|
43479
42558
|
let d = num;
|
43480
|
-
while (power >
|
43481
|
-
if (power &
|
42559
|
+
while (power > _0n3) {
|
42560
|
+
if (power & _1n3)
|
43482
42561
|
p = f2.mul(p, d);
|
43483
42562
|
d = f2.sqr(d);
|
43484
|
-
power >>=
|
42563
|
+
power >>= _1n3;
|
43485
42564
|
}
|
43486
42565
|
return p;
|
43487
42566
|
}
|
@@ -43508,7 +42587,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43508
42587
|
return { nBitLength: _nBitLength, nByteLength };
|
43509
42588
|
}
|
43510
42589
|
function Field(ORDER, bitLen2, isLE3 = false, redef = {}) {
|
43511
|
-
if (ORDER <=
|
42590
|
+
if (ORDER <= _0n3)
|
43512
42591
|
throw new Error(`Expected Field ORDER > 0, got ${ORDER}`);
|
43513
42592
|
const { nBitLength: BITS, nByteLength: BYTES } = nLength(ORDER, bitLen2);
|
43514
42593
|
if (BYTES > 2048)
|
@@ -43519,16 +42598,16 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43519
42598
|
BITS,
|
43520
42599
|
BYTES,
|
43521
42600
|
MASK: bitMask(BITS),
|
43522
|
-
ZERO:
|
43523
|
-
ONE:
|
42601
|
+
ZERO: _0n3,
|
42602
|
+
ONE: _1n3,
|
43524
42603
|
create: (num) => mod(num, ORDER),
|
43525
42604
|
isValid: (num) => {
|
43526
42605
|
if (typeof num !== "bigint")
|
43527
42606
|
throw new Error(`Invalid field element: expected bigint, got ${typeof num}`);
|
43528
|
-
return
|
42607
|
+
return _0n3 <= num && num < ORDER;
|
43529
42608
|
},
|
43530
|
-
is0: (num) => num ===
|
43531
|
-
isOdd: (num) => (num &
|
42609
|
+
is0: (num) => num === _0n3,
|
42610
|
+
isOdd: (num) => (num & _1n3) === _1n3,
|
43532
42611
|
neg: (num) => mod(-num, ORDER),
|
43533
42612
|
eql: (lhs, rhs) => lhs === rhs,
|
43534
42613
|
sqr: (num) => mod(num * num, ORDER),
|
@@ -43574,13 +42653,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43574
42653
|
if (len < 16 || len < minLen || len > 1024)
|
43575
42654
|
throw new Error(`expected ${minLen}-1024 bytes of input, got ${len}`);
|
43576
42655
|
const num = isLE3 ? bytesToNumberBE(key) : bytesToNumberLE(key);
|
43577
|
-
const reduced = mod(num, fieldOrder -
|
42656
|
+
const reduced = mod(num, fieldOrder - _1n3) + _1n3;
|
43578
42657
|
return isLE3 ? numberToBytesLE(reduced, fieldLen) : numberToBytesBE(reduced, fieldLen);
|
43579
42658
|
}
|
43580
42659
|
|
43581
42660
|
// ../../node_modules/.pnpm/@noble+curves@1.3.0/node_modules/@noble/curves/esm/abstract/curve.js
|
43582
|
-
var
|
43583
|
-
var
|
42661
|
+
var _0n4 = BigInt(0);
|
42662
|
+
var _1n4 = BigInt(1);
|
43584
42663
|
function wNAF(c, bits) {
|
43585
42664
|
const constTimeNegate = (condition, item) => {
|
43586
42665
|
const neg = item.negate();
|
@@ -43597,11 +42676,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43597
42676
|
unsafeLadder(elm, n) {
|
43598
42677
|
let p = c.ZERO;
|
43599
42678
|
let d = elm;
|
43600
|
-
while (n >
|
43601
|
-
if (n &
|
42679
|
+
while (n > _0n4) {
|
42680
|
+
if (n & _1n4)
|
43602
42681
|
p = p.add(d);
|
43603
42682
|
d = d.double();
|
43604
|
-
n >>=
|
42683
|
+
n >>= _1n4;
|
43605
42684
|
}
|
43606
42685
|
return p;
|
43607
42686
|
},
|
@@ -43651,7 +42730,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43651
42730
|
n >>= shiftBy;
|
43652
42731
|
if (wbits > windowSize) {
|
43653
42732
|
wbits -= maxNumber;
|
43654
|
-
n +=
|
42733
|
+
n += _1n4;
|
43655
42734
|
}
|
43656
42735
|
const offset1 = offset;
|
43657
42736
|
const offset2 = offset + Math.abs(wbits) - 1;
|
@@ -43775,9 +42854,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43775
42854
|
return `30${h(rhl + shl + 4)}02${rl}${r}02${sl}${s}`;
|
43776
42855
|
}
|
43777
42856
|
};
|
43778
|
-
var
|
43779
|
-
var
|
43780
|
-
var
|
42857
|
+
var _0n5 = BigInt(0);
|
42858
|
+
var _1n5 = BigInt(1);
|
42859
|
+
var _2n4 = BigInt(2);
|
43781
42860
|
var _3n2 = BigInt(3);
|
43782
42861
|
var _4n2 = BigInt(4);
|
43783
42862
|
function weierstrassPoints(opts) {
|
@@ -43802,7 +42881,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43802
42881
|
if (!Fp2.eql(Fp2.sqr(CURVE.Gy), weierstrassEquation(CURVE.Gx)))
|
43803
42882
|
throw new Error("bad generator point: equation left != right");
|
43804
42883
|
function isWithinCurveOrder(num) {
|
43805
|
-
return typeof num === "bigint" &&
|
42884
|
+
return typeof num === "bigint" && _0n5 < num && num < CURVE.n;
|
43806
42885
|
}
|
43807
42886
|
function assertGE(num) {
|
43808
42887
|
if (!isWithinCurveOrder(num))
|
@@ -44046,10 +43125,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44046
43125
|
*/
|
44047
43126
|
multiplyUnsafe(n) {
|
44048
43127
|
const I = Point2.ZERO;
|
44049
|
-
if (n ===
|
43128
|
+
if (n === _0n5)
|
44050
43129
|
return I;
|
44051
43130
|
assertGE(n);
|
44052
|
-
if (n ===
|
43131
|
+
if (n === _1n5)
|
44053
43132
|
return this;
|
44054
43133
|
const { endo } = CURVE;
|
44055
43134
|
if (!endo)
|
@@ -44058,14 +43137,14 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44058
43137
|
let k1p = I;
|
44059
43138
|
let k2p = I;
|
44060
43139
|
let d = this;
|
44061
|
-
while (k1 >
|
44062
|
-
if (k1 &
|
43140
|
+
while (k1 > _0n5 || k2 > _0n5) {
|
43141
|
+
if (k1 & _1n5)
|
44063
43142
|
k1p = k1p.add(d);
|
44064
|
-
if (k2 &
|
43143
|
+
if (k2 & _1n5)
|
44065
43144
|
k2p = k2p.add(d);
|
44066
43145
|
d = d.double();
|
44067
|
-
k1 >>=
|
44068
|
-
k2 >>=
|
43146
|
+
k1 >>= _1n5;
|
43147
|
+
k2 >>= _1n5;
|
44069
43148
|
}
|
44070
43149
|
if (k1neg)
|
44071
43150
|
k1p = k1p.negate();
|
@@ -44112,7 +43191,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44112
43191
|
*/
|
44113
43192
|
multiplyAndAddUnsafe(Q, a, b) {
|
44114
43193
|
const G = Point2.BASE;
|
44115
|
-
const mul = (P, a2) => a2 ===
|
43194
|
+
const mul = (P, a2) => a2 === _0n5 || a2 === _1n5 || !P.equals(G) ? P.multiplyUnsafe(a2) : P.multiply(a2);
|
44116
43195
|
const sum = mul(this, a).add(mul(Q, b));
|
44117
43196
|
return sum.is0() ? void 0 : sum;
|
44118
43197
|
}
|
@@ -44135,7 +43214,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44135
43214
|
}
|
44136
43215
|
isTorsionFree() {
|
44137
43216
|
const { h: cofactor, isTorsionFree } = CURVE;
|
44138
|
-
if (cofactor ===
|
43217
|
+
if (cofactor === _1n5)
|
44139
43218
|
return true;
|
44140
43219
|
if (isTorsionFree)
|
44141
43220
|
return isTorsionFree(Point2, this);
|
@@ -44143,7 +43222,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44143
43222
|
}
|
44144
43223
|
clearCofactor() {
|
44145
43224
|
const { h: cofactor, clearCofactor } = CURVE;
|
44146
|
-
if (cofactor ===
|
43225
|
+
if (cofactor === _1n5)
|
44147
43226
|
return this;
|
44148
43227
|
if (clearCofactor)
|
44149
43228
|
return clearCofactor(Point2, this);
|
@@ -44188,7 +43267,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44188
43267
|
const compressedLen = Fp2.BYTES + 1;
|
44189
43268
|
const uncompressedLen = 2 * Fp2.BYTES + 1;
|
44190
43269
|
function isValidFieldElement(num) {
|
44191
|
-
return
|
43270
|
+
return _0n5 < num && num < Fp2.ORDER;
|
44192
43271
|
}
|
44193
43272
|
function modN(a) {
|
44194
43273
|
return mod(a, CURVE_ORDER);
|
@@ -44218,7 +43297,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44218
43297
|
throw new Error("Point is not on curve");
|
44219
43298
|
const y2 = weierstrassEquation(x);
|
44220
43299
|
let y = Fp2.sqrt(y2);
|
44221
|
-
const isYOdd = (y &
|
43300
|
+
const isYOdd = (y & _1n5) === _1n5;
|
44222
43301
|
const isHeadOdd = (head & 1) === 1;
|
44223
43302
|
if (isHeadOdd !== isYOdd)
|
44224
43303
|
y = Fp2.neg(y);
|
@@ -44234,7 +43313,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44234
43313
|
});
|
44235
43314
|
const numToNByteStr = (num) => bytesToHex(numberToBytesBE(num, CURVE.nByteLength));
|
44236
43315
|
function isBiggerThanHalfOrder(number3) {
|
44237
|
-
const HALF = CURVE_ORDER >>
|
43316
|
+
const HALF = CURVE_ORDER >> _1n5;
|
44238
43317
|
return number3 > HALF;
|
44239
43318
|
}
|
44240
43319
|
function normalizeS(s) {
|
@@ -44377,7 +43456,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44377
43456
|
function int2octets(num) {
|
44378
43457
|
if (typeof num !== "bigint")
|
44379
43458
|
throw new Error("bigint expected");
|
44380
|
-
if (!(
|
43459
|
+
if (!(_0n5 <= num && num < ORDER_MASK))
|
44381
43460
|
throw new Error(`bigint expected < 2^${CURVE.nBitLength}`);
|
44382
43461
|
return numberToBytesBE(num, CURVE.nByteLength);
|
44383
43462
|
}
|
@@ -44407,12 +43486,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44407
43486
|
const ik = invN(k);
|
44408
43487
|
const q = Point2.BASE.multiply(k).toAffine();
|
44409
43488
|
const r = modN(q.x);
|
44410
|
-
if (r ===
|
43489
|
+
if (r === _0n5)
|
44411
43490
|
return;
|
44412
43491
|
const s = modN(ik * modN(m + r * d));
|
44413
|
-
if (s ===
|
43492
|
+
if (s === _0n5)
|
44414
43493
|
return;
|
44415
|
-
let recovery = (q.x === r ? 0 : 2) | Number(q.y &
|
43494
|
+
let recovery = (q.x === r ? 0 : 2) | Number(q.y & _1n5);
|
44416
43495
|
let normS = s;
|
44417
43496
|
if (lowS && isBiggerThanHalfOrder(s)) {
|
44418
43497
|
normS = normalizeS(s);
|
@@ -44504,9 +43583,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44504
43583
|
// ../../node_modules/.pnpm/@noble+curves@1.3.0/node_modules/@noble/curves/esm/secp256k1.js
|
44505
43584
|
var secp256k1P = BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f");
|
44506
43585
|
var secp256k1N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");
|
44507
|
-
var
|
44508
|
-
var
|
44509
|
-
var divNearest = (a, b) => (a + b /
|
43586
|
+
var _1n6 = BigInt(1);
|
43587
|
+
var _2n5 = BigInt(2);
|
43588
|
+
var divNearest = (a, b) => (a + b / _2n5) / b;
|
44510
43589
|
function sqrtMod(y) {
|
44511
43590
|
const P = secp256k1P;
|
44512
43591
|
const _3n3 = BigInt(3), _6n = BigInt(6), _11n = BigInt(11), _22n = BigInt(22);
|
@@ -44515,7 +43594,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44515
43594
|
const b3 = b2 * b2 * y % P;
|
44516
43595
|
const b6 = pow2(b3, _3n3, P) * b3 % P;
|
44517
43596
|
const b9 = pow2(b6, _3n3, P) * b3 % P;
|
44518
|
-
const b11 = pow2(b9,
|
43597
|
+
const b11 = pow2(b9, _2n5, P) * b2 % P;
|
44519
43598
|
const b22 = pow2(b11, _11n, P) * b11 % P;
|
44520
43599
|
const b44 = pow2(b22, _22n, P) * b22 % P;
|
44521
43600
|
const b88 = pow2(b44, _44n, P) * b44 % P;
|
@@ -44524,7 +43603,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44524
43603
|
const b223 = pow2(b220, _3n3, P) * b3 % P;
|
44525
43604
|
const t1 = pow2(b223, _23n, P) * b22 % P;
|
44526
43605
|
const t2 = pow2(t1, _6n, P) * b2 % P;
|
44527
|
-
const root = pow2(t2,
|
43606
|
+
const root = pow2(t2, _2n5, P);
|
44528
43607
|
if (!Fp.eql(Fp.sqr(root), y))
|
44529
43608
|
throw new Error("Cannot find square root");
|
44530
43609
|
return root;
|
@@ -44557,7 +43636,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44557
43636
|
splitScalar: (k) => {
|
44558
43637
|
const n = secp256k1N;
|
44559
43638
|
const a1 = BigInt("0x3086d221a7d46bcde86c90e49284eb15");
|
44560
|
-
const b1 = -
|
43639
|
+
const b1 = -_1n6 * BigInt("0xe4437ed6010e88286f547fa90abfe4c3");
|
44561
43640
|
const a2 = BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8");
|
44562
43641
|
const b2 = a1;
|
44563
43642
|
const POW_2_128 = BigInt("0x100000000000000000000000000000000");
|
@@ -44578,7 +43657,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44578
43657
|
}
|
44579
43658
|
}
|
44580
43659
|
}, sha256);
|
44581
|
-
var
|
43660
|
+
var _0n6 = BigInt(0);
|
44582
43661
|
var Point = secp256k1.ProjectivePoint;
|
44583
43662
|
|
44584
43663
|
// src/signer/signer.ts
|
@@ -44685,12 +43764,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44685
43764
|
};
|
44686
43765
|
|
44687
43766
|
// ../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-node/rng.js
|
44688
|
-
var
|
43767
|
+
var import_crypto15 = __toESM(__require("crypto"));
|
44689
43768
|
var rnds8Pool = new Uint8Array(256);
|
44690
43769
|
var poolPtr = rnds8Pool.length;
|
44691
43770
|
function rng() {
|
44692
43771
|
if (poolPtr > rnds8Pool.length - 16) {
|
44693
|
-
|
43772
|
+
import_crypto15.default.randomFillSync(rnds8Pool);
|
44694
43773
|
poolPtr = 0;
|
44695
43774
|
}
|
44696
43775
|
return rnds8Pool.slice(poolPtr, poolPtr += 16);
|
@@ -44706,9 +43785,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44706
43785
|
}
|
44707
43786
|
|
44708
43787
|
// ../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-node/native.js
|
44709
|
-
var
|
43788
|
+
var import_crypto16 = __toESM(__require("crypto"));
|
44710
43789
|
var native_default = {
|
44711
|
-
randomUUID:
|
43790
|
+
randomUUID: import_crypto16.default.randomUUID
|
44712
43791
|
};
|
44713
43792
|
|
44714
43793
|
// ../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-node/v4.js
|
@@ -48167,15 +47246,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
48167
47246
|
populateTransactionPredicateData(transactionRequestLike) {
|
48168
47247
|
const request = transactionRequestify(transactionRequestLike);
|
48169
47248
|
const { policies } = BaseTransactionRequest.getPolicyMeta(request);
|
48170
|
-
|
48171
|
-
|
48172
|
-
request.removeWitness(placeholderIndex);
|
48173
|
-
}
|
48174
|
-
request.inputs.filter(isRequestInputResource).forEach((input) => {
|
48175
|
-
if (isRequestInputResourceFromOwner(input, this.address)) {
|
47249
|
+
request.inputs?.forEach((input) => {
|
47250
|
+
if (input.type === InputType.Coin && hexlify(input.owner) === this.address.toB256()) {
|
48176
47251
|
input.predicate = hexlify(this.bytes);
|
48177
47252
|
input.predicateData = hexlify(this.getPredicateData(policies.length));
|
48178
|
-
input.witnessIndex = 0;
|
48179
47253
|
}
|
48180
47254
|
});
|
48181
47255
|
return request;
|
@@ -48298,28 +47372,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
48298
47372
|
}
|
48299
47373
|
return mutatedBytes;
|
48300
47374
|
}
|
48301
|
-
/**
|
48302
|
-
* Returns the index of the witness placeholder that was added to this predicate.
|
48303
|
-
* If no witness placeholder was added, it returns -1.
|
48304
|
-
* @param request - The transaction request.
|
48305
|
-
* @returns The index of the witness placeholder, or -1 if there is no witness placeholder.
|
48306
|
-
*/
|
48307
|
-
getIndexFromPlaceholderWitness(request) {
|
48308
|
-
const predicateInputs = request.inputs.filter(isRequestInputResource).filter((input) => isRequestInputResourceFromOwner(input, this.address));
|
48309
|
-
let index = -1;
|
48310
|
-
const hasEmptyPredicateInputs = predicateInputs.find((input) => !input.predicate);
|
48311
|
-
if (hasEmptyPredicateInputs) {
|
48312
|
-
index = hasEmptyPredicateInputs.witnessIndex;
|
48313
|
-
const allInputsAreEmpty = predicateInputs.every((input) => !input.predicate);
|
48314
|
-
if (!allInputsAreEmpty) {
|
48315
|
-
const wasFilledInputAddedFirst = !!predicateInputs[0]?.predicate;
|
48316
|
-
if (wasFilledInputAddedFirst) {
|
48317
|
-
index = -1;
|
48318
|
-
}
|
48319
|
-
}
|
48320
|
-
}
|
48321
|
-
return index;
|
48322
|
-
}
|
48323
47375
|
};
|
48324
47376
|
|
48325
47377
|
// src/connectors/fuel-connector.ts
|