@fuel-ts/account 0.0.0-rc-2152-20240429145747 → 0.0.0-rc-2037-20240430003658

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.

Files changed (36) hide show
  1. package/README.md +15 -12
  2. package/dist/index.global.js +1097 -126
  3. package/dist/index.global.js.map +1 -1
  4. package/dist/index.js +241 -128
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.mjs +146 -39
  7. package/dist/index.mjs.map +1 -1
  8. package/dist/predicate/predicate.d.ts +9 -2
  9. package/dist/predicate/predicate.d.ts.map +1 -1
  10. package/dist/providers/__generated__/operations.d.ts +17 -0
  11. package/dist/providers/__generated__/operations.d.ts.map +1 -1
  12. package/dist/providers/provider.d.ts +17 -1
  13. package/dist/providers/provider.d.ts.map +1 -1
  14. package/dist/providers/transaction-request/helpers.d.ts +10 -0
  15. package/dist/providers/transaction-request/helpers.d.ts.map +1 -0
  16. package/dist/providers/transaction-request/index.d.ts +1 -0
  17. package/dist/providers/transaction-request/index.d.ts.map +1 -1
  18. package/dist/providers/transaction-request/transaction-request.d.ts +2 -0
  19. package/dist/providers/transaction-request/transaction-request.d.ts.map +1 -1
  20. package/dist/test-utils/index.d.ts +1 -0
  21. package/dist/test-utils/index.d.ts.map +1 -1
  22. package/dist/test-utils/resources.d.ts +4 -0
  23. package/dist/test-utils/resources.d.ts.map +1 -0
  24. package/dist/test-utils/seedTestWallet.d.ts +1 -1
  25. package/dist/test-utils/seedTestWallet.d.ts.map +1 -1
  26. package/dist/test-utils/transactionRequest.d.ts +5 -0
  27. package/dist/test-utils/transactionRequest.d.ts.map +1 -0
  28. package/dist/test-utils.global.js +1104 -136
  29. package/dist/test-utils.global.js.map +1 -1
  30. package/dist/test-utils.js +228 -125
  31. package/dist/test-utils.js.map +1 -1
  32. package/dist/test-utils.mjs +142 -42
  33. package/dist/test-utils.mjs.map +1 -1
  34. package/dist/wallet/base-wallet-unlocked.d.ts +2 -2
  35. package/dist/wallet/base-wallet-unlocked.d.ts.map +1 -1
  36. package/package.json +15 -15
@@ -173,13 +173,13 @@
173
173
  if (str !== lowered && str !== uppered)
174
174
  return "Mixed-case string " + str;
175
175
  str = lowered;
176
- const split2 = str.lastIndexOf("1");
177
- if (split2 === -1)
176
+ const split3 = str.lastIndexOf("1");
177
+ if (split3 === -1)
178
178
  return "No separator character for " + str;
179
- if (split2 === 0)
179
+ if (split3 === 0)
180
180
  return "Missing prefix for " + str;
181
- const prefix = str.slice(0, split2);
182
- const wordChars = str.slice(split2 + 1);
181
+ const prefix = str.slice(0, split3);
182
+ const wordChars = str.slice(split3 + 1);
183
183
  if (wordChars.length < 6)
184
184
  return "Data too short";
185
185
  let chk = prefixChk(prefix);
@@ -1080,7 +1080,7 @@
1080
1080
  }
1081
1081
  return this;
1082
1082
  };
1083
- BN2.prototype.add = function add(num) {
1083
+ BN2.prototype.add = function add2(num) {
1084
1084
  var res;
1085
1085
  if (num.negative !== 0 && this.negative === 0) {
1086
1086
  num.negative = 0;
@@ -2794,7 +2794,7 @@
2794
2794
  }
2795
2795
  return r;
2796
2796
  };
2797
- MPrime.prototype.split = function split2(input, out) {
2797
+ MPrime.prototype.split = function split3(input, out) {
2798
2798
  input.iushrn(this.n, 0, out);
2799
2799
  };
2800
2800
  MPrime.prototype.imulK = function imulK(num) {
@@ -2808,7 +2808,7 @@
2808
2808
  );
2809
2809
  }
2810
2810
  inherits(K256, MPrime);
2811
- K256.prototype.split = function split2(input, output3) {
2811
+ K256.prototype.split = function split3(input, output3) {
2812
2812
  var mask2 = 4194303;
2813
2813
  var outLen = Math.min(input.length, 9);
2814
2814
  for (var i = 0; i < outLen; i++) {
@@ -2944,7 +2944,7 @@
2944
2944
  }
2945
2945
  return this.m.sub(a)._forceRed(this);
2946
2946
  };
2947
- Red.prototype.add = function add(a, b) {
2947
+ Red.prototype.add = function add2(a, b) {
2948
2948
  this._verify2(a, b);
2949
2949
  var res = a.add(b);
2950
2950
  if (res.cmp(this.m) >= 0) {
@@ -20408,7 +20408,7 @@ spurious results.`);
20408
20408
  }
20409
20409
  return instance.ptr;
20410
20410
  }
20411
- function add(dst, lhs, rhs) {
20411
+ function add2(dst, lhs, rhs) {
20412
20412
  const ret3 = wasm$1.add(dst, lhs, rhs);
20413
20413
  return Instruction.__wrap(ret3);
20414
20414
  }
@@ -27987,7 +27987,7 @@ spurious results.`);
27987
27987
  exports.WQOP = WQOP;
27988
27988
  exports.XOR = XOR;
27989
27989
  exports.XORI = XORI;
27990
- exports.add = add;
27990
+ exports.add = add2;
27991
27991
  exports.addi = addi2;
27992
27992
  exports.aloc = aloc;
27993
27993
  exports.and = and;
@@ -30264,13 +30264,13 @@ spurious results.`);
30264
30264
  createDebug.names = [];
30265
30265
  createDebug.skips = [];
30266
30266
  var i;
30267
- var split2 = (typeof namespaces === "string" ? namespaces : "").split(/[\s,]+/);
30268
- var len = split2.length;
30267
+ var split3 = (typeof namespaces === "string" ? namespaces : "").split(/[\s,]+/);
30268
+ var len = split3.length;
30269
30269
  for (i = 0; i < len; i++) {
30270
- if (!split2[i]) {
30270
+ if (!split3[i]) {
30271
30271
  continue;
30272
30272
  }
30273
- namespaces = split2[i].replace(/\*/g, ".*?");
30273
+ namespaces = split3[i].replace(/\*/g, ".*?");
30274
30274
  if (namespaces[0] === "-") {
30275
30275
  createDebug.skips.push(new RegExp("^" + namespaces.substr(1) + "$"));
30276
30276
  } else {
@@ -31198,9 +31198,9 @@ spurious results.`);
31198
31198
  function setBigUint64(view, byteOffset, value, isLE3) {
31199
31199
  if (typeof view.setBigUint64 === "function")
31200
31200
  return view.setBigUint64(byteOffset, value, isLE3);
31201
- const _32n2 = BigInt(32);
31201
+ const _32n3 = BigInt(32);
31202
31202
  const _u32_max = BigInt(4294967295);
31203
- const wh = Number(value >> _32n2 & _u32_max);
31203
+ const wh = Number(value >> _32n3 & _u32_max);
31204
31204
  const wl = Number(value & _u32_max);
31205
31205
  const h = isLE3 ? 4 : 0;
31206
31206
  const l = isLE3 ? 0 : 4;
@@ -32930,6 +32930,14 @@ This unreleased fuel-core build may include features and updates not yet support
32930
32930
  amount: 12704439083013452e3,
32931
32931
  data: "",
32932
32932
  da_height: 0
32933
+ },
32934
+ {
32935
+ sender: "0x22cae5308938e8b4caf217b6464884f6331eff05e81468df8ccd08126effc8d0",
32936
+ recipient: "0x8d2af98a4198732a46bf65d87a73427dd7608acaad2414585d8ccdd6f59c437b",
32937
+ nonce: "0x381de90750098776c71544527fd253412908dec3d07ce9a7367bd1ba975908a0",
32938
+ amount: 18446744073709552e3,
32939
+ data: "",
32940
+ da_height: 0
32933
32941
  }
32934
32942
  ],
32935
32943
  contracts: [],
@@ -32947,7 +32955,7 @@ This unreleased fuel-core build may include features and updates not yet support
32947
32955
  }
32948
32956
 
32949
32957
  // ../crypto/dist/index.mjs
32950
- var import_crypto7 = __toESM(__require("crypto"), 1);
32958
+ var import_crypto8 = __toESM(__require("crypto"), 1);
32951
32959
 
32952
32960
  // ../../node_modules/.pnpm/ethers@6.7.1/node_modules/ethers/lib.esm/_version.js
32953
32961
  var version = "6.7.1";
@@ -33114,6 +33122,18 @@ This unreleased fuel-core build may include features and updates not yet support
33114
33122
  function getBytes(value, name) {
33115
33123
  return _getBytes(value, name, false);
33116
33124
  }
33125
+ function isHexString(value, length) {
33126
+ if (typeof value !== "string" || !value.match(/^0x[0-9A-Fa-f]*$/)) {
33127
+ return false;
33128
+ }
33129
+ if (typeof length === "number" && value.length !== 2 + 2 * length) {
33130
+ return false;
33131
+ }
33132
+ if (length === true && value.length % 2 !== 0) {
33133
+ return false;
33134
+ }
33135
+ return true;
33136
+ }
33117
33137
  var HexCharacters2 = "0123456789abcdef";
33118
33138
  function hexlify2(data) {
33119
33139
  const bytes3 = getBytes(data);
@@ -33474,7 +33494,74 @@ This unreleased fuel-core build may include features and updates not yet support
33474
33494
  };
33475
33495
  var assert_default = assert2;
33476
33496
 
33497
+ // ../../node_modules/.pnpm/@noble+hashes@1.1.2/node_modules/@noble/hashes/esm/_u64.js
33498
+ var U32_MASK642 = BigInt(2 ** 32 - 1);
33499
+ var _32n2 = BigInt(32);
33500
+ function fromBig2(n, le = false) {
33501
+ if (le)
33502
+ return { h: Number(n & U32_MASK642), l: Number(n >> _32n2 & U32_MASK642) };
33503
+ return { h: Number(n >> _32n2 & U32_MASK642) | 0, l: Number(n & U32_MASK642) | 0 };
33504
+ }
33505
+ function split2(lst, le = false) {
33506
+ let Ah = new Uint32Array(lst.length);
33507
+ let Al = new Uint32Array(lst.length);
33508
+ for (let i = 0; i < lst.length; i++) {
33509
+ const { h, l } = fromBig2(lst[i], le);
33510
+ [Ah[i], Al[i]] = [h, l];
33511
+ }
33512
+ return [Ah, Al];
33513
+ }
33514
+ var toBig = (h, l) => BigInt(h >>> 0) << _32n2 | BigInt(l >>> 0);
33515
+ var shrSH = (h, l, s) => h >>> s;
33516
+ var shrSL = (h, l, s) => h << 32 - s | l >>> s;
33517
+ var rotrSH = (h, l, s) => h >>> s | l << 32 - s;
33518
+ var rotrSL = (h, l, s) => h << 32 - s | l >>> s;
33519
+ var rotrBH = (h, l, s) => h << 64 - s | l >>> s - 32;
33520
+ var rotrBL = (h, l, s) => h >>> s - 32 | l << 64 - s;
33521
+ var rotr32H = (h, l) => l;
33522
+ var rotr32L = (h, l) => h;
33523
+ var rotlSH2 = (h, l, s) => h << s | l >>> 32 - s;
33524
+ var rotlSL2 = (h, l, s) => l << s | h >>> 32 - s;
33525
+ var rotlBH2 = (h, l, s) => l << s - 32 | h >>> 64 - s;
33526
+ var rotlBL2 = (h, l, s) => h << s - 32 | l >>> 64 - s;
33527
+ function add(Ah, Al, Bh, Bl) {
33528
+ const l = (Al >>> 0) + (Bl >>> 0);
33529
+ return { h: Ah + Bh + (l / 2 ** 32 | 0) | 0, l: l | 0 };
33530
+ }
33531
+ var add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);
33532
+ var add3H = (low, Ah, Bh, Ch) => Ah + Bh + Ch + (low / 2 ** 32 | 0) | 0;
33533
+ var add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);
33534
+ var add4H = (low, Ah, Bh, Ch, Dh) => Ah + Bh + Ch + Dh + (low / 2 ** 32 | 0) | 0;
33535
+ var add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);
33536
+ var add5H = (low, Ah, Bh, Ch, Dh, Eh) => Ah + Bh + Ch + Dh + Eh + (low / 2 ** 32 | 0) | 0;
33537
+ var u64 = {
33538
+ fromBig: fromBig2,
33539
+ split: split2,
33540
+ toBig,
33541
+ shrSH,
33542
+ shrSL,
33543
+ rotrSH,
33544
+ rotrSL,
33545
+ rotrBH,
33546
+ rotrBL,
33547
+ rotr32H,
33548
+ rotr32L,
33549
+ rotlSH: rotlSH2,
33550
+ rotlSL: rotlSL2,
33551
+ rotlBH: rotlBH2,
33552
+ rotlBL: rotlBL2,
33553
+ add,
33554
+ add3L,
33555
+ add3H,
33556
+ add4L,
33557
+ add4H,
33558
+ add5H,
33559
+ add5L
33560
+ };
33561
+ var u64_default = u64;
33562
+
33477
33563
  // ../../node_modules/.pnpm/@noble+hashes@1.1.2/node_modules/@noble/hashes/esm/utils.js
