@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.

@@ -85,20 +85,20 @@
85
85
  ctor.prototype = new TempCtor();
86
86
  ctor.prototype.constructor = ctor;
87
87
  }
88
- function BN2(number2, base, endian) {
89
- if (BN2.isBN(number2)) {
90
- return number2;
88
+ function BN2(number3, base, endian) {
89
+ if (BN2.isBN(number3)) {
90
+ return number3;
91
91
  }
92
92
  this.negative = 0;
93
93
  this.words = null;
94
94
  this.length = 0;
95
95
  this.red = null;
96
- if (number2 !== null) {
96
+ if (number3 !== null) {
97
97
  if (base === "le" || base === "be") {
98
98
  endian = base;
99
99
  base = 10;
100
100
  }
101
- this._init(number2 || 0, base || 10, endian || "be");
101
+ this._init(number3 || 0, base || 10, endian || "be");
102
102
  }
103
103
  }
104
104
  if (typeof module2 === "object") {
@@ -133,53 +133,53 @@
133
133
  return left;
134
134
  return right;
135
135
  };
136
- BN2.prototype._init = function init(number2, base, endian) {
137
- if (typeof number2 === "number") {
138
- return this._initNumber(number2, base, endian);
136
+ BN2.prototype._init = function init(number3, base, endian) {
137
+ if (typeof number3 === "number") {
138
+ return this._initNumber(number3, base, endian);
139
139
  }
140
- if (typeof number2 === "object") {
141
- return this._initArray(number2, base, endian);
140
+ if (typeof number3 === "object") {
141
+ return this._initArray(number3, base, endian);
142
142
  }
143
143
  if (base === "hex") {
144
144
  base = 16;
145
145
  }
146
146
  assert2(base === (base | 0) && base >= 2 && base <= 36);
147
- number2 = number2.toString().replace(/\s+/g, "");
147
+ number3 = number3.toString().replace(/\s+/g, "");
148
148
  var start = 0;
149
- if (number2[0] === "-") {
149
+ if (number3[0] === "-") {
150
150
  start++;
151
151
  this.negative = 1;
152
152
  }
153
- if (start < number2.length) {
153
+ if (start < number3.length) {
154
154
  if (base === 16) {
155
- this._parseHex(number2, start, endian);
155
+ this._parseHex(number3, start, endian);
156
156
  } else {
157
- this._parseBase(number2, base, start);
157
+ this._parseBase(number3, base, start);
158
158
  if (endian === "le") {
159
159
  this._initArray(this.toArray(), base, endian);
160
160
  }
161
161
  }
162
162
  }
163
163
  };
164
- BN2.prototype._initNumber = function _initNumber(number2, base, endian) {
165
- if (number2 < 0) {
164
+ BN2.prototype._initNumber = function _initNumber(number3, base, endian) {
165
+ if (number3 < 0) {
166
166
  this.negative = 1;
167
- number2 = -number2;
167
+ number3 = -number3;
168
168
  }
169
- if (number2 < 67108864) {
170
- this.words = [number2 & 67108863];
169
+ if (number3 < 67108864) {
170
+ this.words = [number3 & 67108863];
171
171
  this.length = 1;
172
- } else if (number2 < 4503599627370496) {
172
+ } else if (number3 < 4503599627370496) {
173
173
  this.words = [
174
- number2 & 67108863,
175
- number2 / 67108864 & 67108863
174
+ number3 & 67108863,
175
+ number3 / 67108864 & 67108863
176
176
  ];
177
177
  this.length = 2;
178
178
  } else {
179
- assert2(number2 < 9007199254740992);
179
+ assert2(number3 < 9007199254740992);
180
180
  this.words = [
181
- number2 & 67108863,
182
- number2 / 67108864 & 67108863,
181
+ number3 & 67108863,
182
+ number3 / 67108864 & 67108863,
183
183
  1
184
184
  ];
185
185
  this.length = 3;
@@ -188,14 +188,14 @@
188
188
  return;
189
189
  this._initArray(this.toArray(), base, endian);
190
190
  };
191
- BN2.prototype._initArray = function _initArray(number2, base, endian) {
192
- assert2(typeof number2.length === "number");
193
- if (number2.length <= 0) {
191
+ BN2.prototype._initArray = function _initArray(number3, base, endian) {
192
+ assert2(typeof number3.length === "number");
193
+ if (number3.length <= 0) {
194
194
  this.words = [0];
195
195
  this.length = 1;
196
196
  return this;
197
197
  }
198
- this.length = Math.ceil(number2.length / 3);
198
+ this.length = Math.ceil(number3.length / 3);
199
199
  this.words = new Array(this.length);
200
200
  for (var i = 0; i < this.length; i++) {
201
201
  this.words[i] = 0;
@@ -203,8 +203,8 @@
203
203
  var j, w;
204
204
  var off = 0;
205
205
  if (endian === "be") {
206
- for (i = number2.length - 1, j = 0; i >= 0; i -= 3) {
207
- w = number2[i] | number2[i - 1] << 8 | number2[i - 2] << 16;
206
+ for (i = number3.length - 1, j = 0; i >= 0; i -= 3) {
207
+ w = number3[i] | number3[i - 1] << 8 | number3[i - 2] << 16;
208
208
  this.words[j] |= w << off & 67108863;
209
209
  this.words[j + 1] = w >>> 26 - off & 67108863;
210
210
  off += 24;
@@ -214,8 +214,8 @@
214
214
  }
215
215
  }
216
216
  } else if (endian === "le") {
217
- for (i = 0, j = 0; i < number2.length; i += 3) {
218
- w = number2[i] | number2[i + 1] << 8 | number2[i + 2] << 16;
217
+ for (i = 0, j = 0; i < number3.length; i += 3) {
218
+ w = number3[i] | number3[i + 1] << 8 | number3[i + 2] << 16;
219
219
  this.words[j] |= w << off & 67108863;
220
220
  this.words[j + 1] = w >>> 26 - off & 67108863;
221
221
  off += 24;
@@ -246,8 +246,8 @@
246
246
  }
247
247
  return r;
248
248
  }
249
- BN2.prototype._parseHex = function _parseHex(number2, start, endian) {
250
- this.length = Math.ceil((number2.length - start) / 6);
249
+ BN2.prototype._parseHex = function _parseHex(number3, start, endian) {
250
+ this.length = Math.ceil((number3.length - start) / 6);
251
251
  this.words = new Array(this.length);
252
252
  for (var i = 0; i < this.length; i++) {
253
253
  this.words[i] = 0;
@@ -256,8 +256,8 @@
256
256
  var j = 0;
257
257
  var w;
258
258
  if (endian === "be") {
259
- for (i = number2.length - 1; i >= start; i -= 2) {
260
- w = parseHexByte(number2, start, i) << off;
259
+ for (i = number3.length - 1; i >= start; i -= 2) {
260
+ w = parseHexByte(number3, start, i) << off;
261
261
  this.words[j] |= w & 67108863;
262
262
  if (off >= 18) {
263
263
  off -= 18;
@@ -268,9 +268,9 @@
268
268
  }
269
269
  }
270
270
  } else {
271
- var parseLength = number2.length - start;
272
- for (i = parseLength % 2 === 0 ? start + 1 : start; i < number2.length; i += 2) {
273
- w = parseHexByte(number2, start, i) << off;
271
+ var parseLength = number3.length - start;
272
+ for (i = parseLength % 2 === 0 ? start + 1 : start; i < number3.length; i += 2) {
273
+ w = parseHexByte(number3, start, i) << off;
274
274
  this.words[j] |= w & 67108863;
275
275
  if (off >= 18) {
276
276
  off -= 18;
@@ -302,7 +302,7 @@
302
302
  }
303
303
  return r;
304
304
  }
305
- BN2.prototype._parseBase = function _parseBase(number2, base, start) {
305
+ BN2.prototype._parseBase = function _parseBase(number3, base, start) {
306
306
  this.words = [0];
307
307
  this.length = 1;
308
308
  for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base) {
@@ -310,12 +310,12 @@
310
310
  }
311
311
  limbLen--;
312
312
  limbPow = limbPow / base | 0;
313
- var total = number2.length - start;
313
+ var total = number3.length - start;
314
314
  var mod2 = total % limbLen;
315
315
  var end = Math.min(total, total - mod2) + start;
316
316
  var word = 0;
317
317
  for (var i = start; i < end; i += limbLen) {
318
- word = parseBase(number2, i, i + limbLen, base);
318
+ word = parseBase(number3, i, i + limbLen, base);
319
319
  this.imuln(limbPow);
320
320
  if (this.words[0] + word < 67108864) {
321
321
  this.words[0] += word;
@@ -325,7 +325,7 @@
325
325
  }
326
326
  if (mod2 !== 0) {
327
327
  var pow3 = 1;
328
- word = parseBase(number2, i, number2.length, base);
328
+ word = parseBase(number3, i, number3.length, base);
329
329
  for (i = 0; i < mod2; i++) {
330
330
  pow3 *= base;
331
331
  }
@@ -2651,20 +2651,20 @@
2651
2651
  );
2652
2652
  }
2653
2653
  inherits(K256, MPrime);
2654
- K256.prototype.split = function split2(input, output2) {
2654
+ K256.prototype.split = function split2(input, output3) {
2655
2655
  var mask = 4194303;
2656
2656
  var outLen = Math.min(input.length, 9);
2657
2657
  for (var i = 0; i < outLen; i++) {
2658
- output2.words[i] = input.words[i];
2658
+ output3.words[i] = input.words[i];
2659
2659
  }
2660
- output2.length = outLen;
2660
+ output3.length = outLen;
2661
2661
  if (input.length <= 9) {
2662
2662
  input.words[0] = 0;
2663
2663
  input.length = 1;
2664
2664
  return;
2665
2665
  }
2666
2666
  var prev = input.words[9];
2667
- output2.words[output2.length++] = prev & mask;
2667
+ output3.words[output3.length++] = prev & mask;
2668
2668
  for (i = 10; i < input.length; i++) {
2669
2669
  var next = input.words[i] | 0;
2670
2670
  input.words[i - 10] = (next & mask) << 4 | prev >>> 22;
@@ -3060,8 +3060,8 @@
3060
3060
  }
3061
3061
  return result;
3062
3062
  }
3063
- function toWords(bytes2) {
3064
- return convert2(bytes2, 8, 5, true);
3063
+ function toWords(bytes3) {
3064
+ return convert2(bytes3, 8, 5, true);
3065
3065
  }
3066
3066
  function fromWordsUnsafe(words) {
3067
3067
  const res = convert2(words, 5, 8, false);
@@ -3600,18 +3600,18 @@
3600
3600
  }
3601
3601
  function utf8PercentDecode(str) {
3602
3602
  const input = new Buffer(str);
3603
- const output2 = [];
3603
+ const output3 = [];
3604
3604
  for (let i = 0; i < input.length; ++i) {
3605
3605
  if (input[i] !== 37) {
3606
- output2.push(input[i]);
3606
+ output3.push(input[i]);
3607
3607
  } else if (input[i] === 37 && isASCIIHex(input[i + 1]) && isASCIIHex(input[i + 2])) {
3608
- output2.push(parseInt(input.slice(i + 1, i + 3).toString(), 16));
3608
+ output3.push(parseInt(input.slice(i + 1, i + 3).toString(), 16));
3609
3609
  i += 2;
3610
3610
  } else {
3611
- output2.push(input[i]);
3611
+ output3.push(input[i]);
3612
3612
  }
3613
3613
  }
3614
- return new Buffer(output2).toString();
3614
+ return new Buffer(output3).toString();
3615
3615
  }
3616
3616
  function isC0ControlPercentEncode(c) {
3617
3617
  return c <= 31 || c > 126;
@@ -3687,16 +3687,16 @@
3687
3687
  return ipv4;
3688
3688
  }
3689
3689
  function serializeIPv4(address) {
3690
- let output2 = "";
3690
+ let output3 = "";
3691
3691
  let n = address;
3692
3692
  for (let i = 1; i <= 4; ++i) {
3693
- output2 = String(n % 256) + output2;
3693
+ output3 = String(n % 256) + output3;
3694
3694
  if (i !== 4) {
3695
- output2 = "." + output2;
3695
+ output3 = "." + output3;
3696
3696
  }
3697
3697
  n = Math.floor(n / 256);
3698
3698
  }
3699
- return output2;
3699
+ return output3;
3700
3700
  }
3701
3701
  function parseIPv6(input) {
3702
3702
  const address = [0, 0, 0, 0, 0, 0, 0, 0];
@@ -3754,13 +3754,13 @@
3754
3754
  return failure;
3755
3755
  }
3756
3756
  while (isASCIIDigit(input[pointer])) {
3757
- const number2 = parseInt(at(input, pointer));
3757
+ const number3 = parseInt(at(input, pointer));
3758
3758
  if (ipv4Piece === null) {
3759
- ipv4Piece = number2;
3759
+ ipv4Piece = number3;
3760
3760
  } else if (ipv4Piece === 0) {
3761
3761
  return failure;
3762
3762
  } else {
3763
- ipv4Piece = ipv4Piece * 10 + number2;
3763
+ ipv4Piece = ipv4Piece * 10 + number3;
3764
3764
  }
3765
3765
  if (ipv4Piece > 255) {
3766
3766
  return failure;
@@ -3804,7 +3804,7 @@
3804
3804
  return address;
3805
3805
  }
3806
3806
  function serializeIPv6(address) {
3807
- let output2 = "";
3807
+ let output3 = "";
3808
3808
  const seqResult = findLongestZeroSequence(address);
3809
3809
  const compress = seqResult.idx;
3810
3810
  let ignore0 = false;
@@ -3816,16 +3816,16 @@
3816
3816
  }
3817
3817
  if (compress === pieceIndex) {
3818
3818
  const separator = pieceIndex === 0 ? "::" : ":";
3819
- output2 += separator;
3819
+ output3 += separator;
3820
3820
  ignore0 = true;
3821
3821
  continue;
3822
3822
  }
3823
- output2 += address[pieceIndex].toString(16);
3823
+ output3 += address[pieceIndex].toString(16);
3824
3824
  if (pieceIndex !== 7) {
3825
- output2 += ":";
3825
+ output3 += ":";
3826
3826
  }
3827
3827
  }
3828
- return output2;
3828
+ return output3;
3829
3829
  }
3830
3830
  function parseHost(input, isSpecialArg) {
3831
3831
  if (input[0] === "[") {
@@ -3855,12 +3855,12 @@
3855
3855
  if (containsForbiddenHostCodePointExcludingPercent(input)) {
3856
3856
  return failure;
3857
3857
  }
3858
- let output2 = "";
3858
+ let output3 = "";
3859
3859
  const decoded = punycode.ucs2.decode(input);
3860
3860
  for (let i = 0; i < decoded.length; ++i) {
3861
- output2 += percentEncodeChar(decoded[i], isC0ControlPercentEncode);
3861
+ output3 += percentEncodeChar(decoded[i], isC0ControlPercentEncode);
3862
3862
  }
3863
- return output2;
3863
+ return output3;
3864
3864
  }
3865
3865
  function findLongestZeroSequence(arr) {
3866
3866
  let maxIdx = null;
@@ -4485,37 +4485,37 @@
4485
4485
  return true;
4486
4486
  };
4487
4487
  function serializeURL(url, excludeFragment) {
4488
- let output2 = url.scheme + ":";
4488
+ let output3 = url.scheme + ":";
4489
4489
  if (url.host !== null) {
4490
- output2 += "//";
4490
+ output3 += "//";
4491
4491
  if (url.username !== "" || url.password !== "") {
4492
- output2 += url.username;
4492
+ output3 += url.username;
4493
4493
  if (url.password !== "") {
4494
- output2 += ":" + url.password;
4494
+ output3 += ":" + url.password;
4495
4495
  }
4496
- output2 += "@";
4496
+ output3 += "@";
4497
4497
  }
4498
- output2 += serializeHost(url.host);
4498
+ output3 += serializeHost(url.host);
4499
4499
  if (url.port !== null) {
4500
- output2 += ":" + url.port;
4500
+ output3 += ":" + url.port;
4501
4501
  }
4502
4502
  } else if (url.host === null && url.scheme === "file") {
4503
- output2 += "//";
4503
+ output3 += "//";
4504
4504
  }
4505
4505
  if (url.cannotBeABaseURL) {
4506
- output2 += url.path[0];
4506
+ output3 += url.path[0];
4507
4507
  } else {
4508
4508
  for (const string of url.path) {
4509
- output2 += "/" + string;
4509
+ output3 += "/" + string;
4510
4510
  }
4511
4511
  }
4512
4512
  if (url.query !== null) {
4513
- output2 += "?" + url.query;
4513
+ output3 += "?" + url.query;
4514
4514
  }
4515
4515
  if (!excludeFragment && url.fragment !== null) {
4516
- output2 += "#" + url.fragment;
4516
+ output3 += "#" + url.fragment;
4517
4517
  }
4518
- return output2;
4518
+ return output3;
4519
4519
  }
4520
4520
  function serializeOrigin(tuple) {
4521
4521
  let result = tuple.scheme + "://";
@@ -6459,19 +6459,19 @@
6459
6459
  return "GraphQLError";
6460
6460
  }
6461
6461
  toString() {
6462
- let output2 = this.message;
6462
+ let output3 = this.message;
6463
6463
  if (this.nodes) {
6464
6464
  for (const node of this.nodes) {
6465
6465
  if (node.loc) {
6466
- output2 += "\n\n" + (0, _printLocation.printLocation)(node.loc);
6466
+ output3 += "\n\n" + (0, _printLocation.printLocation)(node.loc);
6467
6467
  }
6468
6468
  }
6469
6469
  } else if (this.source && this.locations) {
6470
6470
  for (const location of this.locations) {
6471
- output2 += "\n\n" + (0, _printLocation.printSourceLocation)(this.source, location);
6471
+ output3 += "\n\n" + (0, _printLocation.printSourceLocation)(this.source, location);
6472
6472
  }
6473
6473
  }
6474
- return output2;
6474
+ return output3;
6475
6475
  }
6476
6476
  toJSON() {
6477
6477
  const formattedError = {
@@ -18786,7 +18786,7 @@ spurious results.`);
18786
18786
  module.exports = iterate;
18787
18787
  function iterate(list, iterator, state, callback) {
18788
18788
  var key = state["keyedList"] ? state["keyedList"][state.index] : state.index;
18789
- state.jobs[key] = runJob(iterator, key, list[key], function(error, output2) {
18789
+ state.jobs[key] = runJob(iterator, key, list[key], function(error, output3) {
18790
18790
  if (!(key in state.jobs)) {
18791
18791
  return;
18792
18792
  }
@@ -18794,7 +18794,7 @@ spurious results.`);
18794
18794
  if (error) {
18795
18795
  abort(state);
18796
18796
  } else {
18797
- state.results[key] = output2;
18797
+ state.results[key] = output3;
18798
18798
  }
18799
18799
  callback(error, state.results);
18800
18800
  });
@@ -20556,8 +20556,8 @@ spurious results.`);
20556
20556
  const ret3 = wasm$1.retd(addr, len);
20557
20557
  return Instruction.__wrap(ret3);
20558
20558
  }
20559
- function aloc(bytes2) {
20560
- const ret3 = wasm$1.aloc(bytes2);
20559
+ function aloc(bytes3) {
20560
+ const ret3 = wasm$1.aloc(bytes3);
20561
20561
  return Instruction.__wrap(ret3);
20562
20562
  }
20563
20563
  function mcl(dst_addr, len) {
@@ -21766,9 +21766,9 @@ spurious results.`);
21766
21766
  * Construct the instruction from its parts.
21767
21767
  * @param {RegId} bytes
21768
21768
  */
21769
- constructor(bytes2) {
21770
- _assertClass(bytes2, RegId);
21771
- var ptr0 = bytes2.__destroy_into_raw();
21769
+ constructor(bytes3) {
21770
+ _assertClass(bytes3, RegId);
21771
+ var ptr0 = bytes3.__destroy_into_raw();
21772
21772
  const ret3 = wasm$1.aloc_new_typescript(ptr0);
21773
21773
  this.__wbg_ptr = ret3 >>> 0;
21774
21774
  return this;
@@ -28305,8 +28305,8 @@ spurious results.`);
28305
28305
  }
28306
28306
  }
28307
28307
  }
28308
- const bytes2 = await module2.arrayBuffer();
28309
- return await WebAssembly.instantiate(bytes2, imports);
28308
+ const bytes3 = await module2.arrayBuffer();
28309
+ return await WebAssembly.instantiate(bytes3, imports);
28310
28310
  } else {
28311
28311
  const instance = await WebAssembly.instantiate(module2, imports);
28312
28312
  if (instance instanceof WebAssembly.Instance) {
@@ -28636,9 +28636,9 @@ spurious results.`);
28636
28636
  // ../versions/dist/index.mjs
28637
28637
  function getBuiltinVersions() {
28638
28638
  return {
28639
- FORC: "0.60.0",
28639
+ FORC: "0.61.1",
28640
28640
  FUEL_CORE: "0.30.0",
28641
- FUELS: "0.90.0"
28641
+ FUELS: "0.91.0"
28642
28642
  };
28643
28643
  }
28644
28644
  function parseVersion(version) {
@@ -28761,15 +28761,17 @@ This unreleased fuel-core build may include features and updates not yet support
28761
28761
  ErrorCode2["UNLOCKED_WALLET_REQUIRED"] = "unlocked-wallet-required";
28762
28762
  ErrorCode2["ERROR_BUILDING_BLOCK_EXPLORER_URL"] = "error-building-block-explorer-url";
28763
28763
  ErrorCode2["VITEPRESS_PLUGIN_ERROR"] = "vitepress-plugin-error";
28764
- ErrorCode2["INVALID_MULTICALL"] = "invalid-multicall";
28765
28764
  ErrorCode2["SCRIPT_REVERTED"] = "script-reverted";
28766
28765
  ErrorCode2["SCRIPT_RETURN_INVALID_TYPE"] = "script-return-invalid-type";
28767
28766
  ErrorCode2["STREAM_PARSING_ERROR"] = "stream-parsing-error";
28767
+ ErrorCode2["NODE_LAUNCH_FAILED"] = "node-launch-failed";
28768
+ ErrorCode2["UNKNOWN"] = "unknown";
28768
28769
  return ErrorCode2;
28769
28770
  })(ErrorCode || {});
28770
28771
  var _FuelError = class extends Error {
28771
28772
  VERSIONS = versions;
28772
28773
  metadata;
28774
+ rawError;
28773
28775
  static parse(e) {
28774
28776
  const error = e;
28775
28777
  if (error.code === void 0) {
@@ -28789,15 +28791,16 @@ This unreleased fuel-core build may include features and updates not yet support
28789
28791
  return new _FuelError(error.code, error.message);
28790
28792
  }
28791
28793
  code;
28792
- constructor(code, message, metadata = {}) {
28794
+ constructor(code, message, metadata = {}, rawError = {}) {
28793
28795
  super(message);
28794
28796
  this.code = code;
28795
28797
  this.name = "FuelError";
28796
28798
  this.metadata = metadata;
28799
+ this.rawError = rawError;
28797
28800
  }
28798
28801
  toObject() {
28799
- const { code, name, message, metadata, VERSIONS } = this;
28800
- return { code, name, message, metadata, VERSIONS };
28802
+ const { code, name, message, metadata, VERSIONS, rawError } = this;
28803
+ return { code, name, message, metadata, VERSIONS, rawError };
28801
28804
  }
28802
28805
  };
28803
28806
  var FuelError = _FuelError;
@@ -28839,15 +28842,15 @@ This unreleased fuel-core build may include features and updates not yet support
28839
28842
  // ANCHOR: HELPERS
28840
28843
  // make sure we always include `0x` in hex strings
28841
28844
  toString(base, length) {
28842
- const output2 = super.toString(base, length);
28845
+ const output3 = super.toString(base, length);
28843
28846
  if (base === 16 || base === "hex") {
28844
- return `0x${output2}`;
28847
+ return `0x${output3}`;
28845
28848
  }
28846
- return output2;
28849
+ return output3;
28847
28850
  }
28848
28851
  toHex(bytesPadding) {
28849
- const bytes2 = bytesPadding || 0;
28850
- const bytesLength = bytes2 * 2;
28852
+ const bytes3 = bytesPadding || 0;
28853
+ const bytesLength = bytes3 * 2;
28851
28854
  if (this.isNeg()) {
28852
28855
  throw new FuelError(ErrorCode.CONVERTING_FAILED, "Cannot convert negative value to hex.");
28853
28856
  }
@@ -28958,21 +28961,21 @@ This unreleased fuel-core build may include features and updates not yet support
28958
28961
  // END ANCHOR: OVERRIDES to output our BN type
28959
28962
  // ANCHOR: OVERRIDES to avoid losing references
28960
28963
  caller(v, methodName) {
28961
- const output2 = super[methodName](new BN(v));
28962
- if (BN.isBN(output2)) {
28963
- return new BN(output2.toArray());
28964
+ const output3 = super[methodName](new BN(v));
28965
+ if (BN.isBN(output3)) {
28966
+ return new BN(output3.toArray());
28964
28967
  }
28965
- if (typeof output2 === "boolean") {
28966
- return output2;
28968
+ if (typeof output3 === "boolean") {
28969
+ return output3;
28967
28970
  }
28968
- return output2;
28971
+ return output3;
28969
28972
  }
28970
28973
  clone() {
28971
28974
  return new BN(this.toArray());
28972
28975
  }
28973
28976
  mulTo(num, out) {
28974
- const output2 = new import_bn.default(this.toArray()).mulTo(num, out);
28975
- return new BN(output2.toArray());
28977
+ const output3 = new import_bn.default(this.toArray()).mulTo(num, out);
28978
+ return new BN(output3.toArray());
28976
28979
  }
28977
28980
  egcd(p) {
28978
28981
  const { a, b, gcd } = new import_bn.default(this.toArray()).egcd(p);
@@ -29030,15 +29033,15 @@ This unreleased fuel-core build may include features and updates not yet support
29030
29033
  __defNormalProp3(obj, typeof key !== "symbol" ? key + "" : key, value);
29031
29034
  return value;
29032
29035
  };
29033
- var chunkAndPadBytes = (bytes2, chunkSize) => {
29036
+ var chunkAndPadBytes = (bytes3, chunkSize) => {
29034
29037
  const chunks = [];
29035
- for (let offset = 0; offset < bytes2.length; offset += chunkSize) {
29038
+ for (let offset = 0; offset < bytes3.length; offset += chunkSize) {
29036
29039
  const chunk = new Uint8Array(chunkSize);
29037
- chunk.set(bytes2.slice(offset, offset + chunkSize));
29040
+ chunk.set(bytes3.slice(offset, offset + chunkSize));
29038
29041
  chunks.push(chunk);
29039
29042
  }
29040
29043
  const lastChunk = chunks[chunks.length - 1];
29041
- const remainingBytes = bytes2.length % chunkSize;
29044
+ const remainingBytes = bytes3.length % chunkSize;
29042
29045
  const paddedChunkLength = remainingBytes + (8 - remainingBytes % 8) % 8;
29043
29046
  const newChunk = lastChunk.slice(0, paddedChunkLength);
29044
29047
  chunks[chunks.length - 1] = newChunk;
@@ -29081,15 +29084,15 @@ If you are attempting to transform a hex value, please make sure it is being pas
29081
29084
  return concatenated;
29082
29085
  };
29083
29086
  var concat = (arrays) => {
29084
- const bytes2 = arrays.map((v) => arrayify(v));
29085
- return concatBytes(bytes2);
29087
+ const bytes3 = arrays.map((v) => arrayify(v));
29088
+ return concatBytes(bytes3);
29086
29089
  };
29087
29090
  var HexCharacters = "0123456789abcdef";
29088
29091
  function hexlify(data) {
29089
- const bytes2 = arrayify(data);
29092
+ const bytes3 = arrayify(data);
29090
29093
  let result = "0x";
29091
- for (let i = 0; i < bytes2.length; i++) {
29092
- const v = bytes2[i];
29094
+ for (let i = 0; i < bytes3.length; i++) {
29095
+ const v = bytes3[i];
29093
29096
  result += HexCharacters[(v & 240) >> 4] + HexCharacters[v & 15];
29094
29097
  }
29095
29098
  return result;
@@ -29182,15 +29185,15 @@ If you are attempting to transform a hex value, please make sure it is being pas
29182
29185
  return bn(result);
29183
29186
  }
29184
29187
  function encodeBase58(_value) {
29185
- const bytes2 = arrayify(_value);
29186
- let value = bn(bytes2);
29188
+ const bytes3 = arrayify(_value);
29189
+ let value = bn(bytes3);
29187
29190
  let result = "";
29188
29191
  while (value.gt(BN_0)) {
29189
29192
  result = Alphabet[Number(value.mod(BN_58))] + result;
29190
29193
  value = value.div(BN_58);
29191
29194
  }
29192
- for (let i = 0; i < bytes2.length; i++) {
29193
- if (bytes2[i]) {
29195
+ for (let i = 0; i < bytes3.length; i++) {
29196
+ if (bytes3[i]) {
29194
29197
  break;
29195
29198
  }
29196
29199
  result = Alphabet[0] + result;
@@ -29206,11 +29209,11 @@ If you are attempting to transform a hex value, please make sure it is being pas
29206
29209
  return result;
29207
29210
  }
29208
29211
  function dataSlice(data, start, end) {
29209
- const bytes2 = arrayify(data);
29210
- if (end != null && end > bytes2.length) {
29212
+ const bytes3 = arrayify(data);
29213
+ if (end != null && end > bytes3.length) {
29211
29214
  throw new FuelError(ErrorCode.INVALID_DATA, "cannot slice beyond data bounds");
29212
29215
  }
29213
- return hexlify(bytes2.slice(start == null ? 0 : start, end == null ? bytes2.length : end));
29216
+ return hexlify(bytes3.slice(start == null ? 0 : start, end == null ? bytes3.length : end));
29214
29217
  }
29215
29218
  function toUtf8Bytes(stri, form = true) {
29216
29219
  let str = stri;
@@ -29247,8 +29250,8 @@ If you are attempting to transform a hex value, please make sure it is being pas
29247
29250
  }
29248
29251
  return new Uint8Array(result);
29249
29252
  }
29250
- function onError(reason, offset, bytes2, output2, badCodepoint) {
29251
- console.log(`invalid codepoint at offset ${offset}; ${reason}, bytes: ${bytes2}`);
29253
+ function onError(reason, offset, bytes3, output3, badCodepoint) {
29254
+ console.log(`invalid codepoint at offset ${offset}; ${reason}, bytes: ${bytes3}`);
29252
29255
  return offset;
29253
29256
  }
29254
29257
  function helper(codePoints) {
@@ -29264,11 +29267,11 @@ If you are attempting to transform a hex value, please make sure it is being pas
29264
29267
  }).join("");
29265
29268
  }
29266
29269
  function getUtf8CodePoints(_bytes) {
29267
- const bytes2 = arrayify(_bytes, "bytes");
29270
+ const bytes3 = arrayify(_bytes, "bytes");
29268
29271
  const result = [];
29269
29272
  let i = 0;
29270
- while (i < bytes2.length) {
29271
- const c = bytes2[i++];
29273
+ while (i < bytes3.length) {
29274
+ const c = bytes3[i++];
29272
29275
  if (c >> 7 === 0) {
29273
29276
  result.push(c);
29274
29277
  continue;
@@ -29286,21 +29289,21 @@ If you are attempting to transform a hex value, please make sure it is being pas
29286
29289
  overlongMask = 65535;
29287
29290
  } else {
29288
29291
  if ((c & 192) === 128) {
29289
- i += onError("UNEXPECTED_CONTINUE", i - 1, bytes2, result);
29292
+ i += onError("UNEXPECTED_CONTINUE", i - 1, bytes3, result);
29290
29293
  } else {
29291
- i += onError("BAD_PREFIX", i - 1, bytes2, result);
29294
+ i += onError("BAD_PREFIX", i - 1, bytes3, result);
29292
29295
  }
29293
29296
  continue;
29294
29297
  }
29295
- if (i - 1 + extraLength >= bytes2.length) {
29296
- i += onError("OVERRUN", i - 1, bytes2, result);
29298
+ if (i - 1 + extraLength >= bytes3.length) {
29299
+ i += onError("OVERRUN", i - 1, bytes3, result);
29297
29300
  continue;
29298
29301
  }
29299
29302
  let res = c & (1 << 8 - extraLength - 1) - 1;
29300
29303
  for (let j = 0; j < extraLength; j++) {
29301
- const nextChar = bytes2[i];
29304
+ const nextChar = bytes3[i];
29302
29305
  if ((nextChar & 192) !== 128) {
29303
- i += onError("MISSING_CONTINUE", i, bytes2, result);
29306
+ i += onError("MISSING_CONTINUE", i, bytes3, result);
29304
29307
  res = null;
29305
29308
  break;
29306
29309
  }
@@ -29311,23 +29314,23 @@ If you are attempting to transform a hex value, please make sure it is being pas
29311
29314
  continue;
29312
29315
  }
29313
29316
  if (res > 1114111) {
29314
- i += onError("OUT_OF_RANGE", i - 1 - extraLength, bytes2, result, res);
29317
+ i += onError("OUT_OF_RANGE", i - 1 - extraLength, bytes3, result, res);
29315
29318
  continue;
29316
29319
  }
29317
29320
  if (res >= 55296 && res <= 57343) {
29318
- i += onError("UTF16_SURROGATE", i - 1 - extraLength, bytes2, result, res);
29321
+ i += onError("UTF16_SURROGATE", i - 1 - extraLength, bytes3, result, res);
29319
29322
  continue;
29320
29323
  }
29321
29324
  if (res <= overlongMask) {
29322
- i += onError("OVERLONG", i - 1 - extraLength, bytes2, result, res);
29325
+ i += onError("OVERLONG", i - 1 - extraLength, bytes3, result, res);
29323
29326
  continue;
29324
29327
  }
29325
29328
  result.push(res);
29326
29329
  }
29327
29330
  return result;
29328
29331
  }
29329
- function toUtf8String(bytes2) {
29330
- return helper(getUtf8CodePoints(bytes2));
29332
+ function toUtf8String(bytes3) {
29333
+ return helper(getUtf8CodePoints(bytes3));
29331
29334
  }
29332
29335
 
29333
29336
  // ../../node_modules/.pnpm/@noble+hashes@1.3.3/node_modules/@noble/hashes/esm/_assert.js
@@ -29344,11 +29347,11 @@ If you are attempting to transform a hex value, please make sure it is being pas
29344
29347
  if (lengths.length > 0 && !lengths.includes(b.length))
29345
29348
  throw new Error(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`);
29346
29349
  }
29347
- function hash(hash3) {
29348
- if (typeof hash3 !== "function" || typeof hash3.create !== "function")
29350
+ function hash(hash4) {
29351
+ if (typeof hash4 !== "function" || typeof hash4.create !== "function")
29349
29352
  throw new Error("Hash should be wrapped by utils.wrapConstructor");
29350
- number(hash3.outputLen);
29351
- number(hash3.blockLen);
29353
+ number(hash4.outputLen);
29354
+ number(hash4.blockLen);
29352
29355
  }
29353
29356
  function exists(instance, checkFinished = true) {
29354
29357
  if (instance.destroyed)
@@ -29364,10 +29367,6 @@ If you are attempting to transform a hex value, please make sure it is being pas
29364
29367
  }
29365
29368
  }
29366
29369
 
29367
- // ../../node_modules/.pnpm/@noble+hashes@1.3.3/node_modules/@noble/hashes/esm/cryptoNode.js
29368
- var nc = __toESM(__require("crypto"), 1);
29369
- var crypto = nc && typeof nc === "object" && "webcrypto" in nc ? nc.webcrypto : void 0;
29370
-
29371
29370
  // ../../node_modules/.pnpm/@noble+hashes@1.3.3/node_modules/@noble/hashes/esm/utils.js
29372
29371
  var u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
29373
29372
  function isBytes2(a) {
@@ -29390,22 +29389,6 @@ If you are attempting to transform a hex value, please make sure it is being pas
29390
29389
  throw new Error(`expected Uint8Array, got ${typeof data}`);
29391
29390
  return data;
29392
29391
  }
29393
- function concatBytes2(...arrays) {
29394
- let sum = 0;
29395
- for (let i = 0; i < arrays.length; i++) {
29396
- const a = arrays[i];
29397
- if (!isBytes2(a))
29398
- throw new Error("Uint8Array expected");
29399
- sum += a.length;
29400
- }
29401
- const res = new Uint8Array(sum);
29402
- for (let i = 0, pad3 = 0; i < arrays.length; i++) {
29403
- const a = arrays[i];
29404
- res.set(a, pad3);
29405
- pad3 += a.length;
29406
- }
29407
- return res;
29408
- }
29409
29392
  var Hash = class {
29410
29393
  // Safe version that clones internal state
29411
29394
  clone() {
@@ -29435,33 +29418,27 @@ If you are attempting to transform a hex value, please make sure it is being pas
29435
29418
  hashC.create = (opts) => hashCons(opts);
29436
29419
  return hashC;
29437
29420
  }
29438
- function randomBytes(bytesLength = 32) {
29439
- if (crypto && typeof crypto.getRandomValues === "function") {
29440
- return crypto.getRandomValues(new Uint8Array(bytesLength));
29441
- }
29442
- throw new Error("crypto.getRandomValues must be defined");
29443
- }
29444
29421
 
29445
29422
  // ../../node_modules/.pnpm/@noble+hashes@1.3.3/node_modules/@noble/hashes/esm/_sha2.js
29446
- function setBigUint64(view, byteOffset, value, isLE2) {
29423
+ function setBigUint64(view, byteOffset, value, isLE3) {
29447
29424
  if (typeof view.setBigUint64 === "function")
29448
- return view.setBigUint64(byteOffset, value, isLE2);
29425
+ return view.setBigUint64(byteOffset, value, isLE3);
29449
29426
  const _32n2 = BigInt(32);
29450
29427
  const _u32_max = BigInt(4294967295);
29451
29428
  const wh = Number(value >> _32n2 & _u32_max);
29452
29429
  const wl = Number(value & _u32_max);
29453
- const h = isLE2 ? 4 : 0;
29454
- const l = isLE2 ? 0 : 4;
29455
- view.setUint32(byteOffset + h, wh, isLE2);
29456
- view.setUint32(byteOffset + l, wl, isLE2);
29430
+ const h = isLE3 ? 4 : 0;
29431
+ const l = isLE3 ? 0 : 4;
29432
+ view.setUint32(byteOffset + h, wh, isLE3);
29433
+ view.setUint32(byteOffset + l, wl, isLE3);
29457
29434
  }
29458
29435
  var SHA2 = class extends Hash {
29459
- constructor(blockLen, outputLen, padOffset, isLE2) {
29436
+ constructor(blockLen, outputLen, padOffset, isLE3) {
29460
29437
  super();
29461
29438
  this.blockLen = blockLen;
29462
29439
  this.outputLen = outputLen;
29463
29440
  this.padOffset = padOffset;
29464
- this.isLE = isLE2;
29441
+ this.isLE = isLE3;
29465
29442
  this.finished = false;
29466
29443
  this.length = 0;
29467
29444
  this.pos = 0;
@@ -29498,7 +29475,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
29498
29475
  exists(this);
29499
29476
  output(out, this);
29500
29477
  this.finished = true;
29501
- const { buffer, view, blockLen, isLE: isLE2 } = this;
29478
+ const { buffer, view, blockLen, isLE: isLE3 } = this;
29502
29479
  let { pos } = this;
29503
29480
  buffer[pos++] = 128;
29504
29481
  this.buffer.subarray(pos).fill(0);
@@ -29508,7 +29485,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
29508
29485
  }
29509
29486
  for (let i = pos; i < blockLen; i++)
29510
29487
  buffer[i] = 0;
29511
- setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE2);
29488
+ setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE3);
29512
29489
  this.process(view, 0);
29513
29490
  const oview = createView(out);
29514
29491
  const len = this.outputLen;
@@ -29519,7 +29496,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
29519
29496
  if (outLen > state.length)
29520
29497
  throw new Error("_sha2: outputLen bigger than state");
29521
29498
  for (let i = 0; i < outLen; i++)
29522
- oview.setUint32(4 * i, state[i], isLE2);
29499
+ oview.setUint32(4 * i, state[i], isLE3);
29523
29500
  }
29524
29501
  digest() {
29525
29502
  const { buffer, outputLen } = this;
@@ -29696,24 +29673,24 @@ If you are attempting to transform a hex value, please make sure it is being pas
29696
29673
 
29697
29674
  // ../../node_modules/.pnpm/@noble+hashes@1.3.3/node_modules/@noble/hashes/esm/hmac.js
29698
29675
  var HMAC = class extends Hash {
29699
- constructor(hash3, _key) {
29676
+ constructor(hash4, _key) {
29700
29677
  super();
29701
29678
  this.finished = false;
29702
29679
  this.destroyed = false;
29703
- hash(hash3);
29680
+ hash(hash4);
29704
29681
  const key = toBytes2(_key);
29705
- this.iHash = hash3.create();
29682
+ this.iHash = hash4.create();
29706
29683
  if (typeof this.iHash.update !== "function")
29707
29684
  throw new Error("Expected instance of class which extends utils.Hash");
29708
29685
  this.blockLen = this.iHash.blockLen;
29709
29686
  this.outputLen = this.iHash.outputLen;
29710
29687
  const blockLen = this.blockLen;
29711
29688
  const pad3 = new Uint8Array(blockLen);
29712
- pad3.set(key.length > blockLen ? hash3.create().update(key).digest() : key);
29689
+ pad3.set(key.length > blockLen ? hash4.create().update(key).digest() : key);
29713
29690
  for (let i = 0; i < pad3.length; i++)
29714
29691
  pad3[i] ^= 54;
29715
29692
  this.iHash.update(pad3);
29716
- this.oHash = hash3.create();
29693
+ this.oHash = hash4.create();
29717
29694
  for (let i = 0; i < pad3.length; i++)
29718
29695
  pad3[i] ^= 54 ^ 92;
29719
29696
  this.oHash.update(pad3);
@@ -29756,12 +29733,12 @@ If you are attempting to transform a hex value, please make sure it is being pas
29756
29733
  this.iHash.destroy();
29757
29734
  }
29758
29735
  };
29759
- var hmac = (hash3, key, message) => new HMAC(hash3, key).update(message).digest();
29760
- hmac.create = (hash3, key) => new HMAC(hash3, key);
29736
+ var hmac = (hash4, key, message) => new HMAC(hash4, key).update(message).digest();
29737
+ hmac.create = (hash4, key) => new HMAC(hash4, key);
29761
29738
 
29762
29739
  // ../../node_modules/.pnpm/@noble+hashes@1.3.3/node_modules/@noble/hashes/esm/pbkdf2.js
29763
- function pbkdf2Init(hash3, _password, _salt, _opts) {
29764
- hash(hash3);
29740
+ function pbkdf2Init(hash4, _password, _salt, _opts) {
29741
+ hash(hash4);
29765
29742
  const opts = checkOpts({ dkLen: 32, asyncTick: 10 }, _opts);
29766
29743
  const { c, dkLen, asyncTick } = opts;
29767
29744
  number(c);
@@ -29772,7 +29749,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
29772
29749
  const password = toBytes2(_password);
29773
29750
  const salt = toBytes2(_salt);
29774
29751
  const DK = new Uint8Array(dkLen);
29775
- const PRF = hmac.create(hash3, password);
29752
+ const PRF = hmac.create(hash4, password);
29776
29753
  const PRFSalt = PRF._cloneInto().update(salt);
29777
29754
  return { c, dkLen, asyncTick, DK, PRF, PRFSalt };
29778
29755
  }
@@ -29784,8 +29761,8 @@ If you are attempting to transform a hex value, please make sure it is being pas
29784
29761
  u.fill(0);
29785
29762
  return DK;
29786
29763
  }
29787
- function pbkdf2(hash3, password, salt, opts) {
29788
- const { c, dkLen, DK, PRF, PRFSalt } = pbkdf2Init(hash3, password, salt, opts);
29764
+ function pbkdf2(hash4, password, salt, opts) {
29765
+ const { c, dkLen, DK, PRF, PRFSalt } = pbkdf2Init(hash4, password, salt, opts);
29789
29766
  let prfW;
29790
29767
  const arr = new Uint8Array(4);
29791
29768
  const view = createView(arr);
@@ -30112,9 +30089,9 @@ If you are attempting to transform a hex value, please make sure it is being pas
30112
30089
  throw new Error("XOF is not possible for this instance");
30113
30090
  return this.writeInto(out);
30114
30091
  }
30115
- xof(bytes2) {
30116
- number(bytes2);
30117
- return this.xofInto(new Uint8Array(bytes2));
30092
+ xof(bytes3) {
30093
+ number(bytes3);
30094
+ return this.xofInto(new Uint8Array(bytes3));
30118
30095
  }
30119
30096
  digestInto(out) {
30120
30097
  output(out, this);
@@ -30257,11 +30234,11 @@ If you are attempting to transform a hex value, please make sure it is being pas
30257
30234
  var ripemd160 = /* @__PURE__ */ wrapConstructor(() => new RIPEMD160());
30258
30235
 
30259
30236
  // ../crypto/dist/index.mjs
30260
- var import_crypto2 = __toESM(__require("crypto"), 1);
30261
- var import_crypto3 = __require("crypto");
30237
+ var import_crypto = __toESM(__require("crypto"), 1);
30238
+ var import_crypto2 = __require("crypto");
30239
+ var import_crypto3 = __toESM(__require("crypto"), 1);
30262
30240
  var import_crypto4 = __toESM(__require("crypto"), 1);
30263
- var import_crypto5 = __toESM(__require("crypto"), 1);
30264
- var import_crypto6 = __require("crypto");
30241
+ var import_crypto5 = __require("crypto");
30265
30242
  var scrypt2 = (params) => {
30266
30243
  const { password, salt, n, p, r, dklen } = params;
30267
30244
  const derivedKey = scrypt(password, salt, { N: n, r, p, dkLen: dklen });
@@ -30288,7 +30265,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
30288
30265
  Object.freeze(ripemd1602);
30289
30266
  var bufferFromString = (string, encoding = "base64") => Uint8Array.from(Buffer.from(string, encoding));
30290
30267
  var locked2 = false;
30291
- var PBKDF2 = (password, salt, iterations, keylen, algo) => (0, import_crypto3.pbkdf2Sync)(password, salt, iterations, keylen, algo);
30268
+ var PBKDF2 = (password, salt, iterations, keylen, algo) => (0, import_crypto2.pbkdf2Sync)(password, salt, iterations, keylen, algo);
30292
30269
  var pBkdf2 = PBKDF2;
30293
30270
  function pbkdf22(_password, _salt, iterations, keylen, algo) {
30294
30271
  const password = arrayify(_password, "password");
@@ -30306,8 +30283,8 @@ If you are attempting to transform a hex value, please make sure it is being pas
30306
30283
  pBkdf2 = func;
30307
30284
  };
30308
30285
  Object.freeze(pbkdf22);
30309
- var randomBytes2 = (length) => {
30310
- const randomValues = Uint8Array.from(import_crypto4.default.randomBytes(length));
30286
+ var randomBytes = (length) => {
30287
+ const randomValues = Uint8Array.from(import_crypto3.default.randomBytes(length));
30311
30288
  return randomValues;
30312
30289
  };
30313
30290
  var stringFromBuffer = (buffer, encoding = "base64") => Buffer.from(buffer).toString(encoding);
@@ -30318,11 +30295,11 @@ If you are attempting to transform a hex value, please make sure it is being pas
30318
30295
  return arrayify(key);
30319
30296
  };
30320
30297
  var encrypt = async (password, data) => {
30321
- const iv = randomBytes2(16);
30322
- const salt = randomBytes2(32);
30298
+ const iv = randomBytes(16);
30299
+ const salt = randomBytes(32);
30323
30300
  const secret = keyFromPassword(password, salt);
30324
30301
  const dataBuffer = Uint8Array.from(Buffer.from(JSON.stringify(data), "utf-8"));
30325
- const cipher = await import_crypto2.default.createCipheriv(ALGORITHM, secret, iv);
30302
+ const cipher = await import_crypto.default.createCipheriv(ALGORITHM, secret, iv);
30326
30303
  let cipherData = cipher.update(dataBuffer);
30327
30304
  cipherData = Buffer.concat([cipherData, cipher.final()]);
30328
30305
  return {
@@ -30336,7 +30313,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
30336
30313
  const salt = bufferFromString(keystore.salt);
30337
30314
  const secret = keyFromPassword(password, salt);
30338
30315
  const encryptedText = bufferFromString(keystore.data);
30339
- const decipher = await import_crypto2.default.createDecipheriv(ALGORITHM, secret, iv);
30316
+ const decipher = await import_crypto.default.createDecipheriv(ALGORITHM, secret, iv);
30340
30317
  const decrypted = decipher.update(encryptedText);
30341
30318
  const deBuff = Buffer.concat([decrypted, decipher.final()]);
30342
30319
  const decryptedData = Buffer.from(deBuff).toString("utf-8");
@@ -30347,17 +30324,17 @@ If you are attempting to transform a hex value, please make sure it is being pas
30347
30324
  }
30348
30325
  };
30349
30326
  async function encryptJsonWalletData(data, key, iv) {
30350
- const cipher = await import_crypto5.default.createCipheriv("aes-128-ctr", key.subarray(0, 16), iv);
30327
+ const cipher = await import_crypto4.default.createCipheriv("aes-128-ctr", key.subarray(0, 16), iv);
30351
30328
  const encrypted = Buffer.concat([cipher.update(data), cipher.final()]);
30352
30329
  return new Uint8Array(encrypted);
30353
30330
  }
30354
30331
  async function decryptJsonWalletData(data, key, iv) {
30355
- const decipher = import_crypto5.default.createDecipheriv("aes-128-ctr", key.subarray(0, 16), iv);
30332
+ const decipher = import_crypto4.default.createDecipheriv("aes-128-ctr", key.subarray(0, 16), iv);
30356
30333
  const decrypted = await Buffer.concat([decipher.update(data), decipher.final()]);
30357
30334
  return new Uint8Array(decrypted);
30358
30335
  }
30359
30336
  var locked3 = false;
30360
- var COMPUTEHMAC = (algorithm, key, data) => (0, import_crypto6.createHmac)(algorithm, key).update(data).digest();
30337
+ var COMPUTEHMAC = (algorithm, key, data) => (0, import_crypto5.createHmac)(algorithm, key).update(data).digest();
30361
30338
  var computeHMAC = COMPUTEHMAC;
30362
30339
  function computeHmac(algorithm, _key, _data) {
30363
30340
  const key = arrayify(_key, "key");
@@ -30381,7 +30358,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
30381
30358
  decrypt,
30382
30359
  encrypt,
30383
30360
  keyFromPassword,
30384
- randomBytes: randomBytes2,
30361
+ randomBytes,
30385
30362
  scrypt: scrypt2,
30386
30363
  keccak256,
30387
30364
  decryptJsonWalletData,
@@ -30396,7 +30373,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
30396
30373
  decrypt: decrypt2,
30397
30374
  encrypt: encrypt2,
30398
30375
  keyFromPassword: keyFromPassword2,
30399
- randomBytes: randomBytes22,
30376
+ randomBytes: randomBytes2,
30400
30377
  stringFromBuffer: stringFromBuffer2,
30401
30378
  scrypt: scrypt22,
30402
30379
  keccak256: keccak2562,
@@ -30574,15 +30551,15 @@ If you are attempting to transform a hex value, please make sure it is being pas
30574
30551
  if (data.length < this.encodedLength) {
30575
30552
  throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid b256 data size.`);
30576
30553
  }
30577
- let bytes2 = data.slice(offset, offset + this.encodedLength);
30578
- const decoded = bn(bytes2);
30554
+ let bytes3 = data.slice(offset, offset + this.encodedLength);
30555
+ const decoded = bn(bytes3);
30579
30556
  if (decoded.isZero()) {
30580
- bytes2 = new Uint8Array(32);
30557
+ bytes3 = new Uint8Array(32);
30581
30558
  }
30582
- if (bytes2.length !== this.encodedLength) {
30559
+ if (bytes3.length !== this.encodedLength) {
30583
30560
  throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid b256 byte data size.`);
30584
30561
  }
30585
- return [toHex(bytes2, 32), offset + 32];
30562
+ return [toHex(bytes3, 32), offset + 32];
30586
30563
  }
30587
30564
  };
30588
30565
  var B512Coder = class extends Coder {
@@ -30605,15 +30582,15 @@ If you are attempting to transform a hex value, please make sure it is being pas
30605
30582
  if (data.length < this.encodedLength) {
30606
30583
  throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid b512 data size.`);
30607
30584
  }
30608
- let bytes2 = data.slice(offset, offset + this.encodedLength);
30609
- const decoded = bn(bytes2);
30585
+ let bytes3 = data.slice(offset, offset + this.encodedLength);
30586
+ const decoded = bn(bytes3);
30610
30587
  if (decoded.isZero()) {
30611
- bytes2 = new Uint8Array(64);
30588
+ bytes3 = new Uint8Array(64);
30612
30589
  }
30613
- if (bytes2.length !== this.encodedLength) {
30590
+ if (bytes3.length !== this.encodedLength) {
30614
30591
  throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid b512 byte data size.`);
30615
30592
  }
30616
- return [toHex(bytes2, this.encodedLength), offset + this.encodedLength];
30593
+ return [toHex(bytes3, this.encodedLength), offset + this.encodedLength];
30617
30594
  }
30618
30595
  };
30619
30596
  var encodedLengths = {
@@ -30625,24 +30602,24 @@ If you are attempting to transform a hex value, please make sure it is being pas
30625
30602
  super("bigNumber", baseType, encodedLengths[baseType]);
30626
30603
  }
30627
30604
  encode(value) {
30628
- let bytes2;
30605
+ let bytes3;
30629
30606
  try {
30630
- bytes2 = toBytes(value, this.encodedLength);
30607
+ bytes3 = toBytes(value, this.encodedLength);
30631
30608
  } catch (error) {
30632
30609
  throw new FuelError(ErrorCode.ENCODE_ERROR, `Invalid ${this.type}.`);
30633
30610
  }
30634
- return bytes2;
30611
+ return bytes3;
30635
30612
  }
30636
30613
  decode(data, offset) {
30637
30614
  if (data.length < this.encodedLength) {
30638
30615
  throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid ${this.type} data size.`);
30639
30616
  }
30640
- let bytes2 = data.slice(offset, offset + this.encodedLength);
30641
- bytes2 = bytes2.slice(0, this.encodedLength);
30642
- if (bytes2.length !== this.encodedLength) {
30617
+ let bytes3 = data.slice(offset, offset + this.encodedLength);
30618
+ bytes3 = bytes3.slice(0, this.encodedLength);
30619
+ if (bytes3.length !== this.encodedLength) {
30643
30620
  throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid ${this.type} byte data size.`);
30644
30621
  }
30645
- return [bn(bytes2), offset + this.encodedLength];
30622
+ return [bn(bytes3), offset + this.encodedLength];
30646
30623
  }
30647
30624
  };
30648
30625
  var BooleanCoder = class extends Coder {
@@ -30665,11 +30642,11 @@ If you are attempting to transform a hex value, please make sure it is being pas
30665
30642
  if (data.length < this.encodedLength) {
30666
30643
  throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid boolean data size.`);
30667
30644
  }
30668
- const bytes2 = bn(data.slice(offset, offset + this.encodedLength));
30669
- if (bytes2.isZero()) {
30645
+ const bytes3 = bn(data.slice(offset, offset + this.encodedLength));
30646
+ if (bytes3.isZero()) {
30670
30647
  return [false, offset + this.encodedLength];
30671
30648
  }
30672
- if (!bytes2.eq(bn(1))) {
30649
+ if (!bytes3.eq(bn(1))) {
30673
30650
  throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid boolean value.`);
30674
30651
  }
30675
30652
  return [true, offset + this.encodedLength];
@@ -30680,9 +30657,9 @@ If you are attempting to transform a hex value, please make sure it is being pas
30680
30657
  super("struct", "struct Bytes", WORD_SIZE);
30681
30658
  }
30682
30659
  encode(value) {
30683
- const bytes2 = value instanceof Uint8Array ? value : new Uint8Array(value);
30684
- const lengthBytes = new BigNumberCoder("u64").encode(bytes2.length);
30685
- return new Uint8Array([...lengthBytes, ...bytes2]);
30660
+ const bytes3 = value instanceof Uint8Array ? value : new Uint8Array(value);
30661
+ const lengthBytes = new BigNumberCoder("u64").encode(bytes3.length);
30662
+ return new Uint8Array([...lengthBytes, ...bytes3]);
30686
30663
  }
30687
30664
  decode(data, offset) {
30688
30665
  if (data.length < WORD_SIZE) {
@@ -30809,26 +30786,26 @@ If you are attempting to transform a hex value, please make sure it is being pas
30809
30786
  this.options = options;
30810
30787
  }
30811
30788
  encode(value) {
30812
- let bytes2;
30789
+ let bytes3;
30813
30790
  try {
30814
- bytes2 = toBytes(value);
30791
+ bytes3 = toBytes(value);
30815
30792
  } catch (error) {
30816
30793
  throw new FuelError(ErrorCode.ENCODE_ERROR, `Invalid ${this.baseType}.`);
30817
30794
  }
30818
- if (bytes2.length > this.encodedLength) {
30795
+ if (bytes3.length > this.encodedLength) {
30819
30796
  throw new FuelError(ErrorCode.ENCODE_ERROR, `Invalid ${this.baseType}, too many bytes.`);
30820
30797
  }
30821
- return toBytes(bytes2, this.encodedLength);
30798
+ return toBytes(bytes3, this.encodedLength);
30822
30799
  }
30823
30800
  decode(data, offset) {
30824
30801
  if (data.length < this.encodedLength) {
30825
30802
  throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid number data size.`);
30826
30803
  }
30827
- const bytes2 = data.slice(offset, offset + this.encodedLength);
30828
- if (bytes2.length !== this.encodedLength) {
30804
+ const bytes3 = data.slice(offset, offset + this.encodedLength);
30805
+ if (bytes3.length !== this.encodedLength) {
30829
30806
  throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid number byte data size.`);
30830
30807
  }
30831
- return [toNumber(bytes2), offset + this.encodedLength];
30808
+ return [toNumber(bytes3), offset + this.encodedLength];
30832
30809
  }
30833
30810
  };
30834
30811
  var OptionCoder = class extends EnumCoder {
@@ -30846,9 +30823,9 @@ If you are attempting to transform a hex value, please make sure it is being pas
30846
30823
  const [decoded, newOffset] = super.decode(data, offset);
30847
30824
  return [this.toOption(decoded), newOffset];
30848
30825
  }
30849
- toOption(output2) {
30850
- if (output2 && "Some" in output2) {
30851
- return output2.Some;
30826
+ toOption(output3) {
30827
+ if (output3 && "Some" in output3) {
30828
+ return output3.Some;
30852
30829
  }
30853
30830
  return void 0;
30854
30831
  }
@@ -30862,9 +30839,9 @@ If you are attempting to transform a hex value, please make sure it is being pas
30862
30839
  throw new FuelError(ErrorCode.ENCODE_ERROR, `Expected array value.`);
30863
30840
  }
30864
30841
  const internalCoder = new ArrayCoder(new NumberCoder("u8"), value.length);
30865
- const bytes2 = internalCoder.encode(value);
30866
- const lengthBytes = new BigNumberCoder("u64").encode(bytes2.length);
30867
- return new Uint8Array([...lengthBytes, ...bytes2]);
30842
+ const bytes3 = internalCoder.encode(value);
30843
+ const lengthBytes = new BigNumberCoder("u64").encode(bytes3.length);
30844
+ return new Uint8Array([...lengthBytes, ...bytes3]);
30868
30845
  }
30869
30846
  decode(data, offset) {
30870
30847
  if (data.length < this.encodedLength) {
@@ -30887,9 +30864,9 @@ If you are attempting to transform a hex value, please make sure it is being pas
30887
30864
  super("struct", "struct String", WORD_SIZE);
30888
30865
  }
30889
30866
  encode(value) {
30890
- const bytes2 = toUtf8Bytes(value);
30867
+ const bytes3 = toUtf8Bytes(value);
30891
30868
  const lengthBytes = new BigNumberCoder("u64").encode(value.length);
30892
- return new Uint8Array([...lengthBytes, ...bytes2]);
30869
+ return new Uint8Array([...lengthBytes, ...bytes3]);
30893
30870
  }
30894
30871
  decode(data, offset) {
30895
30872
  if (data.length < this.encodedLength) {
@@ -30911,9 +30888,9 @@ If you are attempting to transform a hex value, please make sure it is being pas
30911
30888
  super("strSlice", "str", WORD_SIZE);
30912
30889
  }
30913
30890
  encode(value) {
30914
- const bytes2 = toUtf8Bytes(value);
30891
+ const bytes3 = toUtf8Bytes(value);
30915
30892
  const lengthBytes = new BigNumberCoder("u64").encode(value.length);
30916
- return new Uint8Array([...lengthBytes, ...bytes2]);
30893
+ return new Uint8Array([...lengthBytes, ...bytes3]);
30917
30894
  }
30918
30895
  decode(data, offset) {
30919
30896
  if (data.length < this.encodedLength) {
@@ -30922,11 +30899,11 @@ If you are attempting to transform a hex value, please make sure it is being pas
30922
30899
  const offsetAndLength = offset + WORD_SIZE;
30923
30900
  const lengthBytes = data.slice(offset, offsetAndLength);
30924
30901
  const length = bn(new BigNumberCoder("u64").decode(lengthBytes, 0)[0]).toNumber();
30925
- const bytes2 = data.slice(offsetAndLength, offsetAndLength + length);
30926
- if (bytes2.length !== length) {
30902
+ const bytes3 = data.slice(offsetAndLength, offsetAndLength + length);
30903
+ if (bytes3.length !== length) {
30927
30904
  throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid string slice byte data size.`);
30928
30905
  }
30929
- return [toUtf8String(bytes2), offsetAndLength + length];
30906
+ return [toUtf8String(bytes3), offsetAndLength + length];
30930
30907
  }
30931
30908
  };
30932
30909
  __publicField4(StrSliceCoder, "memorySize", 1);
@@ -30944,11 +30921,11 @@ If you are attempting to transform a hex value, please make sure it is being pas
30944
30921
  if (data.length < this.encodedLength) {
30945
30922
  throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid string data size.`);
30946
30923
  }
30947
- const bytes2 = data.slice(offset, offset + this.encodedLength);
30948
- if (bytes2.length !== this.encodedLength) {
30924
+ const bytes3 = data.slice(offset, offset + this.encodedLength);
30925
+ if (bytes3.length !== this.encodedLength) {
30949
30926
  throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid string byte data size.`);
30950
30927
  }
30951
- return [toUtf8String(bytes2), offset + this.encodedLength];
30928
+ return [toUtf8String(bytes3), offset + this.encodedLength];
30952
30929
  }
30953
30930
  };
30954
30931
  var StructCoder = class extends Coder {
@@ -31042,9 +31019,9 @@ If you are attempting to transform a hex value, please make sure it is being pas
31042
31019
  if (isUint8Array(value)) {
31043
31020
  return new Uint8Array([...lengthCoder.encode(value.length), ...value]);
31044
31021
  }
31045
- const bytes2 = value.map((v) => this.coder.encode(v));
31022
+ const bytes3 = value.map((v) => this.coder.encode(v));
31046
31023
  const lengthBytes = lengthCoder.encode(value.length);
31047
- return new Uint8Array([...lengthBytes, ...concatBytes(bytes2)]);
31024
+ return new Uint8Array([...lengthBytes, ...concatBytes(bytes3)]);
31048
31025
  }
31049
31026
  decode(data, offset) {
31050
31027
  if (!this.#hasNestedOption && data.length < this.encodedLength || data.length > MAX_BYTES) {
@@ -31423,10 +31400,10 @@ If you are attempting to transform a hex value, please make sure it is being pas
31423
31400
  throw new FuelError(ErrorCode.ABI_TYPES_AND_VALUES_MISMATCH, errorMsg);
31424
31401
  }
31425
31402
  decodeArguments(data) {
31426
- const bytes2 = arrayify(data);
31403
+ const bytes3 = arrayify(data);
31427
31404
  const nonEmptyInputs = findNonEmptyInputs(this.jsonAbi, this.jsonFn.inputs);
31428
31405
  if (nonEmptyInputs.length === 0) {
31429
- if (bytes2.length === 0) {
31406
+ if (bytes3.length === 0) {
31430
31407
  return void 0;
31431
31408
  }
31432
31409
  throw new FuelError(
@@ -31435,12 +31412,12 @@ If you are attempting to transform a hex value, please make sure it is being pas
31435
31412
  count: {
31436
31413
  types: this.jsonFn.inputs.length,
31437
31414
  nonEmptyInputs: nonEmptyInputs.length,
31438
- values: bytes2.length
31415
+ values: bytes3.length
31439
31416
  },
31440
31417
  value: {
31441
31418
  args: this.jsonFn.inputs,
31442
31419
  nonEmptyInputs,
31443
- values: bytes2
31420
+ values: bytes3
31444
31421
  }
31445
31422
  })}`
31446
31423
  );
@@ -31448,7 +31425,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
31448
31425
  const result = nonEmptyInputs.reduce(
31449
31426
  (obj, input) => {
31450
31427
  const coder = AbiCoder.getCoder(this.jsonAbi, input, { encoding: this.encoding });
31451
- const [decodedValue, decodedValueByteSize] = coder.decode(bytes2, obj.offset);
31428
+ const [decodedValue, decodedValueByteSize] = coder.decode(bytes3, obj.offset);
31452
31429
  return {
31453
31430
  decoded: [...obj.decoded, decodedValue],
31454
31431
  offset: obj.offset + decodedValueByteSize
@@ -31463,11 +31440,11 @@ If you are attempting to transform a hex value, please make sure it is being pas
31463
31440
  if (outputAbiType.type === "()") {
31464
31441
  return [void 0, 0];
31465
31442
  }
31466
- const bytes2 = arrayify(data);
31443
+ const bytes3 = arrayify(data);
31467
31444
  const coder = AbiCoder.getCoder(this.jsonAbi, this.jsonFn.output, {
31468
31445
  encoding: this.encoding
31469
31446
  });
31470
- return coder.decode(bytes2, 0);
31447
+ return coder.decode(bytes3, 0);
31471
31448
  }
31472
31449
  /**
31473
31450
  * Checks if the function is read-only i.e. it only reads from storage, does not write to it.
@@ -31601,9 +31578,9 @@ If you are attempting to transform a hex value, please make sure it is being pas
31601
31578
  }
31602
31579
  return addressLike;
31603
31580
  };
31604
- var getRandomB256 = () => hexlify(randomBytes22(32));
31581
+ var getRandomB256 = () => hexlify(randomBytes2(32));
31605
31582
  var clearFirst12BytesFromB256 = (b256) => {
31606
- let bytes2;
31583
+ let bytes3;
31607
31584
  try {
31608
31585
  if (!isB256(b256)) {
31609
31586
  throw new FuelError(
@@ -31611,15 +31588,15 @@ If you are attempting to transform a hex value, please make sure it is being pas
31611
31588
  `Invalid Bech32 Address: ${b256}.`
31612
31589
  );
31613
31590
  }
31614
- bytes2 = getBytesFromBech32(toBech32(b256));
31615
- bytes2 = hexlify(bytes2.fill(0, 0, 12));
31591
+ bytes3 = getBytesFromBech32(toBech32(b256));
31592
+ bytes3 = hexlify(bytes3.fill(0, 0, 12));
31616
31593
  } catch (error) {
31617
31594
  throw new FuelError(
31618
31595
  FuelError.CODES.PARSE_FAILED,
31619
31596
  `Cannot generate EVM Address B256 from: ${b256}.`
31620
31597
  );
31621
31598
  }
31622
- return bytes2;
31599
+ return bytes3;
31623
31600
  };
31624
31601
  var padFirst12BytesOfEvmAddress = (address) => {
31625
31602
  if (!isEvmAddress(address)) {
@@ -32193,9 +32170,9 @@ If you are attempting to transform a hex value, please make sure it is being pas
32193
32170
  return sha2562(concat(parts));
32194
32171
  }
32195
32172
  static encodeData(messageData) {
32196
- const bytes2 = arrayify(messageData || "0x");
32197
- const dataLength = bytes2.length;
32198
- return new ByteArrayCoder(dataLength).encode(bytes2);
32173
+ const bytes3 = arrayify(messageData || "0x");
32174
+ const dataLength = bytes3.length;
32175
+ return new ByteArrayCoder(dataLength).encode(bytes3);
32199
32176
  }
32200
32177
  encode(value) {
32201
32178
  const parts = [];
@@ -32217,9 +32194,9 @@ If you are attempting to transform a hex value, please make sure it is being pas
32217
32194
  return concat(parts);
32218
32195
  }
32219
32196
  static decodeData(messageData) {
32220
- const bytes2 = arrayify(messageData);
32221
- const dataLength = bytes2.length;
32222
- const [data] = new ByteArrayCoder(dataLength).decode(bytes2, 0);
32197
+ const bytes3 = arrayify(messageData);
32198
+ const dataLength = bytes3.length;
32199
+ const [data] = new ByteArrayCoder(dataLength).decode(bytes3, 0);
32223
32200
  return arrayify(data);
32224
32201
  }
32225
32202
  decode(data, offset) {
@@ -33299,9 +33276,10 @@ If you are attempting to transform a hex value, please make sure it is being pas
33299
33276
  }
33300
33277
  };
33301
33278
 
33302
- // ../../node_modules/.pnpm/@noble+curves@1.3.0/node_modules/@noble/curves/esm/abstract/utils.js
33279
+ // ../../node_modules/.pnpm/@noble+curves@1.4.0/node_modules/@noble/curves/esm/abstract/utils.js
33303
33280
  var utils_exports = {};
33304
33281
  __export(utils_exports, {
33282
+ abytes: () => abytes,
33305
33283
  bitGet: () => bitGet,
33306
33284
  bitLen: () => bitLen,
33307
33285
  bitMask: () => bitMask,
@@ -33309,7 +33287,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
33309
33287
  bytesToHex: () => bytesToHex,
33310
33288
  bytesToNumberBE: () => bytesToNumberBE,
33311
33289
  bytesToNumberLE: () => bytesToNumberLE,
33312
- concatBytes: () => concatBytes3,
33290
+ concatBytes: () => concatBytes2,
33313
33291
  createHmacDrbg: () => createHmacDrbg,
33314
33292
  ensureBytes: () => ensureBytes,
33315
33293
  equalBytes: () => equalBytes,
@@ -33329,13 +33307,16 @@ If you are attempting to transform a hex value, please make sure it is being pas
33329
33307
  function isBytes3(a) {
33330
33308
  return a instanceof Uint8Array || a != null && typeof a === "object" && a.constructor.name === "Uint8Array";
33331
33309
  }
33332
- var hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0"));
33333
- function bytesToHex(bytes2) {
33334
- if (!isBytes3(bytes2))
33310
+ function abytes(item) {
33311
+ if (!isBytes3(item))
33335
33312
  throw new Error("Uint8Array expected");
33313
+ }
33314
+ var hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0"));
33315
+ function bytesToHex(bytes3) {
33316
+ abytes(bytes3);
33336
33317
  let hex = "";
33337
- for (let i = 0; i < bytes2.length; i++) {
33338
- hex += hexes[bytes2[i]];
33318
+ for (let i = 0; i < bytes3.length; i++) {
33319
+ hex += hexes[bytes3[i]];
33339
33320
  }
33340
33321
  return hex;
33341
33322
  }
@@ -33377,13 +33358,12 @@ If you are attempting to transform a hex value, please make sure it is being pas
33377
33358
  }
33378
33359
  return array;
33379
33360
  }
33380
- function bytesToNumberBE(bytes2) {
33381
- return hexToNumber(bytesToHex(bytes2));
33361
+ function bytesToNumberBE(bytes3) {
33362
+ return hexToNumber(bytesToHex(bytes3));
33382
33363
  }
33383
- function bytesToNumberLE(bytes2) {
33384
- if (!isBytes3(bytes2))
33385
- throw new Error("Uint8Array expected");
33386
- return hexToNumber(bytesToHex(Uint8Array.from(bytes2).reverse()));
33364
+ function bytesToNumberLE(bytes3) {
33365
+ abytes(bytes3);
33366
+ return hexToNumber(bytesToHex(Uint8Array.from(bytes3).reverse()));
33387
33367
  }
33388
33368
  function numberToBytesBE(n, len) {
33389
33369
  return hexToBytes(n.toString(16).padStart(len * 2, "0"));
@@ -33412,17 +33392,15 @@ If you are attempting to transform a hex value, please make sure it is being pas
33412
33392
  throw new Error(`${title} expected ${expectedLength} bytes, got ${len}`);
33413
33393
  return res;
33414
33394
  }
33415
- function concatBytes3(...arrays) {
33395
+ function concatBytes2(...arrays) {
33416
33396
  let sum = 0;
33417
33397
  for (let i = 0; i < arrays.length; i++) {
33418
33398
  const a = arrays[i];
33419
- if (!isBytes3(a))
33420
- throw new Error("Uint8Array expected");
33399
+ abytes(a);
33421
33400
  sum += a.length;
33422
33401
  }
33423
- let res = new Uint8Array(sum);
33424
- let pad3 = 0;
33425
- for (let i = 0; i < arrays.length; i++) {
33402
+ const res = new Uint8Array(sum);
33403
+ for (let i = 0, pad3 = 0; i < arrays.length; i++) {
33426
33404
  const a = arrays[i];
33427
33405
  res.set(a, pad3);
33428
33406
  pad3 += a.length;
@@ -33451,9 +33429,9 @@ If you are attempting to transform a hex value, please make sure it is being pas
33451
33429
  function bitGet(n, pos) {
33452
33430
  return n >> BigInt(pos) & _1n2;
33453
33431
  }
33454
- var bitSet = (n, pos, value) => {
33432
+ function bitSet(n, pos, value) {
33455
33433
  return n | (value ? _1n2 : _0n2) << BigInt(pos);
33456
- };
33434
+ }
33457
33435
  var bitMask = (n) => (_2n2 << BigInt(n - 1)) - _1n2;
33458
33436
  var u8n = (data) => new Uint8Array(data);
33459
33437
  var u8fr = (arr) => Uint8Array.from(arr);
@@ -33492,7 +33470,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
33492
33470
  out.push(sl);
33493
33471
  len += v.length;
33494
33472
  }
33495
- return concatBytes3(...out);
33473
+ return concatBytes2(...out);
33496
33474
  };
33497
33475
  const genUntil = (seed, pred) => {
33498
33476
  reset();
@@ -33756,19 +33734,19 @@ If you are attempting to transform a hex value, please make sure it is being pas
33756
33734
  return "GraphQLError";
33757
33735
  }
33758
33736
  toString() {
33759
- let output2 = this.message;
33737
+ let output3 = this.message;
33760
33738
  if (this.nodes) {
33761
33739
  for (const node of this.nodes) {
33762
33740
  if (node.loc) {
33763
- output2 += "\n\n" + printLocation(node.loc);
33741
+ output3 += "\n\n" + printLocation(node.loc);
33764
33742
  }
33765
33743
  }
33766
33744
  } else if (this.source && this.locations) {
33767
33745
  for (const location of this.locations) {
33768
- output2 += "\n\n" + printSourceLocation(this.source, location);
33746
+ output3 += "\n\n" + printSourceLocation(this.source, location);
33769
33747
  }
33770
33748
  }
33771
- return output2;
33749
+ return output3;
33772
33750
  }
33773
33751
  toJSON() {
33774
33752
  const formattedError = {
@@ -37127,6 +37105,12 @@ ${ReceiptFragmentDoc}`;
37127
37105
  alocDependentCost {
37128
37106
  ...DependentCostFragment
37129
37107
  }
37108
+ cfe {
37109
+ ...DependentCostFragment
37110
+ }
37111
+ cfeiDependentCost {
37112
+ ...DependentCostFragment
37113
+ }
37130
37114
  call {
37131
37115
  ...DependentCostFragment
37132
37116
  }
@@ -38359,7 +38343,7 @@ ${MessageCoinFragmentDoc}`;
38359
38343
  }
38360
38344
 
38361
38345
  // src/providers/utils/extract-tx-error.ts
38362
- var assemblePanicError = (statusReason) => {
38346
+ var assemblePanicError = (statusReason, metadata) => {
38363
38347
  let errorMessage = `The transaction reverted with reason: "${statusReason}".`;
38364
38348
  if (PANIC_REASONS.includes(statusReason)) {
38365
38349
  errorMessage = `${errorMessage}
@@ -38368,10 +38352,13 @@ You can read more about this error at:
38368
38352
 
38369
38353
  ${PANIC_DOC_URL}#variant.${statusReason}`;
38370
38354
  }
38371
- return { errorMessage, reason: statusReason };
38355
+ return new FuelError(ErrorCode.SCRIPT_REVERTED, errorMessage, {
38356
+ ...metadata,
38357
+ reason: statusReason
38358
+ });
38372
38359
  };
38373
38360
  var stringify = (obj) => JSON.stringify(obj, null, 2);
38374
- var assembleRevertError = (receipts, logs) => {
38361
+ var assembleRevertError = (receipts, logs, metadata) => {
38375
38362
  let errorMessage = "The transaction reverted with an unknown reason.";
38376
38363
  const revertReceipt = receipts.find(({ type: type3 }) => type3 === ReceiptType.Revert);
38377
38364
  let reason = "";
@@ -38404,25 +38391,36 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
38404
38391
  errorMessage = `The transaction reverted because it's missing an "OutputChange".`;
38405
38392
  break;
38406
38393
  default:
38407
- reason = "unknown";
38408
- errorMessage = `The transaction reverted with an unknown reason: ${revertReceipt.val}`;
38394
+ throw new FuelError(
38395
+ ErrorCode.UNKNOWN,
38396
+ `The transaction reverted with an unknown reason: ${revertReceipt.val}`,
38397
+ {
38398
+ ...metadata,
38399
+ reason: "unknown"
38400
+ }
38401
+ );
38409
38402
  }
38410
38403
  }
38411
- return { errorMessage, reason };
38404
+ return new FuelError(ErrorCode.SCRIPT_REVERTED, errorMessage, {
38405
+ ...metadata,
38406
+ reason
38407
+ });
38412
38408
  };
38413
38409
  var extractTxError = (params) => {
38414
38410
  const { receipts, statusReason, logs } = params;
38415
38411
  const isPanic = receipts.some(({ type: type3 }) => type3 === ReceiptType.Panic);
38416
38412
  const isRevert = receipts.some(({ type: type3 }) => type3 === ReceiptType.Revert);
38417
- const { errorMessage, reason } = isPanic ? assemblePanicError(statusReason) : assembleRevertError(receipts, logs);
38418
38413
  const metadata = {
38419
38414
  logs,
38420
38415
  receipts,
38421
38416
  panic: isPanic,
38422
38417
  revert: isRevert,
38423
- reason
38418
+ reason: ""
38424
38419
  };
38425
- return new FuelError(ErrorCode.SCRIPT_REVERTED, errorMessage, metadata);
38420
+ if (isPanic) {
38421
+ return assemblePanicError(statusReason, metadata);
38422
+ }
38423
+ return assembleRevertError(receipts, logs, metadata);
38426
38424
  };
38427
38425
 
38428
38426
  // src/providers/transaction-request/errors.ts
@@ -38604,8 +38602,8 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
38604
38602
  *
38605
38603
  * Pushes an output to the list without any side effects and returns the index
38606
38604
  */
38607
- pushOutput(output2) {
38608
- this.outputs.push(output2);
38605
+ pushOutput(output3) {
38606
+ this.outputs.push(output3);
38609
38607
  return this.outputs.length - 1;
38610
38608
  }
38611
38609
  /**
@@ -38689,7 +38687,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
38689
38687
  */
38690
38688
  getCoinOutputs() {
38691
38689
  return this.outputs.filter(
38692
- (output2) => output2.type === OutputType.Coin
38690
+ (output3) => output3.type === OutputType.Coin
38693
38691
  );
38694
38692
  }
38695
38693
  /**
@@ -38699,7 +38697,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
38699
38697
  */
38700
38698
  getChangeOutputs() {
38701
38699
  return this.outputs.filter(
38702
- (output2) => output2.type === OutputType.Change
38700
+ (output3) => output3.type === OutputType.Change
38703
38701
  );
38704
38702
  }
38705
38703
  /**
@@ -38849,7 +38847,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
38849
38847
  */
38850
38848
  addChangeOutput(to, assetId) {
38851
38849
  const changeOutput = this.getChangeOutputs().find(
38852
- (output2) => hexlify(output2.assetId) === assetId
38850
+ (output3) => hexlify(output3.assetId) === assetId
38853
38851
  );
38854
38852
  if (!changeOutput) {
38855
38853
  this.pushOutput({
@@ -38927,12 +38925,12 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
38927
38925
  usedQuantity = bn("1000000000000000000");
38928
38926
  }
38929
38927
  if (assetInput && "assetId" in assetInput) {
38930
- assetInput.id = hexlify(randomBytes22(UTXO_ID_LEN));
38928
+ assetInput.id = hexlify(randomBytes2(UTXO_ID_LEN));
38931
38929
  assetInput.amount = usedQuantity;
38932
38930
  } else {
38933
38931
  this.addResources([
38934
38932
  {
38935
- id: hexlify(randomBytes22(UTXO_ID_LEN)),
38933
+ id: hexlify(randomBytes2(UTXO_ID_LEN)),
38936
38934
  amount: usedQuantity,
38937
38935
  assetId,
38938
38936
  owner: resourcesOwner || Address.fromRandom(),
@@ -39028,8 +39026,8 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
39028
39026
  return inputClone;
39029
39027
  }
39030
39028
  });
39031
- transaction.outputs = transaction.outputs.map((output2) => {
39032
- const outputClone = clone_default(output2);
39029
+ transaction.outputs = transaction.outputs.map((output3) => {
39030
+ const outputClone = clone_default(output3);
39033
39031
  switch (outputClone.type) {
39034
39032
  case OutputType.Contract: {
39035
39033
  outputClone.balanceRoot = ZeroBytes32;
@@ -39131,7 +39129,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
39131
39129
  */
39132
39130
  getContractCreatedOutputs() {
39133
39131
  return this.outputs.filter(
39134
- (output2) => output2.type === OutputType.ContractCreated
39132
+ (output3) => output3.type === OutputType.ContractCreated
39135
39133
  );
39136
39134
  }
39137
39135
  /**
@@ -39257,7 +39255,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
39257
39255
  */
39258
39256
  getContractOutputs() {
39259
39257
  return this.outputs.filter(
39260
- (output2) => output2.type === OutputType.Contract
39258
+ (output3) => output3.type === OutputType.Contract
39261
39259
  );
39262
39260
  }
39263
39261
  /**
@@ -39267,7 +39265,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
39267
39265
  */
39268
39266
  getVariableOutputs() {
39269
39267
  return this.outputs.filter(
39270
- (output2) => output2.type === OutputType.Variable
39268
+ (output3) => output3.type === OutputType.Variable
39271
39269
  );
39272
39270
  }
39273
39271
  /**
@@ -39739,8 +39737,8 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
39739
39737
  }) {
39740
39738
  const contractCallReceipts = getReceiptsCall(receipts);
39741
39739
  const contractOutputs = getOutputsContract(outputs);
39742
- const contractCallOperations = contractOutputs.reduce((prevOutputCallOps, output2) => {
39743
- const contractInput = getInputContractFromIndex(inputs, output2.inputIndex);
39740
+ const contractCallOperations = contractOutputs.reduce((prevOutputCallOps, output3) => {
39741
+ const contractInput = getInputContractFromIndex(inputs, output3.inputIndex);
39744
39742
  if (contractInput) {
39745
39743
  const newCallOps = contractCallReceipts.reduce((prevContractCallOps, receipt) => {
39746
39744
  if (receipt.to === contractInput.contractID) {
@@ -39794,7 +39792,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
39794
39792
  let { from: fromAddress } = receipt;
39795
39793
  const toType = contractInputs.some((input) => input.contractID === toAddress) ? 0 /* contract */ : 1 /* account */;
39796
39794
  if (ZeroBytes32 === fromAddress) {
39797
- const change = changeOutputs.find((output2) => output2.assetId === assetId);
39795
+ const change = changeOutputs.find((output3) => output3.assetId === assetId);
39798
39796
  fromAddress = change?.to || fromAddress;
39799
39797
  }
39800
39798
  const fromType = contractInputs.some((input) => input.contractID === fromAddress) ? 0 /* contract */ : 1 /* account */;
@@ -39825,8 +39823,8 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
39825
39823
  const coinOutputs = getOutputsCoin(outputs);
39826
39824
  const contractInputs = getInputsContract(inputs);
39827
39825
  const changeOutputs = getOutputsChange(outputs);
39828
- coinOutputs.forEach((output2) => {
39829
- const { amount, assetId, to } = output2;
39826
+ coinOutputs.forEach((output3) => {
39827
+ const { amount, assetId, to } = output3;
39830
39828
  const changeOutput = changeOutputs.find((change) => change.assetId === assetId);
39831
39829
  if (changeOutput) {
39832
39830
  operations = addOperation(operations, {
@@ -39864,7 +39862,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
39864
39862
  }
39865
39863
  function getPayProducerOperations(outputs) {
39866
39864
  const coinOutputs = getOutputsCoin(outputs);
39867
- const payProducerOperations = coinOutputs.reduce((prev, output2) => {
39865
+ const payProducerOperations = coinOutputs.reduce((prev, output3) => {
39868
39866
  const operations = addOperation(prev, {
39869
39867
  name: "Pay network fee to block producer" /* payBlockProducer */,
39870
39868
  from: {
@@ -39873,12 +39871,12 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
39873
39871
  },
39874
39872
  to: {
39875
39873
  type: 1 /* account */,
39876
- address: output2.to.toString()
39874
+ address: output3.to.toString()
39877
39875
  },
39878
39876
  assetsSent: [
39879
39877
  {
39880
- assetId: output2.assetId.toString(),
39881
- amount: output2.amount
39878
+ assetId: output3.assetId.toString(),
39879
+ amount: output3.amount
39882
39880
  }
39883
39881
  ]
39884
39882
  });
@@ -41714,11 +41712,11 @@ Supported fuel-core version: ${supportedVersion}.`
41714
41712
  gasPrice,
41715
41713
  baseAssetId
41716
41714
  });
41717
- const output2 = {
41715
+ const output3 = {
41718
41716
  gqlTransaction,
41719
41717
  ...transactionSummary
41720
41718
  };
41721
- return output2;
41719
+ return output3;
41722
41720
  });
41723
41721
  return {
41724
41722
  transactions,
@@ -42363,7 +42361,7 @@ Supported fuel-core version: ${supportedVersion}.`
42363
42361
  */
42364
42362
  generateFakeResources(coins) {
42365
42363
  return coins.map((coin) => ({
42366
- id: hexlify(randomBytes22(UTXO_ID_LEN)),
42364
+ id: hexlify(randomBytes2(UTXO_ID_LEN)),
42367
42365
  owner: this.address,
42368
42366
  blockCreated: bn(1),
42369
42367
  txCreatedIdx: bn(1),
@@ -42422,7 +42420,349 @@ Supported fuel-core version: ${supportedVersion}.`
42422
42420
  }
42423
42421
  };
42424
42422
 
42425
- // ../../node_modules/.pnpm/@noble+curves@1.3.0/node_modules/@noble/curves/esm/abstract/modular.js
42423
+ // ../../node_modules/.pnpm/@noble+hashes@1.4.0/node_modules/@noble/hashes/esm/_assert.js
42424
+ function number2(n) {
42425
+ if (!Number.isSafeInteger(n) || n < 0)
42426
+ throw new Error(`positive integer expected, not ${n}`);
42427
+ }
42428
+ function isBytes4(a) {
42429
+ return a instanceof Uint8Array || a != null && typeof a === "object" && a.constructor.name === "Uint8Array";
42430
+ }
42431
+ function bytes2(b, ...lengths) {
42432
+ if (!isBytes4(b))
42433
+ throw new Error("Uint8Array expected");
42434
+ if (lengths.length > 0 && !lengths.includes(b.length))
42435
+ throw new Error(`Uint8Array expected of length ${lengths}, not of length=${b.length}`);
42436
+ }
42437
+ function hash3(h) {
42438
+ if (typeof h !== "function" || typeof h.create !== "function")
42439
+ throw new Error("Hash should be wrapped by utils.wrapConstructor");
42440
+ number2(h.outputLen);
42441
+ number2(h.blockLen);
42442
+ }
42443
+ function exists2(instance, checkFinished = true) {
42444
+ if (instance.destroyed)
42445
+ throw new Error("Hash instance has been destroyed");
42446
+ if (checkFinished && instance.finished)
42447
+ throw new Error("Hash#digest() has already been called");
42448
+ }
42449
+ function output2(out, instance) {
42450
+ bytes2(out);
42451
+ const min = instance.outputLen;
42452
+ if (out.length < min) {
42453
+ throw new Error(`digestInto() expects output buffer of length at least ${min}`);
42454
+ }
42455
+ }
42456
+
42457
+ // ../../node_modules/.pnpm/@noble+hashes@1.4.0/node_modules/@noble/hashes/esm/cryptoNode.js
42458
+ var nc = __toESM(__require("crypto"), 1);
42459
+ var crypto4 = nc && typeof nc === "object" && "webcrypto" in nc ? nc.webcrypto : void 0;
42460
+
42461
+ // ../../node_modules/.pnpm/@noble+hashes@1.4.0/node_modules/@noble/hashes/esm/utils.js
42462
+ var createView2 = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
42463
+ var rotr2 = (word, shift) => word << 32 - shift | word >>> shift;
42464
+ var isLE2 = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
42465
+ function utf8ToBytes3(str) {
42466
+ if (typeof str !== "string")
42467
+ throw new Error(`utf8ToBytes expected string, got ${typeof str}`);
42468
+ return new Uint8Array(new TextEncoder().encode(str));
42469
+ }
42470
+ function toBytes3(data) {
42471
+ if (typeof data === "string")
42472
+ data = utf8ToBytes3(data);
42473
+ bytes2(data);
42474
+ return data;
42475
+ }
42476
+ function concatBytes3(...arrays) {
42477
+ let sum = 0;
42478
+ for (let i = 0; i < arrays.length; i++) {
42479
+ const a = arrays[i];
42480
+ bytes2(a);
42481
+ sum += a.length;
42482
+ }
42483
+ const res = new Uint8Array(sum);
42484
+ for (let i = 0, pad3 = 0; i < arrays.length; i++) {
42485
+ const a = arrays[i];
42486
+ res.set(a, pad3);
42487
+ pad3 += a.length;
42488
+ }
42489
+ return res;
42490
+ }
42491
+ var Hash2 = class {
42492
+ // Safe version that clones internal state
42493
+ clone() {
42494
+ return this._cloneInto();
42495
+ }
42496
+ };
42497
+ var toStr2 = {}.toString;
42498
+ function wrapConstructor2(hashCons) {
42499
+ const hashC = (msg) => hashCons().update(toBytes3(msg)).digest();
42500
+ const tmp = hashCons();
42501
+ hashC.outputLen = tmp.outputLen;
42502
+ hashC.blockLen = tmp.blockLen;
42503
+ hashC.create = () => hashCons();
42504
+ return hashC;
42505
+ }
42506
+ function randomBytes3(bytesLength = 32) {
42507
+ if (crypto4 && typeof crypto4.getRandomValues === "function") {
42508
+ return crypto4.getRandomValues(new Uint8Array(bytesLength));
42509
+ }
42510
+ throw new Error("crypto.getRandomValues must be defined");
42511
+ }
42512
+
42513
+ // ../../node_modules/.pnpm/@noble+hashes@1.4.0/node_modules/@noble/hashes/esm/_md.js
42514
+ function setBigUint642(view, byteOffset, value, isLE3) {
42515
+ if (typeof view.setBigUint64 === "function")
42516
+ return view.setBigUint64(byteOffset, value, isLE3);
42517
+ const _32n2 = BigInt(32);
42518
+ const _u32_max = BigInt(4294967295);
42519
+ const wh = Number(value >> _32n2 & _u32_max);
42520
+ const wl = Number(value & _u32_max);
42521
+ const h = isLE3 ? 4 : 0;
42522
+ const l = isLE3 ? 0 : 4;
42523
+ view.setUint32(byteOffset + h, wh, isLE3);
42524
+ view.setUint32(byteOffset + l, wl, isLE3);
42525
+ }
42526
+ var Chi2 = (a, b, c) => a & b ^ ~a & c;
42527
+ var Maj2 = (a, b, c) => a & b ^ a & c ^ b & c;
42528
+ var HashMD = class extends Hash2 {
42529
+ constructor(blockLen, outputLen, padOffset, isLE3) {
42530
+ super();
42531
+ this.blockLen = blockLen;
42532
+ this.outputLen = outputLen;
42533
+ this.padOffset = padOffset;
42534
+ this.isLE = isLE3;
42535
+ this.finished = false;
42536
+ this.length = 0;
42537
+ this.pos = 0;
42538
+ this.destroyed = false;
42539
+ this.buffer = new Uint8Array(blockLen);
42540
+ this.view = createView2(this.buffer);
42541
+ }
42542
+ update(data) {
42543
+ exists2(this);
42544
+ const { view, buffer, blockLen } = this;
42545
+ data = toBytes3(data);
42546
+ const len = data.length;
42547
+ for (let pos = 0; pos < len; ) {
42548
+ const take = Math.min(blockLen - this.pos, len - pos);
42549
+ if (take === blockLen) {
42550
+ const dataView = createView2(data);
42551
+ for (; blockLen <= len - pos; pos += blockLen)
42552
+ this.process(dataView, pos);
42553
+ continue;
42554
+ }
42555
+ buffer.set(data.subarray(pos, pos + take), this.pos);
42556
+ this.pos += take;
42557
+ pos += take;
42558
+ if (this.pos === blockLen) {
42559
+ this.process(view, 0);
42560
+ this.pos = 0;
42561
+ }
42562
+ }
42563
+ this.length += data.length;
42564
+ this.roundClean();
42565
+ return this;
42566
+ }
42567
+ digestInto(out) {
42568
+ exists2(this);
42569
+ output2(out, this);
42570
+ this.finished = true;
42571
+ const { buffer, view, blockLen, isLE: isLE3 } = this;
42572
+ let { pos } = this;
42573
+ buffer[pos++] = 128;
42574
+ this.buffer.subarray(pos).fill(0);
42575
+ if (this.padOffset > blockLen - pos) {
42576
+ this.process(view, 0);
42577
+ pos = 0;
42578
+ }
42579
+ for (let i = pos; i < blockLen; i++)
42580
+ buffer[i] = 0;
42581
+ setBigUint642(view, blockLen - 8, BigInt(this.length * 8), isLE3);
42582
+ this.process(view, 0);
42583
+ const oview = createView2(out);
42584
+ const len = this.outputLen;
42585
+ if (len % 4)
42586
+ throw new Error("_sha2: outputLen should be aligned to 32bit");
42587
+ const outLen = len / 4;
42588
+ const state = this.get();
42589
+ if (outLen > state.length)
42590
+ throw new Error("_sha2: outputLen bigger than state");
42591
+ for (let i = 0; i < outLen; i++)
42592
+ oview.setUint32(4 * i, state[i], isLE3);
42593
+ }
42594
+ digest() {
42595
+ const { buffer, outputLen } = this;
42596
+ this.digestInto(buffer);
42597
+ const res = buffer.slice(0, outputLen);
42598
+ this.destroy();
42599
+ return res;
42600
+ }
42601
+ _cloneInto(to) {
42602
+ to || (to = new this.constructor());
42603
+ to.set(...this.get());
42604
+ const { blockLen, buffer, length, finished, destroyed, pos } = this;
42605
+ to.length = length;
42606
+ to.pos = pos;
42607
+ to.finished = finished;
42608
+ to.destroyed = destroyed;
42609
+ if (length % blockLen)
42610
+ to.buffer.set(buffer);
42611
+ return to;
42612
+ }
42613
+ };
42614
+
42615
+ // ../../node_modules/.pnpm/@noble+hashes@1.4.0/node_modules/@noble/hashes/esm/sha256.js
42616
+ var SHA256_K2 = /* @__PURE__ */ new Uint32Array([
42617
+ 1116352408,
42618
+ 1899447441,
42619
+ 3049323471,
42620
+ 3921009573,
42621
+ 961987163,
42622
+ 1508970993,
42623
+ 2453635748,
42624
+ 2870763221,
42625
+ 3624381080,
42626
+ 310598401,
42627
+ 607225278,
42628
+ 1426881987,
42629
+ 1925078388,
42630
+ 2162078206,
42631
+ 2614888103,
42632
+ 3248222580,
42633
+ 3835390401,
42634
+ 4022224774,
42635
+ 264347078,
42636
+ 604807628,
42637
+ 770255983,
42638
+ 1249150122,
42639
+ 1555081692,
42640
+ 1996064986,
42641
+ 2554220882,
42642
+ 2821834349,
42643
+ 2952996808,
42644
+ 3210313671,
42645
+ 3336571891,
42646
+ 3584528711,
42647
+ 113926993,
42648
+ 338241895,
42649
+ 666307205,
42650
+ 773529912,
42651
+ 1294757372,
42652
+ 1396182291,
42653
+ 1695183700,
42654
+ 1986661051,
42655
+ 2177026350,
42656
+ 2456956037,
42657
+ 2730485921,
42658
+ 2820302411,
42659
+ 3259730800,
42660
+ 3345764771,
42661
+ 3516065817,
42662
+ 3600352804,
42663
+ 4094571909,
42664
+ 275423344,
42665
+ 430227734,
42666
+ 506948616,
42667
+ 659060556,
42668
+ 883997877,
42669
+ 958139571,
42670
+ 1322822218,
42671
+ 1537002063,
42672
+ 1747873779,
42673
+ 1955562222,
42674
+ 2024104815,
42675
+ 2227730452,
42676
+ 2361852424,
42677
+ 2428436474,
42678
+ 2756734187,
42679
+ 3204031479,
42680
+ 3329325298
42681
+ ]);
42682
+ var SHA256_IV = /* @__PURE__ */ new Uint32Array([
42683
+ 1779033703,
42684
+ 3144134277,
42685
+ 1013904242,
42686
+ 2773480762,
42687
+ 1359893119,
42688
+ 2600822924,
42689
+ 528734635,
42690
+ 1541459225
42691
+ ]);
42692
+ var SHA256_W2 = /* @__PURE__ */ new Uint32Array(64);
42693
+ var SHA2562 = class extends HashMD {
42694
+ constructor() {
42695
+ super(64, 32, 8, false);
42696
+ this.A = SHA256_IV[0] | 0;
42697
+ this.B = SHA256_IV[1] | 0;
42698
+ this.C = SHA256_IV[2] | 0;
42699
+ this.D = SHA256_IV[3] | 0;
42700
+ this.E = SHA256_IV[4] | 0;
42701
+ this.F = SHA256_IV[5] | 0;
42702
+ this.G = SHA256_IV[6] | 0;
42703
+ this.H = SHA256_IV[7] | 0;
42704
+ }
42705
+ get() {
42706
+ const { A, B, C, D, E, F, G, H } = this;
42707
+ return [A, B, C, D, E, F, G, H];
42708
+ }
42709
+ // prettier-ignore
42710
+ set(A, B, C, D, E, F, G, H) {
42711
+ this.A = A | 0;
42712
+ this.B = B | 0;
42713
+ this.C = C | 0;
42714
+ this.D = D | 0;
42715
+ this.E = E | 0;
42716
+ this.F = F | 0;
42717
+ this.G = G | 0;
42718
+ this.H = H | 0;
42719
+ }
42720
+ process(view, offset) {
42721
+ for (let i = 0; i < 16; i++, offset += 4)
42722
+ SHA256_W2[i] = view.getUint32(offset, false);
42723
+ for (let i = 16; i < 64; i++) {
42724
+ const W15 = SHA256_W2[i - 15];
42725
+ const W2 = SHA256_W2[i - 2];
42726
+ const s0 = rotr2(W15, 7) ^ rotr2(W15, 18) ^ W15 >>> 3;
42727
+ const s1 = rotr2(W2, 17) ^ rotr2(W2, 19) ^ W2 >>> 10;
42728
+ SHA256_W2[i] = s1 + SHA256_W2[i - 7] + s0 + SHA256_W2[i - 16] | 0;
42729
+ }
42730
+ let { A, B, C, D, E, F, G, H } = this;
42731
+ for (let i = 0; i < 64; i++) {
42732
+ const sigma1 = rotr2(E, 6) ^ rotr2(E, 11) ^ rotr2(E, 25);
42733
+ const T1 = H + sigma1 + Chi2(E, F, G) + SHA256_K2[i] + SHA256_W2[i] | 0;
42734
+ const sigma0 = rotr2(A, 2) ^ rotr2(A, 13) ^ rotr2(A, 22);
42735
+ const T2 = sigma0 + Maj2(A, B, C) | 0;
42736
+ H = G;
42737
+ G = F;
42738
+ F = E;
42739
+ E = D + T1 | 0;
42740
+ D = C;
42741
+ C = B;
42742
+ B = A;
42743
+ A = T1 + T2 | 0;
42744
+ }
42745
+ A = A + this.A | 0;
42746
+ B = B + this.B | 0;
42747
+ C = C + this.C | 0;
42748
+ D = D + this.D | 0;
42749
+ E = E + this.E | 0;
42750
+ F = F + this.F | 0;
42751
+ G = G + this.G | 0;
42752
+ H = H + this.H | 0;
42753
+ this.set(A, B, C, D, E, F, G, H);
42754
+ }
42755
+ roundClean() {
42756
+ SHA256_W2.fill(0);
42757
+ }
42758
+ destroy() {
42759
+ this.set(0, 0, 0, 0, 0, 0, 0, 0);
42760
+ this.buffer.fill(0);
42761
+ }
42762
+ };
42763
+ var sha2563 = /* @__PURE__ */ wrapConstructor2(() => new SHA2562());
42764
+
42765
+ // ../../node_modules/.pnpm/@noble+curves@1.4.0/node_modules/@noble/curves/esm/abstract/modular.js
42426
42766
  var _0n3 = BigInt(0);
42427
42767
  var _1n3 = BigInt(1);
42428
42768
  var _2n3 = BigInt(2);
@@ -42458,11 +42798,11 @@ Supported fuel-core version: ${supportedVersion}.`
42458
42798
  }
42459
42799
  return res;
42460
42800
  }
42461
- function invert(number2, modulo) {
42462
- if (number2 === _0n3 || modulo <= _0n3) {
42463
- throw new Error(`invert: expected positive integers, got n=${number2} mod=${modulo}`);
42801
+ function invert(number3, modulo) {
42802
+ if (number3 === _0n3 || modulo <= _0n3) {
42803
+ throw new Error(`invert: expected positive integers, got n=${number3} mod=${modulo}`);
42464
42804
  }
42465
- let a = mod(number2, modulo);
42805
+ let a = mod(number3, modulo);
42466
42806
  let b = modulo;
42467
42807
  let x = _0n3, y = _1n3, u = _1n3, v = _0n3;
42468
42808
  while (a !== _0n3) {
@@ -42617,7 +42957,7 @@ Supported fuel-core version: ${supportedVersion}.`
42617
42957
  const nByteLength = Math.ceil(_nBitLength / 8);
42618
42958
  return { nBitLength: _nBitLength, nByteLength };
42619
42959
  }
42620
- function Field(ORDER, bitLen2, isLE2 = false, redef = {}) {
42960
+ function Field(ORDER, bitLen2, isLE3 = false, redef = {}) {
42621
42961
  if (ORDER <= _0n3)
42622
42962
  throw new Error(`Expected Field ORDER > 0, got ${ORDER}`);
42623
42963
  const { nBitLength: BITS, nByteLength: BYTES } = nLength(ORDER, bitLen2);
@@ -42658,11 +42998,11 @@ Supported fuel-core version: ${supportedVersion}.`
42658
42998
  // TODO: do we really need constant cmov?
42659
42999
  // We don't have const-time bigints anyway, so probably will be not very useful
42660
43000
  cmov: (a, b, c) => c ? b : a,
42661
- toBytes: (num) => isLE2 ? numberToBytesLE(num, BYTES) : numberToBytesBE(num, BYTES),
42662
- fromBytes: (bytes2) => {
42663
- if (bytes2.length !== BYTES)
42664
- throw new Error(`Fp.fromBytes: expected ${BYTES}, got ${bytes2.length}`);
42665
- return isLE2 ? bytesToNumberLE(bytes2) : bytesToNumberBE(bytes2);
43001
+ toBytes: (num) => isLE3 ? numberToBytesLE(num, BYTES) : numberToBytesBE(num, BYTES),
43002
+ fromBytes: (bytes3) => {
43003
+ if (bytes3.length !== BYTES)
43004
+ throw new Error(`Fp.fromBytes: expected ${BYTES}, got ${bytes3.length}`);
43005
+ return isLE3 ? bytesToNumberLE(bytes3) : bytesToNumberBE(bytes3);
42666
43006
  }
42667
43007
  });
42668
43008
  return Object.freeze(f2);
@@ -42677,18 +43017,18 @@ Supported fuel-core version: ${supportedVersion}.`
42677
43017
  const length = getFieldBytesLength(fieldOrder);
42678
43018
  return length + Math.ceil(length / 2);
42679
43019
  }
42680
- function mapHashToField(key, fieldOrder, isLE2 = false) {
43020
+ function mapHashToField(key, fieldOrder, isLE3 = false) {
42681
43021
  const len = key.length;
42682
43022
  const fieldLen = getFieldBytesLength(fieldOrder);
42683
43023
  const minLen = getMinHashLength(fieldOrder);
42684
43024
  if (len < 16 || len < minLen || len > 1024)
42685
43025
  throw new Error(`expected ${minLen}-1024 bytes of input, got ${len}`);
42686
- const num = isLE2 ? bytesToNumberBE(key) : bytesToNumberLE(key);
43026
+ const num = isLE3 ? bytesToNumberBE(key) : bytesToNumberLE(key);
42687
43027
  const reduced = mod(num, fieldOrder - _1n3) + _1n3;
42688
- return isLE2 ? numberToBytesLE(reduced, fieldLen) : numberToBytesBE(reduced, fieldLen);
43028
+ return isLE3 ? numberToBytesLE(reduced, fieldLen) : numberToBytesBE(reduced, fieldLen);
42689
43029
  }
42690
43030
 
42691
- // ../../node_modules/.pnpm/@noble+curves@1.3.0/node_modules/@noble/curves/esm/abstract/curve.js
43031
+ // ../../node_modules/.pnpm/@noble+curves@1.4.0/node_modules/@noble/curves/esm/abstract/curve.js
42692
43032
  var _0n4 = BigInt(0);
42693
43033
  var _1n4 = BigInt(1);
42694
43034
  function wNAF(c, bits) {
@@ -42806,7 +43146,7 @@ Supported fuel-core version: ${supportedVersion}.`
42806
43146
  });
42807
43147
  }
42808
43148
 
42809
- // ../../node_modules/.pnpm/@noble+curves@1.3.0/node_modules/@noble/curves/esm/abstract/weierstrass.js
43149
+ // ../../node_modules/.pnpm/@noble+curves@1.4.0/node_modules/@noble/curves/esm/abstract/weierstrass.js
42810
43150
  function validatePointOpts(curve) {
42811
43151
  const opts = validateBasic(curve);
42812
43152
  validateObject(opts, {
@@ -42857,8 +43197,7 @@ Supported fuel-core version: ${supportedVersion}.`
42857
43197
  toSig(hex) {
42858
43198
  const { Err: E } = DER;
42859
43199
  const data = typeof hex === "string" ? h2b(hex) : hex;
42860
- if (!isBytes3(data))
42861
- throw new Error("ui8a expected");
43200
+ abytes(data);
42862
43201
  let l = data.length;
42863
43202
  if (l < 2 || data[0] != 48)
42864
43203
  throw new E("Invalid signature tag");
@@ -42893,12 +43232,12 @@ Supported fuel-core version: ${supportedVersion}.`
42893
43232
  function weierstrassPoints(opts) {
42894
43233
  const CURVE = validatePointOpts(opts);
42895
43234
  const { Fp: Fp2 } = CURVE;
42896
- const toBytes3 = CURVE.toBytes || ((_c, point, _isCompressed) => {
43235
+ const toBytes4 = CURVE.toBytes || ((_c, point, _isCompressed) => {
42897
43236
  const a = point.toAffine();
42898
- return concatBytes3(Uint8Array.from([4]), Fp2.toBytes(a.x), Fp2.toBytes(a.y));
43237
+ return concatBytes2(Uint8Array.from([4]), Fp2.toBytes(a.x), Fp2.toBytes(a.y));
42899
43238
  });
42900
- const fromBytes = CURVE.fromBytes || ((bytes2) => {
42901
- const tail = bytes2.subarray(1);
43239
+ const fromBytes = CURVE.fromBytes || ((bytes3) => {
43240
+ const tail = bytes3.subarray(1);
42902
43241
  const x = Fp2.fromBytes(tail.subarray(0, Fp2.BYTES));
42903
43242
  const y = Fp2.fromBytes(tail.subarray(Fp2.BYTES, 2 * Fp2.BYTES));
42904
43243
  return { x, y };
@@ -43261,7 +43600,7 @@ Supported fuel-core version: ${supportedVersion}.`
43261
43600
  }
43262
43601
  toRawBytes(isCompressed = true) {
43263
43602
  this.assertValidity();
43264
- return toBytes3(Point2, this, isCompressed);
43603
+ return toBytes4(Point2, this, isCompressed);
43265
43604
  }
43266
43605
  toHex(isCompressed = true) {
43267
43606
  return bytesToHex(this.toRawBytes(isCompressed));
@@ -43311,23 +43650,29 @@ Supported fuel-core version: ${supportedVersion}.`
43311
43650
  toBytes(_c, point, isCompressed) {
43312
43651
  const a = point.toAffine();
43313
43652
  const x = Fp2.toBytes(a.x);
43314
- const cat = concatBytes3;
43653
+ const cat = concatBytes2;
43315
43654
  if (isCompressed) {
43316
43655
  return cat(Uint8Array.from([point.hasEvenY() ? 2 : 3]), x);
43317
43656
  } else {
43318
43657
  return cat(Uint8Array.from([4]), x, Fp2.toBytes(a.y));
43319
43658
  }
43320
43659
  },
43321
- fromBytes(bytes2) {
43322
- const len = bytes2.length;
43323
- const head = bytes2[0];
43324
- const tail = bytes2.subarray(1);
43660
+ fromBytes(bytes3) {
43661
+ const len = bytes3.length;
43662
+ const head = bytes3[0];
43663
+ const tail = bytes3.subarray(1);
43325
43664
  if (len === compressedLen && (head === 2 || head === 3)) {
43326
43665
  const x = bytesToNumberBE(tail);
43327
43666
  if (!isValidFieldElement(x))
43328
43667
  throw new Error("Point is not on curve");
43329
43668
  const y2 = weierstrassEquation(x);
43330
- let y = Fp2.sqrt(y2);
43669
+ let y;
43670
+ try {
43671
+ y = Fp2.sqrt(y2);
43672
+ } catch (sqrtError) {
43673
+ const suffix = sqrtError instanceof Error ? ": " + sqrtError.message : "";
43674
+ throw new Error("Point is not on curve" + suffix);
43675
+ }
43331
43676
  const isYOdd = (y & _1n5) === _1n5;
43332
43677
  const isHeadOdd = (head & 1) === 1;
43333
43678
  if (isHeadOdd !== isYOdd)
@@ -43343,9 +43688,9 @@ Supported fuel-core version: ${supportedVersion}.`
43343
43688
  }
43344
43689
  });
43345
43690
  const numToNByteStr = (num) => bytesToHex(numberToBytesBE(num, CURVE.nByteLength));
43346
- function isBiggerThanHalfOrder(number2) {
43691
+ function isBiggerThanHalfOrder(number3) {
43347
43692
  const HALF = CURVE_ORDER >> _1n5;
43348
- return number2 > HALF;
43693
+ return number3 > HALF;
43349
43694
  }
43350
43695
  function normalizeS(s) {
43351
43696
  return isBiggerThanHalfOrder(s) ? modN(-s) : s;
@@ -43475,13 +43820,13 @@ Supported fuel-core version: ${supportedVersion}.`
43475
43820
  const b = Point2.fromHex(publicB);
43476
43821
  return b.multiply(normPrivateKeyToScalar(privateA)).toRawBytes(isCompressed);
43477
43822
  }
43478
- const bits2int = CURVE.bits2int || function(bytes2) {
43479
- const num = bytesToNumberBE(bytes2);
43480
- const delta = bytes2.length * 8 - CURVE.nBitLength;
43823
+ const bits2int = CURVE.bits2int || function(bytes3) {
43824
+ const num = bytesToNumberBE(bytes3);
43825
+ const delta = bytes3.length * 8 - CURVE.nBitLength;
43481
43826
  return delta > 0 ? num >> BigInt(delta) : num;
43482
43827
  };
43483
- const bits2int_modN = CURVE.bits2int_modN || function(bytes2) {
43484
- return modN(bits2int(bytes2));
43828
+ const bits2int_modN = CURVE.bits2int_modN || function(bytes3) {
43829
+ return modN(bits2int(bytes3));
43485
43830
  };
43486
43831
  const ORDER_MASK = bitMask(CURVE.nBitLength);
43487
43832
  function int2octets(num) {
@@ -43494,21 +43839,21 @@ Supported fuel-core version: ${supportedVersion}.`
43494
43839
  function prepSig(msgHash, privateKey, opts = defaultSigOpts) {
43495
43840
  if (["recovered", "canonical"].some((k) => k in opts))
43496
43841
  throw new Error("sign() legacy options not supported");
43497
- const { hash: hash3, randomBytes: randomBytes3 } = CURVE;
43842
+ const { hash: hash4, randomBytes: randomBytes4 } = CURVE;
43498
43843
  let { lowS, prehash, extraEntropy: ent } = opts;
43499
43844
  if (lowS == null)
43500
43845
  lowS = true;
43501
43846
  msgHash = ensureBytes("msgHash", msgHash);
43502
43847
  if (prehash)
43503
- msgHash = ensureBytes("prehashed msgHash", hash3(msgHash));
43848
+ msgHash = ensureBytes("prehashed msgHash", hash4(msgHash));
43504
43849
  const h1int = bits2int_modN(msgHash);
43505
43850
  const d = normPrivateKeyToScalar(privateKey);
43506
43851
  const seedArgs = [int2octets(d), int2octets(h1int)];
43507
- if (ent != null) {
43508
- const e = ent === true ? randomBytes3(Fp2.BYTES) : ent;
43852
+ if (ent != null && ent !== false) {
43853
+ const e = ent === true ? randomBytes4(Fp2.BYTES) : ent;
43509
43854
  seedArgs.push(ensureBytes("extraEntropy", e));
43510
43855
  }
43511
- const seed = concatBytes3(...seedArgs);
43856
+ const seed = concatBytes2(...seedArgs);
43512
43857
  const m = h1int;
43513
43858
  function k2sig(kBytes) {
43514
43859
  const k = bits2int(kBytes);
@@ -43598,20 +43943,85 @@ Supported fuel-core version: ${supportedVersion}.`
43598
43943
  };
43599
43944
  }
43600
43945
 
43601
- // ../../node_modules/.pnpm/@noble+curves@1.3.0/node_modules/@noble/curves/esm/_shortw_utils.js
43602
- function getHash(hash3) {
43946
+ // ../../node_modules/.pnpm/@noble+hashes@1.4.0/node_modules/@noble/hashes/esm/hmac.js
43947
+ var HMAC2 = class extends Hash2 {
43948
+ constructor(hash4, _key) {
43949
+ super();
43950
+ this.finished = false;
43951
+ this.destroyed = false;
43952
+ hash3(hash4);
43953
+ const key = toBytes3(_key);
43954
+ this.iHash = hash4.create();
43955
+ if (typeof this.iHash.update !== "function")
43956
+ throw new Error("Expected instance of class which extends utils.Hash");
43957
+ this.blockLen = this.iHash.blockLen;
43958
+ this.outputLen = this.iHash.outputLen;
43959
+ const blockLen = this.blockLen;
43960
+ const pad3 = new Uint8Array(blockLen);
43961
+ pad3.set(key.length > blockLen ? hash4.create().update(key).digest() : key);
43962
+ for (let i = 0; i < pad3.length; i++)
43963
+ pad3[i] ^= 54;
43964
+ this.iHash.update(pad3);
43965
+ this.oHash = hash4.create();
43966
+ for (let i = 0; i < pad3.length; i++)
43967
+ pad3[i] ^= 54 ^ 92;
43968
+ this.oHash.update(pad3);
43969
+ pad3.fill(0);
43970
+ }
43971
+ update(buf) {
43972
+ exists2(this);
43973
+ this.iHash.update(buf);
43974
+ return this;
43975
+ }
43976
+ digestInto(out) {
43977
+ exists2(this);
43978
+ bytes2(out, this.outputLen);
43979
+ this.finished = true;
43980
+ this.iHash.digestInto(out);
43981
+ this.oHash.update(out);
43982
+ this.oHash.digestInto(out);
43983
+ this.destroy();
43984
+ }
43985
+ digest() {
43986
+ const out = new Uint8Array(this.oHash.outputLen);
43987
+ this.digestInto(out);
43988
+ return out;
43989
+ }
43990
+ _cloneInto(to) {
43991
+ to || (to = Object.create(Object.getPrototypeOf(this), {}));
43992
+ const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this;
43993
+ to = to;
43994
+ to.finished = finished;
43995
+ to.destroyed = destroyed;
43996
+ to.blockLen = blockLen;
43997
+ to.outputLen = outputLen;
43998
+ to.oHash = oHash._cloneInto(to.oHash);
43999
+ to.iHash = iHash._cloneInto(to.iHash);
44000
+ return to;
44001
+ }
44002
+ destroy() {
44003
+ this.destroyed = true;
44004
+ this.oHash.destroy();
44005
+ this.iHash.destroy();
44006
+ }
44007
+ };
44008
+ var hmac2 = (hash4, key, message) => new HMAC2(hash4, key).update(message).digest();
44009
+ hmac2.create = (hash4, key) => new HMAC2(hash4, key);
44010
+
44011
+ // ../../node_modules/.pnpm/@noble+curves@1.4.0/node_modules/@noble/curves/esm/_shortw_utils.js
44012
+ function getHash(hash4) {
43603
44013
  return {
43604
- hash: hash3,
43605
- hmac: (key, ...msgs) => hmac(hash3, key, concatBytes2(...msgs)),
43606
- randomBytes
44014
+ hash: hash4,
44015
+ hmac: (key, ...msgs) => hmac2(hash4, key, concatBytes3(...msgs)),
44016
+ randomBytes: randomBytes3
43607
44017
  };
43608
44018
  }
43609
44019
  function createCurve(curveDef, defHash) {
43610
- const create = (hash3) => weierstrass({ ...curveDef, ...getHash(hash3) });
44020
+ const create = (hash4) => weierstrass({ ...curveDef, ...getHash(hash4) });
43611
44021
  return Object.freeze({ ...create(defHash), create });
43612
44022
  }
43613
44023
 
43614
- // ../../node_modules/.pnpm/@noble+curves@1.3.0/node_modules/@noble/curves/esm/secp256k1.js
44024
+ // ../../node_modules/.pnpm/@noble+curves@1.4.0/node_modules/@noble/curves/esm/secp256k1.js
43615
44025
  var secp256k1P = BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f");
43616
44026
  var secp256k1N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");
43617
44027
  var _1n6 = BigInt(1);
@@ -43687,7 +44097,7 @@ Supported fuel-core version: ${supportedVersion}.`
43687
44097
  return { k1neg, k1, k2neg, k2 };
43688
44098
  }
43689
44099
  }
43690
- }, sha256);
44100
+ }, sha2563);
43691
44101
  var _0n6 = BigInt(0);
43692
44102
  var Point = secp256k1.ProjectivePoint;
43693
44103
 
@@ -43780,7 +44190,7 @@ Supported fuel-core version: ${supportedVersion}.`
43780
44190
  * @returns random 32-byte hashed
43781
44191
  */
43782
44192
  static generatePrivateKey(entropy) {
43783
- return entropy ? hash2(concat([randomBytes22(32), arrayify(entropy)])) : randomBytes22(32);
44193
+ return entropy ? hash2(concat([randomBytes2(32), arrayify(entropy)])) : randomBytes2(32);
43784
44194
  }
43785
44195
  /**
43786
44196
  * Extended publicKey from a compact publicKey
@@ -43794,34 +44204,34 @@ Supported fuel-core version: ${supportedVersion}.`
43794
44204
  }
43795
44205
  };
43796
44206
 
43797
- // ../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-node/rng.js
43798
- var import_crypto13 = __toESM(__require("crypto"));
44207
+ // ../../node_modules/.pnpm/uuid@10.0.0/node_modules/uuid/dist/esm-node/stringify.js
44208
+ var byteToHex = [];
44209
+ for (let i = 0; i < 256; ++i) {
44210
+ byteToHex.push((i + 256).toString(16).slice(1));
44211
+ }
44212
+ function unsafeStringify(arr, offset = 0) {
44213
+ 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();
44214
+ }
44215
+
44216
+ // ../../node_modules/.pnpm/uuid@10.0.0/node_modules/uuid/dist/esm-node/rng.js
44217
+ var import_node_crypto = __toESM(__require("crypto"));
43799
44218
  var rnds8Pool = new Uint8Array(256);
43800
44219
  var poolPtr = rnds8Pool.length;
43801
44220
  function rng() {
43802
44221
  if (poolPtr > rnds8Pool.length - 16) {
43803
- import_crypto13.default.randomFillSync(rnds8Pool);
44222
+ import_node_crypto.default.randomFillSync(rnds8Pool);
43804
44223
  poolPtr = 0;
43805
44224
  }
43806
44225
  return rnds8Pool.slice(poolPtr, poolPtr += 16);
43807
44226
  }
43808
44227
 
43809
- // ../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-node/stringify.js
43810
- var byteToHex = [];
43811
- for (let i = 0; i < 256; ++i) {
43812
- byteToHex.push((i + 256).toString(16).slice(1));
43813
- }
43814
- function unsafeStringify(arr, offset = 0) {
43815
- 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();
43816
- }
43817
-
43818
- // ../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-node/native.js
43819
- var import_crypto14 = __toESM(__require("crypto"));
44228
+ // ../../node_modules/.pnpm/uuid@10.0.0/node_modules/uuid/dist/esm-node/native.js
44229
+ var import_node_crypto2 = __toESM(__require("crypto"));
43820
44230
  var native_default = {
43821
- randomUUID: import_crypto14.default.randomUUID
44231
+ randomUUID: import_node_crypto2.default.randomUUID
43822
44232
  };
43823
44233
 
43824
- // ../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-node/v4.js
44234
+ // ../../node_modules/.pnpm/uuid@10.0.0/node_modules/uuid/dist/esm-node/v4.js
43825
44235
  function v4(options, buf, offset) {
43826
44236
  if (native_default.randomUUID && !buf && !options) {
43827
44237
  return native_default.randomUUID();
@@ -43856,7 +44266,7 @@ Supported fuel-core version: ${supportedVersion}.`
43856
44266
  async function encryptKeystoreWallet(privateKey, address, password) {
43857
44267
  const privateKeyBuffer = bufferFromString2(removeHexPrefix(privateKey), "hex");
43858
44268
  const ownerAddress = Address.fromAddressOrString(address);
43859
- const salt = randomBytes22(DEFAULT_KEY_SIZE);
44269
+ const salt = randomBytes2(DEFAULT_KEY_SIZE);
43860
44270
  const key = scrypt22({
43861
44271
  password: bufferFromString2(password),
43862
44272
  salt,
@@ -43865,7 +44275,7 @@ Supported fuel-core version: ${supportedVersion}.`
43865
44275
  r: DEFAULT_KDF_PARAMS_R,
43866
44276
  p: DEFAULT_KDF_PARAMS_P
43867
44277
  });
43868
- const iv = randomBytes22(DEFAULT_IV_SIZE);
44278
+ const iv = randomBytes2(DEFAULT_IV_SIZE);
43869
44279
  const ciphertext = await encryptJsonWalletData2(privateKeyBuffer, key, iv);
43870
44280
  const data = Uint8Array.from([...key.subarray(16, 32), ...ciphertext]);
43871
44281
  const macHashUint8Array = keccak2562(data);
@@ -46367,7 +46777,7 @@ Supported fuel-core version: ${supportedVersion}.`
46367
46777
  * @returns A randomly generated mnemonic
46368
46778
  */
46369
46779
  static generate(size = 32, extraEntropy = "") {
46370
- const entropy = extraEntropy ? sha2562(concat([randomBytes22(size), arrayify(extraEntropy)])) : randomBytes22(size);
46780
+ const entropy = extraEntropy ? sha2562(concat([randomBytes2(size), arrayify(extraEntropy)])) : randomBytes2(size);
46371
46781
  return Mnemonic.entropyToMnemonic(entropy);
46372
46782
  }
46373
46783
  };
@@ -46468,9 +46878,9 @@ Supported fuel-core version: ${supportedVersion}.`
46468
46878
  data.set(arrayify(this.publicKey));
46469
46879
  }
46470
46880
  data.set(toBytes(index, 4), 33);
46471
- const bytes2 = arrayify(computeHmac2("sha512", chainCode, data));
46472
- const IL = bytes2.slice(0, 32);
46473
- const IR = bytes2.slice(32);
46881
+ const bytes3 = arrayify(computeHmac2("sha512", chainCode, data));
46882
+ const IL = bytes3.slice(0, 32);
46883
+ const IR = bytes3.slice(32);
46474
46884
  if (privateKey) {
46475
46885
  const N = "0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141";
46476
46886
  const ki = bn(IL).add(privateKey).mod(N).toBytes(32);
@@ -46540,26 +46950,26 @@ Supported fuel-core version: ${supportedVersion}.`
46540
46950
  }
46541
46951
  static fromExtendedKey(extendedKey) {
46542
46952
  const decoded = hexlify(toBytes(decodeBase58(extendedKey)));
46543
- const bytes2 = arrayify(decoded);
46544
- const validChecksum = base58check(bytes2.slice(0, 78)) === extendedKey;
46545
- if (bytes2.length !== 82 || !isValidExtendedKey(bytes2)) {
46953
+ const bytes3 = arrayify(decoded);
46954
+ const validChecksum = base58check(bytes3.slice(0, 78)) === extendedKey;
46955
+ if (bytes3.length !== 82 || !isValidExtendedKey(bytes3)) {
46546
46956
  throw new FuelError(ErrorCode.HD_WALLET_ERROR, "Provided key is not a valid extended key.");
46547
46957
  }
46548
46958
  if (!validChecksum) {
46549
46959
  throw new FuelError(ErrorCode.HD_WALLET_ERROR, "Provided key has an invalid checksum.");
46550
46960
  }
46551
- const depth = bytes2[4];
46552
- const parentFingerprint = hexlify(bytes2.slice(5, 9));
46553
- const index = parseInt(hexlify(bytes2.slice(9, 13)).substring(2), 16);
46554
- const chainCode = hexlify(bytes2.slice(13, 45));
46555
- const key = bytes2.slice(45, 78);
46961
+ const depth = bytes3[4];
46962
+ const parentFingerprint = hexlify(bytes3.slice(5, 9));
46963
+ const index = parseInt(hexlify(bytes3.slice(9, 13)).substring(2), 16);
46964
+ const chainCode = hexlify(bytes3.slice(13, 45));
46965
+ const key = bytes3.slice(45, 78);
46556
46966
  if (depth === 0 && parentFingerprint !== "0x00000000" || depth === 0 && index !== 0) {
46557
46967
  throw new FuelError(
46558
46968
  ErrorCode.HD_WALLET_ERROR,
46559
46969
  "Inconsistency detected: Depth is zero but fingerprint/index is non-zero."
46560
46970
  );
46561
46971
  }
46562
- if (isPublicExtendedKey(bytes2)) {
46972
+ if (isPublicExtendedKey(bytes3)) {
46563
46973
  if (key[0] !== 3) {
46564
46974
  throw new FuelError(ErrorCode.HD_WALLET_ERROR, "Invalid public extended key.");
46565
46975
  }
@@ -47203,8 +47613,8 @@ Supported fuel-core version: ${supportedVersion}.`
47203
47613
  // src/predicate/utils/getPredicateRoot.ts
47204
47614
  var getPredicateRoot = (bytecode) => {
47205
47615
  const chunkSize = 16 * 1024;
47206
- const bytes2 = arrayify(bytecode);
47207
- const chunks = chunkAndPadBytes(bytes2, chunkSize);
47616
+ const bytes3 = arrayify(bytecode);
47617
+ const chunks = chunkAndPadBytes(bytes3, chunkSize);
47208
47618
  const codeRoot = calcRoot(chunks.map((c) => hexlify(c)));
47209
47619
  const predicateRoot = hash2(concat(["0x4655454C", codeRoot]));
47210
47620
  return predicateRoot;
@@ -47300,8 +47710,8 @@ Supported fuel-core version: ${supportedVersion}.`
47300
47710
  * @param configurableConstants - Optional configurable constants for the predicate.
47301
47711
  * @returns An object containing the new predicate bytes and interface.
47302
47712
  */
47303
- static processPredicateData(bytes2, jsonAbi, configurableConstants) {
47304
- let predicateBytes = arrayify(bytes2);
47713
+ static processPredicateData(bytes3, jsonAbi, configurableConstants) {
47714
+ let predicateBytes = arrayify(bytes3);
47305
47715
  let abiInterface;
47306
47716
  if (jsonAbi) {
47307
47717
  abiInterface = new Interface(jsonAbi);
@@ -47364,8 +47774,8 @@ Supported fuel-core version: ${supportedVersion}.`
47364
47774
  * @param abiInterface - The ABI interface of the predicate.
47365
47775
  * @returns The mutated bytes with the configurable constants set.
47366
47776
  */
47367
- static setConfigurableConstants(bytes2, configurableConstants, abiInterface) {
47368
- const mutatedBytes = bytes2;
47777
+ static setConfigurableConstants(bytes3, configurableConstants, abiInterface) {
47778
+ const mutatedBytes = bytes3;
47369
47779
  try {
47370
47780
  if (!abiInterface) {
47371
47781
  throw new Error(
@@ -48109,6 +48519,9 @@ mime-types/index.js:
48109
48519
  @noble/curves/esm/abstract/utils.js:
48110
48520
  (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
48111
48521
 
48522
+ @noble/hashes/esm/utils.js:
48523
+ (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
48524
+
48112
48525
  @noble/curves/esm/abstract/modular.js:
48113
48526
  (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
48114
48527