@fuel-ts/account 0.0.0-rc-2021-20240424121206 → 0.0.0-rc-1976-20240424150847

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 (56) hide show
  1. package/README.md +3 -3
  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 +686 -942
  12. package/dist/index.global.js.map +1 -1
  13. package/dist/index.js +605 -865
  14. package/dist/index.js.map +1 -1
  15. package/dist/index.mjs +448 -707
  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 +327 -821
  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/message.d.ts +1 -7
  26. package/dist/providers/message.d.ts.map +1 -1
  27. package/dist/providers/provider.d.ts +34 -37
  28. package/dist/providers/provider.d.ts.map +1 -1
  29. package/dist/providers/transaction-request/create-transaction-request.d.ts +1 -1
  30. package/dist/providers/transaction-request/create-transaction-request.d.ts.map +1 -1
  31. package/dist/providers/transaction-request/input.d.ts +2 -2
  32. package/dist/providers/transaction-request/input.d.ts.map +1 -1
  33. package/dist/providers/transaction-request/script-transaction-request.d.ts.map +1 -1
  34. package/dist/providers/transaction-request/transaction-request.d.ts +33 -12
  35. package/dist/providers/transaction-request/transaction-request.d.ts.map +1 -1
  36. package/dist/providers/transaction-request/utils.d.ts +0 -3
  37. package/dist/providers/transaction-request/utils.d.ts.map +1 -1
  38. package/dist/providers/transaction-response/transaction-response.d.ts.map +1 -1
  39. package/dist/providers/transaction-summary/assemble-transaction-summary.d.ts +0 -2
  40. package/dist/providers/transaction-summary/assemble-transaction-summary.d.ts.map +1 -1
  41. package/dist/providers/transaction-summary/calculate-transaction-fee.d.ts +2 -3
  42. package/dist/providers/transaction-summary/calculate-transaction-fee.d.ts.map +1 -1
  43. package/dist/providers/transaction-summary/get-transaction-summary.d.ts.map +1 -1
  44. package/dist/providers/utils/gas.d.ts +2 -8
  45. package/dist/providers/utils/gas.d.ts.map +1 -1
  46. package/dist/providers/utils/merge-quantities.d.ts +1 -1
  47. package/dist/providers/utils/merge-quantities.d.ts.map +1 -1
  48. package/dist/test-utils/launchNode.d.ts.map +1 -1
  49. package/dist/test-utils.global.js +1218 -1690
  50. package/dist/test-utils.global.js.map +1 -1
  51. package/dist/test-utils.js +604 -846
  52. package/dist/test-utils.js.map +1 -1
  53. package/dist/test-utils.mjs +458 -700
  54. package/dist/test-utils.mjs.map +1 -1
  55. package/dist/wallet/base-wallet-unlocked.d.ts.map +1 -1
  56. 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
@@ -6210,9 +6210,9 @@
6210
6210
  }
6211
6211
  });
6212
6212
 