33564
+ var u322 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
33478
33565
  var createView2 = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
33479
33566
  var isLE2 = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
33480
33567
  if (!isLE2)
@@ -33507,14 +33594,224 @@ This unreleased fuel-core build may include features and updates not yet support
33507
33594
  hashC.create = () => hashConstructor();
33508
33595
  return hashC;
33509
33596
  }
33597
+ function wrapConstructorWithOpts(hashCons) {
33598
+ const hashC = (msg, opts) => hashCons(opts).update(toBytes2(msg)).digest();
33599
+ const tmp = hashCons({});
33600
+ hashC.outputLen = tmp.outputLen;
33601
+ hashC.blockLen = tmp.blockLen;
33602
+ hashC.create = (opts) => hashCons(opts);
33603
+ return hashC;
33604
+ }
33605
+
33606
+ // ../../node_modules/.pnpm/@noble+hashes@1.1.2/node_modules/@noble/hashes/esm/sha3.js
33607
+ var [SHA3_PI2, SHA3_ROTL2, _SHA3_IOTA2] = [[], [], []];
33608
+ var _0n2 = BigInt(0);
33609
+ var _1n2 = BigInt(1);
33610
+ var _2n2 = BigInt(2);
33611
+ var _7n2 = BigInt(7);
33612
+ var _256n2 = BigInt(256);
33613
+ var _0x71n2 = BigInt(113);
33614
+ for (let round = 0, R = _1n2, x = 1, y = 0; round < 24; round++) {
33615
+ [x, y] = [y, (2 * x + 3 * y) % 5];
33616
+ SHA3_PI2.push(2 * (5 * y + x));
33617
+ SHA3_ROTL2.push((round + 1) * (round + 2) / 2 % 64);
33618
+ let t = _0n2;
33619
+ for (let j = 0; j < 7; j++) {
33620
+ R = (R << _1n2 ^ (R >> _7n2) * _0x71n2) % _256n2;
33621
+ if (R & _2n2)
33622
+ t ^= _1n2 << (_1n2 << BigInt(j)) - _1n2;
33623
+ }
33624
+ _SHA3_IOTA2.push(t);
33625
+ }
33626
+ var [SHA3_IOTA_H2, SHA3_IOTA_L2] = u64_default.split(_SHA3_IOTA2, true);
33627
+ var rotlH2 = (h, l, s) => s > 32 ? u64_default.rotlBH(h, l, s) : u64_default.rotlSH(h, l, s);
33628
+ var rotlL2 = (h, l, s) => s > 32 ? u64_default.rotlBL(h, l, s) : u64_default.rotlSL(h, l, s);
33629
+ function keccakP2(s, rounds = 24) {
33630
+ const B = new Uint32Array(5 * 2);
33631
+ for (let round = 24 - rounds; round < 24; round++) {
33632
+ for (let x = 0; x < 10; x++)
33633
+ B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40];
33634
+ for (let x = 0; x < 10; x += 2) {
33635
+ const idx1 = (x + 8) % 10;
33636
+ const idx0 = (x + 2) % 10;
33637
+ const B0 = B[idx0];
33638
+ const B1 = B[idx0 + 1];
33639
+ const Th = rotlH2(B0, B1, 1) ^ B[idx1];
33640
+ const Tl = rotlL2(B0, B1, 1) ^ B[idx1 + 1];
33641
+ for (let y = 0; y < 50; y += 10) {
33642
+ s[x + y] ^= Th;
33643
+ s[x + y + 1] ^= Tl;
33644
+ }
33645
+ }
33646
+ let curH = s[2];
33647
+ let curL = s[3];
33648
+ for (let t = 0; t < 24; t++) {
33649
+ const shift = SHA3_ROTL2[t];
33650
+ const Th = rotlH2(curH, curL, shift);
33651
+ const Tl = rotlL2(curH, curL, shift);
33652
+ const PI = SHA3_PI2[t];
33653
+ curH = s[PI];
33654
+ curL = s[PI + 1];
33655
+ s[PI] = Th;
33656
+ s[PI + 1] = Tl;
33657
+ }
33658
+ for (let y = 0; y < 50; y += 10) {
33659
+ for (let x = 0; x < 10; x++)
33660
+ B[x] = s[y + x];
33661
+ for (let x = 0; x < 10; x++)
33662
+ s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10];
33663
+ }
33664
+ s[0] ^= SHA3_IOTA_H2[round];
33665
+ s[1] ^= SHA3_IOTA_L2[round];
33666
+ }
33667
+ B.fill(0);
33668
+ }
33669
+ var Keccak2 = class extends Hash2 {
33670
+ // NOTE: we accept arguments in bytes instead of bits here.
33671
+ constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {
33672
+ super();
33673
+ this.blockLen = blockLen;
33674
+ this.suffix = suffix;
33675
+ this.outputLen = outputLen;
33676
+ this.enableXOF = enableXOF;
33677
+ this.rounds = rounds;
33678
+ this.pos = 0;
33679
+ this.posOut = 0;
33680
+ this.finished = false;
33681
+ this.destroyed = false;
33682
+ assert_default.number(outputLen);
33683
+ if (0 >= this.blockLen || this.blockLen >= 200)
33684
+ throw new Error("Sha3 supports only keccak-f1600 function");
33685
+ this.state = new Uint8Array(200);
33686
+ this.state32 = u322(this.state);
33687
+ }
33688
+ keccak() {
33689
+ keccakP2(this.state32, this.rounds);
33690
+ this.posOut = 0;
33691
+ this.pos = 0;
33692
+ }
33693
+ update(data) {
33694
+ assert_default.exists(this);
33695
+ const { blockLen, state } = this;
33696
+ data = toBytes2(data);
33697
+ const len = data.length;
33698
+ for (let pos = 0; pos < len; ) {
33699
+ const take = Math.min(blockLen - this.pos, len - pos);
33700
+ for (let i = 0; i < take; i++)
33701
+ state[this.pos++] ^= data[pos++];
33702
+ if (this.pos === blockLen)
33703
+ this.keccak();
33704
+ }
33705
+ return this;
33706
+ }
33707
+ finish() {
33708
+ if (this.finished)
33709
+ return;
33710
+ this.finished = true;
33711
+ const { state, suffix, pos, blockLen } = this;
33712
+ state[pos] ^= suffix;
33713
+ if ((suffix & 128) !== 0 && pos === blockLen - 1)
33714
+ this.keccak();
33715
+ state[blockLen - 1] ^= 128;
33716
+ this.keccak();
33717
+ }
33718
+ writeInto(out) {
33719
+ assert_default.exists(this, false);
33720
+ assert_default.bytes(out);
33721
+ this.finish();
33722
+ const bufferOut = this.state;
33723
+ const { blockLen } = this;
33724
+ for (let pos = 0, len = out.length; pos < len; ) {
33725
+ if (this.posOut >= blockLen)
33726
+ this.keccak();
33727
+ const take = Math.min(blockLen - this.posOut, len - pos);
33728
+ out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos);
33729
+ this.posOut += take;
33730
+ pos += take;
33731
+ }
33732
+ return out;
33733
+ }
33734
+ xofInto(out) {
33735
+ if (!this.enableXOF)
33736
+ throw new Error("XOF is not possible for this instance");
33737
+ return this.writeInto(out);
33738
+ }
33739
+ xof(bytes3) {
33740
+ assert_default.number(bytes3);
33741
+ return this.xofInto(new Uint8Array(bytes3));
33742
+ }
33743
+ digestInto(out) {
33744
+ assert_default.output(out, this);
33745
+ if (this.finished)
33746
+ throw new Error("digest() was already called");
33747
+ this.writeInto(out);
33748
+ this.destroy();
33749
+ return out;
33750
+ }
33751
+ digest() {
33752
+ return this.digestInto(new Uint8Array(this.outputLen));
33753
+ }
33754
+ destroy() {
33755
+ this.destroyed = true;
33756
+ this.state.fill(0);
33757
+ }
33758
+ _cloneInto(to) {
33759
+ const { blockLen, suffix, outputLen, rounds, enableXOF } = this;
33760
+ to || (to = new Keccak2(blockLen, suffix, outputLen, enableXOF, rounds));
33761
+ to.state32.set(this.state32);
33762
+ to.pos = this.pos;
33763
+ to.posOut = this.posOut;
33764
+ to.finished = this.finished;
33765
+ to.rounds = rounds;
33766
+ to.suffix = suffix;
33767
+ to.outputLen = outputLen;
33768
+ to.enableXOF = enableXOF;
33769
+ to.destroyed = this.destroyed;
33770
+ return to;
33771
+ }
33772
+ };
33773
+ var gen2 = (suffix, blockLen, outputLen) => wrapConstructor2(() => new Keccak2(blockLen, suffix, outputLen));
33774
+ var sha3_2242 = gen2(6, 144, 224 / 8);
33775
+ var sha3_2562 = gen2(6, 136, 256 / 8);
33776
+ var sha3_3842 = gen2(6, 104, 384 / 8);
33777
+ var sha3_5122 = gen2(6, 72, 512 / 8);
33778
+ var keccak_2242 = gen2(1, 144, 224 / 8);
33779
+ var keccak_2562 = gen2(1, 136, 256 / 8);
33780
+ var keccak_3842 = gen2(1, 104, 384 / 8);
33781
+ var keccak_5122 = gen2(1, 72, 512 / 8);
33782
+ var genShake2 = (suffix, blockLen, outputLen) => wrapConstructorWithOpts((opts = {}) => new Keccak2(blockLen, suffix, opts.dkLen === void 0 ? outputLen : opts.dkLen, true));
33783
+ var shake1282 = genShake2(31, 168, 128 / 8);
33784
+ var shake2562 = genShake2(31, 136, 256 / 8);
33785
+
33786
+ // ../../node_modules/.pnpm/ethers@6.7.1/node_modules/ethers/lib.esm/crypto/keccak.js
33787
+ var locked2 = false;
33788
+ var _keccak256 = function(data) {
33789
+ return keccak_2562(data);
33790
+ };
33791
+ var __keccak256 = _keccak256;
33792
+ function keccak256(_data) {
33793
+ const data = getBytes(_data, "data");
33794
+ return hexlify2(__keccak256(data));
33795
+ }
33796
+ keccak256._ = _keccak256;
33797
+ keccak256.lock = function() {
33798
+ locked2 = true;
33799
+ };
33800
+ keccak256.register = function(func) {
33801
+ if (locked2) {
33802
+ throw new TypeError("keccak256 is locked");
33803
+ }
33804
+ __keccak256 = func;
33805
+ };
33806
+ Object.freeze(keccak256);
33510
33807
 
