@fuel-ts/account 0.0.0-rc-2021-20240411141803 → 0.0.0-rc-1976-20240411153008

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

Potentially problematic release.


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

Files changed (57) hide show
  1. package/README.md +1 -1
  2. package/dist/account.d.ts +4 -5
  3. package/dist/account.d.ts.map +1 -1
  4. package/dist/configs.d.ts.map +1 -1
  5. package/dist/configs.global.js +1 -1
  6. package/dist/configs.global.js.map +1 -1
  7. package/dist/configs.js +1 -1
  8. package/dist/configs.js.map +1 -1
  9. package/dist/configs.mjs +1 -1
  10. package/dist/configs.mjs.map +1 -1
  11. package/dist/index.global.js +625 -876
  12. package/dist/index.global.js.map +1 -1
  13. package/dist/index.js +619 -856
  14. package/dist/index.js.map +1 -1
  15. package/dist/index.mjs +462 -698
  16. package/dist/index.mjs.map +1 -1
  17. package/dist/predicate/predicate.d.ts +2 -10
  18. package/dist/predicate/predicate.d.ts.map +1 -1
  19. package/dist/providers/__generated__/operations.d.ts +328 -894
  20. package/dist/providers/__generated__/operations.d.ts.map +1 -1
  21. package/dist/providers/coin-quantity.d.ts +3 -3
  22. package/dist/providers/coin-quantity.d.ts.map +1 -1
  23. package/dist/providers/coin.d.ts +2 -4
  24. package/dist/providers/coin.d.ts.map +1 -1
  25. package/dist/providers/fuel-graphql-subscriber.d.ts.map +1 -1
  26. package/dist/providers/message.d.ts +1 -3
  27. package/dist/providers/message.d.ts.map +1 -1
  28. package/dist/providers/provider.d.ts +34 -45
  29. package/dist/providers/provider.d.ts.map +1 -1
  30. package/dist/providers/transaction-request/create-transaction-request.d.ts +1 -1
  31. package/dist/providers/transaction-request/create-transaction-request.d.ts.map +1 -1
  32. package/dist/providers/transaction-request/input.d.ts +2 -2
  33. package/dist/providers/transaction-request/input.d.ts.map +1 -1
  34. package/dist/providers/transaction-request/script-transaction-request.d.ts +1 -1
  35. package/dist/providers/transaction-request/script-transaction-request.d.ts.map +1 -1
  36. package/dist/providers/transaction-request/transaction-request.d.ts +29 -9
  37. package/dist/providers/transaction-request/transaction-request.d.ts.map +1 -1
  38. package/dist/providers/transaction-request/utils.d.ts +0 -3
  39. package/dist/providers/transaction-request/utils.d.ts.map +1 -1
  40. package/dist/providers/transaction-response/transaction-response.d.ts.map +1 -1
  41. package/dist/providers/transaction-summary/assemble-transaction-summary.d.ts +0 -2
  42. package/dist/providers/transaction-summary/assemble-transaction-summary.d.ts.map +1 -1
  43. package/dist/providers/transaction-summary/calculate-transaction-fee.d.ts +2 -3
  44. package/dist/providers/transaction-summary/calculate-transaction-fee.d.ts.map +1 -1
  45. package/dist/providers/transaction-summary/get-transaction-summary.d.ts.map +1 -1
  46. package/dist/providers/utils/gas.d.ts +2 -8
  47. package/dist/providers/utils/gas.d.ts.map +1 -1
  48. package/dist/test-utils/launchNode.d.ts.map +1 -1
  49. package/dist/test-utils/seedTestWallet.d.ts.map +1 -1
  50. package/dist/test-utils.global.js +1128 -1593
  51. package/dist/test-utils.global.js.map +1 -1
  52. package/dist/test-utils.js +618 -834
  53. package/dist/test-utils.js.map +1 -1
  54. package/dist/test-utils.mjs +476 -692
  55. package/dist/test-utils.mjs.map +1 -1
  56. package/dist/wallet/base-wallet-unlocked.d.ts.map +1 -1
  57. package/package.json +17 -17
@@ -289,7 +289,7 @@
289
289
  }
290
290
  return num !== null && typeof num === "object" && num.constructor.wordSize === BN2.wordSize && Array.isArray(num.words);
291
291
  };
