@fuel-ts/account 0.90.0 → 0.91.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of @fuel-ts/account might be problematic. Click here for more details.

@@ -76,20 +76,20 @@
76
76
  ctor.prototype = new TempCtor();
77
77
  ctor.prototype.constructor = ctor;
78
78
  }
79
- function BN2(number2, base, endian) {
80
- if (BN2.isBN(number2)) {
81
- return number2;
79
+ function BN2(number3, base, endian) {
80
+ if (BN2.isBN(number3)) {
81
+ return number3;
82
82
  }
83
83
  this.negative = 0;
84
84
  this.words = null;
85
85
  this.length = 0;
86
86
  this.red = null;
87
- if (number2 !== null) {
87
+ if (number3 !== null) {
88
88
  if (base === "le" || base === "be") {
89
89
  endian = base;
90
90
  base = 10;
91
91
  }
92
- this._init(number2 || 0, base || 10, endian || "be");
92
+ this._init(number3 || 0, base || 10, endian || "be");
93
93
  }
94
94
  }
95
95
  if (typeof module2 === "object") {
@@ -124,53 +124,53 @@
124
124
  return left;
125
125
  return right;
126
126
  };
127
- BN2.prototype._init = function init(number2, base, endian) {
128
- if (typeof number2 === "number") {
129
- return this._initNumber(number2, base, endian);
127
+ BN2.prototype._init = function init(number3, base, endian) {
128
+ if (typeof number3 === "number") {
129
+ return this._initNumber(number3, base, endian);
130
130
  }
131
- if (typeof number2 === "object") {
132
- return this._initArray(number2, base, endian);
131
+ if (typeof number3 === "object") {
132
+ return this._initArray(number3, base, endian);
133
133
  }
134
134
  if (base === "hex") {
135
135
  base = 16;
136
136
  }
137
137
  assert(base === (base | 0) && base >= 2 && base <= 36);
138
- number2 = number2.toString().replace(/\s+/g, "");
138
+ number3 = number3.toString().replace(/\s+/g, "");
139
139
  var start = 0;
140
- if (number2[0] === "-") {
140
+ if (number3[0] === "-") {
141
141
  start++;
142
142
  this.negative = 1;
143
143
  }
144
- if (start < number2.length) {
144
+ if (start < number3.length) {
145
145
  if (base === 16) {
146
- this._parseHex(number2, start, endian);
146
+ this._parseHex(number3, start, endian);
147
147
  } else {
148
- this._parseBase(number2, base, start);
148
+ this._parseBase(number3, base, start);
149
149
  if (endian === "le") {
150
150
  this._initArray(this.toArray(), base, endian);
151
151
  }
152
152
  }
153
153
  }
154
154
  };
155
- BN2.prototype._initNumber = function _initNumber(number2, base, endian) {
156
- if (number2 < 0) {
155
+ BN2.prototype._initNumber = function _initNumber(number3, base, endian) {
156
+ if (number3 < 0) {
157
157
  this.negative = 1;
158
- number2 = -number2;
158
+ number3 = -number3;
159
159
  }
160
- if (number2 < 67108864) {
161
- this.words = [number2 & 67108863];
160
+ if (number3 < 67108864) {
161
+ this.words = [number3 & 67108863];
162
162
  this.length = 1;
163
- } else if (number2 < 4503599627370496) {
163
+ } else if (number3 < 4503599627370496) {
164
164
  this.words = [
165
- number2 & 67108863,
166
- number2 / 67108864 & 67108863
165
+ number3 & 67108863,
166
+ number3 / 67108864 & 67108863
167
167
  ];
168
168
  this.length = 2;
169
169
  } else {
170
- assert(number2 < 9007199254740992);
170
+ assert(number3 < 9007199254740992);
171
171
  this.words = [
172
- number2 & 67108863,
173
- number2 / 67108864 & 67108863,
172
+ number3 & 67108863,
173
+ number3 / 67108864 & 67108863,
174
174
  1
175
175
  ];
176
176
  this.length = 3;
@@ -179,14 +179,14 @@
179
179
  return;
180
180
  this._initArray(this.toArray(), base, endian);
181
181
  };
182
- BN2.prototype._initArray = function _initArray(number2, base, endian) {
183
- assert(typeof number2.length === "number");
184
- if (number2.length <= 0) {
182
+ BN2.prototype._initArray = function _initArray(number3, base, endian) {
183
+ assert(typeof number3.length === "number");
184
+ if (number3.length <= 0) {
185
185
  this.words = [0];
186
186
  this.length = 1;
187
187
  return this;
188
188
  }
189
- this.length = Math.ceil(number2.length / 3);
189
+ this.length = Math.ceil(number3.length / 3);
190
190
  this.words = new Array(this.length);
191
191
  for (var i = 0; i < this.length; i++) {
192
192
  this.words[i] = 0;
@@ -194,8 +194,8 @@
194
194
  var j, w;
195
195
  var off = 0;
196
196
  if (endian === "be") {
197
- for (i = number2.length - 1, j = 0; i >= 0; i -= 3) {
198
- w = number2[i] | number2[i - 1] << 8 | number2[i - 2] << 16;
197
+ for (i = number3.length - 1, j = 0; i >= 0; i -= 3) {
198
+ w = number3[i] | number3[i - 1] << 8 | number3[i - 2] << 16;
199
199
  this.words[j] |= w << off & 67108863;
200
200
  this.words[j + 1] = w >>> 26 - off & 67108863;
201
201
  off += 24;
@@ -205,8 +205,8 @@
205
205
  }
206
206
  }
207
207
  } else if (endian === "le") {
208
- for (i = 0, j = 0; i < number2.length; i += 3) {
209
- w = number2[i] | number2[i + 1] << 8 | number2[i + 2] << 16;
208
+ for (i = 0, j = 0; i < number3.length; i += 3) {
209
+ w = number3[i] | number3[i + 1] << 8 | number3[i + 2] << 16;
210
210
  this.words[j] |= w << off & 67108863;
211
211
  this.words[j + 1] = w >>> 26 - off & 67108863;
212
212
  off += 24;
@@ -237,8 +237,8 @@
237
237
  }
238
238
  return r;
239
239
  }
240
- BN2.prototype._parseHex = function _parseHex(number2, start, endian) {
241
- this.length = Math.ceil((number2.length - start) / 6);
240
+ BN2.prototype._parseHex = function _parseHex(number3, start, endian) {
241
+ this.length = Math.ceil((number3.length - start) / 6);
242
242
  this.words = new Array(this.length);
243
243
  for (var i = 0; i < this.length; i++) {
244
244
  this.words[i] = 0;
@@ -247,8 +247,8 @@
247
247
  var j = 0;
248
248
  var w;
249
249
  if (endian === "be") {
250
- for (i = number2.length - 1; i >= start; i -= 2) {
251
- w = parseHexByte(number2, start, i) << off;
250
+ for (i = number3.length - 1; i >= start; i -= 2) {
251
+ w = parseHexByte(number3, start, i) << off;
252
252
  this.words[j] |= w & 67108863;
253
253
  if (off >= 18) {
254
254
  off -= 18;
@@ -259,9 +259,9 @@
259
259
  }
260
260
  }
261
261
  } else {
262
- var parseLength = number2.length - start;
263
- for (i = parseLength % 2 === 0 ? start + 1 : start; i < number2.length; i += 2) {
264
- w = parseHexByte(number2, start, i) << off;
262
+ var parseLength = number3.length - start;
263
+ for (i = parseLength % 2 === 0 ? start + 1 : start; i < number3.length; i += 2) {
264
+ w = parseHexByte(number3, start, i) << off;
265
265
  this.words[j] |= w & 67108863;
266
266
  if (off >= 18) {
267
267
  off -= 18;
@@ -293,7 +293,7 @@
293
293
  }
294
294
  return r;
295
295
  }
296
- BN2.prototype._parseBase = function _parseBase(number2, base, start) {
296
+ BN2.prototype._parseBase = function _parseBase(number3, base, start) {
297
297
  this.words = [0];
298
298
  this.length = 1;
299
299
  for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base) {
@@ -301,12 +301,12 @@
301
301
  }
302
302
  limbLen--;
303
303
  limbPow = limbPow / base | 0;
304
- var total = number2.length - start;
304
+ var total = number3.length - start;
305
305
  var mod2 = total % limbLen;
306
306
  var end = Math.min(total, total - mod2) + start;
307
307
  var word = 0;
308
308
  for (var i = start; i < end; i += limbLen) {
309
- word = parseBase(number2, i, i + limbLen, base);
309
+ word = parseBase(number3, i, i + limbLen, base);
310
310
  this.imuln(limbPow);
311
311
  if (this.words[0] + word < 67108864) {
312
312
  this.words[0] += word;
@@ -316,7 +316,7 @@
316
316
  }
317
317
  if (mod2 !== 0) {
318
318
  var pow3 = 1;
319
- word = parseBase(number2, i, number2.length, base);
319
+ word = parseBase(number3, i, number3.length, base);
320
320
  for (i = 0; i < mod2; i++) {
321
321
  pow3 *= base;
322
322
  }
@@ -2642,20 +2642,20 @@
2642
2642
  );
2643
2643
  }
2644
2644
  inherits(K256, MPrime);
2645
- K256.prototype.split = function split2(input, output2) {
2645
+ K256.prototype.split = function split2(input, output3) {
2646
2646
  var mask = 4194303;
2647
2647
  var outLen = Math.min(input.length, 9);
2648
2648
  for (var i = 0; i < outLen; i++) {
2649
- output2.words[i] = input.words[i];
2649
+ output3.words[i] = input.words[i];
2650
2650
  }
2651
- output2.length = outLen;
2651
+ output3.length = outLen;
2652
2652
  if (input.length <= 9) {
2653
2653
  input.words[0] = 0;
2654
2654
  input.length = 1;
2655
2655
  return;
2656
2656
  }
2657
2657
  var prev = input.words[9];
2658
- output2.words[output2.length++] = prev & mask;
2658
+ output3.words[output3.length++] = prev & mask;
2659
2659
  for (i = 10; i < input.length; i++) {
2660
2660
  var next = input.words[i] | 0;
2661
2661
  input.words[i - 10] = (next & mask) << 4 | prev >>> 22;
@@ -3051,8 +3051,8 @@
3051
3051
  }
3052
3052
  return result;
3053
3053
  }
3054
- function toWords(bytes2) {
3055
- return convert2(bytes2, 8, 5, true);
3054
+ function toWords(bytes3) {
3055
+ return convert2(bytes3, 8, 5, true);
3056
3056
  }
3057
3057
  function fromWordsUnsafe(words) {
3058
3058
  const res = convert2(words, 5, 8, false);
@@ -3591,18 +3591,18 @@
3591
3591
  }
3592
3592
  function utf8PercentDecode(str) {
3593
3593
  const input = new Buffer(str);
3594
- const output2 = [];
3594
+ const output3 = [];
3595
3595
  for (let i = 0; i < input.length; ++i) {
3596
3596
  if (input[i] !== 37) {
3597
- output2.push(input[i]);
3597
+ output3.push(input[i]);
3598
3598
  } else if (input[i] === 37 && isASCIIHex(input[i + 1]) && isASCIIHex(input[i + 2])) {
3599
- output2.push(parseInt(input.slice(i + 1, i + 3).toString(), 16));
3599
+ output3.push(parseInt(input.slice(i + 1, i + 3).toString(), 16));
3600
3600
  i += 2;
3601
3601
  } else {
3602
- output2.push(input[i]);
3602
+ output3.push(input[i]);
3603
3603
  }
3604
3604
  }
3605
- return new Buffer(output2).toString();
3605
+ return new Buffer(output3).toString();
3606
3606
  }
3607
3607
  function isC0ControlPercentEncode(c) {
3608
3608
  return c <= 31 || c > 126;
@@ -3678,16 +3678,16 @@
3678
3678
  return ipv4;
3679
3679
  }
3680
3680
  function serializeIPv4(address) {
3681
- let output2 = "";
3681
+ let output3 = "";
3682
3682
  let n = address;
3683
3683
  for (let i = 1; i <= 4; ++i) {
3684
- output2 = String(n % 256) + output2;
3684
+ output3 = String(n % 256) + output3;
3685
3685
  if (i !== 4) {
3686
- output2 = "." + output2;
3686
+ output3 = "." + output3;
3687
3687
  }
3688
3688
  n = Math.floor(n / 256);
3689
3689
  }
3690
- return output2;
3690
+ return output3;
3691
3691
  }
3692
3692
  function parseIPv6(input) {
3693
3693
  const address = [0, 0, 0, 0, 0, 0, 0, 0];
@@ -3745,13 +3745,13 @@
3745
3745
  return failure;
3746
3746
  }
3747
3747
  while (isASCIIDigit(input[pointer])) {
3748
- const number2 = parseInt(at(input, pointer));
3748
+ const number3 = parseInt(at(input, pointer));
3749
3749
  if (ipv4Piece === null) {
3750
- ipv4Piece = number2;
3750
+ ipv4Piece = number3;
3751
3751
  } else if (ipv4Piece === 0) {
3752
3752
  return failure;
3753
3753
  } else {
3754
- ipv4Piece = ipv4Piece * 10 + number2;
3754
+ ipv4Piece = ipv4Piece * 10 + number3;
3755
3755
  }
3756
3756
  if (ipv4Piece > 255) {
3757
3757
  return failure;
@@ -3795,7 +3795,7 @@
3795
3795
  return address;
3796
3796
  }
3797
3797
  function serializeIPv6(address) {
3798
- let output2 = "";
3798
+ let output3 = "";
3799
3799
  const seqResult = findLongestZeroSequence(address);
3800
3800
  const compress = seqResult.idx;
3801
3801
  let ignore0 = false;
@@ -3807,16 +3807,16 @@
3807
3807
  }
3808
3808
  if (compress === pieceIndex) {
3809
3809
  const separator = pieceIndex === 0 ? "::" : ":";
3810
- output2 += separator;
3810
+ output3 += separator;
3811
3811
  ignore0 = true;
3812
3812
  continue;
3813
3813
  }
3814
- output2 += address[pieceIndex].toString(16);
3814
+ output3 += address[pieceIndex].toString(16);
3815
3815
  if (pieceIndex !== 7) {
3816
- output2 += ":";
3816
+ output3 += ":";
3817
3817
  }
3818
3818
  }
3819
- return output2;
3819
+ return output3;
3820
3820
  }
3821
3821
  function parseHost(input, isSpecialArg) {
3822
3822
  if (input[0] === "[") {
@@ -3846,12 +3846,12 @@
3846
3846
  if (containsForbiddenHostCodePointExcludingPercent(input)) {
3847
3847
  return failure;
3848
3848
  }
3849
- let output2 = "";
3849
+ let output3 = "";
3850
3850
  const decoded = punycode.ucs2.decode(input);
3851
3851
  for (let i = 0; i < decoded.length; ++i) {
3852
- output2 += percentEncodeChar(decoded[i], isC0ControlPercentEncode);
3852
+ output3 += percentEncodeChar(decoded[i], isC0ControlPercentEncode);
3853
3853
  }
3854
- return output2;
3854
+ return output3;
3855
3855
  }
3856
3856
  function findLongestZeroSequence(arr) {
3857
3857
  let maxIdx = null;
@@ -4476,37 +4476,37 @@
4476
4476
  return true;
4477
4477
  };
4478
4478
  function serializeURL(url, excludeFragment) {
4479
- let output2 = url.scheme + ":";
4479
+ let output3 = url.scheme + ":";
4480
4480
  if (url.host !== null) {
4481
- output2 += "//";
4481
+ output3 += "//";
4482
4482
  if (url.username !== "" || url.password !== "") {
4483
- output2 += url.username;
4483
+ output3 += url.username;
4484
4484
  if (url.password !== "") {
4485
- output2 += ":" + url.password;
4485
+ output3 += ":" + url.password;
4486
4486
  }
4487
- output2 += "@";
4487
+ output3 += "@";
4488
4488
  }
4489
- output2 += serializeHost(url.host);
4489
+ output3 += serializeHost(url.host);
4490
4490
  if (url.port !== null) {
4491
- output2 += ":" + url.port;
4491
+ output3 += ":" + url.port;
4492
4492
  }
4493
4493
  } else if (url.host === null && url.scheme === "file") {
4494
- output2 += "//";
4494
+ output3 += "//";
4495
4495
  }
4496
4496
  if (url.cannotBeABaseURL) {
4497
- output2 += url.path[0];
4497
+ output3 += url.path[0];
4498
4498
  } else {
4499
4499
  for (const string of url.path) {
4500
- output2 += "/" + string;
4500
+ output3 += "/" + string;
4501
4501
  }
4502
4502
  }
4503
4503
  if (url.query !== null) {
4504
- output2 += "?" + url.query;
4504
+ output3 += "?" + url.query;
4505
4505
  }
4506
4506
  if (!excludeFragment && url.fragment !== null) {
4507
- output2 += "#" + url.fragment;
4507
+ output3 += "#" + url.fragment;
4508
4508
  }
4509
- return output2;
4509
+ return output3;
4510
4510
  }
4511
4511
  function serializeOrigin(tuple) {
4512
4512
  let result = tuple.scheme + "://";
@@ -6450,19 +6450,19 @@
6450
6450
  return "GraphQLError";
6451
6451
  }
6452
6452
  toString() {
6453
- let output2 = this.message;
6453
+ let output3 = this.message;
6454
6454
  if (this.nodes) {
6455
6455
  for (const node of this.nodes) {
6456
6456
  if (node.loc) {
6457
- output2 += "\n\n" + (0, _printLocation.printLocation)(node.loc);
6457
+ output3 += "\n\n" + (0, _printLocation.printLocation)(node.loc);
6458
6458
  }
6459
6459
  }
6460
6460
  } else if (this.source && this.locations) {
6461
6461
  for (const location of this.locations) {
6462
- output2 += "\n\n" + (0, _printLocation.printSourceLocation)(this.source, location);
6462
+ output3 += "\n\n" + (0, _printLocation.printSourceLocation)(this.source, location);
6463
6463
  }
6464
6464
  }
6465
- return output2;
6465
+ return output3;
6466
6466
  }
6467
6467
  toJSON() {
6468
6468
  const formattedError = {
@@ -18777,7 +18777,7 @@ spurious results.`);
18777
18777
  module.exports = iterate;
18778
18778
  function iterate(list, iterator, state, callback) {
18779
18779
  var key = state["keyedList"] ? state["keyedList"][state.index] : state.index;
18780
- state.jobs[key] = runJob(iterator, key, list[key], function(error, output2) {
18780
+ state.jobs[key] = runJob(iterator, key, list[key], function(error, output3) {
18781
18781
  if (!(key in state.jobs)) {
18782
18782
  return;
18783
18783
  }
@@ -18785,7 +18785,7 @@ spurious results.`);
18785
18785
  if (error) {
18786
18786
  abort(state);
18787
18787
  } else {
18788
- state.results[key] = output2;
18788
+ state.results[key] = output3;
18789
18789
  }
18790
18790
  callback(error, state.results);
18791
18791
  });
@@ -20547,8 +20547,8 @@ spurious results.`);
20547
20547
  const ret3 = wasm$1.retd(addr, len);
20548
20548
  return Instruction.__wrap(ret3);
20549
20549
  }
20550
- function aloc(bytes2) {
20551
- const ret3 = wasm$1.aloc(bytes2);
20550
+ function aloc(bytes3) {
20551
+ const ret3 = wasm$1.aloc(bytes3);
20552
20552
  return Instruction.__wrap(ret3);
20553
20553
  }
20554
20554
  function mcl(dst_addr, len) {
@@ -21757,9 +21757,9 @@ spurious results.`);
21757
21757
  * Construct the instruction from its parts.
21758
21758
  * @param {RegId} bytes
21759
21759
  */
21760
- constructor(bytes2) {
21761
- _assertClass(bytes2, RegId);
21762
- var ptr0 = bytes2.__destroy_into_raw();
21760
+ constructor(bytes3) {
21761
+ _assertClass(bytes3, RegId);
21762
+ var ptr0 = bytes3.__destroy_into_raw();
21763
21763
  const ret3 = wasm$1.aloc_new_typescript(ptr0);
21764
21764
  this.__wbg_ptr = ret3 >>> 0;
21765
21765
  return this;
@@ -28296,8 +28296,8 @@ spurious results.`);
28296
28296
  }
28297
28297
  }
28298
28298
  }
28299
- const bytes2 = await module2.arrayBuffer();
28300
- return await WebAssembly.instantiate(bytes2, imports);
28299
+ const bytes3 = await module2.arrayBuffer();
28300
+ return await WebAssembly.instantiate(bytes3, imports);
28301
28301
  } else {
28302
28302
  const instance = await WebAssembly.instantiate(module2, imports);
28303
28303
  if (instance instanceof WebAssembly.Instance) {
@@ -30702,12 +30702,12 @@ spurious results.`);
30702
30702
  createDebug.skips = [];
30703
30703
  createDebug.formatters = {};
30704
30704
  function selectColor(namespace) {
30705
- var hash3 = 0;
30705
+ var hash4 = 0;
30706
30706
  for (var i = 0; i < namespace.length; i++) {
30707
- hash3 = (hash3 << 5) - hash3 + namespace.charCodeAt(i);
30708
- hash3 |= 0;
30707
+ hash4 = (hash4 << 5) - hash4 + namespace.charCodeAt(i);
30708
+ hash4 |= 0;
30709
30709
  }
30710
- return createDebug.colors[Math.abs(hash3) % createDebug.colors.length];
30710
+ return createDebug.colors[Math.abs(hash4) % createDebug.colors.length];
30711
30711
  }
30712
30712
  createDebug.selectColor = selectColor;
30713
30713
  function createDebug(namespace) {
@@ -31494,7 +31494,7 @@ spurious results.`);
31494
31494
  "../../node_modules/.pnpm/tree-kill@1.2.2/node_modules/tree-kill/index.js"(exports, module) {
31495
31495
  "use strict";
31496
31496
  var childProcess = __require("child_process");
31497
- var spawn2 = childProcess.spawn;
31497
+ var spawn = childProcess.spawn;
31498
31498
  var exec = childProcess.exec;
31499
31499
  module.exports = function(pid, signal, callback) {
31500
31500
  if (typeof signal === "function" && callback === void 0) {
@@ -31519,14 +31519,14 @@ spurious results.`);
31519
31519
  break;
31520
31520
  case "darwin":
31521
31521
  buildProcessTree(pid, tree, pidsToProcess, function(parentPid) {
31522
- return spawn2("pgrep", ["-P", parentPid]);
31522
+ return spawn("pgrep", ["-P", parentPid]);
31523
31523
  }, function() {
31524
31524
  killAll(tree, signal, callback);
31525
31525
  });
31526
31526
  break;
31527
31527
  default:
31528
31528
  buildProcessTree(pid, tree, pidsToProcess, function(parentPid) {
31529
- return spawn2("ps", ["-o", "pid", "--no-headers", "--ppid", parentPid]);
31529
+ return spawn("ps", ["-o", "pid", "--no-headers", "--ppid", parentPid]);
31530
31530
  }, function() {
31531
31531
  killAll(tree, signal, callback);
31532
31532
  });
@@ -31609,11 +31609,11 @@ spurious results.`);
31609
31609
  if (lengths.length > 0 && !lengths.includes(b.length))
31610
31610
  throw new Error(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`);
31611
31611
  }
31612
- function hash(hash3) {
31613
- if (typeof hash3 !== "function" || typeof hash3.create !== "function")
31612
+ function hash(hash4) {
31613
+ if (typeof hash4 !== "function" || typeof hash4.create !== "function")
31614
31614
  throw new Error("Hash should be wrapped by utils.wrapConstructor");
31615
- number(hash3.outputLen);
31616
- number(hash3.blockLen);
31615
+ number(hash4.outputLen);
31616
+ number(hash4.blockLen);
31617
31617
  }
31618
31618
  function exists(instance, checkFinished = true) {
31619
31619
  if (instance.destroyed)
@@ -31629,10 +31629,6 @@ spurious results.`);
31629
31629
  }
31630
31630
  }
31631
31631
 
31632
- // ../../node_modules/.pnpm/@noble+hashes@1.3.3/node_modules/@noble/hashes/esm/cryptoNode.js
31633
- var nc = __toESM(__require("crypto"), 1);
31634
- var crypto = nc && typeof nc === "object" && "webcrypto" in nc ? nc.webcrypto : void 0;
31635
-
31636
31632
  // ../../node_modules/.pnpm/@noble+hashes@1.3.3/node_modules/@noble/hashes/esm/utils.js
31637
31633
  var u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
31638
31634
  function isBytes2(a) {
@@ -31655,22 +31651,6 @@ spurious results.`);
31655
31651
  throw new Error(`expected Uint8Array, got ${typeof data}`);
31656
31652
  return data;
31657
31653
  }
31658
- function concatBytes(...arrays) {
31659
- let sum = 0;
31660
- for (let i = 0; i < arrays.length; i++) {
31661
- const a = arrays[i];
31662
- if (!isBytes2(a))
31663
- throw new Error("Uint8Array expected");
31664
- sum += a.length;
31665
- }
31666
- const res = new Uint8Array(sum);
31667
- for (let i = 0, pad3 = 0; i < arrays.length; i++) {
31668
- const a = arrays[i];
31669
- res.set(a, pad3);
31670
- pad3 += a.length;
31671
- }
31672
- return res;
31673
- }
31674
31654
  var Hash = class {
31675
31655
  // Safe version that clones internal state
31676
31656
  clone() {
@@ -31700,33 +31680,27 @@ spurious results.`);
31700
31680
  hashC.create = (opts) => hashCons(opts);
31701
31681
  return hashC;
31702
31682
  }
31703
- function randomBytes(bytesLength = 32) {
31704
- if (crypto && typeof crypto.getRandomValues === "function") {
31705
- return crypto.getRandomValues(new Uint8Array(bytesLength));
31706
- }
31707
- throw new Error("crypto.getRandomValues must be defined");
31708
- }
31709
31683
 
31710
31684
  // ../../node_modules/.pnpm/@noble+hashes@1.3.3/node_modules/@noble/hashes/esm/_sha2.js
31711
- function setBigUint64(view, byteOffset, value, isLE2) {
31685
+ function setBigUint64(view, byteOffset, value, isLE3) {
31712
31686
  if (typeof view.setBigUint64 === "function")
31713
- return view.setBigUint64(byteOffset, value, isLE2);
31687
+ return view.setBigUint64(byteOffset, value, isLE3);
31714
31688
  const _32n2 = BigInt(32);
31715
31689
  const _u32_max = BigInt(4294967295);
31716
31690
  const wh = Number(value >> _32n2 & _u32_max);
31717
31691
  const wl = Number(value & _u32_max);
31718
- const h = isLE2 ? 4 : 0;
31719
- const l = isLE2 ? 0 : 4;
31720
- view.setUint32(byteOffset + h, wh, isLE2);
31721
- view.setUint32(byteOffset + l, wl, isLE2);
31692
+ const h = isLE3 ? 4 : 0;
31693
+ const l = isLE3 ? 0 : 4;
31694
+ view.setUint32(byteOffset + h, wh, isLE3);
31695
+ view.setUint32(byteOffset + l, wl, isLE3);
31722
31696
  }
31723
31697
  var SHA2 = class extends Hash {
31724
- constructor(blockLen, outputLen, padOffset, isLE2) {
31698
+ constructor(blockLen, outputLen, padOffset, isLE3) {
31725
31699
  super();
31726
31700
  this.blockLen = blockLen;
31727
31701
  this.outputLen = outputLen;
31728
31702
  this.padOffset = padOffset;
31729
- this.isLE = isLE2;
31703
+ this.isLE = isLE3;
31730
31704
  this.finished = false;
31731
31705
  this.length = 0;
31732
31706
  this.pos = 0;
@@ -31763,7 +31737,7 @@ spurious results.`);
31763
31737
  exists(this);
31764
31738
  output(out, this);
31765
31739
  this.finished = true;
31766
- const { buffer, view, blockLen, isLE: isLE2 } = this;
31740
+ const { buffer, view, blockLen, isLE: isLE3 } = this;
31767
31741
  let { pos } = this;
31768
31742
  buffer[pos++] = 128;
31769
31743
  this.buffer.subarray(pos).fill(0);
@@ -31773,7 +31747,7 @@ spurious results.`);
31773
31747
  }
31774
31748
  for (let i = pos; i < blockLen; i++)
31775
31749
  buffer[i] = 0;
31776
- setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE2);
31750
+ setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE3);
31777
31751
  this.process(view, 0);
31778
31752
  const oview = createView(out);
31779
31753
  const len = this.outputLen;
@@ -31784,7 +31758,7 @@ spurious results.`);
31784
31758
  if (outLen > state.length)
31785
31759
  throw new Error("_sha2: outputLen bigger than state");
31786
31760
  for (let i = 0; i < outLen; i++)
31787
- oview.setUint32(4 * i, state[i], isLE2);
31761
+ oview.setUint32(4 * i, state[i], isLE3);
31788
31762
  }
31789
31763
  digest() {
31790
31764
  const { buffer, outputLen } = this;
@@ -31961,24 +31935,24 @@ spurious results.`);
31961
31935
 
31962
31936
  // ../../node_modules/.pnpm/@noble+hashes@1.3.3/node_modules/@noble/hashes/esm/hmac.js
31963
31937
  var HMAC = class extends Hash {
31964
- constructor(hash3, _key) {
31938
+ constructor(hash4, _key) {
31965
31939
  super();
31966
31940
  this.finished = false;
31967
31941
  this.destroyed = false;
31968
- hash(hash3);
31942
+ hash(hash4);
31969
31943
  const key = toBytes(_key);
31970
- this.iHash = hash3.create();
31944
+ this.iHash = hash4.create();
31971
31945
  if (typeof this.iHash.update !== "function")
31972
31946
  throw new Error("Expected instance of class which extends utils.Hash");
31973
31947
  this.blockLen = this.iHash.blockLen;
31974
31948
  this.outputLen = this.iHash.outputLen;
31975
31949
  const blockLen = this.blockLen;
31976
31950
  const pad3 = new Uint8Array(blockLen);
31977
- pad3.set(key.length > blockLen ? hash3.create().update(key).digest() : key);
31951
+ pad3.set(key.length > blockLen ? hash4.create().update(key).digest() : key);
31978
31952
  for (let i = 0; i < pad3.length; i++)
31979
31953
  pad3[i] ^= 54;
31980
31954
  this.iHash.update(pad3);
31981
- this.oHash = hash3.create();
31955
+ this.oHash = hash4.create();
31982
31956
  for (let i = 0; i < pad3.length; i++)
31983
31957
  pad3[i] ^= 54 ^ 92;
31984
31958
  this.oHash.update(pad3);
@@ -32021,12 +31995,12 @@ spurious results.`);
32021
31995
  this.iHash.destroy();
32022
31996
  }
32023
31997
  };
32024
- var hmac = (hash3, key, message) => new HMAC(hash3, key).update(message).digest();
32025
- hmac.create = (hash3, key) => new HMAC(hash3, key);
31998
+ var hmac = (hash4, key, message) => new HMAC(hash4, key).update(message).digest();
31999
+ hmac.create = (hash4, key) => new HMAC(hash4, key);
32026
32000
 
32027
32001
  // ../../node_modules/.pnpm/@noble+hashes@1.3.3/node_modules/@noble/hashes/esm/pbkdf2.js
32028
- function pbkdf2Init(hash3, _password, _salt, _opts) {
32029
- hash(hash3);
32002
+ function pbkdf2Init(hash4, _password, _salt, _opts) {
32003
+ hash(hash4);
32030
32004
  const opts = checkOpts({ dkLen: 32, asyncTick: 10 }, _opts);
32031
32005
  const { c, dkLen, asyncTick } = opts;
32032
32006
  number(c);
@@ -32037,7 +32011,7 @@ spurious results.`);
32037
32011
  const password = toBytes(_password);
32038
32012
  const salt = toBytes(_salt);
32039
32013
  const DK = new Uint8Array(dkLen);
32040
- const PRF = hmac.create(hash3, password);
32014
+ const PRF = hmac.create(hash4, password);
32041
32015
  const PRFSalt = PRF._cloneInto().update(salt);
32042
32016
  return { c, dkLen, asyncTick, DK, PRF, PRFSalt };
32043
32017
  }
@@ -32049,8 +32023,8 @@ spurious results.`);
32049
32023
  u.fill(0);
32050
32024
  return DK;
32051
32025
  }
32052
- function pbkdf2(hash3, password, salt, opts) {
32053
- const { c, dkLen, DK, PRF, PRFSalt } = pbkdf2Init(hash3, password, salt, opts);
32026
+ function pbkdf2(hash4, password, salt, opts) {
32027
+ const { c, dkLen, DK, PRF, PRFSalt } = pbkdf2Init(hash4, password, salt, opts);
32054
32028
  let prfW;
32055
32029
  const arr = new Uint8Array(4);
32056
32030
  const view = createView(arr);
@@ -32377,9 +32351,9 @@ spurious results.`);
32377
32351
  throw new Error("XOF is not possible for this instance");
32378
32352
  return this.writeInto(out);
32379
32353
  }
32380
- xof(bytes2) {
32381
- number(bytes2);
32382
- return this.xofInto(new Uint8Array(bytes2));
32354
+ xof(bytes3) {
32355
+ number(bytes3);
32356
+ return this.xofInto(new Uint8Array(bytes3));
32383
32357
  }
32384
32358
  digestInto(out) {
32385
32359
  output(out, this);
@@ -32427,9 +32401,9 @@ spurious results.`);
32427
32401
  // ../versions/dist/index.mjs
32428
32402
  function getBuiltinVersions() {
32429
32403
  return {
32430
- FORC: "0.60.0",
32404
+ FORC: "0.61.1",
32431
32405
  FUEL_CORE: "0.30.0",
32432
- FUELS: "0.90.0"
32406
+ FUELS: "0.91.0"
32433
32407
  };
32434
32408
  }
32435
32409
  function parseVersion(version) {
@@ -32552,15 +32526,17 @@ This unreleased fuel-core build may include features and updates not yet support
32552
32526
  ErrorCode2["UNLOCKED_WALLET_REQUIRED"] = "unlocked-wallet-required";
32553
32527
  ErrorCode2["ERROR_BUILDING_BLOCK_EXPLORER_URL"] = "error-building-block-explorer-url";
32554
32528
  ErrorCode2["VITEPRESS_PLUGIN_ERROR"] = "vitepress-plugin-error";
32555
- ErrorCode2["INVALID_MULTICALL"] = "invalid-multicall";
32556
32529
  ErrorCode2["SCRIPT_REVERTED"] = "script-reverted";
32557
32530
  ErrorCode2["SCRIPT_RETURN_INVALID_TYPE"] = "script-return-invalid-type";
32558
32531
  ErrorCode2["STREAM_PARSING_ERROR"] = "stream-parsing-error";
32532
+ ErrorCode2["NODE_LAUNCH_FAILED"] = "node-launch-failed";
32533
+ ErrorCode2["UNKNOWN"] = "unknown";
32559
32534
  return ErrorCode2;
32560
32535
  })(ErrorCode || {});
32561
32536
  var _FuelError = class extends Error {
32562
32537
  VERSIONS = versions;
32563
32538
  metadata;
32539
+ rawError;
32564
32540
  static parse(e) {
32565
32541
  const error = e;
32566
32542
  if (error.code === void 0) {
@@ -32580,15 +32556,16 @@ This unreleased fuel-core build may include features and updates not yet support
32580
32556
  return new _FuelError(error.code, error.message);
32581
32557
  }
32582
32558
  code;
32583
- constructor(code, message, metadata = {}) {
32559
+ constructor(code, message, metadata = {}, rawError = {}) {
32584
32560
  super(message);
32585
32561
  this.code = code;
32586
32562
  this.name = "FuelError";
32587
32563
  this.metadata = metadata;
32564
+ this.rawError = rawError;
32588
32565
  }
32589
32566
  toObject() {
32590
- const { code, name, message, metadata, VERSIONS } = this;
32591
- return { code, name, message, metadata, VERSIONS };
32567
+ const { code, name, message, metadata, VERSIONS, rawError } = this;
32568
+ return { code, name, message, metadata, VERSIONS, rawError };
32592
32569
  }
32593
32570
  };
32594
32571
  var FuelError = _FuelError;
@@ -32630,15 +32607,15 @@ This unreleased fuel-core build may include features and updates not yet support
32630
32607
  // ANCHOR: HELPERS
32631
32608
  // make sure we always include `0x` in hex strings
32632
32609
  toString(base, length) {
32633
- const output2 = super.toString(base, length);
32610
+ const output3 = super.toString(base, length);
32634
32611
  if (base === 16 || base === "hex") {
32635
- return `0x${output2}`;
32612
+ return `0x${output3}`;
32636
32613
  }
32637
- return output2;
32614
+ return output3;
32638
32615
  }
32639
32616
  toHex(bytesPadding) {
32640
- const bytes2 = bytesPadding || 0;
32641
- const bytesLength = bytes2 * 2;
32617
+ const bytes3 = bytesPadding || 0;
32618
+ const bytesLength = bytes3 * 2;
32642
32619
  if (this.isNeg()) {
32643
32620
  throw new FuelError(ErrorCode.CONVERTING_FAILED, "Cannot convert negative value to hex.");
32644
32621
  }
@@ -32749,21 +32726,21 @@ This unreleased fuel-core build may include features and updates not yet support
32749
32726
  // END ANCHOR: OVERRIDES to output our BN type
32750
32727
  // ANCHOR: OVERRIDES to avoid losing references
32751
32728
  caller(v, methodName) {
32752
- const output2 = super[methodName](new BN(v));
32753
- if (BN.isBN(output2)) {
32754
- return new BN(output2.toArray());
32729
+ const output3 = super[methodName](new BN(v));
32730
+ if (BN.isBN(output3)) {
32731
+ return new BN(output3.toArray());
32755
32732
  }
32756
- if (typeof output2 === "boolean") {
32757
- return output2;
32733
+ if (typeof output3 === "boolean") {
32734
+ return output3;
32758
32735
  }
32759
- return output2;
32736
+ return output3;
32760
32737
  }
32761
32738
  clone() {
32762
32739
  return new BN(this.toArray());
32763
32740
  }
32764
32741
  mulTo(num, out) {
32765
- const output2 = new import_bn.default(this.toArray()).mulTo(num, out);
32766
- return new BN(output2.toArray());
32742
+ const output3 = new import_bn.default(this.toArray()).mulTo(num, out);
32743
+ return new BN(output3.toArray());
32767
32744
  }
32768
32745
  egcd(p) {
32769
32746
  const { a, b, gcd } = new import_bn.default(this.toArray()).egcd(p);
@@ -32842,7 +32819,7 @@ This unreleased fuel-core build may include features and updates not yet support
32842
32819
  If you are attempting to transform a hex value, please make sure it is being passed as a string and wrapped in quotes.`;
32843
32820
  throw new FuelError(ErrorCode.INVALID_DATA, message);
32844
32821
  };
32845
- var concatBytes2 = (arrays) => {
32822
+ var concatBytes = (arrays) => {
32846
32823
  const byteArrays = arrays.map((array) => {
32847
32824
  if (array instanceof Uint8Array) {
32848
32825
  return array;
@@ -32858,15 +32835,15 @@ If you are attempting to transform a hex value, please make sure it is being pas
32858
32835
  return concatenated;
32859
32836
  };
32860
32837
  var concat = (arrays) => {
32861
- const bytes2 = arrays.map((v) => arrayify(v));
32862
- return concatBytes2(bytes2);
32838
+ const bytes3 = arrays.map((v) => arrayify(v));
32839
+ return concatBytes(bytes3);
32863
32840
  };
32864
32841
  var HexCharacters = "0123456789abcdef";
32865
32842
  function hexlify(data) {
32866
- const bytes2 = arrayify(data);
32843
+ const bytes3 = arrayify(data);
32867
32844
  let result = "0x";
32868
- for (let i = 0; i < bytes2.length; i++) {
32869
- const v = bytes2[i];
32845
+ for (let i = 0; i < bytes3.length; i++) {
32846
+ const v = bytes3[i];
32870
32847
  result += HexCharacters[(v & 240) >> 4] + HexCharacters[v & 15];
32871
32848
  }
32872
32849
  return result;
@@ -33070,9 +33047,21 @@ If you are attempting to transform a hex value, please make sure it is being pas
33070
33047
  xor: 2,
33071
33048
  xori: 2,
33072
33049
  alocDependentCost: {
33073
- LightOperation: {
33074
- base: "2",
33075
- unitsPerGas: "214"
33050
+ HeavyOperation: {
33051
+ base: 2,
33052
+ gasPerUnit: 0
33053
+ }
33054
+ },
33055
+ cfe: {
33056
+ HeavyOperation: {
33057
+ base: 2,
33058
+ gasPerUnit: 0
33059
+ }
33060
+ },
33061
+ cfeiDependentCost: {
33062
+ HeavyOperation: {
33063
+ base: 2,
33064
+ gasPerUnit: 0
33076
33065
  }
33077
33066
  },
33078
33067
  call: {
@@ -33724,15 +33713,15 @@ If you are attempting to transform a hex value, please make sure it is being pas
33724
33713
  return bn(result);
33725
33714
  }
33726
33715
  function encodeBase58(_value) {
33727
- const bytes2 = arrayify(_value);
33728
- let value = bn(bytes2);
33716
+ const bytes3 = arrayify(_value);
33717
+ let value = bn(bytes3);
33729
33718
  let result = "";
33730
33719
  while (value.gt(BN_0)) {
33731
33720
  result = Alphabet[Number(value.mod(BN_58))] + result;
33732
33721
  value = value.div(BN_58);
33733
33722
  }
33734
- for (let i = 0; i < bytes2.length; i++) {
33735
- if (bytes2[i]) {
33723
+ for (let i = 0; i < bytes3.length; i++) {
33724
+ if (bytes3[i]) {
33736
33725
  break;
33737
33726
  }
33738
33727
  result = Alphabet[0] + result;
@@ -33748,11 +33737,11 @@ If you are attempting to transform a hex value, please make sure it is being pas
33748
33737
  return result;
33749
33738
  }
33750
33739
  function dataSlice(data, start, end) {
33751
- const bytes2 = arrayify(data);
33752
- if (end != null && end > bytes2.length) {
33740
+ const bytes3 = arrayify(data);
33741
+ if (end != null && end > bytes3.length) {
33753
33742
  throw new FuelError(ErrorCode.INVALID_DATA, "cannot slice beyond data bounds");
33754
33743
  }
33755
- return hexlify(bytes2.slice(start == null ? 0 : start, end == null ? bytes2.length : end));
33744
+ return hexlify(bytes3.slice(start == null ? 0 : start, end == null ? bytes3.length : end));
33756
33745
  }
33757
33746
  function toUtf8Bytes(stri, form = true) {
33758
33747
  let str = stri;
@@ -33789,8 +33778,8 @@ If you are attempting to transform a hex value, please make sure it is being pas
33789
33778
  }
33790
33779
  return new Uint8Array(result);
33791
33780
  }
33792
- function onError(reason, offset, bytes2, output2, badCodepoint) {
33793
- console.log(`invalid codepoint at offset ${offset}; ${reason}, bytes: ${bytes2}`);
33781
+ function onError(reason, offset, bytes3, output3, badCodepoint) {
33782
+ console.log(`invalid codepoint at offset ${offset}; ${reason}, bytes: ${bytes3}`);
33794
33783
  return offset;
33795
33784
  }
33796
33785
  function helper(codePoints) {
@@ -33806,11 +33795,11 @@ If you are attempting to transform a hex value, please make sure it is being pas
33806
33795
  }).join("");
33807
33796
  }
33808
33797
  function getUtf8CodePoints(_bytes) {
33809
- const bytes2 = arrayify(_bytes, "bytes");
33798
+ const bytes3 = arrayify(_bytes, "bytes");
33810
33799
  const result = [];
33811
33800
  let i = 0;
33812
- while (i < bytes2.length) {
33813
- const c = bytes2[i++];
33801
+ while (i < bytes3.length) {
33802
+ const c = bytes3[i++];
33814
33803
  if (c >> 7 === 0) {
33815
33804
  result.push(c);
33816
33805
  continue;
@@ -33828,21 +33817,21 @@ If you are attempting to transform a hex value, please make sure it is being pas
33828
33817
  overlongMask = 65535;
33829
33818
  } else {
33830
33819
  if ((c & 192) === 128) {
33831
- i += onError("UNEXPECTED_CONTINUE", i - 1, bytes2, result);
33820
+ i += onError("UNEXPECTED_CONTINUE", i - 1, bytes3, result);
33832
33821
  } else {
33833
- i += onError("BAD_PREFIX", i - 1, bytes2, result);
33822
+ i += onError("BAD_PREFIX", i - 1, bytes3, result);
33834
33823
  }
33835
33824
  continue;
33836
33825
  }
33837
- if (i - 1 + extraLength >= bytes2.length) {
33838
- i += onError("OVERRUN", i - 1, bytes2, result);
33826
+ if (i - 1 + extraLength >= bytes3.length) {
33827
+ i += onError("OVERRUN", i - 1, bytes3, result);
33839
33828
  continue;
33840
33829
  }
33841
33830
  let res = c & (1 << 8 - extraLength - 1) - 1;
33842
33831
  for (let j = 0; j < extraLength; j++) {
33843
- const nextChar = bytes2[i];
33832
+ const nextChar = bytes3[i];
33844
33833
  if ((nextChar & 192) !== 128) {
33845
- i += onError("MISSING_CONTINUE", i, bytes2, result);
33834
+ i += onError("MISSING_CONTINUE", i, bytes3, result);
33846
33835
  res = null;
33847
33836
  break;
33848
33837
  }
@@ -33853,23 +33842,23 @@ If you are attempting to transform a hex value, please make sure it is being pas
33853
33842
  continue;
33854
33843
  }
33855
33844
  if (res > 1114111) {
33856
- i += onError("OUT_OF_RANGE", i - 1 - extraLength, bytes2, result, res);
33845
+ i += onError("OUT_OF_RANGE", i - 1 - extraLength, bytes3, result, res);
33857
33846
  continue;
33858
33847
  }
33859
33848
  if (res >= 55296 && res <= 57343) {
33860
- i += onError("UTF16_SURROGATE", i - 1 - extraLength, bytes2, result, res);
33849
+ i += onError("UTF16_SURROGATE", i - 1 - extraLength, bytes3, result, res);
33861
33850
  continue;
33862
33851
  }
33863
33852
  if (res <= overlongMask) {
33864
- i += onError("OVERLONG", i - 1 - extraLength, bytes2, result, res);
33853
+ i += onError("OVERLONG", i - 1 - extraLength, bytes3, result, res);
33865
33854
  continue;
33866
33855
  }
33867
33856
  result.push(res);
33868
33857
  }
33869
33858
  return result;
33870
33859
  }
33871
- function toUtf8String(bytes2) {
33872
- return helper(getUtf8CodePoints(bytes2));
33860
+ function toUtf8String(bytes3) {
33861
+ return helper(getUtf8CodePoints(bytes3));
33873
33862
  }
33874
33863
 
33875
33864
  // ../../node_modules/.pnpm/@noble+hashes@1.3.3/node_modules/@noble/hashes/esm/ripemd160.js
@@ -33970,11 +33959,11 @@ If you are attempting to transform a hex value, please make sure it is being pas
33970
33959
  var ripemd160 = /* @__PURE__ */ wrapConstructor(() => new RIPEMD160());
33971
33960
 
33972
33961
  // ../crypto/dist/index.mjs
33973
- var import_crypto2 = __toESM(__require("crypto"), 1);
33974
- var import_crypto3 = __require("crypto");
33962
+ var import_crypto = __toESM(__require("crypto"), 1);
33963
+ var import_crypto2 = __require("crypto");
33964
+ var import_crypto3 = __toESM(__require("crypto"), 1);
33975
33965
  var import_crypto4 = __toESM(__require("crypto"), 1);
33976
- var import_crypto5 = __toESM(__require("crypto"), 1);
33977
- var import_crypto6 = __require("crypto");
33966
+ var import_crypto5 = __require("crypto");
33978
33967
  var scrypt2 = (params) => {
33979
33968
  const { password, salt, n, p, r, dklen } = params;
33980
33969
  const derivedKey = scrypt(password, salt, { N: n, r, p, dkLen: dklen });
@@ -34001,7 +33990,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
34001
33990
  Object.freeze(ripemd1602);
34002
33991
  var bufferFromString = (string, encoding = "base64") => Uint8Array.from(Buffer.from(string, encoding));
34003
33992
  var locked2 = false;
34004
- var PBKDF2 = (password, salt, iterations, keylen, algo) => (0, import_crypto3.pbkdf2Sync)(password, salt, iterations, keylen, algo);
33993
+ var PBKDF2 = (password, salt, iterations, keylen, algo) => (0, import_crypto2.pbkdf2Sync)(password, salt, iterations, keylen, algo);
34005
33994
  var pBkdf2 = PBKDF2;
34006
33995
  function pbkdf22(_password, _salt, iterations, keylen, algo) {
34007
33996
  const password = arrayify(_password, "password");
@@ -34019,8 +34008,8 @@ If you are attempting to transform a hex value, please make sure it is being pas
34019
34008
  pBkdf2 = func;
34020
34009
  };
34021
34010
  Object.freeze(pbkdf22);
34022
- var randomBytes2 = (length) => {
34023
- const randomValues = Uint8Array.from(import_crypto4.default.randomBytes(length));
34011
+ var randomBytes = (length) => {
34012
+ const randomValues = Uint8Array.from(import_crypto3.default.randomBytes(length));
34024
34013
  return randomValues;
34025
34014
  };
34026
34015
  var stringFromBuffer = (buffer, encoding = "base64") => Buffer.from(buffer).toString(encoding);
@@ -34031,11 +34020,11 @@ If you are attempting to transform a hex value, please make sure it is being pas
34031
34020
  return arrayify(key);
34032
34021
  };
34033
34022
  var encrypt = async (password, data) => {
34034
- const iv = randomBytes2(16);
34035
- const salt = randomBytes2(32);
34023
+ const iv = randomBytes(16);
34024
+ const salt = randomBytes(32);
34036
34025
  const secret = keyFromPassword(password, salt);
34037
34026
  const dataBuffer = Uint8Array.from(Buffer.from(JSON.stringify(data), "utf-8"));
34038
- const cipher = await import_crypto2.default.createCipheriv(ALGORITHM, secret, iv);
34027
+ const cipher = await import_crypto.default.createCipheriv(ALGORITHM, secret, iv);
34039
34028
  let cipherData = cipher.update(dataBuffer);
34040
34029
  cipherData = Buffer.concat([cipherData, cipher.final()]);
34041
34030
  return {
@@ -34049,7 +34038,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
34049
34038
  const salt = bufferFromString(keystore.salt);
34050
34039
  const secret = keyFromPassword(password, salt);
34051
34040
  const encryptedText = bufferFromString(keystore.data);
34052
- const decipher = await import_crypto2.default.createDecipheriv(ALGORITHM, secret, iv);
34041
+ const decipher = await import_crypto.default.createDecipheriv(ALGORITHM, secret, iv);
34053
34042
  const decrypted = decipher.update(encryptedText);
34054
34043
  const deBuff = Buffer.concat([decrypted, decipher.final()]);
34055
34044
  const decryptedData = Buffer.from(deBuff).toString("utf-8");
@@ -34060,17 +34049,17 @@ If you are attempting to transform a hex value, please make sure it is being pas
34060
34049
  }
34061
34050
  };
34062
34051
  async function encryptJsonWalletData(data, key, iv) {
34063
- const cipher = await import_crypto5.default.createCipheriv("aes-128-ctr", key.subarray(0, 16), iv);
34052
+ const cipher = await import_crypto4.default.createCipheriv("aes-128-ctr", key.subarray(0, 16), iv);
34064
34053
  const encrypted = Buffer.concat([cipher.update(data), cipher.final()]);
34065
34054
  return new Uint8Array(encrypted);
34066
34055
  }
34067
34056
  async function decryptJsonWalletData(data, key, iv) {
34068
- const decipher = import_crypto5.default.createDecipheriv("aes-128-ctr", key.subarray(0, 16), iv);
34057
+ const decipher = import_crypto4.default.createDecipheriv("aes-128-ctr", key.subarray(0, 16), iv);
34069
34058
  const decrypted = await Buffer.concat([decipher.update(data), decipher.final()]);
34070
34059
  return new Uint8Array(decrypted);
34071
34060
  }
34072
34061
  var locked3 = false;
34073
- var COMPUTEHMAC = (algorithm, key, data) => (0, import_crypto6.createHmac)(algorithm, key).update(data).digest();
34062
+ var COMPUTEHMAC = (algorithm, key, data) => (0, import_crypto5.createHmac)(algorithm, key).update(data).digest();
34074
34063
  var computeHMAC = COMPUTEHMAC;
34075
34064
  function computeHmac(algorithm, _key, _data) {
34076
34065
  const key = arrayify(_key, "key");
@@ -34094,7 +34083,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
34094
34083
  decrypt,
34095
34084
  encrypt,
34096
34085
  keyFromPassword,
34097
- randomBytes: randomBytes2,
34086
+ randomBytes,
34098
34087
  scrypt: scrypt2,
34099
34088
  keccak256,
34100
34089
  decryptJsonWalletData,
@@ -34109,7 +34098,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
34109
34098
  decrypt: decrypt2,
34110
34099
  encrypt: encrypt2,
34111
34100
  keyFromPassword: keyFromPassword2,
34112
- randomBytes: randomBytes22,
34101
+ randomBytes: randomBytes2,
34113
34102
  stringFromBuffer: stringFromBuffer2,
34114
34103
  scrypt: scrypt22,
34115
34104
  keccak256: keccak2562,
@@ -34287,15 +34276,15 @@ If you are attempting to transform a hex value, please make sure it is being pas
34287
34276
  if (data.length < this.encodedLength) {
34288
34277
  throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid b256 data size.`);
34289
34278
  }
34290
- let bytes2 = data.slice(offset, offset + this.encodedLength);
34291
- const decoded = bn(bytes2);
34279
+ let bytes3 = data.slice(offset, offset + this.encodedLength);
34280
+ const decoded = bn(bytes3);
34292
34281
  if (decoded.isZero()) {
34293
- bytes2 = new Uint8Array(32);
34282
+ bytes3 = new Uint8Array(32);
34294
34283
  }
34295
- if (bytes2.length !== this.encodedLength) {
34284
+ if (bytes3.length !== this.encodedLength) {
34296
34285
  throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid b256 byte data size.`);
34297
34286
  }
34298
- return [toHex(bytes2, 32), offset + 32];
34287
+ return [toHex(bytes3, 32), offset + 32];
34299
34288
  }
34300
34289
  };
34301
34290
  var B512Coder = class extends Coder {
@@ -34318,15 +34307,15 @@ If you are attempting to transform a hex value, please make sure it is being pas
34318
34307
  if (data.length < this.encodedLength) {
34319
34308
  throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid b512 data size.`);
34320
34309
  }
34321
- let bytes2 = data.slice(offset, offset + this.encodedLength);
34322
- const decoded = bn(bytes2);
34310
+ let bytes3 = data.slice(offset, offset + this.encodedLength);
34311
+ const decoded = bn(bytes3);
34323
34312
  if (decoded.isZero()) {
34324
- bytes2 = new Uint8Array(64);
34313
+ bytes3 = new Uint8Array(64);
34325
34314
  }
34326
- if (bytes2.length !== this.encodedLength) {
34315
+ if (bytes3.length !== this.encodedLength) {
34327
34316
  throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid b512 byte data size.`);
34328
34317
  }
34329
- return [toHex(bytes2, this.encodedLength), offset + this.encodedLength];
34318
+ return [toHex(bytes3, this.encodedLength), offset + this.encodedLength];
34330
34319
  }
34331
34320
  };
34332
34321
  var encodedLengths = {
@@ -34338,24 +34327,24 @@ If you are attempting to transform a hex value, please make sure it is being pas
34338
34327
  super("bigNumber", baseType, encodedLengths[baseType]);
34339
34328
  }
34340
34329
  encode(value) {
34341
- let bytes2;
34330
+ let bytes3;
34342
34331
  try {
34343
- bytes2 = toBytes2(value, this.encodedLength);
34332
+ bytes3 = toBytes2(value, this.encodedLength);
34344
34333
  } catch (error) {
34345
34334
  throw new FuelError(ErrorCode.ENCODE_ERROR, `Invalid ${this.type}.`);
34346
34335
  }
34347
- return bytes2;
34336
+ return bytes3;
34348
34337
  }
34349
34338
  decode(data, offset) {
34350
34339
  if (data.length < this.encodedLength) {
34351
34340
  throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid ${this.type} data size.`);
34352
34341
  }
34353
- let bytes2 = data.slice(offset, offset + this.encodedLength);
34354
- bytes2 = bytes2.slice(0, this.encodedLength);
34355
- if (bytes2.length !== this.encodedLength) {
34342
+ let bytes3 = data.slice(offset, offset + this.encodedLength);
34343
+ bytes3 = bytes3.slice(0, this.encodedLength);
34344
+ if (bytes3.length !== this.encodedLength) {
34356
34345
  throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid ${this.type} byte data size.`);
34357
34346
  }
34358
- return [bn(bytes2), offset + this.encodedLength];
34347
+ return [bn(bytes3), offset + this.encodedLength];
34359
34348
  }
34360
34349
  };
34361
34350
  var BooleanCoder = class extends Coder {
@@ -34378,11 +34367,11 @@ If you are attempting to transform a hex value, please make sure it is being pas
34378
34367
  if (data.length < this.encodedLength) {
34379
34368
  throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid boolean data size.`);
34380
34369
  }
34381
- const bytes2 = bn(data.slice(offset, offset + this.encodedLength));
34382
- if (bytes2.isZero()) {
34370
+ const bytes3 = bn(data.slice(offset, offset + this.encodedLength));
34371
+ if (bytes3.isZero()) {
34383
34372
  return [false, offset + this.encodedLength];
34384
34373
  }
34385
- if (!bytes2.eq(bn(1))) {
34374
+ if (!bytes3.eq(bn(1))) {
34386
34375
  throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid boolean value.`);
34387
34376
  }
34388
34377
  return [true, offset + this.encodedLength];
@@ -34393,9 +34382,9 @@ If you are attempting to transform a hex value, please make sure it is being pas
34393
34382
  super("struct", "struct Bytes", WORD_SIZE);
34394
34383
  }
34395
34384
  encode(value) {
34396
- const bytes2 = value instanceof Uint8Array ? value : new Uint8Array(value);
34397
- const lengthBytes = new BigNumberCoder("u64").encode(bytes2.length);
34398
- return new Uint8Array([...lengthBytes, ...bytes2]);
34385
+ const bytes3 = value instanceof Uint8Array ? value : new Uint8Array(value);
34386
+ const lengthBytes = new BigNumberCoder("u64").encode(bytes3.length);
34387
+ return new Uint8Array([...lengthBytes, ...bytes3]);
34399
34388
  }
34400
34389
  decode(data, offset) {
34401
34390
  if (data.length < WORD_SIZE) {
@@ -34522,26 +34511,26 @@ If you are attempting to transform a hex value, please make sure it is being pas
34522
34511
  this.options = options;
34523
34512
  }
34524
34513
  encode(value) {
34525
- let bytes2;
34514
+ let bytes3;
34526
34515
  try {
34527
- bytes2 = toBytes2(value);
34516
+ bytes3 = toBytes2(value);
34528
34517
  } catch (error) {
34529
34518
  throw new FuelError(ErrorCode.ENCODE_ERROR, `Invalid ${this.baseType}.`);
34530
34519
  }
34531
- if (bytes2.length > this.encodedLength) {
34520
+ if (bytes3.length > this.encodedLength) {
34532
34521
  throw new FuelError(ErrorCode.ENCODE_ERROR, `Invalid ${this.baseType}, too many bytes.`);
34533
34522
  }
34534
- return toBytes2(bytes2, this.encodedLength);
34523
+ return toBytes2(bytes3, this.encodedLength);
34535
34524
  }
34536
34525
  decode(data, offset) {
34537
34526
  if (data.length < this.encodedLength) {
34538
34527
  throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid number data size.`);
34539
34528
  }
34540
- const bytes2 = data.slice(offset, offset + this.encodedLength);
34541
- if (bytes2.length !== this.encodedLength) {
34529
+ const bytes3 = data.slice(offset, offset + this.encodedLength);
34530
+ if (bytes3.length !== this.encodedLength) {
34542
34531
  throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid number byte data size.`);
34543
34532
  }
34544
- return [toNumber(bytes2), offset + this.encodedLength];
34533
+ return [toNumber(bytes3), offset + this.encodedLength];
34545
34534
  }
34546
34535
  };
34547
34536
  var OptionCoder = class extends EnumCoder {
@@ -34559,9 +34548,9 @@ If you are attempting to transform a hex value, please make sure it is being pas
34559
34548
  const [decoded, newOffset] = super.decode(data, offset);
34560
34549
  return [this.toOption(decoded), newOffset];
34561
34550
  }
34562
- toOption(output2) {
34563
- if (output2 && "Some" in output2) {
34564
- return output2.Some;
34551
+ toOption(output3) {
34552
+ if (output3 && "Some" in output3) {
34553
+ return output3.Some;
34565
34554
  }
34566
34555
  return void 0;
34567
34556
  }
@@ -34575,9 +34564,9 @@ If you are attempting to transform a hex value, please make sure it is being pas
34575
34564
  throw new FuelError(ErrorCode.ENCODE_ERROR, `Expected array value.`);
34576
34565
  }
34577
34566
  const internalCoder = new ArrayCoder(new NumberCoder("u8"), value.length);
34578
- const bytes2 = internalCoder.encode(value);
34579
- const lengthBytes = new BigNumberCoder("u64").encode(bytes2.length);
34580
- return new Uint8Array([...lengthBytes, ...bytes2]);
34567
+ const bytes3 = internalCoder.encode(value);
34568
+ const lengthBytes = new BigNumberCoder("u64").encode(bytes3.length);
34569
+ return new Uint8Array([...lengthBytes, ...bytes3]);
34581
34570
  }
34582
34571
  decode(data, offset) {
34583
34572
  if (data.length < this.encodedLength) {
@@ -34600,9 +34589,9 @@ If you are attempting to transform a hex value, please make sure it is being pas
34600
34589
  super("struct", "struct String", WORD_SIZE);
34601
34590
  }
34602
34591
  encode(value) {
34603
- const bytes2 = toUtf8Bytes(value);
34592
+ const bytes3 = toUtf8Bytes(value);
34604
34593
  const lengthBytes = new BigNumberCoder("u64").encode(value.length);
34605
- return new Uint8Array([...lengthBytes, ...bytes2]);
34594
+ return new Uint8Array([...lengthBytes, ...bytes3]);
34606
34595
  }
34607
34596
  decode(data, offset) {
34608
34597
  if (data.length < this.encodedLength) {
@@ -34624,9 +34613,9 @@ If you are attempting to transform a hex value, please make sure it is being pas
34624
34613
  super("strSlice", "str", WORD_SIZE);
34625
34614
  }
34626
34615
  encode(value) {
34627
- const bytes2 = toUtf8Bytes(value);
34616
+ const bytes3 = toUtf8Bytes(value);
34628
34617
  const lengthBytes = new BigNumberCoder("u64").encode(value.length);
34629
- return new Uint8Array([...lengthBytes, ...bytes2]);
34618
+ return new Uint8Array([...lengthBytes, ...bytes3]);
34630
34619
  }
34631
34620
  decode(data, offset) {
34632
34621
  if (data.length < this.encodedLength) {
@@ -34635,11 +34624,11 @@ If you are attempting to transform a hex value, please make sure it is being pas
34635
34624
  const offsetAndLength = offset + WORD_SIZE;
34636
34625
  const lengthBytes = data.slice(offset, offsetAndLength);
34637
34626
  const length = bn(new BigNumberCoder("u64").decode(lengthBytes, 0)[0]).toNumber();
34638
- const bytes2 = data.slice(offsetAndLength, offsetAndLength + length);
34639
- if (bytes2.length !== length) {
34627
+ const bytes3 = data.slice(offsetAndLength, offsetAndLength + length);
34628
+ if (bytes3.length !== length) {
34640
34629
  throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid string slice byte data size.`);
34641
34630
  }
34642
- return [toUtf8String(bytes2), offsetAndLength + length];
34631
+ return [toUtf8String(bytes3), offsetAndLength + length];
34643
34632
  }
34644
34633
  };
34645
34634
  __publicField4(StrSliceCoder, "memorySize", 1);
@@ -34657,11 +34646,11 @@ If you are attempting to transform a hex value, please make sure it is being pas
34657
34646
  if (data.length < this.encodedLength) {
34658
34647
  throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid string data size.`);
34659
34648
  }
34660
- const bytes2 = data.slice(offset, offset + this.encodedLength);
34661
- if (bytes2.length !== this.encodedLength) {
34649
+ const bytes3 = data.slice(offset, offset + this.encodedLength);
34650
+ if (bytes3.length !== this.encodedLength) {
34662
34651
  throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid string byte data size.`);
34663
34652
  }
34664
- return [toUtf8String(bytes2), offset + this.encodedLength];
34653
+ return [toUtf8String(bytes3), offset + this.encodedLength];
34665
34654
  }
34666
34655
  };
34667
34656
  var StructCoder = class extends Coder {
@@ -34679,7 +34668,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
34679
34668
  this.#hasNestedOption = hasNestedOption(coders);
34680
34669
  }
34681
34670
  encode(value) {
34682
- return concatBytes2(
34671
+ return concatBytes(
34683
34672
  Object.keys(this.coders).map((fieldName) => {
34684
34673
  const fieldCoder = this.coders[fieldName];
34685
34674
  const fieldValue = value[fieldName];
@@ -34721,7 +34710,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
34721
34710
  if (this.coders.length !== value.length) {
34722
34711
  throw new FuelError(ErrorCode.ENCODE_ERROR, `Types/values length mismatch.`);
34723
34712
  }
34724
- return concatBytes2(this.coders.map((coder, i) => coder.encode(value[i])));
34713
+ return concatBytes(this.coders.map((coder, i) => coder.encode(value[i])));
34725
34714
  }
34726
34715
  decode(data, offset) {
34727
34716
  if (!this.#hasNestedOption && data.length < this.encodedLength) {
@@ -34755,9 +34744,9 @@ If you are attempting to transform a hex value, please make sure it is being pas
34755
34744
  if (isUint8Array(value)) {
34756
34745
  return new Uint8Array([...lengthCoder.encode(value.length), ...value]);
34757
34746
  }
34758
- const bytes2 = value.map((v) => this.coder.encode(v));
34747
+ const bytes3 = value.map((v) => this.coder.encode(v));
34759
34748
  const lengthBytes = lengthCoder.encode(value.length);
34760
- return new Uint8Array([...lengthBytes, ...concatBytes2(bytes2)]);
34749
+ return new Uint8Array([...lengthBytes, ...concatBytes(bytes3)]);
34761
34750
  }
34762
34751
  decode(data, offset) {
34763
34752
  if (!this.#hasNestedOption && data.length < this.encodedLength || data.length > MAX_BYTES) {
@@ -35136,10 +35125,10 @@ If you are attempting to transform a hex value, please make sure it is being pas
35136
35125
  throw new FuelError(ErrorCode.ABI_TYPES_AND_VALUES_MISMATCH, errorMsg);
35137
35126
  }
35138
35127
  decodeArguments(data) {
35139
- const bytes2 = arrayify(data);
35128
+ const bytes3 = arrayify(data);
35140
35129
  const nonEmptyInputs = findNonEmptyInputs(this.jsonAbi, this.jsonFn.inputs);
35141
35130
  if (nonEmptyInputs.length === 0) {
35142
- if (bytes2.length === 0) {
35131
+ if (bytes3.length === 0) {
35143
35132
  return void 0;
35144
35133
  }
35145
35134
  throw new FuelError(
@@ -35148,12 +35137,12 @@ If you are attempting to transform a hex value, please make sure it is being pas
35148
35137
  count: {
35149
35138
  types: this.jsonFn.inputs.length,
35150
35139
  nonEmptyInputs: nonEmptyInputs.length,
35151
- values: bytes2.length
35140
+ values: bytes3.length
35152
35141
  },
35153
35142
  value: {
35154
35143
  args: this.jsonFn.inputs,
35155
35144
  nonEmptyInputs,
35156
- values: bytes2
35145
+ values: bytes3
35157
35146
  }
35158
35147
  })}`
35159
35148
  );
@@ -35161,7 +35150,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
35161
35150
  const result = nonEmptyInputs.reduce(
35162
35151
  (obj, input) => {
35163
35152
  const coder = AbiCoder.getCoder(this.jsonAbi, input, { encoding: this.encoding });
35164
- const [decodedValue, decodedValueByteSize] = coder.decode(bytes2, obj.offset);
35153
+ const [decodedValue, decodedValueByteSize] = coder.decode(bytes3, obj.offset);
35165
35154
  return {
35166
35155
  decoded: [...obj.decoded, decodedValue],
35167
35156
  offset: obj.offset + decodedValueByteSize
@@ -35176,11 +35165,11 @@ If you are attempting to transform a hex value, please make sure it is being pas
35176
35165
  if (outputAbiType.type === "()") {
35177
35166
  return [void 0, 0];
35178
35167
  }
35179
- const bytes2 = arrayify(data);
35168
+ const bytes3 = arrayify(data);
35180
35169
  const coder = AbiCoder.getCoder(this.jsonAbi, this.jsonFn.output, {
35181
35170
  encoding: this.encoding
35182
35171
  });
35183
- return coder.decode(bytes2, 0);
35172
+ return coder.decode(bytes3, 0);
35184
35173
  }
35185
35174
  /**
35186
35175
  * Checks if the function is read-only i.e. it only reads from storage, does not write to it.
@@ -35314,9 +35303,9 @@ If you are attempting to transform a hex value, please make sure it is being pas
35314
35303
  }
35315
35304
  return addressLike;
35316
35305
  };
35317
- var getRandomB256 = () => hexlify(randomBytes22(32));
35306
+ var getRandomB256 = () => hexlify(randomBytes2(32));
35318
35307
  var clearFirst12BytesFromB256 = (b256) => {
35319
- let bytes2;
35308
+ let bytes3;
35320
35309
  try {
35321
35310
  if (!isB256(b256)) {
35322
35311
  throw new FuelError(
@@ -35324,15 +35313,15 @@ If you are attempting to transform a hex value, please make sure it is being pas
35324
35313
  `Invalid Bech32 Address: ${b256}.`
35325
35314
  );
35326
35315
  }
35327
- bytes2 = getBytesFromBech32(toBech32(b256));
35328
- bytes2 = hexlify(bytes2.fill(0, 0, 12));
35316
+ bytes3 = getBytesFromBech32(toBech32(b256));
35317
+ bytes3 = hexlify(bytes3.fill(0, 0, 12));
35329
35318
  } catch (error) {
35330
35319
  throw new FuelError(
35331
35320
  FuelError.CODES.PARSE_FAILED,
35332
35321
  `Cannot generate EVM Address B256 from: ${b256}.`
35333
35322
  );
35334
35323
  }
35335
- return bytes2;
35324
+ return bytes3;
35336
35325
  };
35337
35326
  var padFirst12BytesOfEvmAddress = (address) => {
35338
35327
  if (!isEvmAddress(address)) {
@@ -36012,9 +36001,9 @@ If you are attempting to transform a hex value, please make sure it is being pas
36012
36001
  return sha2562(concat(parts));
36013
36002
  }
36014
36003
  static encodeData(messageData) {
36015
- const bytes2 = arrayify(messageData || "0x");
36016
- const dataLength = bytes2.length;
36017
- return new ByteArrayCoder(dataLength).encode(bytes2);
36004
+ const bytes3 = arrayify(messageData || "0x");
36005
+ const dataLength = bytes3.length;
36006
+ return new ByteArrayCoder(dataLength).encode(bytes3);
36018
36007
  }
36019
36008
  encode(value) {
36020
36009
  const parts = [];
@@ -36036,9 +36025,9 @@ If you are attempting to transform a hex value, please make sure it is being pas
36036
36025
  return concat(parts);
36037
36026
  }
36038
36027
  static decodeData(messageData) {
36039
- const bytes2 = arrayify(messageData);
36040
- const dataLength = bytes2.length;
36041
- const [data] = new ByteArrayCoder(dataLength).decode(bytes2, 0);
36028
+ const bytes3 = arrayify(messageData);
36029
+ const dataLength = bytes3.length;
36030
+ const [data] = new ByteArrayCoder(dataLength).decode(bytes3, 0);
36042
36031
  return arrayify(data);
36043
36032
  }
36044
36033
  decode(data, offset) {
@@ -37118,9 +37107,10 @@ If you are attempting to transform a hex value, please make sure it is being pas
37118
37107
  }
37119
37108
  };
37120
37109
 
37121
- // ../../node_modules/.pnpm/@noble+curves@1.3.0/node_modules/@noble/curves/esm/abstract/utils.js
37110
+ // ../../node_modules/.pnpm/@noble+curves@1.4.0/node_modules/@noble/curves/esm/abstract/utils.js
37122
37111
  var utils_exports = {};
37123
37112
  __export(utils_exports, {
37113
+ abytes: () => abytes,
37124
37114
  bitGet: () => bitGet,
37125
37115
  bitLen: () => bitLen,
37126
37116
  bitMask: () => bitMask,
@@ -37128,7 +37118,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
37128
37118
  bytesToHex: () => bytesToHex,
37129
37119
  bytesToNumberBE: () => bytesToNumberBE,
37130
37120
  bytesToNumberLE: () => bytesToNumberLE,
37131
- concatBytes: () => concatBytes3,
37121
+ concatBytes: () => concatBytes2,
37132
37122
  createHmacDrbg: () => createHmacDrbg,
37133
37123
  ensureBytes: () => ensureBytes,
37134
37124
  equalBytes: () => equalBytes,
@@ -37148,13 +37138,16 @@ If you are attempting to transform a hex value, please make sure it is being pas
37148
37138
  function isBytes3(a) {
37149
37139
  return a instanceof Uint8Array || a != null && typeof a === "object" && a.constructor.name === "Uint8Array";
37150
37140
  }
37151
- var hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0"));
37152
- function bytesToHex(bytes2) {
37153
- if (!isBytes3(bytes2))
37141
+ function abytes(item) {
37142
+ if (!isBytes3(item))
37154
37143
  throw new Error("Uint8Array expected");
37144
+ }
37145
+ var hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0"));
37146
+ function bytesToHex(bytes3) {
37147
+ abytes(bytes3);
37155
37148
  let hex = "";
37156
- for (let i = 0; i < bytes2.length; i++) {
37157
- hex += hexes[bytes2[i]];
37149
+ for (let i = 0; i < bytes3.length; i++) {
37150
+ hex += hexes[bytes3[i]];
37158
37151
  }
37159
37152
  return hex;
37160
37153
  }
@@ -37196,13 +37189,12 @@ If you are attempting to transform a hex value, please make sure it is being pas
37196
37189
  }
37197
37190
  return array;
37198
37191
  }
37199
- function bytesToNumberBE(bytes2) {
37200
- return hexToNumber(bytesToHex(bytes2));
37192
+ function bytesToNumberBE(bytes3) {
37193
+ return hexToNumber(bytesToHex(bytes3));
37201
37194
  }
37202
- function bytesToNumberLE(bytes2) {
37203
- if (!isBytes3(bytes2))
37204
- throw new Error("Uint8Array expected");
37205
- return hexToNumber(bytesToHex(Uint8Array.from(bytes2).reverse()));
37195
+ function bytesToNumberLE(bytes3) {
37196
+ abytes(bytes3);
37197
+ return hexToNumber(bytesToHex(Uint8Array.from(bytes3).reverse()));
37206
37198
  }
37207
37199
  function numberToBytesBE(n, len) {
37208
37200
  return hexToBytes(n.toString(16).padStart(len * 2, "0"));
@@ -37231,17 +37223,15 @@ If you are attempting to transform a hex value, please make sure it is being pas
37231
37223
  throw new Error(`${title} expected ${expectedLength} bytes, got ${len}`);
37232
37224
  return res;
37233
37225
  }
37234
- function concatBytes3(...arrays) {
37226
+ function concatBytes2(...arrays) {
37235
37227
  let sum = 0;
37236
37228
  for (let i = 0; i < arrays.length; i++) {
37237
37229
  const a = arrays[i];
37238
- if (!isBytes3(a))
37239
- throw new Error("Uint8Array expected");
37230
+ abytes(a);
37240
37231
  sum += a.length;
37241
37232
  }
37242
- let res = new Uint8Array(sum);
37243
- let pad3 = 0;
37244
- for (let i = 0; i < arrays.length; i++) {
37233
+ const res = new Uint8Array(sum);
37234
+ for (let i = 0, pad3 = 0; i < arrays.length; i++) {
37245
37235
  const a = arrays[i];
37246
37236
  res.set(a, pad3);
37247
37237
  pad3 += a.length;
@@ -37270,9 +37260,9 @@ If you are attempting to transform a hex value, please make sure it is being pas
37270
37260
  function bitGet(n, pos) {
37271
37261
  return n >> BigInt(pos) & _1n2;
37272
37262
  }
37273
- var bitSet = (n, pos, value) => {
37263
+ function bitSet(n, pos, value) {
37274
37264
  return n | (value ? _1n2 : _0n2) << BigInt(pos);
37275
- };
37265
+ }
37276
37266
  var bitMask = (n) => (_2n2 << BigInt(n - 1)) - _1n2;
37277
37267
  var u8n = (data) => new Uint8Array(data);
37278
37268
  var u8fr = (arr) => Uint8Array.from(arr);
@@ -37311,7 +37301,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
37311
37301
  out.push(sl);
37312
37302
  len += v.length;
37313
37303
  }
37314
- return concatBytes3(...out);
37304
+ return concatBytes2(...out);
37315
37305
  };
37316
37306
  const genUntil = (seed, pred) => {
37317
37307
  reset();
@@ -37575,19 +37565,19 @@ If you are attempting to transform a hex value, please make sure it is being pas
37575
37565
  return "GraphQLError";
37576
37566
  }
37577
37567
  toString() {
37578
- let output2 = this.message;
37568
+ let output3 = this.message;
37579
37569
  if (this.nodes) {
37580
37570
  for (const node of this.nodes) {
37581
37571
  if (node.loc) {
37582
- output2 += "\n\n" + printLocation(node.loc);
37572
+ output3 += "\n\n" + printLocation(node.loc);
37583
37573
  }
37584
37574
  }
37585
37575
  } else if (this.source && this.locations) {
37586
37576
  for (const location of this.locations) {
37587
- output2 += "\n\n" + printSourceLocation(this.source, location);
37577
+ output3 += "\n\n" + printSourceLocation(this.source, location);
37588
37578
  }
37589
37579
  }
37590
- return output2;
37580
+ return output3;
37591
37581
  }
37592
37582
  toJSON() {
37593
37583
  const formattedError = {
@@ -40946,6 +40936,12 @@ ${ReceiptFragmentDoc}`;
40946
40936
  alocDependentCost {
40947
40937
  ...DependentCostFragment
40948
40938
  }
40939
+ cfe {
40940
+ ...DependentCostFragment
40941
+ }
40942
+ cfeiDependentCost {
40943
+ ...DependentCostFragment
40944
+ }
40949
40945
  call {
40950
40946
  ...DependentCostFragment
40951
40947
  }
@@ -42114,7 +42110,7 @@ ${MessageCoinFragmentDoc}`;
42114
42110
  }
42115
42111
 
42116
42112
  // src/providers/utils/extract-tx-error.ts
42117
- var assemblePanicError = (statusReason) => {
42113
+ var assemblePanicError = (statusReason, metadata) => {
42118
42114
  let errorMessage = `The transaction reverted with reason: "${statusReason}".`;
42119
42115
  if (PANIC_REASONS.includes(statusReason)) {
42120
42116
  errorMessage = `${errorMessage}
@@ -42123,10 +42119,13 @@ You can read more about this error at:
42123
42119
 
42124
42120
  ${PANIC_DOC_URL}#variant.${statusReason}`;
42125
42121
  }
42126
- return { errorMessage, reason: statusReason };
42122
+ return new FuelError(ErrorCode.SCRIPT_REVERTED, errorMessage, {
42123
+ ...metadata,
42124
+ reason: statusReason
42125
+ });
42127
42126
  };
42128
42127
  var stringify = (obj) => JSON.stringify(obj, null, 2);
42129
- var assembleRevertError = (receipts, logs) => {
42128
+ var assembleRevertError = (receipts, logs, metadata) => {
42130
42129
  let errorMessage = "The transaction reverted with an unknown reason.";
42131
42130
  const revertReceipt = receipts.find(({ type: type3 }) => type3 === ReceiptType.Revert);
42132
42131
  let reason = "";
@@ -42159,25 +42158,36 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
42159
42158
  errorMessage = `The transaction reverted because it's missing an "OutputChange".`;
42160
42159
  break;
42161
42160
  default:
42162
- reason = "unknown";
42163
- errorMessage = `The transaction reverted with an unknown reason: ${revertReceipt.val}`;
42161
+ throw new FuelError(
42162
+ ErrorCode.UNKNOWN,
42163
+ `The transaction reverted with an unknown reason: ${revertReceipt.val}`,
42164
+ {
42165
+ ...metadata,
42166
+ reason: "unknown"
42167
+ }
42168
+ );
42164
42169
  }
42165
42170
  }
42166
- return { errorMessage, reason };
42171
+ return new FuelError(ErrorCode.SCRIPT_REVERTED, errorMessage, {
42172
+ ...metadata,
42173
+ reason
42174
+ });
42167
42175
  };
42168
42176
  var extractTxError = (params) => {
42169
42177
  const { receipts, statusReason, logs } = params;
42170
42178
  const isPanic = receipts.some(({ type: type3 }) => type3 === ReceiptType.Panic);
42171
42179
  const isRevert = receipts.some(({ type: type3 }) => type3 === ReceiptType.Revert);
42172
- const { errorMessage, reason } = isPanic ? assemblePanicError(statusReason) : assembleRevertError(receipts, logs);
42173
42180
  const metadata = {
42174
42181
  logs,
42175
42182
  receipts,
42176
42183
  panic: isPanic,
42177
42184
  revert: isRevert,
42178
- reason
42185
+ reason: ""
42179
42186
  };
42180
- return new FuelError(ErrorCode.SCRIPT_REVERTED, errorMessage, metadata);
42187
+ if (isPanic) {
42188
+ return assemblePanicError(statusReason, metadata);
42189
+ }
42190
+ return assembleRevertError(receipts, logs, metadata);
42181
42191
  };
42182
42192
 
42183
42193
  // src/providers/transaction-request/errors.ts
@@ -42333,8 +42343,8 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
42333
42343
  *
42334
42344
  * Pushes an output to the list without any side effects and returns the index
42335
42345
  */
42336
- pushOutput(output2) {
42337
- this.outputs.push(output2);
42346
+ pushOutput(output3) {
42347
+ this.outputs.push(output3);
42338
42348
  return this.outputs.length - 1;
42339
42349
  }
42340
42350
  /**
@@ -42418,7 +42428,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
42418
42428
  */
42419
42429
  getCoinOutputs() {
42420
42430
  return this.outputs.filter(
42421
- (output2) => output2.type === OutputType.Coin
42431
+ (output3) => output3.type === OutputType.Coin
42422
42432
  );
42423
42433
  }
42424
42434
  /**
@@ -42428,7 +42438,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
42428
42438
  */
42429
42439
  getChangeOutputs() {
42430
42440
  return this.outputs.filter(
42431
- (output2) => output2.type === OutputType.Change
42441
+ (output3) => output3.type === OutputType.Change
42432
42442
  );
42433
42443
  }
42434
42444
  /**
@@ -42578,7 +42588,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
42578
42588
  */
42579
42589
  addChangeOutput(to, assetId) {
42580
42590
  const changeOutput = this.getChangeOutputs().find(
42581
- (output2) => hexlify(output2.assetId) === assetId
42591
+ (output3) => hexlify(output3.assetId) === assetId
42582
42592
  );
42583
42593
  if (!changeOutput) {
42584
42594
  this.pushOutput({
@@ -42656,12 +42666,12 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
42656
42666
  usedQuantity = bn("1000000000000000000");
42657
42667
  }
42658
42668
  if (assetInput && "assetId" in assetInput) {
42659
- assetInput.id = hexlify(randomBytes22(UTXO_ID_LEN));
42669
+ assetInput.id = hexlify(randomBytes2(UTXO_ID_LEN));
42660
42670
  assetInput.amount = usedQuantity;
42661
42671
  } else {
42662
42672
  this.addResources([
42663
42673
  {
42664
- id: hexlify(randomBytes22(UTXO_ID_LEN)),
42674
+ id: hexlify(randomBytes2(UTXO_ID_LEN)),
42665
42675
  amount: usedQuantity,
42666
42676
  assetId,
42667
42677
  owner: resourcesOwner || Address.fromRandom(),
@@ -42757,8 +42767,8 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
42757
42767
  return inputClone;
42758
42768
  }
42759
42769
  });
42760
- transaction.outputs = transaction.outputs.map((output2) => {
42761
- const outputClone = clone_default(output2);
42770
+ transaction.outputs = transaction.outputs.map((output3) => {
42771
+ const outputClone = clone_default(output3);
42762
42772
  switch (outputClone.type) {
42763
42773
  case OutputType.Contract: {
42764
42774
  outputClone.balanceRoot = ZeroBytes32;
@@ -42860,7 +42870,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
42860
42870
  */
42861
42871
  getContractCreatedOutputs() {
42862
42872
  return this.outputs.filter(
42863
- (output2) => output2.type === OutputType.ContractCreated
42873
+ (output3) => output3.type === OutputType.ContractCreated
42864
42874
  );
42865
42875
  }
42866
42876
  /**
@@ -42986,7 +42996,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
42986
42996
  */
42987
42997
  getContractOutputs() {
42988
42998
  return this.outputs.filter(
42989
- (output2) => output2.type === OutputType.Contract
42999
+ (output3) => output3.type === OutputType.Contract
42990
43000
  );
42991
43001
  }
42992
43002
  /**
@@ -42996,7 +43006,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
42996
43006
  */
42997
43007
  getVariableOutputs() {
42998
43008
  return this.outputs.filter(
42999
- (output2) => output2.type === OutputType.Variable
43009
+ (output3) => output3.type === OutputType.Variable
43000
43010
  );
43001
43011
  }
43002
43012
  /**
@@ -43419,8 +43429,8 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
43419
43429
  }) {
43420
43430
  const contractCallReceipts = getReceiptsCall(receipts);
43421
43431
  const contractOutputs = getOutputsContract(outputs);
43422
- const contractCallOperations = contractOutputs.reduce((prevOutputCallOps, output2) => {
43423
- const contractInput = getInputContractFromIndex(inputs, output2.inputIndex);
43432
+ const contractCallOperations = contractOutputs.reduce((prevOutputCallOps, output3) => {
43433
+ const contractInput = getInputContractFromIndex(inputs, output3.inputIndex);
43424
43434
  if (contractInput) {
43425
43435
  const newCallOps = contractCallReceipts.reduce((prevContractCallOps, receipt) => {
43426
43436
  if (receipt.to === contractInput.contractID) {
@@ -43474,7 +43484,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
43474
43484
  let { from: fromAddress } = receipt;
43475
43485
  const toType = contractInputs.some((input) => input.contractID === toAddress) ? 0 /* contract */ : 1 /* account */;
43476
43486
  if (ZeroBytes32 === fromAddress) {
43477
- const change = changeOutputs.find((output2) => output2.assetId === assetId);
43487
+ const change = changeOutputs.find((output3) => output3.assetId === assetId);
43478
43488
  fromAddress = change?.to || fromAddress;
43479
43489
  }
43480
43490
  const fromType = contractInputs.some((input) => input.contractID === fromAddress) ? 0 /* contract */ : 1 /* account */;
@@ -43505,8 +43515,8 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
43505
43515
  const coinOutputs = getOutputsCoin(outputs);
43506
43516
  const contractInputs = getInputsContract(inputs);
43507
43517
  const changeOutputs = getOutputsChange(outputs);
43508
- coinOutputs.forEach((output2) => {
43509
- const { amount, assetId, to } = output2;
43518
+ coinOutputs.forEach((output3) => {
43519
+ const { amount, assetId, to } = output3;
43510
43520
  const changeOutput = changeOutputs.find((change) => change.assetId === assetId);
43511
43521
  if (changeOutput) {
43512
43522
  operations = addOperation(operations, {
@@ -43544,7 +43554,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
43544
43554
  }
43545
43555
  function getPayProducerOperations(outputs) {
43546
43556
  const coinOutputs = getOutputsCoin(outputs);
43547
- const payProducerOperations = coinOutputs.reduce((prev, output2) => {
43557
+ const payProducerOperations = coinOutputs.reduce((prev, output3) => {
43548
43558
  const operations = addOperation(prev, {
43549
43559
  name: "Pay network fee to block producer" /* payBlockProducer */,
43550
43560
  from: {
@@ -43553,12 +43563,12 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
43553
43563
  },
43554
43564
  to: {
43555
43565
  type: 1 /* account */,
43556
- address: output2.to.toString()
43566
+ address: output3.to.toString()
43557
43567
  },
43558
43568
  assetsSent: [
43559
43569
  {
43560
- assetId: output2.assetId.toString(),
43561
- amount: output2.amount
43570
+ assetId: output3.assetId.toString(),
43571
+ amount: output3.amount
43562
43572
  }
43563
43573
  ]
43564
43574
  });
@@ -45866,7 +45876,7 @@ Supported fuel-core version: ${supportedVersion}.`
45866
45876
  */
45867
45877
  generateFakeResources(coins) {
45868
45878
  return coins.map((coin) => ({
45869
- id: hexlify(randomBytes22(UTXO_ID_LEN)),
45879
+ id: hexlify(randomBytes2(UTXO_ID_LEN)),
45870
45880
  owner: this.address,
45871
45881
  blockCreated: bn(1),
45872
45882
  txCreatedIdx: bn(1),
@@ -45925,7 +45935,349 @@ Supported fuel-core version: ${supportedVersion}.`
45925
45935
  }
45926
45936
  };
45927
45937
 
45928
- // ../../node_modules/.pnpm/@noble+curves@1.3.0/node_modules/@noble/curves/esm/abstract/modular.js
45938
+ // ../../node_modules/.pnpm/@noble+hashes@1.4.0/node_modules/@noble/hashes/esm/_assert.js
45939
+ function number2(n) {
45940
+ if (!Number.isSafeInteger(n) || n < 0)
45941
+ throw new Error(`positive integer expected, not ${n}`);
45942
+ }
45943
+ function isBytes4(a) {
45944
+ return a instanceof Uint8Array || a != null && typeof a === "object" && a.constructor.name === "Uint8Array";
45945
+ }
45946
+ function bytes2(b, ...lengths) {
45947
+ if (!isBytes4(b))
45948
+ throw new Error("Uint8Array expected");
45949
+ if (lengths.length > 0 && !lengths.includes(b.length))
45950
+ throw new Error(`Uint8Array expected of length ${lengths}, not of length=${b.length}`);
45951
+ }
45952
+ function hash3(h) {
45953
+ if (typeof h !== "function" || typeof h.create !== "function")
45954
+ throw new Error("Hash should be wrapped by utils.wrapConstructor");
45955
+ number2(h.outputLen);
45956
+ number2(h.blockLen);
45957
+ }
45958
+ function exists2(instance, checkFinished = true) {
45959
+ if (instance.destroyed)
45960
+ throw new Error("Hash instance has been destroyed");
45961
+ if (checkFinished && instance.finished)
45962
+ throw new Error("Hash#digest() has already been called");
45963
+ }
45964
+ function output2(out, instance) {
45965
+ bytes2(out);
45966
+ const min = instance.outputLen;
45967
+ if (out.length < min) {
45968
+ throw new Error(`digestInto() expects output buffer of length at least ${min}`);
45969
+ }
45970
+ }
45971
+
45972
+ // ../../node_modules/.pnpm/@noble+hashes@1.4.0/node_modules/@noble/hashes/esm/cryptoNode.js
45973
+ var nc = __toESM(__require("crypto"), 1);
45974
+ var crypto4 = nc && typeof nc === "object" && "webcrypto" in nc ? nc.webcrypto : void 0;
45975
+
45976
+ // ../../node_modules/.pnpm/@noble+hashes@1.4.0/node_modules/@noble/hashes/esm/utils.js
45977
+ var createView2 = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
45978
+ var rotr2 = (word, shift) => word << 32 - shift | word >>> shift;
45979
+ var isLE2 = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
45980
+ function utf8ToBytes3(str) {
45981
+ if (typeof str !== "string")
45982
+ throw new Error(`utf8ToBytes expected string, got ${typeof str}`);
45983
+ return new Uint8Array(new TextEncoder().encode(str));
45984
+ }
45985
+ function toBytes3(data) {
45986
+ if (typeof data === "string")
45987
+ data = utf8ToBytes3(data);
45988
+ bytes2(data);
45989
+ return data;
45990
+ }
45991
+ function concatBytes3(...arrays) {
45992
+ let sum = 0;
45993
+ for (let i = 0; i < arrays.length; i++) {
45994
+ const a = arrays[i];
45995
+ bytes2(a);
45996
+ sum += a.length;
45997
+ }
45998
+ const res = new Uint8Array(sum);
45999
+ for (let i = 0, pad3 = 0; i < arrays.length; i++) {
46000
+ const a = arrays[i];
46001
+ res.set(a, pad3);
46002
+ pad3 += a.length;
46003
+ }
46004
+ return res;
46005
+ }
46006
+ var Hash2 = class {
46007
+ // Safe version that clones internal state
46008
+ clone() {
46009
+ return this._cloneInto();
46010
+ }
46011
+ };
46012
+ var toStr2 = {}.toString;
46013
+ function wrapConstructor2(hashCons) {
46014
+ const hashC = (msg) => hashCons().update(toBytes3(msg)).digest();
46015
+ const tmp = hashCons();
46016
+ hashC.outputLen = tmp.outputLen;
46017
+ hashC.blockLen = tmp.blockLen;
46018
+ hashC.create = () => hashCons();
46019
+ return hashC;
46020
+ }
46021
+ function randomBytes3(bytesLength = 32) {
46022
+ if (crypto4 && typeof crypto4.getRandomValues === "function") {
46023
+ return crypto4.getRandomValues(new Uint8Array(bytesLength));
46024
+ }
46025
+ throw new Error("crypto.getRandomValues must be defined");
46026
+ }
46027
+
46028
+ // ../../node_modules/.pnpm/@noble+hashes@1.4.0/node_modules/@noble/hashes/esm/_md.js
46029
+ function setBigUint642(view, byteOffset, value, isLE3) {
46030
+ if (typeof view.setBigUint64 === "function")
46031
+ return view.setBigUint64(byteOffset, value, isLE3);
46032
+ const _32n2 = BigInt(32);
46033
+ const _u32_max = BigInt(4294967295);
46034
+ const wh = Number(value >> _32n2 & _u32_max);
46035
+ const wl = Number(value & _u32_max);
46036
+ const h = isLE3 ? 4 : 0;
46037
+ const l = isLE3 ? 0 : 4;
46038
+ view.setUint32(byteOffset + h, wh, isLE3);
46039
+ view.setUint32(byteOffset + l, wl, isLE3);
46040
+ }
46041
+ var Chi2 = (a, b, c) => a & b ^ ~a & c;
46042
+ var Maj2 = (a, b, c) => a & b ^ a & c ^ b & c;
46043
+ var HashMD = class extends Hash2 {
46044
+ constructor(blockLen, outputLen, padOffset, isLE3) {
46045
+ super();
46046
+ this.blockLen = blockLen;
46047
+ this.outputLen = outputLen;
46048
+ this.padOffset = padOffset;
46049
+ this.isLE = isLE3;
46050
+ this.finished = false;
46051
+ this.length = 0;
46052
+ this.pos = 0;
46053
+ this.destroyed = false;
46054
+ this.buffer = new Uint8Array(blockLen);
46055
+ this.view = createView2(this.buffer);
46056
+ }
46057
+ update(data) {
46058
+ exists2(this);
46059
+ const { view, buffer, blockLen } = this;
46060
+ data = toBytes3(data);
46061
+ const len = data.length;
46062
+ for (let pos = 0; pos < len; ) {
46063
+ const take = Math.min(blockLen - this.pos, len - pos);
46064
+ if (take === blockLen) {
46065
+ const dataView = createView2(data);
46066
+ for (; blockLen <= len - pos; pos += blockLen)
46067
+ this.process(dataView, pos);
46068
+ continue;
46069
+ }
46070
+ buffer.set(data.subarray(pos, pos + take), this.pos);
46071
+ this.pos += take;
46072
+ pos += take;
46073
+ if (this.pos === blockLen) {
46074
+ this.process(view, 0);
46075
+ this.pos = 0;
46076
+ }
46077
+ }
46078
+ this.length += data.length;
46079
+ this.roundClean();
46080
+ return this;
46081
+ }
46082
+ digestInto(out) {
46083
+ exists2(this);
46084
+ output2(out, this);
46085
+ this.finished = true;
46086
+ const { buffer, view, blockLen, isLE: isLE3 } = this;
46087
+ let { pos } = this;
46088
+ buffer[pos++] = 128;
46089
+ this.buffer.subarray(pos).fill(0);
46090
+ if (this.padOffset > blockLen - pos) {
46091
+ this.process(view, 0);
46092
+ pos = 0;
46093
+ }
46094
+ for (let i = pos; i < blockLen; i++)
46095
+ buffer[i] = 0;
46096
+ setBigUint642(view, blockLen - 8, BigInt(this.length * 8), isLE3);
46097
+ this.process(view, 0);
46098
+ const oview = createView2(out);
46099
+ const len = this.outputLen;
46100
+ if (len % 4)
46101
+ throw new Error("_sha2: outputLen should be aligned to 32bit");
46102
+ const outLen = len / 4;
46103
+ const state = this.get();
46104
+ if (outLen > state.length)
46105
+ throw new Error("_sha2: outputLen bigger than state");
46106
+ for (let i = 0; i < outLen; i++)
46107
+ oview.setUint32(4 * i, state[i], isLE3);
46108
+ }
46109
+ digest() {
46110
+ const { buffer, outputLen } = this;
46111
+ this.digestInto(buffer);
46112
+ const res = buffer.slice(0, outputLen);
46113
+ this.destroy();
46114
+ return res;
46115
+ }
46116
+ _cloneInto(to) {
46117
+ to || (to = new this.constructor());
46118
+ to.set(...this.get());
46119
+ const { blockLen, buffer, length, finished, destroyed, pos } = this;
46120
+ to.length = length;
46121
+ to.pos = pos;
46122
+ to.finished = finished;
46123
+ to.destroyed = destroyed;
46124
+ if (length % blockLen)
46125
+ to.buffer.set(buffer);
46126
+ return to;
46127
+ }
46128
+ };
46129
+
46130
+ // ../../node_modules/.pnpm/@noble+hashes@1.4.0/node_modules/@noble/hashes/esm/sha256.js
46131
+ var SHA256_K2 = /* @__PURE__ */ new Uint32Array([
46132
+ 1116352408,
46133
+ 1899447441,
46134
+ 3049323471,
46135
+ 3921009573,
46136
+ 961987163,
46137
+ 1508970993,
46138
+ 2453635748,
46139
+ 2870763221,
46140
+ 3624381080,
46141
+ 310598401,
46142
+ 607225278,
46143
+ 1426881987,
46144
+ 1925078388,
46145
+ 2162078206,
46146
+ 2614888103,
46147
+ 3248222580,
46148
+ 3835390401,
46149
+ 4022224774,
46150
+ 264347078,
46151
+ 604807628,
46152
+ 770255983,
46153
+ 1249150122,
46154
+ 1555081692,
46155
+ 1996064986,
46156
+ 2554220882,
46157
+ 2821834349,
46158
+ 2952996808,
46159
+ 3210313671,
46160
+ 3336571891,
46161
+ 3584528711,
46162
+ 113926993,
46163
+ 338241895,
46164
+ 666307205,
46165
+ 773529912,
46166
+ 1294757372,
46167
+ 1396182291,
46168
+ 1695183700,
46169
+ 1986661051,
46170
+ 2177026350,
46171
+ 2456956037,
46172
+ 2730485921,
46173
+ 2820302411,
46174
+ 3259730800,
46175
+ 3345764771,
46176
+ 3516065817,
46177
+ 3600352804,
46178
+ 4094571909,
46179
+ 275423344,
46180
+ 430227734,
46181
+ 506948616,
46182
+ 659060556,
46183
+ 883997877,
46184
+ 958139571,
46185
+ 1322822218,
46186
+ 1537002063,
46187
+ 1747873779,
46188
+ 1955562222,
46189
+ 2024104815,
46190
+ 2227730452,
46191
+ 2361852424,
46192
+ 2428436474,
46193
+ 2756734187,
46194
+ 3204031479,
46195
+ 3329325298
46196
+ ]);
46197
+ var SHA256_IV = /* @__PURE__ */ new Uint32Array([
46198
+ 1779033703,
46199
+ 3144134277,
46200
+ 1013904242,
46201
+ 2773480762,
46202
+ 1359893119,
46203
+ 2600822924,
46204
+ 528734635,
46205
+ 1541459225
46206
+ ]);
46207
+ var SHA256_W2 = /* @__PURE__ */ new Uint32Array(64);
46208
+ var SHA2562 = class extends HashMD {
46209
+ constructor() {
46210
+ super(64, 32, 8, false);
46211
+ this.A = SHA256_IV[0] | 0;
46212
+ this.B = SHA256_IV[1] | 0;
46213
+ this.C = SHA256_IV[2] | 0;
46214
+ this.D = SHA256_IV[3] | 0;
46215
+ this.E = SHA256_IV[4] | 0;
46216
+ this.F = SHA256_IV[5] | 0;
46217
+ this.G = SHA256_IV[6] | 0;
46218
+ this.H = SHA256_IV[7] | 0;
46219
+ }
46220
+ get() {
46221
+ const { A, B, C, D, E, F, G, H } = this;
46222
+ return [A, B, C, D, E, F, G, H];
46223
+ }
46224
+ // prettier-ignore
46225
+ set(A, B, C, D, E, F, G, H) {
46226
+ this.A = A | 0;
46227
+ this.B = B | 0;
46228
+ this.C = C | 0;
46229
+ this.D = D | 0;
46230
+ this.E = E | 0;
46231
+ this.F = F | 0;
46232
+ this.G = G | 0;
46233
+ this.H = H | 0;
46234
+ }
46235
+ process(view, offset) {
46236
+ for (let i = 0; i < 16; i++, offset += 4)
46237
+ SHA256_W2[i] = view.getUint32(offset, false);
46238
+ for (let i = 16; i < 64; i++) {
46239
+ const W15 = SHA256_W2[i - 15];
46240
+ const W2 = SHA256_W2[i - 2];
46241
+ const s0 = rotr2(W15, 7) ^ rotr2(W15, 18) ^ W15 >>> 3;
46242
+ const s1 = rotr2(W2, 17) ^ rotr2(W2, 19) ^ W2 >>> 10;
46243
+ SHA256_W2[i] = s1 + SHA256_W2[i - 7] + s0 + SHA256_W2[i - 16] | 0;
46244
+ }
46245
+ let { A, B, C, D, E, F, G, H } = this;
46246
+ for (let i = 0; i < 64; i++) {
46247
+ const sigma1 = rotr2(E, 6) ^ rotr2(E, 11) ^ rotr2(E, 25);
46248
+ const T1 = H + sigma1 + Chi2(E, F, G) + SHA256_K2[i] + SHA256_W2[i] | 0;
46249
+ const sigma0 = rotr2(A, 2) ^ rotr2(A, 13) ^ rotr2(A, 22);
46250
+ const T2 = sigma0 + Maj2(A, B, C) | 0;
46251
+ H = G;
46252
+ G = F;
46253
+ F = E;
46254
+ E = D + T1 | 0;
46255
+ D = C;
46256
+ C = B;
46257
+ B = A;
46258
+ A = T1 + T2 | 0;
46259
+ }
46260
+ A = A + this.A | 0;
46261
+ B = B + this.B | 0;
46262
+ C = C + this.C | 0;
46263
+ D = D + this.D | 0;
46264
+ E = E + this.E | 0;
46265
+ F = F + this.F | 0;
46266
+ G = G + this.G | 0;
46267
+ H = H + this.H | 0;
46268
+ this.set(A, B, C, D, E, F, G, H);
46269
+ }
46270
+ roundClean() {
46271
+ SHA256_W2.fill(0);
46272
+ }
46273
+ destroy() {
46274
+ this.set(0, 0, 0, 0, 0, 0, 0, 0);
46275
+ this.buffer.fill(0);
46276
+ }
46277
+ };
46278
+ var sha2563 = /* @__PURE__ */ wrapConstructor2(() => new SHA2562());
46279
+
46280
+ // ../../node_modules/.pnpm/@noble+curves@1.4.0/node_modules/@noble/curves/esm/abstract/modular.js
45929
46281
  var _0n3 = BigInt(0);
45930
46282
  var _1n3 = BigInt(1);
45931
46283
  var _2n3 = BigInt(2);
@@ -45961,11 +46313,11 @@ Supported fuel-core version: ${supportedVersion}.`
45961
46313
  }
45962
46314
  return res;
45963
46315
  }
45964
- function invert(number2, modulo) {
45965
- if (number2 === _0n3 || modulo <= _0n3) {
45966
- throw new Error(`invert: expected positive integers, got n=${number2} mod=${modulo}`);
46316
+ function invert(number3, modulo) {
46317
+ if (number3 === _0n3 || modulo <= _0n3) {
46318
+ throw new Error(`invert: expected positive integers, got n=${number3} mod=${modulo}`);
45967
46319
  }
45968
- let a = mod(number2, modulo);
46320
+ let a = mod(number3, modulo);
45969
46321
  let b = modulo;
45970
46322
  let x = _0n3, y = _1n3, u = _1n3, v = _0n3;
45971
46323
  while (a !== _0n3) {
@@ -46120,7 +46472,7 @@ Supported fuel-core version: ${supportedVersion}.`
46120
46472
  const nByteLength = Math.ceil(_nBitLength / 8);
46121
46473
  return { nBitLength: _nBitLength, nByteLength };
46122
46474
  }
46123
- function Field(ORDER, bitLen2, isLE2 = false, redef = {}) {
46475
+ function Field(ORDER, bitLen2, isLE3 = false, redef = {}) {
46124
46476
  if (ORDER <= _0n3)
46125
46477
  throw new Error(`Expected Field ORDER > 0, got ${ORDER}`);
46126
46478
  const { nBitLength: BITS, nByteLength: BYTES } = nLength(ORDER, bitLen2);
@@ -46161,11 +46513,11 @@ Supported fuel-core version: ${supportedVersion}.`
46161
46513
  // TODO: do we really need constant cmov?
46162
46514
  // We don't have const-time bigints anyway, so probably will be not very useful
46163
46515
  cmov: (a, b, c) => c ? b : a,
46164
- toBytes: (num) => isLE2 ? numberToBytesLE(num, BYTES) : numberToBytesBE(num, BYTES),
46165
- fromBytes: (bytes2) => {
46166
- if (bytes2.length !== BYTES)
46167
- throw new Error(`Fp.fromBytes: expected ${BYTES}, got ${bytes2.length}`);
46168
- return isLE2 ? bytesToNumberLE(bytes2) : bytesToNumberBE(bytes2);
46516
+ toBytes: (num) => isLE3 ? numberToBytesLE(num, BYTES) : numberToBytesBE(num, BYTES),
46517
+ fromBytes: (bytes3) => {
46518
+ if (bytes3.length !== BYTES)
46519
+ throw new Error(`Fp.fromBytes: expected ${BYTES}, got ${bytes3.length}`);
46520
+ return isLE3 ? bytesToNumberLE(bytes3) : bytesToNumberBE(bytes3);
46169
46521
  }
46170
46522
  });
46171
46523
  return Object.freeze(f2);
@@ -46180,18 +46532,18 @@ Supported fuel-core version: ${supportedVersion}.`
46180
46532
  const length = getFieldBytesLength(fieldOrder);
46181
46533
  return length + Math.ceil(length / 2);
46182
46534
  }
46183
- function mapHashToField(key, fieldOrder, isLE2 = false) {
46535
+ function mapHashToField(key, fieldOrder, isLE3 = false) {
46184
46536
  const len = key.length;
46185
46537
  const fieldLen = getFieldBytesLength(fieldOrder);
46186
46538
  const minLen = getMinHashLength(fieldOrder);
46187
46539
  if (len < 16 || len < minLen || len > 1024)
46188
46540
  throw new Error(`expected ${minLen}-1024 bytes of input, got ${len}`);
46189
- const num = isLE2 ? bytesToNumberBE(key) : bytesToNumberLE(key);
46541
+ const num = isLE3 ? bytesToNumberBE(key) : bytesToNumberLE(key);
46190
46542
  const reduced = mod(num, fieldOrder - _1n3) + _1n3;
46191
- return isLE2 ? numberToBytesLE(reduced, fieldLen) : numberToBytesBE(reduced, fieldLen);
46543
+ return isLE3 ? numberToBytesLE(reduced, fieldLen) : numberToBytesBE(reduced, fieldLen);
46192
46544
  }
46193
46545
 
46194
- // ../../node_modules/.pnpm/@noble+curves@1.3.0/node_modules/@noble/curves/esm/abstract/curve.js
46546
+ // ../../node_modules/.pnpm/@noble+curves@1.4.0/node_modules/@noble/curves/esm/abstract/curve.js
46195
46547
  var _0n4 = BigInt(0);
46196
46548
  var _1n4 = BigInt(1);
46197
46549
  function wNAF(c, bits) {
@@ -46309,7 +46661,7 @@ Supported fuel-core version: ${supportedVersion}.`
46309
46661
  });
46310
46662
  }
46311
46663
 
46312
- // ../../node_modules/.pnpm/@noble+curves@1.3.0/node_modules/@noble/curves/esm/abstract/weierstrass.js
46664
+ // ../../node_modules/.pnpm/@noble+curves@1.4.0/node_modules/@noble/curves/esm/abstract/weierstrass.js
46313
46665
  function validatePointOpts(curve) {
46314
46666
  const opts = validateBasic(curve);
46315
46667
  validateObject(opts, {
@@ -46360,8 +46712,7 @@ Supported fuel-core version: ${supportedVersion}.`
46360
46712
  toSig(hex) {
46361
46713
  const { Err: E } = DER;
46362
46714
  const data = typeof hex === "string" ? h2b(hex) : hex;
46363
- if (!isBytes3(data))
46364
- throw new Error("ui8a expected");
46715
+ abytes(data);
46365
46716
  let l = data.length;
46366
46717
  if (l < 2 || data[0] != 48)
46367
46718
  throw new E("Invalid signature tag");
@@ -46396,12 +46747,12 @@ Supported fuel-core version: ${supportedVersion}.`
46396
46747
  function weierstrassPoints(opts) {
46397
46748
  const CURVE = validatePointOpts(opts);
46398
46749
  const { Fp: Fp2 } = CURVE;
46399
- const toBytes3 = CURVE.toBytes || ((_c, point, _isCompressed) => {
46750
+ const toBytes4 = CURVE.toBytes || ((_c, point, _isCompressed) => {
46400
46751
  const a = point.toAffine();
46401
- return concatBytes3(Uint8Array.from([4]), Fp2.toBytes(a.x), Fp2.toBytes(a.y));
46752
+ return concatBytes2(Uint8Array.from([4]), Fp2.toBytes(a.x), Fp2.toBytes(a.y));
46402
46753
  });
46403
- const fromBytes = CURVE.fromBytes || ((bytes2) => {
46404
- const tail = bytes2.subarray(1);
46754
+ const fromBytes = CURVE.fromBytes || ((bytes3) => {
46755
+ const tail = bytes3.subarray(1);
46405
46756
  const x = Fp2.fromBytes(tail.subarray(0, Fp2.BYTES));
46406
46757
  const y = Fp2.fromBytes(tail.subarray(Fp2.BYTES, 2 * Fp2.BYTES));
46407
46758
  return { x, y };
@@ -46764,7 +47115,7 @@ Supported fuel-core version: ${supportedVersion}.`
46764
47115
  }
46765
47116
  toRawBytes(isCompressed = true) {
46766
47117
  this.assertValidity();
46767
- return toBytes3(Point2, this, isCompressed);
47118
+ return toBytes4(Point2, this, isCompressed);
46768
47119
  }
46769
47120
  toHex(isCompressed = true) {
46770
47121
  return bytesToHex(this.toRawBytes(isCompressed));
@@ -46814,23 +47165,29 @@ Supported fuel-core version: ${supportedVersion}.`
46814
47165
  toBytes(_c, point, isCompressed) {
46815
47166
  const a = point.toAffine();
46816
47167
  const x = Fp2.toBytes(a.x);
46817
- const cat = concatBytes3;
47168
+ const cat = concatBytes2;
46818
47169
  if (isCompressed) {
46819
47170
  return cat(Uint8Array.from([point.hasEvenY() ? 2 : 3]), x);
46820
47171
  } else {
46821
47172
  return cat(Uint8Array.from([4]), x, Fp2.toBytes(a.y));
46822
47173
  }
46823
47174
  },
46824
- fromBytes(bytes2) {
46825
- const len = bytes2.length;
46826
- const head = bytes2[0];
46827
- const tail = bytes2.subarray(1);
47175
+ fromBytes(bytes3) {
47176
+ const len = bytes3.length;
47177
+ const head = bytes3[0];
47178
+ const tail = bytes3.subarray(1);
46828
47179
  if (len === compressedLen && (head === 2 || head === 3)) {
46829
47180
  const x = bytesToNumberBE(tail);
46830
47181
  if (!isValidFieldElement(x))
46831
47182
  throw new Error("Point is not on curve");
46832
47183
  const y2 = weierstrassEquation(x);
46833
- let y = Fp2.sqrt(y2);
47184
+ let y;
47185
+ try {
47186
+ y = Fp2.sqrt(y2);
47187
+ } catch (sqrtError) {
47188
+ const suffix = sqrtError instanceof Error ? ": " + sqrtError.message : "";
47189
+ throw new Error("Point is not on curve" + suffix);
47190
+ }
46834
47191
  const isYOdd = (y & _1n5) === _1n5;
46835
47192
  const isHeadOdd = (head & 1) === 1;
46836
47193
  if (isHeadOdd !== isYOdd)
@@ -46846,9 +47203,9 @@ Supported fuel-core version: ${supportedVersion}.`
46846
47203
  }
46847
47204
  });
46848
47205
  const numToNByteStr = (num) => bytesToHex(numberToBytesBE(num, CURVE.nByteLength));
46849
- function isBiggerThanHalfOrder(number2) {
47206
+ function isBiggerThanHalfOrder(number3) {
46850
47207
  const HALF = CURVE_ORDER >> _1n5;
46851
- return number2 > HALF;
47208
+ return number3 > HALF;
46852
47209
  }
46853
47210
  function normalizeS(s) {
46854
47211
  return isBiggerThanHalfOrder(s) ? modN(-s) : s;
@@ -46978,13 +47335,13 @@ Supported fuel-core version: ${supportedVersion}.`
46978
47335
  const b = Point2.fromHex(publicB);
46979
47336
  return b.multiply(normPrivateKeyToScalar(privateA)).toRawBytes(isCompressed);
46980
47337
  }
46981
- const bits2int = CURVE.bits2int || function(bytes2) {
46982
- const num = bytesToNumberBE(bytes2);
46983
- const delta = bytes2.length * 8 - CURVE.nBitLength;
47338
+ const bits2int = CURVE.bits2int || function(bytes3) {
47339
+ const num = bytesToNumberBE(bytes3);
47340
+ const delta = bytes3.length * 8 - CURVE.nBitLength;
46984
47341
  return delta > 0 ? num >> BigInt(delta) : num;
46985
47342
  };
46986
- const bits2int_modN = CURVE.bits2int_modN || function(bytes2) {
46987
- return modN(bits2int(bytes2));
47343
+ const bits2int_modN = CURVE.bits2int_modN || function(bytes3) {
47344
+ return modN(bits2int(bytes3));
46988
47345
  };
46989
47346
  const ORDER_MASK = bitMask(CURVE.nBitLength);
46990
47347
  function int2octets(num) {
@@ -46997,21 +47354,21 @@ Supported fuel-core version: ${supportedVersion}.`
46997
47354
  function prepSig(msgHash, privateKey, opts = defaultSigOpts) {
46998
47355
  if (["recovered", "canonical"].some((k) => k in opts))
46999
47356
  throw new Error("sign() legacy options not supported");
47000
- const { hash: hash3, randomBytes: randomBytes3 } = CURVE;
47357
+ const { hash: hash4, randomBytes: randomBytes4 } = CURVE;
47001
47358
  let { lowS, prehash, extraEntropy: ent } = opts;
47002
47359
  if (lowS == null)
47003
47360
  lowS = true;
47004
47361
  msgHash = ensureBytes("msgHash", msgHash);
47005
47362
  if (prehash)
47006
- msgHash = ensureBytes("prehashed msgHash", hash3(msgHash));
47363
+ msgHash = ensureBytes("prehashed msgHash", hash4(msgHash));
47007
47364
  const h1int = bits2int_modN(msgHash);
47008
47365
  const d = normPrivateKeyToScalar(privateKey);
47009
47366
  const seedArgs = [int2octets(d), int2octets(h1int)];
47010
- if (ent != null) {
47011
- const e = ent === true ? randomBytes3(Fp2.BYTES) : ent;
47367
+ if (ent != null && ent !== false) {
47368
+ const e = ent === true ? randomBytes4(Fp2.BYTES) : ent;
47012
47369
  seedArgs.push(ensureBytes("extraEntropy", e));
47013
47370
  }
47014
- const seed = concatBytes3(...seedArgs);
47371
+ const seed = concatBytes2(...seedArgs);
47015
47372
  const m = h1int;
47016
47373
  function k2sig(kBytes) {
47017
47374
  const k = bits2int(kBytes);
@@ -47101,20 +47458,85 @@ Supported fuel-core version: ${supportedVersion}.`
47101
47458
  };
47102
47459
  }
47103
47460
 
47104
- // ../../node_modules/.pnpm/@noble+curves@1.3.0/node_modules/@noble/curves/esm/_shortw_utils.js
47105
- function getHash(hash3) {
47461
+ // ../../node_modules/.pnpm/@noble+hashes@1.4.0/node_modules/@noble/hashes/esm/hmac.js
47462
+ var HMAC2 = class extends Hash2 {
47463
+ constructor(hash4, _key) {
47464
+ super();
47465
+ this.finished = false;
47466
+ this.destroyed = false;
47467
+ hash3(hash4);
47468
+ const key = toBytes3(_key);
47469
+ this.iHash = hash4.create();
47470
+ if (typeof this.iHash.update !== "function")
47471
+ throw new Error("Expected instance of class which extends utils.Hash");
47472
+ this.blockLen = this.iHash.blockLen;
47473
+ this.outputLen = this.iHash.outputLen;
47474
+ const blockLen = this.blockLen;
47475
+ const pad3 = new Uint8Array(blockLen);
47476
+ pad3.set(key.length > blockLen ? hash4.create().update(key).digest() : key);
47477
+ for (let i = 0; i < pad3.length; i++)
47478
+ pad3[i] ^= 54;
47479
+ this.iHash.update(pad3);
47480
+ this.oHash = hash4.create();
47481
+ for (let i = 0; i < pad3.length; i++)
47482
+ pad3[i] ^= 54 ^ 92;
47483
+ this.oHash.update(pad3);
47484
+ pad3.fill(0);
47485
+ }
47486
+ update(buf) {
47487
+ exists2(this);
47488
+ this.iHash.update(buf);
47489
+ return this;
47490
+ }
47491
+ digestInto(out) {
47492
+ exists2(this);
47493
+ bytes2(out, this.outputLen);
47494
+ this.finished = true;
47495
+ this.iHash.digestInto(out);
47496
+ this.oHash.update(out);
47497
+ this.oHash.digestInto(out);
47498
+ this.destroy();
47499
+ }
47500
+ digest() {
47501
+ const out = new Uint8Array(this.oHash.outputLen);
47502
+ this.digestInto(out);
47503
+ return out;
47504
+ }
47505
+ _cloneInto(to) {
47506
+ to || (to = Object.create(Object.getPrototypeOf(this), {}));
47507
+ const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this;
47508
+ to = to;
47509
+ to.finished = finished;
47510
+ to.destroyed = destroyed;
47511
+ to.blockLen = blockLen;
47512
+ to.outputLen = outputLen;
47513
+ to.oHash = oHash._cloneInto(to.oHash);
47514
+ to.iHash = iHash._cloneInto(to.iHash);
47515
+ return to;
47516
+ }
47517
+ destroy() {
47518
+ this.destroyed = true;
47519
+ this.oHash.destroy();
47520
+ this.iHash.destroy();
47521
+ }
47522
+ };
47523
+ var hmac2 = (hash4, key, message) => new HMAC2(hash4, key).update(message).digest();
47524
+ hmac2.create = (hash4, key) => new HMAC2(hash4, key);
47525
+
47526
+ // ../../node_modules/.pnpm/@noble+curves@1.4.0/node_modules/@noble/curves/esm/_shortw_utils.js
47527
+ function getHash(hash4) {
47106
47528
  return {
47107
- hash: hash3,
47108
- hmac: (key, ...msgs) => hmac(hash3, key, concatBytes(...msgs)),
47109
- randomBytes
47529
+ hash: hash4,
47530
+ hmac: (key, ...msgs) => hmac2(hash4, key, concatBytes3(...msgs)),
47531
+ randomBytes: randomBytes3
47110
47532
  };
47111
47533
  }
47112
47534
  function createCurve(curveDef, defHash) {
47113
- const create = (hash3) => weierstrass({ ...curveDef, ...getHash(hash3) });
47535
+ const create = (hash4) => weierstrass({ ...curveDef, ...getHash(hash4) });
47114
47536
  return Object.freeze({ ...create(defHash), create });
47115
47537
  }
47116
47538
 
47117
- // ../../node_modules/.pnpm/@noble+curves@1.3.0/node_modules/@noble/curves/esm/secp256k1.js
47539
+ // ../../node_modules/.pnpm/@noble+curves@1.4.0/node_modules/@noble/curves/esm/secp256k1.js
47118
47540
  var secp256k1P = BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f");
47119
47541
  var secp256k1N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");
47120
47542
  var _1n6 = BigInt(1);
@@ -47190,7 +47612,7 @@ Supported fuel-core version: ${supportedVersion}.`
47190
47612
  return { k1neg, k1, k2neg, k2 };
47191
47613
  }
47192
47614
  }
47193
- }, sha256);
47615
+ }, sha2563);
47194
47616
  var _0n6 = BigInt(0);
47195
47617
  var Point = secp256k1.ProjectivePoint;
47196
47618
 
@@ -47283,7 +47705,7 @@ Supported fuel-core version: ${supportedVersion}.`
47283
47705
  * @returns random 32-byte hashed
47284
47706
  */
47285
47707
  static generatePrivateKey(entropy) {
47286
- return entropy ? hash2(concat([randomBytes22(32), arrayify(entropy)])) : randomBytes22(32);
47708
+ return entropy ? hash2(concat([randomBytes2(32), arrayify(entropy)])) : randomBytes2(32);
47287
47709
  }
47288
47710
  /**
47289
47711
  * Extended publicKey from a compact publicKey
@@ -47297,34 +47719,34 @@ Supported fuel-core version: ${supportedVersion}.`
47297
47719
  }
47298
47720
  };
47299
47721
 
47300
- // ../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-node/rng.js
47301
- var import_crypto13 = __toESM(__require("crypto"));
47722
+ // ../../node_modules/.pnpm/uuid@10.0.0/node_modules/uuid/dist/esm-node/stringify.js
47723
+ var byteToHex = [];
47724
+ for (let i = 0; i < 256; ++i) {
47725
+ byteToHex.push((i + 256).toString(16).slice(1));
47726
+ }
47727
+ function unsafeStringify(arr, offset = 0) {
47728
+ return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
47729
+ }
47730
+
47731
+ // ../../node_modules/.pnpm/uuid@10.0.0/node_modules/uuid/dist/esm-node/rng.js
47732
+ var import_node_crypto = __toESM(__require("crypto"));
47302
47733
  var rnds8Pool = new Uint8Array(256);
47303
47734
  var poolPtr = rnds8Pool.length;
47304
47735
  function rng() {
47305
47736
  if (poolPtr > rnds8Pool.length - 16) {
47306
- import_crypto13.default.randomFillSync(rnds8Pool);
47737
+ import_node_crypto.default.randomFillSync(rnds8Pool);
47307
47738
  poolPtr = 0;
47308
47739
  }
47309
47740
  return rnds8Pool.slice(poolPtr, poolPtr += 16);
47310
47741
  }
47311
47742
 
47312
- // ../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-node/stringify.js
47313
- var byteToHex = [];
47314
- for (let i = 0; i < 256; ++i) {
47315
- byteToHex.push((i + 256).toString(16).slice(1));
47316
- }
47317
- function unsafeStringify(arr, offset = 0) {
47318
- return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
47319
- }
47320
-
47321
- // ../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-node/native.js
47322
- var import_crypto14 = __toESM(__require("crypto"));
47743
+ // ../../node_modules/.pnpm/uuid@10.0.0/node_modules/uuid/dist/esm-node/native.js
47744
+ var import_node_crypto2 = __toESM(__require("crypto"));
47323
47745
  var native_default = {
47324
- randomUUID: import_crypto14.default.randomUUID
47746
+ randomUUID: import_node_crypto2.default.randomUUID
47325
47747
  };
47326
47748
 
47327
- // ../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-node/v4.js
47749
+ // ../../node_modules/.pnpm/uuid@10.0.0/node_modules/uuid/dist/esm-node/v4.js
47328
47750
  function v4(options, buf, offset) {
47329
47751
  if (native_default.randomUUID && !buf && !options) {
47330
47752
  return native_default.randomUUID();
@@ -47359,7 +47781,7 @@ Supported fuel-core version: ${supportedVersion}.`
47359
47781
  async function encryptKeystoreWallet(privateKey, address, password) {
47360
47782
  const privateKeyBuffer = bufferFromString2(removeHexPrefix(privateKey), "hex");
47361
47783
  const ownerAddress = Address.fromAddressOrString(address);
47362
- const salt = randomBytes22(DEFAULT_KEY_SIZE);
47784
+ const salt = randomBytes2(DEFAULT_KEY_SIZE);
47363
47785
  const key = scrypt22({
47364
47786
  password: bufferFromString2(password),
47365
47787
  salt,
@@ -47368,7 +47790,7 @@ Supported fuel-core version: ${supportedVersion}.`
47368
47790
  r: DEFAULT_KDF_PARAMS_R,
47369
47791
  p: DEFAULT_KDF_PARAMS_P
47370
47792
  });
47371
- const iv = randomBytes22(DEFAULT_IV_SIZE);
47793
+ const iv = randomBytes2(DEFAULT_IV_SIZE);
47372
47794
  const ciphertext = await encryptJsonWalletData2(privateKeyBuffer, key, iv);
47373
47795
  const data = Uint8Array.from([...key.subarray(16, 32), ...ciphertext]);
47374
47796
  const macHashUint8Array = keccak2562(data);
@@ -49864,7 +50286,7 @@ Supported fuel-core version: ${supportedVersion}.`
49864
50286
  * @returns A randomly generated mnemonic
49865
50287
  */
49866
50288
  static generate(size = 32, extraEntropy = "") {
49867
- const entropy = extraEntropy ? sha2562(concat([randomBytes22(size), arrayify(extraEntropy)])) : randomBytes22(size);
50289
+ const entropy = extraEntropy ? sha2562(concat([randomBytes2(size), arrayify(extraEntropy)])) : randomBytes2(size);
49868
50290
  return Mnemonic.entropyToMnemonic(entropy);
49869
50291
  }
49870
50292
  };
@@ -49965,9 +50387,9 @@ Supported fuel-core version: ${supportedVersion}.`
49965
50387
  data.set(arrayify(this.publicKey));
49966
50388
  }
49967
50389
  data.set(toBytes2(index, 4), 33);
49968
- const bytes2 = arrayify(computeHmac2("sha512", chainCode, data));
49969
- const IL = bytes2.slice(0, 32);
49970
- const IR = bytes2.slice(32);
50390
+ const bytes3 = arrayify(computeHmac2("sha512", chainCode, data));
50391
+ const IL = bytes3.slice(0, 32);
50392
+ const IR = bytes3.slice(32);
49971
50393
  if (privateKey) {
49972
50394
  const N = "0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141";
49973
50395
  const ki = bn(IL).add(privateKey).mod(N).toBytes(32);
@@ -50037,26 +50459,26 @@ Supported fuel-core version: ${supportedVersion}.`
50037
50459
  }
50038
50460
  static fromExtendedKey(extendedKey) {
50039
50461
  const decoded = hexlify(toBytes2(decodeBase58(extendedKey)));
50040
- const bytes2 = arrayify(decoded);
50041
- const validChecksum = base58check(bytes2.slice(0, 78)) === extendedKey;
50042
- if (bytes2.length !== 82 || !isValidExtendedKey(bytes2)) {
50462
+ const bytes3 = arrayify(decoded);
50463
+ const validChecksum = base58check(bytes3.slice(0, 78)) === extendedKey;
50464
+ if (bytes3.length !== 82 || !isValidExtendedKey(bytes3)) {
50043
50465
  throw new FuelError(ErrorCode.HD_WALLET_ERROR, "Provided key is not a valid extended key.");
50044
50466
  }
50045
50467
  if (!validChecksum) {
50046
50468
  throw new FuelError(ErrorCode.HD_WALLET_ERROR, "Provided key has an invalid checksum.");
50047
50469
  }
50048
- const depth = bytes2[4];
50049
- const parentFingerprint = hexlify(bytes2.slice(5, 9));
50050
- const index = parseInt(hexlify(bytes2.slice(9, 13)).substring(2), 16);
50051
- const chainCode = hexlify(bytes2.slice(13, 45));
50052
- const key = bytes2.slice(45, 78);
50470
+ const depth = bytes3[4];
50471
+ const parentFingerprint = hexlify(bytes3.slice(5, 9));
50472
+ const index = parseInt(hexlify(bytes3.slice(9, 13)).substring(2), 16);
50473
+ const chainCode = hexlify(bytes3.slice(13, 45));
50474
+ const key = bytes3.slice(45, 78);
50053
50475
  if (depth === 0 && parentFingerprint !== "0x00000000" || depth === 0 && index !== 0) {
50054
50476
  throw new FuelError(
50055
50477
  ErrorCode.HD_WALLET_ERROR,
50056
50478
  "Inconsistency detected: Depth is zero but fingerprint/index is non-zero."
50057
50479
  );
50058
50480
  }
50059
- if (isPublicExtendedKey(bytes2)) {
50481
+ if (isPublicExtendedKey(bytes3)) {
50060
50482
  if (key[0] !== 3) {
50061
50483
  throw new FuelError(ErrorCode.HD_WALLET_ERROR, "Invalid public extended key.");
50062
50484
  }
@@ -50238,7 +50660,7 @@ Supported fuel-core version: ${supportedVersion}.`
50238
50660
  var seedTestWallet = async (wallet, quantities, utxosAmount = 1) => {
50239
50661
  const accountsToBeFunded = Array.isArray(wallet) ? wallet : [wallet];
50240
50662
  const [{ provider }] = accountsToBeFunded;
50241
- const genesisWallet = new WalletUnlocked(process.env.GENESIS_SECRET || randomBytes22(32), provider);
50663
+ const genesisWallet = new WalletUnlocked(process.env.GENESIS_SECRET || randomBytes2(32), provider);
50242
50664
  const request = new ScriptTransactionRequest();
50243
50665
  quantities.map(coinQuantityfy).forEach(
50244
50666
  ({ amount, assetId }) => accountsToBeFunded.forEach(({ address }) => {
@@ -50264,8 +50686,7 @@ Supported fuel-core version: ${supportedVersion}.`
50264
50686
  };
50265
50687
 
50266
50688
  // src/test-utils/launchNode.ts
50267
- var import_child_process = __require("child_process");
50268
- var import_crypto20 = __require("crypto");
50689
+ var import_crypto18 = __require("crypto");
50269
50690
  var import_fs = __require("fs");
50270
50691
  var import_os = __toESM(__require("os"));
50271
50692
  var import_path7 = __toESM(__require("path"));
@@ -50295,7 +50716,6 @@ Supported fuel-core version: ${supportedVersion}.`
50295
50716
  state.isDead = true;
50296
50717
  killFn(Number(child.pid));
50297
50718
  }
50298
- child.stdout.removeAllListeners();
50299
50719
  child.stderr.removeAllListeners();
50300
50720
  if ((0, import_fs.existsSync)(configPath)) {
50301
50721
  (0, import_fs.rmSync)(configPath, { recursive: true });
@@ -50318,7 +50738,7 @@ Supported fuel-core version: ${supportedVersion}.`
50318
50738
  const signer = new Signer(pk);
50319
50739
  process.env.GENESIS_SECRET = hexlify(pk);
50320
50740
  coins.push({
50321
- tx_id: hexlify(randomBytes22(BYTES_32)),
50741
+ tx_id: hexlify(randomBytes2(BYTES_32)),
50322
50742
  owner: signer.address.toHexString(),
50323
50743
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
50324
50744
  amount: "18446744073709551615",
@@ -50340,12 +50760,11 @@ Supported fuel-core version: ${supportedVersion}.`
50340
50760
  ip,
50341
50761
  port,
50342
50762
  args = [],
50343
- fuelCorePath = process.env.FUEL_CORE_PATH ?? void 0,
50763
+ fuelCorePath = process.env.FUEL_CORE_PATH || void 0,
50344
50764
  loggingEnabled = true,
50345
- debugEnabled = false,
50346
50765
  basePath,
50347
50766
  snapshotConfig = defaultSnapshotConfigs
50348
- }) => (
50767
+ } = {}) => (
50349
50768
  // eslint-disable-next-line no-async-promise-executor
50350
50769
  new Promise(async (resolve, reject) => {
50351
50770
  const remainingArgs = extractRemainingArgs(args, [
@@ -50362,7 +50781,7 @@ Supported fuel-core version: ${supportedVersion}.`
50362
50781
  const poaInstant = poaInstantFlagValue === "true" || poaInstantFlagValue === void 0;
50363
50782
  const nativeExecutorVersion = getFlagValueFromArgs(args, "--native-executor-version") || "0";
50364
50783
  const graphQLStartSubstring = "Binding GraphQL provider to";
50365
- const command = fuelCorePath ?? "fuel-core";
50784
+ const command = fuelCorePath || "fuel-core";
50366
50785
  const ipToUse = ip || "0.0.0.0";
50367
50786
  const portToUse = port || (await (0, import_portfinder.getPortPromise)({
50368
50787
  port: 4e3,
@@ -50372,7 +50791,7 @@ Supported fuel-core version: ${supportedVersion}.`
50372
50791
  })).toString();
50373
50792
  let snapshotDirToUse;
50374
50793
  const prefix = basePath || import_os.default.tmpdir();
50375
- const suffix = basePath ? "" : (0, import_crypto20.randomUUID)();
50794
+ const suffix = basePath ? "" : (0, import_crypto18.randomUUID)();
50376
50795
  const tempDir = import_path7.default.join(prefix, ".fuels", suffix, "snapshotDir");
50377
50796
  if (snapshotDir) {
50378
50797
  snapshotDirToUse = snapshotDir;
@@ -50391,7 +50810,8 @@ Supported fuel-core version: ${supportedVersion}.`
50391
50810
  (0, import_fs.writeFileSync)(stateTransitionPath, JSON.stringify(""));
50392
50811
  snapshotDirToUse = tempDir;
50393
50812
  }
50394
- const child = (0, import_child_process.spawn)(
50813
+ const { spawn } = await import("child_process");
50814
+ const child = spawn(
50395
50815
  command,
50396
50816
  [
50397
50817
  "run",
@@ -50408,15 +50828,12 @@ Supported fuel-core version: ${supportedVersion}.`
50408
50828
  "--debug",
50409
50829
  ...remainingArgs
50410
50830
  ].flat(),
50411
- {
50412
- stdio: "pipe"
50413
- }
50831
+ { stdio: "pipe" }
50414
50832
  );
50415
50833
  if (loggingEnabled) {
50416
- child.stderr.pipe(process.stderr);
50417
- }
50418
- if (debugEnabled) {
50419
- child.stdout.pipe(process.stdout);
50834
+ child.stderr.on("data", (chunk) => {
50835
+ console.log(chunk.toString());
50836
+ });
50420
50837
  }
50421
50838
  const cleanupConfig = {
50422
50839
  child,
@@ -50441,7 +50858,8 @@ Supported fuel-core version: ${supportedVersion}.`
50441
50858
  });
50442
50859
  }
50443
50860
  if (/error/i.test(text)) {
50444
- reject(text.toString());
50861
+ console.log(text);
50862
+ reject(new FuelError(FuelError.CODES.NODE_LAUNCH_FAILED, text));
50445
50863
  }
50446
50864
  });
50447
50865
  process.on("exit", () => killNode(cleanupConfig));
@@ -50483,7 +50901,7 @@ Supported fuel-core version: ${supportedVersion}.`
50483
50901
  static random(count = 1) {
50484
50902
  const assetIds = [];
50485
50903
  for (let i = 0; i < count; i++) {
50486
- assetIds.push(new _AssetId(hexlify(randomBytes22(32))));
50904
+ assetIds.push(new _AssetId(hexlify(randomBytes2(32))));
50487
50905
  }
50488
50906
  return assetIds;
50489
50907
  }
@@ -50504,7 +50922,7 @@ Supported fuel-core version: ${supportedVersion}.`
50504
50922
  generateWallets = () => {
50505
50923
  const generatedWallets = [];
50506
50924
  for (let index = 1; index <= this.options.count; index++) {
50507
- generatedWallets.push(new WalletUnlocked(randomBytes22(32)));
50925
+ generatedWallets.push(new WalletUnlocked(randomBytes2(32)));
50508
50926
  }
50509
50927
  return generatedWallets;
50510
50928
  };
@@ -50561,7 +50979,7 @@ Supported fuel-core version: ${supportedVersion}.`
50561
50979
  tx_pointer_block_height: 0,
50562
50980
  tx_pointer_tx_idx: 0,
50563
50981
  output_index: 0,
50564
- tx_id: hexlify(randomBytes22(32))
50982
+ tx_id: hexlify(randomBytes2(32))
50565
50983
  });
50566
50984
  }
50567
50985
  });
@@ -50612,7 +51030,8 @@ Supported fuel-core version: ${supportedVersion}.`
50612
51030
  async function setupTestProviderAndWallets({
50613
51031
  walletsConfig: walletsConfigOptions = {},
50614
51032
  providerOptions,
50615
- nodeOptions = {}
51033
+ nodeOptions = {},
51034
+ launchNodeServerPort = process.env.LAUNCH_NODE_SERVER_PORT || void 0
50616
51035
  } = {}) {
50617
51036
  Symbol.dispose ??= Symbol("Symbol.dispose");
50618
51037
  const walletsConfig = new WalletsConfig(
@@ -50622,7 +51041,7 @@ Supported fuel-core version: ${supportedVersion}.`
50622
51041
  ...walletsConfigOptions
50623
51042
  }
50624
51043
  );
50625
- const { cleanup, url } = await launchNode({
51044
+ const launchNodeOptions = {
50626
51045
  loggingEnabled: false,
50627
51046
  ...nodeOptions,
50628
51047
  snapshotConfig: mergeDeepRight_default(
@@ -50630,7 +51049,20 @@ Supported fuel-core version: ${supportedVersion}.`
50630
51049
  walletsConfig.apply(nodeOptions?.snapshotConfig)
50631
51050
  ),
50632
51051
  port: "0"
50633
- });
51052
+ };
51053
+ let cleanup;
51054
+ let url;
51055
+ if (launchNodeServerPort) {
51056
+ const serverUrl = `http://localhost:${launchNodeServerPort}`;
51057
+ url = await (await fetch(serverUrl, { method: "POST", body: JSON.stringify(launchNodeOptions) })).text();
51058
+ cleanup = () => {
51059
+ fetch(`${serverUrl}/cleanup/${url}`);
51060
+ };
51061
+ } else {
51062
+ const settings = await launchNode(launchNodeOptions);
51063
+ url = settings.url;
51064
+ cleanup = settings.cleanup;
51065
+ }
50634
51066
  let provider;
50635
51067
  try {
50636
51068
  provider = await Provider.create(url, providerOptions);
@@ -50667,7 +51099,7 @@ Supported fuel-core version: ${supportedVersion}.`
50667
51099
  constructor({
50668
51100
  sender = Address.fromRandom(),
50669
51101
  recipient = Address.fromRandom(),
50670
- nonce = hexlify(randomBytes22(32)),
51102
+ nonce = hexlify(randomBytes2(32)),
50671
51103
  amount = 1e6,
50672
51104
  data = "02",
50673
51105
  da_height = 0
@@ -50715,6 +51147,9 @@ mime-types/index.js:
50715
51147
  @noble/curves/esm/abstract/utils.js:
50716
51148
  (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
50717
51149
 
51150
+ @noble/hashes/esm/utils.js:
51151
+ (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
51152
+
50718
51153
  @noble/curves/esm/abstract/modular.js:
50719
51154
  (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
50720
51155