33511
33808
  // ../../node_modules/.pnpm/@noble+hashes@1.1.2/node_modules/@noble/hashes/esm/_sha2.js
33512
33809
  function setBigUint642(view, byteOffset, value, isLE3) {
33513
33810
  if (typeof view.setBigUint64 === "function")
33514
33811
  return view.setBigUint64(byteOffset, value, isLE3);
33515
- const _32n2 = BigInt(32);
33812
+ const _32n3 = BigInt(32);
33516
33813
  const _u32_max = BigInt(4294967295);
33517
- const wh = Number(value >> _32n2 & _u32_max);
33814
+ const wh = Number(value >> _32n3 & _u32_max);
33518
33815
  const wl = Number(value & _u32_max);
33519
33816
  const h = isLE3 ? 4 : 0;
33520
33817
  const l = isLE3 ? 0 : 4;
@@ -33686,7 +33983,7 @@ This unreleased fuel-core build may include features and updates not yet support
33686
33983
  var ripemd160 = wrapConstructor2(() => new RIPEMD160());
33687
33984
 
33688
33985
  // ../../node_modules/.pnpm/ethers@6.7.1/node_modules/ethers/lib.esm/crypto/ripemd160.js
33689
- var locked2 = false;
33986
+ var locked3 = false;
33690
33987
  var _ripemd160 = function(data) {
33691
33988
  return ripemd160(data);
33692
33989
  };
@@ -33697,10 +33994,10 @@ This unreleased fuel-core build may include features and updates not yet support
33697
33994
  }
33698
33995
  ripemd1602._ = _ripemd160;
33699
33996
  ripemd1602.lock = function() {
33700
- locked2 = true;
33997
+ locked3 = true;
33701
33998
  };