292
- BN2.max = function max(left, right) {
292
+ BN2.max = function max2(left, right) {
293
293
  if (left.cmp(right) > 0)
294
294
  return left;
295
295
  return right;
@@ -5113,7 +5113,7 @@
5113
5113
  function isBlob(obj) {
5114
5114
  return typeof obj === "object" && typeof obj.arrayBuffer === "function" && typeof obj.type === "string" && typeof obj.stream === "function" && typeof obj.constructor === "function" && typeof obj.constructor.name === "string" && /^(Blob|File)$/.test(obj.constructor.name) && /^(Blob|File)$/.test(obj[Symbol.toStringTag]);
5115
5115
  }
5116
- function clone3(instance) {
5116
+ function clone(instance) {
5117
5117
  let p1, p2;
5118
5118
  let body = instance.body;
5119
5119
  if (instance.bodyUsed) {
@@ -6047,7 +6047,7 @@
6047
6047
  * @return Response
6048
6048
  */
6049
6049
  clone() {
6050
- return new Response2(clone3(this), {
6050
+ return new Response2(clone(this), {
6051
6051
  url: this.url,
6052
6052
  status: this.status,
6053
6053
  statusText: this.statusText,
@@ -6097,7 +6097,7 @@
6097
6097
  if ((init.body != null || isRequest(input) && input.body !== null) && (method === "GET" || method === "HEAD")) {
6098
6098
  throw new TypeError("Request with GET/HEAD method cannot have body");
6099
6099
  }
6100
- let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone3(input) : null;
6100
+ let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
6101
6101
  Body.call(this, inputBody, {
6102
6102
  timeout: init.timeout || input.timeout || 0,
6103
6103
  size: init.size || input.size || 0
@@ -28952,8 +28952,8 @@ spurious results.`);
28952
28952
  // ../versions/dist/index.mjs
28953
28953
  function getBuiltinVersions() {
28954
28954
  return {
28955
- FORC: "0.51.1",
28956
- FUEL_CORE: "0.24.2",
28955
+ FORC: "0.49.3",
28956
+ FUEL_CORE: "0.22.1",
28957
28957
  FUELS: "0.79.0"
28958
28958
  };
28959
28959
  }
@@ -29245,7 +29245,7 @@ This unreleased fuel-core build may include features and updates not yet support
29245
29245
  __publicField3(DateTime, "TAI64_NULL", "");
29246
29246
 
29247
29247
  // ../crypto/dist/index.mjs
29248
- var import_crypto9 = __toESM(__require("crypto"), 1);
29248
+ var import_crypto8 = __toESM(__require("crypto"), 1);
29249
29249
 
29250
29250
  // ../../node_modules/.pnpm/ethers@6.7.1/node_modules/ethers/lib.esm/_version.js
29251
29251
  var version = "6.7.1";
@@ -30317,27 +30317,6 @@ This unreleased fuel-core build may include features and updates not yet support
30317
30317
  };
30318
30318
  Object.freeze(pbkdf22);
30319
30319
 
30320
- // ../../node_modules/.pnpm/ethers@6.7.1/node_modules/ethers/lib.esm/crypto/random.js
30321
- var locked5 = false;
30322
- var _randomBytes = function(length) {
30323
- return new Uint8Array((0, import_crypto2.randomBytes)(length));
30324
- };
30325
- var __randomBytes = _randomBytes;
30326
- function randomBytes3(length) {
30327
- return __randomBytes(length);
30328
- }
30329
- randomBytes3._ = _randomBytes;
30330
- randomBytes3.lock = function() {
30331
- locked5 = true;
30332
- };
30333
- randomBytes3.register = function(func) {
30334
- if (locked5) {
30335
- throw new Error("randomBytes is locked");
30336
- }
30337
- __randomBytes = func;
30338
- };
30339
- Object.freeze(randomBytes3);
30340
-
30341
30320
  // ../../node_modules/.pnpm/ethers@6.7.1/node_modules/ethers/lib.esm/address/address.js
30342
30321
  var BN_03 = BigInt(0);
30343
30322
  var BN_36 = BigInt(36);
@@ -30922,8 +30901,8 @@ This unreleased fuel-core build may include features and updates not yet support
30922
30901
  }
30923
30902
 
30924
30903
  // ../crypto/dist/index.mjs
30904
+ var import_crypto9 = __toESM(__require("crypto"), 1);
30925
30905
  var import_crypto10 = __toESM(__require("crypto"), 1);
30926
- var import_crypto11 = __toESM(__require("crypto"), 1);
30927
30906
  var scrypt3 = (params) => {
30928
30907
  const { password, salt, n, p, r, dklen } = params;
30929
30908
  const derivedKey = scrypt(password, salt, { N: n, r, p, dkLen: dklen });
@@ -30932,7 +30911,7 @@ This unreleased fuel-core build may include features and updates not yet support
30932
30911
  var keccak2562 = (data) => keccak_256(data);
30933
30912
  var bufferFromString = (string, encoding = "base64") => Uint8Array.from(Buffer.from(string, encoding));
30934
30913
  var randomBytes4 = (length) => {
30935
- const randomValues = Uint8Array.from(import_crypto10.default.randomBytes(length));
30914
+ const randomValues = Uint8Array.from(import_crypto9.default.randomBytes(length));
30936
30915
  return randomValues;
30937
30916
  };
30938
30917
  var stringFromBuffer = (buffer, encoding = "base64") => Buffer.from(buffer).toString(encoding);
@@ -30947,7 +30926,7 @@ This unreleased fuel-core build may include features and updates not yet support
30947
30926
  const salt = randomBytes4(32);
30948
30927
  const secret = keyFromPassword(password, salt);
30949
30928
  const dataBuffer = Uint8Array.from(Buffer.from(JSON.stringify(data), "utf-8"));
30950
- const cipher = await import_crypto9.default.createCipheriv(ALGORITHM, secret, iv);
30929
+ const cipher = await import_crypto8.default.createCipheriv(ALGORITHM, secret, iv);
30951
30930
  let cipherData = cipher.update(dataBuffer);
30952
30931
  cipherData = Buffer.concat([cipherData, cipher.final()]);
30953
30932
  return {
@@ -30961,7 +30940,7 @@ This unreleased fuel-core build may include features and updates not yet support
30961
30940
  const salt = bufferFromString(keystore.salt);
30962
30941
  const secret = keyFromPassword(password, salt);
30963
30942
  const encryptedText = bufferFromString(keystore.data);
30964
- const decipher = await import_crypto9.default.createDecipheriv(ALGORITHM, secret, iv);
30943
+ const decipher = await import_crypto8.default.createDecipheriv(ALGORITHM, secret, iv);
30965
30944
  const decrypted = decipher.update(encryptedText);
30966
30945
  const deBuff = Buffer.concat([decrypted, decipher.final()]);
30967
30946
  const decryptedData = Buffer.from(deBuff).toString("utf-8");
@@ -30972,12 +30951,12 @@ This unreleased fuel-core build may include features and updates not yet support
30972
30951
  }
30973
30952
  };
30974
30953
  async function encryptJsonWalletData(data, key, iv) {
30975
- const cipher = await import_crypto11.default.createCipheriv("aes-128-ctr", key.subarray(0, 16), iv);
30954
+ const cipher = await import_crypto10.default.createCipheriv("aes-128-ctr", key.subarray(0, 16), iv);
30976
30955
  const encrypted = Buffer.concat([cipher.update(data), cipher.final()]);
30977
30956
  return new Uint8Array(encrypted);
30978
30957
  }
30979
30958
  async function decryptJsonWalletData(data, key, iv) {
30980
- const decipher = import_crypto11.default.createDecipheriv("aes-128-ctr", key.subarray(0, 16), iv);
30959
+ const decipher = import_crypto10.default.createDecipheriv("aes-128-ctr", key.subarray(0, 16), iv);
30981
30960
  const decrypted = await Buffer.concat([decipher.update(data), decipher.final()]);
30982
30961
  return new Uint8Array(decrypted);
30983
30962
  }
@@ -31293,10 +31272,6 @@ This unreleased fuel-core build may include features and updates not yet support
31293
31272
  }
31294
31273
  };
31295
31274
 
31296
- // ../address/dist/configs.mjs
31297
- var ZeroBytes32 = "0x0000000000000000000000000000000000000000000000000000000000000000";
31298
- var BaseAssetId = ZeroBytes32;
31299
-
31300
31275
  // ../math/dist/index.mjs
31301
31276
  var import_bn = __toESM(require_bn(), 1);
31302
31277
  var DEFAULT_PRECISION = 9;
@@ -31516,182 +31491,32 @@ This unreleased fuel-core build may include features and updates not yet support
31516
31491
  function toBytes3(value, bytesPadding) {
31517
31492
  return bn(value).toBytes(bytesPadding);
31518
31493
  }
31519
-
31520
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isPlaceholder.js
31521
- function _isPlaceholder(a) {
31522
- return a != null && typeof a === "object" && a["@@functional/placeholder"] === true;
31523
- }
31524
-
31525
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_curry1.js
31526
- function _curry1(fn) {
31527
- return function f1(a) {
31528
- if (arguments.length === 0 || _isPlaceholder(a)) {
31529
- return f1;
31530
- } else {
31531
- return fn.apply(this, arguments);
31532
- }
31533
- };
31534
- }
31535
-
31536
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isArray.js
31537
- var isArray_default = Array.isArray || function _isArray(val) {
31538
- return val != null && val.length >= 0 && Object.prototype.toString.call(val) === "[object Array]";
31539
- };
31540
-
31541
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/type.js
31542
- var type = /* @__PURE__ */ _curry1(function type2(val) {
31543
- return val === null ? "Null" : val === void 0 ? "Undefined" : Object.prototype.toString.call(val).slice(8, -1);
31544
- });
31545
- var type_default = type;
31546
-
31547
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_toISOString.js
31548
- var pad = function pad2(n) {
31549
- return (n < 10 ? "0" : "") + n;
31550
- };
31551
- var _toISOString = typeof Date.prototype.toISOString === "function" ? function _toISOString2(d) {
31552
- return d.toISOString();
31553
- } : function _toISOString3(d) {
31554
- return d.getUTCFullYear() + "-" + pad(d.getUTCMonth() + 1) + "-" + pad(d.getUTCDate()) + "T" + pad(d.getUTCHours()) + ":" + pad(d.getUTCMinutes()) + ":" + pad(d.getUTCSeconds()) + "." + (d.getUTCMilliseconds() / 1e3).toFixed(3).slice(2, 5) + "Z";
31555
- };
31556
-
31557
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isInteger.js
31558
- var isInteger_default = Number.isInteger || function _isInteger(n) {
31559
- return n << 0 === n;
31560
- };
31561
-
31562
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_cloneRegExp.js
31563
- function _cloneRegExp(pattern) {
31564
- return new RegExp(pattern.source, pattern.flags ? pattern.flags : (pattern.global ? "g" : "") + (pattern.ignoreCase ? "i" : "") + (pattern.multiline ? "m" : "") + (pattern.sticky ? "y" : "") + (pattern.unicode ? "u" : "") + (pattern.dotAll ? "s" : ""));
31494
+ function max(...numbers) {
31495
+ return numbers.reduce((prev, cur) => bn(cur).gt(prev) ? bn(cur) : prev, bn(0));
31565
31496
  }
31566
31497
 
31567
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_clone.js
31568
- function _clone(value, deep, map) {
31569
- map || (map = new _ObjectMap());
31570
- if (_isPrimitive(value)) {
31571
- return value;
31572
- }
31573
- var copy = function copy2(copiedValue) {
31574
- var cachedCopy = map.get(value);
31575
- if (cachedCopy) {
31576
- return cachedCopy;
31577
- }
31578
- map.set(value, copiedValue);
31579
- for (var key in value) {
31580
- if (Object.prototype.hasOwnProperty.call(value, key)) {
31581
- copiedValue[key] = deep ? _clone(value[key], true, map) : value[key];
31582
- }
31583
- }
31584
- return copiedValue;
31585
- };
31586
- switch (type_default(value)) {
31587
- case "Object":
31588
- return copy(Object.create(Object.getPrototypeOf(value)));
31589
- case "Array":
31590
- return copy([]);
31591
- case "Date":
31592
- return new Date(value.valueOf());
31593
- case "RegExp":
31594
- return _cloneRegExp(value);
31595
- case "Int8Array":
31596
- case "Uint8Array":
31597
- case "Uint8ClampedArray":
31598
- case "Int16Array":
31599
- case "Uint16Array":
31600
- case "Int32Array":
31601
- case "Uint32Array":
31602
- case "Float32Array":
31603
- case "Float64Array":
31604
- case "BigInt64Array":
31605
- case "BigUint64Array":
31606
- return value.slice();
31607
- default:
31608
- return value;
31609
- }
31610
- }
31611
- function _isPrimitive(param) {
31612
- var type3 = typeof param;
31613
- return param == null || type3 != "object" && type3 != "function";
31614
- }
31615
- var _ObjectMap = /* @__PURE__ */ function() {
31616
- function _ObjectMap2() {
31617
- this.map = {};
31618
- this.length = 0;
31619
- }
31620
- _ObjectMap2.prototype.set = function(key, value) {
31621
- const hashedKey = this.hash(key);
31622
- let bucket = this.map[hashedKey];
31623
- if (!bucket) {
31624
- this.map[hashedKey] = bucket = [];
31625
- }
31626
- bucket.push([key, value]);
31627
- this.length += 1;
31628
- };
31629
- _ObjectMap2.prototype.hash = function(key) {
31630
- let hashedKey = [];
31631
- for (var value in key) {
31632
- hashedKey.push(Object.prototype.toString.call(key[value]));
31633
- }
31634
- return hashedKey.join();
31635
- };
31636
- _ObjectMap2.prototype.get = function(key) {
31637
- if (this.length <= 180) {
31638
- for (const p in this.map) {
31639
- const bucket2 = this.map[p];
31640
- for (let i = 0; i < bucket2.length; i += 1) {
31641
- const element = bucket2[i];
31642
- if (element[0] === key) {
31643
- return element[1];
31644
- }
31645
- }
31646
- }
31647
- return;
31648
- }
31649
- const hashedKey = this.hash(key);
31650
- const bucket = this.map[hashedKey];
31651
- if (!bucket) {
31652
- return;
31653
- }
31654
- for (let i = 0; i < bucket.length; i += 1) {
31655
- const element = bucket[i];
31656
- if (element[0] === key) {
31657
- return element[1];
31658
- }
31659
- }
31660
- };
31661
- return _ObjectMap2;
31662
- }();
31663
-
31664
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/clone.js
31665
- var clone = /* @__PURE__ */ _curry1(function clone2(value) {
31666
- return value != null && typeof value.clone === "function" ? value.clone() : _clone(value, true);
31667
- });
31668
- var clone_default = clone;
31669
-
31670
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/trim.js
31671
- var hasProtoTrim = typeof String.prototype.trim === "function";
31672
-
31673
31498
  // src/providers/coin-quantity.ts
31674
31499
  var coinQuantityfy = (coinQuantityLike) => {
31675
31500
  let assetId;
31676
31501
  let amount;
31677
- let max;
31502
+ let max2;
31678
31503
  if (Array.isArray(coinQuantityLike)) {
31679
31504
  amount = coinQuantityLike[0];
31680
- assetId = coinQuantityLike[1] ?? BaseAssetId;
31681
- max = coinQuantityLike[2] ?? void 0;
31505
+ assetId = coinQuantityLike[1];
31506
+ max2 = coinQuantityLike[2];
31682
31507
  } else {
31683
31508
  amount = coinQuantityLike.amount;
31684
- assetId = coinQuantityLike.assetId ?? BaseAssetId;
31685
- max = coinQuantityLike.max ?? void 0;
31509
+ assetId = coinQuantityLike.assetId;
31510
+ max2 = coinQuantityLike.max ?? void 0;
31686
31511
  }
31687
31512
  const bnAmount = bn(amount);
31688
31513
  return {
31689
31514
  assetId: hexlify(assetId),
31690
31515
  amount: bnAmount.lt(1) ? bn(1) : bnAmount,
31691
- max: max ? bn(max) : void 0
31516
+ max: max2 ? bn(max2) : void 0
31692
31517
  };
31693
31518
  };
31694
- var addAmountToCoinQuantities = (params) => {
31519
+ var addAmountToAsset = (params) => {
31695
31520
  const { amount, assetId } = params;
31696
31521
  const coinQuantities = [...params.coinQuantities];
31697
31522
  const assetIdx = coinQuantities.findIndex((coinQuantity) => coinQuantity.assetId === assetId);
@@ -31783,9 +31608,9 @@ This unreleased fuel-core build may include features and updates not yet support
31783
31608
  var TX_POINTER_LEN = WORD_SIZE * 2;
31784
31609
  var MAX_BYTES = 2 ** 32 - 1;
31785
31610
  var calculateVmTxMemory = ({ maxInputs }) => BYTES_32 + // Tx ID
31786
- ASSET_ID_LEN + // Base asset ID
31611
+ WORD_SIZE + // Tx size
31787
31612
  // Asset ID/Balance coin input pairs
31788
- maxInputs * (ASSET_ID_LEN + WORD_SIZE) + WORD_SIZE;
31613
+ maxInputs * (ASSET_ID_LEN + WORD_SIZE);
31789
31614
  var SCRIPT_FIXED_SIZE = WORD_SIZE + // Identifier
31790
31615
  WORD_SIZE + // Gas limit
31791
31616
  WORD_SIZE + // Script size
@@ -31803,6 +31628,7 @@ This unreleased fuel-core build may include features and updates not yet support
31803
31628
  ASSET_ID_LEN + // Asset id
31804
31629
  TX_POINTER_LEN + // TxPointer
31805
31630
  WORD_SIZE + // Witnesses index
31631
+ WORD_SIZE + // Maturity
31806
31632
  WORD_SIZE + // Predicate size
31807
31633
  WORD_SIZE + // Predicate data size
31808
31634
  WORD_SIZE;
@@ -32124,7 +31950,7 @@ This unreleased fuel-core build may include features and updates not yet support
32124
31950
  constructor(name, coders) {
32125
31951
  const caseIndexCoder = new BigNumberCoder("u64");
32126
31952
  const encodedValueSize = Object.values(coders).reduce(
32127
- (max, coder) => Math.max(max, coder.encodedLength),
31953
+ (max2, coder) => Math.max(max2, coder.encodedLength),
32128
31954
  0
32129
31955
  );
32130
31956
  super(`enum ${name}`, `enum ${name}`, caseIndexCoder.encodedLength + encodedValueSize);
@@ -32828,7 +32654,7 @@ This unreleased fuel-core build may include features and updates not yet support
32828
32654
  constructor(name, coders) {
32829
32655
  const caseIndexCoder = new BigNumberCoder("u64");
32830
32656
  const encodedValueSize = Object.values(coders).reduce(
32831
- (max, coder) => Math.max(max, coder.encodedLength),
32657
+ (max2, coder) => Math.max(max2, coder.encodedLength),
32832
32658
  0
32833
32659
  );
32834
32660
  super(`enum ${name}`, `enum ${name}`, caseIndexCoder.encodedLength + encodedValueSize);
@@ -33540,19 +33366,18 @@ This unreleased fuel-core build may include features and updates not yet support
33540
33366
  encode(value) {
33541
33367
  const parts = [];
33542
33368
  parts.push(new B256Coder().encode(value.txID));
33543
- parts.push(new NumberCoder("u16").encode(value.outputIndex));
33369
+ parts.push(new NumberCoder("u8").encode(value.outputIndex));
33544
33370
  parts.push(new B256Coder().encode(value.owner));
33545
33371
  parts.push(new BigNumberCoder("u64").encode(value.amount));
33546
33372
  parts.push(new B256Coder().encode(value.assetId));
33547
33373
  parts.push(new TxPointerCoder().encode(value.txPointer));
33548
- parts.push(new NumberCoder("u16").encode(value.witnessIndex));
33374
+ parts.push(new NumberCoder("u8").encode(value.witnessIndex));
33375
+ parts.push(new NumberCoder("u32").encode(value.maturity));
33549
33376
  parts.push(new BigNumberCoder("u64").encode(value.predicateGasUsed));
33550
- parts.push(new BigNumberCoder("u64").encode(value.predicateLength));
33551
- parts.push(new BigNumberCoder("u64").encode(value.predicateDataLength));
33552
- parts.push(new ByteArrayCoder(value.predicateLength.toNumber()).encode(value.predicate));
33553
- parts.push(
33554
- new ByteArrayCoder(value.predicateDataLength.toNumber()).encode(value.predicateData)
33555
- );
33377
+ parts.push(new NumberCoder("u32").encode(value.predicateLength));
33378
+ parts.push(new NumberCoder("u32").encode(value.predicateDataLength));
33379
+ parts.push(new ByteArrayCoder(value.predicateLength).encode(value.predicate));
33380
+ parts.push(new ByteArrayCoder(value.predicateDataLength).encode(value.predicateData));
33556
33381
  return concat(parts);
33557
33382
  }
33558
33383
  decode(data, offset) {
@@ -33560,7 +33385,7 @@ This unreleased fuel-core build may include features and updates not yet support
33560
33385
  let o = offset;
33561
33386
  [decoded, o] = new B256Coder().decode(data, o);
33562
33387
  const txID = decoded;
33563
- [decoded, o] = new NumberCoder("u16").decode(data, o);
33388
+ [decoded, o] = new NumberCoder("u8").decode(data, o);
33564
33389
  const outputIndex = decoded;
33565
33390
  [decoded, o] = new B256Coder().decode(data, o);
33566
33391
  const owner = decoded;
@@ -33570,17 +33395,19 @@ This unreleased fuel-core build may include features and updates not yet support
33570
33395
  const assetId = decoded;
33571
33396
  [decoded, o] = new TxPointerCoder().decode(data, o);
33572
33397
  const txPointer = decoded;
33573
- [decoded, o] = new NumberCoder("u16").decode(data, o);
33398
+ [decoded, o] = new NumberCoder("u8").decode(data, o);
33574
33399
  const witnessIndex = Number(decoded);
33400
+ [decoded, o] = new NumberCoder("u32").decode(data, o);
33401
+ const maturity = decoded;
33575
33402
  [decoded, o] = new BigNumberCoder("u64").decode(data, o);
33576
33403
  const predicateGasUsed = decoded;
33577
- [decoded, o] = new BigNumberCoder("u64").decode(data, o);
33404
+ [decoded, o] = new NumberCoder("u32").decode(data, o);
33578
33405
  const predicateLength = decoded;
33579
- [decoded, o] = new BigNumberCoder("u64").decode(data, o);
33406
+ [decoded, o] = new NumberCoder("u32").decode(data, o);
33580
33407
  const predicateDataLength = decoded;
33581
- [decoded, o] = new ByteArrayCoder(predicateLength.toNumber()).decode(data, o);
33408
+ [decoded, o] = new ByteArrayCoder(predicateLength).decode(data, o);
33582
33409
  const predicate = decoded;
33583
- [decoded, o] = new ByteArrayCoder(predicateDataLength.toNumber()).decode(data, o);
33410
+ [decoded, o] = new ByteArrayCoder(predicateDataLength).decode(data, o);
33584
33411
  const predicateData = decoded;
33585
33412
  return [
33586
33413
  {
@@ -33592,6 +33419,7 @@ This unreleased fuel-core build may include features and updates not yet support
33592
33419
  assetId,
33593
33420
  txPointer,
33594
33421
  witnessIndex,
33422
+ maturity,
33595
33423
  predicateGasUsed,
33596
33424
  predicateLength,
33597
33425
  predicateDataLength,
@@ -33609,7 +33437,7 @@ This unreleased fuel-core build may include features and updates not yet support
33609
33437
  encode(value) {
33610
33438
  const parts = [];
33611
33439
  parts.push(new B256Coder().encode(value.txID));
33612
- parts.push(new NumberCoder("u16").encode(value.outputIndex));
33440
+ parts.push(new NumberCoder("u8").encode(value.outputIndex));
33613
33441
  parts.push(new B256Coder().encode(value.balanceRoot));
33614
33442
  parts.push(new B256Coder().encode(value.stateRoot));
33615
33443
  parts.push(new TxPointerCoder().encode(value.txPointer));
@@ -33621,7 +33449,7 @@ This unreleased fuel-core build may include features and updates not yet support
33621
33449
  let o = offset;
33622
33450
  [decoded, o] = new B256Coder().decode(data, o);
33623
33451
  const txID = decoded;
33624
- [decoded, o] = new NumberCoder("u16").decode(data, o);
33452
+ [decoded, o] = new NumberCoder("u8").decode(data, o);
33625
33453
  const outputIndex = decoded;
33626
33454
  [decoded, o] = new B256Coder().decode(data, o);
33627
33455
  const balanceRoot = decoded;
@@ -33670,16 +33498,14 @@ This unreleased fuel-core build may include features and updates not yet support
33670
33498
  parts.push(new ByteArrayCoder(32).encode(value.recipient));
33671
33499
  parts.push(new BigNumberCoder("u64").encode(value.amount));
33672
33500
  parts.push(new ByteArrayCoder(32).encode(value.nonce));
33673
- parts.push(new NumberCoder("u16").encode(value.witnessIndex));
33501
+ parts.push(new NumberCoder("u8").encode(value.witnessIndex));
33674
33502
  parts.push(new BigNumberCoder("u64").encode(value.predicateGasUsed));
33675
- parts.push(new BigNumberCoder("u64").encode(data.length));
33676
- parts.push(new BigNumberCoder("u64").encode(value.predicateLength));
33677
- parts.push(new BigNumberCoder("u64").encode(value.predicateDataLength));
33503
+ parts.push(new NumberCoder("u32").encode(data.length));
33504
+ parts.push(new NumberCoder("u32").encode(value.predicateLength));
33505
+ parts.push(new NumberCoder("u32").encode(value.predicateDataLength));
33678
33506
  parts.push(new ByteArrayCoder(data.length).encode(data));
33679
- parts.push(new ByteArrayCoder(value.predicateLength.toNumber()).encode(value.predicate));
33680
- parts.push(
33681
- new ByteArrayCoder(value.predicateDataLength.toNumber()).encode(value.predicateData)
33682
- );
33507
+ parts.push(new ByteArrayCoder(value.predicateLength).encode(value.predicate));
33508
+ parts.push(new ByteArrayCoder(value.predicateDataLength).encode(value.predicateData));
33683
33509
  return concat(parts);
33684
33510
  }
33685
33511
  static decodeData(messageData) {
@@ -33699,21 +33525,21 @@ This unreleased fuel-core build may include features and updates not yet support
33699
33525
  const amount = decoded;
33700
33526
  [decoded, o] = new B256Coder().decode(data, o);
33701
33527
  const nonce = decoded;
33702
- [decoded, o] = new NumberCoder("u16").decode(data, o);
33528
+ [decoded, o] = new NumberCoder("u8").decode(data, o);
33703
33529
  const witnessIndex = Number(decoded);
33704
33530
  [decoded, o] = new BigNumberCoder("u64").decode(data, o);
33705
33531
  const predicateGasUsed = decoded;
33706
33532
  [decoded, o] = new NumberCoder("u32").decode(data, o);
33707
33533
  const dataLength2 = decoded;
33708
- [decoded, o] = new BigNumberCoder("u64").decode(data, o);
33534
+ [decoded, o] = new NumberCoder("u32").decode(data, o);
33709
33535
  const predicateLength = decoded;
33710
- [decoded, o] = new BigNumberCoder("u64").decode(data, o);
33536
+ [decoded, o] = new NumberCoder("u32").decode(data, o);
33711
33537
  const predicateDataLength = decoded;
33712
33538
  [decoded, o] = new ByteArrayCoder(dataLength2).decode(data, o);
33713
33539
  const messageData = decoded;
33714
- [decoded, o] = new ByteArrayCoder(predicateLength.toNumber()).decode(data, o);
33540
+ [decoded, o] = new ByteArrayCoder(predicateLength).decode(data, o);
33715
33541
  const predicate = decoded;
33716
- [decoded, o] = new ByteArrayCoder(predicateDataLength.toNumber()).decode(data, o);
33542
+ [decoded, o] = new ByteArrayCoder(predicateDataLength).decode(data, o);
33717
33543
  const predicateData = decoded;
33718
33544
  return [
33719
33545
  {
@@ -34025,7 +33851,7 @@ This unreleased fuel-core build may include features and updates not yet support
34025
33851
  }
34026
33852
  };
34027
33853
  var PolicyType = /* @__PURE__ */ ((PolicyType2) => {
34028
- PolicyType2[PolicyType2["Tip"] = 1] = "Tip";
33854
+ PolicyType2[PolicyType2["GasPrice"] = 1] = "GasPrice";
34029
33855
  PolicyType2[PolicyType2["WitnessLimit"] = 2] = "WitnessLimit";
34030
33856
  PolicyType2[PolicyType2["Maturity"] = 4] = "Maturity";
34031
33857
  PolicyType2[PolicyType2["MaxFee"] = 8] = "MaxFee";
@@ -34073,9 +33899,9 @@ This unreleased fuel-core build may include features and updates not yet support
34073
33899
  let o = offset;
34074
33900
  const policies = [];
34075
33901
  if (policyTypes & 1) {
34076
- const [tip, nextOffset] = new BigNumberCoder("u64").decode(data, o);
33902
+ const [gasPrice, nextOffset] = new BigNumberCoder("u64").decode(data, o);
34077
33903
  o = nextOffset;
34078
- policies.push({ type: 1, data: tip });
33904
+ policies.push({ type: 1, data: gasPrice });
34079
33905
  }
34080
33906
  if (policyTypes & 2) {
34081
33907
  const [witnessLimit, nextOffset] = new BigNumberCoder("u64").decode(data, o);
@@ -34307,15 +34133,15 @@ This unreleased fuel-core build may include features and updates not yet support
34307
34133
  encode(value) {
34308
34134
  const parts = [];
34309
34135
  parts.push(new BigNumberCoder("u64").encode(value.scriptGasLimit));
34310
- parts.push(new B256Coder().encode(value.receiptsRoot));
34311
- parts.push(new BigNumberCoder("u64").encode(value.scriptLength));
34312
- parts.push(new BigNumberCoder("u64").encode(value.scriptDataLength));
34136
+ parts.push(new NumberCoder("u32").encode(value.scriptLength));
34137
+ parts.push(new NumberCoder("u32").encode(value.scriptDataLength));
34313
34138
  parts.push(new NumberCoder("u32").encode(value.policyTypes));
34314
- parts.push(new NumberCoder("u16").encode(value.inputsCount));
34315
- parts.push(new NumberCoder("u16").encode(value.outputsCount));
34316
- parts.push(new NumberCoder("u16").encode(value.witnessesCount));
34317
- parts.push(new ByteArrayCoder(value.scriptLength.toNumber()).encode(value.script));
34318
- parts.push(new ByteArrayCoder(value.scriptDataLength.toNumber()).encode(value.scriptData));
34139
+ parts.push(new NumberCoder("u8").encode(value.inputsCount));
34140
+ parts.push(new NumberCoder("u8").encode(value.outputsCount));
34141
+ parts.push(new NumberCoder("u8").encode(value.witnessesCount));
34142
+ parts.push(new B256Coder().encode(value.receiptsRoot));
34143
+ parts.push(new ByteArrayCoder(value.scriptLength).encode(value.script));
34144
+ parts.push(new ByteArrayCoder(value.scriptDataLength).encode(value.scriptData));
34319
34145
  parts.push(new PoliciesCoder().encode(value.policies));
34320
34146
  parts.push(new ArrayCoder(new InputCoder(), value.inputsCount).encode(value.inputs));
34321
34147
  parts.push(new ArrayCoder(new OutputCoder(), value.outputsCount).encode(value.outputs));
@@ -34327,23 +34153,23 @@ This unreleased fuel-core build may include features and updates not yet support
34327
34153
  let o = offset;
34328
34154
  [decoded, o] = new BigNumberCoder("u64").decode(data, o);
34329
34155
  const scriptGasLimit = decoded;
34330
- [decoded, o] = new B256Coder().decode(data, o);
34331
- const receiptsRoot = decoded;
34332
- [decoded, o] = new BigNumberCoder("u64").decode(data, o);
34156
+ [decoded, o] = new NumberCoder("u32").decode(data, o);
34333
34157
  const scriptLength = decoded;
34334
- [decoded, o] = new BigNumberCoder("u64").decode(data, o);
34158
+ [decoded, o] = new NumberCoder("u32").decode(data, o);
34335
34159
  const scriptDataLength = decoded;
34336
34160
  [decoded, o] = new NumberCoder("u32").decode(data, o);
34337
34161
  const policyTypes = decoded;
34338
- [decoded, o] = new NumberCoder("u16").decode(data, o);
34162
+ [decoded, o] = new NumberCoder("u8").decode(data, o);
34339
34163
  const inputsCount = decoded;
34340
- [decoded, o] = new NumberCoder("u16").decode(data, o);
34164
+ [decoded, o] = new NumberCoder("u8").decode(data, o);
34341
34165
  const outputsCount = decoded;
34342
- [decoded, o] = new NumberCoder("u16").decode(data, o);
34166
+ [decoded, o] = new NumberCoder("u8").decode(data, o);
34343
34167
  const witnessesCount = decoded;
34344
- [decoded, o] = new ByteArrayCoder(scriptLength.toNumber()).decode(data, o);
34168
+ [decoded, o] = new B256Coder().decode(data, o);
34169
+ const receiptsRoot = decoded;
34170
+ [decoded, o] = new ByteArrayCoder(scriptLength).decode(data, o);
34345
34171
  const script = decoded;
34346
- [decoded, o] = new ByteArrayCoder(scriptDataLength.toNumber()).decode(data, o);
34172
+ [decoded, o] = new ByteArrayCoder(scriptDataLength).decode(data, o);
34347
34173
  const scriptData = decoded;
34348
34174
  [decoded, o] = new PoliciesCoder().decode(data, o, policyTypes);
34349
34175
  const policies = decoded;
@@ -34381,19 +34207,18 @@ This unreleased fuel-core build may include features and updates not yet support
34381
34207
  }
34382
34208
  encode(value) {
34383
34209
  const parts = [];
34384
- parts.push(new NumberCoder("u16").encode(value.bytecodeWitnessIndex));
34385
- parts.push(new B256Coder().encode(value.salt));
34386
- parts.push(new BigNumberCoder("u64").encode(value.storageSlotsCount));
34210
+ parts.push(new NumberCoder("u32").encode(value.bytecodeLength));
34211
+ parts.push(new NumberCoder("u8").encode(value.bytecodeWitnessIndex));
34387
34212
  parts.push(new NumberCoder("u32").encode(value.policyTypes));
34388
- parts.push(new NumberCoder("u16").encode(value.inputsCount));
34389
- parts.push(new NumberCoder("u16").encode(value.outputsCount));
34390
- parts.push(new NumberCoder("u16").encode(value.witnessesCount));
34213
+ parts.push(new NumberCoder("u16").encode(value.storageSlotsCount));
34214
+ parts.push(new NumberCoder("u8").encode(value.inputsCount));
34215
+ parts.push(new NumberCoder("u8").encode(value.outputsCount));
34216
+ parts.push(new NumberCoder("u8").encode(value.witnessesCount));
34217
+ parts.push(new B256Coder().encode(value.salt));
34218
+ parts.push(new PoliciesCoder().encode(value.policies));
34391
34219
  parts.push(
34392
- new ArrayCoder(new StorageSlotCoder(), value.storageSlotsCount.toNumber()).encode(
34393
- value.storageSlots
34394
- )
34220
+ new ArrayCoder(new StorageSlotCoder(), value.storageSlotsCount).encode(value.storageSlots)
34395
34221
  );
34396
- parts.push(new PoliciesCoder().encode(value.policies));
34397
34222
  parts.push(new ArrayCoder(new InputCoder(), value.inputsCount).encode(value.inputs));
34398
34223
  parts.push(new ArrayCoder(new OutputCoder(), value.outputsCount).encode(value.outputs));
34399
34224
  parts.push(new ArrayCoder(new WitnessCoder(), value.witnessesCount).encode(value.witnesses));
@@ -34402,27 +34227,26 @@ This unreleased fuel-core build may include features and updates not yet support
34402
34227
  decode(data, offset) {
34403
34228
  let decoded;
34404
34229
  let o = offset;
34405
- [decoded, o] = new NumberCoder("u16").decode(data, o);
34230
+ [decoded, o] = new NumberCoder("u32").decode(data, o);
34231
+ const bytecodeLength = decoded;
34232
+ [decoded, o] = new NumberCoder("u8").decode(data, o);
34406
34233
  const bytecodeWitnessIndex = decoded;
34407
- [decoded, o] = new B256Coder().decode(data, o);
34408
- const salt = decoded;
34409
- [decoded, o] = new BigNumberCoder("u64").decode(data, o);
34410
- const storageSlotsCount = decoded;
34411
34234
  [decoded, o] = new NumberCoder("u32").decode(data, o);
34412
34235
  const policyTypes = decoded;
34413
34236
  [decoded, o] = new NumberCoder("u16").decode(data, o);
34237
+ const storageSlotsCount = decoded;
34238
+ [decoded, o] = new NumberCoder("u8").decode(data, o);
34414
34239
  const inputsCount = decoded;
34415
- [decoded, o] = new NumberCoder("u16").decode(data, o);
34240
+ [decoded, o] = new NumberCoder("u8").decode(data, o);
34416
34241
  const outputsCount = decoded;
34417
- [decoded, o] = new NumberCoder("u16").decode(data, o);
34242
+ [decoded, o] = new NumberCoder("u8").decode(data, o);
34418
34243
  const witnessesCount = decoded;
34419
- [decoded, o] = new ArrayCoder(new StorageSlotCoder(), storageSlotsCount.toNumber()).decode(
34420
- data,
34421
- o
34422
- );
34423
- const storageSlots = decoded;
34244
+ [decoded, o] = new B256Coder().decode(data, o);
34245
+ const salt = decoded;
34424
34246
  [decoded, o] = new PoliciesCoder().decode(data, o, policyTypes);
34425
34247
  const policies = decoded;
34248
+ [decoded, o] = new ArrayCoder(new StorageSlotCoder(), storageSlotsCount).decode(data, o);
34249
+ const storageSlots = decoded;
34426
34250
  [decoded, o] = new ArrayCoder(new InputCoder(), inputsCount).decode(data, o);
34427
34251
  const inputs = decoded;
34428
34252
  [decoded, o] = new ArrayCoder(new OutputCoder(), outputsCount).decode(data, o);
@@ -34432,6 +34256,7 @@ This unreleased fuel-core build may include features and updates not yet support
34432
34256
  return [
34433
34257
  {
34434
34258
  type: 1,
34259
+ bytecodeLength,
34435
34260
  bytecodeWitnessIndex,
34436
34261
  policyTypes,
34437
34262
  storageSlotsCount,
@@ -34460,7 +34285,6 @@ This unreleased fuel-core build may include features and updates not yet support
34460
34285
  parts.push(new OutputContractCoder().encode(value.outputContract));
34461
34286
  parts.push(new BigNumberCoder("u64").encode(value.mintAmount));
34462
34287
  parts.push(new B256Coder().encode(value.mintAssetId));
34463
- parts.push(new BigNumberCoder("u64").encode(value.gasPrice));
34464
34288
  return concat(parts);
34465
34289
  }
34466
34290
  decode(data, offset) {
@@ -34476,8 +34300,6 @@ This unreleased fuel-core build may include features and updates not yet support
34476
34300
  const mintAmount = decoded;
34477
34301
  [decoded, o] = new B256Coder().decode(data, o);
34478
34302
  const mintAssetId = decoded;
34479
- [decoded, o] = new BigNumberCoder("u64").decode(data, o);
34480
- const gasPrice = decoded;
34481
34303
  return [
34482
34304
  {
34483
34305
  type: 2,
@@ -34485,8 +34307,7 @@ This unreleased fuel-core build may include features and updates not yet support
34485
34307
  inputContract,
34486
34308
  outputContract,
34487
34309
  mintAmount,
34488
- mintAssetId,
34489
- gasPrice
34310
+ mintAssetId
34490
34311
  },
34491
34312
  o
34492
34313
  ];
@@ -34793,6 +34614,159 @@ This unreleased fuel-core build may include features and updates not yet support
34793
34614
  // src/providers/provider.ts
34794
34615
  var import_graphql_request = __toESM(require_dist2());
34795
34616
 
34617
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isPlaceholder.js
34618
+ function _isPlaceholder(a) {
34619
+ return a != null && typeof a === "object" && a["@@functional/placeholder"] === true;
34620
+ }
34621
+
34622
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_curry1.js
34623
+ function _curry1(fn) {
34624
+ return function f1(a) {
34625
+ if (arguments.length === 0 || _isPlaceholder(a)) {
34626
+ return f1;
34627
+ } else {
34628
+ return fn.apply(this, arguments);
34629
+ }
34630
+ };
34631
+ }
34632
+
34633
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isArray.js
34634
+ var isArray_default = Array.isArray || function _isArray(val) {
34635
+ return val != null && val.length >= 0 && Object.prototype.toString.call(val) === "[object Array]";
34636
+ };
34637
+
34638
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/type.js
34639
+ var type = /* @__PURE__ */ _curry1(function type2(val) {
34640
+ return val === null ? "Null" : val === void 0 ? "Undefined" : Object.prototype.toString.call(val).slice(8, -1);
34641
+ });
34642
+ var type_default = type;
34643
+
34644
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_toISOString.js
34645
+ var pad = function pad2(n) {
34646
+ return (n < 10 ? "0" : "") + n;
34647
+ };
34648
+ var _toISOString = typeof Date.prototype.toISOString === "function" ? function _toISOString2(d) {
34649
+ return d.toISOString();
34650
+ } : function _toISOString3(d) {
34651
+ return d.getUTCFullYear() + "-" + pad(d.getUTCMonth() + 1) + "-" + pad(d.getUTCDate()) + "T" + pad(d.getUTCHours()) + ":" + pad(d.getUTCMinutes()) + ":" + pad(d.getUTCSeconds()) + "." + (d.getUTCMilliseconds() / 1e3).toFixed(3).slice(2, 5) + "Z";
34652
+ };
34653
+
34654
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isInteger.js
34655
+ var isInteger_default = Number.isInteger || function _isInteger(n) {
34656
+ return n << 0 === n;
34657
+ };
34658
+
34659
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_cloneRegExp.js
34660
+ function _cloneRegExp(pattern) {
34661
+ return new RegExp(pattern.source, pattern.flags ? pattern.flags : (pattern.global ? "g" : "") + (pattern.ignoreCase ? "i" : "") + (pattern.multiline ? "m" : "") + (pattern.sticky ? "y" : "") + (pattern.unicode ? "u" : "") + (pattern.dotAll ? "s" : ""));
34662
+ }
34663
+
34664
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_clone.js
34665
+ function _clone(value, deep, map) {
34666
+ map || (map = new _ObjectMap());
34667
+ if (_isPrimitive(value)) {
34668
+ return value;
34669
+ }
34670
+ var copy = function copy2(copiedValue) {
34671
+ var cachedCopy = map.get(value);
34672
+ if (cachedCopy) {
34673
+ return cachedCopy;
34674
+ }
34675
+ map.set(value, copiedValue);
34676
+ for (var key in value) {
34677
+ if (Object.prototype.hasOwnProperty.call(value, key)) {
34678
+ copiedValue[key] = deep ? _clone(value[key], true, map) : value[key];
34679
+ }
34680
+ }
34681
+ return copiedValue;
34682
+ };
34683
+ switch (type_default(value)) {
34684
+ case "Object":
34685
+ return copy(Object.create(Object.getPrototypeOf(value)));
34686
+ case "Array":
34687
+ return copy([]);
34688
+ case "Date":
34689
+ return new Date(value.valueOf());
34690
+ case "RegExp":
34691
+ return _cloneRegExp(value);
34692
+ case "Int8Array":
34693
+ case "Uint8Array":
34694
+ case "Uint8ClampedArray":
34695
+ case "Int16Array":
34696
+ case "Uint16Array":
34697
+ case "Int32Array":
34698
+ case "Uint32Array":
34699
+ case "Float32Array":
34700
+ case "Float64Array":
34701
+ case "BigInt64Array":
34702
+ case "BigUint64Array":
34703
+ return value.slice();
34704
+ default:
34705
+ return value;
34706
+ }
34707
+ }
34708
+ function _isPrimitive(param) {
34709
+ var type3 = typeof param;
34710
+ return param == null || type3 != "object" && type3 != "function";
34711
+ }
34712
+ var _ObjectMap = /* @__PURE__ */ function() {
34713
+ function _ObjectMap2() {
34714
+ this.map = {};
34715
+ this.length = 0;
34716
+ }
34717
+ _ObjectMap2.prototype.set = function(key, value) {
34718
+ const hashedKey = this.hash(key);
34719
+ let bucket = this.map[hashedKey];
34720
+ if (!bucket) {
34721
+ this.map[hashedKey] = bucket = [];
34722
+ }
34723
+ bucket.push([key, value]);
34724
+ this.length += 1;
34725
+ };
34726
+ _ObjectMap2.prototype.hash = function(key) {
34727
+ let hashedKey = [];
34728
+ for (var value in key) {
34729
+ hashedKey.push(Object.prototype.toString.call(key[value]));
34730
+ }
34731
+ return hashedKey.join();
34732
+ };
34733
+ _ObjectMap2.prototype.get = function(key) {
34734
+ if (this.length <= 180) {
34735
+ for (const p in this.map) {
34736
+ const bucket2 = this.map[p];
34737
+ for (let i = 0; i < bucket2.length; i += 1) {
34738
+ const element = bucket2[i];
34739
+ if (element[0] === key) {
34740
+ return element[1];
34741
+ }
34742
+ }
34743
+ }
34744
+ return;
34745
+ }
34746
+ const hashedKey = this.hash(key);
34747
+ const bucket = this.map[hashedKey];
34748
+ if (!bucket) {
34749
+ return;
34750
+ }
34751
+ for (let i = 0; i < bucket.length; i += 1) {
34752
+ const element = bucket[i];
34753
+ if (element[0] === key) {
34754
+ return element[1];
34755
+ }
34756
+ }
34757
+ };
34758
+ return _ObjectMap2;
34759
+ }();
34760
+
34761
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/clone.js
34762
+ var clone2 = /* @__PURE__ */ _curry1(function clone3(value) {
34763
+ return value != null && typeof value.clone === "function" ? value.clone() : _clone(value, true);
34764
+ });
34765
+ var clone_default = clone2;
34766
+
34767
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/trim.js
34768
+ var hasProtoTrim = typeof String.prototype.trim === "function";
34769
+
34796
34770
  // ../../node_modules/.pnpm/tslib@2.6.0/node_modules/tslib/tslib.es6.mjs
34797
34771
  var __assign = function() {
34798
34772
  __assign = Object.assign || function __assign2(t) {
@@ -37960,10 +37934,14 @@ spurious results.`);
37960
37934
  // src/providers/__generated__/operations.ts
37961
37935
  var ReceiptFragmentFragmentDoc = lib_default2`
37962
37936
  fragment receiptFragment on Receipt {
37963
- id
37937
+ contract {
37938
+ id
37939
+ }
37964
37940
  pc
37965
37941
  is
37966
- to
37942
+ to {
37943
+ id
37944
+ }
37967
37945
  toAddress
37968
37946
  amount
37969
37947
  assetId
@@ -38001,16 +37979,10 @@ spurious results.`);
38001
37979
  id
38002
37980
  }
38003
37981
  time
38004
- receipts {
38005
- ...receiptFragment
38006
- }
38007
37982
  programState {
38008
37983
  returnType
38009
37984
  data
38010
37985
  }
38011
- receipts {
38012
- ...receiptFragment
38013
- }
38014
37986
  }
38015
37987
  ... on FailureStatus {
38016
37988
  block {
@@ -38018,24 +37990,26 @@ spurious results.`);
38018
37990
  }
38019
37991
  time
38020
37992
  reason
38021
- receipts {
38022
- ...receiptFragment
38023
- }
38024
37993
  }
38025
37994
  ... on SqueezedOutStatus {
38026
37995
  reason
38027
37996
  }
38028
37997
  }
38029
- ${ReceiptFragmentFragmentDoc}`;
37998
+ `;
38030
37999
  var TransactionFragmentFragmentDoc = lib_default2`
38031
38000
  fragment transactionFragment on Transaction {
38032
38001
  id
38033
38002
  rawPayload
38003
+ gasPrice
38004
+ receipts {
38005
+ ...receiptFragment
38006
+ }
38034
38007
  status {
38035
38008
  ...transactionStatusFragment
38036
38009
  }
38037
38010
  }
38038
- ${TransactionStatusFragmentFragmentDoc}`;
38011
+ ${ReceiptFragmentFragmentDoc}
38012
+ ${TransactionStatusFragmentFragmentDoc}`;
38039
38013
  var InputEstimatePredicatesFragmentFragmentDoc = lib_default2`
38040
38014
  fragment inputEstimatePredicatesFragment on Input {
38041
38015
  ... on InputCoin {
@@ -38053,46 +38027,6 @@ spurious results.`);
38053
38027
  }
38054
38028
  }
38055
38029
  ${InputEstimatePredicatesFragmentFragmentDoc}`;
38056
- var DryRunFailureStatusFragmentFragmentDoc = lib_default2`
38057
- fragment dryRunFailureStatusFragment on DryRunFailureStatus {
38058
- reason
38059
- programState {
38060
- returnType
38061
- data
38062
- }
38063
- }
38064
- `;
38065
- var DryRunSuccessStatusFragmentFragmentDoc = lib_default2`
38066
- fragment dryRunSuccessStatusFragment on DryRunSuccessStatus {
38067
- programState {
38068
- returnType
38069
- data
38070
- }
38071
- }
38072
- `;
38073
- var DryRunTransactionStatusFragmentFragmentDoc = lib_default2`
38074
- fragment dryRunTransactionStatusFragment on DryRunTransactionStatus {
38075
- ... on DryRunFailureStatus {
38076
- ...dryRunFailureStatusFragment
38077
- }
38078
- ... on DryRunSuccessStatus {
38079
- ...dryRunSuccessStatusFragment
38080
- }
38081
- }
38082
- ${DryRunFailureStatusFragmentFragmentDoc}
38083
- ${DryRunSuccessStatusFragmentFragmentDoc}`;
38084
- var DryRunTransactionExecutionStatusFragmentFragmentDoc = lib_default2`
38085
- fragment dryRunTransactionExecutionStatusFragment on DryRunTransactionExecutionStatus {
38086
- id
38087
- status {
38088
- ...dryRunTransactionStatusFragment
38089
- }
38090
- receipts {
38091
- ...receiptFragment
38092
- }
38093
- }
38094
- ${DryRunTransactionStatusFragmentFragmentDoc}
38095
- ${ReceiptFragmentFragmentDoc}`;
38096
38030
  var CoinFragmentFragmentDoc = lib_default2`
38097
38031
  fragment coinFragment on Coin {
38098
38032
  __typename
@@ -38100,6 +38034,7 @@ ${ReceiptFragmentFragmentDoc}`;
38100
38034
  owner
38101
38035
  amount
38102
38036
  assetId
38037
+ maturity
38103
38038
  blockCreated
38104
38039
  txCreatedIdx
38105
38040
  }
@@ -38144,6 +38079,7 @@ ${ReceiptFragmentFragmentDoc}`;
38144
38079
  prevRoot
38145
38080
  time
38146
38081
  applicationHash
38082
+ messageReceiptRoot
38147
38083
  messageReceiptCount
38148
38084
  }
38149
38085
  commitBlockHeader {
@@ -38155,6 +38091,7 @@ ${ReceiptFragmentFragmentDoc}`;
38155
38091
  prevRoot
38156
38092
  time
38157
38093
  applicationHash
38094
+ messageReceiptRoot
38158
38095
  messageReceiptCount
38159
38096
  }
38160
38097
  sender
@@ -38174,8 +38111,8 @@ ${ReceiptFragmentFragmentDoc}`;
38174
38111
  var BlockFragmentFragmentDoc = lib_default2`
38175
38112
  fragment blockFragment on Block {
38176
38113
  id
38177
- height
38178
38114
  header {
38115
+ height
38179
38116
  time
38180
38117
  }
38181
38118
  transactions {
@@ -38233,11 +38170,6 @@ ${ReceiptFragmentFragmentDoc}`;
38233
38170
  `;
38234
38171
  var GasCostsFragmentFragmentDoc = lib_default2`
38235
38172
  fragment GasCostsFragment on GasCosts {
38236
- version {
38237
- ... on Version {
38238
- value
38239
- }
38240
- }
38241
38173
  add
38242
38174
  addi
38243
38175
  aloc
@@ -38250,6 +38182,7 @@ ${ReceiptFragmentFragmentDoc}`;
38250
38182
  cb
38251
38183
  cfei
38252
38184
  cfsi
38185
+ croo
38253
38186
  div
38254
38187
  divi
38255
38188
  ecr1
@@ -38332,9 +38265,6 @@ ${ReceiptFragmentFragmentDoc}`;
38332
38265
  ccp {
38333
38266
  ...DependentCostFragment
38334
38267
  }
38335
- croo {
38336
- ...DependentCostFragment
38337
- }
38338
38268
  csiz {
38339
38269
  ...DependentCostFragment
38340
38270
  }
@@ -38394,11 +38324,6 @@ ${ReceiptFragmentFragmentDoc}`;
38394
38324
  ${DependentCostFragmentFragmentDoc}`;
38395
38325
  var ConsensusParametersFragmentFragmentDoc = lib_default2`
38396
38326
  fragment consensusParametersFragment on ConsensusParameters {
38397
- version {
38398
- ... on Version {
38399
- value
38400
- }
38401
- }
38402
38327
  txParams {
38403
38328
  ...TxParametersFragment
38404
38329
  }
@@ -38458,9 +38383,18 @@ ${ConsensusParametersFragmentFragmentDoc}`;
38458
38383
  fragment nodeInfoFragment on NodeInfo {
38459
38384
  utxoValidation
38460
38385
  vmBacktrace
38386
+ minGasPrice
38461
38387
  maxTx
38462
38388
  maxDepth
38463
38389
  nodeVersion
38390
+ peers {
38391
+ id
38392
+ addresses
38393
+ clientVersion
38394
+ blockHeight
38395
+ lastHeartbeatMs
38396
+ appScore
38397
+ }
38464
38398
  }
38465
38399
  `;
38466
38400
  var GetVersionDocument = lib_default2`
@@ -38495,9 +38429,13 @@ ${ConsensusParametersFragmentFragmentDoc}`;
38495
38429
  query getTransactionWithReceipts($transactionId: TransactionId!) {
38496
38430
  transaction(id: $transactionId) {
38497
38431
  ...transactionFragment
38432
+ receipts {
38433
+ ...receiptFragment
38434
+ }
38498
38435
  }
38499
38436
  }
38500
- ${TransactionFragmentFragmentDoc}`;
38437
+ ${TransactionFragmentFragmentDoc}
38438
+ ${ReceiptFragmentFragmentDoc}`;
38501
38439
  var GetTransactionsDocument = lib_default2`
38502
38440
  query getTransactions($after: String, $before: String, $first: Int, $last: Int) {
38503
38441
  transactions(after: $after, before: $before, first: $first, last: $last) {
@@ -38625,20 +38563,6 @@ ${MessageCoinFragmentFragmentDoc}`;
38625
38563
  }
38626
38564
  }
38627
38565
  ${BalanceFragmentFragmentDoc}`;
38628
- var GetLatestGasPriceDocument = lib_default2`
38629
- query getLatestGasPrice {
38630
- latestGasPrice {
38631
- gasPrice
38632
- }
38633
- }
38634
- `;
38635
- var EstimateGasPriceDocument = lib_default2`
38636
- query estimateGasPrice($blockHorizon: U32!) {
38637
- estimateGasPrice(blockHorizon: $blockHorizon) {
38638
- gasPrice
38639
- }
38640
- }
38641
- `;
38642
38566
  var GetBalancesDocument = lib_default2`
38643
38567
  query getBalances($filter: BalanceFilterInput!, $after: String, $before: String, $first: Int, $last: Int) {
38644
38568
  balances(
@@ -38693,12 +38617,12 @@ ${MessageCoinFragmentFragmentDoc}`;
38693
38617
  }
38694
38618
  `;
38695
38619
  var DryRunDocument = lib_default2`
38696
- mutation dryRun($encodedTransactions: [HexString!]!, $utxoValidation: Boolean) {
38697
- dryRun(txs: $encodedTransactions, utxoValidation: $utxoValidation) {
38698
- ...dryRunTransactionExecutionStatusFragment
38620
+ mutation dryRun($encodedTransaction: HexString!, $utxoValidation: Boolean) {
38621
+ dryRun(tx: $encodedTransaction, utxoValidation: $utxoValidation) {
38622
+ ...receiptFragment
38699
38623
  }
38700
38624
  }
38701
- ${DryRunTransactionExecutionStatusFragmentFragmentDoc}`;
38625
+ ${ReceiptFragmentFragmentDoc}`;
38702
38626
  var SubmitDocument = lib_default2`
38703
38627
  mutation submit($encodedTransaction: HexString!) {
38704
38628
  submit(tx: $encodedTransaction) {
@@ -38781,12 +38705,6 @@ ${MessageCoinFragmentFragmentDoc}`;
38781
38705
  getBalance(variables, options) {
38782
38706
  return requester(GetBalanceDocument, variables, options);
38783
38707
  },
38784
- getLatestGasPrice(variables, options) {
38785
- return requester(GetLatestGasPriceDocument, variables, options);
38786
- },
38787
- estimateGasPrice(variables, options) {
38788
- return requester(EstimateGasPriceDocument, variables, options);
38789
- },
38790
38708
  getBalances(variables, options) {
38791
38709
  return requester(GetBalancesDocument, variables, options);
38792
38710
  },
@@ -38854,14 +38772,11 @@ ${MessageCoinFragmentFragmentDoc}`;
38854
38772
  let data;
38855
38773
  let errors;
38856
38774
  try {
38857
- const sanitizedText = text.replace(/\s/g, "");
38858
- ({ data, errors } = JSON.parse(sanitizedText.replace(/^data:/, "")));
38775
+ ({ data, errors } = JSON.parse(text.replace(/^data:/, "")));
38859
38776
  } catch (e) {
38860
38777
  throw new FuelError(
38861
38778
  ErrorCode.STREAM_PARSING_ERROR,
38862
- `Error while parsing stream data response: ${text}
38863
-
38864
- Thrown error: ${e}`
38779
+ `Error while parsing stream data response: ${text}`
38865
38780
  );
38866
38781
  }
38867
38782
  if (Array.isArray(errors)) {
@@ -38945,6 +38860,9 @@ Thrown error: ${e}`
38945
38860
  }
38946
38861
  };
38947
38862
 
38863
+ // ../address/dist/configs.mjs
38864
+ var ZeroBytes32 = "0x0000000000000000000000000000000000000000000000000000000000000000";
38865
+
38948
38866
  // src/providers/transaction-request/input.ts
38949
38867
  var inputify = (value) => {
38950
38868
  const { type: type3 } = value;
@@ -38955,7 +38873,7 @@ Thrown error: ${e}`
38955
38873
  return {
38956
38874
  type: InputType.Coin,
38957
38875
  txID: hexlify(arrayify(value.id).slice(0, 32)),
38958
- outputIndex: toNumber2(arrayify(value.id).slice(32, 34)),
38876
+ outputIndex: arrayify(value.id)[32],
38959
38877
  owner: hexlify(value.owner),
38960
38878
  amount: bn(value.amount),
38961
38879
  assetId: hexlify(value.assetId),
@@ -38964,9 +38882,10 @@ Thrown error: ${e}`
38964
38882
  txIndex: toNumber2(arrayify(value.txPointer).slice(8, 16))
38965
38883
  },
38966
38884
  witnessIndex: value.witnessIndex,
38885
+ maturity: value.maturity ?? 0,
38967
38886
  predicateGasUsed: bn(value.predicateGasUsed),
38968
- predicateLength: bn(predicate.length),
38969
- predicateDataLength: bn(predicateData.length),
38887
+ predicateLength: predicate.length,
38888
+ predicateDataLength: predicateData.length,
38970
38889
  predicate: hexlify(predicate),
38971
38890
  predicateData: hexlify(predicateData)
38972
38891
  };
@@ -38997,8 +38916,8 @@ Thrown error: ${e}`
38997
38916
  nonce: hexlify(value.nonce),
38998
38917
  witnessIndex: value.witnessIndex,
38999
38918
  predicateGasUsed: bn(value.predicateGasUsed),
39000
- predicateLength: bn(predicate.length),
39001
- predicateDataLength: bn(predicateData.length),
38919
+ predicateLength: predicate.length,
38920
+ predicateDataLength: predicateData.length,
39002
38921
  predicate: hexlify(predicate),
39003
38922
  predicateData: hexlify(predicateData),
39004
38923
  data: hexlify(data),
@@ -39158,8 +39077,8 @@ Thrown error: ${e}`
39158
39077
  case "CALL" /* Call */: {
39159
39078
  const callReceipt = {
39160
39079
  type: ReceiptType.Call,
39161
- from: hexOrZero(receipt.id || receipt.contractId),
39162
- to: hexOrZero(receipt?.to),
39080
+ from: hexOrZero(receipt.contract?.id),
39081
+ to: hexOrZero(receipt?.to?.id),
39163
39082
  amount: bn(receipt.amount),
39164
39083
  assetId: hexOrZero(receipt.assetId),
39165
39084
  gas: bn(receipt.gas),
@@ -39173,7 +39092,7 @@ Thrown error: ${e}`
39173
39092
  case "RETURN" /* Return */: {
39174
39093
  const returnReceipt = {
39175
39094
  type: ReceiptType.Return,
39176
- id: hexOrZero(receipt.id || receipt.contractId),
39095
+ id: hexOrZero(receipt.contract?.id),
39177
39096
  val: bn(receipt.val),
39178
39097
  pc: bn(receipt.pc),
39179
39098
  is: bn(receipt.is)
@@ -39183,7 +39102,7 @@ Thrown error: ${e}`
39183
39102
  case "RETURN_DATA" /* ReturnData */: {
39184
39103
  const returnDataReceipt = {
39185
39104
  type: ReceiptType.ReturnData,
39186
- id: hexOrZero(receipt.id || receipt.contractId),
39105
+ id: hexOrZero(receipt.contract?.id),
39187
39106
  ptr: bn(receipt.ptr),
39188
39107
  len: bn(receipt.len),
39189
39108
  digest: hexOrZero(receipt.digest),
@@ -39195,7 +39114,7 @@ Thrown error: ${e}`
39195
39114
  case "PANIC" /* Panic */: {
39196
39115
  const panicReceipt = {
39197
39116
  type: ReceiptType.Panic,
39198
- id: hexOrZero(receipt.id),
39117
+ id: hexOrZero(receipt.contract?.id),
39199
39118
  reason: bn(receipt.reason),
39200
39119
  pc: bn(receipt.pc),
39201
39120
  is: bn(receipt.is),
@@ -39206,7 +39125,7 @@ Thrown error: ${e}`
39206
39125
  case "REVERT" /* Revert */: {
39207
39126
  const revertReceipt = {
39208
39127
  type: ReceiptType.Revert,
39209
- id: hexOrZero(receipt.id || receipt.contractId),
39128
+ id: hexOrZero(receipt.contract?.id),
39210
39129
  val: bn(receipt.ra),
39211
39130
  pc: bn(receipt.pc),
39212
39131
  is: bn(receipt.is)
@@ -39216,7 +39135,7 @@ Thrown error: ${e}`
39216
39135
  case "LOG" /* Log */: {
39217
39136
  const logReceipt = {
39218
39137
  type: ReceiptType.Log,
39219
- id: hexOrZero(receipt.id || receipt.contractId),
39138
+ id: hexOrZero(receipt.contract?.id),
39220
39139
  val0: bn(receipt.ra),
39221
39140
  val1: bn(receipt.rb),
39222
39141
  val2: bn(receipt.rc),
@@ -39229,7 +39148,7 @@ Thrown error: ${e}`
39229
39148
  case "LOG_DATA" /* LogData */: {
39230
39149
  const logDataReceipt = {
39231
39150
  type: ReceiptType.LogData,
39232
- id: hexOrZero(receipt.id || receipt.contractId),
39151
+ id: hexOrZero(receipt.contract?.id),
39233
39152
  val0: bn(receipt.ra),
39234
39153
  val1: bn(receipt.rb),
39235
39154
  ptr: bn(receipt.ptr),
@@ -39243,8 +39162,8 @@ Thrown error: ${e}`
39243
39162
  case "TRANSFER" /* Transfer */: {
39244
39163
  const transferReceipt = {
39245
39164
  type: ReceiptType.Transfer,
39246
- from: hexOrZero(receipt.id || receipt.contractId),
39247
- to: hexOrZero(receipt.toAddress || receipt?.to),
39165
+ from: hexOrZero(receipt.contract?.id),
39166
+ to: hexOrZero(receipt.toAddress || receipt?.to?.id),
39248
39167
  amount: bn(receipt.amount),
39249
39168
  assetId: hexOrZero(receipt.assetId),
39250
39169
  pc: bn(receipt.pc),
@@ -39255,8 +39174,8 @@ Thrown error: ${e}`
39255
39174
  case "TRANSFER_OUT" /* TransferOut */: {
39256
39175
  const transferOutReceipt = {
39257
39176
  type: ReceiptType.TransferOut,
39258
- from: hexOrZero(receipt.id || receipt.contractId),
39259
- to: hexOrZero(receipt.toAddress || receipt.to),
39177
+ from: hexOrZero(receipt.contract?.id),
39178
+ to: hexOrZero(receipt.toAddress || receipt.to?.id),
39260
39179
  amount: bn(receipt.amount),
39261
39180
  assetId: hexOrZero(receipt.assetId),
39262
39181
  pc: bn(receipt.pc),
@@ -39299,7 +39218,7 @@ Thrown error: ${e}`
39299
39218
  return receiptMessageOut;
39300
39219
  }
39301
39220
  case "MINT" /* Mint */: {
39302
- const contractId = hexOrZero(receipt.id || receipt.contractId);
39221
+ const contractId = hexOrZero(receipt.contract?.id);
39303
39222
  const subId = hexOrZero(receipt.subId);
39304
39223
  const assetId = ReceiptMintCoder.getAssetId(contractId, subId);
39305
39224
  const mintReceipt = {
@@ -39314,7 +39233,7 @@ Thrown error: ${e}`
39314
39233
  return mintReceipt;
39315
39234
  }
39316
39235
  case "BURN" /* Burn */: {
39317
- const contractId = hexOrZero(receipt.id || receipt.contractId);
39236
+ const contractId = hexOrZero(receipt.contract?.id);
39318
39237
  const subId = hexOrZero(receipt.subId);
39319
39238
  const assetId = ReceiptBurnCoder.getAssetId(contractId, subId);
39320
39239
  const burnReceipt = {
@@ -39395,6 +39314,7 @@ Thrown error: ${e}`
39395
39314
  };
39396
39315
 
39397
39316
  // src/providers/utils/gas.ts
39317
+ var calculatePriceWithFactor = (gas, gasPrice, priceFactor) => bn(Math.ceil(gas.mul(gasPrice).toNumber() / priceFactor.toNumber()));
39398
39318
  var getGasUsedFromReceipts = (receipts) => {
39399
39319
  const scriptResult = receipts.filter(
39400
39320
  (receipt) => receipt.type === ReceiptType.ScriptResult
@@ -39415,28 +39335,18 @@ Thrown error: ${e}`
39415
39335
  }
39416
39336
  function gasUsedByInputs(inputs, txBytesSize, gasCosts) {
39417
39337
  const witnessCache = [];
39418
- const chargeableInputs = inputs.filter((input) => {
39419
- const isCoinOrMessage = "owner" in input || "sender" in input;
39420
- if (isCoinOrMessage) {
39421
- if ("predicate" in input && input.predicate && input.predicate !== "0x") {
39422
- return true;
39423
- }
39424
- if (!witnessCache.includes(input.witnessIndex)) {
39425
- witnessCache.push(input.witnessIndex);
39426
- return true;
39427
- }
39428
- }
39429
- return false;
39430
- });
39431
- const vmInitializationCost = resolveGasDependentCosts(txBytesSize, gasCosts.vmInitialization);
39432
- const totalGas = chargeableInputs.reduce((total, input) => {
39338
+ const totalGas = inputs.reduce((total, input) => {
39433
39339
  if ("predicate" in input && input.predicate && input.predicate !== "0x") {
39434
39340
  return total.add(
39435
- vmInitializationCost.add(resolveGasDependentCosts(arrayify(input.predicate).length, gasCosts.contractRoot)).add(bn(input.predicateGasUsed))
39341
+ resolveGasDependentCosts(txBytesSize, gasCosts.vmInitialization).add(resolveGasDependentCosts(arrayify(input.predicate).length, gasCosts.contractRoot)).add(bn(input.predicateGasUsed))
39436
39342
  );
39437
39343
  }
39438
- return total.add(gasCosts.ecr1);
39439
- }, bn(0));
39344
+ if ("witnessIndex" in input && !witnessCache.includes(input.witnessIndex)) {
39345
+ witnessCache.push(input.witnessIndex);
39346
+ return total.add(gasCosts.ecr1);
39347
+ }
39348
+ return total;
39349
+ }, bn());
39440
39350
  return totalGas;
39441
39351
  }
39442
39352
  function getMinGas(params) {
@@ -39448,20 +39358,12 @@ Thrown error: ${e}`
39448
39358
  return minGas;
39449
39359
  }
39450
39360
  function getMaxGas(params) {
39451
- const {
39452
- gasPerByte,
39453
- witnessesLength,
39454
- witnessLimit,
39455
- minGas,
39456
- gasLimit = bn(0),
39457
- maxGasPerTx
39458
- } = params;
39361
+ const { gasPerByte, witnessesLength, witnessLimit, minGas, gasLimit = bn(0) } = params;
39459
39362
  let remainingAllowedWitnessGas = bn(0);
39460
39363
  if (witnessLimit?.gt(0) && witnessLimit.gte(witnessesLength)) {
39461
39364
  remainingAllowedWitnessGas = bn(witnessLimit).sub(witnessesLength).mul(gasPerByte);
39462
39365
  }
39463
- const maxGas = remainingAllowedWitnessGas.add(minGas).add(gasLimit);
39464
- return maxGas.gte(maxGasPerTx) ? maxGasPerTx : maxGas;
39366
+ return remainingAllowedWitnessGas.add(minGas).add(gasLimit);
39465
39367
  }
39466
39368
  function calculateMetadataGasForTxCreate({
39467
39369
  gasCosts,
@@ -39483,10 +39385,6 @@ Thrown error: ${e}`
39483
39385
  }) {
39484
39386
  return resolveGasDependentCosts(txBytesSize, gasCosts.s256);
39485
39387
  }
39486
- var calculateGasFee = (params) => {
39487
- const { gas, gasPrice, priceFactor, tip } = params;
39488
- return gas.mul(gasPrice).div(priceFactor).add(tip);
39489
- };
39490
39388
 
39491
39389
  // src/providers/utils/json.ts
39492
39390
  function normalize2(object) {
@@ -39628,7 +39526,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
39628
39526
  // src/providers/transaction-request/transaction-request.ts
39629
39527
  var BaseTransactionRequest = class {
39630
39528
  /** Gas price for transaction */
39631
- tip;
39529
+ gasPrice;
39632
39530
  /** Block until which tx cannot be included */
39633
39531
  maturity;
39634
39532
  /** The maximum fee payable by this transaction using BASE_ASSET. */
@@ -39641,34 +39539,38 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
39641
39539
  outputs = [];
39642
39540
  /** List of witnesses */
39643
39541
  witnesses = [];
39542
+ /** Base asset ID - should be fetched from the chain */
39543
+ baseAssetId;
39644
39544
  /**
39645
39545
  * Constructor for initializing a base transaction request.
39646
39546
  *
39647
39547
  * @param baseTransactionRequest - Optional object containing properties to initialize the transaction request.
39648
39548
  */
39649
39549
  constructor({
39650
- tip,
39550
+ gasPrice,
39651
39551
  maturity,
39652
39552
  maxFee,
39653
39553
  witnessLimit,
39654
39554
  inputs,
39655
39555
  outputs,
39656
- witnesses
39657
- } = {}) {
39658
- this.tip = bn(tip);
39556
+ witnesses,
39557
+ baseAssetId
39558
+ }) {
39559
+ this.gasPrice = bn(gasPrice);
39659
39560
  this.maturity = maturity ?? 0;
39660
39561
  this.witnessLimit = witnessLimit ? bn(witnessLimit) : void 0;
39661
39562
  this.maxFee = maxFee ? bn(maxFee) : void 0;
39662
39563
  this.inputs = inputs ?? [];
39663
39564
  this.outputs = outputs ?? [];
39664
39565
  this.witnesses = witnesses ?? [];
39566
+ this.baseAssetId = baseAssetId;
39665
39567
  }
39666
39568
  static getPolicyMeta(req) {
39667
39569
  let policyTypes = 0;
39668
39570
  const policies = [];
39669
- if (req.tip) {
39670
- policyTypes += PolicyType.Tip;
39671
- policies.push({ data: req.tip, type: PolicyType.Tip });
39571
+ if (req.gasPrice) {
39572
+ policyTypes += PolicyType.GasPrice;
39573
+ policies.push({ data: req.gasPrice, type: PolicyType.GasPrice });
39672
39574
  }
39673
39575
  if (req.witnessLimit) {
39674
39576
  policyTypes += PolicyType.WitnessLimit;
@@ -39855,10 +39757,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
39855
39757
  * @param predicate - Predicate bytes.
39856
39758
  * @param predicateData - Predicate data bytes.
39857
39759
  */
39858
- addCoinInput(coin) {
39760
+ addCoinInput(coin, predicate) {
39859
39761
  const { assetId, owner, amount } = coin;
39860
39762
  let witnessIndex;
39861
- if (coin.predicate) {
39763
+ if (predicate) {
39862
39764
  witnessIndex = 0;
39863
39765
  } else {
39864
39766
  witnessIndex = this.getCoinInputWitnessIndexByOwner(owner);
@@ -39873,7 +39775,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
39873
39775
  amount,
39874
39776
  assetId,
39875
39777
  txPointer: "0x00000000000000000000000000000000",
39876
- witnessIndex
39778
+ witnessIndex,
39779
+ predicate: predicate?.bytes
39877
39780
  };
39878
39781
  this.pushInput(input);
39879
39782
  this.addChangeOutput(owner, assetId);
@@ -39884,13 +39787,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
39884
39787
  *
39885
39788
  * @param message - Message resource.
39886
39789
  * @param predicate - Predicate bytes.
39887
- * @param predicateData - Predicate data bytes.
39888
39790
  */
39889
- addMessageInput(message) {
39791
+ addMessageInput(message, predicate) {
39890
39792
  const { recipient, sender, amount } = message;
39891
- const assetId = BaseAssetId;
39892
39793
  let witnessIndex;
39893
- if (message.predicate) {
39794
+ if (predicate) {
39894
39795
  witnessIndex = 0;
39895
39796
  } else {
39896
39797
  witnessIndex = this.getCoinInputWitnessIndexByOwner(recipient);
@@ -39904,10 +39805,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
39904
39805
  sender: sender.toB256(),
39905
39806
  recipient: recipient.toB256(),
39906
39807
  amount,
39907
- witnessIndex
39808
+ witnessIndex,
39809
+ predicate: predicate?.bytes
39908
39810
  };
39909
39811
  this.pushInput(input);
39910
- this.addChangeOutput(recipient, assetId);
39812
+ this.addChangeOutput(recipient, this.baseAssetId);
39911
39813
  }
39912
39814
  /**
39913
39815
  * Adds a single resource to the transaction by adding a coin/message input and a
@@ -39935,6 +39837,32 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
39935
39837
  resources.forEach((resource) => this.addResource(resource));
39936
39838
  return this;
39937
39839
  }
39840
+ /**
39841
+ * Adds multiple resources to the transaction by adding coin/message inputs and change
39842
+ * outputs from the related assetIds.
39843
+ *
39844
+ * @param resources - The resources to add.
39845
+ * @returns This transaction.
39846
+ */
39847
+ addPredicateResource(resource, predicate) {
39848
+ if (isCoin(resource)) {
39849
+ this.addCoinInput(resource, predicate);
39850
+ } else {
39851
+ this.addMessageInput(resource, predicate);
39852
+ }
39853
+ return this;
39854
+ }
39855
+ /**
39856
+ * Adds multiple predicate coin/message inputs to the transaction and change outputs
39857
+ * from the related assetIds.
39858
+ *
39859
+ * @param resources - The resources to add.
39860
+ * @returns This transaction.
39861
+ */
39862
+ addPredicateResources(resources, predicate) {
39863
+ resources.forEach((resource) => this.addPredicateResource(resource, predicate));
39864
+ return this;
39865
+ }
39938
39866
  /**
39939
39867
  * Adds a coin output to the transaction.
39940
39868
  *
@@ -39942,12 +39870,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
39942
39870
  * @param amount - Amount of coin.
39943
39871
  * @param assetId - Asset ID of coin.
39944
39872
  */
39945
- addCoinOutput(to, amount, assetId = BaseAssetId) {
39873
+ addCoinOutput(to, amount, assetId) {
39946
39874
  this.pushOutput({
39947
39875
  type: OutputType.Coin,
39948
39876
  to: addressify(to).toB256(),
39949
39877
  amount,
39950
- assetId
39878
+ assetId: assetId ?? this.baseAssetId
39951
39879
  });
39952
39880
  return this;
39953
39881
  }
@@ -39974,7 +39902,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
39974
39902
  * @param to - Address of the owner.
39975
39903
  * @param assetId - Asset ID of coin.
39976
39904
  */
39977
- addChangeOutput(to, assetId = BaseAssetId) {
39905
+ addChangeOutput(to, assetId) {
39978
39906
  const changeOutput = this.getChangeOutputs().find(
39979
39907
  (output3) => hexlify(output3.assetId) === assetId
39980
39908
  );
@@ -39982,7 +39910,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
39982
39910
  this.pushOutput({
39983
39911
  type: OutputType.Change,
39984
39912
  to: addressify(to).toB256(),
39985
- assetId
39913
+ assetId: assetId ?? this.baseAssetId
39986
39914
  });
39987
39915
  }
39988
39916
  }
@@ -40014,7 +39942,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
40014
39942
  }
40015
39943
  calculateMaxGas(chainInfo, minGas) {
40016
39944
  const { consensusParameters } = chainInfo;
40017
- const { gasPerByte, maxGasPerTx } = consensusParameters;
39945
+ const { gasPerByte } = consensusParameters;
40018
39946
  const witnessesLength = this.toTransaction().witnesses.reduce(
40019
39947
  (acc, wit) => acc + wit.dataLength,
40020
39948
  0
@@ -40023,8 +39951,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
40023
39951
  gasPerByte,
40024
39952
  minGas,
40025
39953
  witnessesLength,
40026
- witnessLimit: this.witnessLimit,
40027
- maxGasPerTx
39954
+ witnessLimit: this.witnessLimit
40028
39955
  });
40029
39956
  }
40030
39957
  /**
@@ -40034,6 +39961,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
40034
39961
  * @param quantities - CoinQuantity Array.
40035
39962
  */
40036
39963
  fundWithFakeUtxos(quantities, resourcesOwner) {
39964
+ let idCounter = 0;
39965
+ const generateId = () => {
39966
+ const counterString = String(idCounter++);
39967
+ const id = ZeroBytes32.slice(0, -counterString.length).concat(counterString);
39968
+ return id;
39969
+ };
40037
39970
  const findAssetInput = (assetId) => this.inputs.find((input) => {
40038
39971
  if ("assetId" in input) {
40039
39972
  return input.assetId === assetId;
@@ -40042,27 +39975,24 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
40042
39975
  });
40043
39976
  const updateAssetInput = (assetId, quantity) => {
40044
39977
  const assetInput = findAssetInput(assetId);
40045
- let usedQuantity = quantity;
40046
- if (assetId === BaseAssetId) {
40047
- usedQuantity = bn("1000000000000000000");
40048
- }
40049
39978
  if (assetInput && "assetId" in assetInput) {
40050
- assetInput.id = hexlify(randomBytes3(34));
40051
- assetInput.amount = usedQuantity;
39979
+ assetInput.id = generateId();
39980
+ assetInput.amount = quantity;
40052
39981
  } else {
40053
39982
  this.addResources([
40054
39983
  {
40055
- id: hexlify(randomBytes3(34)),
40056
- amount: usedQuantity,
39984
+ id: generateId(),
39985
+ amount: quantity,
40057
39986
  assetId,
40058
39987
  owner: resourcesOwner || Address.fromRandom(),
39988
+ maturity: 0,
40059
39989
  blockCreated: bn(1),
40060
39990
  txCreatedIdx: bn(1)
40061
39991
  }
40062
39992
  ]);
40063
39993
  }
40064
39994
  };
40065
- updateAssetInput(BaseAssetId, bn(1e11));
39995
+ updateAssetInput(this.baseAssetId, bn(1e11));
40066
39996
  quantities.forEach((q) => updateAssetInput(q.assetId, q.amount));
40067
39997
  }
40068
39998
  /**
@@ -40087,7 +40017,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
40087
40017
  toJSON() {
40088
40018
  return normalizeJSON(this);
40089
40019
  }
40090
- updatePredicateGasUsed(inputs) {
40020
+ updatePredicateInputs(inputs) {
40091
40021
  this.inputs.forEach((i) => {
40092
40022
  let correspondingInput;
40093
40023
  switch (i.type) {
@@ -40109,15 +40039,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
40109
40039
  }
40110
40040
  });
40111
40041
  }
40112
- shiftPredicateData() {
40113
- this.inputs.forEach((input) => {
40114
- if ("predicateData" in input && "paddPredicateData" in input && typeof input.paddPredicateData === "function") {
40115
- input.predicateData = input.paddPredicateData(
40116
- BaseTransactionRequest.getPolicyMeta(this).policies.length
40117
- );
40118
- }
40119
- });
40120
- }
40121
40042
  };
40122
40043
 
40123
40044
  // src/providers/transaction-request/hash-transaction.ts
@@ -40228,12 +40149,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
40228
40149
  *
40229
40150
  * @param createTransactionRequestLike - The initial values for the instance
40230
40151
  */
40231
- constructor({
40232
- bytecodeWitnessIndex,
40233
- salt,
40234
- storageSlots,
40235
- ...rest
40236
- } = {}) {
40152
+ constructor({ bytecodeWitnessIndex, salt, storageSlots, ...rest }) {
40237
40153
  super(rest);
40238
40154
  this.bytecodeWitnessIndex = bytecodeWitnessIndex ?? 0;
40239
40155
  this.salt = hexlify(salt ?? ZeroBytes32);
@@ -40251,8 +40167,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
40251
40167
  return {
40252
40168
  type: TransactionType.Create,
40253
40169
  ...baseTransaction,
40170
+ bytecodeLength: baseTransaction.witnesses[bytecodeWitnessIndex].dataLength / 4,
40254
40171
  bytecodeWitnessIndex,
40255
- storageSlotsCount: bn(storageSlots.length),
40172
+ storageSlotsCount: storageSlots.length,
40256
40173
  salt: this.salt ? hexlify(this.salt) : ZeroBytes32,
40257
40174
  storageSlots
40258
40175
  };
@@ -40347,7 +40264,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
40347
40264
  *
40348
40265
  * @param scriptTransactionRequestLike - The initial values for the instance.
40349
40266
  */
40350
- constructor({ script, scriptData, gasLimit, ...rest } = {}) {
40267
+ constructor({ script, scriptData, gasLimit, ...rest }) {
40351
40268
  super(rest);
40352
40269
  this.gasLimit = bn(gasLimit);
40353
40270
  this.script = arrayify(script ?? returnZeroScript.bytes);
@@ -40366,8 +40283,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
40366
40283
  type: TransactionType.Script,
40367
40284
  scriptGasLimit: this.gasLimit,
40368
40285
  ...super.getBaseTransaction(),
40369
- scriptLength: bn(script.length),
40370
- scriptDataLength: bn(scriptData.length),
40286
+ scriptLength: script.length,
40287
+ scriptDataLength: scriptData.length,
40371
40288
  receiptsRoot: ZeroBytes32,
40372
40289
  script: hexlify(script),
40373
40290
  scriptData: hexlify(scriptData)
@@ -40431,7 +40348,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
40431
40348
  }
40432
40349
  calculateMaxGas(chainInfo, minGas) {
40433
40350
  const { consensusParameters } = chainInfo;
40434
- const { gasPerByte, maxGasPerTx } = consensusParameters;
40351
+ const { gasPerByte } = consensusParameters;
40435
40352
  const witnessesLength = this.toTransaction().witnesses.reduce(
40436
40353
  (acc, wit) => acc + wit.dataLength,
40437
40354
  0
@@ -40441,8 +40358,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
40441
40358
  minGas,
40442
40359
  witnessesLength,
40443
40360
  witnessLimit: this.witnessLimit,
40444
- gasLimit: this.gasLimit,
40445
- maxGasPerTx
40361
+ gasLimit: this.gasLimit
40446
40362
  });
40447
40363
  }
40448
40364
  /**
@@ -40515,29 +40431,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
40515
40431
  }
40516
40432
  }
40517
40433
  };
40518
- var cacheTxInputsFromOwner = (inputs, owner) => inputs.reduce(
40519
- (acc, input) => {
40520
- if (input.type === InputType.Coin && input.owner === owner) {
40521
- acc.utxos.push(input.id);
40522
- }
40523
- if (input.type === InputType.Message && input.recipient === owner) {
40524
- acc.messages.push(input.nonce);
40525
- }
40526
- return acc;
40527
- },
40528
- {
40529
- utxos: [],
40530
- messages: []
40531
- }
40532
- );
40533
40434
 
40534
40435
  // src/providers/transaction-summary/calculate-transaction-fee.ts
40535
40436
  var calculateTransactionFee = (params) => {
40536
40437
  const {
40537
- gasPrice,
40438
+ gasUsed,
40538
40439
  rawPayload,
40539
- tip,
40540
- consensusParameters: { gasCosts, feeParams, maxGasPerTx }
40440
+ consensusParameters: { gasCosts, feeParams }
40541
40441
  } = params;
40542
40442
  const gasPerByte = bn(feeParams.gasPerByte);
40543
40443
  const gasPriceFactor = bn(feeParams.gasPriceFactor);
@@ -40547,7 +40447,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
40547
40447
  return {
40548
40448
  fee: bn(0),
40549
40449
  minFee: bn(0),
40550
- maxFee: bn(0)
40450
+ maxFee: bn(0),
40451
+ feeFromGasUsed: bn(0)
40551
40452
  };
40552
40453
  }
40553
40454
  const { type: type3, witnesses, inputs, policies } = transaction;
@@ -40579,6 +40480,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
40579
40480
  metadataGas,
40580
40481
  txBytesSize: transactionBytes.length
40581
40482
  });
40483
+ const gasPrice = bn(policies.find((policy) => policy.type === PolicyType.GasPrice)?.data);
40582
40484
  const witnessLimit = policies.find((policy) => policy.type === PolicyType.WitnessLimit)?.data;
40583
40485
  const witnessesLength = witnesses.reduce((acc, wit) => acc + wit.dataLength, 0);
40584
40486
  const maxGas = getMaxGas({
@@ -40586,25 +40488,17 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
40586
40488
  minGas,
40587
40489
  witnessesLength,
40588
40490
  gasLimit,
40589
- witnessLimit,
40590
- maxGasPerTx
40591
- });
40592
- const minFee = calculateGasFee({
40593
- gasPrice,
40594
- gas: minGas,
40595
- priceFactor: gasPriceFactor,
40596
- tip
40597
- });
40598
- const maxFee = calculateGasFee({
40599
- gasPrice,
40600
- gas: maxGas,
40601
- priceFactor: gasPriceFactor,
40602
- tip
40491
+ witnessLimit
40603
40492
  });
40493
+ const feeFromGasUsed = calculatePriceWithFactor(gasUsed, gasPrice, gasPriceFactor);
40494
+ const minFee = calculatePriceWithFactor(minGas, gasPrice, gasPriceFactor);
40495
+ const maxFee = calculatePriceWithFactor(maxGas, gasPrice, gasPriceFactor);
40496
+ const fee = minFee.add(feeFromGasUsed);
40604
40497
  return {
40498
+ fee,
40605
40499
  minFee,
40606
40500
  maxFee,
40607
- fee: maxFee
40501
+ feeFromGasUsed
40608
40502
  };
40609
40503
  };
40610
40504
 
@@ -41205,9 +41099,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
41205
41099
  gqlTransactionStatus,
41206
41100
  abiMap = {},
41207
41101
  maxInputs,
41208
- gasCosts,
41209
- maxGasPerTx,
41210
- gasPrice
41102
+ gasCosts
41211
41103
  } = params;
41212
41104
  const gasUsed = getGasUsedFromReceipts(receipts);
41213
41105
  const rawPayload = hexlify(transactionBytes);
@@ -41221,14 +41113,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
41221
41113
  maxInputs
41222
41114
  });
41223
41115
  const typeName = getTransactionTypeName(transaction.type);
41224
- const tip = bn(transaction.policies?.find((policy) => policy.type === PolicyType.Tip)?.data);
41225
41116
  const { fee } = calculateTransactionFee({
41226
- gasPrice,
41117
+ gasUsed,
41227
41118
  rawPayload,
41228
- tip,
41229
41119
  consensusParameters: {
41230
41120
  gasCosts,
41231
- maxGasPerTx,
41232
41121
  feeParams: {
41233
41122
  gasPerByte,
41234
41123
  gasPriceFactor
@@ -41364,13 +41253,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
41364
41253
  const decodedTransaction = this.decodeTransaction(
41365
41254
  transaction
41366
41255
  );
41367
- let txReceipts = [];
41368
- if (transaction?.status && "receipts" in transaction.status) {
41369
- txReceipts = transaction.status.receipts;
41370
- }
41371
- const receipts = txReceipts.map(processGqlReceipt) || [];
41372
- const { gasPerByte, gasPriceFactor, gasCosts, maxGasPerTx } = this.provider.getGasConfig();
41373
- const gasPrice = await this.provider.getLatestGasPrice();
41256
+ const receipts = transaction.receipts?.map(processGqlReceipt) || [];
41257
+ const { gasPerByte, gasPriceFactor, gasCosts } = this.provider.getGasConfig();
41374
41258
  const maxInputs = this.provider.getChain().consensusParameters.maxInputs;
41375
41259
  const transactionSummary = assembleTransactionSummary({
41376
41260
  id: this.id,
@@ -41382,9 +41266,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
41382
41266
  gasPriceFactor,
41383
41267
  abiMap: contractsAbiMap,
41384
41268
  maxInputs,
41385
- gasCosts,
41386
- maxGasPerTx,
41387
- gasPrice
41269
+ gasCosts
41388
41270
  });
41389
41271
  return transactionSummary;
41390
41272
  }
@@ -41528,12 +41410,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
41528
41410
  gasPerByte: bn(feeParams.gasPerByte),
41529
41411
  maxMessageDataLength: bn(predicateParams.maxMessageDataLength),
41530
41412
  chainId: bn(consensusParameters.chainId),
41413
+ baseAssetId: consensusParameters.baseAssetId,
41531
41414
  gasCosts
41532
41415
  },
41533
41416
  gasCosts,
41534
41417
  latestBlock: {
41535
41418
  id: latestBlock.id,
41536
- height: bn(latestBlock.height),
41419
+ height: bn(latestBlock.header.height),
41537
41420
  time: latestBlock.header.time,
41538
41421
  transactions: latestBlock.transactions.map((i) => ({
41539
41422
  id: i.id
@@ -41627,8 +41510,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
41627
41510
  * Returns some helpful parameters related to gas fees.
41628
41511
  */
41629
41512
  getGasConfig() {
41513
+ const { minGasPrice } = this.getNode();
41630
41514
  const { maxGasPerTx, maxGasPerPredicate, gasPriceFactor, gasPerByte, gasCosts } = this.getChain().consensusParameters;
41631
41515
  return {
41516
+ minGasPrice,
41632
41517
  maxGasPerTx,
41633
41518
  maxGasPerPredicate,
41634
41519
  gasPriceFactor,
@@ -41726,7 +41611,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
41726
41611
  */
41727
41612
  async getBlockNumber() {
41728
41613
  const { chain } = await this.operations.getChain();
41729
- return bn(chain.latestBlock.height, 10);
41614
+ return bn(chain.latestBlock.header.height, 10);
41730
41615
  }
41731
41616
  /**
41732
41617
  * Returns the chain information.
@@ -41738,9 +41623,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
41738
41623
  const processedNodeInfo = {
41739
41624
  maxDepth: bn(nodeInfo.maxDepth),
41740
41625
  maxTx: bn(nodeInfo.maxTx),
41626
+ minGasPrice: bn(nodeInfo.minGasPrice),
41741
41627
  nodeVersion: nodeInfo.nodeVersion,
41742
41628
  utxoValidation: nodeInfo.utxoValidation,
41743
- vmBacktrace: nodeInfo.vmBacktrace
41629
+ vmBacktrace: nodeInfo.vmBacktrace,
41630
+ peers: nodeInfo.peers
41744
41631
  };
41745
41632
  _Provider.nodeInfoCache[this.url] = processedNodeInfo;
41746
41633
  return processedNodeInfo;
@@ -41766,6 +41653,17 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
41766
41653
  } = this.getChain();
41767
41654
  return chainId.toNumber();
41768
41655
  }
41656
+ /**
41657
+ * Returns the base asset ID
41658
+ *
41659
+ * @returns A promise that resolves to the base asset ID
41660
+ */
41661
+ getBaseAssetId() {
41662
+ const {
41663
+ consensusParameters: { baseAssetId }
41664
+ } = this.getChain();
41665
+ return baseAssetId;
41666
+ }
41769
41667
  /**
41770
41668
  * Submits a transaction to the chain to be executed.
41771
41669
  *
@@ -41826,13 +41724,14 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
41826
41724
  return this.estimateTxDependencies(transactionRequest);
41827
41725
  }
41828
41726
  const encodedTransaction = hexlify(transactionRequest.toTransactionBytes());
41829
- const { dryRun: dryRunStatuses } = await this.operations.dryRun({
41830
- encodedTransactions: encodedTransaction,
41727
+ const { dryRun: gqlReceipts } = await this.operations.dryRun({
41728
+ encodedTransaction,
41831
41729
  utxoValidation: utxoValidation || false
41832
41730
  });
41833
- const [{ receipts: rawReceipts, status }] = dryRunStatuses;
41834
- const receipts = rawReceipts.map(processGqlReceipt);
41835
- return { receipts, dryrunStatus: status };
41731
+ const receipts = gqlReceipts.map(processGqlReceipt);
41732
+ return {
41733
+ receipts
41734
+ };
41836
41735
  }
41837
41736
  /**
41838
41737
  * Verifies whether enough gas is available to complete transaction.
@@ -41871,6 +41770,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
41871
41770
  * If there are missing variable outputs,
41872
41771
  * `addVariableOutputs` is called on the transaction.
41873
41772
  *
41773
+ * @privateRemarks
41774
+ * TODO: Investigate support for missing contract IDs
41775
+ * TODO: Add support for missing output messages
41874
41776
  *
41875
41777
  * @param transactionRequest - The transaction request object.
41876
41778
  * @returns A promise.
@@ -41883,19 +41785,16 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
41883
41785
  missingContractIds: []
41884
41786
  };
41885
41787
  }
41788
+ await this.estimatePredicates(transactionRequest);
41886
41789
  let receipts = [];
41887
41790
  const missingContractIds = [];
41888
41791
  let outputVariables = 0;
41889
- let dryrunStatus;
41890
41792
  for (let attempt = 0; attempt < MAX_RETRIES; attempt++) {
41891
- const {
41892
- dryRun: [{ receipts: rawReceipts, status }]
41893
- } = await this.operations.dryRun({
41894
- encodedTransactions: [hexlify(transactionRequest.toTransactionBytes())],
41793
+ const { dryRun: gqlReceipts } = await this.operations.dryRun({
41794
+ encodedTransaction: hexlify(transactionRequest.toTransactionBytes()),
41895
41795
  utxoValidation: false
41896
41796
  });
41897
- receipts = rawReceipts.map(processGqlReceipt);
41898
- dryrunStatus = status;
41797
+ receipts = gqlReceipts.map(processGqlReceipt);
41899
41798
  const { missingOutputVariables, missingOutputContractIds } = getReceiptsWithMissingData(receipts);
41900
41799
  const hasMissingOutputs = missingOutputVariables.length !== 0 || missingOutputContractIds.length !== 0;
41901
41800
  if (hasMissingOutputs) {
@@ -41905,11 +41804,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
41905
41804
  transactionRequest.addContractInputAndOutput(Address.fromString(contractId));
41906
41805
  missingContractIds.push(contractId);
41907
41806
  });
41908
- const { maxFee } = await this.estimateTxGasAndFee({
41909
- transactionRequest,
41910
- optimizeGas: false
41911
- });
41912
- transactionRequest.maxFee = maxFee;
41913
41807
  } else {
41914
41808
  break;
41915
41809
  }
@@ -41917,133 +41811,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
41917
41811
  return {
41918
41812
  receipts,
41919
41813
  outputVariables,
41920
- missingContractIds,
41921
- dryrunStatus
41922
- };
41923
- }
41924
- /**
41925
- * Dry runs multiple transactions and checks for missing dependencies in batches.
41926
- *
41927
- * Transactions are dry run in batches. After each dry run, transactions requiring
41928
- * further modifications are identified. The method iteratively updates these transactions
41929
- * and performs subsequent dry runs until all dependencies for each transaction are satisfied.
41930
- *
41931
- * @param transactionRequests - Array of transaction request objects.
41932
- * @returns A promise that resolves to an array of results for each transaction.
41933
- */
41934
- async estimateMultipleTxDependencies(transactionRequests) {
41935
- const results = transactionRequests.map(() => ({
41936
- receipts: [],
41937
- outputVariables: 0,
41938
- missingContractIds: [],
41939
- dryrunStatus: void 0
41940
- }));
41941
- const allRequests = clone_default(transactionRequests);
41942
- const serializedTransactionsMap = /* @__PURE__ */ new Map();
41943
- allRequests.forEach((req, index) => {
41944
- if (req.type === TransactionType.Script) {
41945
- serializedTransactionsMap.set(index, hexlify(req.toTransactionBytes()));
41946
- }
41947
- });
41948
- let transactionsToProcess = Array.from(serializedTransactionsMap.keys());
41949
- let attempt = 0;
41950
- while (transactionsToProcess.length > 0 && attempt < MAX_RETRIES) {
41951
- const encodedTransactions = transactionsToProcess.map(
41952
- (index) => serializedTransactionsMap.get(index)
41953
- );
41954
- const dryRunResults = await this.operations.dryRun({
41955
- encodedTransactions,
41956
- utxoValidation: false
41957
- });
41958
- const nextRoundTransactions = [];
41959
- for (let i = 0; i < dryRunResults.dryRun.length; i++) {
41960
- const currentResultIndex = transactionsToProcess[i];
41961
- const { receipts: rawReceipts, status } = dryRunResults.dryRun[i];
41962
- results[currentResultIndex].receipts = rawReceipts.map(processGqlReceipt);
41963
- results[currentResultIndex].dryrunStatus = status;
41964
- const { missingOutputVariables, missingOutputContractIds } = getReceiptsWithMissingData(
41965
- results[currentResultIndex].receipts
41966
- );
41967
- const hasMissingOutputs = missingOutputVariables.length > 0 || missingOutputContractIds.length > 0;
41968
- const requestToProcess = allRequests[currentResultIndex];
41969
- if (hasMissingOutputs && requestToProcess?.type === TransactionType.Script) {
41970
- results[currentResultIndex].outputVariables += missingOutputVariables.length;
41971
- requestToProcess.addVariableOutputs(missingOutputVariables.length);
41972
- missingOutputContractIds.forEach(({ contractId }) => {
41973
- requestToProcess.addContractInputAndOutput(Address.fromString(contractId));
41974
- results[currentResultIndex].missingContractIds.push(contractId);
41975
- });
41976
- const { maxFee } = await this.estimateTxGasAndFee({
41977
- transactionRequest: requestToProcess,
41978
- optimizeGas: false
41979
- });
41980
- requestToProcess.maxFee = maxFee;
41981
- serializedTransactionsMap.set(
41982
- currentResultIndex,
41983
- hexlify(requestToProcess.toTransactionBytes())
41984
- );
41985
- nextRoundTransactions.push(currentResultIndex);
41986
- allRequests[currentResultIndex] = requestToProcess;
41987
- }
41988
- }
41989
- transactionsToProcess = nextRoundTransactions;
41990
- attempt += 1;
41991
- }
41992
- return results;
41993
- }
41994
- async dryRunMultipleTransactions(transactionRequests, { utxoValidation, estimateTxDependencies = true } = {}) {
41995
- if (estimateTxDependencies) {
41996
- return this.estimateMultipleTxDependencies(transactionRequests);
41997
- }
41998
- const encodedTransactions = transactionRequests.map((tx) => hexlify(tx.toTransactionBytes()));
41999
- const { dryRun: dryRunStatuses } = await this.operations.dryRun({
42000
- encodedTransactions,
42001
- utxoValidation: utxoValidation || false
42002
- });
42003
- const results = dryRunStatuses.map(({ receipts: rawReceipts, status }) => {
42004
- const receipts = rawReceipts.map(processGqlReceipt);
42005
- return { receipts, dryrunStatus: status };
42006
- });
42007
- return results;
42008
- }
42009
- async estimateTxGasAndFee(params) {
42010
- const { transactionRequest, optimizeGas = true } = params;
42011
- let { gasPrice } = params;
42012
- const chainInfo = this.getChain();
42013
- const { gasPriceFactor } = this.getGasConfig();
42014
- const minGas = transactionRequest.calculateMinGas(chainInfo);
42015
- if (!gasPrice) {
42016
- gasPrice = await this.estimateGasPrice(10);
42017
- }
42018
- const minFee = calculateGasFee({
42019
- gasPrice: bn(gasPrice),
42020
- gas: minGas,
42021
- priceFactor: gasPriceFactor,
42022
- tip: transactionRequest.tip
42023
- }).add(1);
42024
- let gasLimit = bn(0);
42025
- if (transactionRequest.type === TransactionType.Script) {
42026
- gasLimit = transactionRequest.gasLimit;
42027
- if (!optimizeGas) {
42028
- transactionRequest.gasLimit = minGas;
42029
- gasLimit = transactionRequest.calculateMaxGas(chainInfo, minGas);
42030
- transactionRequest.gasLimit = gasLimit;
42031
- }
42032
- }
42033
- const maxGas = transactionRequest.calculateMaxGas(chainInfo, minGas);
42034
- const maxFee = calculateGasFee({
42035
- gasPrice: bn(gasPrice),
42036
- gas: maxGas,
42037
- priceFactor: gasPriceFactor,
42038
- tip: transactionRequest.tip
42039
- }).add(1);
42040
- return {
42041
- minGas,
42042
- minFee,
42043
- maxGas,
42044
- maxFee,
42045
- gasPrice,
42046
- gasLimit
41814
+ missingContractIds
42047
41815
  };
42048
41816
  }
42049
41817
  /**
@@ -42061,17 +41829,15 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42061
41829
  if (estimateTxDependencies) {
42062
41830
  return this.estimateTxDependencies(transactionRequest);
42063
41831
  }
42064
- const encodedTransactions = [hexlify(transactionRequest.toTransactionBytes())];
42065
- const { dryRun: dryRunStatuses } = await this.operations.dryRun({
42066
- encodedTransactions,
41832
+ const encodedTransaction = hexlify(transactionRequest.toTransactionBytes());
41833
+ const { dryRun: gqlReceipts } = await this.operations.dryRun({
41834
+ encodedTransaction,
42067
41835
  utxoValidation: true
42068
41836
  });
42069
- const callResult = dryRunStatuses.map((dryRunStatus) => {
42070
- const { id, receipts, status } = dryRunStatus;
42071
- const processedReceipts = receipts.map(processGqlReceipt);
42072
- return { id, receipts: processedReceipts, status };
42073
- });
42074
- return { receipts: callResult[0].receipts };
41837
+ const receipts = gqlReceipts.map(processGqlReceipt);
41838
+ return {
41839
+ receipts
41840
+ };
42075
41841
  }
42076
41842
  /**
42077
41843
  * Returns a transaction cost to enable user
@@ -42088,80 +41854,80 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42088
41854
  * @param tolerance - The tolerance to add on top of the gasUsed.
42089
41855
  * @returns A promise that resolves to the transaction cost object.
42090
41856
  */
42091
- async getTransactionCost(transactionRequestLike, { resourcesOwner, signatureCallback, quantitiesToContract = [] } = {}) {
41857
+ async getTransactionCost(transactionRequestLike, forwardingQuantities = [], {
41858
+ estimateTxDependencies = true,
41859
+ estimatePredicates = true,
41860
+ resourcesOwner,
41861
+ signatureCallback
41862
+ } = {}) {
42092
41863
  const txRequestClone = clone_default(transactionRequestify(transactionRequestLike));
41864
+ const chainInfo = this.getChain();
41865
+ const { gasPriceFactor, minGasPrice, maxGasPerTx } = this.getGasConfig();
41866
+ const gasPrice = max(txRequestClone.gasPrice, minGasPrice);
42093
41867
  const isScriptTransaction = txRequestClone.type === TransactionType.Script;
42094
41868
  const coinOutputsQuantities = txRequestClone.getCoinOutputsQuantities();
42095
- const allQuantities = mergeQuantities(coinOutputsQuantities, quantitiesToContract);
41869
+ const allQuantities = mergeQuantities(coinOutputsQuantities, forwardingQuantities);
42096
41870
  txRequestClone.fundWithFakeUtxos(allQuantities, resourcesOwner?.address);
42097
- txRequestClone.maxFee = bn(0);
42098
- if (isScriptTransaction) {
42099
- txRequestClone.gasLimit = bn(0);
42100
- }
42101
- if (resourcesOwner && "populateTransactionPredicateData" in resourcesOwner) {
42102
- resourcesOwner.populateTransactionPredicateData(txRequestClone);
41871
+ if (estimatePredicates) {
41872
+ if (isScriptTransaction) {
41873
+ txRequestClone.gasLimit = bn(0);
41874
+ }
41875
+ if (resourcesOwner && "populateTransactionPredicateData" in resourcesOwner) {
41876
+ resourcesOwner.populateTransactionPredicateData(txRequestClone);
41877
+ }
41878
+ await this.estimatePredicates(txRequestClone);
42103
41879
  }
42104
- const signedRequest = clone_default(txRequestClone);
42105
- let addedSignatures = 0;
42106
41880
  if (signatureCallback && isScriptTransaction) {
42107
- const lengthBefore = signedRequest.witnesses.length;
42108
- await signatureCallback(signedRequest);
42109
- addedSignatures = signedRequest.witnesses.length - lengthBefore;
42110
- }
42111
- await this.estimatePredicates(signedRequest);
42112
- let { maxFee, maxGas, minFee, minGas, gasPrice, gasLimit } = await this.estimateTxGasAndFee({
42113
- transactionRequest: signedRequest,
42114
- optimizeGas: false
42115
- });
42116
- txRequestClone.maxFee = maxFee;
41881
+ await signatureCallback(txRequestClone);
41882
+ }
41883
+ const minGas = txRequestClone.calculateMinGas(chainInfo);
41884
+ const maxGas = txRequestClone.calculateMaxGas(chainInfo, minGas);
42117
41885
  let receipts = [];
42118
41886
  let missingContractIds = [];
42119
41887
  let outputVariables = 0;
42120
- let gasUsed = bn(0);
42121
- txRequestClone.updatePredicateGasUsed(signedRequest.inputs);
42122
- if (isScriptTransaction) {
42123
- if (signatureCallback) {
42124
- await signatureCallback(txRequestClone);
42125
- }
42126
- txRequestClone.gasLimit = gasLimit;
41888
+ if (isScriptTransaction && estimateTxDependencies) {
41889
+ txRequestClone.gasPrice = bn(0);
41890
+ txRequestClone.gasLimit = bn(maxGasPerTx.sub(maxGas).toNumber() * 0.9);
42127
41891
  const result = await this.estimateTxDependencies(txRequestClone);
42128
41892
  receipts = result.receipts;
42129
41893
  outputVariables = result.outputVariables;
42130
41894
  missingContractIds = result.missingContractIds;
42131
- gasUsed = getGasUsedFromReceipts(receipts);
42132
- txRequestClone.gasLimit = gasUsed;
42133
- ({ maxFee, maxGas, minFee, minGas, gasPrice } = await this.estimateTxGasAndFee({
42134
- transactionRequest: txRequestClone,
42135
- gasPrice
42136
- }));
42137
41895
  }
41896
+ const gasUsed = isScriptTransaction ? getGasUsedFromReceipts(receipts) : minGas;
41897
+ const usedFee = calculatePriceWithFactor(
41898
+ gasUsed,
41899
+ gasPrice,
41900
+ gasPriceFactor
41901
+ ).normalizeZeroToOne();
41902
+ const minFee = calculatePriceWithFactor(minGas, gasPrice, gasPriceFactor).normalizeZeroToOne();
41903
+ const maxFee = calculatePriceWithFactor(maxGas, gasPrice, gasPriceFactor).normalizeZeroToOne();
42138
41904
  return {
42139
41905
  requiredQuantities: allQuantities,
42140
41906
  receipts,
42141
41907
  gasUsed,
41908
+ minGasPrice,
42142
41909
  gasPrice,
42143
41910
  minGas,
42144
41911
  maxGas,
41912
+ usedFee,
42145
41913
  minFee,
42146
41914
  maxFee,
41915
+ estimatedInputs: txRequestClone.inputs,
42147
41916
  outputVariables,
42148
- missingContractIds,
42149
- addedSignatures,
42150
- estimatedPredicates: txRequestClone.inputs
41917
+ missingContractIds
42151
41918
  };
42152
41919
  }
42153
- async getResourcesForTransaction(owner, transactionRequestLike, quantitiesToContract = []) {
41920
+ async getResourcesForTransaction(owner, transactionRequestLike, forwardingQuantities = []) {
42154
41921
  const ownerAddress = Address.fromAddressOrString(owner);
42155
41922
  const transactionRequest = transactionRequestify(clone_default(transactionRequestLike));
42156
- const transactionCost = await this.getTransactionCost(transactionRequest, {
42157
- quantitiesToContract
42158
- });
41923
+ const transactionCost = await this.getTransactionCost(transactionRequest, forwardingQuantities);
42159
41924
  transactionRequest.addResources(
42160
41925
  await this.getResourcesToSpend(ownerAddress, transactionCost.requiredQuantities)
42161
41926
  );
42162
- const { requiredQuantities, ...txCost } = await this.getTransactionCost(transactionRequest, {
42163
- quantitiesToContract
42164
- });
41927
+ const { requiredQuantities, ...txCost } = await this.getTransactionCost(
41928
+ transactionRequest,
41929
+ forwardingQuantities
41930
+ );
42165
41931
  const resources = await this.getResourcesToSpend(ownerAddress, requiredQuantities);
42166
41932
  return {
42167
41933
  resources,
@@ -42185,6 +41951,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42185
41951
  assetId: coin.assetId,
42186
41952
  amount: bn(coin.amount),
42187
41953
  owner: Address.fromAddressOrString(coin.owner),
41954
+ maturity: bn(coin.maturity).toNumber(),
42188
41955
  blockCreated: bn(coin.blockCreated),
42189
41956
  txCreatedIdx: bn(coin.txCreatedIdx)
42190
41957
  }));
@@ -42236,6 +42003,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42236
42003
  amount: bn(coin.amount),
42237
42004
  assetId: coin.assetId,
42238
42005
  owner: Address.fromAddressOrString(coin.owner),
42006
+ maturity: bn(coin.maturity).toNumber(),
42239
42007
  blockCreated: bn(coin.blockCreated),
42240
42008
  txCreatedIdx: bn(coin.txCreatedIdx)
42241
42009
  };
@@ -42268,7 +42036,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42268
42036
  }
42269
42037
  return {
42270
42038
  id: block2.id,
42271
- height: bn(block2.height),
42039
+ height: bn(block2.header.height),
42272
42040
  time: block2.header.time,
42273
42041
  transactionIds: block2.transactions.map((tx) => tx.id)
42274
42042
  };
@@ -42283,7 +42051,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42283
42051
  const { blocks: fetchedData } = await this.operations.getBlocks(params);
42284
42052
  const blocks = fetchedData.edges.map(({ node: block2 }) => ({
42285
42053
  id: block2.id,
42286
- height: bn(block2.height),
42054
+ height: bn(block2.header.height),
42287
42055
  time: block2.header.time,
42288
42056
  transactionIds: block2.transactions.map((tx) => tx.id)
42289
42057
  }));
@@ -42310,7 +42078,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42310
42078
  }
42311
42079
  return {
42312
42080
  id: block2.id,
42313
- height: bn(block2.height, 10),
42081
+ height: bn(block2.header.height, 10),
42314
42082
  time: block2.header.time,
42315
42083
  transactionIds: block2.transactions.map((tx) => tx.id),
42316
42084
  transactions: block2.transactions.map(
@@ -42490,6 +42258,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42490
42258
  prevRoot: messageBlockHeader.prevRoot,
42491
42259
  time: messageBlockHeader.time,
42492
42260
  applicationHash: messageBlockHeader.applicationHash,
42261
+ messageReceiptRoot: messageBlockHeader.messageReceiptRoot,
42493
42262
  messageReceiptCount: bn(messageBlockHeader.messageReceiptCount)
42494
42263
  },
42495
42264
  commitBlockHeader: {
@@ -42501,6 +42270,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42501
42270
  prevRoot: commitBlockHeader.prevRoot,
42502
42271
  time: commitBlockHeader.time,
42503
42272
  applicationHash: commitBlockHeader.applicationHash,
42273
+ messageReceiptRoot: commitBlockHeader.messageReceiptRoot,
42504
42274
  messageReceiptCount: bn(commitBlockHeader.messageReceiptCount)
42505
42275
  },
42506
42276
  sender: Address.fromAddressOrString(sender),
@@ -42510,16 +42280,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42510
42280
  data
42511
42281
  };
42512
42282
  }
42513
- async getLatestGasPrice() {
42514
- const { latestGasPrice } = await this.operations.getLatestGasPrice();
42515
- return bn(latestGasPrice.gasPrice);
42516
- }
42517
- async estimateGasPrice(blockHorizon) {
42518
- const { estimateGasPrice } = await this.operations.estimateGasPrice({
42519
- blockHorizon: String(blockHorizon)
42520
- });
42521
- return bn(estimateGasPrice.gasPrice);
42522
- }
42523
42283
  /**
42524
42284
  * Returns Message Proof for given transaction id and the message id from MessageOut receipt.
42525
42285
  *
@@ -42580,15 +42340,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42580
42340
  arrayify(gqlTransaction.rawPayload),
42581
42341
  0
42582
42342
  );
42583
- let txReceipts = [];
42584
- if (gqlTransaction?.status && "receipts" in gqlTransaction.status) {
42585
- txReceipts = gqlTransaction.status.receipts;
42586
- }
42587
- const receipts = txReceipts.map(processGqlReceipt);
42343
+ const receipts = gqlTransaction.receipts?.map(processGqlReceipt) || [];
42588
42344
  const {
42589
- consensusParameters: { gasPerByte, gasPriceFactor, maxInputs, gasCosts, maxGasPerTx }
42345
+ consensusParameters: { gasPerByte, gasPriceFactor, maxInputs, gasCosts }
42590
42346
  } = provider.getChain();
42591
- const gasPrice = await provider.getLatestGasPrice();
42592
42347
  const transactionInfo = assembleTransactionSummary({
42593
42348
  id: gqlTransaction.id,
42594
42349
  receipts,
@@ -42599,9 +42354,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42599
42354
  gasPriceFactor: bn(gasPriceFactor),
42600
42355
  abiMap,
42601
42356
  maxInputs,
42602
- gasCosts,
42603
- maxGasPerTx,
42604
- gasPrice
42357
+ gasCosts
42605
42358
  });
42606
42359
  return {
42607
42360
  gqlTransaction,
@@ -42611,11 +42364,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42611
42364
  async function getTransactionSummaryFromRequest(params) {
42612
42365
  const { provider, transactionRequest, abiMap } = params;
42613
42366
  const { receipts } = await provider.call(transactionRequest);
42614
- const { gasPerByte, gasPriceFactor, gasCosts, maxGasPerTx } = provider.getGasConfig();
42367
+ const { gasPerByte, gasPriceFactor, gasCosts } = provider.getGasConfig();
42615
42368
  const maxInputs = provider.getChain().consensusParameters.maxInputs;
42616
42369
  const transaction = transactionRequest.toTransaction();
42617
42370
  const transactionBytes = transactionRequest.toTransactionBytes();
42618
- const gasPrice = await provider.getLatestGasPrice();
42619
42371
  const transactionSummary = assembleTransactionSummary({
42620
42372
  receipts,
42621
42373
  transaction,
@@ -42624,9 +42376,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42624
42376
  gasPerByte,
42625
42377
  gasPriceFactor,
42626
42378
  maxInputs,
42627
- gasCosts,
42628
- maxGasPerTx,
42629
- gasPrice
42379
+ gasCosts
42630
42380
  });
42631
42381
  return transactionSummary;
42632
42382
  }
@@ -42635,18 +42385,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42635
42385
  const { transactionsByOwner } = await provider.operations.getTransactionsByOwner(filters);
42636
42386
  const { edges, pageInfo } = transactionsByOwner;
42637
42387
  const {
42638
- consensusParameters: { gasPerByte, gasPriceFactor, maxInputs, gasCosts, maxGasPerTx }
42388
+ consensusParameters: { gasPerByte, gasPriceFactor, maxInputs, gasCosts }
42639
42389
  } = provider.getChain();
42640
- const gasPrice = await provider.getLatestGasPrice();
42641
42390
  const transactions = edges.map((edge) => {
42642
42391
  const { node: gqlTransaction } = edge;
42643
- const { id, rawPayload, status } = gqlTransaction;
42392
+ const { id, rawPayload, receipts: gqlReceipts, status } = gqlTransaction;
42644
42393
  const [decodedTransaction] = new TransactionCoder().decode(arrayify(rawPayload), 0);
42645
- let txReceipts = [];
42646
- if (gqlTransaction?.status && "receipts" in gqlTransaction.status) {
42647
- txReceipts = gqlTransaction.status.receipts;
42648
- }
42649
- const receipts = txReceipts.map(processGqlReceipt);
42394
+ const receipts = gqlReceipts?.map(processGqlReceipt) || [];
42650
42395
  const transactionSummary = assembleTransactionSummary({
42651
42396
  id,
42652
42397
  receipts,
@@ -42657,9 +42402,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42657
42402
  gasPerByte,
42658
42403
  gasPriceFactor,
42659
42404
  maxInputs,
42660
- gasCosts,
42661
- maxGasPerTx,
42662
- gasPrice
42405
+ gasCosts
42663
42406
  });
42664
42407
  const output3 = {
42665
42408
  gqlTransaction,
@@ -42950,8 +42693,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42950
42693
  * @param assetId - The asset ID to check the balance for.
42951
42694
  * @returns A promise that resolves to the balance amount.
42952
42695
  */
42953
- async getBalance(assetId = BaseAssetId) {
42954
- const amount = await this.provider.getBalance(this.address, assetId);
42696
+ async getBalance(assetId) {
42697
+ const assetIdToFetch = assetId ?? this.provider.getBaseAssetId();
42698
+ const amount = await this.provider.getBalance(this.address, assetIdToFetch);
42955
42699
  return amount;
42956
42700
  }
42957
42701
  /**
@@ -42988,33 +42732,37 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42988
42732
  * @param fee - The estimated transaction fee.
42989
42733
  * @returns A promise that resolves when the resources are added to the transaction.
42990
42734
  */
42991
- async fund(request, params) {
42992
- const { addedSignatures, estimatedPredicates, maxFee: fee, requiredQuantities } = params;
42993
- const txRequest = request;
42994
- const requiredQuantitiesWithFee = addAmountToCoinQuantities({
42735
+ async fund(request, coinQuantities, fee) {
42736
+ const baseAssetId = this.provider.getBaseAssetId();
42737
+ const updatedQuantities = addAmountToAsset({
42995
42738
  amount: bn(fee),
42996
- assetId: BaseAssetId,
42997
- coinQuantities: requiredQuantities
42739
+ assetId: baseAssetId,
42740
+ coinQuantities
42998
42741
  });
42999
42742
  const quantitiesDict = {};
43000
- requiredQuantitiesWithFee.forEach(({ amount, assetId }) => {
42743
+ updatedQuantities.forEach(({ amount, assetId }) => {
43001
42744
  quantitiesDict[assetId] = {
43002
42745
  required: amount,
43003
42746
  owned: bn(0)
43004
42747
  };
43005
42748
  });
43006
- txRequest.inputs.forEach((input) => {
42749
+ const cachedUtxos = [];
42750
+ const cachedMessages = [];
42751
+ const owner = this.address.toB256();
42752
+ request.inputs.forEach((input) => {
43007
42753
  const isResource = "amount" in input;
43008
42754
  if (isResource) {
43009
42755
  const isCoin2 = "owner" in input;
43010
42756
  if (isCoin2) {
43011
42757
  const assetId = String(input.assetId);
43012
- if (quantitiesDict[assetId]) {
42758
+ if (input.owner === owner && quantitiesDict[assetId]) {
43013
42759
  const amount = bn(input.amount);
43014
42760
  quantitiesDict[assetId].owned = quantitiesDict[assetId].owned.add(amount);
42761
+ cachedUtxos.push(input.id);
43015
42762
  }
43016
- } else if (input.amount && quantitiesDict[BaseAssetId]) {
43017
- quantitiesDict[BaseAssetId].owned = quantitiesDict[BaseAssetId].owned.add(input.amount);
42763
+ } else if (input.recipient === owner && input.amount && quantitiesDict[baseAssetId]) {
42764
+ quantitiesDict[baseAssetId].owned = quantitiesDict[baseAssetId].owned.add(input.amount);
42765
+ cachedMessages.push(input.nonce);
43018
42766
  }
43019
42767
  }
43020
42768
  });
@@ -43029,23 +42777,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43029
42777
  });
43030
42778
  const needsToBeFunded = missingQuantities.length;
43031
42779
  if (needsToBeFunded) {
43032
- const excludedIds = cacheTxInputsFromOwner(txRequest.inputs, this.address.toB256());
43033
- const resources = await this.getResourcesToSpend(missingQuantities, excludedIds);
43034
- txRequest.addResources(resources);
43035
- }
43036
- txRequest.shiftPredicateData();
43037
- txRequest.updatePredicateGasUsed(estimatedPredicates);
43038
- const requestToBeReEstimate = clone_default(txRequest);
43039
- if (addedSignatures) {
43040
- Array.from({ length: addedSignatures }).forEach(
43041
- () => requestToBeReEstimate.addEmptyWitness()
43042
- );
42780
+ const resources = await this.getResourcesToSpend(missingQuantities, {
42781
+ messages: cachedMessages,
42782
+ utxos: cachedUtxos
42783
+ });
42784
+ request.addResources(resources);
43043
42785
  }
43044
- const { maxFee } = await this.provider.estimateTxGasAndFee({
43045
- transactionRequest: requestToBeReEstimate
43046
- });
43047
- txRequest.maxFee = maxFee;
43048
- return txRequest;
43049
42786
  }
43050
42787
  /**
43051
42788
  * A helper that creates a transfer transaction request and returns it.
@@ -43053,25 +42790,30 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43053
42790
  * @param destination - The address of the destination.
43054
42791
  * @param amount - The amount of coins to transfer.
43055
42792
  * @param assetId - The asset ID of the coins to transfer.
43056
- * @param txParams - The transaction parameters (gasLimit, tip, maturity, maxFee, witnessLimit).
42793
+ * @param txParams - The transaction parameters (gasLimit, gasPrice, maturity).
43057
42794
  * @returns A promise that resolves to the prepared transaction request.
43058
42795
  */
43059
- async createTransfer(destination, amount, assetId = BaseAssetId, txParams = {}) {
43060
- const request = new ScriptTransactionRequest(txParams);
43061
- request.addCoinOutput(Address.fromAddressOrString(destination), amount, assetId);
43062
- const txCost = await this.provider.getTransactionCost(request, {
42796
+ async createTransfer(destination, amount, assetId, txParams = {}) {
42797
+ const { minGasPrice } = this.provider.getGasConfig();
42798
+ const baseAssetId = this.provider.getBaseAssetId();
42799
+ const assetIdToTransfer = assetId ?? this.provider.getBaseAssetId();
42800
+ const params = { gasPrice: minGasPrice, baseAssetId, ...txParams };
42801
+ const request = new ScriptTransactionRequest(params);
42802
+ request.addCoinOutput(Address.fromAddressOrString(destination), amount, assetIdToTransfer);
42803
+ const { maxFee, requiredQuantities, gasUsed, estimatedInputs } = await this.provider.getTransactionCost(request, [], {
43063
42804
  estimateTxDependencies: true,
43064
42805
  resourcesOwner: this
43065
42806
  });
43066
- if ("gasLimit" in txParams) {
43067
- this.validateGas({
43068
- gasUsed: txCost.gasUsed,
43069
- gasLimit: request.gasLimit
43070
- });
43071
- }
43072
- request.gasLimit = txCost.gasUsed;
43073
- request.maxFee = txCost.maxFee;
43074
- await this.fund(request, txCost);
42807
+ request.gasPrice = bn(txParams.gasPrice ?? minGasPrice);
42808
+ request.gasLimit = bn(txParams.gasLimit ?? gasUsed);
42809
+ this.validateGas({
42810
+ gasUsed,
42811
+ gasPrice: request.gasPrice,
42812
+ gasLimit: request.gasLimit,
42813
+ minGasPrice
42814
+ });
42815
+ await this.fund(request, requiredQuantities, maxFee);
42816
+ request.updatePredicateInputs(estimatedInputs);
43075
42817
  return request;
43076
42818
  }
43077
42819
  /**
@@ -43083,14 +42825,15 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43083
42825
  * @param txParams - The transaction parameters (gasLimit, gasPrice, maturity).
43084
42826
  * @returns A promise that resolves to the transaction response.
43085
42827
  */
43086
- async transfer(destination, amount, assetId = BaseAssetId, txParams = {}) {
42828
+ async transfer(destination, amount, assetId, txParams = {}) {
43087
42829
  if (bn(amount).lte(0)) {
43088
42830
  throw new FuelError(
43089
42831
  ErrorCode.INVALID_TRANSFER_AMOUNT,
43090
42832
  "Transfer amount must be a positive number."
43091
42833
  );
43092
42834
  }
43093
- const request = await this.createTransfer(destination, amount, assetId, txParams);
42835
+ const assetIdToTransfer = assetId ?? this.provider.getBaseAssetId();
42836
+ const request = await this.createTransfer(destination, amount, assetIdToTransfer, txParams);
43094
42837
  return this.sendTransaction(request, { estimateTxDependencies: false });
43095
42838
  }
43096
42839
  /**
@@ -43102,7 +42845,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43102
42845
  * @param txParams - The optional transaction parameters.
43103
42846
  * @returns A promise that resolves to the transaction response.
43104
42847
  */
43105
- async transferToContract(contractId, amount, assetId = BaseAssetId, txParams = {}) {
42848
+ async transferToContract(contractId, amount, assetId, txParams = {}) {
43106
42849
  if (bn(amount).lte(0)) {
43107
42850
  throw new FuelError(
43108
42851
  ErrorCode.INVALID_TRANSFER_AMOUNT,
@@ -43110,30 +42853,33 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43110
42853
  );
43111
42854
  }
43112
42855
  const contractAddress = Address.fromAddressOrString(contractId);
42856
+ const { minGasPrice } = this.provider.getGasConfig();
42857
+ const baseAssetId = this.provider.getBaseAssetId();
42858
+ const assetIdToTransfer = assetId ?? this.provider.getBaseAssetId();
42859
+ const params = { gasPrice: minGasPrice, baseAssetId, ...txParams };
43113
42860
  const { script, scriptData } = await assembleTransferToContractScript({
43114
42861
  hexlifiedContractId: contractAddress.toB256(),
43115
42862
  amountToTransfer: bn(amount),
43116
- assetId
42863
+ assetId: assetIdToTransfer
43117
42864
  });
43118
42865
  const request = new ScriptTransactionRequest({
43119
- ...txParams,
42866
+ ...params,
43120
42867
  script,
43121
42868
  scriptData
43122
42869
  });
43123
42870
  request.addContractInputAndOutput(contractAddress);
43124
- const txCost = await this.provider.getTransactionCost(request, {
43125
- resourcesOwner: this,
43126
- quantitiesToContract: [{ amount: bn(amount), assetId: String(assetId) }]
42871
+ const { maxFee, requiredQuantities, gasUsed } = await this.provider.getTransactionCost(
42872
+ request,
42873
+ [{ amount: bn(amount), assetId: String(assetIdToTransfer) }]
42874
+ );
42875
+ request.gasLimit = bn(params.gasLimit ?? gasUsed);
42876
+ this.validateGas({
42877
+ gasUsed,
42878
+ gasPrice: request.gasPrice,
42879
+ gasLimit: request.gasLimit,
42880
+ minGasPrice
43127
42881
  });
43128
- if (txParams.gasLimit) {
43129
- this.validateGas({
43130
- gasUsed: txCost.gasUsed,
43131
- gasLimit: request.gasLimit
43132
- });
43133
- }
43134
- request.gasLimit = txCost.gasUsed;
43135
- request.maxFee = txCost.maxFee;
43136
- await this.fund(request, txCost);
42882
+ await this.fund(request, requiredQuantities, maxFee);
43137
42883
  return this.sendTransaction(request);
43138
42884
  }
43139
42885
  /**
@@ -43145,6 +42891,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43145
42891
  * @returns A promise that resolves to the transaction response.
43146
42892
  */
43147
42893
  async withdrawToBaseLayer(recipient, amount, txParams = {}) {
42894
+ const { minGasPrice } = this.provider.getGasConfig();
42895
+ const baseAssetId = this.provider.getBaseAssetId();
43148
42896
  const recipientAddress = Address.fromAddressOrString(recipient);
43149
42897
  const recipientDataArray = arrayify(
43150
42898
  "0x".concat(recipientAddress.toHexString().substring(2).padStart(64, "0"))
@@ -43157,19 +42905,26 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43157
42905
  ...recipientDataArray,
43158
42906
  ...amountDataArray
43159
42907
  ]);
43160
- const params = { script, ...txParams };
42908
+ const params = {
42909
+ script,
42910
+ gasPrice: minGasPrice,
42911
+ baseAssetId,
42912
+ ...txParams
42913
+ };
43161
42914
  const request = new ScriptTransactionRequest(params);
43162
- const quantitiesToContract = [{ amount: bn(amount), assetId: BaseAssetId }];
43163
- const txCost = await this.provider.getTransactionCost(request, { quantitiesToContract });
43164
- if (txParams.gasLimit) {
43165
- this.validateGas({
43166
- gasUsed: txCost.gasUsed,
43167
- gasLimit: request.gasLimit
43168
- });
43169
- }
43170
- request.maxFee = txCost.maxFee;
43171
- request.gasLimit = txCost.gasUsed;
43172
- await this.fund(request, txCost);
42915
+ const forwardingQuantities = [{ amount: bn(amount), assetId: baseAssetId }];
42916
+ const { requiredQuantities, maxFee, gasUsed } = await this.provider.getTransactionCost(
42917
+ request,
42918
+ forwardingQuantities
42919
+ );
42920
+ request.gasLimit = bn(params.gasLimit ?? gasUsed);
42921
+ this.validateGas({
42922
+ gasUsed,
42923
+ gasPrice: request.gasPrice,
42924
+ gasLimit: request.gasLimit,
42925
+ minGasPrice
42926
+ });
42927
+ await this.fund(request, requiredQuantities, maxFee);
43173
42928
  return this.sendTransaction(request);
43174
42929
  }
43175
42930
  async signMessage(message) {
@@ -43227,7 +42982,18 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43227
42982
  }
43228
42983
  return this.provider.simulate(transactionRequest, { estimateTxDependencies: false });
43229
42984
  }
43230
- validateGas({ gasUsed, gasLimit }) {
42985
+ validateGas({
42986
+ gasUsed,
42987
+ gasPrice,
42988
+ gasLimit,
42989
+ minGasPrice
42990
+ }) {
42991
+ if (minGasPrice.gt(gasPrice)) {
42992
+ throw new FuelError(
42993
+ ErrorCode.GAS_PRICE_TOO_LOW,
42994
+ `Gas price '${gasPrice}' is lower than the required: '${minGasPrice}'.`
42995
+ );
42996
+ }
43231
42997
  if (gasUsed.gt(gasLimit)) {
43232
42998
  throw new FuelError(
43233
42999
  ErrorCode.GAS_LIMIT_TOO_LOW,
@@ -44610,12 +44376,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44610
44376
  };
44611
44377
 
44612
44378
  // ../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-node/rng.js
44613
- var import_crypto16 = __toESM(__require("crypto"));
44379
+ var import_crypto15 = __toESM(__require("crypto"));
44614
44380
  var rnds8Pool = new Uint8Array(256);
44615
44381
  var poolPtr = rnds8Pool.length;
44616
44382
  function rng() {
44617
44383
  if (poolPtr > rnds8Pool.length - 16) {
44618
- import_crypto16.default.randomFillSync(rnds8Pool);
44384
+ import_crypto15.default.randomFillSync(rnds8Pool);
44619
44385
  poolPtr = 0;
44620
44386
  }
44621
44387
  return rnds8Pool.slice(poolPtr, poolPtr += 16);
@@ -44631,9 +44397,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44631
44397
  }
44632
44398
 
44633
44399
  // ../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-node/native.js
44634
- var import_crypto17 = __toESM(__require("crypto"));
44400
+ var import_crypto16 = __toESM(__require("crypto"));
44635
44401
  var native_default = {
44636
- randomUUID: import_crypto17.default.randomUUID
44402
+ randomUUID: import_crypto16.default.randomUUID
44637
44403
  };
44638
44404
 
44639
44405
  // ../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-node/v4.js
@@ -44816,7 +44582,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44816
44582
  * @param transactionRequestLike - The transaction request to send.
44817
44583
  * @returns A promise that resolves to the TransactionResponse object.
44818
44584
  */
44819
- async sendTransaction(transactionRequestLike, { estimateTxDependencies = false, awaitExecution } = {}) {
44585
+ async sendTransaction(transactionRequestLike, { estimateTxDependencies = true, awaitExecution } = {}) {
44820
44586
  const transactionRequest = transactionRequestify(transactionRequestLike);
44821
44587
  if (estimateTxDependencies) {
44822
44588
  await this.provider.estimateTxDependencies(transactionRequest);
@@ -48094,8 +47860,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
48094
47860
  const { policies } = BaseTransactionRequest.getPolicyMeta(request);
48095
47861
  request.inputs?.forEach((input) => {
48096
47862
  if (input.type === InputType.Coin && hexlify(input.owner) === this.address.toB256()) {
48097
- input.predicate = hexlify(this.bytes);
48098
- input.predicateData = hexlify(this.getPredicateData(policies.length));
47863
+ input.predicate = this.bytes;
47864
+ input.predicateData = this.getPredicateData(policies.length);
48099
47865
  }
48100
47866
  });
48101
47867
  return request;
@@ -48109,8 +47875,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
48109
47875
  * @param txParams - The transaction parameters (gasLimit, gasPrice, maturity).
48110
47876
  * @returns A promise that resolves to the prepared transaction request.
48111
47877
  */
48112
- async createTransfer(destination, amount, assetId = BaseAssetId, txParams = {}) {
48113
- return super.createTransfer(destination, amount, assetId, txParams);
47878
+ async createTransfer(destination, amount, assetId, txParams = {}) {
47879
+ const assetIdToTransfer = assetId ?? this.provider.getBaseAssetId();
47880
+ const request = await super.createTransfer(destination, amount, assetIdToTransfer, txParams);
47881
+ return this.populateTransactionPredicateData(request);
48114
47882
  }
48115
47883
  /**
48116
47884
  * Sends a transaction with the populated predicate data.
@@ -48118,9 +47886,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
48118
47886
  * @param transactionRequestLike - The transaction request-like object.
48119
47887
  * @returns A promise that resolves to the transaction response.
48120
47888
  */
48121
- sendTransaction(transactionRequestLike) {
48122
- const transactionRequest = transactionRequestify(transactionRequestLike);
48123
- return super.sendTransaction(transactionRequest, { estimateTxDependencies: false });
47889
+ sendTransaction(transactionRequestLike, options) {
47890
+ const transactionRequest = this.populateTransactionPredicateData(transactionRequestLike);
47891
+ return super.sendTransaction(transactionRequest, options);
48124
47892
  }
48125
47893
  /**
48126
47894
  * Simulates a transaction with the populated predicate data.
@@ -48129,8 +47897,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
48129
47897
  * @returns A promise that resolves to the call result.
48130
47898
  */
48131
47899
  simulateTransaction(transactionRequestLike) {
48132
- const transactionRequest = transactionRequestify(transactionRequestLike);
48133
- return super.simulateTransaction(transactionRequest, { estimateTxDependencies: false });
47900
+ const transactionRequest = this.populateTransactionPredicateData(transactionRequestLike);
47901
+ return super.simulateTransaction(transactionRequest);
48134
47902
  }
48135
47903
  getPredicateData(policiesLength) {
48136
47904
  if (!this.predicateData.length) {
@@ -48176,25 +47944,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
48176
47944
  predicateInterface: abiInterface
48177
47945
  };
48178
47946
  }
48179
- /**
48180
- * Retrieves resources satisfying the spend query for the account.
48181
- *
48182
- * @param quantities - IDs of coins to exclude.
48183
- * @param excludedIds - IDs of resources to be excluded from the query.
48184
- * @returns A promise that resolves to an array of Resources.
48185
- */
48186
- async getResourcesToSpend(quantities, excludedIds) {
48187
- const resources = await this.provider.getResourcesToSpend(
48188
- this.address,
48189
- quantities,
48190
- excludedIds
48191
- );
48192
- return resources.map((resource) => ({
48193
- ...resource,
48194
- predicate: hexlify(this.bytes),
48195
- paddPredicateData: (policiesLength) => hexlify(this.getPredicateData(policiesLength))
48196
- }));
48197
- }
48198
47947
  /**
48199
47948
  * Sets the configurable constants for the predicate.
48200
47949
  *