6213
- // ../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/jsutils/isObjectLike.js
6213
+ // ../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/jsutils/isObjectLike.js
6214
6214
  var require_isObjectLike = __commonJS({
6215
- "../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/jsutils/isObjectLike.js"(exports) {
6215
+ "../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/jsutils/isObjectLike.js"(exports) {
6216
6216
  "use strict";
6217
6217
  Object.defineProperty(exports, "__esModule", {
6218
6218
  value: true
@@ -6224,9 +6224,9 @@
6224
6224
  }
6225
6225
  });
6226
6226
 
6227
- // ../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/jsutils/invariant.js
6227
+ // ../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/jsutils/invariant.js
6228
6228
  var require_invariant = __commonJS({
6229
- "../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/jsutils/invariant.js"(exports) {
6229
+ "../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/jsutils/invariant.js"(exports) {
6230
6230
  "use strict";
6231
6231
  Object.defineProperty(exports, "__esModule", {
6232
6232
  value: true
@@ -6243,9 +6243,9 @@
6243
6243
  }
6244
6244
  });
6245
6245
 
6246
- // ../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/location.js
6246
+ // ../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/language/location.js
6247
6247
  var require_location = __commonJS({
6248
- "../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/location.js"(exports) {
6248
+ "../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/language/location.js"(exports) {
6249
6249
  "use strict";
6250
6250
  Object.defineProperty(exports, "__esModule", {
6251
6251
  value: true
@@ -6272,9 +6272,9 @@
6272
6272
  }
6273
6273
  });
6274
6274
 
6275
- // ../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/printLocation.js
6275
+ // ../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/language/printLocation.js
6276
6276
  var require_printLocation = __commonJS({
6277
- "../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/printLocation.js"(exports) {
6277
+ "../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/language/printLocation.js"(exports) {
6278
6278
  "use strict";
6279
6279
  Object.defineProperty(exports, "__esModule", {
6280
6280
  value: true
@@ -6330,9 +6330,9 @@
6330
6330
  }
6331
6331
  });
6332
6332
 
6333
- // ../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/error/GraphQLError.js
6333
+ // ../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/error/GraphQLError.js
6334
6334
  var require_GraphQLError = __commonJS({
6335
- "../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/error/GraphQLError.js"(exports) {
6335
+ "../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/error/GraphQLError.js"(exports) {
6336
6336
  "use strict";
6337
6337
  Object.defineProperty(exports, "__esModule", {
6338
6338
  value: true
@@ -6502,9 +6502,9 @@
6502
6502
  }
6503
6503
  });
6504
6504
 
6505
- // ../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/error/syntaxError.js
6505
+ // ../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/error/syntaxError.js
6506
6506
  var require_syntaxError = __commonJS({
6507
- "../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/error/syntaxError.js"(exports) {
6507
+ "../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/error/syntaxError.js"(exports) {
6508
6508
  "use strict";
6509
6509
  Object.defineProperty(exports, "__esModule", {
6510
6510
  value: true
@@ -6520,9 +6520,9 @@
6520
6520
  }
6521
6521
  });
6522
6522
 
6523
- // ../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/ast.js
6523
+ // ../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/language/ast.js
6524
6524
  var require_ast = __commonJS({
6525
- "../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/ast.js"(exports) {
6525
+ "../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/language/ast.js"(exports) {
6526
6526
  "use strict";
6527
6527
  Object.defineProperty(exports, "__esModule", {
6528
6528
  value: true
@@ -6704,9 +6704,9 @@
6704
6704
  }
6705
6705
  });
6706
6706
 
6707
- // ../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/directiveLocation.js
6707
+ // ../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/language/directiveLocation.js
6708
6708
  var require_directiveLocation = __commonJS({
6709
- "../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/directiveLocation.js"(exports) {
6709
+ "../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/language/directiveLocation.js"(exports) {
6710
6710
  "use strict";
6711
6711
  Object.defineProperty(exports, "__esModule", {
6712
6712
  value: true
@@ -6738,9 +6738,9 @@
6738
6738
  }
6739
6739
  });
6740
6740
 
6741
- // ../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/kinds.js
6741
+ // ../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/language/kinds.js
6742
6742
  var require_kinds = __commonJS({
6743
- "../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/kinds.js"(exports) {
6743
+ "../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/language/kinds.js"(exports) {
6744
6744
  "use strict";
6745
6745
  Object.defineProperty(exports, "__esModule", {
6746
6746
  value: true
@@ -6796,9 +6796,9 @@
6796
6796
  }
6797
6797
  });
6798
6798
 
6799
- // ../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/characterClasses.js
6799
+ // ../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/language/characterClasses.js
6800
6800
  var require_characterClasses = __commonJS({
6801
- "../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/characterClasses.js"(exports) {
6801
+ "../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/language/characterClasses.js"(exports) {
6802
6802
  "use strict";
6803
6803
  Object.defineProperty(exports, "__esModule", {
6804
6804
  value: true
@@ -6827,9 +6827,9 @@
6827
6827
  }
6828
6828
  });
6829
6829
 
6830
- // ../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/blockString.js
6830
+ // ../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/language/blockString.js
6831
6831
  var require_blockString = __commonJS({
6832
- "../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/blockString.js"(exports) {
6832
+ "../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/language/blockString.js"(exports) {
6833
6833
  "use strict";
6834
6834
  Object.defineProperty(exports, "__esModule", {
6835
6835
  value: true
@@ -6946,9 +6946,9 @@
6946
6946
  }
6947
6947
  });
6948
6948
 
6949
- // ../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/tokenKind.js
6949
+ // ../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/language/tokenKind.js
6950
6950
  var require_tokenKind = __commonJS({
6951
- "../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/tokenKind.js"(exports) {
6951
+ "../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/language/tokenKind.js"(exports) {
6952
6952
  "use strict";
6953
6953
  Object.defineProperty(exports, "__esModule", {
6954
6954
  value: true
@@ -6983,9 +6983,9 @@
6983
6983
  }
6984
6984
  });
6985
6985
 
6986
- // ../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/lexer.js
6986
+ // ../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/language/lexer.js
6987
6987
  var require_lexer = __commonJS({
6988
- "../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/lexer.js"(exports) {
6988
+ "../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/language/lexer.js"(exports) {
6989
6989
  "use strict";
6990
6990
  Object.defineProperty(exports, "__esModule", {
6991
6991
  value: true
@@ -7590,9 +7590,9 @@
7590
7590
  }
7591
7591
  });
7592
7592
 
7593
- // ../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/jsutils/devAssert.js
7593
+ // ../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/jsutils/devAssert.js
7594
7594
  var require_devAssert = __commonJS({
7595
- "../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/jsutils/devAssert.js"(exports) {
7595
+ "../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/jsutils/devAssert.js"(exports) {
7596
7596
  "use strict";
7597
7597
  Object.defineProperty(exports, "__esModule", {
7598
7598
  value: true
@@ -7607,9 +7607,9 @@
7607
7607
  }
7608
7608
  });
7609
7609
 
7610
- // ../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/jsutils/inspect.js
7610
+ // ../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/jsutils/inspect.js
7611
7611
  var require_inspect = __commonJS({
7612
- "../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/jsutils/inspect.js"(exports) {
7612
+ "../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/jsutils/inspect.js"(exports) {
7613
7613
  "use strict";
7614
7614
  Object.defineProperty(exports, "__esModule", {
7615
7615
  value: true
@@ -7699,9 +7699,9 @@
7699
7699
  }
7700
7700
  });
7701
7701
 
7702
- // ../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/jsutils/instanceOf.js
7702
+ // ../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/jsutils/instanceOf.js
7703
7703
  var require_instanceOf = __commonJS({
7704
- "../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/jsutils/instanceOf.js"(exports) {
7704
+ "../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/jsutils/instanceOf.js"(exports) {
7705
7705
  "use strict";
7706
7706
  Object.defineProperty(exports, "__esModule", {
7707
7707
  value: true
@@ -7711,8 +7711,7 @@
7711
7711
  var instanceOf4 = (
7712
7712
  /* c8 ignore next 6 */
7713
7713
  // FIXME: https://github.com/graphql/graphql-js/issues/2317
7714
- // eslint-disable-next-line no-undef
7715
- process.env.NODE_ENV === "production" ? function instanceOf5(value, constructor) {
7714
+ globalThis.process && globalThis.process.env.NODE_ENV === "production" ? function instanceOf5(value, constructor) {
7716
7715
  return value instanceof constructor;
7717
7716
  } : function instanceOf5(value, constructor) {
7718
7717
  if (value instanceof constructor) {
@@ -7748,9 +7747,9 @@ spurious results.`);
7748
7747
  }
7749
7748
  });
7750
7749
 
7751
- // ../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/source.js
7750
+ // ../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/language/source.js
7752
7751
  var require_source = __commonJS({
7753
- "../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/source.js"(exports) {
7752
+ "../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/language/source.js"(exports) {
7754
7753
  "use strict";
7755
7754
  Object.defineProperty(exports, "__esModule", {
7756
7755
  value: true
@@ -7792,9 +7791,9 @@ spurious results.`);
7792
7791
  }
7793
7792
  });
7794
7793
 
7795
- // ../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/parser.js
7794
+ // ../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/language/parser.js
7796
7795
  var require_parser = __commonJS({
7797
- "../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/parser.js"(exports) {
7796
+ "../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/language/parser.js"(exports) {
7798
7797
  "use strict";
7799
7798
  Object.defineProperty(exports, "__esModule", {
7800
7799
  value: true
@@ -9101,9 +9100,9 @@ spurious results.`);
9101
9100
  }
9102
9101
  });
9103
9102
 
9104
- // ../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/printString.js
9103
+ // ../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/language/printString.js
9105
9104
  var require_printString = __commonJS({
9106
- "../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/printString.js"(exports) {
9105
+ "../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/language/printString.js"(exports) {
9107
9106
  "use strict";
9108
9107
  Object.defineProperty(exports, "__esModule", {
9109
9108
  value: true
@@ -9286,9 +9285,9 @@ spurious results.`);
9286
9285
  }
9287
9286
  });
9288
9287
 
9289
- // ../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/visitor.js
9288
+ // ../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/language/visitor.js
9290
9289
  var require_visitor = __commonJS({
9291
- "../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/visitor.js"(exports) {
9290
+ "../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/language/visitor.js"(exports) {
9292
9291
  "use strict";
9293
9292
  Object.defineProperty(exports, "__esModule", {
9294
9293
  value: true
@@ -9497,9 +9496,9 @@ spurious results.`);
9497
9496
  }
9498
9497
  });
9499
9498
 
9500
- // ../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/printer.js
9499
+ // ../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/language/printer.js
9501
9500
  var require_printer = __commonJS({
9502
- "../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/printer.js"(exports) {
9501
+ "../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/language/printer.js"(exports) {
9503
9502
  "use strict";
9504
9503
  Object.defineProperty(exports, "__esModule", {
9505
9504
  value: true
@@ -19258,9 +19257,9 @@ spurious results.`);
19258
19257
  }
19259
19258
  });
19260
19259
 
19261
- // ../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/defaultJsonSerializer.js
19260
+ // ../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.8.1/node_modules/graphql-request/dist/defaultJsonSerializer.js
19262
19261
  var require_defaultJsonSerializer = __commonJS({
19263
- "../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/defaultJsonSerializer.js"(exports) {
19262
+ "../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.8.1/node_modules/graphql-request/dist/defaultJsonSerializer.js"(exports) {
19264
19263
  "use strict";
19265
19264
  Object.defineProperty(exports, "__esModule", { value: true });
19266
19265
  exports.defaultJsonSerializer = void 0;
@@ -19271,9 +19270,9 @@ spurious results.`);
19271
19270
  }
19272
19271
  });
19273
19272
 
19274
- // ../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/createRequestBody.js
19273
+ // ../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.8.1/node_modules/graphql-request/dist/createRequestBody.js
19275
19274
  var require_createRequestBody = __commonJS({
19276
- "../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/createRequestBody.js"(exports) {
19275
+ "../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.8.1/node_modules/graphql-request/dist/createRequestBody.js"(exports) {
19277
19276
  "use strict";
19278
19277
  var __importDefault = exports && exports.__importDefault || function(mod2) {
19279
19278
  return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
@@ -19322,9 +19321,9 @@ spurious results.`);
19322
19321
  }
19323
19322
  });
19324
19323
 
19325
- // ../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/parseArgs.js
19324
+ // ../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.8.1/node_modules/graphql-request/dist/parseArgs.js
19326
19325
  var require_parseArgs = __commonJS({
19327
- "../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/parseArgs.js"(exports) {
19326
+ "../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.8.1/node_modules/graphql-request/dist/parseArgs.js"(exports) {
19328
19327
  "use strict";
19329
19328
  Object.defineProperty(exports, "__esModule", { value: true });
19330
19329
  exports.parseBatchRequestsExtendedArgs = exports.parseRawRequestExtendedArgs = exports.parseRequestExtendedArgs = exports.parseBatchRequestArgs = exports.parseRawRequestArgs = exports.parseRequestArgs = void 0;
@@ -19386,9 +19385,9 @@ spurious results.`);
19386
19385
  }
19387
19386
  });
19388
19387
 
19389
- // ../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/types.js
19388
+ // ../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.8.1/node_modules/graphql-request/dist/types.js
19390
19389
  var require_types = __commonJS({
19391
- "../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/types.js"(exports) {
19390
+ "../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.8.1/node_modules/graphql-request/dist/types.js"(exports) {
19392
19391
  "use strict";
19393
19392
  var __extends = exports && exports.__extends || function() {
19394
19393
  var extendStatics = function(d, b) {
@@ -19446,9 +19445,9 @@ spurious results.`);
19446
19445
  }
19447
19446
  });
19448
19447
 
19449
- // ../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/graphql-ws.js
19448
+ // ../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.8.1/node_modules/graphql-request/dist/graphql-ws.js
19450
19449
  var require_graphql_ws = __commonJS({
19451
- "../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/graphql-ws.js"(exports) {
19450
+ "../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.8.1/node_modules/graphql-request/dist/graphql-ws.js"(exports) {
19452
19451
  "use strict";
19453
19452
  var __assign2 = exports && exports.__assign || function() {
19454
19453
  __assign2 = Object.assign || function(t) {
@@ -19818,9 +19817,9 @@ spurious results.`);
19818
19817
  }
19819
19818
  });
19820
19819
 
19821
- // ../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/index.js
19820
+ // ../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.8.1/node_modules/graphql-request/dist/index.js
19822
19821
  var require_dist2 = __commonJS({
19823
- "../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.6.0/node_modules/graphql-request/dist/index.js"(exports) {
19822
+ "../../node_modules/.pnpm/graphql-request@5.0.0_graphql@16.8.1/node_modules/graphql-request/dist/index.js"(exports) {
19824
19823
  "use strict";
19825
19824
  var __assign2 = exports && exports.__assign || function() {
19826
19825
  __assign2 = Object.assign || function(t) {
@@ -28952,8 +28951,8 @@ spurious results.`);
28952
28951
  // ../versions/dist/index.mjs
28953
28952
  function getBuiltinVersions() {
28954
28953
  return {
28955
- FORC: "0.51.1",
28956
- FUEL_CORE: "0.24.2",
28954
+ FORC: "0.49.3",
28955
+ FUEL_CORE: "0.22.1",
28957
28956
  FUELS: "0.81.0"
28958
28957
  };
28959
28958
  }
@@ -31272,10 +31271,6 @@ This unreleased fuel-core build may include features and updates not yet support
31272
31271
  }
31273
31272
  };
31274
31273
 
31275
- // ../address/dist/configs.mjs
31276
- var ZeroBytes32 = "0x0000000000000000000000000000000000000000000000000000000000000000";
31277
- var BaseAssetId = ZeroBytes32;
31278
-
31279
31274
  // ../math/dist/index.mjs
31280
31275
  var import_bn = __toESM(require_bn(), 1);
31281
31276
  var DEFAULT_PRECISION = 9;
@@ -31495,182 +31490,32 @@ This unreleased fuel-core build may include features and updates not yet support
31495
31490
  function toBytes3(value, bytesPadding) {
31496
31491
  return bn(value).toBytes(bytesPadding);
31497
31492
  }
31498
-
31499
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isPlaceholder.js
31500
- function _isPlaceholder(a) {
31501
- return a != null && typeof a === "object" && a["@@functional/placeholder"] === true;
31502
- }
31503
-
31504
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_curry1.js
31505
- function _curry1(fn) {
31506
- return function f1(a) {
31507
- if (arguments.length === 0 || _isPlaceholder(a)) {
31508
- return f1;
31509
- } else {
31510
- return fn.apply(this, arguments);
31511
- }
31512
- };
31513
- }
31514
-
31515
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isArray.js
31516
- var isArray_default = Array.isArray || function _isArray(val) {
31517
- return val != null && val.length >= 0 && Object.prototype.toString.call(val) === "[object Array]";
31518
- };
31519
-
31520
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/type.js
31521
- var type = /* @__PURE__ */ _curry1(function type2(val) {
31522
- return val === null ? "Null" : val === void 0 ? "Undefined" : Object.prototype.toString.call(val).slice(8, -1);
31523
- });
31524
- var type_default = type;
31525
-
31526
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_toISOString.js
31527
- var pad = function pad2(n) {
31528
- return (n < 10 ? "0" : "") + n;
31529
- };
31530
- var _toISOString = typeof Date.prototype.toISOString === "function" ? function _toISOString2(d) {
31531
- return d.toISOString();
31532
- } : function _toISOString3(d) {
31533
- 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";
31534
- };
31535
-
31536
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isInteger.js
31537
- var isInteger_default = Number.isInteger || function _isInteger(n) {
31538
- return n << 0 === n;
31539
- };
31540
-
31541
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_cloneRegExp.js
31542
- function _cloneRegExp(pattern) {
31543
- 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" : ""));
31493
+ function max(...numbers) {
31494
+ return numbers.reduce((prev, cur) => bn(cur).gt(prev) ? bn(cur) : prev, bn(0));
31544
31495
  }
31545
31496
 
31546
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_clone.js
31547
- function _clone(value, deep, map) {
31548
- map || (map = new _ObjectMap());
31549
- if (_isPrimitive(value)) {
31550
- return value;
31551
- }
31552
- var copy = function copy2(copiedValue) {
31553
- var cachedCopy = map.get(value);
31554
- if (cachedCopy) {
31555
- return cachedCopy;
31556
- }
31557
- map.set(value, copiedValue);
31558
- for (var key in value) {
31559
- if (Object.prototype.hasOwnProperty.call(value, key)) {
31560
- copiedValue[key] = deep ? _clone(value[key], true, map) : value[key];
31561
- }
31562
- }
31563
- return copiedValue;
31564
- };
31565
- switch (type_default(value)) {
31566
- case "Object":
31567
- return copy(Object.create(Object.getPrototypeOf(value)));
31568
- case "Array":
31569
- return copy([]);
31570
- case "Date":
31571
- return new Date(value.valueOf());
31572
- case "RegExp":
31573
- return _cloneRegExp(value);
31574
- case "Int8Array":
31575
- case "Uint8Array":
31576
- case "Uint8ClampedArray":
31577
- case "Int16Array":
31578
- case "Uint16Array":
31579
- case "Int32Array":
31580
- case "Uint32Array":
31581
- case "Float32Array":
31582
- case "Float64Array":
31583
- case "BigInt64Array":
31584
- case "BigUint64Array":
31585
- return value.slice();
31586
- default:
31587
- return value;
31588
- }
31589
- }
31590
- function _isPrimitive(param) {
31591
- var type3 = typeof param;
31592
- return param == null || type3 != "object" && type3 != "function";
31593
- }
31594
- var _ObjectMap = /* @__PURE__ */ function() {
31595
- function _ObjectMap2() {
31596
- this.map = {};
31597
- this.length = 0;
31598
- }
31599
- _ObjectMap2.prototype.set = function(key, value) {
31600
- const hashedKey = this.hash(key);
31601
- let bucket = this.map[hashedKey];
31602
- if (!bucket) {
31603
- this.map[hashedKey] = bucket = [];
31604
- }
31605
- bucket.push([key, value]);
31606
- this.length += 1;
31607
- };
31608
- _ObjectMap2.prototype.hash = function(key) {
31609
- let hashedKey = [];
31610
- for (var value in key) {
31611
- hashedKey.push(Object.prototype.toString.call(key[value]));
31612
- }
31613
- return hashedKey.join();
31614
- };
31615
- _ObjectMap2.prototype.get = function(key) {
31616
- if (this.length <= 180) {
31617
- for (const p in this.map) {
31618
- const bucket2 = this.map[p];
31619
- for (let i = 0; i < bucket2.length; i += 1) {
31620
- const element = bucket2[i];
31621
- if (element[0] === key) {
31622
- return element[1];
31623
- }
31624
- }
31625
- }
31626
- return;
31627
- }
31628
- const hashedKey = this.hash(key);
31629
- const bucket = this.map[hashedKey];
31630
- if (!bucket) {
31631
- return;
31632
- }
31633
- for (let i = 0; i < bucket.length; i += 1) {
31634
- const element = bucket[i];
31635
- if (element[0] === key) {
31636
- return element[1];
31637
- }
31638
- }
31639
- };
31640
- return _ObjectMap2;
31641
- }();
31642
-
31643
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/clone.js
31644
- var clone = /* @__PURE__ */ _curry1(function clone2(value) {
31645
- return value != null && typeof value.clone === "function" ? value.clone() : _clone(value, true);
31646
- });
31647
- var clone_default = clone;
31648
-
31649
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/trim.js
31650
- var hasProtoTrim = typeof String.prototype.trim === "function";
31651
-
31652
31497
  // src/providers/coin-quantity.ts
31653
31498
  var coinQuantityfy = (coinQuantityLike) => {
31654
31499
  let assetId;
31655
31500
  let amount;
31656
- let max;
31501
+ let max2;
31657
31502
  if (Array.isArray(coinQuantityLike)) {
31658
31503
  amount = coinQuantityLike[0];
31659
- assetId = coinQuantityLike[1] ?? BaseAssetId;
31660
- max = coinQuantityLike[2] ?? void 0;
31504
+ assetId = coinQuantityLike[1];
31505
+ max2 = coinQuantityLike[2];
31661
31506
  } else {
31662
31507
  amount = coinQuantityLike.amount;
31663
- assetId = coinQuantityLike.assetId ?? BaseAssetId;
31664
- max = coinQuantityLike.max ?? void 0;
31508
+ assetId = coinQuantityLike.assetId;
31509
+ max2 = coinQuantityLike.max ?? void 0;
31665
31510
  }
31666
31511
  const bnAmount = bn(amount);
31667
31512
  return {
31668
31513
  assetId: hexlify(assetId),
31669
31514
  amount: bnAmount.lt(1) ? bn(1) : bnAmount,
31670
- max: max ? bn(max) : void 0
31515
+ max: max2 ? bn(max2) : void 0
31671
31516
  };
31672
31517
  };
31673
- var addAmountToCoinQuantities = (params) => {
31518
+ var addAmountToAsset = (params) => {
31674
31519
  const { amount, assetId } = params;
31675
31520
  const coinQuantities = [...params.coinQuantities];
31676
31521
  const assetIdx = coinQuantities.findIndex((coinQuantity) => coinQuantity.assetId === assetId);
@@ -31755,7 +31600,7 @@ This unreleased fuel-core build may include features and updates not yet support
31755
31600
  var ENCODING_V1 = "1";
31756
31601
  var WORD_SIZE = 8;
31757
31602
  var BYTES_32 = 32;
31758
- var UTXO_ID_LEN = BYTES_32 + 2;
31603
+ var UTXO_ID_LEN = BYTES_32 + 1;
31759
31604
  var ASSET_ID_LEN = BYTES_32;
31760
31605
  var ADDRESS_LEN = BYTES_32;
31761
31606
  var NONCE_LEN = BYTES_32;
@@ -31763,9 +31608,9 @@ This unreleased fuel-core build may include features and updates not yet support
31763
31608
  var TX_POINTER_LEN = WORD_SIZE * 2;
31764
31609
  var MAX_BYTES = 2 ** 32 - 1;
31765
31610
  var calculateVmTxMemory = ({ maxInputs }) => BYTES_32 + // Tx ID
31766
- ASSET_ID_LEN + // Base asset ID
31611
+ WORD_SIZE + // Tx size
31767
31612
  // Asset ID/Balance coin input pairs
31768
- maxInputs * (ASSET_ID_LEN + WORD_SIZE) + WORD_SIZE;
31613
+ maxInputs * (ASSET_ID_LEN + WORD_SIZE);
31769
31614
  var SCRIPT_FIXED_SIZE = WORD_SIZE + // Identifier
31770
31615
  WORD_SIZE + // Gas limit
31771
31616
  WORD_SIZE + // Script size
@@ -31783,6 +31628,7 @@ This unreleased fuel-core build may include features and updates not yet support
31783
31628
  ASSET_ID_LEN + // Asset id
31784
31629
  TX_POINTER_LEN + // TxPointer
31785
31630
  WORD_SIZE + // Witnesses index
31631
+ WORD_SIZE + // Maturity
31786
31632
  WORD_SIZE + // Predicate size
31787
31633
  WORD_SIZE + // Predicate data size
31788
31634
  WORD_SIZE;
@@ -32104,7 +31950,7 @@ This unreleased fuel-core build may include features and updates not yet support
32104
31950
  constructor(name, coders) {
32105
31951
  const caseIndexCoder = new BigNumberCoder("u64");
32106
31952
  const encodedValueSize = Object.values(coders).reduce(
32107
- (max, coder) => Math.max(max, coder.encodedLength),
31953
+ (max2, coder) => Math.max(max2, coder.encodedLength),
32108
31954
  0
32109
31955
  );
32110
31956
  super(`enum ${name}`, `enum ${name}`, caseIndexCoder.encodedLength + encodedValueSize);
@@ -32822,7 +32668,7 @@ This unreleased fuel-core build may include features and updates not yet support
32822
32668
  constructor(name, coders) {
32823
32669
  const caseIndexCoder = new BigNumberCoder("u64");
32824
32670
  const encodedValueSize = Object.values(coders).reduce(
32825
- (max, coder) => Math.max(max, coder.encodedLength),
32671
+ (max2, coder) => Math.max(max2, coder.encodedLength),
32826
32672
  0
32827
32673
  );
32828
32674
  super(`enum ${name}`, `enum ${name}`, caseIndexCoder.encodedLength + encodedValueSize);
@@ -33536,19 +33382,18 @@ This unreleased fuel-core build may include features and updates not yet support
33536
33382
  encode(value) {
33537
33383
  const parts = [];
33538
33384
  parts.push(new B256Coder().encode(value.txID));
33539
- parts.push(new NumberCoder("u16").encode(value.outputIndex));
33385
+ parts.push(new NumberCoder("u8").encode(value.outputIndex));
33540
33386
  parts.push(new B256Coder().encode(value.owner));
33541
33387
  parts.push(new BigNumberCoder("u64").encode(value.amount));
33542
33388
  parts.push(new B256Coder().encode(value.assetId));
33543
33389
  parts.push(new TxPointerCoder().encode(value.txPointer));
33544
- parts.push(new NumberCoder("u16").encode(value.witnessIndex));
33390
+ parts.push(new NumberCoder("u8").encode(value.witnessIndex));
33391
+ parts.push(new NumberCoder("u32").encode(value.maturity));
33545
33392
  parts.push(new BigNumberCoder("u64").encode(value.predicateGasUsed));
33546
- parts.push(new BigNumberCoder("u64").encode(value.predicateLength));
33547
- parts.push(new BigNumberCoder("u64").encode(value.predicateDataLength));
33548
- parts.push(new ByteArrayCoder(value.predicateLength.toNumber()).encode(value.predicate));
33549
- parts.push(
33550
- new ByteArrayCoder(value.predicateDataLength.toNumber()).encode(value.predicateData)
33551
- );
33393
+ parts.push(new NumberCoder("u32").encode(value.predicateLength));
33394
+ parts.push(new NumberCoder("u32").encode(value.predicateDataLength));
33395
+ parts.push(new ByteArrayCoder(value.predicateLength).encode(value.predicate));
33396
+ parts.push(new ByteArrayCoder(value.predicateDataLength).encode(value.predicateData));
33552
33397
  return concat(parts);
33553
33398
  }
33554
33399
  decode(data, offset) {
@@ -33556,7 +33401,7 @@ This unreleased fuel-core build may include features and updates not yet support
33556
33401
  let o = offset;
33557
33402
  [decoded, o] = new B256Coder().decode(data, o);
33558
33403
  const txID = decoded;
33559
- [decoded, o] = new NumberCoder("u16").decode(data, o);
33404
+ [decoded, o] = new NumberCoder("u8").decode(data, o);
33560
33405
  const outputIndex = decoded;
33561
33406
  [decoded, o] = new B256Coder().decode(data, o);
33562
33407
  const owner = decoded;
@@ -33566,17 +33411,19 @@ This unreleased fuel-core build may include features and updates not yet support
33566
33411
  const assetId = decoded;
33567
33412
  [decoded, o] = new TxPointerCoder().decode(data, o);
33568
33413
  const txPointer = decoded;
33569
- [decoded, o] = new NumberCoder("u16").decode(data, o);
33414
+ [decoded, o] = new NumberCoder("u8").decode(data, o);
33570
33415
  const witnessIndex = Number(decoded);
33416
+ [decoded, o] = new NumberCoder("u32").decode(data, o);
33417
+ const maturity = decoded;
33571
33418
  [decoded, o] = new BigNumberCoder("u64").decode(data, o);
33572
33419
  const predicateGasUsed = decoded;
33573
- [decoded, o] = new BigNumberCoder("u64").decode(data, o);
33420
+ [decoded, o] = new NumberCoder("u32").decode(data, o);
33574
33421
  const predicateLength = decoded;
33575
- [decoded, o] = new BigNumberCoder("u64").decode(data, o);
33422
+ [decoded, o] = new NumberCoder("u32").decode(data, o);
33576
33423
  const predicateDataLength = decoded;
33577
- [decoded, o] = new ByteArrayCoder(predicateLength.toNumber()).decode(data, o);
33424
+ [decoded, o] = new ByteArrayCoder(predicateLength).decode(data, o);
33578
33425
  const predicate = decoded;
33579
- [decoded, o] = new ByteArrayCoder(predicateDataLength.toNumber()).decode(data, o);
33426
+ [decoded, o] = new ByteArrayCoder(predicateDataLength).decode(data, o);
33580
33427
  const predicateData = decoded;
33581
33428
  return [
33582
33429
  {
@@ -33588,6 +33435,7 @@ This unreleased fuel-core build may include features and updates not yet support
33588
33435
  assetId,
33589
33436
  txPointer,
33590
33437
  witnessIndex,
33438
+ maturity,
33591
33439
  predicateGasUsed,
33592
33440
  predicateLength,
33593
33441
  predicateDataLength,
@@ -33605,7 +33453,7 @@ This unreleased fuel-core build may include features and updates not yet support
33605
33453
  encode(value) {
33606
33454
  const parts = [];
33607
33455
  parts.push(new B256Coder().encode(value.txID));
33608
- parts.push(new NumberCoder("u16").encode(value.outputIndex));
33456
+ parts.push(new NumberCoder("u8").encode(value.outputIndex));
33609
33457
  parts.push(new B256Coder().encode(value.balanceRoot));
33610
33458
  parts.push(new B256Coder().encode(value.stateRoot));
33611
33459
  parts.push(new TxPointerCoder().encode(value.txPointer));
@@ -33617,7 +33465,7 @@ This unreleased fuel-core build may include features and updates not yet support
33617
33465
  let o = offset;
33618
33466
  [decoded, o] = new B256Coder().decode(data, o);
33619
33467
  const txID = decoded;
33620
- [decoded, o] = new NumberCoder("u16").decode(data, o);
33468
+ [decoded, o] = new NumberCoder("u8").decode(data, o);
33621
33469
  const outputIndex = decoded;
33622
33470
  [decoded, o] = new B256Coder().decode(data, o);
33623
33471
  const balanceRoot = decoded;
@@ -33666,16 +33514,14 @@ This unreleased fuel-core build may include features and updates not yet support
33666
33514
  parts.push(new ByteArrayCoder(32).encode(value.recipient));
33667
33515
  parts.push(new BigNumberCoder("u64").encode(value.amount));
33668
33516
  parts.push(new ByteArrayCoder(32).encode(value.nonce));
33669
- parts.push(new NumberCoder("u16").encode(value.witnessIndex));
33517
+ parts.push(new NumberCoder("u8").encode(value.witnessIndex));
33670
33518
  parts.push(new BigNumberCoder("u64").encode(value.predicateGasUsed));
33671
- parts.push(new BigNumberCoder("u64").encode(data.length));
33672
- parts.push(new BigNumberCoder("u64").encode(value.predicateLength));
33673
- parts.push(new BigNumberCoder("u64").encode(value.predicateDataLength));
33519
+ parts.push(new NumberCoder("u32").encode(data.length));
33520
+ parts.push(new NumberCoder("u32").encode(value.predicateLength));
33521
+ parts.push(new NumberCoder("u32").encode(value.predicateDataLength));
33674
33522
  parts.push(new ByteArrayCoder(data.length).encode(data));
33675
- parts.push(new ByteArrayCoder(value.predicateLength.toNumber()).encode(value.predicate));
33676
- parts.push(
33677
- new ByteArrayCoder(value.predicateDataLength.toNumber()).encode(value.predicateData)
33678
- );
33523
+ parts.push(new ByteArrayCoder(value.predicateLength).encode(value.predicate));
33524
+ parts.push(new ByteArrayCoder(value.predicateDataLength).encode(value.predicateData));
33679
33525
  return concat(parts);
33680
33526
  }
33681
33527
  static decodeData(messageData) {
@@ -33695,21 +33541,21 @@ This unreleased fuel-core build may include features and updates not yet support
33695
33541
  const amount = decoded;
33696
33542
  [decoded, o] = new B256Coder().decode(data, o);
33697
33543
  const nonce = decoded;
33698
- [decoded, o] = new NumberCoder("u16").decode(data, o);
33544
+ [decoded, o] = new NumberCoder("u8").decode(data, o);
33699
33545
  const witnessIndex = Number(decoded);
33700
33546
  [decoded, o] = new BigNumberCoder("u64").decode(data, o);
33701
33547
  const predicateGasUsed = decoded;
33702
33548
  [decoded, o] = new NumberCoder("u32").decode(data, o);
33703
33549
  const dataLength2 = decoded;
33704
- [decoded, o] = new BigNumberCoder("u64").decode(data, o);
33550
+ [decoded, o] = new NumberCoder("u32").decode(data, o);
33705
33551
  const predicateLength = decoded;
33706
- [decoded, o] = new BigNumberCoder("u64").decode(data, o);
33552
+ [decoded, o] = new NumberCoder("u32").decode(data, o);
33707
33553
  const predicateDataLength = decoded;
33708
33554
  [decoded, o] = new ByteArrayCoder(dataLength2).decode(data, o);
33709
33555
  const messageData = decoded;
33710
- [decoded, o] = new ByteArrayCoder(predicateLength.toNumber()).decode(data, o);
33556
+ [decoded, o] = new ByteArrayCoder(predicateLength).decode(data, o);
33711
33557
  const predicate = decoded;
33712
- [decoded, o] = new ByteArrayCoder(predicateDataLength.toNumber()).decode(data, o);
33558
+ [decoded, o] = new ByteArrayCoder(predicateDataLength).decode(data, o);
33713
33559
  const predicateData = decoded;
33714
33560
  return [
33715
33561
  {
@@ -34021,7 +33867,7 @@ This unreleased fuel-core build may include features and updates not yet support
34021
33867
  }
34022
33868
  };
34023
33869
  var PolicyType = /* @__PURE__ */ ((PolicyType2) => {
34024
- PolicyType2[PolicyType2["Tip"] = 1] = "Tip";
33870
+ PolicyType2[PolicyType2["GasPrice"] = 1] = "GasPrice";
34025
33871
  PolicyType2[PolicyType2["WitnessLimit"] = 2] = "WitnessLimit";
34026
33872
  PolicyType2[PolicyType2["Maturity"] = 4] = "Maturity";
34027
33873
  PolicyType2[PolicyType2["MaxFee"] = 8] = "MaxFee";
@@ -34069,9 +33915,9 @@ This unreleased fuel-core build may include features and updates not yet support
34069
33915
  let o = offset;
34070
33916
  const policies = [];
34071
33917
  if (policyTypes & 1) {
34072
- const [tip, nextOffset] = new BigNumberCoder("u64").decode(data, o);
33918
+ const [gasPrice, nextOffset] = new BigNumberCoder("u64").decode(data, o);
34073
33919
  o = nextOffset;
34074
- policies.push({ type: 1, data: tip });
33920
+ policies.push({ type: 1, data: gasPrice });
34075
33921
  }
34076
33922
  if (policyTypes & 2) {
34077
33923
  const [witnessLimit, nextOffset] = new BigNumberCoder("u64").decode(data, o);
@@ -34303,15 +34149,15 @@ This unreleased fuel-core build may include features and updates not yet support
34303
34149
  encode(value) {
34304
34150
  const parts = [];
34305
34151
  parts.push(new BigNumberCoder("u64").encode(value.scriptGasLimit));
34306
- parts.push(new B256Coder().encode(value.receiptsRoot));
34307
- parts.push(new BigNumberCoder("u64").encode(value.scriptLength));
34308
- parts.push(new BigNumberCoder("u64").encode(value.scriptDataLength));
34152
+ parts.push(new NumberCoder("u32").encode(value.scriptLength));
34153
+ parts.push(new NumberCoder("u32").encode(value.scriptDataLength));
34309
34154
  parts.push(new NumberCoder("u32").encode(value.policyTypes));
34310
- parts.push(new NumberCoder("u16").encode(value.inputsCount));
34311
- parts.push(new NumberCoder("u16").encode(value.outputsCount));
34312
- parts.push(new NumberCoder("u16").encode(value.witnessesCount));
34313
- parts.push(new ByteArrayCoder(value.scriptLength.toNumber()).encode(value.script));
34314
- parts.push(new ByteArrayCoder(value.scriptDataLength.toNumber()).encode(value.scriptData));
34155
+ parts.push(new NumberCoder("u8").encode(value.inputsCount));
34156
+ parts.push(new NumberCoder("u8").encode(value.outputsCount));
34157
+ parts.push(new NumberCoder("u8").encode(value.witnessesCount));
34158
+ parts.push(new B256Coder().encode(value.receiptsRoot));
34159
+ parts.push(new ByteArrayCoder(value.scriptLength).encode(value.script));
34160
+ parts.push(new ByteArrayCoder(value.scriptDataLength).encode(value.scriptData));
34315
34161
  parts.push(new PoliciesCoder().encode(value.policies));
34316
34162
  parts.push(new ArrayCoder(new InputCoder(), value.inputsCount).encode(value.inputs));
34317
34163
  parts.push(new ArrayCoder(new OutputCoder(), value.outputsCount).encode(value.outputs));
@@ -34323,23 +34169,23 @@ This unreleased fuel-core build may include features and updates not yet support
34323
34169
  let o = offset;
34324
34170
  [decoded, o] = new BigNumberCoder("u64").decode(data, o);
34325
34171
  const scriptGasLimit = decoded;
34326
- [decoded, o] = new B256Coder().decode(data, o);
34327
- const receiptsRoot = decoded;
34328
- [decoded, o] = new BigNumberCoder("u64").decode(data, o);
34172
+ [decoded, o] = new NumberCoder("u32").decode(data, o);
34329
34173
  const scriptLength = decoded;
34330
- [decoded, o] = new BigNumberCoder("u64").decode(data, o);
34174
+ [decoded, o] = new NumberCoder("u32").decode(data, o);
34331
34175
  const scriptDataLength = decoded;
34332
34176
  [decoded, o] = new NumberCoder("u32").decode(data, o);
34333
34177
  const policyTypes = decoded;
34334
- [decoded, o] = new NumberCoder("u16").decode(data, o);
34178
+ [decoded, o] = new NumberCoder("u8").decode(data, o);
34335
34179
  const inputsCount = decoded;
34336
- [decoded, o] = new NumberCoder("u16").decode(data, o);
34180
+ [decoded, o] = new NumberCoder("u8").decode(data, o);
34337
34181
  const outputsCount = decoded;
34338
- [decoded, o] = new NumberCoder("u16").decode(data, o);
34182
+ [decoded, o] = new NumberCoder("u8").decode(data, o);
34339
34183
  const witnessesCount = decoded;
34340
- [decoded, o] = new ByteArrayCoder(scriptLength.toNumber()).decode(data, o);
34184
+ [decoded, o] = new B256Coder().decode(data, o);
34185
+ const receiptsRoot = decoded;
34186
+ [decoded, o] = new ByteArrayCoder(scriptLength).decode(data, o);
34341
34187
  const script = decoded;
34342
- [decoded, o] = new ByteArrayCoder(scriptDataLength.toNumber()).decode(data, o);
34188
+ [decoded, o] = new ByteArrayCoder(scriptDataLength).decode(data, o);
34343
34189
  const scriptData = decoded;
34344
34190
  [decoded, o] = new PoliciesCoder().decode(data, o, policyTypes);
34345
34191
  const policies = decoded;
@@ -34377,19 +34223,18 @@ This unreleased fuel-core build may include features and updates not yet support
34377
34223
  }
34378
34224
  encode(value) {
34379
34225
  const parts = [];
34380
- parts.push(new NumberCoder("u16").encode(value.bytecodeWitnessIndex));
34381
- parts.push(new B256Coder().encode(value.salt));
34382
- parts.push(new BigNumberCoder("u64").encode(value.storageSlotsCount));
34226
+ parts.push(new NumberCoder("u32").encode(value.bytecodeLength));
34227
+ parts.push(new NumberCoder("u8").encode(value.bytecodeWitnessIndex));
34383
34228
  parts.push(new NumberCoder("u32").encode(value.policyTypes));
34384
- parts.push(new NumberCoder("u16").encode(value.inputsCount));
34385
- parts.push(new NumberCoder("u16").encode(value.outputsCount));
34386
- parts.push(new NumberCoder("u16").encode(value.witnessesCount));
34229
+ parts.push(new NumberCoder("u16").encode(value.storageSlotsCount));
34230
+ parts.push(new NumberCoder("u8").encode(value.inputsCount));
34231
+ parts.push(new NumberCoder("u8").encode(value.outputsCount));
34232
+ parts.push(new NumberCoder("u8").encode(value.witnessesCount));
34233
+ parts.push(new B256Coder().encode(value.salt));
34234
+ parts.push(new PoliciesCoder().encode(value.policies));
34387
34235
  parts.push(
34388
- new ArrayCoder(new StorageSlotCoder(), value.storageSlotsCount.toNumber()).encode(
34389
- value.storageSlots
34390
- )
34236
+ new ArrayCoder(new StorageSlotCoder(), value.storageSlotsCount).encode(value.storageSlots)
34391
34237
  );
34392
- parts.push(new PoliciesCoder().encode(value.policies));
34393
34238
  parts.push(new ArrayCoder(new InputCoder(), value.inputsCount).encode(value.inputs));
34394
34239
  parts.push(new ArrayCoder(new OutputCoder(), value.outputsCount).encode(value.outputs));
34395
34240
  parts.push(new ArrayCoder(new WitnessCoder(), value.witnessesCount).encode(value.witnesses));
@@ -34398,27 +34243,26 @@ This unreleased fuel-core build may include features and updates not yet support
34398
34243
  decode(data, offset) {
34399
34244
  let decoded;
34400
34245
  let o = offset;
34401
- [decoded, o] = new NumberCoder("u16").decode(data, o);
34246
+ [decoded, o] = new NumberCoder("u32").decode(data, o);
34247
+ const bytecodeLength = decoded;
34248
+ [decoded, o] = new NumberCoder("u8").decode(data, o);
34402
34249
  const bytecodeWitnessIndex = decoded;
34403
- [decoded, o] = new B256Coder().decode(data, o);
34404
- const salt = decoded;
34405
- [decoded, o] = new BigNumberCoder("u64").decode(data, o);
34406
- const storageSlotsCount = decoded;
34407
34250
  [decoded, o] = new NumberCoder("u32").decode(data, o);
34408
34251
  const policyTypes = decoded;
34409
34252
  [decoded, o] = new NumberCoder("u16").decode(data, o);
34253
+ const storageSlotsCount = decoded;
34254
+ [decoded, o] = new NumberCoder("u8").decode(data, o);
34410
34255
  const inputsCount = decoded;
34411
- [decoded, o] = new NumberCoder("u16").decode(data, o);
34256
+ [decoded, o] = new NumberCoder("u8").decode(data, o);
34412
34257
  const outputsCount = decoded;
34413
- [decoded, o] = new NumberCoder("u16").decode(data, o);
34258
+ [decoded, o] = new NumberCoder("u8").decode(data, o);
34414
34259
  const witnessesCount = decoded;
34415
- [decoded, o] = new ArrayCoder(new StorageSlotCoder(), storageSlotsCount.toNumber()).decode(
34416
- data,
34417
- o
34418
- );
34419
- const storageSlots = decoded;
34260
+ [decoded, o] = new B256Coder().decode(data, o);
34261
+ const salt = decoded;
34420
34262
  [decoded, o] = new PoliciesCoder().decode(data, o, policyTypes);
34421
34263
  const policies = decoded;
34264
+ [decoded, o] = new ArrayCoder(new StorageSlotCoder(), storageSlotsCount).decode(data, o);
34265
+ const storageSlots = decoded;
34422
34266
  [decoded, o] = new ArrayCoder(new InputCoder(), inputsCount).decode(data, o);
34423
34267
  const inputs = decoded;
34424
34268
  [decoded, o] = new ArrayCoder(new OutputCoder(), outputsCount).decode(data, o);
@@ -34428,6 +34272,7 @@ This unreleased fuel-core build may include features and updates not yet support
34428
34272
  return [
34429
34273
  {
34430
34274
  type: 1,
34275
+ bytecodeLength,
34431
34276
  bytecodeWitnessIndex,
34432
34277
  policyTypes,
34433
34278
  storageSlotsCount,
@@ -34456,7 +34301,6 @@ This unreleased fuel-core build may include features and updates not yet support
34456
34301
  parts.push(new OutputContractCoder().encode(value.outputContract));
34457
34302
  parts.push(new BigNumberCoder("u64").encode(value.mintAmount));
34458
34303
  parts.push(new B256Coder().encode(value.mintAssetId));
34459
- parts.push(new BigNumberCoder("u64").encode(value.gasPrice));
34460
34304
  return concat(parts);
34461
34305
  }
34462
34306
  decode(data, offset) {
@@ -34472,8 +34316,6 @@ This unreleased fuel-core build may include features and updates not yet support
34472
34316
  const mintAmount = decoded;
34473
34317
  [decoded, o] = new B256Coder().decode(data, o);
34474
34318
  const mintAssetId = decoded;
34475
- [decoded, o] = new BigNumberCoder("u64").decode(data, o);
34476
- const gasPrice = decoded;
34477
34319
  return [
34478
34320
  {
34479
34321
  type: 2,
@@ -34481,8 +34323,7 @@ This unreleased fuel-core build may include features and updates not yet support
34481
34323
  inputContract,
34482
34324
  outputContract,
34483
34325
  mintAmount,
34484
- mintAssetId,
34485
- gasPrice
34326
+ mintAssetId
34486
34327
  },
34487
34328
  o
34488
34329
  ];
@@ -34789,6 +34630,159 @@ This unreleased fuel-core build may include features and updates not yet support
34789
34630
  // src/providers/provider.ts
34790
34631
  var import_graphql_request = __toESM(require_dist2());
34791
34632
 
34633
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isPlaceholder.js
34634
+ function _isPlaceholder(a) {
34635
+ return a != null && typeof a === "object" && a["@@functional/placeholder"] === true;
34636
+ }
34637
+
34638
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_curry1.js
34639
+ function _curry1(fn) {
34640
+ return function f1(a) {
34641
+ if (arguments.length === 0 || _isPlaceholder(a)) {
34642
+ return f1;
34643
+ } else {
34644
+ return fn.apply(this, arguments);
34645
+ }
34646
+ };
34647
+ }
34648
+
34649
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isArray.js
34650
+ var isArray_default = Array.isArray || function _isArray(val) {
34651
+ return val != null && val.length >= 0 && Object.prototype.toString.call(val) === "[object Array]";
34652
+ };
34653
+
34654
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/type.js
34655
+ var type = /* @__PURE__ */ _curry1(function type2(val) {
34656
+ return val === null ? "Null" : val === void 0 ? "Undefined" : Object.prototype.toString.call(val).slice(8, -1);
34657
+ });
34658
+ var type_default = type;
34659
+
34660
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_toISOString.js
34661
+ var pad = function pad2(n) {
34662
+ return (n < 10 ? "0" : "") + n;
34663
+ };
34664
+ var _toISOString = typeof Date.prototype.toISOString === "function" ? function _toISOString2(d) {
34665
+ return d.toISOString();
34666
+ } : function _toISOString3(d) {
34667
+ 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";
34668
+ };
34669
+
34670
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isInteger.js
34671
+ var isInteger_default = Number.isInteger || function _isInteger(n) {
34672
+ return n << 0 === n;
34673
+ };
34674
+
34675
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_cloneRegExp.js
34676
+ function _cloneRegExp(pattern) {
34677
+ 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" : ""));
34678
+ }
34679
+
34680
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_clone.js
34681
+ function _clone(value, deep, map) {
34682
+ map || (map = new _ObjectMap());
34683
+ if (_isPrimitive(value)) {
34684
+ return value;
34685
+ }
34686
+ var copy = function copy2(copiedValue) {
34687
+ var cachedCopy = map.get(value);
34688
+ if (cachedCopy) {
34689
+ return cachedCopy;
34690
+ }
34691
+ map.set(value, copiedValue);
34692
+ for (var key in value) {
34693
+ if (Object.prototype.hasOwnProperty.call(value, key)) {
34694
+ copiedValue[key] = deep ? _clone(value[key], true, map) : value[key];
34695
+ }
34696
+ }
34697
+ return copiedValue;
34698
+ };
34699
+ switch (type_default(value)) {
34700
+ case "Object":
34701
+ return copy(Object.create(Object.getPrototypeOf(value)));
34702
+ case "Array":
34703
+ return copy([]);
34704
+ case "Date":
34705
+ return new Date(value.valueOf());
34706
+ case "RegExp":
34707
+ return _cloneRegExp(value);
34708
+ case "Int8Array":
34709
+ case "Uint8Array":
34710
+ case "Uint8ClampedArray":
34711
+ case "Int16Array":
34712
+ case "Uint16Array":
34713
+ case "Int32Array":
34714
+ case "Uint32Array":
34715
+ case "Float32Array":
34716
+ case "Float64Array":
34717
+ case "BigInt64Array":
34718
+ case "BigUint64Array":
34719
+ return value.slice();
34720
+ default:
34721
+ return value;
34722
+ }
34723
+ }
34724
+ function _isPrimitive(param) {
34725
+ var type3 = typeof param;
34726
+ return param == null || type3 != "object" && type3 != "function";
34727
+ }
34728
+ var _ObjectMap = /* @__PURE__ */ function() {
34729
+ function _ObjectMap2() {
34730
+ this.map = {};
34731
+ this.length = 0;
34732
+ }
34733
+ _ObjectMap2.prototype.set = function(key, value) {
34734
+ const hashedKey = this.hash(key);
34735
+ let bucket = this.map[hashedKey];
34736
+ if (!bucket) {
34737
+ this.map[hashedKey] = bucket = [];
34738
+ }
34739
+ bucket.push([key, value]);
34740
+ this.length += 1;
34741
+ };
34742
+ _ObjectMap2.prototype.hash = function(key) {
34743
+ let hashedKey = [];
34744
+ for (var value in key) {
34745
+ hashedKey.push(Object.prototype.toString.call(key[value]));
34746
+ }
34747
+ return hashedKey.join();
34748
+ };
34749
+ _ObjectMap2.prototype.get = function(key) {
34750
+ if (this.length <= 180) {
34751
+ for (const p in this.map) {
34752
+ const bucket2 = this.map[p];
34753
+ for (let i = 0; i < bucket2.length; i += 1) {
34754
+ const element = bucket2[i];
34755
+ if (element[0] === key) {
34756
+ return element[1];
34757
+ }
34758
+ }
34759
+ }
34760
+ return;
34761
+ }
34762
+ const hashedKey = this.hash(key);
34763
+ const bucket = this.map[hashedKey];
34764
+ if (!bucket) {
34765
+ return;
34766
+ }
34767
+ for (let i = 0; i < bucket.length; i += 1) {
34768
+ const element = bucket[i];
34769
+ if (element[0] === key) {
34770
+ return element[1];
34771
+ }
34772
+ }
34773
+ };
34774
+ return _ObjectMap2;
34775
+ }();
34776
+
34777
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/clone.js
34778
+ var clone2 = /* @__PURE__ */ _curry1(function clone3(value) {
34779
+ return value != null && typeof value.clone === "function" ? value.clone() : _clone(value, true);
34780
+ });
34781
+ var clone_default = clone2;
34782
+
34783
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/trim.js
34784
+ var hasProtoTrim = typeof String.prototype.trim === "function";
34785
+
34792
34786
  // ../../node_modules/.pnpm/tslib@2.6.0/node_modules/tslib/tslib.es6.mjs
34793
34787
  var __assign = function() {
34794
34788
  __assign = Object.assign || function __assign2(t) {
@@ -34803,7 +34797,7 @@ This unreleased fuel-core build may include features and updates not yet support
34803
34797
  return __assign.apply(this, arguments);
34804
34798
  };
34805
34799
 
34806
- // ../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/jsutils/devAssert.mjs
34800
+ // ../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/jsutils/devAssert.mjs
34807
34801
  function devAssert(condition, message) {
34808
34802
  const booleanCondition = Boolean(condition);
34809
34803
  if (!booleanCondition) {
@@ -34811,12 +34805,12 @@ This unreleased fuel-core build may include features and updates not yet support
34811
34805
  }
34812
34806
  }
34813
34807
 
34814
- // ../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/jsutils/isObjectLike.mjs
34808
+ // ../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/jsutils/isObjectLike.mjs
34815
34809
  function isObjectLike(value) {
34816
34810
  return typeof value == "object" && value !== null;
34817
34811
  }
34818
34812
 
34819
- // ../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/jsutils/invariant.mjs
34813
+ // ../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/jsutils/invariant.mjs
34820
34814
  function invariant(condition, message) {
34821
34815
  const booleanCondition = Boolean(condition);
34822
34816
  if (!booleanCondition) {
@@ -34826,7 +34820,7 @@ This unreleased fuel-core build may include features and updates not yet support
34826
34820
  }
34827
34821
  }
34828
34822
 
34829
- // ../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/location.mjs
34823
+ // ../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/language/location.mjs
34830
34824
  var LineRegExp = /\r\n|[\n\r]/g;
34831
34825
  function getLocation(source, position) {
34832
34826
  let lastLineStart = 0;
@@ -34845,7 +34839,7 @@ This unreleased fuel-core build may include features and updates not yet support
34845
34839
  };
34846
34840
  }
34847
34841
 
34848
- // ../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/printLocation.mjs
34842
+ // ../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/language/printLocation.mjs
34849
34843
  function printLocation(location) {
34850
34844
  return printSourceLocation(
34851
34845
  location.source,
@@ -34892,7 +34886,7 @@ This unreleased fuel-core build may include features and updates not yet support
34892
34886
  return existingLines.map(([prefix, line]) => prefix.padStart(padLen) + (line ? " " + line : "")).join("\n");
34893
34887
  }
34894
34888
 
34895
- // ../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/error/GraphQLError.mjs
34889
+ // ../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/error/GraphQLError.mjs
34896
34890
  function toNormalizedOptions(args) {
34897
34891
  const firstArg = args[0];
34898
34892
  if (firstArg == null || "kind" in firstArg || "length" in firstArg) {
@@ -35041,7 +35035,7 @@ This unreleased fuel-core build may include features and updates not yet support
35041
35035
  return array === void 0 || array.length === 0 ? void 0 : array;
35042
35036
  }
35043
35037
 
35044
- // ../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/error/syntaxError.mjs
35038
+ // ../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/error/syntaxError.mjs
35045
35039
  function syntaxError(source, position, description) {
35046
35040
  return new GraphQLError(`Syntax Error: ${description}`, {
35047
35041
  source,
@@ -35049,7 +35043,7 @@ This unreleased fuel-core build may include features and updates not yet support
35049
35043
  });
35050
35044
  }
35051
35045
 
35052
- // ../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/ast.mjs
35046
+ // ../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/language/ast.mjs
35053
35047
  var Location = class {
35054
35048
  /**
35055
35049
  * The character offset at which this Node begins.
@@ -35219,7 +35213,7 @@ This unreleased fuel-core build may include features and updates not yet support
35219
35213
  OperationTypeNode2["SUBSCRIPTION"] = "subscription";
35220
35214
  })(OperationTypeNode || (OperationTypeNode = {}));
35221
35215
 
35222
- // ../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/directiveLocation.mjs
35216
+ // ../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/language/directiveLocation.mjs
35223
35217
  var DirectiveLocation;
35224
35218
  (function(DirectiveLocation2) {
35225
35219
  DirectiveLocation2["QUERY"] = "QUERY";
@@ -35243,7 +35237,7 @@ This unreleased fuel-core build may include features and updates not yet support
35243
35237
  DirectiveLocation2["INPUT_FIELD_DEFINITION"] = "INPUT_FIELD_DEFINITION";
35244
35238
  })(DirectiveLocation || (DirectiveLocation = {}));
35245
35239
 
35246
- // ../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/kinds.mjs
35240
+ // ../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/language/kinds.mjs
35247
35241
  var Kind;
35248
35242
  (function(Kind2) {
35249
35243
  Kind2["NAME"] = "Name";
@@ -35291,7 +35285,7 @@ This unreleased fuel-core build may include features and updates not yet support
35291
35285
  Kind2["INPUT_OBJECT_TYPE_EXTENSION"] = "InputObjectTypeExtension";
35292
35286
  })(Kind || (Kind = {}));
35293
35287
 
35294
- // ../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/characterClasses.mjs
35288
+ // ../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/language/characterClasses.mjs
35295
35289
  function isWhiteSpace(code) {
35296
35290
  return code === 9 || code === 32;
35297
35291
  }
@@ -35309,7 +35303,7 @@ This unreleased fuel-core build may include features and updates not yet support
35309
35303
  return isLetter(code) || isDigit(code) || code === 95;
35310
35304
  }
35311
35305
 
35312
- // ../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/blockString.mjs
35306
+ // ../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/language/blockString.mjs
35313
35307
  function dedentBlockStringLines(lines) {
35314
35308
  var _firstNonEmptyLine2;
35315
35309
  let commonIndent = Number.MAX_SAFE_INTEGER;
@@ -35363,7 +35357,7 @@ This unreleased fuel-core build may include features and updates not yet support
35363
35357
  return '"""' + result + '"""';
35364
35358
  }
35365
35359
 
35366
- // ../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/tokenKind.mjs
35360
+ // ../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/language/tokenKind.mjs
35367
35361
  var TokenKind;
35368
35362
  (function(TokenKind2) {
35369
35363
  TokenKind2["SOF"] = "<SOF>";
@@ -35390,7 +35384,7 @@ This unreleased fuel-core build may include features and updates not yet support
35390
35384
  TokenKind2["COMMENT"] = "Comment";
35391
35385
  })(TokenKind || (TokenKind = {}));
35392
35386
 
35393
- // ../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/lexer.mjs
35387
+ // ../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/language/lexer.mjs
35394
35388
  var Lexer = class {
35395
35389
  /**
35396
35390
  * The previously focused non-ignored token.
@@ -35891,7 +35885,7 @@ This unreleased fuel-core build may include features and updates not yet support
35891
35885
  );
35892
35886
  }
35893
35887
 
35894
- // ../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/jsutils/inspect.mjs
35888
+ // ../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/jsutils/inspect.mjs
35895
35889
  var MAX_ARRAY_LENGTH = 10;
35896
35890
  var MAX_RECURSIVE_DEPTH = 2;
35897
35891
  function inspect(value) {
@@ -35974,12 +35968,11 @@ This unreleased fuel-core build may include features and updates not yet support
35974
35968
  return tag;
35975
35969
  }
35976
35970
 
35977
- // ../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/jsutils/instanceOf.mjs
35971
+ // ../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/jsutils/instanceOf.mjs
35978
35972
  var instanceOf = (
35979
35973
  /* c8 ignore next 6 */
35980
35974
  // FIXME: https://github.com/graphql/graphql-js/issues/2317
35981
- // eslint-disable-next-line no-undef
35982
- process.env.NODE_ENV === "production" ? function instanceOf2(value, constructor) {
35975
+ globalThis.process && globalThis.process.env.NODE_ENV === "production" ? function instanceOf2(value, constructor) {
35983
35976
  return value instanceof constructor;
35984
35977
  } : function instanceOf3(value, constructor) {
35985
35978
  if (value instanceof constructor) {
@@ -36012,7 +36005,7 @@ spurious results.`);
36012
36005
  }
36013
36006
  );
36014
36007
 
36015
- // ../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/source.mjs
36008
+ // ../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/language/source.mjs
36016
36009
  var Source = class {
36017
36010
  constructor(body, name = "GraphQL request", locationOffset = {
36018
36011
  line: 1,
@@ -36039,7 +36032,7 @@ spurious results.`);
36039
36032
  return instanceOf(source, Source);
36040
36033
  }
36041
36034
 
36042
- // ../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/parser.mjs
36035
+ // ../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/language/parser.mjs
36043
36036
  function parse(source, options) {
36044
36037
  const parser = new Parser(source, options);
36045
36038
  return parser.parseDocument();
@@ -37288,7 +37281,7 @@ spurious results.`);
37288
37281
  return isPunctuatorTokenKind(kind) ? `"${kind}"` : kind;
37289
37282
  }
37290
37283
 
37291
- // ../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/printString.mjs
37284
+ // ../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/language/printString.mjs
37292
37285
  function printString(str) {
37293
37286
  return `"${str.replace(escapedRegExp, escapedReplacer)}"`;
37294
37287
  }
@@ -37464,7 +37457,7 @@ spurious results.`);
37464
37457
  "\\u009F"
37465
37458
  ];
37466
37459
 
37467
- // ../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/visitor.mjs
37460
+ // ../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/language/visitor.mjs
37468
37461
  var BREAK = Object.freeze({});
37469
37462
  function visit(root, visitor, visitorKeys = QueryDocumentKeys) {
37470
37463
  const enterLeaveMap = /* @__PURE__ */ new Map();
@@ -37596,7 +37589,7 @@ spurious results.`);
37596
37589
  };
37597
37590
  }
37598
37591
 
37599
- // ../../node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/language/printer.mjs
37592
+ // ../../node_modules/.pnpm/graphql@16.8.1/node_modules/graphql/language/printer.mjs
37600
37593
  function print(ast) {
37601
37594
  return visit(ast, printDocASTReducer);
37602
37595
  }
@@ -37838,7 +37831,7 @@ spurious results.`);
37838
37831
  return (_maybeArray$some = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.some((str) => str.includes("\n"))) !== null && _maybeArray$some !== void 0 ? _maybeArray$some : false;
37839
37832
  }
37840
37833
 
37841
- // ../../node_modules/.pnpm/graphql-tag@2.12.6_graphql@16.6.0/node_modules/graphql-tag/lib/index.js
37834
+ // ../../node_modules/.pnpm/graphql-tag@2.12.6_graphql@16.8.1/node_modules/graphql-tag/lib/index.js
37842
37835
  var docCache = /* @__PURE__ */ new Map();
37843
37836
  var fragmentSourceMap = /* @__PURE__ */ new Map();
37844
37837
  var printFragmentWarnings = true;
@@ -37954,40 +37947,16 @@ spurious results.`);
37954
37947
  var lib_default2 = gql;
37955
37948
 
37956
37949
  // src/providers/__generated__/operations.ts
37957
- var TransactionStatusSubscriptionFragmentFragmentDoc = lib_default2`
37958
- fragment transactionStatusSubscriptionFragment on TransactionStatus {
37959
- type: __typename
37960
- ... on SubmittedStatus {
37961
- time
37962
- }
37963
- ... on SuccessStatus {
37964
- block {
37965
- id
37966
- }
37967
- time
37968
- programState {
37969
- returnType
37970
- data
37971
- }
37972
- }
37973
- ... on FailureStatus {
37974
- block {
37975
- id
37976
- }
37977
- time
37978
- reason
37979
- }
37980
- ... on SqueezedOutStatus {
37981
- reason
37982
- }
37983
- }
37984
- `;
37985
37950
  var ReceiptFragmentFragmentDoc = lib_default2`
37986
37951
  fragment receiptFragment on Receipt {
37987
- id
37952
+ contract {
37953
+ id
37954
+ }
37988
37955
  pc
37989
37956
  is
37990
- to
37957
+ to {
37958
+ id
37959
+ }
37991
37960
  toAddress
37992
37961
  amount
37993
37962
  assetId
@@ -38025,16 +37994,10 @@ spurious results.`);
38025
37994
  id
38026
37995
  }
38027
37996
  time
38028
- receipts {
38029
- ...receiptFragment
38030
- }
38031
37997
  programState {
38032
37998
  returnType
38033
37999
  data
38034
38000
  }
38035
- receipts {
38036
- ...receiptFragment
38037
- }
38038
38001
  }
38039
38002
  ... on FailureStatus {
38040
38003
  block {
@@ -38042,24 +38005,26 @@ spurious results.`);
38042
38005
  }
38043
38006
  time
38044
38007
  reason
38045
- receipts {
38046
- ...receiptFragment
38047
- }
38048
38008
  }
38049
38009
  ... on SqueezedOutStatus {
38050
38010
  reason
38051
38011
  }
38052
38012
  }
38053
- ${ReceiptFragmentFragmentDoc}`;
38013
+ `;
38054
38014
  var TransactionFragmentFragmentDoc = lib_default2`
38055
38015
  fragment transactionFragment on Transaction {
38056
38016
  id
38057
38017
  rawPayload
38018
+ gasPrice
38019
+ receipts {
38020
+ ...receiptFragment
38021
+ }
38058
38022
  status {
38059
38023
  ...transactionStatusFragment
38060
38024
  }
38061
38025
  }
38062
- ${TransactionStatusFragmentFragmentDoc}`;
38026
+ ${ReceiptFragmentFragmentDoc}
38027
+ ${TransactionStatusFragmentFragmentDoc}`;
38063
38028
  var InputEstimatePredicatesFragmentFragmentDoc = lib_default2`
38064
38029
  fragment inputEstimatePredicatesFragment on Input {
38065
38030
  ... on InputCoin {
@@ -38077,46 +38042,6 @@ spurious results.`);
38077
38042
  }
38078
38043
  }
38079
38044
  ${InputEstimatePredicatesFragmentFragmentDoc}`;
38080
- var DryRunFailureStatusFragmentFragmentDoc = lib_default2`
38081
- fragment dryRunFailureStatusFragment on DryRunFailureStatus {
38082
- reason
38083
- programState {
38084
- returnType
38085
- data
38086
- }
38087
- }
38088
- `;
38089
- var DryRunSuccessStatusFragmentFragmentDoc = lib_default2`
38090
- fragment dryRunSuccessStatusFragment on DryRunSuccessStatus {
38091
- programState {
38092
- returnType
38093
- data
38094
- }
38095
- }
38096
- `;
38097
- var DryRunTransactionStatusFragmentFragmentDoc = lib_default2`
38098
- fragment dryRunTransactionStatusFragment on DryRunTransactionStatus {
38099
- ... on DryRunFailureStatus {
38100
- ...dryRunFailureStatusFragment
38101
- }
38102
- ... on DryRunSuccessStatus {
38103
- ...dryRunSuccessStatusFragment
38104
- }
38105
- }
38106
- ${DryRunFailureStatusFragmentFragmentDoc}
38107
- ${DryRunSuccessStatusFragmentFragmentDoc}`;
38108
- var DryRunTransactionExecutionStatusFragmentFragmentDoc = lib_default2`
38109
- fragment dryRunTransactionExecutionStatusFragment on DryRunTransactionExecutionStatus {
38110
- id
38111
- status {
38112
- ...dryRunTransactionStatusFragment
38113
- }
38114
- receipts {
38115
- ...receiptFragment
38116
- }
38117
- }
38118
- ${DryRunTransactionStatusFragmentFragmentDoc}
38119
- ${ReceiptFragmentFragmentDoc}`;
38120
38045
  var CoinFragmentFragmentDoc = lib_default2`
38121
38046
  fragment coinFragment on Coin {
38122
38047
  __typename
@@ -38124,6 +38049,7 @@ ${ReceiptFragmentFragmentDoc}`;
38124
38049
  owner
38125
38050
  amount
38126
38051
  assetId
38052
+ maturity
38127
38053
  blockCreated
38128
38054
  txCreatedIdx
38129
38055
  }
@@ -38162,32 +38088,26 @@ ${ReceiptFragmentFragmentDoc}`;
38162
38088
  messageBlockHeader {
38163
38089
  id
38164
38090
  daHeight
38165
- consensusParametersVersion
38166
- stateTransitionBytecodeVersion
38167
38091
  transactionsCount
38168
- messageReceiptCount
38169
38092
  transactionsRoot
38170
- messageOutboxRoot
38171
- eventInboxRoot
38172
38093
  height
38173
38094
  prevRoot
38174
38095
  time
38175
38096
  applicationHash
38097
+ messageReceiptRoot
38098
+ messageReceiptCount
38176
38099
  }
38177
38100
  commitBlockHeader {
38178
38101
  id
38179
38102
  daHeight
38180
- consensusParametersVersion
38181
- stateTransitionBytecodeVersion
38182
38103
  transactionsCount
38183
- messageReceiptCount
38184
38104
  transactionsRoot
38185
- messageOutboxRoot
38186
- eventInboxRoot
38187
38105
  height
38188
38106
  prevRoot
38189
38107
  time
38190
38108
  applicationHash
38109
+ messageReceiptRoot
38110
+ messageReceiptCount
38191
38111
  }
38192
38112
  sender
38193
38113
  recipient
@@ -38206,8 +38126,8 @@ ${ReceiptFragmentFragmentDoc}`;
38206
38126
  var BlockFragmentFragmentDoc = lib_default2`
38207
38127
  fragment blockFragment on Block {
38208
38128
  id
38209
- height
38210
38129
  header {
38130
+ height
38211
38131
  time
38212
38132
  }
38213
38133
  transactions {
@@ -38265,11 +38185,6 @@ ${ReceiptFragmentFragmentDoc}`;
38265
38185
  `;
38266
38186
  var GasCostsFragmentFragmentDoc = lib_default2`
38267
38187
  fragment GasCostsFragment on GasCosts {
38268
- version {
38269
- ... on Version {
38270
- value
38271
- }
38272
- }
38273
38188
  add
38274
38189
  addi
38275
38190
  aloc
@@ -38282,6 +38197,7 @@ ${ReceiptFragmentFragmentDoc}`;
38282
38197
  cb
38283
38198
  cfei
38284
38199
  cfsi
38200
+ croo
38285
38201
  div
38286
38202
  divi
38287
38203
  ecr1
@@ -38364,9 +38280,6 @@ ${ReceiptFragmentFragmentDoc}`;
38364
38280
  ccp {
38365
38281
  ...DependentCostFragment
38366
38282
  }
38367
- croo {
38368
- ...DependentCostFragment
38369
- }
38370
38283
  csiz {
38371
38284
  ...DependentCostFragment
38372
38285
  }
@@ -38426,11 +38339,6 @@ ${ReceiptFragmentFragmentDoc}`;
38426
38339
  ${DependentCostFragmentFragmentDoc}`;
38427
38340
  var ConsensusParametersFragmentFragmentDoc = lib_default2`
38428
38341
  fragment consensusParametersFragment on ConsensusParameters {
38429
- version {
38430
- ... on Version {
38431
- value
38432
- }
38433
- }
38434
38342
  txParams {
38435
38343
  ...TxParametersFragment
38436
38344
  }
@@ -38490,9 +38398,18 @@ ${ConsensusParametersFragmentFragmentDoc}`;
38490
38398
  fragment nodeInfoFragment on NodeInfo {
38491
38399
  utxoValidation
38492
38400
  vmBacktrace
38401
+ minGasPrice
38493
38402
  maxTx
38494
38403
  maxDepth
38495
38404
  nodeVersion
38405
+ peers {
38406
+ id
38407
+ addresses
38408
+ clientVersion
38409
+ blockHeight
38410
+ lastHeartbeatMs
38411
+ appScore
38412
+ }
38496
38413
  }
38497
38414
  `;
38498
38415
  var GetVersionDocument = lib_default2`
@@ -38527,9 +38444,13 @@ ${ConsensusParametersFragmentFragmentDoc}`;
38527
38444
  query getTransactionWithReceipts($transactionId: TransactionId!) {
38528
38445
  transaction(id: $transactionId) {
38529
38446
  ...transactionFragment
38447
+ receipts {
38448
+ ...receiptFragment
38449
+ }
38530
38450
  }
38531
38451
  }
38532
- ${TransactionFragmentFragmentDoc}`;
38452
+ ${TransactionFragmentFragmentDoc}
38453
+ ${ReceiptFragmentFragmentDoc}`;
38533
38454
  var GetTransactionsDocument = lib_default2`
38534
38455
  query getTransactions($after: String, $before: String, $first: Int, $last: Int) {
38535
38456
  transactions(after: $after, before: $before, first: $first, last: $last) {
@@ -38657,20 +38578,6 @@ ${MessageCoinFragmentFragmentDoc}`;
38657
38578
  }
38658
38579
  }
38659
38580
  ${BalanceFragmentFragmentDoc}`;
38660
- var GetLatestGasPriceDocument = lib_default2`
38661
- query getLatestGasPrice {
38662
- latestGasPrice {
38663
- gasPrice
38664
- }
38665
- }
38666
- `;
38667
- var EstimateGasPriceDocument = lib_default2`
38668
- query estimateGasPrice($blockHorizon: U32!) {
38669
- estimateGasPrice(blockHorizon: $blockHorizon) {
38670
- gasPrice
38671
- }
38672
- }
38673
- `;
38674
38581
  var GetBalancesDocument = lib_default2`
38675
38582
  query getBalances($filter: BalanceFilterInput!, $after: String, $before: String, $first: Int, $last: Int) {
38676
38583
  balances(
@@ -38725,12 +38632,12 @@ ${MessageCoinFragmentFragmentDoc}`;
38725
38632
  }
38726
38633
  `;
38727
38634
  var DryRunDocument = lib_default2`
38728
- mutation dryRun($encodedTransactions: [HexString!]!, $utxoValidation: Boolean) {
38729
- dryRun(txs: $encodedTransactions, utxoValidation: $utxoValidation) {
38730
- ...dryRunTransactionExecutionStatusFragment
38635
+ mutation dryRun($encodedTransaction: HexString!, $utxoValidation: Boolean) {
38636
+ dryRun(tx: $encodedTransaction, utxoValidation: $utxoValidation) {
38637
+ ...receiptFragment
38731
38638
  }
38732
38639
  }
38733
- ${DryRunTransactionExecutionStatusFragmentFragmentDoc}`;
38640
+ ${ReceiptFragmentFragmentDoc}`;
38734
38641
  var SubmitDocument = lib_default2`
38735
38642
  mutation submit($encodedTransaction: HexString!) {
38736
38643
  submit(tx: $encodedTransaction) {
@@ -38749,17 +38656,17 @@ ${MessageCoinFragmentFragmentDoc}`;
38749
38656
  var SubmitAndAwaitDocument = lib_default2`
38750
38657
  subscription submitAndAwait($encodedTransaction: HexString!) {
38751
38658
  submitAndAwait(tx: $encodedTransaction) {
38752
- ...transactionStatusSubscriptionFragment
38659
+ ...transactionStatusFragment
38753
38660
  }
38754
38661
  }
38755
- ${TransactionStatusSubscriptionFragmentFragmentDoc}`;
38662
+ ${TransactionStatusFragmentFragmentDoc}`;
38756
38663
  var StatusChangeDocument = lib_default2`
38757
38664
  subscription statusChange($transactionId: TransactionId!) {
38758
38665
  statusChange(id: $transactionId) {
38759
- ...transactionStatusSubscriptionFragment
38666
+ ...transactionStatusFragment
38760
38667
  }
38761
38668
  }
38762
- ${TransactionStatusSubscriptionFragmentFragmentDoc}`;
38669
+ ${TransactionStatusFragmentFragmentDoc}`;
38763
38670
  function getSdk(requester) {
38764
38671
  return {
38765
38672
  getVersion(variables, options) {
@@ -38813,12 +38720,6 @@ ${MessageCoinFragmentFragmentDoc}`;
38813
38720
  getBalance(variables, options) {
38814
38721
  return requester(GetBalanceDocument, variables, options);
38815
38722
  },
38816
- getLatestGasPrice(variables, options) {
38817
- return requester(GetLatestGasPriceDocument, variables, options);
38818
- },
38819
- estimateGasPrice(variables, options) {
38820
- return requester(EstimateGasPriceDocument, variables, options);
38821
- },
38822
38723
  getBalances(variables, options) {
38823
38724
  return requester(GetBalancesDocument, variables, options);
38824
38725
  },
@@ -38983,6 +38884,9 @@ ${MessageCoinFragmentFragmentDoc}`;
38983
38884
  }
38984
38885
  };
38985
38886
 
38887
+ // ../address/dist/configs.mjs
38888
+ var ZeroBytes32 = "0x0000000000000000000000000000000000000000000000000000000000000000";
38889
+
38986
38890
  // src/providers/transaction-request/input.ts
38987
38891
  var inputify = (value) => {
38988
38892
  const { type: type3 } = value;
@@ -39002,9 +38906,10 @@ ${MessageCoinFragmentFragmentDoc}`;
39002
38906
  txIndex: toNumber2(arrayify(value.txPointer).slice(8, 16))
39003
38907
  },
39004
38908
  witnessIndex: value.witnessIndex,
38909
+ maturity: value.maturity ?? 0,
39005
38910
  predicateGasUsed: bn(value.predicateGasUsed),
39006
- predicateLength: bn(predicate.length),
39007
- predicateDataLength: bn(predicateData.length),
38911
+ predicateLength: predicate.length,
38912
+ predicateDataLength: predicateData.length,
39008
38913
  predicate: hexlify(predicate),
39009
38914
  predicateData: hexlify(predicateData)
39010
38915
  };
@@ -39035,8 +38940,8 @@ ${MessageCoinFragmentFragmentDoc}`;
39035
38940
  nonce: hexlify(value.nonce),
39036
38941
  witnessIndex: value.witnessIndex,
39037
38942
  predicateGasUsed: bn(value.predicateGasUsed),
39038
- predicateLength: bn(predicate.length),
39039
- predicateDataLength: bn(predicateData.length),
38943
+ predicateLength: predicate.length,
38944
+ predicateDataLength: predicateData.length,
39040
38945
  predicate: hexlify(predicate),
39041
38946
  predicateData: hexlify(predicateData),
39042
38947
  data: hexlify(data),
@@ -39196,8 +39101,8 @@ ${MessageCoinFragmentFragmentDoc}`;
39196
39101
  case "CALL" /* Call */: {
39197
39102
  const callReceipt = {
39198
39103
  type: ReceiptType.Call,
39199
- from: hexOrZero(receipt.id || receipt.contractId),
39200
- to: hexOrZero(receipt?.to),
39104
+ from: hexOrZero(receipt.contract?.id),
39105
+ to: hexOrZero(receipt?.to?.id),
39201
39106
  amount: bn(receipt.amount),
39202
39107
  assetId: hexOrZero(receipt.assetId),
39203
39108
  gas: bn(receipt.gas),
@@ -39211,7 +39116,7 @@ ${MessageCoinFragmentFragmentDoc}`;
39211
39116
  case "RETURN" /* Return */: {
39212
39117
  const returnReceipt = {
39213
39118
  type: ReceiptType.Return,
39214
- id: hexOrZero(receipt.id || receipt.contractId),
39119
+ id: hexOrZero(receipt.contract?.id),
39215
39120
  val: bn(receipt.val),
39216
39121
  pc: bn(receipt.pc),
39217
39122
  is: bn(receipt.is)
@@ -39221,7 +39126,7 @@ ${MessageCoinFragmentFragmentDoc}`;
39221
39126
  case "RETURN_DATA" /* ReturnData */: {
39222
39127
  const returnDataReceipt = {
39223
39128
  type: ReceiptType.ReturnData,
39224
- id: hexOrZero(receipt.id || receipt.contractId),
39129
+ id: hexOrZero(receipt.contract?.id),
39225
39130
  ptr: bn(receipt.ptr),
39226
39131
  len: bn(receipt.len),
39227
39132
  digest: hexOrZero(receipt.digest),
@@ -39233,7 +39138,7 @@ ${MessageCoinFragmentFragmentDoc}`;
39233
39138
  case "PANIC" /* Panic */: {
39234
39139
  const panicReceipt = {
39235
39140
  type: ReceiptType.Panic,
39236
- id: hexOrZero(receipt.id),
39141
+ id: hexOrZero(receipt.contract?.id),
39237
39142
  reason: bn(receipt.reason),
39238
39143
  pc: bn(receipt.pc),
39239
39144
  is: bn(receipt.is),
@@ -39244,7 +39149,7 @@ ${MessageCoinFragmentFragmentDoc}`;
39244
39149
  case "REVERT" /* Revert */: {
39245
39150
  const revertReceipt = {
39246
39151
  type: ReceiptType.Revert,
39247
- id: hexOrZero(receipt.id || receipt.contractId),
39152
+ id: hexOrZero(receipt.contract?.id),
39248
39153
  val: bn(receipt.ra),
39249
39154
  pc: bn(receipt.pc),
39250
39155
  is: bn(receipt.is)
@@ -39254,7 +39159,7 @@ ${MessageCoinFragmentFragmentDoc}`;
39254
39159
  case "LOG" /* Log */: {
39255
39160
  const logReceipt = {
39256
39161
  type: ReceiptType.Log,
39257
- id: hexOrZero(receipt.id || receipt.contractId),
39162
+ id: hexOrZero(receipt.contract?.id),
39258
39163
  val0: bn(receipt.ra),
39259
39164
  val1: bn(receipt.rb),
39260
39165
  val2: bn(receipt.rc),
@@ -39267,7 +39172,7 @@ ${MessageCoinFragmentFragmentDoc}`;
39267
39172
  case "LOG_DATA" /* LogData */: {
39268
39173
  const logDataReceipt = {
39269
39174
  type: ReceiptType.LogData,
39270
- id: hexOrZero(receipt.id || receipt.contractId),
39175
+ id: hexOrZero(receipt.contract?.id),
39271
39176
  val0: bn(receipt.ra),
39272
39177
  val1: bn(receipt.rb),
39273
39178
  ptr: bn(receipt.ptr),
@@ -39281,8 +39186,8 @@ ${MessageCoinFragmentFragmentDoc}`;
39281
39186
  case "TRANSFER" /* Transfer */: {
39282
39187
  const transferReceipt = {
39283
39188
  type: ReceiptType.Transfer,
39284
- from: hexOrZero(receipt.id || receipt.contractId),
39285
- to: hexOrZero(receipt.toAddress || receipt?.to),
39189
+ from: hexOrZero(receipt.contract?.id),
39190
+ to: hexOrZero(receipt.toAddress || receipt?.to?.id),
39286
39191
  amount: bn(receipt.amount),
39287
39192
  assetId: hexOrZero(receipt.assetId),
39288
39193
  pc: bn(receipt.pc),
@@ -39293,8 +39198,8 @@ ${MessageCoinFragmentFragmentDoc}`;
39293
39198
  case "TRANSFER_OUT" /* TransferOut */: {
39294
39199
  const transferOutReceipt = {
39295
39200
  type: ReceiptType.TransferOut,
39296
- from: hexOrZero(receipt.id || receipt.contractId),
39297
- to: hexOrZero(receipt.toAddress || receipt.to),
39201
+ from: hexOrZero(receipt.contract?.id),
39202
+ to: hexOrZero(receipt.toAddress || receipt.to?.id),
39298
39203
  amount: bn(receipt.amount),
39299
39204
  assetId: hexOrZero(receipt.assetId),
39300
39205
  pc: bn(receipt.pc),
@@ -39337,7 +39242,7 @@ ${MessageCoinFragmentFragmentDoc}`;
39337
39242
  return receiptMessageOut;
39338
39243
  }
39339
39244
  case "MINT" /* Mint */: {
39340
- const contractId = hexOrZero(receipt.id || receipt.contractId);
39245
+ const contractId = hexOrZero(receipt.contract?.id);
39341
39246
  const subId = hexOrZero(receipt.subId);
39342
39247
  const assetId = ReceiptMintCoder.getAssetId(contractId, subId);
39343
39248
  const mintReceipt = {
@@ -39352,7 +39257,7 @@ ${MessageCoinFragmentFragmentDoc}`;
39352
39257
  return mintReceipt;
39353
39258
  }
39354
39259
  case "BURN" /* Burn */: {
39355
- const contractId = hexOrZero(receipt.id || receipt.contractId);
39260
+ const contractId = hexOrZero(receipt.contract?.id);
39356
39261
  const subId = hexOrZero(receipt.subId);
39357
39262
  const assetId = ReceiptBurnCoder.getAssetId(contractId, subId);
39358
39263
  const burnReceipt = {
@@ -39433,6 +39338,7 @@ ${MessageCoinFragmentFragmentDoc}`;
39433
39338
  };
39434
39339
 
39435
39340
  // src/providers/utils/gas.ts
39341
+ var calculatePriceWithFactor = (gas, gasPrice, priceFactor) => bn(Math.ceil(gas.mul(gasPrice).toNumber() / priceFactor.toNumber()));
39436
39342
  var getGasUsedFromReceipts = (receipts) => {
39437
39343
  const scriptResult = receipts.filter(
39438
39344
  (receipt) => receipt.type === ReceiptType.ScriptResult
@@ -39453,28 +39359,18 @@ ${MessageCoinFragmentFragmentDoc}`;
39453
39359
  }
39454
39360
  function gasUsedByInputs(inputs, txBytesSize, gasCosts) {
39455
39361
  const witnessCache = [];
39456
- const chargeableInputs = inputs.filter((input) => {
39457
- const isCoinOrMessage = "owner" in input || "sender" in input;
39458
- if (isCoinOrMessage) {
39459
- if ("predicate" in input && input.predicate && input.predicate !== "0x") {
39460
- return true;
39461
- }
39462
- if (!witnessCache.includes(input.witnessIndex)) {
39463
- witnessCache.push(input.witnessIndex);
39464
- return true;
39465
- }
39466
- }
39467
- return false;
39468
- });
39469
- const vmInitializationCost = resolveGasDependentCosts(txBytesSize, gasCosts.vmInitialization);
39470
- const totalGas = chargeableInputs.reduce((total, input) => {
39362
+ const totalGas = inputs.reduce((total, input) => {
39471
39363
  if ("predicate" in input && input.predicate && input.predicate !== "0x") {
39472
39364
  return total.add(
39473
- vmInitializationCost.add(resolveGasDependentCosts(arrayify(input.predicate).length, gasCosts.contractRoot)).add(bn(input.predicateGasUsed))
39365
+ resolveGasDependentCosts(txBytesSize, gasCosts.vmInitialization).add(resolveGasDependentCosts(arrayify(input.predicate).length, gasCosts.contractRoot)).add(bn(input.predicateGasUsed))
39474
39366
  );
39475
39367
  }
39476
- return total.add(gasCosts.ecr1);
39477
- }, bn(0));
39368
+ if ("witnessIndex" in input && !witnessCache.includes(input.witnessIndex)) {
39369
+ witnessCache.push(input.witnessIndex);
39370
+ return total.add(gasCosts.ecr1);
39371
+ }
39372
+ return total;
39373
+ }, bn());
39478
39374
  return totalGas;
39479
39375
  }
39480
39376
  function getMinGas(params) {
@@ -39486,20 +39382,12 @@ ${MessageCoinFragmentFragmentDoc}`;
39486
39382
  return minGas;
39487
39383
  }
39488
39384
  function getMaxGas(params) {
39489
- const {
39490
- gasPerByte,
39491
- witnessesLength,
39492
- witnessLimit,
39493
- minGas,
39494
- gasLimit = bn(0),
39495
- maxGasPerTx
39496
- } = params;
39385
+ const { gasPerByte, witnessesLength, witnessLimit, minGas, gasLimit = bn(0) } = params;
39497
39386
  let remainingAllowedWitnessGas = bn(0);
39498
39387
  if (witnessLimit?.gt(0) && witnessLimit.gte(witnessesLength)) {
39499
39388
  remainingAllowedWitnessGas = bn(witnessLimit).sub(witnessesLength).mul(gasPerByte);
39500
39389
  }
39501
- const maxGas = remainingAllowedWitnessGas.add(minGas).add(gasLimit);
39502
- return maxGas.gte(maxGasPerTx) ? maxGasPerTx : maxGas;
39390
+ return remainingAllowedWitnessGas.add(minGas).add(gasLimit);
39503
39391
  }
39504
39392
  function calculateMetadataGasForTxCreate({
39505
39393
  gasCosts,
@@ -39521,10 +39409,6 @@ ${MessageCoinFragmentFragmentDoc}`;
39521
39409
  }) {
39522
39410
  return resolveGasDependentCosts(txBytesSize, gasCosts.s256);
39523
39411
  }
39524
- var calculateGasFee = (params) => {
39525
- const { gas, gasPrice, priceFactor, tip } = params;
39526
- return gas.mul(gasPrice).div(priceFactor).add(tip);
39527
- };
39528
39412
 
39529
39413
  // src/providers/utils/json.ts
39530
39414
  function normalize2(object) {
@@ -39666,7 +39550,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
39666
39550
  // src/providers/transaction-request/transaction-request.ts
39667
39551
  var BaseTransactionRequest = class {
39668
39552
  /** Gas price for transaction */
39669
- tip;
39553
+ gasPrice;
39670
39554
  /** Block until which tx cannot be included */
39671
39555
  maturity;
39672
39556
  /** The maximum fee payable by this transaction using BASE_ASSET. */
@@ -39685,7 +39569,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
39685
39569
  * @param baseTransactionRequest - Optional object containing properties to initialize the transaction request.
39686
39570
  */
39687
39571
  constructor({
39688
- tip,
39572
+ gasPrice,
39689
39573
  maturity,
39690
39574
  maxFee,
39691
39575
  witnessLimit,
@@ -39693,7 +39577,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
39693
39577
  outputs,
39694
39578
  witnesses
39695
39579
  } = {}) {
39696
- this.tip = bn(tip);
39580
+ this.gasPrice = bn(gasPrice);
39697
39581
  this.maturity = maturity ?? 0;
39698
39582
  this.witnessLimit = witnessLimit ? bn(witnessLimit) : void 0;
39699
39583
  this.maxFee = maxFee ? bn(maxFee) : void 0;
@@ -39704,9 +39588,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
39704
39588
  static getPolicyMeta(req) {
39705
39589
  let policyTypes = 0;
39706
39590
  const policies = [];
39707
- if (req.tip) {
39708
- policyTypes += PolicyType.Tip;
39709
- policies.push({ data: req.tip, type: PolicyType.Tip });
39591
+ if (req.gasPrice) {
39592
+ policyTypes += PolicyType.GasPrice;
39593
+ policies.push({ data: req.gasPrice, type: PolicyType.GasPrice });
39710
39594
  }
39711
39595
  if (req.witnessLimit) {
39712
39596
  policyTypes += PolicyType.WitnessLimit;
@@ -39890,11 +39774,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
39890
39774
  * assetId, if one it was not added yet.
39891
39775
  *
39892
39776
  * @param coin - Coin resource.
39777
+ * @param predicate - Predicate bytes.
39778
+ * @param predicateData - Predicate data bytes.
39893
39779
  */
39894
- addCoinInput(coin) {
39780
+ addCoinInput(coin, predicate) {
39895
39781
  const { assetId, owner, amount } = coin;
39896
39782
  let witnessIndex;
39897
- if (coin.predicate) {
39783
+ if (predicate) {
39898
39784
  witnessIndex = 0;
39899
39785
  } else {
39900
39786
  witnessIndex = this.getCoinInputWitnessIndexByOwner(owner);
@@ -39909,22 +39795,23 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
39909
39795
  amount,
39910
39796
  assetId,
39911
39797
  txPointer: "0x00000000000000000000000000000000",
39912
- witnessIndex
39798
+ witnessIndex,
39799
+ predicate: predicate?.bytes
39913
39800
  };
39914
39801
  this.pushInput(input);
39915
39802
  this.addChangeOutput(owner, assetId);
39916
39803
  }
39917
39804
  /**
39918
39805
  * Adds a single message input to the transaction and a change output for the
39919
- * baseAssetId, if one it was not added yet.
39806
+ * asset against the message
39920
39807
  *
39921
39808
  * @param message - Message resource.
39809
+ * @param predicate - Predicate bytes.
39922
39810
  */
39923
- addMessageInput(message) {
39924
- const { recipient, sender, amount } = message;
39925
- const assetId = BaseAssetId;
39811
+ addMessageInput(message, predicate) {
39812
+ const { recipient, sender, amount, assetId } = message;
39926
39813
  let witnessIndex;
39927
- if (message.predicate) {
39814
+ if (predicate) {
39928
39815
  witnessIndex = 0;
39929
39816
  } else {
39930
39817
  witnessIndex = this.getCoinInputWitnessIndexByOwner(recipient);
@@ -39938,7 +39825,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
39938
39825
  sender: sender.toB256(),
39939
39826
  recipient: recipient.toB256(),
39940
39827
  amount,
39941
- witnessIndex
39828
+ witnessIndex,
39829
+ predicate: predicate?.bytes
39942
39830
  };
39943
39831
  this.pushInput(input);
39944
39832
  this.addChangeOutput(recipient, assetId);
@@ -39969,6 +39857,32 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
39969
39857
  resources.forEach((resource) => this.addResource(resource));
39970
39858
  return this;
39971
39859
  }
39860
+ /**
39861
+ * Adds multiple resources to the transaction by adding coin/message inputs and change
39862
+ * outputs from the related assetIds.
39863
+ *
39864
+ * @param resources - The resources to add.
39865
+ * @returns This transaction.
39866
+ */
39867
+ addPredicateResource(resource, predicate) {
39868
+ if (isCoin(resource)) {
39869
+ this.addCoinInput(resource, predicate);
39870
+ } else {
39871
+ this.addMessageInput(resource, predicate);
39872
+ }
39873
+ return this;
39874
+ }
39875
+ /**
39876
+ * Adds multiple predicate coin/message inputs to the transaction and change outputs
39877
+ * from the related assetIds.
39878
+ *
39879
+ * @param resources - The resources to add.
39880
+ * @returns This transaction.
39881
+ */
39882
+ addPredicateResources(resources, predicate) {
39883
+ resources.forEach((resource) => this.addPredicateResource(resource, predicate));
39884
+ return this;
39885
+ }
39972
39886
  /**
39973
39887
  * Adds a coin output to the transaction.
39974
39888
  *
@@ -39976,7 +39890,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
39976
39890
  * @param amount - Amount of coin.
39977
39891
  * @param assetId - Asset ID of coin.
39978
39892
  */
39979
- addCoinOutput(to, amount, assetId = BaseAssetId) {
39893
+ addCoinOutput(to, amount, assetId) {
39980
39894
  this.pushOutput({
39981
39895
  type: OutputType.Coin,
39982
39896
  to: addressify(to).toB256(),
@@ -40008,7 +39922,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
40008
39922
  * @param to - Address of the owner.
40009
39923
  * @param assetId - Asset ID of coin.
40010
39924
  */
40011
- addChangeOutput(to, assetId = BaseAssetId) {
39925
+ addChangeOutput(to, assetId) {
40012
39926
  const changeOutput = this.getChangeOutputs().find(
40013
39927
  (output3) => hexlify(output3.assetId) === assetId
40014
39928
  );
@@ -40048,7 +39962,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
40048
39962
  }
40049
39963
  calculateMaxGas(chainInfo, minGas) {
40050
39964
  const { consensusParameters } = chainInfo;
40051
- const { gasPerByte, maxGasPerTx } = consensusParameters;
39965
+ const { gasPerByte } = consensusParameters;
40052
39966
  const witnessesLength = this.toTransaction().witnesses.reduce(
40053
39967
  (acc, wit) => acc + wit.dataLength,
40054
39968
  0
@@ -40057,8 +39971,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
40057
39971
  gasPerByte,
40058
39972
  minGas,
40059
39973
  witnessesLength,
40060
- witnessLimit: this.witnessLimit,
40061
- maxGasPerTx
39974
+ witnessLimit: this.witnessLimit
40062
39975
  });
40063
39976
  }
40064
39977
  /**
@@ -40066,8 +39979,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
40066
39979
  * quantities array.
40067
39980
  *
40068
39981
  * @param quantities - CoinQuantity Array.
39982
+ * @param baseAssetId - The base asset to fund the transaction.
40069
39983
  */
40070
- fundWithFakeUtxos(quantities, resourcesOwner) {
39984
+ fundWithFakeUtxos(quantities, baseAssetId, resourcesOwner) {
40071
39985
  const findAssetInput = (assetId) => this.inputs.find((input) => {
40072
39986
  if ("assetId" in input) {
40073
39987
  return input.assetId === assetId;
@@ -40076,27 +39990,24 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
40076
39990
  });
40077
39991
  const updateAssetInput = (assetId, quantity) => {
40078
39992
  const assetInput = findAssetInput(assetId);
40079
- let usedQuantity = quantity;
40080
- if (assetId === BaseAssetId) {
40081
- usedQuantity = bn("1000000000000000000");
40082
- }
40083
39993
  if (assetInput && "assetId" in assetInput) {
40084
39994
  assetInput.id = hexlify(randomBytes22(UTXO_ID_LEN));
40085
- assetInput.amount = usedQuantity;
39995
+ assetInput.amount = quantity;
40086
39996
  } else {
40087
39997
  this.addResources([
40088
39998
  {
40089
39999
  id: hexlify(randomBytes22(UTXO_ID_LEN)),
40090
- amount: usedQuantity,
40000
+ amount: quantity,
40091
40001
  assetId,
40092
40002
  owner: resourcesOwner || Address.fromRandom(),
40003
+ maturity: 0,
40093
40004
  blockCreated: bn(1),
40094
40005
  txCreatedIdx: bn(1)
40095
40006
  }
40096
40007
  ]);
40097
40008
  }
40098
40009
  };
40099
- updateAssetInput(BaseAssetId, bn(1e11));
40010
+ updateAssetInput(baseAssetId, bn(1e11));
40100
40011
  quantities.forEach((q) => updateAssetInput(q.assetId, q.amount));
40101
40012
  }
40102
40013
  /**
@@ -40121,7 +40032,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
40121
40032
  toJSON() {
40122
40033
  return normalizeJSON(this);
40123
40034
  }
40124
- updatePredicateGasUsed(inputs) {
40035
+ updatePredicateInputs(inputs) {
40125
40036
  this.inputs.forEach((i) => {
40126
40037
  let correspondingInput;
40127
40038
  switch (i.type) {
@@ -40143,15 +40054,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
40143
40054
  }
40144
40055
  });
40145
40056
  }
40146
- shiftPredicateData() {
40147
- this.inputs.forEach((input) => {
40148
- if ("predicateData" in input && "paddPredicateData" in input && typeof input.paddPredicateData === "function") {
40149
- input.predicateData = input.paddPredicateData(
40150
- BaseTransactionRequest.getPolicyMeta(this).policies.length
40151
- );
40152
- }
40153
- });
40154
- }
40155
40057
  };
40156
40058
 
40157
40059
  // src/providers/transaction-request/hash-transaction.ts
@@ -40262,12 +40164,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
40262
40164
  *
40263
40165
  * @param createTransactionRequestLike - The initial values for the instance
40264
40166
  */
40265
- constructor({
40266
- bytecodeWitnessIndex,
40267
- salt,
40268
- storageSlots,
40269
- ...rest
40270
- } = {}) {
40167
+ constructor({ bytecodeWitnessIndex, salt, storageSlots, ...rest }) {
40271
40168
  super(rest);
40272
40169
  this.bytecodeWitnessIndex = bytecodeWitnessIndex ?? 0;
40273
40170
  this.salt = hexlify(salt ?? ZeroBytes32);
@@ -40285,8 +40182,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
40285
40182
  return {
40286
40183
  type: TransactionType.Create,
40287
40184
  ...baseTransaction,
40185
+ bytecodeLength: baseTransaction.witnesses[bytecodeWitnessIndex].dataLength / 4,
40288
40186
  bytecodeWitnessIndex,
40289
- storageSlotsCount: bn(storageSlots.length),
40187
+ storageSlotsCount: storageSlots.length,
40290
40188
  salt: this.salt ? hexlify(this.salt) : ZeroBytes32,
40291
40189
  storageSlots
40292
40190
  };
@@ -40400,8 +40298,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
40400
40298
  type: TransactionType.Script,
40401
40299
  scriptGasLimit: this.gasLimit,
40402
40300
  ...super.getBaseTransaction(),
40403
- scriptLength: bn(script.length),
40404
- scriptDataLength: bn(scriptData.length),
40301
+ scriptLength: script.length,
40302
+ scriptDataLength: scriptData.length,
40405
40303
  receiptsRoot: ZeroBytes32,
40406
40304
  script: hexlify(script),
40407
40305
  scriptData: hexlify(scriptData)
@@ -40465,7 +40363,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
40465
40363
  }
40466
40364
  calculateMaxGas(chainInfo, minGas) {
40467
40365
  const { consensusParameters } = chainInfo;
40468
- const { gasPerByte, maxGasPerTx } = consensusParameters;
40366
+ const { gasPerByte } = consensusParameters;
40469
40367
  const witnessesLength = this.toTransaction().witnesses.reduce(
40470
40368
  (acc, wit) => acc + wit.dataLength,
40471
40369
  0
@@ -40475,8 +40373,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
40475
40373
  minGas,
40476
40374
  witnessesLength,
40477
40375
  witnessLimit: this.witnessLimit,
40478
- gasLimit: this.gasLimit,
40479
- maxGasPerTx
40376
+ gasLimit: this.gasLimit
40480
40377
  });
40481
40378
  }
40482
40379
  /**
@@ -40549,29 +40446,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
40549
40446
  }
40550
40447
  }
40551
40448
  };
40552
- var cacheTxInputsFromOwner = (inputs, owner) => inputs.reduce(
40553
- (acc, input) => {
40554
- if (input.type === InputType.Coin && input.owner === owner) {
40555
- acc.utxos.push(input.id);
40556
- }
40557
- if (input.type === InputType.Message && input.recipient === owner) {
40558
- acc.messages.push(input.nonce);
40559
- }
40560
- return acc;
40561
- },
40562
- {
40563
- utxos: [],
40564
- messages: []
40565
- }
40566
- );
40567
40449
 
40568
40450
  // src/providers/transaction-summary/calculate-transaction-fee.ts
40569
40451
  var calculateTransactionFee = (params) => {
40570
40452
  const {
40571
- gasPrice,
40453
+ gasUsed,
40572
40454
  rawPayload,
40573
- tip,
40574
- consensusParameters: { gasCosts, feeParams, maxGasPerTx }
40455
+ consensusParameters: { gasCosts, feeParams }
40575
40456
  } = params;
40576
40457
  const gasPerByte = bn(feeParams.gasPerByte);
40577
40458
  const gasPriceFactor = bn(feeParams.gasPriceFactor);
@@ -40581,7 +40462,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
40581
40462
  return {
40582
40463
  fee: bn(0),
40583
40464
  minFee: bn(0),
40584
- maxFee: bn(0)
40465
+ maxFee: bn(0),
40466
+ feeFromGasUsed: bn(0)
40585
40467
  };
40586
40468
  }
40587
40469
  const { type: type3, witnesses, inputs, policies } = transaction;
@@ -40613,6 +40495,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
40613
40495
  metadataGas,
40614
40496
  txBytesSize: transactionBytes.length
40615
40497
  });
40498
+ const gasPrice = bn(policies.find((policy) => policy.type === PolicyType.GasPrice)?.data);
40616
40499
  const witnessLimit = policies.find((policy) => policy.type === PolicyType.WitnessLimit)?.data;
40617
40500
  const witnessesLength = witnesses.reduce((acc, wit) => acc + wit.dataLength, 0);
40618
40501
  const maxGas = getMaxGas({
@@ -40620,25 +40503,17 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
40620
40503
  minGas,
40621
40504
  witnessesLength,
40622
40505
  gasLimit,
40623
- witnessLimit,
40624
- maxGasPerTx
40625
- });
40626
- const minFee = calculateGasFee({
40627
- gasPrice,
40628
- gas: minGas,
40629
- priceFactor: gasPriceFactor,
40630
- tip
40631
- });
40632
- const maxFee = calculateGasFee({
40633
- gasPrice,
40634
- gas: maxGas,
40635
- priceFactor: gasPriceFactor,
40636
- tip
40506
+ witnessLimit
40637
40507
  });
40508
+ const feeFromGasUsed = calculatePriceWithFactor(gasUsed, gasPrice, gasPriceFactor);
40509
+ const minFee = calculatePriceWithFactor(minGas, gasPrice, gasPriceFactor);
40510
+ const maxFee = calculatePriceWithFactor(maxGas, gasPrice, gasPriceFactor);
40511
+ const fee = minFee.add(feeFromGasUsed);
40638
40512
  return {
40513
+ fee,
40639
40514
  minFee,
40640
40515
  maxFee,
40641
- fee: maxFee
40516
+ feeFromGasUsed
40642
40517
  };
40643
40518
  };
40644
40519
 
@@ -41239,9 +41114,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
41239
41114
  gqlTransactionStatus,
41240
41115
  abiMap = {},
41241
41116
  maxInputs,
41242
- gasCosts,
41243
- maxGasPerTx,
41244
- gasPrice
41117
+ gasCosts
41245
41118
  } = params;
41246
41119
  const gasUsed = getGasUsedFromReceipts(receipts);
41247
41120
  const rawPayload = hexlify(transactionBytes);
@@ -41255,14 +41128,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
41255
41128
  maxInputs
41256
41129
  });
41257
41130
  const typeName = getTransactionTypeName(transaction.type);
41258
- const tip = bn(transaction.policies?.find((policy) => policy.type === PolicyType.Tip)?.data);
41259
41131
  const { fee } = calculateTransactionFee({
41260
- gasPrice,
41132
+ gasUsed,
41261
41133
  rawPayload,
41262
- tip,
41263
41134
  consensusParameters: {
41264
41135
  gasCosts,
41265
- maxGasPerTx,
41266
41136
  feeParams: {
41267
41137
  gasPerByte,
41268
41138
  gasPriceFactor
@@ -41398,13 +41268,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
41398
41268
  const decodedTransaction = this.decodeTransaction(
41399
41269
  transaction
41400
41270
  );
41401
- let txReceipts = [];
41402
- if (transaction?.status && "receipts" in transaction.status) {
41403
- txReceipts = transaction.status.receipts;
41404
- }
41405
- const receipts = txReceipts.map(processGqlReceipt) || [];
41406
- const { gasPerByte, gasPriceFactor, gasCosts, maxGasPerTx } = this.provider.getGasConfig();
41407
- const gasPrice = await this.provider.getLatestGasPrice();
41271
+ const receipts = transaction.receipts?.map(processGqlReceipt) || [];
41272
+ const { gasPerByte, gasPriceFactor, gasCosts } = this.provider.getGasConfig();
41408
41273
  const maxInputs = this.provider.getChain().consensusParameters.maxInputs;
41409
41274
  const transactionSummary = assembleTransactionSummary({
41410
41275
  id: this.id,
@@ -41416,9 +41281,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
41416
41281
  gasPriceFactor,
41417
41282
  abiMap: contractsAbiMap,
41418
41283
  maxInputs,
41419
- gasCosts,
41420
- maxGasPerTx,
41421
- gasPrice
41284
+ gasCosts
41422
41285
  });
41423
41286
  return transactionSummary;
41424
41287
  }
@@ -41524,7 +41387,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
41524
41387
  }
41525
41388
 
41526
41389
  // src/providers/utils/merge-quantities.ts
41527
- var mergeQuantities = (arr1, arr2) => {
41390
+ var mergeQuantities = (...coinQuantities) => {
41528
41391
  const resultMap = {};
41529
41392
  function addToMap({ amount, assetId }) {
41530
41393
  if (resultMap[assetId]) {
@@ -41533,8 +41396,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
41533
41396
  resultMap[assetId] = amount;
41534
41397
  }
41535
41398
  }
41536
- arr1.forEach(addToMap);
41537
- arr2.forEach(addToMap);
41399
+ coinQuantities.forEach((arr) => arr.forEach(addToMap));
41538
41400
  return Object.entries(resultMap).map(([assetId, amount]) => ({ assetId, amount }));
41539
41401
  };
41540
41402
 
@@ -41562,12 +41424,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
41562
41424
  gasPerByte: bn(feeParams.gasPerByte),
41563
41425
  maxMessageDataLength: bn(predicateParams.maxMessageDataLength),
41564
41426
  chainId: bn(consensusParameters.chainId),
41427
+ baseAssetId: consensusParameters.baseAssetId,
41565
41428
  gasCosts
41566
41429
  },
41567
41430
  gasCosts,
41568
41431
  latestBlock: {
41569
41432
  id: latestBlock.id,
41570
- height: bn(latestBlock.height),
41433
+ height: bn(latestBlock.header.height),
41571
41434
  time: latestBlock.header.time,
41572
41435
  transactions: latestBlock.transactions.map((i) => ({
41573
41436
  id: i.id
@@ -41661,8 +41524,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
41661
41524
  * Returns some helpful parameters related to gas fees.
41662
41525
  */
41663
41526
  getGasConfig() {
41527
+ const { minGasPrice } = this.getNode();
41664
41528
  const { maxGasPerTx, maxGasPerPredicate, gasPriceFactor, gasPerByte, gasCosts } = this.getChain().consensusParameters;
41665
41529
  return {
41530
+ minGasPrice,
41666
41531
  maxGasPerTx,
41667
41532
  maxGasPerPredicate,
41668
41533
  gasPriceFactor,
@@ -41760,7 +41625,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
41760
41625
  */
41761
41626
  async getBlockNumber() {
41762
41627
  const { chain } = await this.operations.getChain();
41763
- return bn(chain.latestBlock.height, 10);
41628
+ return bn(chain.latestBlock.header.height, 10);
41764
41629
  }
41765
41630
  /**
41766
41631
  * Returns the chain information.
@@ -41772,9 +41637,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
41772
41637
  const processedNodeInfo = {
41773
41638
  maxDepth: bn(nodeInfo.maxDepth),
41774
41639
  maxTx: bn(nodeInfo.maxTx),
41640
+ minGasPrice: bn(nodeInfo.minGasPrice),
41775
41641
  nodeVersion: nodeInfo.nodeVersion,
41776
41642
  utxoValidation: nodeInfo.utxoValidation,
41777
- vmBacktrace: nodeInfo.vmBacktrace
41643
+ vmBacktrace: nodeInfo.vmBacktrace,
41644
+ peers: nodeInfo.peers
41778
41645
  };
41779
41646
  _Provider.nodeInfoCache[this.url] = processedNodeInfo;
41780
41647
  return processedNodeInfo;
@@ -41800,6 +41667,17 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
41800
41667
  } = this.getChain();
41801
41668
  return chainId.toNumber();
41802
41669
  }
41670
+ /**
41671
+ * Returns the base asset ID
41672
+ *
41673
+ * @returns A promise that resolves to the base asset ID
41674
+ */
41675
+ getBaseAssetId() {
41676
+ const {
41677
+ consensusParameters: { baseAssetId }
41678
+ } = this.getChain();
41679
+ return baseAssetId;
41680
+ }
41803
41681
  /**
41804
41682
  * Submits a transaction to the chain to be executed.
41805
41683
  *
@@ -41860,13 +41738,14 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
41860
41738
  return this.estimateTxDependencies(transactionRequest);
41861
41739
  }
41862
41740
  const encodedTransaction = hexlify(transactionRequest.toTransactionBytes());
41863
- const { dryRun: dryRunStatuses } = await this.operations.dryRun({
41864
- encodedTransactions: encodedTransaction,
41741
+ const { dryRun: gqlReceipts } = await this.operations.dryRun({
41742
+ encodedTransaction,
41865
41743
  utxoValidation: utxoValidation || false
41866
41744
  });
41867
- const [{ receipts: rawReceipts, status }] = dryRunStatuses;
41868
- const receipts = rawReceipts.map(processGqlReceipt);
41869
- return { receipts, dryrunStatus: status };
41745
+ const receipts = gqlReceipts.map(processGqlReceipt);
41746
+ return {
41747
+ receipts
41748
+ };
41870
41749
  }
41871
41750
  /**
41872
41751
  * Verifies whether enough gas is available to complete transaction.
@@ -41905,6 +41784,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
41905
41784
  * If there are missing variable outputs,
41906
41785
  * `addVariableOutputs` is called on the transaction.
41907
41786
  *
41787
+ * @privateRemarks
41788
+ * TODO: Investigate support for missing contract IDs
41789
+ * TODO: Add support for missing output messages
41908
41790
  *
41909
41791
  * @param transactionRequest - The transaction request object.
41910
41792
  * @returns A promise.
@@ -41917,19 +41799,16 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
41917
41799
  missingContractIds: []
41918
41800
  };
41919
41801
  }
41802
+ await this.estimatePredicates(transactionRequest);
41920
41803
  let receipts = [];
41921
41804
  const missingContractIds = [];
41922
41805
  let outputVariables = 0;
41923
- let dryrunStatus;
41924
41806
  for (let attempt = 0; attempt < MAX_RETRIES; attempt++) {
41925
- const {
41926
- dryRun: [{ receipts: rawReceipts, status }]
41927
- } = await this.operations.dryRun({
41928
- encodedTransactions: [hexlify(transactionRequest.toTransactionBytes())],
41807
+ const { dryRun: gqlReceipts } = await this.operations.dryRun({
41808
+ encodedTransaction: hexlify(transactionRequest.toTransactionBytes()),
41929
41809
  utxoValidation: false
41930
41810
  });
41931
- receipts = rawReceipts.map(processGqlReceipt);
41932
- dryrunStatus = status;
41811
+ receipts = gqlReceipts.map(processGqlReceipt);
41933
41812
  const { missingOutputVariables, missingOutputContractIds } = getReceiptsWithMissingData(receipts);
41934
41813
  const hasMissingOutputs = missingOutputVariables.length !== 0 || missingOutputContractIds.length !== 0;
41935
41814
  if (hasMissingOutputs) {
@@ -41939,10 +41818,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
41939
41818
  transactionRequest.addContractInputAndOutput(Address.fromString(contractId));
41940
41819
  missingContractIds.push(contractId);
41941
41820
  });
41942
- const { maxFee } = await this.estimateTxGasAndFee({
41943
- transactionRequest
41944
- });
41945
- transactionRequest.maxFee = maxFee;
41946
41821
  } else {
41947
41822
  break;
41948
41823
  }
@@ -41950,139 +41825,37 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
41950
41825
  return {
41951
41826
  receipts,
41952
41827
  outputVariables,
41953
- missingContractIds,
41954
- dryrunStatus
41828
+ missingContractIds
41955
41829
  };
41956
41830
  }
41957
- /**
41958
- * Dry runs multiple transactions and checks for missing dependencies in batches.
41959
- *
41960
- * Transactions are dry run in batches. After each dry run, transactions requiring
41961
- * further modifications are identified. The method iteratively updates these transactions
41962
- * and performs subsequent dry runs until all dependencies for each transaction are satisfied.
41963
- *
41964
- * @param transactionRequests - Array of transaction request objects.
41965
- * @returns A promise that resolves to an array of results for each transaction.
41966
- */
41967
- async estimateMultipleTxDependencies(transactionRequests) {
41968
- const results = transactionRequests.map(() => ({
41969
- receipts: [],
41970
- outputVariables: 0,
41971
- missingContractIds: [],
41972
- dryrunStatus: void 0
41973
- }));
41974
- const allRequests = clone_default(transactionRequests);
41975
- const serializedTransactionsMap = /* @__PURE__ */ new Map();
41976
- allRequests.forEach((req, index) => {
41977
- if (req.type === TransactionType.Script) {
41978
- serializedTransactionsMap.set(index, hexlify(req.toTransactionBytes()));
41979
- }
41980
- });
41981
- let transactionsToProcess = Array.from(serializedTransactionsMap.keys());
41982
- let attempt = 0;
41983
- while (transactionsToProcess.length > 0 && attempt < MAX_RETRIES) {
41984
- const encodedTransactions = transactionsToProcess.map(
41985
- (index) => serializedTransactionsMap.get(index)
41986
- );
41987
- const dryRunResults = await this.operations.dryRun({
41988
- encodedTransactions,
41989
- utxoValidation: false
41990
- });
41991
- const nextRoundTransactions = [];
41992
- for (let i = 0; i < dryRunResults.dryRun.length; i++) {
41993
- const currentResultIndex = transactionsToProcess[i];
41994
- const { receipts: rawReceipts, status } = dryRunResults.dryRun[i];
41995
- results[currentResultIndex].receipts = rawReceipts.map(processGqlReceipt);
41996
- results[currentResultIndex].dryrunStatus = status;
41997
- const { missingOutputVariables, missingOutputContractIds } = getReceiptsWithMissingData(
41998
- results[currentResultIndex].receipts
41999
- );
42000
- const hasMissingOutputs = missingOutputVariables.length > 0 || missingOutputContractIds.length > 0;
42001
- const requestToProcess = allRequests[currentResultIndex];
42002
- if (hasMissingOutputs && requestToProcess?.type === TransactionType.Script) {
42003
- results[currentResultIndex].outputVariables += missingOutputVariables.length;
42004
- requestToProcess.addVariableOutputs(missingOutputVariables.length);
42005
- missingOutputContractIds.forEach(({ contractId }) => {
42006
- requestToProcess.addContractInputAndOutput(Address.fromString(contractId));
42007
- results[currentResultIndex].missingContractIds.push(contractId);
42008
- });
42009
- const { maxFee } = await this.estimateTxGasAndFee({
42010
- transactionRequest: requestToProcess
42011
- });
42012
- requestToProcess.maxFee = maxFee;
42013
- serializedTransactionsMap.set(
42014
- currentResultIndex,
42015
- hexlify(requestToProcess.toTransactionBytes())
42016
- );
42017
- nextRoundTransactions.push(currentResultIndex);
42018
- allRequests[currentResultIndex] = requestToProcess;
42019
- }
42020
- }
42021
- transactionsToProcess = nextRoundTransactions;
42022
- attempt += 1;
42023
- }
42024
- return results;
42025
- }
42026
- async dryRunMultipleTransactions(transactionRequests, { utxoValidation, estimateTxDependencies = true } = {}) {
42027
- if (estimateTxDependencies) {
42028
- return this.estimateMultipleTxDependencies(transactionRequests);
42029
- }
42030
- const encodedTransactions = transactionRequests.map((tx) => hexlify(tx.toTransactionBytes()));
42031
- const { dryRun: dryRunStatuses } = await this.operations.dryRun({
42032
- encodedTransactions,
42033
- utxoValidation: utxoValidation || false
42034
- });
42035
- const results = dryRunStatuses.map(({ receipts: rawReceipts, status }) => {
42036
- const receipts = rawReceipts.map(processGqlReceipt);
42037
- return { receipts, dryrunStatus: status };
42038
- });
42039
- return results;
42040
- }
42041
41831
  /**
42042
41832
  * Estimates the transaction gas and fee based on the provided transaction request.
42043
41833
  * @param transactionRequest - The transaction request object.
42044
41834
  * @returns An object containing the estimated minimum gas, minimum fee, maximum gas, and maximum fee.
42045
41835
  */
42046
- async estimateTxGasAndFee(params) {
41836
+ estimateTxGasAndFee(params) {
42047
41837
  const { transactionRequest } = params;
42048
- let { gasPrice } = params;
41838
+ const { gasPriceFactor, minGasPrice, maxGasPerTx } = this.getGasConfig();
42049
41839
  const chainInfo = this.getChain();
42050
- const { gasPriceFactor, maxGasPerTx } = this.getGasConfig();
41840
+ const gasPrice = transactionRequest.gasPrice.eq(0) ? minGasPrice : transactionRequest.gasPrice;
41841
+ transactionRequest.gasPrice = gasPrice;
42051
41842
  const minGas = transactionRequest.calculateMinGas(chainInfo);
42052
- if (!gasPrice) {
42053
- gasPrice = await this.estimateGasPrice(10);
42054
- }
42055
- const minFee = calculateGasFee({
42056
- gasPrice: bn(gasPrice),
42057
- gas: minGas,
42058
- priceFactor: gasPriceFactor,
42059
- tip: transactionRequest.tip
42060
- }).add(1);
42061
- let gasLimit = bn(0);
41843
+ const minFee = calculatePriceWithFactor(minGas, gasPrice, gasPriceFactor).normalizeZeroToOne();
42062
41844
  if (transactionRequest.type === TransactionType.Script) {
42063
- gasLimit = transactionRequest.gasLimit;
42064
41845
  if (transactionRequest.gasLimit.eq(0)) {
42065
41846
  transactionRequest.gasLimit = minGas;
42066
41847
  transactionRequest.gasLimit = maxGasPerTx.sub(
42067
41848
  transactionRequest.calculateMaxGas(chainInfo, minGas)
42068
41849
  );
42069
- gasLimit = transactionRequest.gasLimit;
42070
41850
  }
42071
41851
  }
42072
41852
  const maxGas = transactionRequest.calculateMaxGas(chainInfo, minGas);
42073
- const maxFee = calculateGasFee({
42074
- gasPrice: bn(gasPrice),
42075
- gas: maxGas,
42076
- priceFactor: gasPriceFactor,
42077
- tip: transactionRequest.tip
42078
- }).add(1);
41853
+ const maxFee = calculatePriceWithFactor(maxGas, gasPrice, gasPriceFactor).normalizeZeroToOne();
42079
41854
  return {
42080
41855
  minGas,
42081
41856
  minFee,
42082
41857
  maxGas,
42083
- maxFee,
42084
- gasPrice,
42085
- gasLimit
41858
+ maxFee
42086
41859
  };
42087
41860
  }
42088
41861
  /**
@@ -42100,17 +41873,15 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42100
41873
  if (estimateTxDependencies) {
42101
41874
  return this.estimateTxDependencies(transactionRequest);
42102
41875
  }
42103
- const encodedTransactions = [hexlify(transactionRequest.toTransactionBytes())];
42104
- const { dryRun: dryRunStatuses } = await this.operations.dryRun({
42105
- encodedTransactions,
41876
+ const encodedTransaction = hexlify(transactionRequest.toTransactionBytes());
41877
+ const { dryRun: gqlReceipts } = await this.operations.dryRun({
41878
+ encodedTransaction,
42106
41879
  utxoValidation: true
42107
41880
  });
42108
- const callResult = dryRunStatuses.map((dryRunStatus) => {
42109
- const { id, receipts, status } = dryRunStatus;
42110
- const processedReceipts = receipts.map(processGqlReceipt);
42111
- return { id, receipts: processedReceipts, status };
42112
- });
42113
- return { receipts: callResult[0].receipts };
41881
+ const receipts = gqlReceipts.map(processGqlReceipt);
41882
+ return {
41883
+ receipts
41884
+ };
42114
41885
  }
42115
41886
  /**
42116
41887
  * Returns a transaction cost to enable user
@@ -42127,79 +41898,78 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42127
41898
  * @param tolerance - The tolerance to add on top of the gasUsed.
42128
41899
  * @returns A promise that resolves to the transaction cost object.
42129
41900
  */
42130
- async getTransactionCost(transactionRequestLike, { resourcesOwner, signatureCallback, quantitiesToContract = [] } = {}) {
41901
+ async getTransactionCost(transactionRequestLike, forwardingQuantities = [], {
41902
+ estimateTxDependencies = true,
41903
+ estimatePredicates = true,
41904
+ resourcesOwner,
41905
+ signatureCallback
41906
+ } = {}) {
42131
41907
  const txRequestClone = clone_default(transactionRequestify(transactionRequestLike));
41908
+ const { minGasPrice } = this.getGasConfig();
41909
+ const setGasPrice = max(txRequestClone.gasPrice, minGasPrice);
42132
41910
  const isScriptTransaction = txRequestClone.type === TransactionType.Script;
41911
+ const baseAssetId = this.getBaseAssetId();
42133
41912
  const coinOutputsQuantities = txRequestClone.getCoinOutputsQuantities();
42134
- const allQuantities = mergeQuantities(coinOutputsQuantities, quantitiesToContract);
42135
- txRequestClone.fundWithFakeUtxos(allQuantities, resourcesOwner?.address);
42136
- txRequestClone.maxFee = bn(0);
41913
+ const allQuantities = mergeQuantities(coinOutputsQuantities, forwardingQuantities);
41914
+ txRequestClone.fundWithFakeUtxos(allQuantities, baseAssetId, resourcesOwner?.address);
42137
41915
  if (isScriptTransaction) {
42138
41916
  txRequestClone.gasLimit = bn(0);
42139
41917
  }
42140
- if (resourcesOwner && "populateTransactionPredicateData" in resourcesOwner) {
42141
- resourcesOwner.populateTransactionPredicateData(txRequestClone);
41918
+ if (estimatePredicates) {
41919
+ if (resourcesOwner && "populateTransactionPredicateData" in resourcesOwner) {
41920
+ resourcesOwner.populateTransactionPredicateData(txRequestClone);
41921
+ }
41922
+ await this.estimatePredicates(txRequestClone);
42142
41923
  }
42143
- const signedRequest = clone_default(txRequestClone);
42144
- let addedSignatures = 0;
42145
41924
  if (signatureCallback && isScriptTransaction) {
42146
- const lengthBefore = signedRequest.witnesses.length;
42147
- await signatureCallback(signedRequest);
42148
- addedSignatures = signedRequest.witnesses.length - lengthBefore;
41925
+ await signatureCallback(txRequestClone);
42149
41926
  }
42150
- await this.estimatePredicates(signedRequest);
42151
- let { maxFee, maxGas, minFee, minGas, gasPrice, gasLimit } = await this.estimateTxGasAndFee({
42152
- transactionRequest: signedRequest
41927
+ let { maxFee, maxGas, minFee, minGas } = this.estimateTxGasAndFee({
41928
+ transactionRequest: txRequestClone
42153
41929
  });
42154
41930
  let receipts = [];
42155
41931
  let missingContractIds = [];
42156
41932
  let outputVariables = 0;
42157
41933
  let gasUsed = bn(0);
42158
- txRequestClone.updatePredicateGasUsed(signedRequest.inputs);
42159
- txRequestClone.maxFee = maxFee;
42160
- if (isScriptTransaction) {
42161
- txRequestClone.gasLimit = gasLimit;
42162
- if (signatureCallback) {
42163
- await signatureCallback(txRequestClone);
42164
- }
41934
+ if (isScriptTransaction && estimateTxDependencies) {
41935
+ txRequestClone.gasPrice = bn(0);
42165
41936
  const result = await this.estimateTxDependencies(txRequestClone);
42166
41937
  receipts = result.receipts;
42167
41938
  outputVariables = result.outputVariables;
42168
41939
  missingContractIds = result.missingContractIds;
42169
41940
  gasUsed = isScriptTransaction ? getGasUsedFromReceipts(receipts) : gasUsed;
42170
41941
  txRequestClone.gasLimit = gasUsed;
42171
- ({ maxFee, maxGas, minFee, minGas, gasPrice } = await this.estimateTxGasAndFee({
42172
- transactionRequest: txRequestClone,
42173
- gasPrice
41942
+ txRequestClone.gasPrice = setGasPrice;
41943
+ ({ maxFee, maxGas, minFee, minGas } = this.estimateTxGasAndFee({
41944
+ transactionRequest: txRequestClone
42174
41945
  }));
42175
41946
  }
42176
41947
  return {
42177
41948
  requiredQuantities: allQuantities,
42178
41949
  receipts,
42179
41950
  gasUsed,
42180
- gasPrice,
41951
+ minGasPrice,
41952
+ gasPrice: setGasPrice,
42181
41953
  minGas,
42182
41954
  maxGas,
42183
41955
  minFee,
42184
41956
  maxFee,
41957
+ estimatedInputs: txRequestClone.inputs,
42185
41958
  outputVariables,
42186
- missingContractIds,
42187
- addedSignatures,
42188
- estimatedPredicates: txRequestClone.inputs
41959
+ missingContractIds
42189
41960
  };
42190
41961
  }
42191
- async getResourcesForTransaction(owner, transactionRequestLike, quantitiesToContract = []) {
41962
+ async getResourcesForTransaction(owner, transactionRequestLike, forwardingQuantities = []) {
42192
41963
  const ownerAddress = Address.fromAddressOrString(owner);
42193
41964
  const transactionRequest = transactionRequestify(clone_default(transactionRequestLike));
42194
- const transactionCost = await this.getTransactionCost(transactionRequest, {
42195
- quantitiesToContract
42196
- });
41965
+ const transactionCost = await this.getTransactionCost(transactionRequest, forwardingQuantities);
42197
41966
  transactionRequest.addResources(
42198
41967
  await this.getResourcesToSpend(ownerAddress, transactionCost.requiredQuantities)
42199
41968
  );
42200
- const { requiredQuantities, ...txCost } = await this.getTransactionCost(transactionRequest, {
42201
- quantitiesToContract
42202
- });
41969
+ const { requiredQuantities, ...txCost } = await this.getTransactionCost(
41970
+ transactionRequest,
41971
+ forwardingQuantities
41972
+ );
42203
41973
  const resources = await this.getResourcesToSpend(ownerAddress, requiredQuantities);
42204
41974
  return {
42205
41975
  resources,
@@ -42223,6 +41993,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42223
41993
  assetId: coin.assetId,
42224
41994
  amount: bn(coin.amount),
42225
41995
  owner: Address.fromAddressOrString(coin.owner),
41996
+ maturity: bn(coin.maturity).toNumber(),
42226
41997
  blockCreated: bn(coin.blockCreated),
42227
41998
  txCreatedIdx: bn(coin.txCreatedIdx)
42228
41999
  }));
@@ -42274,6 +42045,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42274
42045
  amount: bn(coin.amount),
42275
42046
  assetId: coin.assetId,
42276
42047
  owner: Address.fromAddressOrString(coin.owner),
42048
+ maturity: bn(coin.maturity).toNumber(),
42277
42049
  blockCreated: bn(coin.blockCreated),
42278
42050
  txCreatedIdx: bn(coin.txCreatedIdx)
42279
42051
  };
@@ -42306,7 +42078,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42306
42078
  }
42307
42079
  return {
42308
42080
  id: block2.id,
42309
- height: bn(block2.height),
42081
+ height: bn(block2.header.height),
42310
42082
  time: block2.header.time,
42311
42083
  transactionIds: block2.transactions.map((tx) => tx.id)
42312
42084
  };
@@ -42321,7 +42093,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42321
42093
  const { blocks: fetchedData } = await this.operations.getBlocks(params);
42322
42094
  const blocks = fetchedData.edges.map(({ node: block2 }) => ({
42323
42095
  id: block2.id,
42324
- height: bn(block2.height),
42096
+ height: bn(block2.header.height),
42325
42097
  time: block2.header.time,
42326
42098
  transactionIds: block2.transactions.map((tx) => tx.id)
42327
42099
  }));
@@ -42348,7 +42120,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42348
42120
  }
42349
42121
  return {
42350
42122
  id: block2.id,
42351
- height: bn(block2.height, 10),
42123
+ height: bn(block2.header.height, 10),
42352
42124
  time: block2.header.time,
42353
42125
  transactionIds: block2.transactions.map((tx) => tx.id),
42354
42126
  transactions: block2.transactions.map(
@@ -42528,11 +42300,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42528
42300
  prevRoot: messageBlockHeader.prevRoot,
42529
42301
  time: messageBlockHeader.time,
42530
42302
  applicationHash: messageBlockHeader.applicationHash,
42531
- messageReceiptCount: bn(messageBlockHeader.messageReceiptCount),
42532
- messageOutboxRoot: messageBlockHeader.messageOutboxRoot,
42533
- consensusParametersVersion: messageBlockHeader.consensusParametersVersion,
42534
- eventInboxRoot: messageBlockHeader.eventInboxRoot,
42535
- stateTransitionBytecodeVersion: messageBlockHeader.stateTransitionBytecodeVersion
42303
+ messageReceiptRoot: messageBlockHeader.messageReceiptRoot,
42304
+ messageReceiptCount: bn(messageBlockHeader.messageReceiptCount)
42536
42305
  },
42537
42306
  commitBlockHeader: {
42538
42307
  id: commitBlockHeader.id,
@@ -42543,11 +42312,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42543
42312
  prevRoot: commitBlockHeader.prevRoot,
42544
42313
  time: commitBlockHeader.time,
42545
42314
  applicationHash: commitBlockHeader.applicationHash,
42546
- messageReceiptCount: bn(commitBlockHeader.messageReceiptCount),
42547
- messageOutboxRoot: commitBlockHeader.messageOutboxRoot,
42548
- consensusParametersVersion: commitBlockHeader.consensusParametersVersion,
42549
- eventInboxRoot: commitBlockHeader.eventInboxRoot,
42550
- stateTransitionBytecodeVersion: commitBlockHeader.stateTransitionBytecodeVersion
42315
+ messageReceiptRoot: commitBlockHeader.messageReceiptRoot,
42316
+ messageReceiptCount: bn(commitBlockHeader.messageReceiptCount)
42551
42317
  },
42552
42318
  sender: Address.fromAddressOrString(sender),
42553
42319
  recipient: Address.fromAddressOrString(recipient),
@@ -42556,16 +42322,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42556
42322
  data
42557
42323
  };
42558
42324
  }
42559
- async getLatestGasPrice() {
42560
- const { latestGasPrice } = await this.operations.getLatestGasPrice();
42561
- return bn(latestGasPrice.gasPrice);
42562
- }
42563
- async estimateGasPrice(blockHorizon) {
42564
- const { estimateGasPrice } = await this.operations.estimateGasPrice({
42565
- blockHorizon: String(blockHorizon)
42566
- });
42567
- return bn(estimateGasPrice.gasPrice);
42568
- }
42569
42325
  /**
42570
42326
  * Returns Message Proof for given transaction id and the message id from MessageOut receipt.
42571
42327
  *
@@ -42626,15 +42382,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42626
42382
  arrayify(gqlTransaction.rawPayload),
42627
42383
  0
42628
42384
  );
42629
- let txReceipts = [];
42630
- if (gqlTransaction?.status && "receipts" in gqlTransaction.status) {
42631
- txReceipts = gqlTransaction.status.receipts;
42632
- }
42633
- const receipts = txReceipts.map(processGqlReceipt);
42385
+ const receipts = gqlTransaction.receipts?.map(processGqlReceipt) || [];
42634
42386
  const {
42635
- consensusParameters: { gasPerByte, gasPriceFactor, maxInputs, gasCosts, maxGasPerTx }
42387
+ consensusParameters: { gasPerByte, gasPriceFactor, maxInputs, gasCosts }
42636
42388
  } = provider.getChain();
42637
- const gasPrice = await provider.getLatestGasPrice();
42638
42389
  const transactionInfo = assembleTransactionSummary({
42639
42390
  id: gqlTransaction.id,
42640
42391
  receipts,
@@ -42645,9 +42396,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42645
42396
  gasPriceFactor: bn(gasPriceFactor),
42646
42397
  abiMap,
42647
42398
  maxInputs,
42648
- gasCosts,
42649
- maxGasPerTx,
42650
- gasPrice
42399
+ gasCosts
42651
42400
  });
42652
42401
  return {
42653
42402
  gqlTransaction,
@@ -42657,11 +42406,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42657
42406
  async function getTransactionSummaryFromRequest(params) {
42658
42407
  const { provider, transactionRequest, abiMap } = params;
42659
42408
  const { receipts } = await provider.call(transactionRequest);
42660
- const { gasPerByte, gasPriceFactor, gasCosts, maxGasPerTx } = provider.getGasConfig();
42409
+ const { gasPerByte, gasPriceFactor, gasCosts } = provider.getGasConfig();
42661
42410
  const maxInputs = provider.getChain().consensusParameters.maxInputs;
42662
42411
  const transaction = transactionRequest.toTransaction();
42663
42412
  const transactionBytes = transactionRequest.toTransactionBytes();
42664
- const gasPrice = await provider.getLatestGasPrice();
42665
42413
  const transactionSummary = assembleTransactionSummary({
42666
42414
  receipts,
42667
42415
  transaction,
@@ -42670,9 +42418,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42670
42418
  gasPerByte,
42671
42419
  gasPriceFactor,
42672
42420
  maxInputs,
42673
- gasCosts,
42674
- maxGasPerTx,
42675
- gasPrice
42421
+ gasCosts
42676
42422
  });
42677
42423
  return transactionSummary;
42678
42424
  }
@@ -42681,18 +42427,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42681
42427
  const { transactionsByOwner } = await provider.operations.getTransactionsByOwner(filters);
42682
42428
  const { edges, pageInfo } = transactionsByOwner;
42683
42429
  const {
42684
- consensusParameters: { gasPerByte, gasPriceFactor, maxInputs, gasCosts, maxGasPerTx }
42430
+ consensusParameters: { gasPerByte, gasPriceFactor, maxInputs, gasCosts }
42685
42431
  } = provider.getChain();
42686
- const gasPrice = await provider.getLatestGasPrice();
42687
42432
  const transactions = edges.map((edge) => {
42688
42433
  const { node: gqlTransaction } = edge;
42689
- const { id, rawPayload, status } = gqlTransaction;
42434
+ const { id, rawPayload, receipts: gqlReceipts, status } = gqlTransaction;
42690
42435
  const [decodedTransaction] = new TransactionCoder().decode(arrayify(rawPayload), 0);
42691
- let txReceipts = [];
42692
- if (gqlTransaction?.status && "receipts" in gqlTransaction.status) {
42693
- txReceipts = gqlTransaction.status.receipts;
42694
- }
42695
- const receipts = txReceipts.map(processGqlReceipt);
42436
+ const receipts = gqlReceipts?.map(processGqlReceipt) || [];
42696
42437
  const transactionSummary = assembleTransactionSummary({
42697
42438
  id,
42698
42439
  receipts,
@@ -42703,9 +42444,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42703
42444
  gasPerByte,
42704
42445
  gasPriceFactor,
42705
42446
  maxInputs,
42706
- gasCosts,
42707
- maxGasPerTx,
42708
- gasPrice
42447
+ gasCosts
42709
42448
  });
42710
42449
  const output3 = {
42711
42450
  gqlTransaction,
@@ -42996,8 +42735,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42996
42735
  * @param assetId - The asset ID to check the balance for.
42997
42736
  * @returns A promise that resolves to the balance amount.
42998
42737
  */
42999
- async getBalance(assetId = BaseAssetId) {
43000
- const amount = await this.provider.getBalance(this.address, assetId);
42738
+ async getBalance(assetId) {
42739
+ const assetIdToFetch = assetId ?? this.provider.getBaseAssetId();
42740
+ const amount = await this.provider.getBalance(this.address, assetIdToFetch);
43001
42741
  return amount;
43002
42742
  }
43003
42743
  /**
@@ -43034,33 +42774,37 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43034
42774
  * @param fee - The estimated transaction fee.
43035
42775
  * @returns A promise that resolves when the resources are added to the transaction.
43036
42776
  */
43037
- async fund(request, params) {
43038
- const { addedSignatures, estimatedPredicates, maxFee: fee, requiredQuantities } = params;
43039
- const txRequest = request;
43040
- const requiredQuantitiesWithFee = addAmountToCoinQuantities({
42777
+ async fund(request, coinQuantities, fee) {
42778
+ const baseAssetId = this.provider.getBaseAssetId();
42779
+ const updatedQuantities = addAmountToAsset({
43041
42780
  amount: bn(fee),
43042
- assetId: BaseAssetId,
43043
- coinQuantities: requiredQuantities
42781
+ assetId: baseAssetId,
42782
+ coinQuantities
43044
42783
  });
43045
42784
  const quantitiesDict = {};
43046
- requiredQuantitiesWithFee.forEach(({ amount, assetId }) => {
42785
+ updatedQuantities.forEach(({ amount, assetId }) => {
43047
42786
  quantitiesDict[assetId] = {
43048
42787
  required: amount,
43049
42788
  owned: bn(0)
43050
42789
  };
43051
42790
  });
43052
- txRequest.inputs.forEach((input) => {
42791
+ const cachedUtxos = [];
42792
+ const cachedMessages = [];
42793
+ const owner = this.address.toB256();
42794
+ request.inputs.forEach((input) => {
43053
42795
  const isResource = "amount" in input;
43054
42796
  if (isResource) {
43055
42797
  const isCoin2 = "owner" in input;
43056
42798
  if (isCoin2) {
43057
42799
  const assetId = String(input.assetId);
43058
- if (quantitiesDict[assetId]) {
42800
+ if (input.owner === owner && quantitiesDict[assetId]) {
43059
42801
  const amount = bn(input.amount);
43060
42802
  quantitiesDict[assetId].owned = quantitiesDict[assetId].owned.add(amount);
42803
+ cachedUtxos.push(input.id);
43061
42804
  }
43062
- } else if (input.amount && quantitiesDict[BaseAssetId]) {
43063
- quantitiesDict[BaseAssetId].owned = quantitiesDict[BaseAssetId].owned.add(input.amount);
42805
+ } else if (input.recipient === owner && input.amount && quantitiesDict[baseAssetId]) {
42806
+ quantitiesDict[baseAssetId].owned = quantitiesDict[baseAssetId].owned.add(input.amount);
42807
+ cachedMessages.push(input.nonce);
43064
42808
  }
43065
42809
  }
43066
42810
  });
@@ -43075,23 +42819,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43075
42819
  });
43076
42820
  const needsToBeFunded = missingQuantities.length;
43077
42821
  if (needsToBeFunded) {
43078
- const excludedIds = cacheTxInputsFromOwner(txRequest.inputs, this.address.toB256());
43079
- const resources = await this.getResourcesToSpend(missingQuantities, excludedIds);
43080
- txRequest.addResources(resources);
43081
- }
43082
- txRequest.shiftPredicateData();
43083
- txRequest.updatePredicateGasUsed(estimatedPredicates);
43084
- const requestToBeReEstimate = clone_default(txRequest);
43085
- if (addedSignatures) {
43086
- Array.from({ length: addedSignatures }).forEach(
43087
- () => requestToBeReEstimate.addEmptyWitness()
43088
- );
42822
+ const resources = await this.getResourcesToSpend(missingQuantities, {
42823
+ messages: cachedMessages,
42824
+ utxos: cachedUtxos
42825
+ });
42826
+ request.addResources(resources);
43089
42827
  }
43090
- const { maxFee } = await this.provider.estimateTxGasAndFee({
43091
- transactionRequest: requestToBeReEstimate
43092
- });
43093
- txRequest.maxFee = maxFee;
43094
- return txRequest;
43095
42828
  }
43096
42829
  /**
43097
42830
  * A helper that creates a transfer transaction request and returns it.
@@ -43099,25 +42832,30 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43099
42832
  * @param destination - The address of the destination.
43100
42833
  * @param amount - The amount of coins to transfer.
43101
42834
  * @param assetId - The asset ID of the coins to transfer.
43102
- * @param txParams - The transaction parameters (gasLimit, tip, maturity, maxFee, witnessLimit).
42835
+ * @param txParams - The transaction parameters (gasLimit, gasPrice, maturity).
43103
42836
  * @returns A promise that resolves to the prepared transaction request.
43104
42837
  */
43105
- async createTransfer(destination, amount, assetId = BaseAssetId, txParams = {}) {
43106
- const request = new ScriptTransactionRequest(txParams);
43107
- request.addCoinOutput(Address.fromAddressOrString(destination), amount, assetId);
43108
- const txCost = await this.provider.getTransactionCost(request, {
42838
+ async createTransfer(destination, amount, assetId, txParams = {}) {
42839
+ const { minGasPrice } = this.provider.getGasConfig();
42840
+ const baseAssetId = this.provider.getBaseAssetId();
42841
+ const assetIdToTransfer = assetId ?? this.provider.getBaseAssetId();
42842
+ const params = { gasPrice: minGasPrice, baseAssetId, ...txParams };
42843
+ const request = new ScriptTransactionRequest(params);
42844
+ request.addCoinOutput(Address.fromAddressOrString(destination), amount, assetIdToTransfer);
42845
+ const { maxFee, requiredQuantities, gasUsed, estimatedInputs } = await this.provider.getTransactionCost(request, [], {
43109
42846
  estimateTxDependencies: true,
43110
42847
  resourcesOwner: this
43111
42848
  });
43112
- if ("gasLimit" in txParams) {
43113
- this.validateGas({
43114
- gasUsed: txCost.gasUsed,
43115
- gasLimit: request.gasLimit
43116
- });
43117
- }
43118
- request.gasLimit = txCost.gasUsed;
43119
- request.maxFee = txCost.maxFee;
43120
- await this.fund(request, txCost);
42849
+ request.gasPrice = bn(txParams.gasPrice ?? minGasPrice);
42850
+ request.gasLimit = bn(txParams.gasLimit ?? gasUsed);
42851
+ this.validateGas({
42852
+ gasUsed,
42853
+ gasPrice: request.gasPrice,
42854
+ gasLimit: request.gasLimit,
42855
+ minGasPrice
42856
+ });
42857
+ await this.fund(request, requiredQuantities, maxFee);
42858
+ request.updatePredicateInputs(estimatedInputs);
43121
42859
  return request;
43122
42860
  }
43123
42861
  /**
@@ -43129,14 +42867,15 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43129
42867
  * @param txParams - The transaction parameters (gasLimit, gasPrice, maturity).
43130
42868
  * @returns A promise that resolves to the transaction response.
43131
42869
  */
43132
- async transfer(destination, amount, assetId = BaseAssetId, txParams = {}) {
42870
+ async transfer(destination, amount, assetId, txParams = {}) {
43133
42871
  if (bn(amount).lte(0)) {
43134
42872
  throw new FuelError(
43135
42873
  ErrorCode.INVALID_TRANSFER_AMOUNT,
43136
42874
  "Transfer amount must be a positive number."
43137
42875
  );
43138
42876
  }
43139
- const request = await this.createTransfer(destination, amount, assetId, txParams);
42877
+ const assetIdToTransfer = assetId ?? this.provider.getBaseAssetId();
42878
+ const request = await this.createTransfer(destination, amount, assetIdToTransfer, txParams);
43140
42879
  return this.sendTransaction(request, { estimateTxDependencies: false });
43141
42880
  }
43142
42881
  /**
@@ -43148,7 +42887,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43148
42887
  * @param txParams - The optional transaction parameters.
43149
42888
  * @returns A promise that resolves to the transaction response.
43150
42889
  */
43151
- async transferToContract(contractId, amount, assetId = BaseAssetId, txParams = {}) {
42890
+ async transferToContract(contractId, amount, assetId, txParams = {}) {
43152
42891
  if (bn(amount).lte(0)) {
43153
42892
  throw new FuelError(
43154
42893
  ErrorCode.INVALID_TRANSFER_AMOUNT,
@@ -43156,30 +42895,33 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43156
42895
  );
43157
42896
  }
43158
42897
  const contractAddress = Address.fromAddressOrString(contractId);
42898
+ const { minGasPrice } = this.provider.getGasConfig();
42899
+ const baseAssetId = this.provider.getBaseAssetId();
42900
+ const assetIdToTransfer = assetId ?? this.provider.getBaseAssetId();
42901
+ const params = { gasPrice: minGasPrice, baseAssetId, ...txParams };
43159
42902
  const { script, scriptData } = await assembleTransferToContractScript({
43160
42903
  hexlifiedContractId: contractAddress.toB256(),
43161
42904
  amountToTransfer: bn(amount),
43162
- assetId
42905
+ assetId: assetIdToTransfer
43163
42906
  });
43164
42907
  const request = new ScriptTransactionRequest({
43165
- ...txParams,
42908
+ ...params,
43166
42909
  script,
43167
42910
  scriptData
43168
42911
  });
43169
42912
  request.addContractInputAndOutput(contractAddress);
43170
- const txCost = await this.provider.getTransactionCost(request, {
43171
- resourcesOwner: this,
43172
- quantitiesToContract: [{ amount: bn(amount), assetId: String(assetId) }]
42913
+ const { maxFee, requiredQuantities, gasUsed } = await this.provider.getTransactionCost(
42914
+ request,
42915
+ [{ amount: bn(amount), assetId: String(assetIdToTransfer) }]
42916
+ );
42917
+ request.gasLimit = bn(params.gasLimit ?? gasUsed);
42918
+ this.validateGas({
42919
+ gasUsed,
42920
+ gasPrice: request.gasPrice,
42921
+ gasLimit: request.gasLimit,
42922
+ minGasPrice
43173
42923
  });
43174
- if (txParams.gasLimit) {
43175
- this.validateGas({
43176
- gasUsed: txCost.gasUsed,
43177
- gasLimit: request.gasLimit
43178
- });
43179
- }
43180
- request.gasLimit = txCost.gasUsed;
43181
- request.maxFee = txCost.maxFee;
43182
- await this.fund(request, txCost);
42924
+ await this.fund(request, requiredQuantities, maxFee);
43183
42925
  return this.sendTransaction(request);
43184
42926
  }
43185
42927
  /**
@@ -43191,6 +42933,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43191
42933
  * @returns A promise that resolves to the transaction response.
43192
42934
  */
43193
42935
  async withdrawToBaseLayer(recipient, amount, txParams = {}) {
42936
+ const { minGasPrice } = this.provider.getGasConfig();
42937
+ const baseAssetId = this.provider.getBaseAssetId();
43194
42938
  const recipientAddress = Address.fromAddressOrString(recipient);
43195
42939
  const recipientDataArray = arrayify(
43196
42940
  "0x".concat(recipientAddress.toHexString().substring(2).padStart(64, "0"))
@@ -43203,19 +42947,25 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43203
42947
  ...recipientDataArray,
43204
42948
  ...amountDataArray
43205
42949
  ]);
43206
- const params = { script, ...txParams };
42950
+ const params = {
42951
+ script,
42952
+ gasPrice: minGasPrice,
42953
+ ...txParams
42954
+ };
43207
42955
  const request = new ScriptTransactionRequest(params);
43208
- const quantitiesToContract = [{ amount: bn(amount), assetId: BaseAssetId }];
43209
- const txCost = await this.provider.getTransactionCost(request, { quantitiesToContract });
43210
- if (txParams.gasLimit) {
43211
- this.validateGas({
43212
- gasUsed: txCost.gasUsed,
43213
- gasLimit: request.gasLimit
43214
- });
43215
- }
43216
- request.maxFee = txCost.maxFee;
43217
- request.gasLimit = txCost.gasUsed;
43218
- await this.fund(request, txCost);
42956
+ const forwardingQuantities = [{ amount: bn(amount), assetId: baseAssetId }];
42957
+ const { requiredQuantities, maxFee, gasUsed } = await this.provider.getTransactionCost(
42958
+ request,
42959
+ forwardingQuantities
42960
+ );
42961
+ request.gasLimit = bn(params.gasLimit ?? gasUsed);
42962
+ this.validateGas({
42963
+ gasUsed,
42964
+ gasPrice: request.gasPrice,
42965
+ gasLimit: request.gasLimit,
42966
+ minGasPrice
42967
+ });
42968
+ await this.fund(request, requiredQuantities, maxFee);
43219
42969
  return this.sendTransaction(request);
43220
42970
  }
43221
42971
  async signMessage(message) {
@@ -43273,7 +43023,18 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43273
43023
  }
43274
43024
  return this.provider.simulate(transactionRequest, { estimateTxDependencies: false });
43275
43025
  }
43276
- validateGas({ gasUsed, gasLimit }) {
43026
+ validateGas({
43027
+ gasUsed,
43028
+ gasPrice,
43029
+ gasLimit,
43030
+ minGasPrice
43031
+ }) {
43032
+ if (minGasPrice.gt(gasPrice)) {
43033
+ throw new FuelError(
43034
+ ErrorCode.GAS_PRICE_TOO_LOW,
43035
+ `Gas price '${gasPrice}' is lower than the required: '${minGasPrice}'.`
43036
+ );
43037
+ }
43277
43038
  if (gasUsed.gt(gasLimit)) {
43278
43039
  throw new FuelError(
43279
43040
  ErrorCode.GAS_LIMIT_TOO_LOW,
@@ -44862,7 +44623,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44862
44623
  * @param transactionRequestLike - The transaction request to send.
44863
44624
  * @returns A promise that resolves to the TransactionResponse object.
44864
44625
  */
44865
- async sendTransaction(transactionRequestLike, { estimateTxDependencies = false, awaitExecution } = {}) {
44626
+ async sendTransaction(transactionRequestLike, { estimateTxDependencies = true, awaitExecution } = {}) {
44866
44627
  const transactionRequest = transactionRequestify(transactionRequestLike);
44867
44628
  if (estimateTxDependencies) {
44868
44629
  await this.provider.estimateTxDependencies(transactionRequest);
@@ -48140,8 +47901,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
48140
47901
  const { policies } = BaseTransactionRequest.getPolicyMeta(request);
48141
47902
  request.inputs?.forEach((input) => {
48142
47903
  if (input.type === InputType.Coin && hexlify(input.owner) === this.address.toB256()) {
48143
- input.predicate = hexlify(this.bytes);
48144
- input.predicateData = hexlify(this.getPredicateData(policies.length));
47904
+ input.predicate = this.bytes;
47905
+ input.predicateData = this.getPredicateData(policies.length);
48145
47906
  }
48146
47907
  });
48147
47908
  return request;
@@ -48155,8 +47916,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
48155
47916
  * @param txParams - The transaction parameters (gasLimit, gasPrice, maturity).
48156
47917
  * @returns A promise that resolves to the prepared transaction request.
48157
47918
  */
48158
- async createTransfer(destination, amount, assetId = BaseAssetId, txParams = {}) {
48159
- return super.createTransfer(destination, amount, assetId, txParams);
47919
+ async createTransfer(destination, amount, assetId, txParams = {}) {
47920
+ const assetIdToTransfer = assetId ?? this.provider.getBaseAssetId();
47921
+ const request = await super.createTransfer(destination, amount, assetIdToTransfer, txParams);
47922
+ return this.populateTransactionPredicateData(request);
48160
47923
  }
48161
47924
  /**
48162
47925
  * Sends a transaction with the populated predicate data.
@@ -48164,9 +47927,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
48164
47927
  * @param transactionRequestLike - The transaction request-like object.
48165
47928
  * @returns A promise that resolves to the transaction response.
48166
47929
  */
48167
- sendTransaction(transactionRequestLike) {
48168
- const transactionRequest = transactionRequestify(transactionRequestLike);
48169
- return super.sendTransaction(transactionRequest, { estimateTxDependencies: false });
47930
+ sendTransaction(transactionRequestLike, options) {
47931
+ const transactionRequest = this.populateTransactionPredicateData(transactionRequestLike);
47932
+ return super.sendTransaction(transactionRequest, options);
48170
47933
  }
48171
47934
  /**
48172
47935
  * Simulates a transaction with the populated predicate data.
@@ -48175,8 +47938,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
48175
47938
  * @returns A promise that resolves to the call result.
48176
47939
  */
48177
47940
  simulateTransaction(transactionRequestLike) {
48178
- const transactionRequest = transactionRequestify(transactionRequestLike);
48179
- return super.simulateTransaction(transactionRequest, { estimateTxDependencies: false });
47941
+ const transactionRequest = this.populateTransactionPredicateData(transactionRequestLike);
47942
+ return super.simulateTransaction(transactionRequest);
48180
47943
  }
48181
47944
  getPredicateData(policiesLength) {
48182
47945
  if (!this.predicateData.length) {
@@ -48222,25 +47985,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
48222
47985
  predicateInterface: abiInterface
48223
47986
  };
48224
47987
  }
48225
- /**
48226
- * Retrieves resources satisfying the spend query for the account.
48227
- *
48228
- * @param quantities - IDs of coins to exclude.
48229
- * @param excludedIds - IDs of resources to be excluded from the query.
48230
- * @returns A promise that resolves to an array of Resources.
48231
- */
48232
- async getResourcesToSpend(quantities, excludedIds) {
48233
- const resources = await this.provider.getResourcesToSpend(
48234
- this.address,
48235
- quantities,
48236
- excludedIds
48237
- );
48238
- return resources.map((resource) => ({
48239
- ...resource,
48240
- predicate: hexlify(this.bytes),
48241
- paddPredicateData: (policiesLength) => hexlify(this.getPredicateData(policiesLength))
48242
- }));
48243
- }
48244
47988
  /**
48245
47989
  * Sets the configurable constants for the predicate.
48246
47990
  *