33702
33999
  ripemd1602.register = function(func) {
33703
- if (locked2) {
34000
+ if (locked3) {
33704
34001
  throw new TypeError("ripemd160 is locked");
33705
34002
  }
33706
34003
  __ripemd160 = func;
@@ -33708,7 +34005,7 @@ This unreleased fuel-core build may include features and updates not yet support
33708
34005
  Object.freeze(ripemd1602);
33709
34006
 
33710
34007
  // ../../node_modules/.pnpm/ethers@6.7.1/node_modules/ethers/lib.esm/crypto/pbkdf2.js
33711
- var locked3 = false;
34008
+ var locked4 = false;
33712
34009
  var _pbkdf2 = function(password, salt, iterations, keylen, algo) {
33713
34010
  return (0, import_crypto2.pbkdf2Sync)(password, salt, iterations, keylen, algo);
33714
34011
  };
@@ -33720,19 +34017,602 @@ This unreleased fuel-core build may include features and updates not yet support
33720
34017
  }
33721
34018
  pbkdf22._ = _pbkdf2;
33722
34019
  pbkdf22.lock = function() {
33723
- locked3 = true;
34020
+ locked4 = true;
33724
34021
  };
33725
34022
  pbkdf22.register = function(func) {
33726
- if (locked3) {
34023
+ if (locked4) {
33727
34024
  throw new Error("pbkdf2 is locked");
33728
34025
  }
33729
34026
  __pbkdf2 = func;
33730
34027
  };
33731
34028
  Object.freeze(pbkdf22);
33732
34029
 
34030
+ // ../../node_modules/.pnpm/ethers@6.7.1/node_modules/ethers/lib.esm/address/address.js
34031
+ var BN_03 = BigInt(0);
34032
+ var BN_36 = BigInt(36);
34033
+ function getChecksumAddress(address) {
34034
+ address = address.toLowerCase();
34035
+ const chars = address.substring(2).split("");
34036
+ const expanded = new Uint8Array(40);
34037
+ for (let i = 0; i < 40; i++) {
34038
+ expanded[i] = chars[i].charCodeAt(0);
34039
+ }
34040
+ const hashed = getBytes(keccak256(expanded));
34041
+ for (let i = 0; i < 40; i += 2) {
34042
+ if (hashed[i >> 1] >> 4 >= 8) {
34043
+ chars[i] = chars[i].toUpperCase();
34044
+ }
34045
+ if ((hashed[i >> 1] & 15) >= 8) {
34046
+ chars[i + 1] = chars[i + 1].toUpperCase();
34047
+ }
34048
+ }
34049
+ return "0x" + chars.join("");
34050
+ }
34051
+ var ibanLookup = {};
34052
+ for (let i = 0; i < 10; i++) {
34053
+ ibanLookup[String(i)] = String(i);
34054
+ }
34055
+ for (let i = 0; i < 26; i++) {
34056
+ ibanLookup[String.fromCharCode(65 + i)] = String(10 + i);
34057
+ }
34058
+ var safeDigits = 15;
34059
+ function ibanChecksum(address) {
34060
+ address = address.toUpperCase();
34061
+ address = address.substring(4) + address.substring(0, 2) + "00";
34062
+ let expanded = address.split("").map((c) => {
34063
+ return ibanLookup[c];
34064
+ }).join("");
34065
+ while (expanded.length >= safeDigits) {
34066
+ let block2 = expanded.substring(0, safeDigits);
34067
+ expanded = parseInt(block2, 10) % 97 + expanded.substring(block2.length);
34068
+ }
34069
+ let checksum = String(98 - parseInt(expanded, 10) % 97);
34070
+ while (checksum.length < 2) {
34071
+ checksum = "0" + checksum;
34072
+ }
34073
+ return checksum;
34074
+ }
34075
+ var Base36 = function() {
34076
+ ;
34077
+ const result = {};
34078
+ for (let i = 0; i < 36; i++) {
34079
+ const key = "0123456789abcdefghijklmnopqrstuvwxyz"[i];
34080
+ result[key] = BigInt(i);
34081
+ }
34082
+ return result;
34083
+ }();
34084
+ function fromBase36(value) {
34085
+ value = value.toLowerCase();
34086
+ let result = BN_03;
34087
+ for (let i = 0; i < value.length; i++) {
34088
+ result = result * BN_36 + Base36[value[i]];
34089
+ }
34090
+ return result;
34091
+ }
34092
+ function getAddress(address) {
34093
+ assertArgument(typeof address === "string", "invalid address", "address", address);
34094
+ if (address.match(/^(0x)?[0-9a-fA-F]{40}$/)) {
34095
+ if (!address.startsWith("0x")) {
34096
+ address = "0x" + address;
34097
+ }
34098
+ const result = getChecksumAddress(address);
34099
+ assertArgument(!address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) || result === address, "bad address checksum", "address", address);
34100
+ return result;
34101
+ }
34102
+ if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {
34103
+ assertArgument(address.substring(2, 4) === ibanChecksum(address), "bad icap checksum", "address", address);
34104
+ let result = fromBase36(address.substring(4)).toString(16);
34105
+ while (result.length < 40) {
34106
+ result = "0" + result;
34107
+ }
34108
+ return getChecksumAddress("0x" + result);
34109
+ }
34110
+ assertArgument(false, "invalid address", "address", address);
34111
+ }
34112
+
34113
+ // ../../node_modules/.pnpm/ethers@6.7.1/node_modules/ethers/lib.esm/transaction/accesslist.js
34114
+ function accessSetify(addr, storageKeys) {
34115
+ return {
34116
+ address: getAddress(addr),
34117
+ storageKeys: storageKeys.map((storageKey, index) => {
34118
+ assertArgument(isHexString(storageKey, 32), "invalid slot", `storageKeys[${index}]`, storageKey);
34119
+ return storageKey.toLowerCase();
34120
+ })
34121
+ };
34122
+ }
34123
+ function accessListify(value) {
34124
+ if (Array.isArray(value)) {
34125
+ return value.map((set, index) => {
34126
+ if (Array.isArray(set)) {
34127
+ assertArgument(set.length === 2, "invalid slot set", `value[${index}]`, set);
34128
+ return accessSetify(set[0], set[1]);
34129
+ }
34130
+ assertArgument(set != null && typeof set === "object", "invalid address-slot set", "value", value);
34131
+ return accessSetify(set.address, set.storageKeys);
34132
+ });
34133
+ }
34134
+ assertArgument(value != null && typeof value === "object", "invalid access list", "value", value);
34135
+ const result = Object.keys(value).map((addr) => {
34136
+ const storageKeys = value[addr].reduce((accum, storageKey) => {
34137
+ accum[storageKey] = true;
34138
+ return accum;
34139
+ }, {});
34140
+ return accessSetify(addr, Object.keys(storageKeys).sort());
34141
+ });
34142
+ result.sort((a, b) => a.address.localeCompare(b.address));
34143
+ return result;
34144
+ }
34145
+
34146
+ // ../../node_modules/.pnpm/ethers@6.7.1/node_modules/ethers/lib.esm/providers/plugins-network.js
34147
+ var EnsAddress = "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";
34148
+ var NetworkPlugin = class {
34149
+ /**
34150
+ * The name of the plugin.
34151
+ *
34152
+ * It is recommended to use reverse-domain-notation, which permits
34153
+ * unique names with a known authority as well as hierarchal entries.
34154
+ */
34155
+ name;
34156
+ /**
34157
+ * Creates a new **NetworkPlugin**.
34158
+ */
34159
+ constructor(name) {
34160
+ defineProperties(this, { name });
34161
+ }
34162
+ /**
34163
+ * Creates a copy of this plugin.
34164
+ */
34165
+ clone() {
34166
+ return new NetworkPlugin(this.name);
34167
+ }
34168
+ };
34169
+ var GasCostPlugin = class extends NetworkPlugin {
34170
+ /**
34171
+ * The block number to treat these values as valid from.
34172
+ *
34173
+ * This allows a hardfork to have updated values included as well as
34174
+ * mulutiple hardforks to be supported.
34175
+ */
34176
+ effectiveBlock;
34177
+ /**
34178
+ * The transactions base fee.
34179
+ */
34180
+ txBase;
34181
+ /**
34182
+ * The fee for creating a new account.
34183
+ */
34184
+ txCreate;
34185
+ /**
34186
+ * The fee per zero-byte in the data.
34187
+ */
34188
+ txDataZero;
34189
+ /**
34190
+ * The fee per non-zero-byte in the data.
34191
+ */
34192
+ txDataNonzero;
34193
+ /**
34194
+ * The fee per storage key in the [[link-eip-2930]] access list.
34195
+ */
34196
+ txAccessListStorageKey;
34197
+ /**
34198
+ * The fee per address in the [[link-eip-2930]] access list.
34199
+ */
34200
+ txAccessListAddress;
34201
+ /**
34202
+ * Creates a new GasCostPlugin from %%effectiveBlock%% until the
34203
+ * latest block or another GasCostPlugin supercedes that block number,
34204
+ * with the associated %%costs%%.
34205
+ */
34206
+ constructor(effectiveBlock, costs) {
34207
+ if (effectiveBlock == null) {
34208
+ effectiveBlock = 0;
34209
+ }
34210
+ super(`org.ethers.network.plugins.GasCost#${effectiveBlock || 0}`);
34211
+ const props = { effectiveBlock };
34212
+ function set(name, nullish) {
34213
+ let value = (costs || {})[name];
34214
+ if (value == null) {
34215
+ value = nullish;
34216
+ }
34217
+ assertArgument(typeof value === "number", `invalud value for ${name}`, "costs", costs);
34218
+ props[name] = value;
34219
+ }
34220
+ set("txBase", 21e3);
34221
+ set("txCreate", 32e3);
34222
+ set("txDataZero", 4);
34223
+ set("txDataNonzero", 16);
34224
+ set("txAccessListStorageKey", 1900);
34225
+ set("txAccessListAddress", 2400);
34226
+ defineProperties(this, props);
34227
+ }
34228
+ clone() {
34229
+ return new GasCostPlugin(this.effectiveBlock, this);
34230
+ }
34231
+ };
34232
+ var EnsPlugin = class extends NetworkPlugin {
34233
+ /**
34234
+ * The ENS Registrty Contract address.
34235
+ */
34236
+ address;
34237
+ /**
34238
+ * The chain ID that the ENS contract lives on.
34239
+ */
34240
+ targetNetwork;
34241
+ /**
34242
+ * Creates a new **EnsPlugin** connected to %%address%% on the
34243
+ * %%targetNetwork%%. The default ENS address and mainnet is used
34244
+ * if unspecified.
34245
+ */
34246
+ constructor(address, targetNetwork) {
34247
+ super("org.ethers.plugins.network.Ens");
34248
+ defineProperties(this, {
34249
+ address: address || EnsAddress,
34250
+ targetNetwork: targetNetwork == null ? 1 : targetNetwork
34251
+ });
34252
+ }
34253
+ clone() {
34254
+ return new EnsPlugin(this.address, this.targetNetwork);
34255
+ }
34256
+ };
34257
+ var FetchUrlFeeDataNetworkPlugin = class extends NetworkPlugin {
34258
+ #url;
34259
+ #processFunc;
34260
+ /**
34261
+ * The URL to initialize the FetchRequest with in %%processFunc%%.
34262
+ */
34263
+ get url() {
34264
+ return this.#url;
34265
+ }
34266
+ /**
34267
+ * The callback to use when computing the FeeData.
34268
+ */
34269
+ get processFunc() {
34270
+ return this.#processFunc;
34271
+ }
34272
+ /**
34273
+ * Creates a new **FetchUrlFeeDataNetworkPlugin** which will
34274
+ * be used when computing the fee data for the network.
34275
+ */
34276
+ constructor(url, processFunc) {
34277
+ super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");
34278
+ this.#url = url;
34279
+ this.#processFunc = processFunc;
34280
+ }
34281
+ // We are immutable, so we can serve as our own clone
34282
+ clone() {
34283
+ return this;
34284
+ }
34285
+ };
34286
+
34287
+ // ../../node_modules/.pnpm/ethers@6.7.1/node_modules/ethers/lib.esm/providers/network.js
34288
+ var Networks = /* @__PURE__ */ new Map();
34289
+ var Network = class {
34290
+ #name;
34291
+ #chainId;
34292
+ #plugins;
34293
+ /**
34294
+ * Creates a new **Network** for %%name%% and %%chainId%%.
34295
+ */
34296
+ constructor(name, chainId) {
34297
+ this.#name = name;
34298
+ this.#chainId = getBigInt(chainId);
34299
+ this.#plugins = /* @__PURE__ */ new Map();
34300
+ }
34301
+ /**
34302
+ * Returns a JSON-compatible representation of a Network.
34303
+ */
34304
+ toJSON() {
34305
+ return { name: this.name, chainId: String(this.chainId) };
34306
+ }
34307
+ /**
34308
+ * The network common name.
34309
+ *
34310
+ * This is the canonical name, as networks migh have multiple
34311
+ * names.
34312
+ */
34313
+ get name() {
34314
+ return this.#name;
34315
+ }
34316
+ set name(value) {
34317
+ this.#name = value;
34318
+ }
34319
+ /**
34320
+ * The network chain ID.
34321
+ */
34322
+ get chainId() {
34323
+ return this.#chainId;
34324
+ }
34325
+ set chainId(value) {
34326
+ this.#chainId = getBigInt(value, "chainId");
34327
+ }
34328
+ /**
34329
+ * Returns true if %%other%% matches this network. Any chain ID
34330
+ * must match, and if no chain ID is present, the name must match.
34331
+ *
34332
+ * This method does not currently check for additional properties,
34333
+ * such as ENS address or plug-in compatibility.
34334
+ */
34335
+ matches(other) {
34336
+ if (other == null) {
34337
+ return false;
34338
+ }
34339
+ if (typeof other === "string") {
34340
+ try {
34341
+ return this.chainId === getBigInt(other);
34342
+ } catch (error) {
34343
+ }
34344
+ return this.name === other;
34345
+ }
34346
+ if (typeof other === "number" || typeof other === "bigint") {
34347
+ try {
34348
+ return this.chainId === getBigInt(other);
34349
+ } catch (error) {
34350
+ }
34351
+ return false;
34352
+ }
34353
+ if (typeof other === "object") {
34354
+ if (other.chainId != null) {
34355
+ try {
34356
+ return this.chainId === getBigInt(other.chainId);
34357
+ } catch (error) {
34358
+ }
34359
+ return false;
34360
+ }
34361
+ if (other.name != null) {
34362
+ return this.name === other.name;
34363
+ }
34364
+ return false;
34365
+ }
34366
+ return false;
34367
+ }
34368
+ /**
34369
+ * Returns the list of plugins currently attached to this Network.
34370
+ */
34371
+ get plugins() {
34372
+ return Array.from(this.#plugins.values());
34373
+ }
34374
+ /**
34375
+ * Attach a new %%plugin%% to this Network. The network name
34376
+ * must be unique, excluding any fragment.
34377
+ */
34378
+ attachPlugin(plugin) {
34379
+ if (this.#plugins.get(plugin.name)) {
34380
+ throw new Error(`cannot replace existing plugin: ${plugin.name} `);
34381
+ }
34382
+ this.#plugins.set(plugin.name, plugin.clone());
34383
+ return this;
34384
+ }
34385
+ /**
34386
+ * Return the plugin, if any, matching %%name%% exactly. Plugins
34387
+ * with fragments will not be returned unless %%name%% includes
34388
+ * a fragment.
34389
+ */
34390
+ getPlugin(name) {
34391
+ return this.#plugins.get(name) || null;
34392
+ }
34393
+ /**
34394
+ * Gets a list of all plugins that match %%name%%, with otr without
34395
+ * a fragment.
34396
+ */
34397
+ getPlugins(basename) {
34398
+ return this.plugins.filter((p) => p.name.split("#")[0] === basename);
34399
+ }
34400
+ /**
34401
+ * Create a copy of this Network.
34402
+ */
34403
+ clone() {
34404
+ const clone4 = new Network(this.name, this.chainId);
34405
+ this.plugins.forEach((plugin) => {
34406
+ clone4.attachPlugin(plugin.clone());
34407
+ });
34408
+ return clone4;
34409
+ }
34410
+ /**
34411
+ * Compute the intrinsic gas required for a transaction.
34412
+ *
34413
+ * A GasCostPlugin can be attached to override the default
34414
+ * values.
34415
+ */
34416
+ computeIntrinsicGas(tx) {
34417
+ const costs = this.getPlugin("org.ethers.plugins.network.GasCost") || new GasCostPlugin();
34418
+ let gas = costs.txBase;
34419
+ if (tx.to == null) {
34420
+ gas += costs.txCreate;
34421
+ }
34422
+ if (tx.data) {
34423
+ for (let i = 2; i < tx.data.length; i += 2) {
34424
+ if (tx.data.substring(i, i + 2) === "00") {
34425
+ gas += costs.txDataZero;
34426
+ } else {
34427
+ gas += costs.txDataNonzero;
34428
+ }
34429
+ }
34430
+ }
34431
+ if (tx.accessList) {
34432
+ const accessList = accessListify(tx.accessList);
34433
+ for (const addr in accessList) {
34434
+ gas += costs.txAccessListAddress + costs.txAccessListStorageKey * accessList[addr].storageKeys.length;
34435
+ }
34436
+ }
34437
+ return gas;
34438
+ }
34439
+ /**
34440
+ * Returns a new Network for the %%network%% name or chainId.
34441
+ */
34442
+ static from(network) {
34443
+ injectCommonNetworks();
34444
+ if (network == null) {
34445
+ return Network.from("mainnet");
34446
+ }
34447
+ if (typeof network === "number") {
34448
+ network = BigInt(network);
34449
+ }
34450
+ if (typeof network === "string" || typeof network === "bigint") {
34451
+ const networkFunc = Networks.get(network);
34452
+ if (networkFunc) {
34453
+ return networkFunc();
34454
+ }
34455
+ if (typeof network === "bigint") {
34456
+ return new Network("unknown", network);
34457
+ }
34458
+ assertArgument(false, "unknown network", "network", network);
34459
+ }
34460
+ if (typeof network.clone === "function") {
34461
+ const clone4 = network.clone();
34462
+ return clone4;
34463
+ }
34464
+ if (typeof network === "object") {
34465
+ assertArgument(typeof network.name === "string" && typeof network.chainId === "number", "invalid network object name or chainId", "network", network);
34466
+ const custom = new Network(network.name, network.chainId);
34467
+ if (network.ensAddress || network.ensNetwork != null) {
34468
+ custom.attachPlugin(new EnsPlugin(network.ensAddress, network.ensNetwork));
34469
+ }
34470
+ return custom;
34471
+ }
34472
+ assertArgument(false, "invalid network", "network", network);
34473
+ }
34474
+ /**
34475
+ * Register %%nameOrChainId%% with a function which returns
34476
+ * an instance of a Network representing that chain.
34477
+ */
34478
+ static register(nameOrChainId, networkFunc) {
34479
+ if (typeof nameOrChainId === "number") {
34480
+ nameOrChainId = BigInt(nameOrChainId);
34481
+ }
34482
+ const existing = Networks.get(nameOrChainId);
34483
+ if (existing) {
34484
+ assertArgument(false, `conflicting network for ${JSON.stringify(existing.name)}`, "nameOrChainId", nameOrChainId);
34485
+ }
34486
+ Networks.set(nameOrChainId, networkFunc);
34487
+ }
34488
+ };
34489
+ function parseUnits(_value, decimals) {
34490
+ const value = String(_value);
34491
+ if (!value.match(/^[0-9.]+$/)) {
34492
+ throw new Error(`invalid gwei value: ${_value}`);
34493
+ }
34494
+ const comps = value.split(".");
34495
+ if (comps.length === 1) {
34496
+ comps.push("");
34497
+ }
34498
+ if (comps.length !== 2) {
34499
+ throw new Error(`invalid gwei value: ${_value}`);
34500
+ }
34501
+ while (comps[1].length < decimals) {
34502
+ comps[1] += "0";
34503
+ }
34504
+ if (comps[1].length > 9) {
34505
+ let frac = BigInt(comps[1].substring(0, 9));
34506
+ if (!comps[1].substring(9).match(/^0+$/)) {
34507
+ frac++;
34508
+ }
34509
+ comps[1] = frac.toString();
34510
+ }
34511
+ return BigInt(comps[0] + comps[1]);
34512
+ }
34513
+ function getGasStationPlugin(url) {
34514
+ return new FetchUrlFeeDataNetworkPlugin(url, async (fetchFeeData, provider, request) => {
34515
+ request.setHeader("User-Agent", "ethers");
34516
+ let response;
34517
+ try {
34518
+ const [_response, _feeData] = await Promise.all([
34519
+ request.send(),
34520
+ fetchFeeData()
34521
+ ]);
34522
+ response = _response;
34523
+ const payload = response.bodyJson.standard;
34524
+ const feeData = {
34525
+ gasPrice: _feeData.gasPrice,
34526
+ maxFeePerGas: parseUnits(payload.maxFee, 9),
34527
+ maxPriorityFeePerGas: parseUnits(payload.maxPriorityFee, 9)
34528
+ };
34529
+ return feeData;
34530
+ } catch (error) {
34531
+ assert(false, `error encountered with polygon gas station (${JSON.stringify(request.url)})`, "SERVER_ERROR", { request, response, error });
34532
+ }
34533
+ });
34534
+ }
34535
+ function getPriorityFeePlugin(maxPriorityFeePerGas) {
34536
+ return new FetchUrlFeeDataNetworkPlugin("data:", async (fetchFeeData, provider, request) => {
34537
+ const feeData = await fetchFeeData();
34538
+ if (feeData.maxFeePerGas == null || feeData.maxPriorityFeePerGas == null) {
34539
+ return feeData;
34540
+ }
34541
+ const baseFee = feeData.maxFeePerGas - feeData.maxPriorityFeePerGas;
34542
+ return {
34543
+ gasPrice: feeData.gasPrice,
34544
+ maxFeePerGas: baseFee + maxPriorityFeePerGas,
34545
+ maxPriorityFeePerGas
34546
+ };
34547
+ });
34548
+ }
34549
+ var injected = false;
34550
+ function injectCommonNetworks() {
34551
+ if (injected) {
34552
+ return;
34553
+ }
34554
+ injected = true;
34555
+ function registerEth(name, chainId, options) {
34556
+ const func = function() {
34557
+ const network = new Network(name, chainId);
34558
+ if (options.ensNetwork != null) {
34559
+ network.attachPlugin(new EnsPlugin(null, options.ensNetwork));
34560
+ }
34561
+ network.attachPlugin(new GasCostPlugin());
34562
+ (options.plugins || []).forEach((plugin) => {
34563
+ network.attachPlugin(plugin);
34564
+ });
34565
+ return network;
34566
+ };
34567
+ Network.register(name, func);
34568
+ Network.register(chainId, func);
34569
+ if (options.altNames) {
34570
+ options.altNames.forEach((name2) => {
34571
+ Network.register(name2, func);
34572
+ });
34573
+ }
34574
+ }
34575
+ registerEth("mainnet", 1, { ensNetwork: 1, altNames: ["homestead"] });
34576
+ registerEth("ropsten", 3, { ensNetwork: 3 });
34577
+ registerEth("rinkeby", 4, { ensNetwork: 4 });
34578
+ registerEth("goerli", 5, { ensNetwork: 5 });
34579
+ registerEth("kovan", 42, { ensNetwork: 42 });
34580
+ registerEth("sepolia", 11155111, {});
34581
+ registerEth("classic", 61, {});
34582
+ registerEth("classicKotti", 6, {});
34583
+ registerEth("arbitrum", 42161, {
34584
+ ensNetwork: 1
34585
+ });
34586
+ registerEth("arbitrum-goerli", 421613, {});
34587
+ registerEth("bnb", 56, { ensNetwork: 1 });
34588
+ registerEth("bnbt", 97, {});
34589
+ registerEth("linea", 59144, { ensNetwork: 1 });
34590
+ registerEth("linea-goerli", 59140, {});
34591
+ registerEth("matic", 137, {
34592
+ ensNetwork: 1,
34593
+ plugins: [
34594
+ getGasStationPlugin("https://gasstation.polygon.technology/v2")
34595
+ ]
34596
+ });
34597
+ registerEth("matic-mumbai", 80001, {
34598
+ altNames: ["maticMumbai", "maticmum"],
34599
+ plugins: [
34600
+ getGasStationPlugin("https://gasstation-testnet.polygon.technology/v2")
34601
+ ]
34602
+ });
34603
+ registerEth("optimism", 10, {
34604
+ ensNetwork: 1,
34605
+ plugins: [
34606
+ getPriorityFeePlugin(BigInt("1000000"))
34607
+ ]
34608
+ });
34609
+ registerEth("optimism-goerli", 420, {});
34610
+ registerEth("xdai", 100, { ensNetwork: 1 });
34611
+ }
34612
+
33733
34613
  // ../crypto/dist/index.mjs
33734
- var import_crypto8 = __toESM(__require("crypto"), 1);
33735
34614
  var import_crypto9 = __toESM(__require("crypto"), 1);
34615
+ var import_crypto10 = __toESM(__require("crypto"), 1);
33736
34616
  var scrypt3 = (params) => {
33737
34617
  const { password, salt, n, p, r, dklen } = params;
33738
34618
  const derivedKey = scrypt(password, salt, { N: n, r, p, dkLen: dklen });
@@ -33741,7 +34621,7 @@ This unreleased fuel-core build may include features and updates not yet support
33741
34621
  var keccak2562 = (data) => keccak_256(data);
33742
34622
  var bufferFromString = (string, encoding = "base64") => Uint8Array.from(Buffer.from(string, encoding));
33743
34623
  var randomBytes4 = (length) => {
33744
- const randomValues = Uint8Array.from(import_crypto8.default.randomBytes(length));
34624
+ const randomValues = Uint8Array.from(import_crypto9.default.randomBytes(length));
33745
34625
  return randomValues;
33746
34626
  };
33747
34627
  var stringFromBuffer = (buffer, encoding = "base64") => Buffer.from(buffer).toString(encoding);
@@ -33756,7 +34636,7 @@ This unreleased fuel-core build may include features and updates not yet support
33756
34636
  const salt = randomBytes4(32);
33757
34637
  const secret = keyFromPassword(password, salt);
33758
34638
  const dataBuffer = Uint8Array.from(Buffer.from(JSON.stringify(data), "utf-8"));
33759
- const cipher = await import_crypto7.default.createCipheriv(ALGORITHM, secret, iv);
34639
+ const cipher = await import_crypto8.default.createCipheriv(ALGORITHM, secret, iv);
33760
34640
  let cipherData = cipher.update(dataBuffer);
33761
34641
  cipherData = Buffer.concat([cipherData, cipher.final()]);
33762
34642
  return {
@@ -33770,7 +34650,7 @@ This unreleased fuel-core build may include features and updates not yet support
33770
34650
  const salt = bufferFromString(keystore.salt);
33771
34651
  const secret = keyFromPassword(password, salt);
33772
34652
  const encryptedText = bufferFromString(keystore.data);
33773
- const decipher = await import_crypto7.default.createDecipheriv(ALGORITHM, secret, iv);
34653
+ const decipher = await import_crypto8.default.createDecipheriv(ALGORITHM, secret, iv);
33774
34654
  const decrypted = decipher.update(encryptedText);
33775
34655
  const deBuff = Buffer.concat([decrypted, decipher.final()]);
33776
34656
  const decryptedData = Buffer.from(deBuff).toString("utf-8");
@@ -33781,12 +34661,12 @@ This unreleased fuel-core build may include features and updates not yet support
33781
34661
  }
33782
34662
  };
33783
34663
  async function encryptJsonWalletData(data, key, iv) {
33784
- const cipher = await import_crypto9.default.createCipheriv("aes-128-ctr", key.subarray(0, 16), iv);
34664
+ const cipher = await import_crypto10.default.createCipheriv("aes-128-ctr", key.subarray(0, 16), iv);
33785
34665
  const encrypted = Buffer.concat([cipher.update(data), cipher.final()]);
33786
34666
  return new Uint8Array(encrypted);
33787
34667
  }
33788
34668
  async function decryptJsonWalletData(data, key, iv) {
33789
- const decipher = import_crypto9.default.createDecipheriv("aes-128-ctr", key.subarray(0, 16), iv);
34669
+ const decipher = import_crypto10.default.createDecipheriv("aes-128-ctr", key.subarray(0, 16), iv);
33790
34670
  const decrypted = await Buffer.concat([decipher.update(data), decipher.final()]);
33791
34671
  return new Uint8Array(decrypted);
33792
34672
  }
@@ -37404,9 +38284,9 @@ This unreleased fuel-core build may include features and updates not yet support
37404
38284
  utf8ToBytes: () => utf8ToBytes3,
37405
38285
  validateObject: () => validateObject
37406
38286
  });
37407
- var _0n2 = BigInt(0);
37408
- var _1n2 = BigInt(1);
37409
- var _2n2 = BigInt(2);
38287
+ var _0n3 = BigInt(0);
38288
+ var _1n3 = BigInt(1);
38289
+ var _2n3 = BigInt(2);
37410
38290
  function isBytes3(a) {
37411
38291
  return a instanceof Uint8Array || a != null && typeof a === "object" && a.constructor.name === "Uint8Array";
37412
38292
  }
@@ -37525,17 +38405,17 @@ This unreleased fuel-core build may include features and updates not yet support
37525
38405
  }
37526
38406
  function bitLen(n) {
37527
38407
  let len;
37528
- for (len = 0; n > _0n2; n >>= _1n2, len += 1)
38408
+ for (len = 0; n > _0n3; n >>= _1n3, len += 1)
37529
38409
  ;
37530
38410
  return len;
37531
38411
  }
37532
38412
  function bitGet(n, pos) {
37533
- return n >> BigInt(pos) & _1n2;
38413
+ return n >> BigInt(pos) & _1n3;
37534
38414
  }
37535
38415
  var bitSet = (n, pos, value) => {
37536
- return n | (value ? _1n2 : _0n2) << BigInt(pos);
38416
+ return n | (value ? _1n3 : _0n3) << BigInt(pos);
37537
38417
  };
37538
- var bitMask = (n) => (_2n2 << BigInt(n - 1)) - _1n2;
38418
+ var bitMask = (n) => (_2n3 << BigInt(n - 1)) - _1n3;
37539
38419
  var u8n = (data) => new Uint8Array(data);
37540
38420
  var u8fr = (arr) => Uint8Array.from(arr);
37541
38421
  function createHmacDrbg(hashLen, qByteLen, hmacFn) {
@@ -37562,7 +38442,7 @@ This unreleased fuel-core build may include features and updates not yet support
37562
38442
  k = h(u8fr([1]), seed);
37563
38443
  v = h();
37564
38444
  };
37565
- const gen2 = () => {
38445
+ const gen3 = () => {
37566
38446
  if (i++ >= 1e3)
37567
38447
  throw new Error("drbg: tried 1000 values");
37568
38448
  let len = 0;
@@ -37579,7 +38459,7 @@ This unreleased fuel-core build may include features and updates not yet support
37579
38459
  reset();
37580
38460
  reseed(seed);
37581
38461
  let res = void 0;
37582
- while (!(res = pred(gen2())))
38462
+ while (!(res = pred(gen3())))
37583
38463
  reseed();
37584
38464
  reset();
37585
38465
  return res;
@@ -41553,6 +42433,13 @@ ${MessageCoinFragmentFragmentDoc}`;
41553
42433
  )
41554
42434
  }
41555
42435
  `;
42436
+ var GetMessageByNonceDocument = lib_default2`
42437
+ query getMessageByNonce($nonce: Nonce!) {
42438
+ message(nonce: $nonce) {
42439
+ ...messageFragment
42440
+ }
42441
+ }
42442
+ ${MessageFragmentFragmentDoc}`;
41556
42443
  var SubmitAndAwaitDocument = lib_default2`
41557
42444
  subscription submitAndAwait($encodedTransaction: HexString!) {
41558
42445
  submitAndAwait(tx: $encodedTransaction) {
@@ -41647,6 +42534,9 @@ ${MessageCoinFragmentFragmentDoc}`;
41647
42534
  produceBlocks(variables, options) {
41648
42535
  return requester(ProduceBlocksDocument, variables, options);
41649
42536
  },
42537
+ getMessageByNonce(variables, options) {
42538
+ return requester(GetMessageByNonceDocument, variables, options);
42539
+ },
41650
42540
  submitAndAwait(variables, options) {
41651
42541
  return requester(SubmitAndAwaitDocument, variables, options);
41652
42542
  },
@@ -42388,6 +43278,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42388
43278
  name = "NoWitnessAtIndexError";
42389
43279
  };
42390
43280
 
43281
+ // src/providers/transaction-request/helpers.ts
43282
+ var isRequestInputCoin = (input) => input.type === InputType.Coin;
43283
+ var isRequestInputMessage = (input) => input.type === InputType.Message;
43284
+ var isRequestInputResource = (input) => isRequestInputCoin(input) || isRequestInputMessage(input);
43285
+
42391
43286
  // src/providers/transaction-request/witness.ts
42392
43287
  var witnessify = (value) => {
42393
43288
  const data = arrayify(value);
@@ -42626,7 +43521,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42626
43521
  * @param coin - Coin resource.
42627
43522
  */
42628
43523
  addCoinInput(coin) {
42629
- const { assetId, owner, amount } = coin;
43524
+ const { assetId, owner, amount, id, predicate } = coin;
42630
43525
  let witnessIndex;
42631
43526
  if (coin.predicate) {
42632
43527
  witnessIndex = 0;
@@ -42637,13 +43532,14 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42637
43532
  }
42638
43533
  }
42639
43534
  const input = {
42640
- ...coin,
43535
+ id,
42641
43536
  type: InputType.Coin,
42642
43537
  owner: owner.toB256(),
42643
43538
  amount,
42644
43539
  assetId,
42645
43540
  txPointer: "0x00000000000000000000000000000000",
42646
- witnessIndex
43541
+ witnessIndex,
43542
+ predicate
42647
43543
  };
42648
43544
  this.pushInput(input);
42649
43545
  this.addChangeOutput(owner, assetId);
@@ -42655,7 +43551,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42655
43551
  * @param message - Message resource.
42656
43552
  */
42657
43553
  addMessageInput(message) {
42658
- const { recipient, sender, amount, assetId } = message;
43554
+ const { recipient, sender, amount, predicate, nonce, assetId } = message;
42659
43555
  let witnessIndex;
42660
43556
  if (message.predicate) {
42661
43557
  witnessIndex = 0;
@@ -42666,12 +43562,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42666
43562
  }
42667
43563
  }
42668
43564
  const input = {
42669
- ...message,
43565
+ nonce,
42670
43566
  type: InputType.Message,
42671
43567
  sender: sender.toB256(),
42672
43568
  recipient: recipient.toB256(),
42673
43569
  amount,
42674
- witnessIndex
43570
+ witnessIndex,
43571
+ predicate
42675
43572
  };
42676
43573
  this.pushInput(input);
42677
43574
  this.addChangeOutput(recipient, assetId);
@@ -42855,6 +43752,17 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42855
43752
  toJSON() {
42856
43753
  return normalizeJSON(this);
42857
43754
  }
43755
+ removeWitness(index) {
43756
+ this.witnesses.splice(index, 1);
43757
+ this.adjustWitnessIndexes(index);
43758
+ }
43759
+ adjustWitnessIndexes(removedIndex) {
43760
+ this.inputs.filter(isRequestInputResource).forEach((input) => {
43761
+ if (input.witnessIndex > removedIndex) {
43762
+ input.witnessIndex -= 1;
43763
+ }
43764
+ });
43765
+ }
42858
43766
  updatePredicateGasUsed(inputs) {
42859
43767
  this.inputs.forEach((i) => {
42860
43768
  let correspondingInput;
@@ -43996,7 +44904,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43996
44904
  }
43997
44905
 
43998
44906
  // src/providers/transaction-response/transaction-response.ts
43999
- var TransactionResponse = class {
44907
+ var TransactionResponse2 = class {
44000
44908
  /** Transaction ID */
44001
44909
  id;
44002
44910
  /** Current provider */
@@ -44026,7 +44934,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44026
44934
  * @param provider - The provider.
44027
44935
  */
44028
44936
  static async create(id, provider, abis) {
44029
- const response = new TransactionResponse(id, provider, abis);
44937
+ const response = new TransactionResponse2(id, provider, abis);
44030
44938
  await response.fetch();
44031
44939
  return response;
44032
44940
  }
@@ -44420,6 +45328,21 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44420
45328
  } = await this.operations.getVersion();
44421
45329
  return nodeVersion;
44422
45330
  }
45331
+ /**
45332
+ * @hidden
45333
+ *
45334
+ * Returns the network configuration of the connected Fuel node.
45335
+ *
45336
+ * @returns A promise that resolves to the network configuration object
45337
+ */
45338
+ async getNetwork() {
45339
+ const {
45340
+ name,
45341
+ consensusParameters: { chainId }
45342
+ } = await this.getChain();
45343
+ const network = new Network(name, chainId.toNumber());
45344
+ return Promise.resolve(network);
45345
+ }
44423
45346
  /**
44424
45347
  * Returns the block number.
44425
45348
  *
@@ -44513,14 +45436,14 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44513
45436
  }
44514
45437
  }
44515
45438
  const transactionId2 = transactionRequest.getTransactionId(this.getChainId());
44516
- const response = new TransactionResponse(transactionId2, this, abis);
45439
+ const response = new TransactionResponse2(transactionId2, this, abis);
44517
45440
  await response.fetch();
44518
45441
  return response;
44519
45442
  }
44520
45443
  const {
44521
45444
  submit: { id: transactionId }
44522
45445
  } = await this.operations.submit({ encodedTransaction });
44523
- return new TransactionResponse(transactionId, this, abis);
45446
+ return new TransactionResponse2(transactionId, this, abis);
44524
45447
  }
44525
45448
  /**
44526
45449
  * Executes a transaction without actually submitting it to the chain.
@@ -45268,7 +46191,20 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45268
46191
  }
45269
46192
  // eslint-disable-next-line @typescript-eslint/require-await
45270
46193
  async getTransactionResponse(transactionId) {
45271
- return new TransactionResponse(transactionId, this);
46194
+ return new TransactionResponse2(transactionId, this);
46195
+ }
46196
+ /**
46197
+ * Returns Message for given nonce.
46198
+ *
46199
+ * @param nonce - The nonce of the message to retrieve.
46200
+ * @returns A promise that resolves to the Message object.
46201
+ */
46202
+ async getMessageByNonce(nonce) {
46203
+ const { message } = await this.operations.getMessageByNonce({ nonce });
46204
+ if (!message) {
46205
+ return null;
46206
+ }
46207
+ return message;
45272
46208
  }
45273
46209
  };
45274
46210
  var Provider = _Provider;
@@ -45782,9 +46718,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45782
46718
  };
45783
46719
 
45784
46720
  // ../../node_modules/.pnpm/@noble+curves@1.3.0/node_modules/@noble/curves/esm/abstract/modular.js
45785
- var _0n3 = BigInt(0);
45786
- var _1n3 = BigInt(1);
45787
- var _2n3 = BigInt(2);
46721
+ var _0n4 = BigInt(0);
46722
+ var _1n4 = BigInt(1);
46723
+ var _2n4 = BigInt(2);
45788
46724
  var _3n = BigInt(3);
45789
46725
  var _4n = BigInt(4);
45790
46726
  var _5n = BigInt(5);
@@ -45793,38 +46729,38 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45793
46729
  var _16n = BigInt(16);
45794
46730
  function mod(a, b) {
45795
46731
  const result = a % b;
45796
- return result >= _0n3 ? result : b + result;
46732
+ return result >= _0n4 ? result : b + result;
45797
46733
  }
45798
46734
  function pow(num, power, modulo) {
45799
- if (modulo <= _0n3 || power < _0n3)
46735
+ if (modulo <= _0n4 || power < _0n4)
45800
46736
  throw new Error("Expected power/modulo > 0");
45801
- if (modulo === _1n3)
45802
- return _0n3;
45803
- let res = _1n3;
45804
- while (power > _0n3) {
45805
- if (power & _1n3)
46737
+ if (modulo === _1n4)
46738
+ return _0n4;
46739
+ let res = _1n4;
46740
+ while (power > _0n4) {
46741
+ if (power & _1n4)
45806
46742
  res = res * num % modulo;
45807
46743
  num = num * num % modulo;
45808
- power >>= _1n3;
46744
+ power >>= _1n4;
45809
46745
  }
45810
46746
  return res;
45811
46747
  }
45812
46748
  function pow2(x, power, modulo) {
45813
46749
  let res = x;
45814
- while (power-- > _0n3) {
46750
+ while (power-- > _0n4) {
45815
46751
  res *= res;
45816
46752
  res %= modulo;
45817
46753
  }
45818
46754
  return res;
45819
46755
  }
45820
46756
  function invert(number3, modulo) {
45821
- if (number3 === _0n3 || modulo <= _0n3) {
46757
+ if (number3 === _0n4 || modulo <= _0n4) {
45822
46758
  throw new Error(`invert: expected positive integers, got n=${number3} mod=${modulo}`);
45823
46759
  }
45824
46760
  let a = mod(number3, modulo);
45825
46761
  let b = modulo;
45826
- let x = _0n3, y = _1n3, u = _1n3, v = _0n3;
45827
- while (a !== _0n3) {
46762
+ let x = _0n4, y = _1n4, u = _1n4, v = _0n4;
46763
+ while (a !== _0n4) {
45828
46764
  const q = b / a;
45829
46765
  const r = b % a;
45830
46766
  const m = x - u * q;
@@ -45832,19 +46768,19 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45832
46768
  b = a, a = r, x = u, y = v, u = m, v = n;
45833
46769
  }
45834
46770
  const gcd = b;
45835
- if (gcd !== _1n3)
46771
+ if (gcd !== _1n4)
45836
46772
  throw new Error("invert: does not exist");
45837
46773
  return mod(x, modulo);
45838
46774
  }
45839
46775
  function tonelliShanks(P) {
45840
- const legendreC = (P - _1n3) / _2n3;
46776
+ const legendreC = (P - _1n4) / _2n4;
45841
46777
  let Q, S, Z;
45842
- for (Q = P - _1n3, S = 0; Q % _2n3 === _0n3; Q /= _2n3, S++)
46778
+ for (Q = P - _1n4, S = 0; Q % _2n4 === _0n4; Q /= _2n4, S++)
45843
46779
  ;
45844
- for (Z = _2n3; Z < P && pow(Z, legendreC, P) !== P - _1n3; Z++)
46780
+ for (Z = _2n4; Z < P && pow(Z, legendreC, P) !== P - _1n4; Z++)
45845
46781
  ;
45846
46782
  if (S === 1) {
45847
- const p1div4 = (P + _1n3) / _4n;
46783
+ const p1div4 = (P + _1n4) / _4n;
45848
46784
  return function tonelliFast(Fp2, n) {
45849
46785
  const root = Fp2.pow(n, p1div4);
45850
46786
  if (!Fp2.eql(Fp2.sqr(root), n))
@@ -45852,7 +46788,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45852
46788
  return root;
45853
46789
  };
45854
46790
  }
45855
- const Q1div2 = (Q + _1n3) / _2n3;
46791
+ const Q1div2 = (Q + _1n4) / _2n4;
45856
46792
  return function tonelliSlow(Fp2, n) {
45857
46793
  if (Fp2.pow(n, legendreC) === Fp2.neg(Fp2.ONE))
45858
46794
  throw new Error("Cannot find square root");
@@ -45869,7 +46805,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45869
46805
  break;
45870
46806
  t2 = Fp2.sqr(t2);
45871
46807
  }
45872
- const ge = Fp2.pow(g, _1n3 << BigInt(r - m - 1));
46808
+ const ge = Fp2.pow(g, _1n4 << BigInt(r - m - 1));
45873
46809
  g = Fp2.sqr(ge);
45874
46810
  x = Fp2.mul(x, ge);
45875
46811
  b = Fp2.mul(b, g);
@@ -45880,7 +46816,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45880
46816
  }
45881
46817
  function FpSqrt(P) {
45882
46818
  if (P % _4n === _3n) {
45883
- const p1div4 = (P + _1n3) / _4n;
46819
+ const p1div4 = (P + _1n4) / _4n;
45884
46820
  return function sqrt3mod4(Fp2, n) {
45885
46821
  const root = Fp2.pow(n, p1div4);
45886
46822
  if (!Fp2.eql(Fp2.sqr(root), n))
@@ -45891,10 +46827,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45891
46827
  if (P % _8n === _5n) {
45892
46828
  const c1 = (P - _5n) / _8n;
45893
46829
  return function sqrt5mod8(Fp2, n) {
45894
- const n2 = Fp2.mul(n, _2n3);
46830
+ const n2 = Fp2.mul(n, _2n4);
45895
46831
  const v = Fp2.pow(n2, c1);
45896
46832
  const nv = Fp2.mul(n, v);
45897
- const i = Fp2.mul(Fp2.mul(nv, _2n3), v);
46833
+ const i = Fp2.mul(Fp2.mul(nv, _2n4), v);
45898
46834
  const root = Fp2.mul(nv, Fp2.sub(i, Fp2.ONE));
45899
46835
  if (!Fp2.eql(Fp2.sqr(root), n))
45900
46836
  throw new Error("Cannot find square root");
@@ -45938,19 +46874,19 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45938
46874
  return validateObject(field, opts);
45939
46875
  }
45940
46876
  function FpPow(f2, num, power) {
45941
- if (power < _0n3)
46877
+ if (power < _0n4)
45942
46878
  throw new Error("Expected power > 0");
45943
- if (power === _0n3)
46879
+ if (power === _0n4)
45944
46880
  return f2.ONE;
45945
- if (power === _1n3)
46881
+ if (power === _1n4)
45946
46882
  return num;
45947
46883
  let p = f2.ONE;
45948
46884
  let d = num;
45949
- while (power > _0n3) {
45950
- if (power & _1n3)
46885
+ while (power > _0n4) {
46886
+ if (power & _1n4)
45951
46887
  p = f2.mul(p, d);
45952
46888
  d = f2.sqr(d);
45953
- power >>= _1n3;
46889
+ power >>= _1n4;
45954
46890
  }
45955
46891
  return p;
45956
46892
  }
@@ -45977,7 +46913,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45977
46913
  return { nBitLength: _nBitLength, nByteLength };
45978
46914
  }
45979
46915
  function Field(ORDER, bitLen2, isLE3 = false, redef = {}) {
45980
- if (ORDER <= _0n3)
46916
+ if (ORDER <= _0n4)
45981
46917
  throw new Error(`Expected Field ORDER > 0, got ${ORDER}`);
45982
46918
  const { nBitLength: BITS, nByteLength: BYTES } = nLength(ORDER, bitLen2);
45983
46919
  if (BYTES > 2048)
@@ -45988,16 +46924,16 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45988
46924
  BITS,
45989
46925
  BYTES,
45990
46926
  MASK: bitMask(BITS),
45991
- ZERO: _0n3,
45992
- ONE: _1n3,
46927
+ ZERO: _0n4,
46928
+ ONE: _1n4,
45993
46929
  create: (num) => mod(num, ORDER),
45994
46930
  isValid: (num) => {
45995
46931
  if (typeof num !== "bigint")
45996
46932
  throw new Error(`Invalid field element: expected bigint, got ${typeof num}`);
45997
- return _0n3 <= num && num < ORDER;
46933
+ return _0n4 <= num && num < ORDER;
45998
46934
  },
45999
- is0: (num) => num === _0n3,
46000
- isOdd: (num) => (num & _1n3) === _1n3,
46935
+ is0: (num) => num === _0n4,
46936
+ isOdd: (num) => (num & _1n4) === _1n4,
46001
46937
  neg: (num) => mod(-num, ORDER),
46002
46938
  eql: (lhs, rhs) => lhs === rhs,
46003
46939
  sqr: (num) => mod(num * num, ORDER),
@@ -46043,13 +46979,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46043
46979
  if (len < 16 || len < minLen || len > 1024)
46044
46980
  throw new Error(`expected ${minLen}-1024 bytes of input, got ${len}`);
46045
46981
  const num = isLE3 ? bytesToNumberBE(key) : bytesToNumberLE(key);
46046
- const reduced = mod(num, fieldOrder - _1n3) + _1n3;
46982
+ const reduced = mod(num, fieldOrder - _1n4) + _1n4;
46047
46983
  return isLE3 ? numberToBytesLE(reduced, fieldLen) : numberToBytesBE(reduced, fieldLen);
46048
46984
  }
46049
46985
 
46050
46986
  // ../../node_modules/.pnpm/@noble+curves@1.3.0/node_modules/@noble/curves/esm/abstract/curve.js
46051
- var _0n4 = BigInt(0);
46052
- var _1n4 = BigInt(1);
46987
+ var _0n5 = BigInt(0);
46988
+ var _1n5 = BigInt(1);
46053
46989
  function wNAF(c, bits) {
46054
46990
  const constTimeNegate = (condition, item) => {
46055
46991
  const neg = item.negate();
@@ -46066,11 +47002,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46066
47002
  unsafeLadder(elm, n) {
46067
47003
  let p = c.ZERO;
46068
47004
  let d = elm;
46069
- while (n > _0n4) {
46070
- if (n & _1n4)
47005
+ while (n > _0n5) {
47006
+ if (n & _1n5)
46071
47007
  p = p.add(d);
46072
47008
  d = d.double();
46073
- n >>= _1n4;
47009
+ n >>= _1n5;
46074
47010
  }
46075
47011
  return p;
46076
47012
  },
@@ -46120,7 +47056,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46120
47056
  n >>= shiftBy;
46121
47057
  if (wbits > windowSize) {
46122
47058
  wbits -= maxNumber;
46123
- n += _1n4;
47059
+ n += _1n5;
46124
47060
  }
46125
47061
  const offset1 = offset;
46126
47062
  const offset2 = offset + Math.abs(wbits) - 1;
@@ -46244,9 +47180,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46244
47180
  return `30${h(rhl + shl + 4)}02${rl}${r}02${sl}${s}`;
46245
47181
  }
46246
47182
  };
46247
- var _0n5 = BigInt(0);
46248
- var _1n5 = BigInt(1);
46249
- var _2n4 = BigInt(2);
47183
+ var _0n6 = BigInt(0);
47184
+ var _1n6 = BigInt(1);
47185
+ var _2n5 = BigInt(2);
46250
47186
  var _3n2 = BigInt(3);
46251
47187
  var _4n2 = BigInt(4);
46252
47188
  function weierstrassPoints(opts) {
@@ -46271,7 +47207,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46271
47207
  if (!Fp2.eql(Fp2.sqr(CURVE.Gy), weierstrassEquation(CURVE.Gx)))
46272
47208
  throw new Error("bad generator point: equation left != right");
46273
47209
  function isWithinCurveOrder(num) {
46274
- return typeof num === "bigint" && _0n5 < num && num < CURVE.n;
47210
+ return typeof num === "bigint" && _0n6 < num && num < CURVE.n;
46275
47211
  }
46276
47212
  function assertGE(num) {
46277
47213
  if (!isWithinCurveOrder(num))
@@ -46515,10 +47451,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46515
47451
  */
46516
47452
  multiplyUnsafe(n) {
46517
47453
  const I = Point2.ZERO;
46518
- if (n === _0n5)
47454
+ if (n === _0n6)
46519
47455
  return I;
46520
47456
  assertGE(n);
46521
- if (n === _1n5)
47457
+ if (n === _1n6)
46522
47458
  return this;
46523
47459
  const { endo } = CURVE;
46524
47460
  if (!endo)
@@ -46527,14 +47463,14 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46527
47463
  let k1p = I;
46528
47464
  let k2p = I;
46529
47465
  let d = this;
46530
- while (k1 > _0n5 || k2 > _0n5) {
46531
- if (k1 & _1n5)
47466
+ while (k1 > _0n6 || k2 > _0n6) {
47467
+ if (k1 & _1n6)
46532
47468
  k1p = k1p.add(d);
46533
- if (k2 & _1n5)
47469
+ if (k2 & _1n6)
46534
47470
  k2p = k2p.add(d);
46535
47471
  d = d.double();
46536
- k1 >>= _1n5;
46537
- k2 >>= _1n5;
47472
+ k1 >>= _1n6;
47473
+ k2 >>= _1n6;
46538
47474
  }
46539
47475
  if (k1neg)
46540
47476
  k1p = k1p.negate();
@@ -46581,7 +47517,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46581
47517
  */
46582
47518
  multiplyAndAddUnsafe(Q, a, b) {
46583
47519
  const G = Point2.BASE;
46584
- const mul = (P, a2) => a2 === _0n5 || a2 === _1n5 || !P.equals(G) ? P.multiplyUnsafe(a2) : P.multiply(a2);
47520
+ const mul = (P, a2) => a2 === _0n6 || a2 === _1n6 || !P.equals(G) ? P.multiplyUnsafe(a2) : P.multiply(a2);
46585
47521
  const sum = mul(this, a).add(mul(Q, b));
46586
47522
  return sum.is0() ? void 0 : sum;
46587
47523
  }
@@ -46604,7 +47540,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46604
47540
  }
46605
47541
  isTorsionFree() {
46606
47542
  const { h: cofactor, isTorsionFree } = CURVE;
46607
- if (cofactor === _1n5)
47543
+ if (cofactor === _1n6)
46608
47544
  return true;
46609
47545
  if (isTorsionFree)
46610
47546
  return isTorsionFree(Point2, this);
@@ -46612,7 +47548,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46612
47548
  }
46613
47549
  clearCofactor() {
46614
47550
  const { h: cofactor, clearCofactor } = CURVE;
46615
- if (cofactor === _1n5)
47551
+ if (cofactor === _1n6)
46616
47552
  return this;
46617
47553
  if (clearCofactor)
46618
47554
  return clearCofactor(Point2, this);
@@ -46657,7 +47593,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46657
47593
  const compressedLen = Fp2.BYTES + 1;
46658
47594
  const uncompressedLen = 2 * Fp2.BYTES + 1;
46659
47595
  function isValidFieldElement(num) {
46660
- return _0n5 < num && num < Fp2.ORDER;
47596
+ return _0n6 < num && num < Fp2.ORDER;
46661
47597
  }
46662
47598
  function modN(a) {
46663
47599
  return mod(a, CURVE_ORDER);
@@ -46687,7 +47623,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46687
47623
  throw new Error("Point is not on curve");
46688
47624
  const y2 = weierstrassEquation(x);
46689
47625
  let y = Fp2.sqrt(y2);
46690
- const isYOdd = (y & _1n5) === _1n5;
47626
+ const isYOdd = (y & _1n6) === _1n6;
46691
47627
  const isHeadOdd = (head & 1) === 1;
46692
47628
  if (isHeadOdd !== isYOdd)
46693
47629
  y = Fp2.neg(y);
@@ -46703,7 +47639,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46703
47639
  });
46704
47640
  const numToNByteStr = (num) => bytesToHex(numberToBytesBE(num, CURVE.nByteLength));
46705
47641
  function isBiggerThanHalfOrder(number3) {
46706
- const HALF = CURVE_ORDER >> _1n5;
47642
+ const HALF = CURVE_ORDER >> _1n6;
46707
47643
  return number3 > HALF;
46708
47644
  }
46709
47645
  function normalizeS(s) {
@@ -46846,7 +47782,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46846
47782
  function int2octets(num) {
46847
47783
  if (typeof num !== "bigint")
46848
47784
  throw new Error("bigint expected");
46849
- if (!(_0n5 <= num && num < ORDER_MASK))
47785
+ if (!(_0n6 <= num && num < ORDER_MASK))
46850
47786
  throw new Error(`bigint expected < 2^${CURVE.nBitLength}`);
46851
47787
  return numberToBytesBE(num, CURVE.nByteLength);
46852
47788
  }
@@ -46876,12 +47812,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46876
47812
  const ik = invN(k);
46877
47813
  const q = Point2.BASE.multiply(k).toAffine();
46878
47814
  const r = modN(q.x);
46879
- if (r === _0n5)
47815
+ if (r === _0n6)
46880
47816
  return;
46881
47817
  const s = modN(ik * modN(m + r * d));
46882
- if (s === _0n5)
47818
+ if (s === _0n6)
46883
47819
  return;
46884
- let recovery = (q.x === r ? 0 : 2) | Number(q.y & _1n5);
47820
+ let recovery = (q.x === r ? 0 : 2) | Number(q.y & _1n6);
46885
47821
  let normS = s;
46886
47822
  if (lowS && isBiggerThanHalfOrder(s)) {
46887
47823
  normS = normalizeS(s);
@@ -46973,9 +47909,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46973
47909
  // ../../node_modules/.pnpm/@noble+curves@1.3.0/node_modules/@noble/curves/esm/secp256k1.js
46974
47910
  var secp256k1P = BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f");
46975
47911
  var secp256k1N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");
46976
- var _1n6 = BigInt(1);
46977
- var _2n5 = BigInt(2);
46978
- var divNearest = (a, b) => (a + b / _2n5) / b;
47912
+ var _1n7 = BigInt(1);
47913
+ var _2n6 = BigInt(2);
47914
+ var divNearest = (a, b) => (a + b / _2n6) / b;
46979
47915
  function sqrtMod(y) {
46980
47916
  const P = secp256k1P;
46981
47917
  const _3n3 = BigInt(3), _6n = BigInt(6), _11n = BigInt(11), _22n = BigInt(22);
@@ -46984,7 +47920,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46984
47920
  const b3 = b2 * b2 * y % P;
46985
47921
  const b6 = pow2(b3, _3n3, P) * b3 % P;
46986
47922
  const b9 = pow2(b6, _3n3, P) * b3 % P;
46987
- const b11 = pow2(b9, _2n5, P) * b2 % P;
47923
+ const b11 = pow2(b9, _2n6, P) * b2 % P;
46988
47924
  const b22 = pow2(b11, _11n, P) * b11 % P;
46989
47925
  const b44 = pow2(b22, _22n, P) * b22 % P;
46990
47926
  const b88 = pow2(b44, _44n, P) * b44 % P;
@@ -46993,7 +47929,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46993
47929
  const b223 = pow2(b220, _3n3, P) * b3 % P;
46994
47930
  const t1 = pow2(b223, _23n, P) * b22 % P;
46995
47931
  const t2 = pow2(t1, _6n, P) * b2 % P;
46996
- const root = pow2(t2, _2n5, P);
47932
+ const root = pow2(t2, _2n6, P);
46997
47933
  if (!Fp.eql(Fp.sqr(root), y))
46998
47934
  throw new Error("Cannot find square root");
46999
47935
  return root;
@@ -47026,7 +47962,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
47026
47962
  splitScalar: (k) => {
47027
47963
  const n = secp256k1N;
47028
47964
  const a1 = BigInt("0x3086d221a7d46bcde86c90e49284eb15");
47029
- const b1 = -_1n6 * BigInt("0xe4437ed6010e88286f547fa90abfe4c3");
47965
+ const b1 = -_1n7 * BigInt("0xe4437ed6010e88286f547fa90abfe4c3");
47030
47966
  const a2 = BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8");
47031
47967
  const b2 = a1;
47032
47968
  const POW_2_128 = BigInt("0x100000000000000000000000000000000");
@@ -47047,7 +47983,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
47047
47983
  }
47048
47984
  }
47049
47985
  }, sha256);
47050
- var _0n6 = BigInt(0);
47986
+ var _0n7 = BigInt(0);
47051
47987
  var Point = secp256k1.ProjectivePoint;
47052
47988
 
47053
47989
  // src/signer/signer.ts
@@ -47154,12 +48090,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
47154
48090
  };
47155
48091
 
47156
48092
  // ../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-node/rng.js
47157
- var import_crypto15 = __toESM(__require("crypto"));
48093
+ var import_crypto16 = __toESM(__require("crypto"));
47158
48094
  var rnds8Pool = new Uint8Array(256);
47159
48095
  var poolPtr = rnds8Pool.length;
47160
48096
  function rng() {
47161
48097
  if (poolPtr > rnds8Pool.length - 16) {
47162
- import_crypto15.default.randomFillSync(rnds8Pool);
48098
+ import_crypto16.default.randomFillSync(rnds8Pool);
47163
48099
  poolPtr = 0;
47164
48100
  }
47165
48101
  return rnds8Pool.slice(poolPtr, poolPtr += 16);
@@ -47175,9 +48111,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
47175
48111
  }
47176
48112
 
47177
48113
  // ../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-node/native.js
47178
- var import_crypto16 = __toESM(__require("crypto"));
48114
+ var import_crypto17 = __toESM(__require("crypto"));
47179
48115
  var native_default = {
47180
- randomUUID: import_crypto16.default.randomUUID
48116
+ randomUUID: import_crypto17.default.randomUUID
47181
48117
  };
47182
48118
 
47183
48119
  // ../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-node/v4.js
@@ -50115,16 +51051,21 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
50115
51051
  __publicField(Wallet, "fromEncryptedJson", WalletUnlocked.fromEncryptedJson);
50116
51052
 
50117
51053
  // src/test-utils/seedTestWallet.ts
50118
- var seedTestWallet = async (wallet, quantities) => {
51054
+ var seedTestWallet = async (wallet, quantities, utxosAmount = 1) => {
51055
+ const toFundAccounts = Array.isArray(wallet) ? wallet : [wallet];
50119
51056
  const genesisWallet = new WalletUnlocked(
50120
51057
  process.env.GENESIS_SECRET || randomBytes22(32),
50121
- wallet.provider
51058
+ // Connect to the same Provider as wallet
51059
+ toFundAccounts[0].provider
50122
51060
  );
50123
51061
  const request = new ScriptTransactionRequest();
50124
- quantities.forEach((quantity) => {
50125
- const { amount, assetId } = coinQuantityfy(quantity);
50126
- request.addCoinOutput(wallet.address, amount, assetId);
50127
- });
51062
+ quantities.map(coinQuantityfy).forEach(
51063
+ ({ amount, assetId }) => toFundAccounts.forEach(({ address }) => {
51064
+ for (let i = 0; i < utxosAmount; i++) {
51065
+ request.addCoinOutput(address, amount.div(utxosAmount), assetId);
51066
+ }
51067
+ })
51068
+ );
50128
51069
  const txCost = await genesisWallet.provider.getTransactionCost(request);
50129
51070
  request.gasLimit = txCost.gasUsed;
50130
51071
  request.maxFee = txCost.maxFee;
@@ -50158,7 +51099,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
50158
51099
 
50159
51100
  // src/test-utils/launchNode.ts
50160
51101
  var import_child_process = __require("child_process");
50161
- var import_crypto21 = __require("crypto");
51102
+ var import_crypto22 = __require("crypto");
50162
51103
  var import_fs2 = __require("fs");
50163
51104
  var import_os = __toESM(__require("os"));
50164
51105
  var import_path8 = __toESM(__require("path"));
@@ -50230,7 +51171,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
50230
51171
  })).toString();
50231
51172
  let snapshotDirToUse;
50232
51173
  const prefix = basePath || import_os.default.tmpdir();
50233
- const suffix = basePath ? "" : (0, import_crypto21.randomUUID)();
51174
+ const suffix = basePath ? "" : (0, import_crypto22.randomUUID)();
50234
51175
  const tempDirPath = import_path8.default.join(prefix, ".fuels", suffix, "snapshotDir");
50235
51176
  if (snapshotDir) {
50236
51177
  snapshotDirToUse = snapshotDir;
@@ -50357,6 +51298,33 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
50357
51298
  };
50358
51299
  return { wallets, stop: cleanup, provider };
50359
51300
  };
51301
+
51302
+ // src/test-utils/transactionRequest.ts
51303
+ var generateFakeRequestInputCoin = (partial = {}) => ({
51304
+ id: hexlify(randomBytes22(UTXO_ID_LEN)),
51305
+ type: InputType.Coin,
51306
+ owner: getRandomB256(),
51307
+ amount: bn(100),
51308
+ assetId: ZeroBytes32,
51309
+ txPointer: "0x00000000000000000000000000000000",
51310
+ witnessIndex: 0,
51311
+ ...partial
51312
+ });
51313
+ var generateFakeRequestInputMessage = (partial = {}) => ({
51314
+ nonce: getRandomB256(),
51315
+ type: InputType.Message,
51316
+ sender: getRandomB256(),
51317
+ recipient: getRandomB256(),
51318
+ amount: bn(100),
51319
+ witnessIndex: 0,
51320
+ ...partial
51321
+ });
51322
+ var generateFakeRequestInputContract = (partial = {}) => ({
51323
+ contractId: getRandomB256(),
51324
+ type: InputType.Contract,
51325
+ txPointer: "0x00000000000000000000000000000000",
51326
+ ...partial
51327
+ });
50360
51328
  })();
50361
51329
  /*! Bundled license information:
50362
51330