@fuel-ts/account 0.82.0 → 0.83.0

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

Potentially problematic release.


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

Files changed (57) hide show
  1. package/README.md +3 -3
  2. package/dist/account.d.ts +7 -6
  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 +872 -617
  12. package/dist/index.global.js.map +1 -1
  13. package/dist/index.js +853 -604
  14. package/dist/index.js.map +1 -1
  15. package/dist/index.mjs +696 -448
  16. package/dist/index.mjs.map +1 -1
  17. package/dist/predicate/predicate.d.ts +12 -24
  18. package/dist/predicate/predicate.d.ts.map +1 -1
  19. package/dist/providers/__generated__/operations.d.ts +810 -359
  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 +4 -2
  24. package/dist/providers/coin.d.ts.map +1 -1
  25. package/dist/providers/message.d.ts +7 -1
  26. package/dist/providers/message.d.ts.map +1 -1
  27. package/dist/providers/provider.d.ts +44 -27
  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 +13 -33
  35. package/dist/providers/transaction-request/transaction-request.d.ts.map +1 -1
  36. package/dist/providers/transaction-request/utils.d.ts +3 -0
  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 +2 -0
  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 +3 -2
  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 +8 -2
  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 +1 -1
  49. package/dist/test-utils/launchNode.d.ts.map +1 -1
  50. package/dist/test-utils.global.js +1597 -1112
  51. package/dist/test-utils.global.js.map +1 -1
  52. package/dist/test-utils.js +841 -596
  53. package/dist/test-utils.js.map +1 -1
  54. package/dist/test-utils.mjs +696 -451
  55. package/dist/test-utils.mjs.map +1 -1
  56. package/dist/wallet/base-wallet-unlocked.d.ts.map +1 -1
  57. package/package.json +16 -16
@@ -280,7 +280,7 @@
280
280
  }
281
281
  return num !== null && typeof num === "object" && num.constructor.wordSize === BN2.wordSize && Array.isArray(num.words);
282
282
  };
283
- BN2.max = function max2(left, right) {
283
+ BN2.max = function max(left, right) {
284
284
  if (left.cmp(right) > 0)
285
285
  return left;
286
286
  return right;
@@ -5104,7 +5104,7 @@
5104
5104
  function isBlob(obj) {
5105
5105
  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]);
5106
5106
  }
5107
- function clone(instance) {
5107
+ function clone3(instance) {
5108
5108
  let p1, p2;
5109
5109
  let body = instance.body;
5110
5110
  if (instance.bodyUsed) {
@@ -6038,7 +6038,7 @@
6038
6038
  * @return Response
6039
6039
  */
6040
6040
  clone() {
6041
- return new Response2(clone(this), {
6041
+ return new Response2(clone3(this), {
6042
6042
  url: this.url,
6043
6043
  status: this.status,
6044
6044
  statusText: this.statusText,
@@ -6088,7 +6088,7 @@
6088
6088
  if ((init.body != null || isRequest(input) && input.body !== null) && (method === "GET" || method === "HEAD")) {
6089
6089
  throw new TypeError("Request with GET/HEAD method cannot have body");
6090
6090
  }
6091
- let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
6091
+ let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone3(input) : null;
6092
6092
  Body.call(this, inputBody, {
6093
6093
  timeout: init.timeout || input.timeout || 0,
6094
6094
  size: init.size || input.size || 0
@@ -31914,9 +31914,9 @@ spurious results.`);
31914
31914
  // ../versions/dist/index.mjs
31915
31915
  function getBuiltinVersions() {
31916
31916
  return {
31917
- FORC: "0.49.3",
31918
- FUEL_CORE: "0.22.1",
31919
- FUELS: "0.82.0"
31917
+ FORC: "0.56.0",
31918
+ FUEL_CORE: "0.24.3",
31919
+ FUELS: "0.83.0"
31920
31920
  };
31921
31921
  }
31922
31922
  function parseVersion(version2) {
@@ -32015,6 +32015,7 @@ This unreleased fuel-core build may include features and updates not yet support
32015
32015
  ErrorCode2["INVALID_TRANSFER_AMOUNT"] = "invalid-transfer-amount";
32016
32016
  ErrorCode2["GAS_PRICE_TOO_LOW"] = "gas-price-too-low";
32017
32017
  ErrorCode2["GAS_LIMIT_TOO_LOW"] = "gas-limit-too-low";
32018
+ ErrorCode2["MAX_FEE_TOO_LOW"] = "max-fee-too-low";
32018
32019
  ErrorCode2["TRANSACTION_NOT_FOUND"] = "transaction-not-found";
32019
32020
  ErrorCode2["TRANSACTION_FAILED"] = "transaction-failed";
32020
32021
  ErrorCode2["INVALID_CONFIGURABLE_CONSTANTS"] = "invalid-configurable-constants";
@@ -32193,521 +32194,757 @@ This unreleased fuel-core build may include features and updates not yet support
32193
32194
  __publicField3(DateTime, "TAI64_NULL", "");
32194
32195
  var chainConfig_default = {
32195
32196
  chain_name: "local_testnet",
32196
- block_gas_limit: 5e9,
32197
- initial_state: {
32198
- coins: [
32199
- {
32200
- owner: "0x94ffcc53b892684acefaebc8a3d4a595e528a8cf664eeb3ef36f1020b0809d0d",
32201
- amount: "0xFFFFFFFFFFFFFFFF",
32202
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32203
- },
32204
- {
32205
- owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
32206
- amount: "0xFFFFFFFFFFFFFFFF",
32207
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32208
- },
32209
- {
32210
- owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
32211
- amount: "0xFFFFFFFFFFFFFFFF",
32212
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32213
- },
32214
- {
32215
- owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
32216
- amount: "0xFFFFFFFFFFFFFFFF",
32217
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32218
- },
32219
- {
32220
- owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
32221
- amount: "0xFFFFFFFFFFFFFFFF",
32222
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32223
- },
32224
- {
32225
- owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
32226
- amount: "0xFFFFFFFFFFFFFFFF",
32227
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32228
- },
32229
- {
32230
- owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
32231
- amount: "0xFFFFFFFFFFFFFFFF",
32232
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32233
- },
32234
- {
32235
- owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
32236
- amount: "0xFFFFFFFFFFFFFFFF",
32237
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32238
- },
32239
- {
32240
- owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
32241
- amount: "0xFFFFFFFFFFFFFFFF",
32242
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32243
- },
32244
- {
32245
- owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
32246
- amount: "0xFFFFFFFFFFFFFFFF",
32247
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32248
- },
32249
- {
32250
- owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
32251
- amount: "0xFFFFFFFFFFFFFFFF",
32252
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32253
- },
32254
- {
32255
- owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
32256
- amount: "0xFFFFFFFFFFFFFFFF",
32257
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32258
- },
32259
- {
32260
- owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
32261
- amount: "0xFFFFFFFFFFFFFFFF",
32262
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32263
- },
32264
- {
32265
- owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
32266
- amount: "0xFFFFFFFFFFFFFFFF",
32267
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32268
- },
32269
- {
32270
- owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
32271
- amount: "0xFFFFFFFFFFFFFFFF",
32272
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32273
- },
32274
- {
32275
- owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
32276
- amount: "0xFFFFFFFFFFFFFFFF",
32277
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32278
- },
32279
- {
32280
- owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
32281
- amount: "0xFFFFFFFFFFFFFFFF",
32282
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32283
- },
32284
- {
32285
- owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
32286
- amount: "0xFFFFFFFFFFFFFFFF",
32287
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32288
- },
32289
- {
32290
- owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
32291
- amount: "0xFFFFFFFFFFFFFFFF",
32292
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32293
- },
32294
- {
32295
- owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
32296
- amount: "0xFFFFFFFFFFFFFFFF",
32297
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32298
- },
32299
- {
32300
- owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
32301
- amount: "0xFFFFFFFFFFFFFFFF",
32302
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32303
- },
32304
- {
32305
- owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
32306
- amount: "0xFFFFFFFFFFFFFFFF",
32307
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32308
- },
32309
- {
32310
- owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
32311
- amount: "0xFFFFFFFFFFFFFFFF",
32312
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32313
- },
32314
- {
32315
- owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
32316
- amount: "0xFFFFFFFFFFFFFFFF",
32317
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32318
- },
32319
- {
32320
- owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
32321
- amount: "0xFFFFFFFFFFFFFFFF",
32322
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32323
- },
32324
- {
32325
- owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
32326
- amount: "0xFFFFFFFFFFFFFFFF",
32327
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32328
- },
32329
- {
32330
- owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
32331
- amount: "0xFFFFFFFFFFFFFFFF",
32332
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32333
- },
32334
- {
32335
- owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
32336
- amount: "0xFFFFFFFFFFFFFFFF",
32337
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32338
- },
32339
- {
32340
- owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
32341
- amount: "0xFFFFFFFFFFFFFFFF",
32342
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32343
- },
32344
- {
32345
- owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
32346
- amount: "0xFFFFFFFFFFFFFFFF",
32347
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32348
- },
32349
- {
32350
- owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
32351
- amount: "0xFFFFFFFFFFFFFFFF",
32352
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32353
- },
32354
- {
32355
- owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
32356
- amount: "0xFFFFFFFFFFFFFFFF",
32357
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32358
- },
32359
- {
32360
- owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
32361
- amount: "0xFFFFFFFFFFFFFFFF",
32362
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32363
- },
32364
- {
32365
- owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
32366
- amount: "0xFFFFFFFFFFFFFFFF",
32367
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32368
- },
32369
- {
32370
- owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
32371
- amount: "0xFFFFFFFFFFFFFFFF",
32372
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32373
- },
32374
- {
32375
- owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
32376
- amount: "0xFFFFFFFFFFFFFFFF",
32377
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32378
- },
32379
- {
32380
- owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
32381
- amount: "0xFFFFFFFFFFFFFFFF",
32382
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32383
- },
32384
- {
32385
- owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
32386
- amount: "0xFFFFFFFFFFFFFFFF",
32387
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32388
- },
32389
- {
32390
- owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
32391
- amount: "0xFFFFFFFFFFFFFFFF",
32392
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32393
- },
32394
- {
32395
- owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
32396
- amount: "0xFFFFFFFFFFFFFFFF",
32397
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32398
- },
32399
- {
32400
- owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
32401
- amount: "0xFFFFFFFFFFFFFFFF",
32402
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32403
- },
32404
- {
32405
- owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
32406
- amount: "0xFFFFFFFFFFFFFFFF",
32407
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32408
- },
32409
- {
32410
- owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
32411
- amount: "0xFFFFFFFFFFFFFFFF",
32412
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32413
- },
32414
- {
32415
- owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
32416
- amount: "0xFFFFFFFFFFFFFFFF",
32417
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32418
- },
32419
- {
32420
- owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
32421
- amount: "0xFFFFFFFFFFFFFFFF",
32422
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32423
- },
32424
- {
32425
- owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
32426
- amount: "0xFFFFFFFFFFFFFFFF",
32427
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32428
- },
32429
- {
32430
- owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
32431
- amount: "0xFFFFFFFFFFFFFFFF",
32432
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32433
- },
32434
- {
32435
- owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
32436
- amount: "0xFFFFFFFFFFFFFFFF",
32437
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32438
- },
32439
- {
32440
- owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
32441
- amount: "0xFFFFFFFFFFFFFFFF",
32442
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32443
- }
32444
- ],
32445
- messages: [
32446
- {
32447
- sender: "0xc43454aa38dd91f88109a4b7aef5efb96ce34e3f24992fe0f81d233ca686f80f",
32448
- recipient: "0x69a2b736b60159b43bb8a4f98c0589f6da5fa3a3d101e8e269c499eb942753ba",
32449
- nonce: "0101010101010101010101010101010101010101010101010101010101010101",
32450
- amount: "0x000000000000FFFF",
32451
- data: "",
32452
- da_height: "0x00"
32197
+ consensus_parameters: {
32198
+ V1: {
32199
+ tx_params: {
32200
+ V1: {
32201
+ max_inputs: 255,
32202
+ max_outputs: 255,
32203
+ max_witnesses: 255,
32204
+ max_gas_per_tx: 3e7,
32205
+ max_size: 112640
32206
+ }
32207
+ },
32208
+ predicate_params: {
32209
+ V1: {
32210
+ max_predicate_length: 102400,
32211
+ max_predicate_data_length: 102400,
32212
+ max_message_data_length: 102400,
32213
+ max_gas_per_predicate: 3e7
32214
+ }
32215
+ },
32216
+ script_params: {
32217
+ V1: {
32218
+ max_script_length: 102400,
32219
+ max_script_data_length: 102400
32220
+ }
32221
+ },
32222
+ contract_params: {
32223
+ V1: {
32224
+ contract_max_size: 102400,
32225
+ max_storage_slots: 1760
32226
+ }
32227
+ },
32228
+ fee_params: {
32229
+ V1: {
32230
+ gas_price_factor: 92,
32231
+ gas_per_byte: 63
32232
+ }
32233
+ },
32234
+ chain_id: 0,
32235
+ gas_costs: {
32236
+ V1: {
32237
+ add: 2,
32238
+ addi: 2,
32239
+ aloc: 1,
32240
+ and: 2,
32241
+ andi: 2,
32242
+ bal: 366,
32243
+ bhei: 2,
32244
+ bhsh: 2,
32245
+ burn: 33949,
32246
+ cb: 2,
32247
+ cfei: 2,
32248
+ cfsi: 2,
32249
+ div: 2,
32250
+ divi: 2,
32251
+ eck1: 3347,
32252
+ ecr1: 46165,
32253
+ ed19: 4210,
32254
+ eq: 2,
32255
+ exp: 2,
32256
+ expi: 2,
32257
+ flag: 1,
32258
+ gm: 2,
32259
+ gt: 2,
32260
+ gtf: 16,
32261
+ ji: 2,
32262
+ jmp: 2,
32263
+ jne: 2,
32264
+ jnei: 2,
32265
+ jnzi: 2,
32266
+ jmpf: 2,
32267
+ jmpb: 2,
32268
+ jnzf: 2,
32269
+ jnzb: 2,
32270
+ jnef: 2,
32271
+ jneb: 2,
32272
+ lb: 2,
32273
+ log: 754,
32274
+ lt: 2,
32275
+ lw: 2,
32276
+ mint: 35718,
32277
+ mlog: 2,
32278
+ mod: 2,
32279
+ modi: 2,
32280
+ move: 2,
32281
+ movi: 2,
32282
+ mroo: 5,
32283
+ mul: 2,
32284
+ muli: 2,
32285
+ mldv: 4,
32286
+ noop: 1,
32287
+ not: 2,
32288
+ or: 2,
32289
+ ori: 2,
32290
+ poph: 3,
32291
+ popl: 3,
32292
+ pshh: 4,
32293
+ pshl: 4,
32294
+ ret_contract: 733,
32295
+ rvrt_contract: 722,
32296
+ sb: 2,
32297
+ sll: 2,
32298
+ slli: 2,
32299
+ srl: 2,
32300
+ srli: 2,
32301
+ srw: 253,
32302
+ sub: 2,
32303
+ subi: 2,
32304
+ sw: 2,
32305
+ sww: 29053,
32306
+ time: 79,
32307
+ tr: 46242,
32308
+ tro: 33251,
32309
+ wdcm: 3,
32310
+ wqcm: 3,
32311
+ wdop: 3,
32312
+ wqop: 3,
32313
+ wdml: 3,
32314
+ wqml: 4,
32315
+ wddv: 5,
32316
+ wqdv: 7,
32317
+ wdmd: 11,
32318
+ wqmd: 18,
32319
+ wdam: 9,
32320
+ wqam: 12,
32321
+ wdmm: 11,
32322
+ wqmm: 11,
32323
+ xor: 2,
32324
+ xori: 2,
32325
+ call: {
32326
+ LightOperation: {
32327
+ base: 21687,
32328
+ units_per_gas: 4
32329
+ }
32330
+ },
32331
+ ccp: {
32332
+ LightOperation: {
32333
+ base: 59,
32334
+ units_per_gas: 20
32335
+ }
32336
+ },
32337
+ croo: {
32338
+ LightOperation: {
32339
+ base: 1,
32340
+ units_per_gas: 1
32341
+ }
32342
+ },
32343
+ csiz: {
32344
+ LightOperation: {
32345
+ base: 59,
32346
+ units_per_gas: 195
32347
+ }
32348
+ },
32349
+ k256: {
32350
+ LightOperation: {
32351
+ base: 282,
32352
+ units_per_gas: 3
32353
+ }
32354
+ },
32355
+ ldc: {
32356
+ LightOperation: {
32357
+ base: 45,
32358
+ units_per_gas: 65
32359
+ }
32360
+ },
32361
+ logd: {
32362
+ LightOperation: {
32363
+ base: 1134,
32364
+ units_per_gas: 2
32365
+ }
32366
+ },
32367
+ mcl: {
32368
+ LightOperation: {
32369
+ base: 3,
32370
+ units_per_gas: 523
32371
+ }
32372
+ },
32373
+ mcli: {
32374
+ LightOperation: {
32375
+ base: 3,
32376
+ units_per_gas: 526
32377
+ }
32378
+ },
32379
+ mcp: {
32380
+ LightOperation: {
32381
+ base: 3,
32382
+ units_per_gas: 448
32383
+ }
32384
+ },
32385
+ mcpi: {
32386
+ LightOperation: {
32387
+ base: 7,
32388
+ units_per_gas: 585
32389
+ }
32390
+ },
32391
+ meq: {
32392
+ LightOperation: {
32393
+ base: 11,
32394
+ units_per_gas: 1097
32395
+ }
32396
+ },
32397
+ retd_contract: {
32398
+ LightOperation: {
32399
+ base: 1086,
32400
+ units_per_gas: 2
32401
+ }
32402
+ },
32403
+ s256: {
32404
+ LightOperation: {
32405
+ base: 45,
32406
+ units_per_gas: 3
32407
+ }
32408
+ },
32409
+ scwq: {
32410
+ HeavyOperation: {
32411
+ base: 30375,
32412
+ gas_per_unit: 28628
32413
+ }
32414
+ },
32415
+ smo: {
32416
+ LightOperation: {
32417
+ base: 64196,
32418
+ units_per_gas: 1
32419
+ }
32420
+ },
32421
+ srwq: {
32422
+ HeavyOperation: {
32423
+ base: 262,
32424
+ gas_per_unit: 249
32425
+ }
32426
+ },
32427
+ swwq: {
32428
+ HeavyOperation: {
32429
+ base: 28484,
32430
+ gas_per_unit: 26613
32431
+ }
32432
+ },
32433
+ contract_root: {
32434
+ LightOperation: {
32435
+ base: 45,
32436
+ units_per_gas: 1
32437
+ }
32438
+ },
32439
+ state_root: {
32440
+ HeavyOperation: {
32441
+ base: 350,
32442
+ gas_per_unit: 176
32443
+ }
32444
+ },
32445
+ new_storage_per_byte: 63,
32446
+ vm_initialization: {
32447
+ LightOperation: {
32448
+ base: 1645,
32449
+ units_per_gas: 14
32450
+ }
32451
+ }
32452
+ }
32453
32453
  },
32454
- {
32455
- sender: "0x69a2b736b60159b43bb8a4f98c0589f6da5fa3a3d101e8e269c499eb942753ba",
32456
- recipient: "0xc43454aa38dd91f88109a4b7aef5efb96ce34e3f24992fe0f81d233ca686f80f",
32457
- nonce: "0e1ef2963832068b0e1ef2963832068b0e1ef2963832068b0e1ef2963832068b",
32458
- amount: "0xb04f3c08f59b309e",
32459
- data: "",
32460
- da_height: "0x00"
32461
- }
32462
- ]
32454
+ base_asset_id: "0000000000000000000000000000000000000000000000000000000000000000",
32455
+ block_gas_limit: 3e7,
32456
+ privileged_address: "0000000000000000000000000000000000000000000000000000000000000000"
32457
+ }
32463
32458
  },
32464
- consensus_parameters: {
32465
- tx_params: {
32466
- max_inputs: 255,
32467
- max_outputs: 255,
32468
- max_witnesses: 255,
32469
- max_gas_per_tx: 1e7,
32470
- max_size: 17825792
32459
+ consensus: {
32460
+ PoA: {
32461
+ signing_key: "0x94ffcc53b892684acefaebc8a3d4a595e528a8cf664eeb3ef36f1020b0809d0d"
32462
+ }
32463
+ }
32464
+ };
32465
+ var metadata_default = {
32466
+ chain_config: "chainConfig.json",
32467
+ table_encoding: {
32468
+ Json: {
32469
+ filepath: "stateConfig.json"
32470
+ }
32471
+ }
32472
+ };
32473
+ var stateConfig_default = {
32474
+ coins: [
32475
+ {
32476
+ tx_id: "0x260eabfd50937e92939fd92687e9302a72e91c5065f64f853f2ccbe02396fe09d665",
32477
+ output_index: 0,
32478
+ tx_pointer_block_height: 0,
32479
+ tx_pointer_tx_idx: 0,
32480
+ owner: "0x94ffcc53b892684acefaebc8a3d4a595e528a8cf664eeb3ef36f1020b0809d0d",
32481
+ amount: 18446744073709552e3,
32482
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32471
32483
  },
32472
- predicate_params: {
32473
- max_predicate_length: 1048576,
32474
- max_predicate_data_length: 1048576,
32475
- max_gas_per_predicate: 1e7,
32476
- max_message_data_length: 1048576
32484
+ {
32485
+ tx_id: "0x2a757c2317236f7883ac9bbbf7d402f034e0b725c544ef1c8725b1d2bd960f8c690f",
32486
+ output_index: 0,
32487
+ tx_pointer_block_height: 0,
32488
+ tx_pointer_tx_idx: 0,
32489
+ owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
32490
+ amount: 18446744073709552e3,
32491
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32477
32492
  },
32478
- script_params: {
32479
- max_script_length: 1048576,
32480
- max_script_data_length: 1048576
32493
+ {
32494
+ tx_id: "0x634ef6cda00bac63992bbde80c6d694d484d58025a5ca0c9c848f0d35a5a3eee74b2",
32495
+ output_index: 0,
32496
+ tx_pointer_block_height: 0,
32497
+ tx_pointer_tx_idx: 0,
32498
+ owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
32499
+ amount: 18446744073709552e3,
32500
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32481
32501
  },
32482
- contract_params: {
32483
- contract_max_size: 16777216,
32484
- max_storage_slots: 255
32502
+ {
32503
+ tx_id: "0xd3543bb1da137a7987a96a1bb71681fdd195ff25318c0d4a923aa30eb27ffa80bc7b",
32504
+ output_index: 0,
32505
+ tx_pointer_block_height: 0,
32506
+ tx_pointer_tx_idx: 0,
32507
+ owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
32508
+ amount: 18446744073709552e3,
32509
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32485
32510
  },
32486
- fee_params: {
32487
- gas_price_factor: 92,
32488
- gas_per_byte: 4
32489
- }
32490
- },
32491
- gas_costs: {
32492
- add: 1,
32493
- addi: 1,
32494
- aloc: 1,
32495
- and: 1,
32496
- andi: 1,
32497
- bal: 13,
32498
- bhei: 1,
32499
- bhsh: 1,
32500
- burn: 132,
32501
- cb: 1,
32502
- cfei: 1,
32503
- cfsi: 1,
32504
- croo: 16,
32505
- div: 1,
32506
- divi: 1,
32507
- ecr1: 3e3,
32508
- eck1: 951,
32509
- ed19: 3e3,
32510
- eq: 1,
32511
- exp: 1,
32512
- expi: 1,
32513
- flag: 1,
32514
- gm: 1,
32515
- gt: 1,
32516
- gtf: 1,
32517
- ji: 1,
32518
- jmp: 1,
32519
- jne: 1,
32520
- jnei: 1,
32521
- jnzi: 1,
32522
- jmpf: 1,
32523
- jmpb: 1,
32524
- jnzf: 1,
32525
- jnzb: 1,
32526
- jnef: 1,
32527
- jneb: 1,
32528
- lb: 1,
32529
- log: 9,
32530
- lt: 1,
32531
- lw: 1,
32532
- mint: 135,
32533
- mlog: 1,
32534
- modOp: 1,
32535
- modi: 1,
32536
- moveOp: 1,
32537
- movi: 1,
32538
- mroo: 2,
32539
- mul: 1,
32540
- muli: 1,
32541
- mldv: 1,
32542
- noop: 1,
32543
- not: 1,
32544
- or: 1,
32545
- ori: 1,
32546
- poph: 2,
32547
- popl: 2,
32548
- pshh: 2,
32549
- pshl: 2,
32550
- ret: 13,
32551
- rvrt: 13,
32552
- sb: 1,
32553
- sll: 1,
32554
- slli: 1,
32555
- srl: 1,
32556
- srli: 1,
32557
- srw: 12,
32558
- sub: 1,
32559
- subi: 1,
32560
- sw: 1,
32561
- sww: 67,
32562
- time: 1,
32563
- tr: 105,
32564
- tro: 60,
32565
- wdcm: 1,
32566
- wqcm: 1,
32567
- wdop: 1,
32568
- wqop: 1,
32569
- wdml: 1,
32570
- wqml: 1,
32571
- wddv: 1,
32572
- wqdv: 2,
32573
- wdmd: 3,
32574
- wqmd: 4,
32575
- wdam: 2,
32576
- wqam: 3,
32577
- wdmm: 3,
32578
- wqmm: 3,
32579
- xor: 1,
32580
- xori: 1,
32581
- call: {
32582
- LightOperation: {
32583
- base: 144,
32584
- units_per_gas: 214
32585
- }
32511
+ {
32512
+ tx_id: "0xa4d42cbb02adb32f5f3a9eab33a0ee7bdab8910ad9f615dfc86a7bb9e49a732bc58c",
32513
+ output_index: 0,
32514
+ tx_pointer_block_height: 0,
32515
+ tx_pointer_tx_idx: 0,
32516
+ owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
32517
+ amount: 18446744073709552e3,
32518
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32586
32519
  },
32587
- ccp: {
32588
- LightOperation: {
32589
- base: 15,
32590
- units_per_gas: 103
32591
- }
32520
+ {
32521
+ tx_id: "0xc197cb09b1d89a7862b238e9500631bd43f291aadb7ff55c8129335349634e9fde3f",
32522
+ output_index: 0,
32523
+ tx_pointer_block_height: 0,
32524
+ tx_pointer_tx_idx: 0,
32525
+ owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
32526
+ amount: 18446744073709552e3,
32527
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32592
32528
  },
32593
- csiz: {
32594
- LightOperation: {
32595
- base: 17,
32596
- units_per_gas: 790
32597
- }
32529
+ {
32530
+ tx_id: "0x4c4fc2451b9a9b16c520c1b89ec8968ce46823dd0396d84f7e3155861352fdce12c5",
32531
+ output_index: 0,
32532
+ tx_pointer_block_height: 0,
32533
+ tx_pointer_tx_idx: 0,
32534
+ owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
32535
+ amount: 18446744073709552e3,
32536
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32598
32537
  },
32599
- k256: {
32600
- LightOperation: {
32601
- base: 11,
32602
- units_per_gas: 214
32603
- }
32538
+ {
32539
+ tx_id: "0x68df8f08555086a1ab45591e6fe4bf2f538bcb80dd519108030b7e886d6a230c2531",
32540
+ output_index: 0,
32541
+ tx_pointer_block_height: 0,
32542
+ tx_pointer_tx_idx: 0,
32543
+ owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
32544
+ amount: 18446744073709552e3,
32545
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32604
32546
  },
32605
- ldc: {
32606
- LightOperation: {
32607
- base: 15,
32608
- units_per_gas: 272
32609
- }
32547
+ {
32548
+ tx_id: "0x1b9bdaa290518373eb905e45ce7fcb89acedd24341ca7749ad47a938e4bf3ca9b7ce",
32549
+ output_index: 0,
32550
+ tx_pointer_block_height: 0,
32551
+ tx_pointer_tx_idx: 0,
32552
+ owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
32553
+ amount: 18446744073709552e3,
32554
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32610
32555
  },
32611
- logd: {
32612
- LightOperation: {
32613
- base: 26,
32614
- units_per_gas: 64
32615
- }
32556
+ {
32557
+ tx_id: "0xa5a2e9db3d1285337fe1183dc1eabe8f9cdcd470daf95cd5c522bbae292f53977f26",
32558
+ output_index: 0,
32559
+ tx_pointer_block_height: 0,
32560
+ tx_pointer_tx_idx: 0,
32561
+ owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
32562
+ amount: 18446744073709552e3,
32563
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32616
32564
  },
32617
- mcl: {
32618
- LightOperation: {
32619
- base: 1,
32620
- units_per_gas: 3333
32621
- }
32565
+ {
32566
+ tx_id: "0x13b685a1ea7c56309a92d69dd7e4808987ec90d62a1f9c9f2ec18e54746855c8c93c",
32567
+ output_index: 0,
32568
+ tx_pointer_block_height: 0,
32569
+ tx_pointer_tx_idx: 0,
32570
+ owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
32571
+ amount: 18446744073709552e3,
32572
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32622
32573
  },
32623
- mcli: {
32624
- LightOperation: {
32625
- base: 1,
32626
- units_per_gas: 3333
32627
- }
32574
+ {
32575
+ tx_id: "0xf8f00a234cf3fbab86befc3fd9346d7fd1ac085233c9cb58c7447f30c75cbf87ed38",
32576
+ output_index: 0,
32577
+ tx_pointer_block_height: 0,
32578
+ tx_pointer_tx_idx: 0,
32579
+ owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
32580
+ amount: 18446744073709552e3,
32581
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32628
32582
  },
32629
- mcp: {
32630
- LightOperation: {
32631
- base: 1,
32632
- units_per_gas: 2e3
32633
- }
32583
+ {
32584
+ tx_id: "0x2a36c870f624b60fbd6f2b71332ca7f704c69296ceae4ddbf3a8ede79408088934be",
32585
+ output_index: 0,
32586
+ tx_pointer_block_height: 0,
32587
+ tx_pointer_tx_idx: 0,
32588
+ owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
32589
+ amount: 18446744073709552e3,
32590
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32634
32591
  },
32635
- mcpi: {
32636
- LightOperation: {
32637
- base: 3,
32638
- units_per_gas: 2e3
32639
- }
32592
+ {
32593
+ tx_id: "0x9cd180d41e67a422da8a7683f036b463a7ed7efc0de31c1692adac90decbfebce78c",
32594
+ output_index: 0,
32595
+ tx_pointer_block_height: 0,
32596
+ tx_pointer_tx_idx: 0,
32597
+ owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
32598
+ amount: 18446744073709552e3,
32599
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32640
32600
  },
32641
- meq: {
32642
- LightOperation: {
32643
- base: 1,
32644
- units_per_gas: 2500
32645
- }
32601
+ {
32602
+ tx_id: "0xfeb4f2388fa22e6613ff85cf4e655f58acdfaa6299eba7f93b812cd1f0d7bbac48f0",
32603
+ output_index: 0,
32604
+ tx_pointer_block_height: 0,
32605
+ tx_pointer_tx_idx: 0,
32606
+ owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
32607
+ amount: 18446744073709552e3,
32608
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32646
32609
  },
32647
- retd: {
32648
- LightOperation: {
32649
- base: 29,
32650
- units_per_gas: 62
32651
- }
32610
+ {
32611
+ tx_id: "0xc4d20299f43358dc32ab853f6631340b09278511b6adbaf34597ade6ef37efd018f1",
32612
+ output_index: 0,
32613
+ tx_pointer_block_height: 0,
32614
+ tx_pointer_tx_idx: 0,
32615
+ owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
32616
+ amount: 18446744073709552e3,
32617
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32652
32618
  },
32653
- s256: {
32654
- LightOperation: {
32655
- base: 2,
32656
- units_per_gas: 214
32657
- }
32619
+ {
32620
+ tx_id: "0x437291414110b0aebaa8be5c0d9ff1e97d1130a24a6c9e028f2b1f6b0576be6aa961",
32621
+ output_index: 0,
32622
+ tx_pointer_block_height: 0,
32623
+ tx_pointer_tx_idx: 0,
32624
+ owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
32625
+ amount: 18446744073709552e3,
32626
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32658
32627
  },
32659
- scwq: {
32660
- LightOperation: {
32661
- base: 13,
32662
- units_per_gas: 5
32663
- }
32628
+ {
32629
+ tx_id: "0x28131b9acc90c2058ee14f4094a474146ba5b779cb9021867164b3d41abad3d047a7",
32630
+ output_index: 0,
32631
+ tx_pointer_block_height: 0,
32632
+ tx_pointer_tx_idx: 0,
32633
+ owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
32634
+ amount: 18446744073709552e3,
32635
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32664
32636
  },
32665
- smo: {
32666
- LightOperation: {
32667
- base: 209,
32668
- units_per_gas: 55
32669
- }
32637
+ {
32638
+ tx_id: "0x033bb5f9b0e4f530d50af3a0f12dd510f799af495ef88baea3cf854a37da728d214b",
32639
+ output_index: 0,
32640
+ tx_pointer_block_height: 0,
32641
+ tx_pointer_tx_idx: 0,
32642
+ owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
32643
+ amount: 18446744073709552e3,
32644
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32670
32645
  },
32671
- srwq: {
32672
- LightOperation: {
32673
- base: 47,
32674
- units_per_gas: 5
32675
- }
32646
+ {
32647
+ tx_id: "0x460591398552eca338dd9577f362b91b0f9297f308258734870350004dcc303c67e9",
32648
+ output_index: 0,
32649
+ tx_pointer_block_height: 0,
32650
+ tx_pointer_tx_idx: 0,
32651
+ owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
32652
+ amount: 18446744073709552e3,
32653
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32676
32654
  },
32677
- swwq: {
32678
- LightOperation: {
32679
- base: 44,
32680
- units_per_gas: 5
32681
- }
32655
+ {
32656
+ tx_id: "0x447a7c37aee972dcba72f05255c5145dd63125f0fc46ef98c216f775ee0421e23d2b",
32657
+ output_index: 0,
32658
+ tx_pointer_block_height: 0,
32659
+ tx_pointer_tx_idx: 0,
32660
+ owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
32661
+ amount: 18446744073709552e3,
32662
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32682
32663
  },
32683
- contract_root: {
32684
- LightOperation: {
32685
- base: 75,
32686
- units_per_gas: 1
32687
- }
32664
+ {
32665
+ tx_id: "0xf4a5d727606260c7ac6333fa89e7aef474df8a13326716d4d02f6392ebb7b997d268",
32666
+ output_index: 0,
32667
+ tx_pointer_block_height: 0,
32668
+ tx_pointer_tx_idx: 0,
32669
+ owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
32670
+ amount: 18446744073709552e3,
32671
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32688
32672
  },
32689
- state_root: {
32690
- LightOperation: {
32691
- base: 412,
32692
- units_per_gas: 1
32693
- }
32673
+ {
32674
+ tx_id: "0x25a49b0731bf610f6706aa9e9e96e5967f7c50f4302a3c75d7c8141595896551c18d",
32675
+ output_index: 0,
32676
+ tx_pointer_block_height: 0,
32677
+ tx_pointer_tx_idx: 0,
32678
+ owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
32679
+ amount: 18446744073709552e3,
32680
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32694
32681
  },
32695
- vm_initialization: {
32696
- HeavyOperation: {
32697
- base: 2e3,
32698
- gas_per_unit: 0
32699
- }
32682
+ {
32683
+ tx_id: "0x0a6e3585881ef2edf3f7727762799089dc0b5923e8b3718b49044dd9ddcb33b68459",
32684
+ output_index: 0,
32685
+ tx_pointer_block_height: 0,
32686
+ tx_pointer_tx_idx: 0,
32687
+ owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
32688
+ amount: 18446744073709552e3,
32689
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32700
32690
  },
32701
- new_storage_per_byte: 1
32702
- },
32703
- consensus: {
32704
- PoA: {
32705
- signing_key: "0x94ffcc53b892684acefaebc8a3d4a595e528a8cf664eeb3ef36f1020b0809d0d"
32691
+ {
32692
+ tx_id: "0xf73bbe0635f7b6d59a090a21d87288b82164d0f6101da830ce64eff64a2d2ff2ac37",
32693
+ output_index: 0,
32694
+ tx_pointer_block_height: 0,
32695
+ tx_pointer_tx_idx: 0,
32696
+ owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
32697
+ amount: 18446744073709552e3,
32698
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32699
+ },
32700
+ {
32701
+ tx_id: "0x6cc44cb8d2a6462a591a77b6b9917eb6b22ad80d23d3cfd4f94c9da49c14b3cbac6e",
32702
+ output_index: 0,
32703
+ tx_pointer_block_height: 0,
32704
+ tx_pointer_tx_idx: 0,
32705
+ owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
32706
+ amount: 18446744073709552e3,
32707
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32708
+ },
32709
+ {
32710
+ tx_id: "0xbf2305d284ea95227040df4cc727156cccc2ca6aa3b92ed86fea4db1c37e5905f926",
32711
+ output_index: 0,
32712
+ tx_pointer_block_height: 0,
32713
+ tx_pointer_tx_idx: 0,
32714
+ owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
32715
+ amount: 18446744073709552e3,
32716
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32717
+ },
32718
+ {
32719
+ tx_id: "0xf4e1c76c72ecae699696f5e7a62ccf1425f7395080d0ca7b25ab63d1f841f425b807",
32720
+ output_index: 0,
32721
+ tx_pointer_block_height: 0,
32722
+ tx_pointer_tx_idx: 0,
32723
+ owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
32724
+ amount: 18446744073709552e3,
32725
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32726
+ },
32727
+ {
32728
+ tx_id: "0x619c80ee9f4c27c2e134cec6c67bdb268ce7fb1d2ac229ca2a44ec7ac88b2da99669",
32729
+ output_index: 0,
32730
+ tx_pointer_block_height: 0,
32731
+ tx_pointer_tx_idx: 0,
32732
+ owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
32733
+ amount: 18446744073709552e3,
32734
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32735
+ },
32736
+ {
32737
+ tx_id: "0x978d5b6be047ffbf1474dc376a6baa33264629b809e4a8210d11aaa805ec6451585d",
32738
+ output_index: 0,
32739
+ tx_pointer_block_height: 0,
32740
+ tx_pointer_tx_idx: 0,
32741
+ owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
32742
+ amount: 18446744073709552e3,
32743
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32744
+ },
32745
+ {
32746
+ tx_id: "0x673ba12fca6e52429896096262b8c59b61751976e552649fb1fe7369488fc10aa83c",
32747
+ output_index: 0,
32748
+ tx_pointer_block_height: 0,
32749
+ tx_pointer_tx_idx: 0,
32750
+ owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
32751
+ amount: 18446744073709552e3,
32752
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32753
+ },
32754
+ {
32755
+ tx_id: "0xc42a165104b9fcfa4a9ebffc707781ace233f1c0609c24c36a5c4bfcd407480ddb6c",
32756
+ output_index: 0,
32757
+ tx_pointer_block_height: 0,
32758
+ tx_pointer_tx_idx: 0,
32759
+ owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
32760
+ amount: 18446744073709552e3,
32761
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32762
+ },
32763
+ {
32764
+ tx_id: "0xb353fbcd94abba347f3ba25e17744e98da26e608ebccbbbd2e9d004997644bdf993c",
32765
+ output_index: 0,
32766
+ tx_pointer_block_height: 0,
32767
+ tx_pointer_tx_idx: 0,
32768
+ owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
32769
+ amount: 18446744073709552e3,
32770
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32771
+ },
32772
+ {
32773
+ tx_id: "0xc34a6fcb241dec82f885019caf5e14bb6708b435afebfef0037ac447fbb6d30378a3",
32774
+ output_index: 0,
32775
+ tx_pointer_block_height: 0,
32776
+ tx_pointer_tx_idx: 0,
32777
+ owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
32778
+ amount: 18446744073709552e3,
32779
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32780
+ },
32781
+ {
32782
+ tx_id: "0x421dfb5811c905724f2f4c6370cd15eaeb590ddeb966f9a4b9f8d65991dfe5142e12",
32783
+ output_index: 0,
32784
+ tx_pointer_block_height: 0,
32785
+ tx_pointer_tx_idx: 0,
32786
+ owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
32787
+ amount: 18446744073709552e3,
32788
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32789
+ },
32790
+ {
32791
+ tx_id: "0xa952c0487eefac5dda612011c4c82554c8660834461b9b815c6ae257b56b68005235",
32792
+ output_index: 0,
32793
+ tx_pointer_block_height: 0,
32794
+ tx_pointer_tx_idx: 0,
32795
+ owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
32796
+ amount: 18446744073709552e3,
32797
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32798
+ },
32799
+ {
32800
+ tx_id: "0xebaccf91b3b213341d047b6e6af214f1f9729b3d6dadf9c1918a9fe412486af871db",
32801
+ output_index: 0,
32802
+ tx_pointer_block_height: 0,
32803
+ tx_pointer_tx_idx: 0,
32804
+ owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
32805
+ amount: 18446744073709552e3,
32806
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32807
+ },
32808
+ {
32809
+ tx_id: "0xda6d61c153e7d735954408274f4ffe8459c2dbab720ce22a1ae9ffedd33077b5b19d",
32810
+ output_index: 0,
32811
+ tx_pointer_block_height: 0,
32812
+ tx_pointer_tx_idx: 0,
32813
+ owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
32814
+ amount: 18446744073709552e3,
32815
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32816
+ },
32817
+ {
32818
+ tx_id: "0x508871600ef68c4f1e021dd0db219c733107151338aa95de530bd10dc61f6a69c144",
32819
+ output_index: 0,
32820
+ tx_pointer_block_height: 0,
32821
+ tx_pointer_tx_idx: 0,
32822
+ owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
32823
+ amount: 18446744073709552e3,
32824
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32825
+ },
32826
+ {
32827
+ tx_id: "0x509994738b4973e2dbbff9596b176a89fb07ee95f0ed575a4fe07a735a2a181f3200",
32828
+ output_index: 0,
32829
+ tx_pointer_block_height: 0,
32830
+ tx_pointer_tx_idx: 0,
32831
+ owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
32832
+ amount: 18446744073709552e3,
32833
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32834
+ },
32835
+ {
32836
+ tx_id: "0x6cc0cb58df0e0606fc85481aaaf5f47e145a67240b298c184bcb7fd7367c3bbf9453",
32837
+ output_index: 0,
32838
+ tx_pointer_block_height: 0,
32839
+ tx_pointer_tx_idx: 0,
32840
+ owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
32841
+ amount: 18446744073709552e3,
32842
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32843
+ },
32844
+ {
32845
+ tx_id: "0x9ddea761afc31516307e1553647ac6cc26d4a82fed9a9e6a03b994cdbf2293b3e3b6",
32846
+ output_index: 0,
32847
+ tx_pointer_block_height: 0,
32848
+ tx_pointer_tx_idx: 0,
32849
+ owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
32850
+ amount: 18446744073709552e3,
32851
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32852
+ },
32853
+ {
32854
+ tx_id: "0x82dbc478ba63abf28b92d9dce0cb8c2e6c02833d436fe812a33cf78417e4a80c1306",
32855
+ output_index: 0,
32856
+ tx_pointer_block_height: 0,
32857
+ tx_pointer_tx_idx: 0,
32858
+ owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
32859
+ amount: 18446744073709552e3,
32860
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32861
+ },
32862
+ {
32863
+ tx_id: "0xc3b0cb232c74009fd226a6246403f78bcc33d116579f41d9387c0d76c76942749c7c",
32864
+ output_index: 0,
32865
+ tx_pointer_block_height: 0,
32866
+ tx_pointer_tx_idx: 0,
32867
+ owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
32868
+ amount: 18446744073709552e3,
32869
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32870
+ },
32871
+ {
32872
+ tx_id: "0x708ee45d18f94ab06458712745c92c7b9b6049ba345219d6697eae5208ec0328aeaf",
32873
+ output_index: 0,
32874
+ tx_pointer_block_height: 0,
32875
+ tx_pointer_tx_idx: 0,
32876
+ owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
32877
+ amount: 18446744073709552e3,
32878
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32879
+ },
32880
+ {
32881
+ tx_id: "0xfe26968c44ac5becc608ce543075ae9e677b7631f3beb7a11ba20703fdca3c0e3569",
32882
+ output_index: 0,
32883
+ tx_pointer_block_height: 0,
32884
+ tx_pointer_tx_idx: 0,
32885
+ owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
32886
+ amount: 18446744073709552e3,
32887
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32888
+ },
32889
+ {
32890
+ tx_id: "0xe0ec1d2c991feac69be4d0e84ad7c964616de08e16dccc4d2000b1900ba31082b993",
32891
+ output_index: 0,
32892
+ tx_pointer_block_height: 0,
32893
+ tx_pointer_tx_idx: 0,
32894
+ owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
32895
+ amount: 18446744073709552e3,
32896
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32897
+ },
32898
+ {
32899
+ tx_id: "0xfa82dbdd72252d1e6c76ee818bbac0441c3a705aff447f041c8b9fc3cb03f9ccd7e2",
32900
+ output_index: 0,
32901
+ tx_pointer_block_height: 0,
32902
+ tx_pointer_tx_idx: 0,
32903
+ owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
32904
+ amount: 18446744073709552e3,
32905
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32906
+ },
32907
+ {
32908
+ tx_id: "0x324f45e47cef892ac3e0759f3b72207c77046f9938267af4bd4af2ae031b97cb36c8",
32909
+ output_index: 0,
32910
+ tx_pointer_block_height: 0,
32911
+ tx_pointer_tx_idx: 0,
32912
+ owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
32913
+ amount: 18446744073709552e3,
32914
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32706
32915
  }
32707
- }
32916
+ ],
32917
+ messages: [
32918
+ {
32919
+ sender: "0xc43454aa38dd91f88109a4b7aef5efb96ce34e3f24992fe0f81d233ca686f80f",
32920
+ recipient: "0x69a2b736b60159b43bb8a4f98c0589f6da5fa3a3d101e8e269c499eb942753ba",
32921
+ nonce: "0101010101010101010101010101010101010101010101010101010101010101",
32922
+ amount: 18446744073709552e3,
32923
+ data: "",
32924
+ da_height: 0
32925
+ },
32926
+ {
32927
+ sender: "0x69a2b736b60159b43bb8a4f98c0589f6da5fa3a3d101e8e269c499eb942753ba",
32928
+ recipient: "0xc43454aa38dd91f88109a4b7aef5efb96ce34e3f24992fe0f81d233ca686f80f",
32929
+ nonce: "0e1ef2963832068b0e1ef2963832068b0e1ef2963832068b0e1ef2963832068b",
32930
+ amount: 12704439083013452e3,
32931
+ data: "",
32932
+ da_height: 0
32933
+ }
32934
+ ],
32935
+ contracts: [],
32936
+ block_height: 0,
32937
+ da_block_height: 0
32938
+ };
32939
+ var defaultSnapshotConfigs = {
32940
+ chainConfigJson: chainConfig_default,
32941
+ metadataJson: metadata_default,
32942
+ stateConfigJson: stateConfig_default
32708
32943
  };
32709
- var defaultChainConfig = chainConfig_default;
32710
32944
  var defaultConsensusKey = "0xa449b1ffee0e2205fa924c6740cc48b3b473aa28587df6dab12abc245d1f5298";
32945
+ function isDefined(value) {
32946
+ return value !== void 0;
32947
+ }
32711
32948
 
32712
32949
  // ../crypto/dist/index.mjs
32713
32950
  var import_crypto8 = __toESM(__require("crypto"), 1);
@@ -34627,7 +34864,7 @@ This unreleased fuel-core build may include features and updates not yet support
34627
34864
  toEvmAddress() {
34628
34865
  const b256Address = toB256(this.bech32Address);
34629
34866
  return {
34630
- value: clearFirst12BytesFromB256(b256Address)
34867
+ bits: clearFirst12BytesFromB256(b256Address)
34631
34868
  };
34632
34869
  }
34633
34870
  /**
@@ -34637,7 +34874,7 @@ This unreleased fuel-core build may include features and updates not yet support
34637
34874
  */
34638
34875
  toAssetId() {
34639
34876
  return {
34640
- value: this.toB256()
34877
+ bits: this.toB256()
34641
34878
  };
34642
34879
  }
34643
34880
  /**
@@ -34755,10 +34992,6 @@ This unreleased fuel-core build may include features and updates not yet support
34755
34992
  }
34756
34993
  };
34757
34994
 
34758
- // ../address/dist/configs.mjs
34759
- var ZeroBytes32 = "0x0000000000000000000000000000000000000000000000000000000000000000";
34760
- var BaseAssetId = ZeroBytes32;
34761
-
34762
34995
  // ../math/dist/index.mjs
34763
34996
  var import_bn = __toESM(require_bn(), 1);
34764
34997
  var DEFAULT_PRECISION = 9;
@@ -34978,32 +35211,182 @@ This unreleased fuel-core build may include features and updates not yet support
34978
35211
  function toBytes3(value, bytesPadding) {
34979
35212
  return bn(value).toBytes(bytesPadding);
34980
35213
  }
34981
- function max(...numbers) {
34982
- return numbers.reduce((prev, cur) => bn(cur).gt(prev) ? bn(cur) : prev, bn(0));
35214
+
35215
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isPlaceholder.js
35216
+ function _isPlaceholder(a) {
35217
+ return a != null && typeof a === "object" && a["@@functional/placeholder"] === true;
35218
+ }
35219
+
35220
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_curry1.js
35221
+ function _curry1(fn) {
35222
+ return function f1(a) {
35223
+ if (arguments.length === 0 || _isPlaceholder(a)) {
35224
+ return f1;
35225
+ } else {
35226
+ return fn.apply(this, arguments);
35227
+ }
35228
+ };
35229
+ }
35230
+
35231
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isArray.js
35232
+ var isArray_default = Array.isArray || function _isArray(val) {
35233
+ return val != null && val.length >= 0 && Object.prototype.toString.call(val) === "[object Array]";
35234
+ };
35235
+
35236
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/type.js
35237
+ var type = /* @__PURE__ */ _curry1(function type2(val) {
35238
+ return val === null ? "Null" : val === void 0 ? "Undefined" : Object.prototype.toString.call(val).slice(8, -1);
35239
+ });
35240
+ var type_default = type;
35241
+
35242
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_toISOString.js
35243
+ var pad = function pad2(n) {
35244
+ return (n < 10 ? "0" : "") + n;
35245
+ };
35246
+ var _toISOString = typeof Date.prototype.toISOString === "function" ? function _toISOString2(d) {
35247
+ return d.toISOString();
35248
+ } : function _toISOString3(d) {
35249
+ 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";
35250
+ };
35251
+
35252
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isInteger.js
35253
+ var isInteger_default = Number.isInteger || function _isInteger(n) {
35254
+ return n << 0 === n;
35255
+ };
35256
+
35257
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_cloneRegExp.js
35258
+ function _cloneRegExp(pattern) {
35259
+ 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" : ""));
34983
35260
  }
34984
35261
 
35262
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_clone.js
35263
+ function _clone(value, deep, map) {
35264
+ map || (map = new _ObjectMap());
35265
+ if (_isPrimitive(value)) {
35266
+ return value;
35267
+ }
35268
+ var copy = function copy2(copiedValue) {
35269
+ var cachedCopy = map.get(value);
35270
+ if (cachedCopy) {
35271
+ return cachedCopy;
35272
+ }
35273
+ map.set(value, copiedValue);
35274
+ for (var key in value) {
35275
+ if (Object.prototype.hasOwnProperty.call(value, key)) {
35276
+ copiedValue[key] = deep ? _clone(value[key], true, map) : value[key];
35277
+ }
35278
+ }
35279
+ return copiedValue;
35280
+ };
35281
+ switch (type_default(value)) {
35282
+ case "Object":
35283
+ return copy(Object.create(Object.getPrototypeOf(value)));
35284
+ case "Array":
35285
+ return copy([]);
35286
+ case "Date":
35287
+ return new Date(value.valueOf());
35288
+ case "RegExp":
35289
+ return _cloneRegExp(value);
35290
+ case "Int8Array":
35291
+ case "Uint8Array":
35292
+ case "Uint8ClampedArray":
35293
+ case "Int16Array":
35294
+ case "Uint16Array":
35295
+ case "Int32Array":
35296
+ case "Uint32Array":
35297
+ case "Float32Array":
35298
+ case "Float64Array":
35299
+ case "BigInt64Array":
35300
+ case "BigUint64Array":
35301
+ return value.slice();
35302
+ default:
35303
+ return value;
35304
+ }
35305
+ }
35306
+ function _isPrimitive(param) {
35307
+ var type3 = typeof param;
35308
+ return param == null || type3 != "object" && type3 != "function";
35309
+ }
35310
+ var _ObjectMap = /* @__PURE__ */ function() {
35311
+ function _ObjectMap2() {
35312
+ this.map = {};
35313
+ this.length = 0;
35314
+ }
35315
+ _ObjectMap2.prototype.set = function(key, value) {
35316
+ const hashedKey = this.hash(key);
35317
+ let bucket = this.map[hashedKey];
35318
+ if (!bucket) {
35319
+ this.map[hashedKey] = bucket = [];
35320
+ }
35321
+ bucket.push([key, value]);
35322
+ this.length += 1;
35323
+ };
35324
+ _ObjectMap2.prototype.hash = function(key) {
35325
+ let hashedKey = [];
35326
+ for (var value in key) {
35327
+ hashedKey.push(Object.prototype.toString.call(key[value]));
35328
+ }
35329
+ return hashedKey.join();
35330
+ };
35331
+ _ObjectMap2.prototype.get = function(key) {
35332
+ if (this.length <= 180) {
35333
+ for (const p in this.map) {
35334
+ const bucket2 = this.map[p];
35335
+ for (let i = 0; i < bucket2.length; i += 1) {
35336
+ const element = bucket2[i];
35337
+ if (element[0] === key) {
35338
+ return element[1];
35339
+ }
35340
+ }
35341
+ }
35342
+ return;
35343
+ }
35344
+ const hashedKey = this.hash(key);
35345
+ const bucket = this.map[hashedKey];
35346
+ if (!bucket) {
35347
+ return;
35348
+ }
35349
+ for (let i = 0; i < bucket.length; i += 1) {
35350
+ const element = bucket[i];
35351
+ if (element[0] === key) {
35352
+ return element[1];
35353
+ }
35354
+ }
35355
+ };
35356
+ return _ObjectMap2;
35357
+ }();
35358
+
35359
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/clone.js
35360
+ var clone = /* @__PURE__ */ _curry1(function clone2(value) {
35361
+ return value != null && typeof value.clone === "function" ? value.clone() : _clone(value, true);
35362
+ });
35363
+ var clone_default = clone;
35364
+
35365
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/trim.js
35366
+ var hasProtoTrim = typeof String.prototype.trim === "function";
35367
+
34985
35368
  // src/providers/coin-quantity.ts
34986
35369
  var coinQuantityfy = (coinQuantityLike) => {
34987
35370
  let assetId;
34988
35371
  let amount;
34989
- let max2;
35372
+ let max;
34990
35373
  if (Array.isArray(coinQuantityLike)) {
34991
35374
  amount = coinQuantityLike[0];
34992
- assetId = coinQuantityLike[1] ?? BaseAssetId;
34993
- max2 = coinQuantityLike[2] ?? void 0;
35375
+ assetId = coinQuantityLike[1];
35376
+ max = coinQuantityLike[2] ?? void 0;
34994
35377
  } else {
34995
35378
  amount = coinQuantityLike.amount;
34996
- assetId = coinQuantityLike.assetId ?? BaseAssetId;
34997
- max2 = coinQuantityLike.max ?? void 0;
35379
+ assetId = coinQuantityLike.assetId;
35380
+ max = coinQuantityLike.max ?? void 0;
34998
35381
  }
34999
35382
  const bnAmount = bn(amount);
35000
35383
  return {
35001
35384
  assetId: hexlify(assetId),
35002
35385
  amount: bnAmount.lt(1) ? bn(1) : bnAmount,
35003
- max: max2 ? bn(max2) : void 0
35386
+ max: max ? bn(max) : void 0
35004
35387
  };
35005
35388
  };
35006
- var addAmountToAsset = (params) => {
35389
+ var addAmountToCoinQuantities = (params) => {
35007
35390
  const { amount, assetId } = params;
35008
35391
  const coinQuantities = [...params.coinQuantities];
35009
35392
  const assetIdx = coinQuantities.findIndex((coinQuantity) => coinQuantity.assetId === assetId);
@@ -35070,7 +35453,7 @@ This unreleased fuel-core build may include features and updates not yet support
35070
35453
  var ENCODING_V1 = "1";
35071
35454
  var WORD_SIZE = 8;
35072
35455
  var BYTES_32 = 32;
35073
- var UTXO_ID_LEN = BYTES_32 + 1;
35456
+ var UTXO_ID_LEN = BYTES_32 + 2;
35074
35457
  var ASSET_ID_LEN = BYTES_32;
35075
35458
  var ADDRESS_LEN = BYTES_32;
35076
35459
  var NONCE_LEN = BYTES_32;
@@ -35078,9 +35461,9 @@ This unreleased fuel-core build may include features and updates not yet support
35078
35461
  var TX_POINTER_LEN = WORD_SIZE * 2;
35079
35462
  var MAX_BYTES = 2 ** 32 - 1;
35080
35463
  var calculateVmTxMemory = ({ maxInputs }) => BYTES_32 + // Tx ID
35081
- WORD_SIZE + // Tx size
35464
+ ASSET_ID_LEN + // Base asset ID
35082
35465
  // Asset ID/Balance coin input pairs
35083
- maxInputs * (ASSET_ID_LEN + WORD_SIZE);
35466
+ maxInputs * (ASSET_ID_LEN + WORD_SIZE) + WORD_SIZE;
35084
35467
  var SCRIPT_FIXED_SIZE = WORD_SIZE + // Identifier
35085
35468
  WORD_SIZE + // Gas limit
35086
35469
  WORD_SIZE + // Script size
@@ -35098,7 +35481,6 @@ This unreleased fuel-core build may include features and updates not yet support
35098
35481
  ASSET_ID_LEN + // Asset id
35099
35482
  TX_POINTER_LEN + // TxPointer
35100
35483
  WORD_SIZE + // Witnesses index
35101
- WORD_SIZE + // Maturity
35102
35484
  WORD_SIZE + // Predicate size
35103
35485
  WORD_SIZE + // Predicate data size
35104
35486
  WORD_SIZE;
@@ -35420,7 +35802,7 @@ This unreleased fuel-core build may include features and updates not yet support
35420
35802
  constructor(name, coders) {
35421
35803
  const caseIndexCoder = new BigNumberCoder("u64");
35422
35804
  const encodedValueSize = Object.values(coders).reduce(
35423
- (max2, coder) => Math.max(max2, coder.encodedLength),
35805
+ (max, coder) => Math.max(max, coder.encodedLength),
35424
35806
  0
35425
35807
  );
35426
35808
  super(`enum ${name}`, `enum ${name}`, caseIndexCoder.encodedLength + encodedValueSize);
@@ -36138,7 +36520,7 @@ This unreleased fuel-core build may include features and updates not yet support
36138
36520
  constructor(name, coders) {
36139
36521
  const caseIndexCoder = new BigNumberCoder("u64");
36140
36522
  const encodedValueSize = Object.values(coders).reduce(
36141
- (max2, coder) => Math.max(max2, coder.encodedLength),
36523
+ (max, coder) => Math.max(max, coder.encodedLength),
36142
36524
  0
36143
36525
  );
36144
36526
  super(`enum ${name}`, `enum ${name}`, caseIndexCoder.encodedLength + encodedValueSize);
@@ -36429,9 +36811,11 @@ This unreleased fuel-core build may include features and updates not yet support
36429
36811
  };
36430
36812
  var VecCoder2 = class extends Coder {
36431
36813
  coder;
36814
+ #isOptionVec;
36432
36815
  constructor(coder) {
36433
36816
  super("struct", `struct Vec`, coder.encodedLength + WORD_SIZE);
36434
36817
  this.coder = coder;
36818
+ this.#isOptionVec = this.coder instanceof OptionCoder2;
36435
36819
  }
36436
36820
  encode(value) {
36437
36821
  if (!Array.isArray(value)) {
@@ -36442,7 +36826,7 @@ This unreleased fuel-core build may include features and updates not yet support
36442
36826
  return new Uint8Array([...lengthBytes, ...concatBytes2(bytes3)]);
36443
36827
  }
36444
36828
  decode(data, offset) {
36445
- if (data.length < this.encodedLength || data.length > MAX_BYTES) {
36829
+ if (!this.#isOptionVec && (data.length < this.encodedLength || data.length > MAX_BYTES)) {
36446
36830
  throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid vec data size.`);
36447
36831
  }
36448
36832
  const offsetAndLength = offset + WORD_SIZE;
@@ -36450,15 +36834,17 @@ This unreleased fuel-core build may include features and updates not yet support
36450
36834
  const length = bn(new BigNumberCoder("u64").decode(lengthBytes, 0)[0]).toNumber();
36451
36835
  const dataLength2 = length * this.coder.encodedLength;
36452
36836
  const dataBytes = data.slice(offsetAndLength, offsetAndLength + dataLength2);
36453
- if (dataBytes.length !== dataLength2) {
36837
+ if (!this.#isOptionVec && dataBytes.length !== dataLength2) {
36454
36838
  throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid vec byte data size.`);
36455
36839
  }
36456
- return [
36457
- chunkByLength(dataBytes, this.coder.encodedLength).map(
36458
- (chunk) => this.coder.decode(chunk, 0)[0]
36459
- ),
36460
- offsetAndLength + dataLength2
36461
- ];
36840
+ let newOffset = offsetAndLength;
36841
+ const chunks = [];
36842
+ for (let i = 0; i < length; i++) {
36843
+ const [decoded, optionOffset] = this.coder.decode(data, newOffset);
36844
+ chunks.push(decoded);
36845
+ newOffset = optionOffset;
36846
+ }
36847
+ return [chunks, newOffset];
36462
36848
  }
36463
36849
  };
36464
36850
  var getCoder2 = (resolvedAbiType, _options) => {
@@ -36852,18 +37238,19 @@ This unreleased fuel-core build may include features and updates not yet support
36852
37238
  encode(value) {
36853
37239
  const parts = [];
36854
37240
  parts.push(new B256Coder().encode(value.txID));
36855
- parts.push(new NumberCoder("u8").encode(value.outputIndex));
37241
+ parts.push(new NumberCoder("u16").encode(value.outputIndex));
36856
37242
  parts.push(new B256Coder().encode(value.owner));
36857
37243
  parts.push(new BigNumberCoder("u64").encode(value.amount));
36858
37244
  parts.push(new B256Coder().encode(value.assetId));
36859
37245
  parts.push(new TxPointerCoder().encode(value.txPointer));
36860
- parts.push(new NumberCoder("u8").encode(value.witnessIndex));
36861
- parts.push(new NumberCoder("u32").encode(value.maturity));
37246
+ parts.push(new NumberCoder("u16").encode(value.witnessIndex));
36862
37247
  parts.push(new BigNumberCoder("u64").encode(value.predicateGasUsed));
36863
- parts.push(new NumberCoder("u32").encode(value.predicateLength));
36864
- parts.push(new NumberCoder("u32").encode(value.predicateDataLength));
36865
- parts.push(new ByteArrayCoder(value.predicateLength).encode(value.predicate));
36866
- parts.push(new ByteArrayCoder(value.predicateDataLength).encode(value.predicateData));
37248
+ parts.push(new BigNumberCoder("u64").encode(value.predicateLength));
37249
+ parts.push(new BigNumberCoder("u64").encode(value.predicateDataLength));
37250
+ parts.push(new ByteArrayCoder(value.predicateLength.toNumber()).encode(value.predicate));
37251
+ parts.push(
37252
+ new ByteArrayCoder(value.predicateDataLength.toNumber()).encode(value.predicateData)
37253
+ );
36867
37254
  return concat(parts);
36868
37255
  }
36869
37256
  decode(data, offset) {
@@ -36871,7 +37258,7 @@ This unreleased fuel-core build may include features and updates not yet support
36871
37258
  let o = offset;
36872
37259
  [decoded, o] = new B256Coder().decode(data, o);
36873
37260
  const txID = decoded;
36874
- [decoded, o] = new NumberCoder("u8").decode(data, o);
37261
+ [decoded, o] = new NumberCoder("u16").decode(data, o);
36875
37262
  const outputIndex = decoded;
36876
37263
  [decoded, o] = new B256Coder().decode(data, o);
36877
37264
  const owner = decoded;
@@ -36881,19 +37268,17 @@ This unreleased fuel-core build may include features and updates not yet support
36881
37268
  const assetId = decoded;
36882
37269
  [decoded, o] = new TxPointerCoder().decode(data, o);
36883
37270
  const txPointer = decoded;
36884
- [decoded, o] = new NumberCoder("u8").decode(data, o);
37271
+ [decoded, o] = new NumberCoder("u16").decode(data, o);
36885
37272
  const witnessIndex = Number(decoded);
36886
- [decoded, o] = new NumberCoder("u32").decode(data, o);
36887
- const maturity = decoded;
36888
37273
  [decoded, o] = new BigNumberCoder("u64").decode(data, o);
36889
37274
  const predicateGasUsed = decoded;
36890
- [decoded, o] = new NumberCoder("u32").decode(data, o);
37275
+ [decoded, o] = new BigNumberCoder("u64").decode(data, o);
36891
37276
  const predicateLength = decoded;
36892
- [decoded, o] = new NumberCoder("u32").decode(data, o);
37277
+ [decoded, o] = new BigNumberCoder("u64").decode(data, o);
36893
37278
  const predicateDataLength = decoded;
36894
- [decoded, o] = new ByteArrayCoder(predicateLength).decode(data, o);
37279
+ [decoded, o] = new ByteArrayCoder(predicateLength.toNumber()).decode(data, o);
36895
37280
  const predicate = decoded;
36896
- [decoded, o] = new ByteArrayCoder(predicateDataLength).decode(data, o);
37281
+ [decoded, o] = new ByteArrayCoder(predicateDataLength.toNumber()).decode(data, o);
36897
37282
  const predicateData = decoded;
36898
37283
  return [
36899
37284
  {
@@ -36905,7 +37290,6 @@ This unreleased fuel-core build may include features and updates not yet support
36905
37290
  assetId,
36906
37291
  txPointer,
36907
37292
  witnessIndex,
36908
- maturity,
36909
37293
  predicateGasUsed,
36910
37294
  predicateLength,
36911
37295
  predicateDataLength,
@@ -36923,7 +37307,7 @@ This unreleased fuel-core build may include features and updates not yet support
36923
37307
  encode(value) {
36924
37308
  const parts = [];
36925
37309
  parts.push(new B256Coder().encode(value.txID));
36926
- parts.push(new NumberCoder("u8").encode(value.outputIndex));
37310
+ parts.push(new NumberCoder("u16").encode(value.outputIndex));
36927
37311
  parts.push(new B256Coder().encode(value.balanceRoot));
36928
37312
  parts.push(new B256Coder().encode(value.stateRoot));
36929
37313
  parts.push(new TxPointerCoder().encode(value.txPointer));
@@ -36935,7 +37319,7 @@ This unreleased fuel-core build may include features and updates not yet support
36935
37319
  let o = offset;
36936
37320
  [decoded, o] = new B256Coder().decode(data, o);
36937
37321
  const txID = decoded;
36938
- [decoded, o] = new NumberCoder("u8").decode(data, o);
37322
+ [decoded, o] = new NumberCoder("u16").decode(data, o);
36939
37323
  const outputIndex = decoded;
36940
37324
  [decoded, o] = new B256Coder().decode(data, o);
36941
37325
  const balanceRoot = decoded;
@@ -36984,14 +37368,16 @@ This unreleased fuel-core build may include features and updates not yet support
36984
37368
  parts.push(new ByteArrayCoder(32).encode(value.recipient));
36985
37369
  parts.push(new BigNumberCoder("u64").encode(value.amount));
36986
37370
  parts.push(new ByteArrayCoder(32).encode(value.nonce));
36987
- parts.push(new NumberCoder("u8").encode(value.witnessIndex));
37371
+ parts.push(new NumberCoder("u16").encode(value.witnessIndex));
36988
37372
  parts.push(new BigNumberCoder("u64").encode(value.predicateGasUsed));
36989
- parts.push(new NumberCoder("u32").encode(data.length));
36990
- parts.push(new NumberCoder("u32").encode(value.predicateLength));
36991
- parts.push(new NumberCoder("u32").encode(value.predicateDataLength));
37373
+ parts.push(new BigNumberCoder("u64").encode(data.length));
37374
+ parts.push(new BigNumberCoder("u64").encode(value.predicateLength));
37375
+ parts.push(new BigNumberCoder("u64").encode(value.predicateDataLength));
36992
37376
  parts.push(new ByteArrayCoder(data.length).encode(data));
36993
- parts.push(new ByteArrayCoder(value.predicateLength).encode(value.predicate));
36994
- parts.push(new ByteArrayCoder(value.predicateDataLength).encode(value.predicateData));
37377
+ parts.push(new ByteArrayCoder(value.predicateLength.toNumber()).encode(value.predicate));
37378
+ parts.push(
37379
+ new ByteArrayCoder(value.predicateDataLength.toNumber()).encode(value.predicateData)
37380
+ );
36995
37381
  return concat(parts);
36996
37382
  }
36997
37383
  static decodeData(messageData) {
@@ -37011,21 +37397,21 @@ This unreleased fuel-core build may include features and updates not yet support
37011
37397
  const amount = decoded;
37012
37398
  [decoded, o] = new B256Coder().decode(data, o);
37013
37399
  const nonce = decoded;
37014
- [decoded, o] = new NumberCoder("u8").decode(data, o);
37400
+ [decoded, o] = new NumberCoder("u16").decode(data, o);
37015
37401
  const witnessIndex = Number(decoded);
37016
37402
  [decoded, o] = new BigNumberCoder("u64").decode(data, o);
37017
37403
  const predicateGasUsed = decoded;
37018
37404
  [decoded, o] = new NumberCoder("u32").decode(data, o);
37019
37405
  const dataLength2 = decoded;
37020
- [decoded, o] = new NumberCoder("u32").decode(data, o);
37406
+ [decoded, o] = new BigNumberCoder("u64").decode(data, o);
37021
37407
  const predicateLength = decoded;
37022
- [decoded, o] = new NumberCoder("u32").decode(data, o);
37408
+ [decoded, o] = new BigNumberCoder("u64").decode(data, o);
37023
37409
  const predicateDataLength = decoded;
37024
37410
  [decoded, o] = new ByteArrayCoder(dataLength2).decode(data, o);
37025
37411
  const messageData = decoded;
37026
- [decoded, o] = new ByteArrayCoder(predicateLength).decode(data, o);
37412
+ [decoded, o] = new ByteArrayCoder(predicateLength.toNumber()).decode(data, o);
37027
37413
  const predicate = decoded;
37028
- [decoded, o] = new ByteArrayCoder(predicateDataLength).decode(data, o);
37414
+ [decoded, o] = new ByteArrayCoder(predicateDataLength.toNumber()).decode(data, o);
37029
37415
  const predicateData = decoded;
37030
37416
  return [
37031
37417
  {
@@ -37337,7 +37723,7 @@ This unreleased fuel-core build may include features and updates not yet support
37337
37723
  }
37338
37724
  };
37339
37725
  var PolicyType = /* @__PURE__ */ ((PolicyType2) => {
37340
- PolicyType2[PolicyType2["GasPrice"] = 1] = "GasPrice";
37726
+ PolicyType2[PolicyType2["Tip"] = 1] = "Tip";
37341
37727
  PolicyType2[PolicyType2["WitnessLimit"] = 2] = "WitnessLimit";
37342
37728
  PolicyType2[PolicyType2["Maturity"] = 4] = "Maturity";
37343
37729
  PolicyType2[PolicyType2["MaxFee"] = 8] = "MaxFee";
@@ -37385,9 +37771,9 @@ This unreleased fuel-core build may include features and updates not yet support
37385
37771
  let o = offset;
37386
37772
  const policies = [];
37387
37773
  if (policyTypes & 1) {
37388
- const [gasPrice, nextOffset] = new BigNumberCoder("u64").decode(data, o);
37774
+ const [tip, nextOffset] = new BigNumberCoder("u64").decode(data, o);
37389
37775
  o = nextOffset;
37390
- policies.push({ type: 1, data: gasPrice });
37776
+ policies.push({ type: 1, data: tip });
37391
37777
  }
37392
37778
  if (policyTypes & 2) {
37393
37779
  const [witnessLimit, nextOffset] = new BigNumberCoder("u64").decode(data, o);
@@ -37619,15 +38005,15 @@ This unreleased fuel-core build may include features and updates not yet support
37619
38005
  encode(value) {
37620
38006
  const parts = [];
37621
38007
  parts.push(new BigNumberCoder("u64").encode(value.scriptGasLimit));
37622
- parts.push(new NumberCoder("u32").encode(value.scriptLength));
37623
- parts.push(new NumberCoder("u32").encode(value.scriptDataLength));
37624
- parts.push(new NumberCoder("u32").encode(value.policyTypes));
37625
- parts.push(new NumberCoder("u8").encode(value.inputsCount));
37626
- parts.push(new NumberCoder("u8").encode(value.outputsCount));
37627
- parts.push(new NumberCoder("u8").encode(value.witnessesCount));
37628
38008
  parts.push(new B256Coder().encode(value.receiptsRoot));
37629
- parts.push(new ByteArrayCoder(value.scriptLength).encode(value.script));
37630
- parts.push(new ByteArrayCoder(value.scriptDataLength).encode(value.scriptData));
38009
+ parts.push(new BigNumberCoder("u64").encode(value.scriptLength));
38010
+ parts.push(new BigNumberCoder("u64").encode(value.scriptDataLength));
38011
+ parts.push(new NumberCoder("u32").encode(value.policyTypes));
38012
+ parts.push(new NumberCoder("u16").encode(value.inputsCount));
38013
+ parts.push(new NumberCoder("u16").encode(value.outputsCount));
38014
+ parts.push(new NumberCoder("u16").encode(value.witnessesCount));
38015
+ parts.push(new ByteArrayCoder(value.scriptLength.toNumber()).encode(value.script));
38016
+ parts.push(new ByteArrayCoder(value.scriptDataLength.toNumber()).encode(value.scriptData));
37631
38017
  parts.push(new PoliciesCoder().encode(value.policies));
37632
38018
  parts.push(new ArrayCoder(new InputCoder(), value.inputsCount).encode(value.inputs));
37633
38019
  parts.push(new ArrayCoder(new OutputCoder(), value.outputsCount).encode(value.outputs));
@@ -37639,23 +38025,23 @@ This unreleased fuel-core build may include features and updates not yet support
37639
38025
  let o = offset;
37640
38026
  [decoded, o] = new BigNumberCoder("u64").decode(data, o);
37641
38027
  const scriptGasLimit = decoded;
37642
- [decoded, o] = new NumberCoder("u32").decode(data, o);
38028
+ [decoded, o] = new B256Coder().decode(data, o);
38029
+ const receiptsRoot = decoded;
38030
+ [decoded, o] = new BigNumberCoder("u64").decode(data, o);
37643
38031
  const scriptLength = decoded;
37644
- [decoded, o] = new NumberCoder("u32").decode(data, o);
38032
+ [decoded, o] = new BigNumberCoder("u64").decode(data, o);
37645
38033
  const scriptDataLength = decoded;
37646
38034
  [decoded, o] = new NumberCoder("u32").decode(data, o);
37647
38035
  const policyTypes = decoded;
37648
- [decoded, o] = new NumberCoder("u8").decode(data, o);
38036
+ [decoded, o] = new NumberCoder("u16").decode(data, o);
37649
38037
  const inputsCount = decoded;
37650
- [decoded, o] = new NumberCoder("u8").decode(data, o);
38038
+ [decoded, o] = new NumberCoder("u16").decode(data, o);
37651
38039
  const outputsCount = decoded;
37652
- [decoded, o] = new NumberCoder("u8").decode(data, o);
38040
+ [decoded, o] = new NumberCoder("u16").decode(data, o);
37653
38041
  const witnessesCount = decoded;
37654
- [decoded, o] = new B256Coder().decode(data, o);
37655
- const receiptsRoot = decoded;
37656
- [decoded, o] = new ByteArrayCoder(scriptLength).decode(data, o);
38042
+ [decoded, o] = new ByteArrayCoder(scriptLength.toNumber()).decode(data, o);
37657
38043
  const script = decoded;
37658
- [decoded, o] = new ByteArrayCoder(scriptDataLength).decode(data, o);
38044
+ [decoded, o] = new ByteArrayCoder(scriptDataLength.toNumber()).decode(data, o);
37659
38045
  const scriptData = decoded;
37660
38046
  [decoded, o] = new PoliciesCoder().decode(data, o, policyTypes);
37661
38047
  const policies = decoded;
@@ -37693,18 +38079,19 @@ This unreleased fuel-core build may include features and updates not yet support
37693
38079
  }
37694
38080
  encode(value) {
37695
38081
  const parts = [];
37696
- parts.push(new NumberCoder("u32").encode(value.bytecodeLength));
37697
- parts.push(new NumberCoder("u8").encode(value.bytecodeWitnessIndex));
37698
- parts.push(new NumberCoder("u32").encode(value.policyTypes));
37699
- parts.push(new NumberCoder("u16").encode(value.storageSlotsCount));
37700
- parts.push(new NumberCoder("u8").encode(value.inputsCount));
37701
- parts.push(new NumberCoder("u8").encode(value.outputsCount));
37702
- parts.push(new NumberCoder("u8").encode(value.witnessesCount));
38082
+ parts.push(new NumberCoder("u16").encode(value.bytecodeWitnessIndex));
37703
38083
  parts.push(new B256Coder().encode(value.salt));
37704
- parts.push(new PoliciesCoder().encode(value.policies));
38084
+ parts.push(new BigNumberCoder("u64").encode(value.storageSlotsCount));
38085
+ parts.push(new NumberCoder("u32").encode(value.policyTypes));
38086
+ parts.push(new NumberCoder("u16").encode(value.inputsCount));
38087
+ parts.push(new NumberCoder("u16").encode(value.outputsCount));
38088
+ parts.push(new NumberCoder("u16").encode(value.witnessesCount));
37705
38089
  parts.push(
37706
- new ArrayCoder(new StorageSlotCoder(), value.storageSlotsCount).encode(value.storageSlots)
38090
+ new ArrayCoder(new StorageSlotCoder(), value.storageSlotsCount.toNumber()).encode(
38091
+ value.storageSlots
38092
+ )
37707
38093
  );
38094
+ parts.push(new PoliciesCoder().encode(value.policies));
37708
38095
  parts.push(new ArrayCoder(new InputCoder(), value.inputsCount).encode(value.inputs));
37709
38096
  parts.push(new ArrayCoder(new OutputCoder(), value.outputsCount).encode(value.outputs));
37710
38097
  parts.push(new ArrayCoder(new WitnessCoder(), value.witnessesCount).encode(value.witnesses));
@@ -37713,26 +38100,27 @@ This unreleased fuel-core build may include features and updates not yet support
37713
38100
  decode(data, offset) {
37714
38101
  let decoded;
37715
38102
  let o = offset;
37716
- [decoded, o] = new NumberCoder("u32").decode(data, o);
37717
- const bytecodeLength = decoded;
37718
- [decoded, o] = new NumberCoder("u8").decode(data, o);
38103
+ [decoded, o] = new NumberCoder("u16").decode(data, o);
37719
38104
  const bytecodeWitnessIndex = decoded;
38105
+ [decoded, o] = new B256Coder().decode(data, o);
38106
+ const salt = decoded;
38107
+ [decoded, o] = new BigNumberCoder("u64").decode(data, o);
38108
+ const storageSlotsCount = decoded;
37720
38109
  [decoded, o] = new NumberCoder("u32").decode(data, o);
37721
38110
  const policyTypes = decoded;
37722
38111
  [decoded, o] = new NumberCoder("u16").decode(data, o);
37723
- const storageSlotsCount = decoded;
37724
- [decoded, o] = new NumberCoder("u8").decode(data, o);
37725
38112
  const inputsCount = decoded;
37726
- [decoded, o] = new NumberCoder("u8").decode(data, o);
38113
+ [decoded, o] = new NumberCoder("u16").decode(data, o);
37727
38114
  const outputsCount = decoded;
37728
- [decoded, o] = new NumberCoder("u8").decode(data, o);
38115
+ [decoded, o] = new NumberCoder("u16").decode(data, o);
37729
38116
  const witnessesCount = decoded;
37730
- [decoded, o] = new B256Coder().decode(data, o);
37731
- const salt = decoded;
38117
+ [decoded, o] = new ArrayCoder(new StorageSlotCoder(), storageSlotsCount.toNumber()).decode(
38118
+ data,
38119
+ o
38120
+ );
38121
+ const storageSlots = decoded;
37732
38122
  [decoded, o] = new PoliciesCoder().decode(data, o, policyTypes);
37733
38123
  const policies = decoded;
37734
- [decoded, o] = new ArrayCoder(new StorageSlotCoder(), storageSlotsCount).decode(data, o);
37735
- const storageSlots = decoded;
37736
38124
  [decoded, o] = new ArrayCoder(new InputCoder(), inputsCount).decode(data, o);
37737
38125
  const inputs = decoded;
37738
38126
  [decoded, o] = new ArrayCoder(new OutputCoder(), outputsCount).decode(data, o);
@@ -37742,7 +38130,6 @@ This unreleased fuel-core build may include features and updates not yet support
37742
38130
  return [
37743
38131
  {
37744
38132
  type: 1,
37745
- bytecodeLength,
37746
38133
  bytecodeWitnessIndex,
37747
38134
  policyTypes,
37748
38135
  storageSlotsCount,
@@ -37771,6 +38158,7 @@ This unreleased fuel-core build may include features and updates not yet support
37771
38158
  parts.push(new OutputContractCoder().encode(value.outputContract));
37772
38159
  parts.push(new BigNumberCoder("u64").encode(value.mintAmount));
37773
38160
  parts.push(new B256Coder().encode(value.mintAssetId));
38161
+ parts.push(new BigNumberCoder("u64").encode(value.gasPrice));
37774
38162
  return concat(parts);
37775
38163
  }
37776
38164
  decode(data, offset) {
@@ -37786,6 +38174,8 @@ This unreleased fuel-core build may include features and updates not yet support
37786
38174
  const mintAmount = decoded;
37787
38175
  [decoded, o] = new B256Coder().decode(data, o);
37788
38176
  const mintAssetId = decoded;
38177
+ [decoded, o] = new BigNumberCoder("u64").decode(data, o);
38178
+ const gasPrice = decoded;
37789
38179
  return [
37790
38180
  {
37791
38181
  type: 2,
@@ -37793,7 +38183,8 @@ This unreleased fuel-core build may include features and updates not yet support
37793
38183
  inputContract,
37794
38184
  outputContract,
37795
38185
  mintAmount,
37796
- mintAssetId
38186
+ mintAssetId,
38187
+ gasPrice
37797
38188
  },
37798
38189
  o
37799
38190
  ];
@@ -38100,159 +38491,6 @@ This unreleased fuel-core build may include features and updates not yet support
38100
38491
  // src/providers/provider.ts
38101
38492
  var import_graphql_request = __toESM(require_dist2());
38102
38493
 
38103
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isPlaceholder.js
38104
- function _isPlaceholder(a) {
38105
- return a != null && typeof a === "object" && a["@@functional/placeholder"] === true;
38106
- }
38107
-
38108
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_curry1.js
38109
- function _curry1(fn) {
38110
- return function f1(a) {
38111
- if (arguments.length === 0 || _isPlaceholder(a)) {
38112
- return f1;
38113
- } else {
38114
- return fn.apply(this, arguments);
38115
- }
38116
- };
38117
- }
38118
-
38119
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isArray.js
38120
- var isArray_default = Array.isArray || function _isArray(val) {
38121
- return val != null && val.length >= 0 && Object.prototype.toString.call(val) === "[object Array]";
38122
- };
38123
-
38124
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/type.js
38125
- var type = /* @__PURE__ */ _curry1(function type2(val) {
38126
- return val === null ? "Null" : val === void 0 ? "Undefined" : Object.prototype.toString.call(val).slice(8, -1);
38127
- });
38128
- var type_default = type;
38129
-
38130
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_toISOString.js
38131
- var pad = function pad2(n) {
38132
- return (n < 10 ? "0" : "") + n;
38133
- };
38134
- var _toISOString = typeof Date.prototype.toISOString === "function" ? function _toISOString2(d) {
38135
- return d.toISOString();
38136
- } : function _toISOString3(d) {
38137
- 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";
38138
- };
38139
-
38140
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isInteger.js
38141
- var isInteger_default = Number.isInteger || function _isInteger(n) {
38142
- return n << 0 === n;
38143
- };
38144
-
38145
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_cloneRegExp.js
38146
- function _cloneRegExp(pattern) {
38147
- 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" : ""));
38148
- }
38149
-
38150
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_clone.js
38151
- function _clone(value, deep, map) {
38152
- map || (map = new _ObjectMap());
38153
- if (_isPrimitive(value)) {
38154
- return value;
38155
- }
38156
- var copy = function copy2(copiedValue) {
38157
- var cachedCopy = map.get(value);
38158
- if (cachedCopy) {
38159
- return cachedCopy;
38160
- }
38161
- map.set(value, copiedValue);
38162
- for (var key in value) {
38163
- if (Object.prototype.hasOwnProperty.call(value, key)) {
38164
- copiedValue[key] = deep ? _clone(value[key], true, map) : value[key];
38165
- }
38166
- }
38167
- return copiedValue;
38168
- };
38169
- switch (type_default(value)) {
38170
- case "Object":
38171
- return copy(Object.create(Object.getPrototypeOf(value)));
38172
- case "Array":
38173
- return copy([]);
38174
- case "Date":
38175
- return new Date(value.valueOf());
38176
- case "RegExp":
38177
- return _cloneRegExp(value);
38178
- case "Int8Array":
38179
- case "Uint8Array":
38180
- case "Uint8ClampedArray":
38181
- case "Int16Array":
38182
- case "Uint16Array":
38183
- case "Int32Array":
38184
- case "Uint32Array":
38185
- case "Float32Array":
38186
- case "Float64Array":
38187
- case "BigInt64Array":
38188
- case "BigUint64Array":
38189
- return value.slice();
38190
- default:
38191
- return value;
38192
- }
38193
- }
38194
- function _isPrimitive(param) {
38195
- var type3 = typeof param;
38196
- return param == null || type3 != "object" && type3 != "function";
38197
- }
38198
- var _ObjectMap = /* @__PURE__ */ function() {
38199
- function _ObjectMap2() {
38200
- this.map = {};
38201
- this.length = 0;
38202
- }
38203
- _ObjectMap2.prototype.set = function(key, value) {
38204
- const hashedKey = this.hash(key);
38205
- let bucket = this.map[hashedKey];
38206
- if (!bucket) {
38207
- this.map[hashedKey] = bucket = [];
38208
- }
38209
- bucket.push([key, value]);
38210
- this.length += 1;
38211
- };
38212
- _ObjectMap2.prototype.hash = function(key) {
38213
- let hashedKey = [];
38214
- for (var value in key) {
38215
- hashedKey.push(Object.prototype.toString.call(key[value]));
38216
- }
38217
- return hashedKey.join();
38218
- };
38219
- _ObjectMap2.prototype.get = function(key) {
38220
- if (this.length <= 180) {
38221
- for (const p in this.map) {
38222
- const bucket2 = this.map[p];
38223
- for (let i = 0; i < bucket2.length; i += 1) {
38224
- const element = bucket2[i];
38225
- if (element[0] === key) {
38226
- return element[1];
38227
- }
38228
- }
38229
- }
38230
- return;
38231
- }
38232
- const hashedKey = this.hash(key);
38233
- const bucket = this.map[hashedKey];
38234
- if (!bucket) {
38235
- return;
38236
- }
38237
- for (let i = 0; i < bucket.length; i += 1) {
38238
- const element = bucket[i];
38239
- if (element[0] === key) {
38240
- return element[1];
38241
- }
38242
- }
38243
- };
38244
- return _ObjectMap2;
38245
- }();
38246
-
38247
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/clone.js
38248
- var clone2 = /* @__PURE__ */ _curry1(function clone3(value) {
38249
- return value != null && typeof value.clone === "function" ? value.clone() : _clone(value, true);
38250
- });
38251
- var clone_default = clone2;
38252
-
38253
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/trim.js
38254
- var hasProtoTrim = typeof String.prototype.trim === "function";
38255
-
38256
38494
  // ../../node_modules/.pnpm/tslib@2.6.0/node_modules/tslib/tslib.es6.mjs
38257
38495
  var __assign = function() {
38258
38496
  __assign = Object.assign || function __assign2(t) {
@@ -41418,16 +41656,20 @@ spurious results.`);
41418
41656
  var lib_default2 = gql;
41419
41657
 
41420
41658
  // src/providers/__generated__/operations.ts
41659
+ var TransactionStatusSubscriptionFragmentFragmentDoc = lib_default2`
41660
+ fragment transactionStatusSubscriptionFragment on TransactionStatus {
41661
+ type: __typename
41662
+ ... on SqueezedOutStatus {
41663
+ reason
41664
+ }
41665
+ }
41666
+ `;
41421
41667
  var ReceiptFragmentFragmentDoc = lib_default2`
41422
41668
  fragment receiptFragment on Receipt {
41423
- contract {
41424
- id
41425
- }
41669
+ id
41426
41670
  pc
41427
41671
  is
41428
- to {
41429
- id
41430
- }
41672
+ to
41431
41673
  toAddress
41432
41674
  amount
41433
41675
  assetId
@@ -41465,10 +41707,16 @@ spurious results.`);
41465
41707
  id
41466
41708
  }
41467
41709
  time
41710
+ receipts {
41711
+ ...receiptFragment
41712
+ }
41468
41713
  programState {
41469
41714
  returnType
41470
41715
  data
41471
41716
  }
41717
+ receipts {
41718
+ ...receiptFragment
41719
+ }
41472
41720
  }
41473
41721
  ... on FailureStatus {
41474
41722
  block {
@@ -41476,26 +41724,24 @@ spurious results.`);
41476
41724
  }
41477
41725
  time
41478
41726
  reason
41727
+ receipts {
41728
+ ...receiptFragment
41729
+ }
41479
41730
  }
41480
41731
  ... on SqueezedOutStatus {
41481
41732
  reason
41482
41733
  }
41483
41734
  }
41484
- `;
41735
+ ${ReceiptFragmentFragmentDoc}`;
41485
41736
  var TransactionFragmentFragmentDoc = lib_default2`
41486
41737
  fragment transactionFragment on Transaction {
41487
41738
  id
41488
41739
  rawPayload
41489
- gasPrice
41490
- receipts {
41491
- ...receiptFragment
41492
- }
41493
41740
  status {
41494
41741
  ...transactionStatusFragment
41495
41742
  }
41496
41743
  }
41497
- ${ReceiptFragmentFragmentDoc}
41498
- ${TransactionStatusFragmentFragmentDoc}`;
41744
+ ${TransactionStatusFragmentFragmentDoc}`;
41499
41745
  var InputEstimatePredicatesFragmentFragmentDoc = lib_default2`
41500
41746
  fragment inputEstimatePredicatesFragment on Input {
41501
41747
  ... on InputCoin {
@@ -41513,6 +41759,46 @@ ${TransactionStatusFragmentFragmentDoc}`;
41513
41759
  }
41514
41760
  }
41515
41761
  ${InputEstimatePredicatesFragmentFragmentDoc}`;
41762
+ var DryRunFailureStatusFragmentFragmentDoc = lib_default2`
41763
+ fragment dryRunFailureStatusFragment on DryRunFailureStatus {
41764
+ reason
41765
+ programState {
41766
+ returnType
41767
+ data
41768
+ }
41769
+ }
41770
+ `;
41771
+ var DryRunSuccessStatusFragmentFragmentDoc = lib_default2`
41772
+ fragment dryRunSuccessStatusFragment on DryRunSuccessStatus {
41773
+ programState {
41774
+ returnType
41775
+ data
41776
+ }
41777
+ }
41778
+ `;
41779
+ var DryRunTransactionStatusFragmentFragmentDoc = lib_default2`
41780
+ fragment dryRunTransactionStatusFragment on DryRunTransactionStatus {
41781
+ ... on DryRunFailureStatus {
41782
+ ...dryRunFailureStatusFragment
41783
+ }
41784
+ ... on DryRunSuccessStatus {
41785
+ ...dryRunSuccessStatusFragment
41786
+ }
41787
+ }
41788
+ ${DryRunFailureStatusFragmentFragmentDoc}
41789
+ ${DryRunSuccessStatusFragmentFragmentDoc}`;
41790
+ var DryRunTransactionExecutionStatusFragmentFragmentDoc = lib_default2`
41791
+ fragment dryRunTransactionExecutionStatusFragment on DryRunTransactionExecutionStatus {
41792
+ id
41793
+ status {
41794
+ ...dryRunTransactionStatusFragment
41795
+ }
41796
+ receipts {
41797
+ ...receiptFragment
41798
+ }
41799
+ }
41800
+ ${DryRunTransactionStatusFragmentFragmentDoc}
41801
+ ${ReceiptFragmentFragmentDoc}`;
41516
41802
  var CoinFragmentFragmentDoc = lib_default2`
41517
41803
  fragment coinFragment on Coin {
41518
41804
  __typename
@@ -41520,7 +41806,6 @@ ${TransactionStatusFragmentFragmentDoc}`;
41520
41806
  owner
41521
41807
  amount
41522
41808
  assetId
41523
- maturity
41524
41809
  blockCreated
41525
41810
  txCreatedIdx
41526
41811
  }
@@ -41559,26 +41844,32 @@ ${TransactionStatusFragmentFragmentDoc}`;
41559
41844
  messageBlockHeader {
41560
41845
  id
41561
41846
  daHeight
41847
+ consensusParametersVersion
41848
+ stateTransitionBytecodeVersion
41562
41849
  transactionsCount
41850
+ messageReceiptCount
41563
41851
  transactionsRoot
41852
+ messageOutboxRoot
41853
+ eventInboxRoot
41564
41854
  height
41565
41855
  prevRoot
41566
41856
  time
41567
41857
  applicationHash
41568
- messageReceiptRoot
41569
- messageReceiptCount
41570
41858
  }
41571
41859
  commitBlockHeader {
41572
41860
  id
41573
41861
  daHeight
41862
+ consensusParametersVersion
41863
+ stateTransitionBytecodeVersion
41574
41864
  transactionsCount
41865
+ messageReceiptCount
41575
41866
  transactionsRoot
41867
+ messageOutboxRoot
41868
+ eventInboxRoot
41576
41869
  height
41577
41870
  prevRoot
41578
41871
  time
41579
41872
  applicationHash
41580
- messageReceiptRoot
41581
- messageReceiptCount
41582
41873
  }
41583
41874
  sender
41584
41875
  recipient
@@ -41597,8 +41888,8 @@ ${TransactionStatusFragmentFragmentDoc}`;
41597
41888
  var BlockFragmentFragmentDoc = lib_default2`
41598
41889
  fragment blockFragment on Block {
41599
41890
  id
41891
+ height
41600
41892
  header {
41601
- height
41602
41893
  time
41603
41894
  }
41604
41895
  transactions {
@@ -41608,6 +41899,7 @@ ${TransactionStatusFragmentFragmentDoc}`;
41608
41899
  `;
41609
41900
  var TxParametersFragmentFragmentDoc = lib_default2`
41610
41901
  fragment TxParametersFragment on TxParameters {
41902
+ version
41611
41903
  maxInputs
41612
41904
  maxOutputs
41613
41905
  maxWitnesses
@@ -41617,6 +41909,7 @@ ${TransactionStatusFragmentFragmentDoc}`;
41617
41909
  `;
41618
41910
  var PredicateParametersFragmentFragmentDoc = lib_default2`
41619
41911
  fragment PredicateParametersFragment on PredicateParameters {
41912
+ version
41620
41913
  maxPredicateLength
41621
41914
  maxPredicateDataLength
41622
41915
  maxGasPerPredicate
@@ -41625,18 +41918,21 @@ ${TransactionStatusFragmentFragmentDoc}`;
41625
41918
  `;
41626
41919
  var ScriptParametersFragmentFragmentDoc = lib_default2`
41627
41920
  fragment ScriptParametersFragment on ScriptParameters {
41921
+ version
41628
41922
  maxScriptLength
41629
41923
  maxScriptDataLength
41630
41924
  }
41631
41925
  `;
41632
41926
  var ContractParametersFragmentFragmentDoc = lib_default2`
41633
41927
  fragment ContractParametersFragment on ContractParameters {
41928
+ version
41634
41929
  contractMaxSize
41635
41930
  maxStorageSlots
41636
41931
  }
41637
41932
  `;
41638
41933
  var FeeParametersFragmentFragmentDoc = lib_default2`
41639
41934
  fragment FeeParametersFragment on FeeParameters {
41935
+ version
41640
41936
  gasPriceFactor
41641
41937
  gasPerByte
41642
41938
  }
@@ -41656,6 +41952,7 @@ ${TransactionStatusFragmentFragmentDoc}`;
41656
41952
  `;
41657
41953
  var GasCostsFragmentFragmentDoc = lib_default2`
41658
41954
  fragment GasCostsFragment on GasCosts {
41955
+ version
41659
41956
  add
41660
41957
  addi
41661
41958
  aloc
@@ -41668,7 +41965,6 @@ ${TransactionStatusFragmentFragmentDoc}`;
41668
41965
  cb
41669
41966
  cfei
41670
41967
  cfsi
41671
- croo
41672
41968
  div
41673
41969
  divi
41674
41970
  ecr1
@@ -41751,6 +42047,9 @@ ${TransactionStatusFragmentFragmentDoc}`;
41751
42047
  ccp {
41752
42048
  ...DependentCostFragment
41753
42049
  }
42050
+ croo {
42051
+ ...DependentCostFragment
42052
+ }
41754
42053
  csiz {
41755
42054
  ...DependentCostFragment
41756
42055
  }
@@ -41810,6 +42109,7 @@ ${TransactionStatusFragmentFragmentDoc}`;
41810
42109
  ${DependentCostFragmentFragmentDoc}`;
41811
42110
  var ConsensusParametersFragmentFragmentDoc = lib_default2`
41812
42111
  fragment consensusParametersFragment on ConsensusParameters {
42112
+ version
41813
42113
  txParams {
41814
42114
  ...TxParametersFragment
41815
42115
  }
@@ -41869,18 +42169,9 @@ ${ConsensusParametersFragmentFragmentDoc}`;
41869
42169
  fragment nodeInfoFragment on NodeInfo {
41870
42170
  utxoValidation
41871
42171
  vmBacktrace
41872
- minGasPrice
41873
42172
  maxTx
41874
42173
  maxDepth
41875
42174
  nodeVersion
41876
- peers {
41877
- id
41878
- addresses
41879
- clientVersion
41880
- blockHeight
41881
- lastHeartbeatMs
41882
- appScore
41883
- }
41884
42175
  }
41885
42176
  `;
41886
42177
  var GetVersionDocument = lib_default2`
@@ -41915,13 +42206,9 @@ ${ConsensusParametersFragmentFragmentDoc}`;
41915
42206
  query getTransactionWithReceipts($transactionId: TransactionId!) {
41916
42207
  transaction(id: $transactionId) {
41917
42208
  ...transactionFragment
41918
- receipts {
41919
- ...receiptFragment
41920
- }
41921
42209
  }
41922
42210
  }
41923
- ${TransactionFragmentFragmentDoc}
41924
- ${ReceiptFragmentFragmentDoc}`;
42211
+ ${TransactionFragmentFragmentDoc}`;
41925
42212
  var GetTransactionsDocument = lib_default2`
41926
42213
  query getTransactions($after: String, $before: String, $first: Int, $last: Int) {
41927
42214
  transactions(after: $after, before: $before, first: $first, last: $last) {
@@ -42049,6 +42336,20 @@ ${MessageCoinFragmentFragmentDoc}`;
42049
42336
  }
42050
42337
  }
42051
42338
  ${BalanceFragmentFragmentDoc}`;
42339
+ var GetLatestGasPriceDocument = lib_default2`
42340
+ query getLatestGasPrice {
42341
+ latestGasPrice {
42342
+ gasPrice
42343
+ }
42344
+ }
42345
+ `;
42346
+ var EstimateGasPriceDocument = lib_default2`
42347
+ query estimateGasPrice($blockHorizon: U32!) {
42348
+ estimateGasPrice(blockHorizon: $blockHorizon) {
42349
+ gasPrice
42350
+ }
42351
+ }
42352
+ `;
42052
42353
  var GetBalancesDocument = lib_default2`
42053
42354
  query getBalances($filter: BalanceFilterInput!, $after: String, $before: String, $first: Int, $last: Int) {
42054
42355
  balances(
@@ -42103,12 +42404,12 @@ ${MessageCoinFragmentFragmentDoc}`;
42103
42404
  }
42104
42405
  `;
42105
42406
  var DryRunDocument = lib_default2`
42106
- mutation dryRun($encodedTransaction: HexString!, $utxoValidation: Boolean) {
42107
- dryRun(tx: $encodedTransaction, utxoValidation: $utxoValidation) {
42108
- ...receiptFragment
42407
+ mutation dryRun($encodedTransactions: [HexString!]!, $utxoValidation: Boolean) {
42408
+ dryRun(txs: $encodedTransactions, utxoValidation: $utxoValidation) {
42409
+ ...dryRunTransactionExecutionStatusFragment
42109
42410
  }
42110
42411
  }
42111
- ${ReceiptFragmentFragmentDoc}`;
42412
+ ${DryRunTransactionExecutionStatusFragmentFragmentDoc}`;
42112
42413
  var SubmitDocument = lib_default2`
42113
42414
  mutation submit($encodedTransaction: HexString!) {
42114
42415
  submit(tx: $encodedTransaction) {
@@ -42127,17 +42428,17 @@ ${MessageCoinFragmentFragmentDoc}`;
42127
42428
  var SubmitAndAwaitDocument = lib_default2`
42128
42429
  subscription submitAndAwait($encodedTransaction: HexString!) {
42129
42430
  submitAndAwait(tx: $encodedTransaction) {
42130
- ...transactionStatusFragment
42431
+ ...transactionStatusSubscriptionFragment
42131
42432
  }
42132
42433
  }
42133
- ${TransactionStatusFragmentFragmentDoc}`;
42434
+ ${TransactionStatusSubscriptionFragmentFragmentDoc}`;
42134
42435
  var StatusChangeDocument = lib_default2`
42135
42436
  subscription statusChange($transactionId: TransactionId!) {
42136
42437
  statusChange(id: $transactionId) {
42137
- ...transactionStatusFragment
42438
+ ...transactionStatusSubscriptionFragment
42138
42439
  }
42139
42440
  }
42140
- ${TransactionStatusFragmentFragmentDoc}`;
42441
+ ${TransactionStatusSubscriptionFragmentFragmentDoc}`;
42141
42442
  function getSdk(requester) {
42142
42443
  return {
42143
42444
  getVersion(variables, options) {
@@ -42191,6 +42492,12 @@ ${MessageCoinFragmentFragmentDoc}`;
42191
42492
  getBalance(variables, options) {
42192
42493
  return requester(GetBalanceDocument, variables, options);
42193
42494
  },
42495
+ getLatestGasPrice(variables, options) {
42496
+ return requester(GetLatestGasPriceDocument, variables, options);
42497
+ },
42498
+ estimateGasPrice(variables, options) {
42499
+ return requester(EstimateGasPriceDocument, variables, options);
42500
+ },
42194
42501
  getBalances(variables, options) {
42195
42502
  return requester(GetBalancesDocument, variables, options);
42196
42503
  },
@@ -42355,6 +42662,9 @@ ${MessageCoinFragmentFragmentDoc}`;
42355
42662
  }
42356
42663
  };
42357
42664
 
42665
+ // ../address/dist/configs.mjs
42666
+ var ZeroBytes32 = "0x0000000000000000000000000000000000000000000000000000000000000000";
42667
+
42358
42668
  // src/providers/transaction-request/input.ts
42359
42669
  var inputify = (value) => {
42360
42670
  const { type: type3 } = value;
@@ -42374,10 +42684,9 @@ ${MessageCoinFragmentFragmentDoc}`;
42374
42684
  txIndex: toNumber2(arrayify(value.txPointer).slice(8, 16))
42375
42685
  },
42376
42686
  witnessIndex: value.witnessIndex,
42377
- maturity: value.maturity ?? 0,
42378
42687
  predicateGasUsed: bn(value.predicateGasUsed),
42379
- predicateLength: predicate.length,
42380
- predicateDataLength: predicateData.length,
42688
+ predicateLength: bn(predicate.length),
42689
+ predicateDataLength: bn(predicateData.length),
42381
42690
  predicate: hexlify(predicate),
42382
42691
  predicateData: hexlify(predicateData)
42383
42692
  };
@@ -42408,8 +42717,8 @@ ${MessageCoinFragmentFragmentDoc}`;
42408
42717
  nonce: hexlify(value.nonce),
42409
42718
  witnessIndex: value.witnessIndex,
42410
42719
  predicateGasUsed: bn(value.predicateGasUsed),
42411
- predicateLength: predicate.length,
42412
- predicateDataLength: predicateData.length,
42720
+ predicateLength: bn(predicate.length),
42721
+ predicateDataLength: bn(predicateData.length),
42413
42722
  predicate: hexlify(predicate),
42414
42723
  predicateData: hexlify(predicateData),
42415
42724
  data: hexlify(data),
@@ -42566,8 +42875,8 @@ ${MessageCoinFragmentFragmentDoc}`;
42566
42875
  case "CALL" /* Call */: {
42567
42876
  const callReceipt = {
42568
42877
  type: ReceiptType.Call,
42569
- from: hexOrZero(receipt.contract?.id),
42570
- to: hexOrZero(receipt?.to?.id),
42878
+ from: hexOrZero(receipt.id || receipt.contractId),
42879
+ to: hexOrZero(receipt?.to),
42571
42880
  amount: bn(receipt.amount),
42572
42881
  assetId: hexOrZero(receipt.assetId),
42573
42882
  gas: bn(receipt.gas),
@@ -42581,7 +42890,7 @@ ${MessageCoinFragmentFragmentDoc}`;
42581
42890
  case "RETURN" /* Return */: {
42582
42891
  const returnReceipt = {
42583
42892
  type: ReceiptType.Return,
42584
- id: hexOrZero(receipt.contract?.id),
42893
+ id: hexOrZero(receipt.id || receipt.contractId),
42585
42894
  val: bn(receipt.val),
42586
42895
  pc: bn(receipt.pc),
42587
42896
  is: bn(receipt.is)
@@ -42591,7 +42900,7 @@ ${MessageCoinFragmentFragmentDoc}`;
42591
42900
  case "RETURN_DATA" /* ReturnData */: {
42592
42901
  const returnDataReceipt = {
42593
42902
  type: ReceiptType.ReturnData,
42594
- id: hexOrZero(receipt.contract?.id),
42903
+ id: hexOrZero(receipt.id || receipt.contractId),
42595
42904
  ptr: bn(receipt.ptr),
42596
42905
  len: bn(receipt.len),
42597
42906
  digest: hexOrZero(receipt.digest),
@@ -42603,7 +42912,7 @@ ${MessageCoinFragmentFragmentDoc}`;
42603
42912
  case "PANIC" /* Panic */: {
42604
42913
  const panicReceipt = {
42605
42914
  type: ReceiptType.Panic,
42606
- id: hexOrZero(receipt.contract?.id),
42915
+ id: hexOrZero(receipt.id),
42607
42916
  reason: bn(receipt.reason),
42608
42917
  pc: bn(receipt.pc),
42609
42918
  is: bn(receipt.is),
@@ -42614,7 +42923,7 @@ ${MessageCoinFragmentFragmentDoc}`;
42614
42923
  case "REVERT" /* Revert */: {
42615
42924
  const revertReceipt = {
42616
42925
  type: ReceiptType.Revert,
42617
- id: hexOrZero(receipt.contract?.id),
42926
+ id: hexOrZero(receipt.id || receipt.contractId),
42618
42927
  val: bn(receipt.ra),
42619
42928
  pc: bn(receipt.pc),
42620
42929
  is: bn(receipt.is)
@@ -42624,7 +42933,7 @@ ${MessageCoinFragmentFragmentDoc}`;
42624
42933
  case "LOG" /* Log */: {
42625
42934
  const logReceipt = {
42626
42935
  type: ReceiptType.Log,
42627
- id: hexOrZero(receipt.contract?.id),
42936
+ id: hexOrZero(receipt.id || receipt.contractId),
42628
42937
  val0: bn(receipt.ra),
42629
42938
  val1: bn(receipt.rb),
42630
42939
  val2: bn(receipt.rc),
@@ -42637,7 +42946,7 @@ ${MessageCoinFragmentFragmentDoc}`;
42637
42946
  case "LOG_DATA" /* LogData */: {
42638
42947
  const logDataReceipt = {
42639
42948
  type: ReceiptType.LogData,
42640
- id: hexOrZero(receipt.contract?.id),
42949
+ id: hexOrZero(receipt.id || receipt.contractId),
42641
42950
  val0: bn(receipt.ra),
42642
42951
  val1: bn(receipt.rb),
42643
42952
  ptr: bn(receipt.ptr),
@@ -42651,8 +42960,8 @@ ${MessageCoinFragmentFragmentDoc}`;
42651
42960
  case "TRANSFER" /* Transfer */: {
42652
42961
  const transferReceipt = {
42653
42962
  type: ReceiptType.Transfer,
42654
- from: hexOrZero(receipt.contract?.id),
42655
- to: hexOrZero(receipt.toAddress || receipt?.to?.id),
42963
+ from: hexOrZero(receipt.id || receipt.contractId),
42964
+ to: hexOrZero(receipt.toAddress || receipt?.to),
42656
42965
  amount: bn(receipt.amount),
42657
42966
  assetId: hexOrZero(receipt.assetId),
42658
42967
  pc: bn(receipt.pc),
@@ -42663,8 +42972,8 @@ ${MessageCoinFragmentFragmentDoc}`;
42663
42972
  case "TRANSFER_OUT" /* TransferOut */: {
42664
42973
  const transferOutReceipt = {
42665
42974
  type: ReceiptType.TransferOut,
42666
- from: hexOrZero(receipt.contract?.id),
42667
- to: hexOrZero(receipt.toAddress || receipt.to?.id),
42975
+ from: hexOrZero(receipt.id || receipt.contractId),
42976
+ to: hexOrZero(receipt.toAddress || receipt.to),
42668
42977
  amount: bn(receipt.amount),
42669
42978
  assetId: hexOrZero(receipt.assetId),
42670
42979
  pc: bn(receipt.pc),
@@ -42707,7 +43016,7 @@ ${MessageCoinFragmentFragmentDoc}`;
42707
43016
  return receiptMessageOut;
42708
43017
  }
42709
43018
  case "MINT" /* Mint */: {
42710
- const contractId = hexOrZero(receipt.contract?.id);
43019
+ const contractId = hexOrZero(receipt.id || receipt.contractId);
42711
43020
  const subId = hexOrZero(receipt.subId);
42712
43021
  const assetId = ReceiptMintCoder.getAssetId(contractId, subId);
42713
43022
  const mintReceipt = {
@@ -42722,7 +43031,7 @@ ${MessageCoinFragmentFragmentDoc}`;
42722
43031
  return mintReceipt;
42723
43032
  }
42724
43033
  case "BURN" /* Burn */: {
42725
- const contractId = hexOrZero(receipt.contract?.id);
43034
+ const contractId = hexOrZero(receipt.id || receipt.contractId);
42726
43035
  const subId = hexOrZero(receipt.subId);
42727
43036
  const assetId = ReceiptBurnCoder.getAssetId(contractId, subId);
42728
43037
  const burnReceipt = {
@@ -42742,7 +43051,6 @@ ${MessageCoinFragmentFragmentDoc}`;
42742
43051
  }
42743
43052
 
42744
43053
  // src/providers/utils/gas.ts
42745
- var calculatePriceWithFactor = (gas, gasPrice, priceFactor) => bn(Math.ceil(gas.mul(gasPrice).toNumber() / priceFactor.toNumber()));
42746
43054
  var getGasUsedFromReceipts = (receipts) => {
42747
43055
  const scriptResult = receipts.filter(
42748
43056
  (receipt) => receipt.type === ReceiptType.ScriptResult
@@ -42763,18 +43071,28 @@ ${MessageCoinFragmentFragmentDoc}`;
42763
43071
  }
42764
43072
  function gasUsedByInputs(inputs, txBytesSize, gasCosts) {
42765
43073
  const witnessCache = [];
42766
- const totalGas = inputs.reduce((total, input) => {
43074
+ const chargeableInputs = inputs.filter((input) => {
43075
+ const isCoinOrMessage = "owner" in input || "sender" in input;
43076
+ if (isCoinOrMessage) {
43077
+ if ("predicate" in input && input.predicate && input.predicate !== "0x") {
43078
+ return true;
43079
+ }
43080
+ if (!witnessCache.includes(input.witnessIndex)) {
43081
+ witnessCache.push(input.witnessIndex);
43082
+ return true;
43083
+ }
43084
+ }
43085
+ return false;
43086
+ });
43087
+ const vmInitializationCost = resolveGasDependentCosts(txBytesSize, gasCosts.vmInitialization);
43088
+ const totalGas = chargeableInputs.reduce((total, input) => {
42767
43089
  if ("predicate" in input && input.predicate && input.predicate !== "0x") {
42768
43090
  return total.add(
42769
- resolveGasDependentCosts(txBytesSize, gasCosts.vmInitialization).add(resolveGasDependentCosts(arrayify(input.predicate).length, gasCosts.contractRoot)).add(bn(input.predicateGasUsed))
43091
+ vmInitializationCost.add(resolveGasDependentCosts(arrayify(input.predicate).length, gasCosts.contractRoot)).add(bn(input.predicateGasUsed))
42770
43092
  );
42771
43093
  }
42772
- if ("witnessIndex" in input && !witnessCache.includes(input.witnessIndex)) {
42773
- witnessCache.push(input.witnessIndex);
42774
- return total.add(gasCosts.ecr1);
42775
- }
42776
- return total;
42777
- }, bn());
43094
+ return total.add(gasCosts.ecr1);
43095
+ }, bn(0));
42778
43096
  return totalGas;
42779
43097
  }
42780
43098
  function getMinGas(params) {
@@ -42786,12 +43104,20 @@ ${MessageCoinFragmentFragmentDoc}`;
42786
43104
  return minGas;
42787
43105
  }
42788
43106
  function getMaxGas(params) {
42789
- const { gasPerByte, witnessesLength, witnessLimit, minGas, gasLimit = bn(0) } = params;
43107
+ const {
43108
+ gasPerByte,
43109
+ witnessesLength,
43110
+ witnessLimit,
43111
+ minGas,
43112
+ gasLimit = bn(0),
43113
+ maxGasPerTx
43114
+ } = params;
42790
43115
  let remainingAllowedWitnessGas = bn(0);
42791
43116
  if (witnessLimit?.gt(0) && witnessLimit.gte(witnessesLength)) {
42792
43117
  remainingAllowedWitnessGas = bn(witnessLimit).sub(witnessesLength).mul(gasPerByte);
42793
43118
  }
42794
- return remainingAllowedWitnessGas.add(minGas).add(gasLimit);
43119
+ const maxGas = remainingAllowedWitnessGas.add(minGas).add(gasLimit);
43120
+ return maxGas.gte(maxGasPerTx) ? maxGasPerTx : maxGas;
42795
43121
  }
42796
43122
  function calculateMetadataGasForTxCreate({
42797
43123
  gasCosts,
@@ -42813,6 +43139,10 @@ ${MessageCoinFragmentFragmentDoc}`;
42813
43139
  }) {
42814
43140
  return resolveGasDependentCosts(txBytesSize, gasCosts.s256);
42815
43141
  }
43142
+ var calculateGasFee = (params) => {
43143
+ const { gas, gasPrice, priceFactor, tip } = params;
43144
+ return gas.mul(gasPrice).div(priceFactor).add(tip);
43145
+ };
42816
43146
 
42817
43147
  // src/providers/utils/json.ts
42818
43148
  function normalize2(object) {
@@ -42942,7 +43272,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42942
43272
  // src/providers/transaction-request/transaction-request.ts
42943
43273
  var BaseTransactionRequest = class {
42944
43274
  /** Gas price for transaction */
42945
- gasPrice;
43275
+ tip;
42946
43276
  /** Block until which tx cannot be included */
42947
43277
  maturity;
42948
43278
  /** The maximum fee payable by this transaction using BASE_ASSET. */
@@ -42961,7 +43291,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42961
43291
  * @param baseTransactionRequest - Optional object containing properties to initialize the transaction request.
42962
43292
  */
42963
43293
  constructor({
42964
- gasPrice,
43294
+ tip,
42965
43295
  maturity,
42966
43296
  maxFee,
42967
43297
  witnessLimit,
@@ -42969,7 +43299,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42969
43299
  outputs,
42970
43300
  witnesses
42971
43301
  } = {}) {
42972
- this.gasPrice = bn(gasPrice);
43302
+ this.tip = bn(tip);
42973
43303
  this.maturity = maturity ?? 0;
42974
43304
  this.witnessLimit = witnessLimit ? bn(witnessLimit) : void 0;
42975
43305
  this.maxFee = maxFee ? bn(maxFee) : void 0;
@@ -42980,9 +43310,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42980
43310
  static getPolicyMeta(req) {
42981
43311
  let policyTypes = 0;
42982
43312
  const policies = [];
42983
- if (req.gasPrice) {
42984
- policyTypes += PolicyType.GasPrice;
42985
- policies.push({ data: req.gasPrice, type: PolicyType.GasPrice });
43313
+ if (req.tip) {
43314
+ policyTypes += PolicyType.Tip;
43315
+ policies.push({ data: req.tip, type: PolicyType.Tip });
42986
43316
  }
42987
43317
  if (req.witnessLimit) {
42988
43318
  policyTypes += PolicyType.WitnessLimit;
@@ -43166,13 +43496,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43166
43496
  * assetId, if one it was not added yet.
43167
43497
  *
43168
43498
  * @param coin - Coin resource.
43169
- * @param predicate - Predicate bytes.
43170
- * @param predicateData - Predicate data bytes.
43171
43499
  */
43172
- addCoinInput(coin, predicate) {
43500
+ addCoinInput(coin) {
43173
43501
  const { assetId, owner, amount } = coin;
43174
43502
  let witnessIndex;
43175
- if (predicate) {
43503
+ if (coin.predicate) {
43176
43504
  witnessIndex = 0;
43177
43505
  } else {
43178
43506
  witnessIndex = this.getCoinInputWitnessIndexByOwner(owner);
@@ -43187,25 +43515,21 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43187
43515
  amount,
43188
43516
  assetId,
43189
43517
  txPointer: "0x00000000000000000000000000000000",
43190
- witnessIndex,
43191
- predicate: predicate?.bytes
43518
+ witnessIndex
43192
43519
  };
43193
43520
  this.pushInput(input);
43194
43521
  this.addChangeOutput(owner, assetId);
43195
43522
  }
43196
43523
  /**
43197
43524
  * Adds a single message input to the transaction and a change output for the
43198
- * baseAssetId, if one it was not added yet.
43525
+ * asset against the message
43199
43526
  *
43200
43527
  * @param message - Message resource.
43201
- * @param predicate - Predicate bytes.
43202
- * @param predicateData - Predicate data bytes.
43203
43528
  */
43204
- addMessageInput(message, predicate) {
43205
- const { recipient, sender, amount } = message;
43206
- const assetId = BaseAssetId;
43529
+ addMessageInput(message) {
43530
+ const { recipient, sender, amount, assetId } = message;
43207
43531
  let witnessIndex;
43208
- if (predicate) {
43532
+ if (message.predicate) {
43209
43533
  witnessIndex = 0;
43210
43534
  } else {
43211
43535
  witnessIndex = this.getCoinInputWitnessIndexByOwner(recipient);
@@ -43219,8 +43543,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43219
43543
  sender: sender.toB256(),
43220
43544
  recipient: recipient.toB256(),
43221
43545
  amount,
43222
- witnessIndex,
43223
- predicate: predicate?.bytes
43546
+ witnessIndex
43224
43547
  };
43225
43548
  this.pushInput(input);
43226
43549
  this.addChangeOutput(recipient, assetId);
@@ -43251,32 +43574,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43251
43574
  resources.forEach((resource) => this.addResource(resource));
43252
43575
  return this;
43253
43576
  }
43254
- /**
43255
- * Adds multiple resources to the transaction by adding coin/message inputs and change
43256
- * outputs from the related assetIds.
43257
- *
43258
- * @param resources - The resources to add.
43259
- * @returns This transaction.
43260
- */
43261
- addPredicateResource(resource, predicate) {
43262
- if (isCoin(resource)) {
43263
- this.addCoinInput(resource, predicate);
43264
- } else {
43265
- this.addMessageInput(resource, predicate);
43266
- }
43267
- return this;
43268
- }
43269
- /**
43270
- * Adds multiple predicate coin/message inputs to the transaction and change outputs
43271
- * from the related assetIds.
43272
- *
43273
- * @param resources - The resources to add.
43274
- * @returns This transaction.
43275
- */
43276
- addPredicateResources(resources, predicate) {
43277
- resources.forEach((resource) => this.addPredicateResource(resource, predicate));
43278
- return this;
43279
- }
43280
43577
  /**
43281
43578
  * Adds a coin output to the transaction.
43282
43579
  *
@@ -43284,7 +43581,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43284
43581
  * @param amount - Amount of coin.
43285
43582
  * @param assetId - Asset ID of coin.
43286
43583
  */
43287
- addCoinOutput(to, amount, assetId = BaseAssetId) {
43584
+ addCoinOutput(to, amount, assetId) {
43288
43585
  this.pushOutput({
43289
43586
  type: OutputType.Coin,
43290
43587
  to: addressify(to).toB256(),
@@ -43316,7 +43613,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43316
43613
  * @param to - Address of the owner.
43317
43614
  * @param assetId - Asset ID of coin.
43318
43615
  */
43319
- addChangeOutput(to, assetId = BaseAssetId) {
43616
+ addChangeOutput(to, assetId) {
43320
43617
  const changeOutput = this.getChangeOutputs().find(
43321
43618
  (output3) => hexlify(output3.assetId) === assetId
43322
43619
  );
@@ -43356,7 +43653,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43356
43653
  }
43357
43654
  calculateMaxGas(chainInfo, minGas) {
43358
43655
  const { consensusParameters } = chainInfo;
43359
- const { gasPerByte } = consensusParameters;
43656
+ const { gasPerByte, maxGasPerTx } = consensusParameters;
43360
43657
  const witnessesLength = this.toTransaction().witnesses.reduce(
43361
43658
  (acc, wit) => acc + wit.dataLength,
43362
43659
  0
@@ -43365,7 +43662,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43365
43662
  gasPerByte,
43366
43663
  minGas,
43367
43664
  witnessesLength,
43368
- witnessLimit: this.witnessLimit
43665
+ witnessLimit: this.witnessLimit,
43666
+ maxGasPerTx
43369
43667
  });
43370
43668
  }
43371
43669
  /**
@@ -43373,8 +43671,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43373
43671
  * quantities array.
43374
43672
  *
43375
43673
  * @param quantities - CoinQuantity Array.
43674
+ * @param baseAssetId - The base asset to fund the transaction.
43376
43675
  */
43377
- fundWithFakeUtxos(quantities, resourcesOwner) {
43676
+ fundWithFakeUtxos(quantities, baseAssetId, resourcesOwner) {
43378
43677
  const findAssetInput = (assetId) => this.inputs.find((input) => {
43379
43678
  if ("assetId" in input) {
43380
43679
  return input.assetId === assetId;
@@ -43383,24 +43682,27 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43383
43682
  });
43384
43683
  const updateAssetInput = (assetId, quantity) => {
43385
43684
  const assetInput = findAssetInput(assetId);
43685
+ let usedQuantity = quantity;
43686
+ if (assetId === baseAssetId) {
43687
+ usedQuantity = bn("1000000000000000000");
43688
+ }
43386
43689
  if (assetInput && "assetId" in assetInput) {
43387
43690
  assetInput.id = hexlify(randomBytes22(UTXO_ID_LEN));
43388
- assetInput.amount = quantity;
43691
+ assetInput.amount = usedQuantity;
43389
43692
  } else {
43390
43693
  this.addResources([
43391
43694
  {
43392
43695
  id: hexlify(randomBytes22(UTXO_ID_LEN)),
43393
- amount: quantity,
43696
+ amount: usedQuantity,
43394
43697
  assetId,
43395
43698
  owner: resourcesOwner || Address.fromRandom(),
43396
- maturity: 0,
43397
43699
  blockCreated: bn(1),
43398
43700
  txCreatedIdx: bn(1)
43399
43701
  }
43400
43702
  ]);
43401
43703
  }
43402
43704
  };
43403
- updateAssetInput(BaseAssetId, bn(1e11));
43705
+ updateAssetInput(baseAssetId, bn(1e11));
43404
43706
  quantities.forEach((q) => updateAssetInput(q.assetId, q.amount));
43405
43707
  }
43406
43708
  /**
@@ -43425,7 +43727,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43425
43727
  toJSON() {
43426
43728
  return normalizeJSON(this);
43427
43729
  }
43428
- updatePredicateInputs(inputs) {
43730
+ updatePredicateGasUsed(inputs) {
43429
43731
  this.inputs.forEach((i) => {
43430
43732
  let correspondingInput;
43431
43733
  switch (i.type) {
@@ -43447,6 +43749,15 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43447
43749
  }
43448
43750
  });
43449
43751
  }
43752
+ shiftPredicateData() {
43753
+ this.inputs.forEach((input) => {
43754
+ if ("predicateData" in input && "padPredicateData" in input && typeof input.padPredicateData === "function") {
43755
+ input.predicateData = input.padPredicateData(
43756
+ BaseTransactionRequest.getPolicyMeta(this).policies.length
43757
+ );
43758
+ }
43759
+ });
43760
+ }
43450
43761
  };
43451
43762
 
43452
43763
  // src/providers/transaction-request/hash-transaction.ts
@@ -43557,12 +43868,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43557
43868
  *
43558
43869
  * @param createTransactionRequestLike - The initial values for the instance
43559
43870
  */
43560
- constructor({
43561
- bytecodeWitnessIndex,
43562
- salt,
43563
- storageSlots,
43564
- ...rest
43565
- } = {}) {
43871
+ constructor({ bytecodeWitnessIndex, salt, storageSlots, ...rest }) {
43566
43872
  super(rest);
43567
43873
  this.bytecodeWitnessIndex = bytecodeWitnessIndex ?? 0;
43568
43874
  this.salt = hexlify(salt ?? ZeroBytes32);
@@ -43580,9 +43886,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43580
43886
  return {
43581
43887
  type: TransactionType.Create,
43582
43888
  ...baseTransaction,
43583
- bytecodeLength: baseTransaction.witnesses[bytecodeWitnessIndex].dataLength / 4,
43584
43889
  bytecodeWitnessIndex,
43585
- storageSlotsCount: storageSlots.length,
43890
+ storageSlotsCount: bn(storageSlots.length),
43586
43891
  salt: this.salt ? hexlify(this.salt) : ZeroBytes32,
43587
43892
  storageSlots
43588
43893
  };
@@ -43696,8 +44001,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43696
44001
  type: TransactionType.Script,
43697
44002
  scriptGasLimit: this.gasLimit,
43698
44003
  ...super.getBaseTransaction(),
43699
- scriptLength: script.length,
43700
- scriptDataLength: scriptData.length,
44004
+ scriptLength: bn(script.length),
44005
+ scriptDataLength: bn(scriptData.length),
43701
44006
  receiptsRoot: ZeroBytes32,
43702
44007
  script: hexlify(script),
43703
44008
  scriptData: hexlify(scriptData)
@@ -43761,7 +44066,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43761
44066
  }
43762
44067
  calculateMaxGas(chainInfo, minGas) {
43763
44068
  const { consensusParameters } = chainInfo;
43764
- const { gasPerByte } = consensusParameters;
44069
+ const { gasPerByte, maxGasPerTx } = consensusParameters;
43765
44070
  const witnessesLength = this.toTransaction().witnesses.reduce(
43766
44071
  (acc, wit) => acc + wit.dataLength,
43767
44072
  0
@@ -43771,7 +44076,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43771
44076
  minGas,
43772
44077
  witnessesLength,
43773
44078
  witnessLimit: this.witnessLimit,
43774
- gasLimit: this.gasLimit
44079
+ gasLimit: this.gasLimit,
44080
+ maxGasPerTx
43775
44081
  });
43776
44082
  }
43777
44083
  /**
@@ -43844,13 +44150,29 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43844
44150
  }
43845
44151
  }
43846
44152
  };
44153
+ var cacheTxInputsFromOwner = (inputs, owner) => inputs.reduce(
44154
+ (acc, input) => {
44155
+ if (input.type === InputType.Coin && input.owner === owner) {
44156
+ acc.utxos.push(input.id);
44157
+ }
44158
+ if (input.type === InputType.Message && input.recipient === owner) {
44159
+ acc.messages.push(input.nonce);
44160
+ }
44161
+ return acc;
44162
+ },
44163
+ {
44164
+ utxos: [],
44165
+ messages: []
44166
+ }
44167
+ );
43847
44168
 
43848
44169
  // src/providers/transaction-summary/calculate-transaction-fee.ts
43849
44170
  var calculateTransactionFee = (params) => {
43850
44171
  const {
43851
- gasUsed,
44172
+ gasPrice,
43852
44173
  rawPayload,
43853
- consensusParameters: { gasCosts, feeParams }
44174
+ tip,
44175
+ consensusParameters: { gasCosts, feeParams, maxGasPerTx }
43854
44176
  } = params;
43855
44177
  const gasPerByte = bn(feeParams.gasPerByte);
43856
44178
  const gasPriceFactor = bn(feeParams.gasPriceFactor);
@@ -43860,8 +44182,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43860
44182
  return {
43861
44183
  fee: bn(0),
43862
44184
  minFee: bn(0),
43863
- maxFee: bn(0),
43864
- feeFromGasUsed: bn(0)
44185
+ maxFee: bn(0)
43865
44186
  };
43866
44187
  }
43867
44188
  const { type: type3, witnesses, inputs, policies } = transaction;
@@ -43893,7 +44214,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43893
44214
  metadataGas,
43894
44215
  txBytesSize: transactionBytes.length
43895
44216
  });
43896
- const gasPrice = bn(policies.find((policy) => policy.type === PolicyType.GasPrice)?.data);
43897
44217
  const witnessLimit = policies.find((policy) => policy.type === PolicyType.WitnessLimit)?.data;
43898
44218
  const witnessesLength = witnesses.reduce((acc, wit) => acc + wit.dataLength, 0);
43899
44219
  const maxGas = getMaxGas({
@@ -43901,17 +44221,25 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43901
44221
  minGas,
43902
44222
  witnessesLength,
43903
44223
  gasLimit,
43904
- witnessLimit
44224
+ witnessLimit,
44225
+ maxGasPerTx
44226
+ });
44227
+ const minFee = calculateGasFee({
44228
+ gasPrice,
44229
+ gas: minGas,
44230
+ priceFactor: gasPriceFactor,
44231
+ tip
44232
+ });
44233
+ const maxFee = calculateGasFee({
44234
+ gasPrice,
44235
+ gas: maxGas,
44236
+ priceFactor: gasPriceFactor,
44237
+ tip
43905
44238
  });
43906
- const feeFromGasUsed = calculatePriceWithFactor(gasUsed, gasPrice, gasPriceFactor);
43907
- const minFee = calculatePriceWithFactor(minGas, gasPrice, gasPriceFactor);
43908
- const maxFee = calculatePriceWithFactor(maxGas, gasPrice, gasPriceFactor);
43909
- const fee = minFee.add(feeFromGasUsed);
43910
44239
  return {
43911
- fee,
43912
44240
  minFee,
43913
44241
  maxFee,
43914
- feeFromGasUsed
44242
+ fee: maxFee
43915
44243
  };
43916
44244
  };
43917
44245
 
@@ -44465,7 +44793,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44465
44793
  gqlTransactionStatus,
44466
44794
  abiMap = {},
44467
44795
  maxInputs,
44468
- gasCosts
44796
+ gasCosts,
44797
+ maxGasPerTx,
44798
+ gasPrice
44469
44799
  } = params;
44470
44800
  const gasUsed = getGasUsedFromReceipts(receipts);
44471
44801
  const rawPayload = hexlify(transactionBytes);
@@ -44479,11 +44809,14 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44479
44809
  maxInputs
44480
44810
  });
44481
44811
  const typeName = getTransactionTypeName(transaction.type);
44812
+ const tip = bn(transaction.policies?.find((policy) => policy.type === PolicyType.Tip)?.data);
44482
44813
  const { fee } = calculateTransactionFee({
44483
- gasUsed,
44814
+ gasPrice,
44484
44815
  rawPayload,
44816
+ tip,
44485
44817
  consensusParameters: {
44486
44818
  gasCosts,
44819
+ maxGasPerTx,
44487
44820
  feeParams: {
44488
44821
  gasPerByte,
44489
44822
  gasPriceFactor
@@ -44619,8 +44952,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44619
44952
  const decodedTransaction = this.decodeTransaction(
44620
44953
  transaction
44621
44954
  );
44622
- const receipts = transaction.receipts?.map(processGqlReceipt) || [];
44623
- const { gasPerByte, gasPriceFactor, gasCosts } = this.provider.getGasConfig();
44955
+ let txReceipts = [];
44956
+ if (transaction?.status && "receipts" in transaction.status) {
44957
+ txReceipts = transaction.status.receipts;
44958
+ }
44959
+ const receipts = txReceipts.map(processGqlReceipt) || [];
44960
+ const { gasPerByte, gasPriceFactor, gasCosts, maxGasPerTx } = this.provider.getGasConfig();
44961
+ const gasPrice = await this.provider.getLatestGasPrice();
44624
44962
  const maxInputs = this.provider.getChain().consensusParameters.maxInputs;
44625
44963
  const transactionSummary = assembleTransactionSummary({
44626
44964
  id: this.id,
@@ -44632,7 +44970,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44632
44970
  gasPriceFactor,
44633
44971
  abiMap: contractsAbiMap,
44634
44972
  maxInputs,
44635
- gasCosts
44973
+ gasCosts,
44974
+ maxGasPerTx,
44975
+ gasPrice
44636
44976
  });
44637
44977
  return transactionSummary;
44638
44978
  }
@@ -44738,7 +45078,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44738
45078
  }
44739
45079
 
44740
45080
  // src/providers/utils/merge-quantities.ts
44741
- var mergeQuantities = (arr1, arr2) => {
45081
+ var mergeQuantities = (...coinQuantities) => {
44742
45082
  const resultMap = {};
44743
45083
  function addToMap({ amount, assetId }) {
44744
45084
  if (resultMap[assetId]) {
@@ -44747,8 +45087,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44747
45087
  resultMap[assetId] = amount;
44748
45088
  }
44749
45089
  }
44750
- arr1.forEach(addToMap);
44751
- arr2.forEach(addToMap);
45090
+ coinQuantities.forEach((arr) => arr.forEach(addToMap));
44752
45091
  return Object.entries(resultMap).map(([assetId, amount]) => ({ assetId, amount }));
44753
45092
  };
44754
45093
 
@@ -44776,12 +45115,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44776
45115
  gasPerByte: bn(feeParams.gasPerByte),
44777
45116
  maxMessageDataLength: bn(predicateParams.maxMessageDataLength),
44778
45117
  chainId: bn(consensusParameters.chainId),
45118
+ baseAssetId: consensusParameters.baseAssetId,
44779
45119
  gasCosts
44780
45120
  },
44781
45121
  gasCosts,
44782
45122
  latestBlock: {
44783
45123
  id: latestBlock.id,
44784
- height: bn(latestBlock.header.height),
45124
+ height: bn(latestBlock.height),
44785
45125
  time: latestBlock.header.time,
44786
45126
  transactions: latestBlock.transactions.map((i) => ({
44787
45127
  id: i.id
@@ -44875,10 +45215,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44875
45215
  * Returns some helpful parameters related to gas fees.
44876
45216
  */
44877
45217
  getGasConfig() {
44878
- const { minGasPrice } = this.getNode();
44879
45218
  const { maxGasPerTx, maxGasPerPredicate, gasPriceFactor, gasPerByte, gasCosts } = this.getChain().consensusParameters;
44880
45219
  return {
44881
- minGasPrice,
44882
45220
  maxGasPerTx,
44883
45221
  maxGasPerPredicate,
44884
45222
  gasPriceFactor,
@@ -44976,7 +45314,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44976
45314
  */
44977
45315
  async getBlockNumber() {
44978
45316
  const { chain } = await this.operations.getChain();
44979
- return bn(chain.latestBlock.header.height, 10);
45317
+ return bn(chain.latestBlock.height, 10);
44980
45318
  }
44981
45319
  /**
44982
45320
  * Returns the chain information.
@@ -44988,11 +45326,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44988
45326
  const processedNodeInfo = {
44989
45327
  maxDepth: bn(nodeInfo.maxDepth),
44990
45328
  maxTx: bn(nodeInfo.maxTx),
44991
- minGasPrice: bn(nodeInfo.minGasPrice),
44992
45329
  nodeVersion: nodeInfo.nodeVersion,
44993
45330
  utxoValidation: nodeInfo.utxoValidation,
44994
- vmBacktrace: nodeInfo.vmBacktrace,
44995
- peers: nodeInfo.peers
45331
+ vmBacktrace: nodeInfo.vmBacktrace
44996
45332
  };
44997
45333
  _Provider.nodeInfoCache[this.url] = processedNodeInfo;
44998
45334
  return processedNodeInfo;
@@ -45018,6 +45354,17 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45018
45354
  } = this.getChain();
45019
45355
  return chainId.toNumber();
45020
45356
  }
45357
+ /**
45358
+ * Returns the base asset ID for the current provider network
45359
+ *
45360
+ * @returns the base asset ID
45361
+ */
45362
+ getBaseAssetId() {
45363
+ const {
45364
+ consensusParameters: { baseAssetId }
45365
+ } = this.getChain();
45366
+ return baseAssetId;
45367
+ }
45021
45368
  /**
45022
45369
  * Submits a transaction to the chain to be executed.
45023
45370
  *
@@ -45078,14 +45425,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45078
45425
  return this.estimateTxDependencies(transactionRequest);
45079
45426
  }
45080
45427
  const encodedTransaction = hexlify(transactionRequest.toTransactionBytes());
45081
- const { dryRun: gqlReceipts } = await this.operations.dryRun({
45082
- encodedTransaction,
45428
+ const { dryRun: dryRunStatuses } = await this.operations.dryRun({
45429
+ encodedTransactions: encodedTransaction,
45083
45430
  utxoValidation: utxoValidation || false
45084
45431
  });
45085
- const receipts = gqlReceipts.map(processGqlReceipt);
45086
- return {
45087
- receipts
45088
- };
45432
+ const [{ receipts: rawReceipts, status }] = dryRunStatuses;
45433
+ const receipts = rawReceipts.map(processGqlReceipt);
45434
+ return { receipts, dryrunStatus: status };
45089
45435
  }
45090
45436
  /**
45091
45437
  * Verifies whether enough gas is available to complete transaction.
@@ -45124,9 +45470,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45124
45470
  * If there are missing variable outputs,
45125
45471
  * `addVariableOutputs` is called on the transaction.
45126
45472
  *
45127
- * @privateRemarks
45128
- * TODO: Investigate support for missing contract IDs
45129
- * TODO: Add support for missing output messages
45130
45473
  *
45131
45474
  * @param transactionRequest - The transaction request object.
45132
45475
  * @returns A promise.
@@ -45139,16 +45482,19 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45139
45482
  missingContractIds: []
45140
45483
  };
45141
45484
  }
45142
- await this.estimatePredicates(transactionRequest);
45143
45485
  let receipts = [];
45144
45486
  const missingContractIds = [];
45145
45487
  let outputVariables = 0;
45488
+ let dryrunStatus;
45146
45489
  for (let attempt = 0; attempt < MAX_RETRIES; attempt++) {
45147
- const { dryRun: gqlReceipts } = await this.operations.dryRun({
45148
- encodedTransaction: hexlify(transactionRequest.toTransactionBytes()),
45490
+ const {
45491
+ dryRun: [{ receipts: rawReceipts, status }]
45492
+ } = await this.operations.dryRun({
45493
+ encodedTransactions: [hexlify(transactionRequest.toTransactionBytes())],
45149
45494
  utxoValidation: false
45150
45495
  });
45151
- receipts = gqlReceipts.map(processGqlReceipt);
45496
+ receipts = rawReceipts.map(processGqlReceipt);
45497
+ dryrunStatus = status;
45152
45498
  const { missingOutputVariables, missingOutputContractIds } = getReceiptsWithMissingData(receipts);
45153
45499
  const hasMissingOutputs = missingOutputVariables.length !== 0 || missingOutputContractIds.length !== 0;
45154
45500
  if (hasMissingOutputs) {
@@ -45158,6 +45504,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45158
45504
  transactionRequest.addContractInputAndOutput(Address.fromString(contractId));
45159
45505
  missingContractIds.push(contractId);
45160
45506
  });
45507
+ const { maxFee } = await this.estimateTxGasAndFee({
45508
+ transactionRequest
45509
+ });
45510
+ transactionRequest.maxFee = maxFee;
45161
45511
  } else {
45162
45512
  break;
45163
45513
  }
@@ -45165,37 +45515,136 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45165
45515
  return {
45166
45516
  receipts,
45167
45517
  outputVariables,
45168
- missingContractIds
45518
+ missingContractIds,
45519
+ dryrunStatus
45169
45520
  };
45170
45521
  }
45522
+ /**
45523
+ * Dry runs multiple transactions and checks for missing dependencies in batches.
45524
+ *
45525
+ * Transactions are dry run in batches. After each dry run, transactions requiring
45526
+ * further modifications are identified. The method iteratively updates these transactions
45527
+ * and performs subsequent dry runs until all dependencies for each transaction are satisfied.
45528
+ *
45529
+ * @param transactionRequests - Array of transaction request objects.
45530
+ * @returns A promise that resolves to an array of results for each transaction.
45531
+ */
45532
+ async estimateMultipleTxDependencies(transactionRequests) {
45533
+ const results = transactionRequests.map(() => ({
45534
+ receipts: [],
45535
+ outputVariables: 0,
45536
+ missingContractIds: [],
45537
+ dryrunStatus: void 0
45538
+ }));
45539
+ const allRequests = clone_default(transactionRequests);
45540
+ const serializedTransactionsMap = /* @__PURE__ */ new Map();
45541
+ allRequests.forEach((req, index) => {
45542
+ if (req.type === TransactionType.Script) {
45543
+ serializedTransactionsMap.set(index, hexlify(req.toTransactionBytes()));
45544
+ }
45545
+ });
45546
+ let transactionsToProcess = Array.from(serializedTransactionsMap.keys());
45547
+ let attempt = 0;
45548
+ while (transactionsToProcess.length > 0 && attempt < MAX_RETRIES) {
45549
+ const encodedTransactions = transactionsToProcess.map(
45550
+ (index) => serializedTransactionsMap.get(index)
45551
+ );
45552
+ const dryRunResults = await this.operations.dryRun({
45553
+ encodedTransactions,
45554
+ utxoValidation: false
45555
+ });
45556
+ const nextRoundTransactions = [];
45557
+ for (let i = 0; i < dryRunResults.dryRun.length; i++) {
45558
+ const requestIdx = transactionsToProcess[i];
45559
+ const { receipts: rawReceipts, status } = dryRunResults.dryRun[i];
45560
+ const result = results[requestIdx];
45561
+ result.receipts = rawReceipts.map(processGqlReceipt);
45562
+ result.dryrunStatus = status;
45563
+ const { missingOutputVariables, missingOutputContractIds } = getReceiptsWithMissingData(
45564
+ result.receipts
45565
+ );
45566
+ const hasMissingOutputs = missingOutputVariables.length > 0 || missingOutputContractIds.length > 0;
45567
+ const request = allRequests[requestIdx];
45568
+ if (hasMissingOutputs && request?.type === TransactionType.Script) {
45569
+ result.outputVariables += missingOutputVariables.length;
45570
+ request.addVariableOutputs(missingOutputVariables.length);
45571
+ missingOutputContractIds.forEach(({ contractId }) => {
45572
+ request.addContractInputAndOutput(Address.fromString(contractId));
45573
+ result.missingContractIds.push(contractId);
45574
+ });
45575
+ const { maxFee } = await this.estimateTxGasAndFee({
45576
+ transactionRequest: request
45577
+ });
45578
+ request.maxFee = maxFee;
45579
+ serializedTransactionsMap.set(requestIdx, hexlify(request.toTransactionBytes()));
45580
+ nextRoundTransactions.push(requestIdx);
45581
+ }
45582
+ }
45583
+ transactionsToProcess = nextRoundTransactions;
45584
+ attempt += 1;
45585
+ }
45586
+ return results;
45587
+ }
45588
+ async dryRunMultipleTransactions(transactionRequests, { utxoValidation, estimateTxDependencies = true } = {}) {
45589
+ if (estimateTxDependencies) {
45590
+ return this.estimateMultipleTxDependencies(transactionRequests);
45591
+ }
45592
+ const encodedTransactions = transactionRequests.map((tx) => hexlify(tx.toTransactionBytes()));
45593
+ const { dryRun: dryRunStatuses } = await this.operations.dryRun({
45594
+ encodedTransactions,
45595
+ utxoValidation: utxoValidation || false
45596
+ });
45597
+ const results = dryRunStatuses.map(({ receipts: rawReceipts, status }) => {
45598
+ const receipts = rawReceipts.map(processGqlReceipt);
45599
+ return { receipts, dryrunStatus: status };
45600
+ });
45601
+ return results;
45602
+ }
45171
45603
  /**
45172
45604
  * Estimates the transaction gas and fee based on the provided transaction request.
45173
45605
  * @param transactionRequest - The transaction request object.
45174
45606
  * @returns An object containing the estimated minimum gas, minimum fee, maximum gas, and maximum fee.
45175
45607
  */
45176
- estimateTxGasAndFee(params) {
45608
+ async estimateTxGasAndFee(params) {
45177
45609
  const { transactionRequest } = params;
45178
- const { gasPriceFactor, minGasPrice, maxGasPerTx } = this.getGasConfig();
45610
+ let { gasPrice } = params;
45179
45611
  const chainInfo = this.getChain();
45180
- const gasPrice = transactionRequest.gasPrice.eq(0) ? minGasPrice : transactionRequest.gasPrice;
45181
- transactionRequest.gasPrice = gasPrice;
45612
+ const { gasPriceFactor, maxGasPerTx } = this.getGasConfig();
45182
45613
  const minGas = transactionRequest.calculateMinGas(chainInfo);
45183
- const minFee = calculatePriceWithFactor(minGas, gasPrice, gasPriceFactor).normalizeZeroToOne();
45614
+ if (!gasPrice) {
45615
+ gasPrice = await this.estimateGasPrice(10);
45616
+ }
45617
+ const minFee = calculateGasFee({
45618
+ gasPrice: bn(gasPrice),
45619
+ gas: minGas,
45620
+ priceFactor: gasPriceFactor,
45621
+ tip: transactionRequest.tip
45622
+ }).add(1);
45623
+ let gasLimit = bn(0);
45184
45624
  if (transactionRequest.type === TransactionType.Script) {
45625
+ gasLimit = transactionRequest.gasLimit;
45185
45626
  if (transactionRequest.gasLimit.eq(0)) {
45186
45627
  transactionRequest.gasLimit = minGas;
45187
45628
  transactionRequest.gasLimit = maxGasPerTx.sub(
45188
45629
  transactionRequest.calculateMaxGas(chainInfo, minGas)
45189
45630
  );
45631
+ gasLimit = transactionRequest.gasLimit;
45190
45632
  }
45191
45633
  }
45192
45634
  const maxGas = transactionRequest.calculateMaxGas(chainInfo, minGas);
45193
- const maxFee = calculatePriceWithFactor(maxGas, gasPrice, gasPriceFactor).normalizeZeroToOne();
45635
+ const maxFee = calculateGasFee({
45636
+ gasPrice: bn(gasPrice),
45637
+ gas: maxGas,
45638
+ priceFactor: gasPriceFactor,
45639
+ tip: transactionRequest.tip
45640
+ }).add(1);
45194
45641
  return {
45195
45642
  minGas,
45196
45643
  minFee,
45197
45644
  maxGas,
45198
- maxFee
45645
+ maxFee,
45646
+ gasPrice,
45647
+ gasLimit
45199
45648
  };
45200
45649
  }
45201
45650
  /**
@@ -45213,15 +45662,17 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45213
45662
  if (estimateTxDependencies) {
45214
45663
  return this.estimateTxDependencies(transactionRequest);
45215
45664
  }
45216
- const encodedTransaction = hexlify(transactionRequest.toTransactionBytes());
45217
- const { dryRun: gqlReceipts } = await this.operations.dryRun({
45218
- encodedTransaction,
45665
+ const encodedTransactions = [hexlify(transactionRequest.toTransactionBytes())];
45666
+ const { dryRun: dryRunStatuses } = await this.operations.dryRun({
45667
+ encodedTransactions,
45219
45668
  utxoValidation: true
45220
45669
  });
45221
- const receipts = gqlReceipts.map(processGqlReceipt);
45222
- return {
45223
- receipts
45224
- };
45670
+ const callResult = dryRunStatuses.map((dryRunStatus) => {
45671
+ const { id, receipts, status } = dryRunStatus;
45672
+ const processedReceipts = receipts.map(processGqlReceipt);
45673
+ return { id, receipts: processedReceipts, status };
45674
+ });
45675
+ return { receipts: callResult[0].receipts };
45225
45676
  }
45226
45677
  /**
45227
45678
  * Returns a transaction cost to enable user
@@ -45238,77 +45689,80 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45238
45689
  * @param tolerance - The tolerance to add on top of the gasUsed.
45239
45690
  * @returns A promise that resolves to the transaction cost object.
45240
45691
  */
45241
- async getTransactionCost(transactionRequestLike, forwardingQuantities = [], {
45242
- estimateTxDependencies = true,
45243
- estimatePredicates = true,
45244
- resourcesOwner,
45245
- signatureCallback
45246
- } = {}) {
45692
+ async getTransactionCost(transactionRequestLike, { resourcesOwner, signatureCallback, quantitiesToContract = [] } = {}) {
45247
45693
  const txRequestClone = clone_default(transactionRequestify(transactionRequestLike));
45248
- const { minGasPrice } = this.getGasConfig();
45249
- const setGasPrice = max(txRequestClone.gasPrice, minGasPrice);
45250
45694
  const isScriptTransaction = txRequestClone.type === TransactionType.Script;
45695
+ const baseAssetId = this.getBaseAssetId();
45251
45696
  const coinOutputsQuantities = txRequestClone.getCoinOutputsQuantities();
45252
- const allQuantities = mergeQuantities(coinOutputsQuantities, forwardingQuantities);
45253
- txRequestClone.fundWithFakeUtxos(allQuantities, resourcesOwner?.address);
45697
+ const allQuantities = mergeQuantities(coinOutputsQuantities, quantitiesToContract);
45698
+ txRequestClone.fundWithFakeUtxos(allQuantities, baseAssetId, resourcesOwner?.address);
45699
+ txRequestClone.maxFee = bn(0);
45254
45700
  if (isScriptTransaction) {
45255
45701
  txRequestClone.gasLimit = bn(0);
45256
45702
  }
45257
- if (estimatePredicates) {
45258
- if (resourcesOwner && "populateTransactionPredicateData" in resourcesOwner) {
45259
- resourcesOwner.populateTransactionPredicateData(txRequestClone);
45260
- }
45261
- await this.estimatePredicates(txRequestClone);
45703
+ if (resourcesOwner && "populateTransactionPredicateData" in resourcesOwner) {
45704
+ resourcesOwner.populateTransactionPredicateData(txRequestClone);
45262
45705
  }
45706
+ const signedRequest = clone_default(txRequestClone);
45707
+ let addedSignatures = 0;
45263
45708
  if (signatureCallback && isScriptTransaction) {
45264
- await signatureCallback(txRequestClone);
45709
+ const lengthBefore = signedRequest.witnesses.length;
45710
+ await signatureCallback(signedRequest);
45711
+ addedSignatures = signedRequest.witnesses.length - lengthBefore;
45265
45712
  }
45266
- let { maxFee, maxGas, minFee, minGas } = this.estimateTxGasAndFee({
45267
- transactionRequest: txRequestClone
45713
+ await this.estimatePredicates(signedRequest);
45714
+ let { maxFee, maxGas, minFee, minGas, gasPrice, gasLimit } = await this.estimateTxGasAndFee({
45715
+ transactionRequest: signedRequest
45268
45716
  });
45269
45717
  let receipts = [];
45270
45718
  let missingContractIds = [];
45271
45719
  let outputVariables = 0;
45272
45720
  let gasUsed = bn(0);
45273
- if (isScriptTransaction && estimateTxDependencies) {
45274
- txRequestClone.gasPrice = bn(0);
45721
+ txRequestClone.updatePredicateGasUsed(signedRequest.inputs);
45722
+ txRequestClone.maxFee = maxFee;
45723
+ if (isScriptTransaction) {
45724
+ txRequestClone.gasLimit = gasLimit;
45725
+ if (signatureCallback) {
45726
+ await signatureCallback(txRequestClone);
45727
+ }
45275
45728
  const result = await this.estimateTxDependencies(txRequestClone);
45276
45729
  receipts = result.receipts;
45277
45730
  outputVariables = result.outputVariables;
45278
45731
  missingContractIds = result.missingContractIds;
45279
45732
  gasUsed = isScriptTransaction ? getGasUsedFromReceipts(receipts) : gasUsed;
45280
45733
  txRequestClone.gasLimit = gasUsed;
45281
- txRequestClone.gasPrice = setGasPrice;
45282
- ({ maxFee, maxGas, minFee, minGas } = this.estimateTxGasAndFee({
45283
- transactionRequest: txRequestClone
45734
+ ({ maxFee, maxGas, minFee, minGas, gasPrice } = await this.estimateTxGasAndFee({
45735
+ transactionRequest: txRequestClone,
45736
+ gasPrice
45284
45737
  }));
45285
45738
  }
45286
45739
  return {
45287
45740
  requiredQuantities: allQuantities,
45288
45741
  receipts,
45289
45742
  gasUsed,
45290
- minGasPrice,
45291
- gasPrice: setGasPrice,
45743
+ gasPrice,
45292
45744
  minGas,
45293
45745
  maxGas,
45294
45746
  minFee,
45295
45747
  maxFee,
45296
- estimatedInputs: txRequestClone.inputs,
45297
45748
  outputVariables,
45298
- missingContractIds
45749
+ missingContractIds,
45750
+ addedSignatures,
45751
+ estimatedPredicates: txRequestClone.inputs
45299
45752
  };
45300
45753
  }
45301
- async getResourcesForTransaction(owner, transactionRequestLike, forwardingQuantities = []) {
45754
+ async getResourcesForTransaction(owner, transactionRequestLike, quantitiesToContract = []) {
45302
45755
  const ownerAddress = Address.fromAddressOrString(owner);
45303
45756
  const transactionRequest = transactionRequestify(clone_default(transactionRequestLike));
45304
- const transactionCost = await this.getTransactionCost(transactionRequest, forwardingQuantities);
45757
+ const transactionCost = await this.getTransactionCost(transactionRequest, {
45758
+ quantitiesToContract
45759
+ });
45305
45760
  transactionRequest.addResources(
45306
45761
  await this.getResourcesToSpend(ownerAddress, transactionCost.requiredQuantities)
45307
45762
  );
45308
- const { requiredQuantities, ...txCost } = await this.getTransactionCost(
45309
- transactionRequest,
45310
- forwardingQuantities
45311
- );
45763
+ const { requiredQuantities, ...txCost } = await this.getTransactionCost(transactionRequest, {
45764
+ quantitiesToContract
45765
+ });
45312
45766
  const resources = await this.getResourcesToSpend(ownerAddress, requiredQuantities);
45313
45767
  return {
45314
45768
  resources,
@@ -45332,7 +45786,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45332
45786
  assetId: coin.assetId,
45333
45787
  amount: bn(coin.amount),
45334
45788
  owner: Address.fromAddressOrString(coin.owner),
45335
- maturity: bn(coin.maturity).toNumber(),
45336
45789
  blockCreated: bn(coin.blockCreated),
45337
45790
  txCreatedIdx: bn(coin.txCreatedIdx)
45338
45791
  }));
@@ -45384,7 +45837,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45384
45837
  amount: bn(coin.amount),
45385
45838
  assetId: coin.assetId,
45386
45839
  owner: Address.fromAddressOrString(coin.owner),
45387
- maturity: bn(coin.maturity).toNumber(),
45388
45840
  blockCreated: bn(coin.blockCreated),
45389
45841
  txCreatedIdx: bn(coin.txCreatedIdx)
45390
45842
  };
@@ -45417,7 +45869,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45417
45869
  }
45418
45870
  return {
45419
45871
  id: block2.id,
45420
- height: bn(block2.header.height),
45872
+ height: bn(block2.height),
45421
45873
  time: block2.header.time,
45422
45874
  transactionIds: block2.transactions.map((tx) => tx.id)
45423
45875
  };
@@ -45432,7 +45884,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45432
45884
  const { blocks: fetchedData } = await this.operations.getBlocks(params);
45433
45885
  const blocks = fetchedData.edges.map(({ node: block2 }) => ({
45434
45886
  id: block2.id,
45435
- height: bn(block2.header.height),
45887
+ height: bn(block2.height),
45436
45888
  time: block2.header.time,
45437
45889
  transactionIds: block2.transactions.map((tx) => tx.id)
45438
45890
  }));
@@ -45459,7 +45911,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45459
45911
  }
45460
45912
  return {
45461
45913
  id: block2.id,
45462
- height: bn(block2.header.height, 10),
45914
+ height: bn(block2.height, 10),
45463
45915
  time: block2.header.time,
45464
45916
  transactionIds: block2.transactions.map((tx) => tx.id),
45465
45917
  transactions: block2.transactions.map(
@@ -45639,8 +46091,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45639
46091
  prevRoot: messageBlockHeader.prevRoot,
45640
46092
  time: messageBlockHeader.time,
45641
46093
  applicationHash: messageBlockHeader.applicationHash,
45642
- messageReceiptRoot: messageBlockHeader.messageReceiptRoot,
45643
- messageReceiptCount: bn(messageBlockHeader.messageReceiptCount)
46094
+ messageReceiptCount: bn(messageBlockHeader.messageReceiptCount),
46095
+ messageOutboxRoot: messageBlockHeader.messageOutboxRoot,
46096
+ consensusParametersVersion: messageBlockHeader.consensusParametersVersion,
46097
+ eventInboxRoot: messageBlockHeader.eventInboxRoot,
46098
+ stateTransitionBytecodeVersion: messageBlockHeader.stateTransitionBytecodeVersion
45644
46099
  },
45645
46100
  commitBlockHeader: {
45646
46101
  id: commitBlockHeader.id,
@@ -45651,8 +46106,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45651
46106
  prevRoot: commitBlockHeader.prevRoot,
45652
46107
  time: commitBlockHeader.time,
45653
46108
  applicationHash: commitBlockHeader.applicationHash,
45654
- messageReceiptRoot: commitBlockHeader.messageReceiptRoot,
45655
- messageReceiptCount: bn(commitBlockHeader.messageReceiptCount)
46109
+ messageReceiptCount: bn(commitBlockHeader.messageReceiptCount),
46110
+ messageOutboxRoot: commitBlockHeader.messageOutboxRoot,
46111
+ consensusParametersVersion: commitBlockHeader.consensusParametersVersion,
46112
+ eventInboxRoot: commitBlockHeader.eventInboxRoot,
46113
+ stateTransitionBytecodeVersion: commitBlockHeader.stateTransitionBytecodeVersion
45656
46114
  },
45657
46115
  sender: Address.fromAddressOrString(sender),
45658
46116
  recipient: Address.fromAddressOrString(recipient),
@@ -45661,6 +46119,16 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45661
46119
  data
45662
46120
  };
45663
46121
  }
46122
+ async getLatestGasPrice() {
46123
+ const { latestGasPrice } = await this.operations.getLatestGasPrice();
46124
+ return bn(latestGasPrice.gasPrice);
46125
+ }
46126
+ async estimateGasPrice(blockHorizon) {
46127
+ const { estimateGasPrice } = await this.operations.estimateGasPrice({
46128
+ blockHorizon: String(blockHorizon)
46129
+ });
46130
+ return bn(estimateGasPrice.gasPrice);
46131
+ }
45664
46132
  /**
45665
46133
  * Returns Message Proof for given transaction id and the message id from MessageOut receipt.
45666
46134
  *
@@ -45906,8 +46374,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45906
46374
  * @param assetId - The asset ID to check the balance for.
45907
46375
  * @returns A promise that resolves to the balance amount.
45908
46376
  */
45909
- async getBalance(assetId = BaseAssetId) {
45910
- const amount = await this.provider.getBalance(this.address, assetId);
46377
+ async getBalance(assetId) {
46378
+ const assetIdToFetch = assetId ?? this.provider.getBaseAssetId();
46379
+ const amount = await this.provider.getBalance(this.address, assetIdToFetch);
45911
46380
  return amount;
45912
46381
  }
45913
46382
  /**
@@ -45944,37 +46413,31 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45944
46413
  * @param fee - The estimated transaction fee.
45945
46414
  * @returns A promise that resolves when the resources are added to the transaction.
45946
46415
  */
45947
- async fund(request, coinQuantities, fee) {
45948
- const updatedQuantities = addAmountToAsset({
46416
+ async fund(request, params) {
46417
+ const { addedSignatures, estimatedPredicates, maxFee: fee, requiredQuantities } = params;
46418
+ const baseAssetId = this.provider.getBaseAssetId();
46419
+ const txRequest = request;
46420
+ const requiredQuantitiesWithFee = addAmountToCoinQuantities({
45949
46421
  amount: bn(fee),
45950
- assetId: BaseAssetId,
45951
- coinQuantities
46422
+ assetId: baseAssetId,
46423
+ coinQuantities: requiredQuantities
45952
46424
  });
45953
46425
  const quantitiesDict = {};
45954
- updatedQuantities.forEach(({ amount, assetId }) => {
46426
+ requiredQuantitiesWithFee.forEach(({ amount, assetId }) => {
45955
46427
  quantitiesDict[assetId] = {
45956
46428
  required: amount,
45957
46429
  owned: bn(0)
45958
46430
  };
45959
46431
  });
45960
- const cachedUtxos = [];
45961
- const cachedMessages = [];
45962
- const owner = this.address.toB256();
45963
- request.inputs.forEach((input) => {
46432
+ txRequest.inputs.forEach((input) => {
45964
46433
  const isResource = "amount" in input;
45965
- if (isResource) {
45966
- const isCoin2 = "owner" in input;
45967
- if (isCoin2) {
45968
- const assetId = String(input.assetId);
45969
- if (input.owner === owner && quantitiesDict[assetId]) {
45970
- const amount = bn(input.amount);
45971
- quantitiesDict[assetId].owned = quantitiesDict[assetId].owned.add(amount);
45972
- cachedUtxos.push(input.id);
45973
- }
45974
- } else if (input.recipient === owner && input.amount && quantitiesDict[BaseAssetId]) {
45975
- quantitiesDict[BaseAssetId].owned = quantitiesDict[BaseAssetId].owned.add(input.amount);
45976
- cachedMessages.push(input.nonce);
45977
- }
46434
+ if (!isResource) {
46435
+ return;
46436
+ }
46437
+ const isCoin2 = "owner" in input;
46438
+ const assetId = isCoin2 ? String(input.assetId) : baseAssetId;
46439
+ if (quantitiesDict[assetId]) {
46440
+ quantitiesDict[assetId].owned = quantitiesDict[assetId].owned.add(input.amount);
45978
46441
  }
45979
46442
  });
45980
46443
  const missingQuantities = [];
@@ -45988,12 +46451,21 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45988
46451
  });
45989
46452
  const needsToBeFunded = missingQuantities.length;
45990
46453
  if (needsToBeFunded) {
45991
- const resources = await this.getResourcesToSpend(missingQuantities, {
45992
- messages: cachedMessages,
45993
- utxos: cachedUtxos
45994
- });
45995
- request.addResources(resources);
45996
- }
46454
+ const excludedIds = cacheTxInputsFromOwner(txRequest.inputs, this.address.toB256());
46455
+ const resources = await this.getResourcesToSpend(missingQuantities, excludedIds);
46456
+ txRequest.addResources(resources);
46457
+ }
46458
+ txRequest.shiftPredicateData();
46459
+ txRequest.updatePredicateGasUsed(estimatedPredicates);
46460
+ const requestToReestimate = clone_default(txRequest);
46461
+ if (addedSignatures) {
46462
+ Array.from({ length: addedSignatures }).forEach(() => requestToReestimate.addEmptyWitness());
46463
+ }
46464
+ const { maxFee } = await this.provider.estimateTxGasAndFee({
46465
+ transactionRequest: requestToReestimate
46466
+ });
46467
+ txRequest.maxFee = maxFee;
46468
+ return txRequest;
45997
46469
  }
45998
46470
  /**
45999
46471
  * A helper that creates a transfer transaction request and returns it.
@@ -46001,28 +46473,25 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46001
46473
  * @param destination - The address of the destination.
46002
46474
  * @param amount - The amount of coins to transfer.
46003
46475
  * @param assetId - The asset ID of the coins to transfer.
46004
- * @param txParams - The transaction parameters (gasLimit, gasPrice, maturity).
46476
+ * @param txParams - The transaction parameters (gasLimit, tip, maturity, maxFee, witnessLimit).
46005
46477
  * @returns A promise that resolves to the prepared transaction request.
46006
46478
  */
46007
- async createTransfer(destination, amount, assetId = BaseAssetId, txParams = {}) {
46008
- const { minGasPrice } = this.provider.getGasConfig();
46009
- const params = { gasPrice: minGasPrice, ...txParams };
46010
- const request = new ScriptTransactionRequest(params);
46011
- request.addCoinOutput(Address.fromAddressOrString(destination), amount, assetId);
46012
- const { maxFee, requiredQuantities, gasUsed, estimatedInputs } = await this.provider.getTransactionCost(request, [], {
46479
+ async createTransfer(destination, amount, assetId, txParams = {}) {
46480
+ const request = new ScriptTransactionRequest(txParams);
46481
+ const assetIdToTransfer = assetId ?? this.provider.getBaseAssetId();
46482
+ request.addCoinOutput(Address.fromAddressOrString(destination), amount, assetIdToTransfer);
46483
+ const txCost = await this.provider.getTransactionCost(request, {
46013
46484
  estimateTxDependencies: true,
46014
46485
  resourcesOwner: this
46015
46486
  });
46016
- request.gasPrice = bn(txParams.gasPrice ?? minGasPrice);
46017
- request.gasLimit = bn(txParams.gasLimit ?? gasUsed);
46018
- this.validateGas({
46019
- gasUsed,
46020
- gasPrice: request.gasPrice,
46021
- gasLimit: request.gasLimit,
46022
- minGasPrice
46487
+ this.validateGasLimitAndMaxFee({
46488
+ gasUsed: txCost.gasUsed,
46489
+ maxFee: txCost.maxFee,
46490
+ txParams
46023
46491
  });
46024
- await this.fund(request, requiredQuantities, maxFee);
46025
- request.updatePredicateInputs(estimatedInputs);
46492
+ request.gasLimit = txCost.gasUsed;
46493
+ request.maxFee = txCost.maxFee;
46494
+ await this.fund(request, txCost);
46026
46495
  return request;
46027
46496
  }
46028
46497
  /**
@@ -46031,17 +46500,18 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46031
46500
  * @param destination - The address of the destination.
46032
46501
  * @param amount - The amount of coins to transfer.
46033
46502
  * @param assetId - The asset ID of the coins to transfer.
46034
- * @param txParams - The transaction parameters (gasLimit, gasPrice, maturity).
46503
+ * @param txParams - The transaction parameters (gasLimit, maturity).
46035
46504
  * @returns A promise that resolves to the transaction response.
46036
46505
  */
46037
- async transfer(destination, amount, assetId = BaseAssetId, txParams = {}) {
46506
+ async transfer(destination, amount, assetId, txParams = {}) {
46038
46507
  if (bn(amount).lte(0)) {
46039
46508
  throw new FuelError(
46040
46509
  ErrorCode.INVALID_TRANSFER_AMOUNT,
46041
46510
  "Transfer amount must be a positive number."
46042
46511
  );
46043
46512
  }
46044
- const request = await this.createTransfer(destination, amount, assetId, txParams);
46513
+ const assetIdToTransfer = assetId ?? this.provider.getBaseAssetId();
46514
+ const request = await this.createTransfer(destination, amount, assetIdToTransfer, txParams);
46045
46515
  return this.sendTransaction(request, { estimateTxDependencies: false });
46046
46516
  }
46047
46517
  /**
@@ -46053,7 +46523,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46053
46523
  * @param txParams - The optional transaction parameters.
46054
46524
  * @returns A promise that resolves to the transaction response.
46055
46525
  */
46056
- async transferToContract(contractId, amount, assetId = BaseAssetId, txParams = {}) {
46526
+ async transferToContract(contractId, amount, assetId, txParams = {}) {
46057
46527
  if (bn(amount).lte(0)) {
46058
46528
  throw new FuelError(
46059
46529
  ErrorCode.INVALID_TRANSFER_AMOUNT,
@@ -46061,31 +46531,30 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46061
46531
  );
46062
46532
  }
46063
46533
  const contractAddress = Address.fromAddressOrString(contractId);
46064
- const { minGasPrice } = this.provider.getGasConfig();
46065
- const params = { gasPrice: minGasPrice, ...txParams };
46534
+ const assetIdToTransfer = assetId ?? this.provider.getBaseAssetId();
46066
46535
  const { script, scriptData } = await assembleTransferToContractScript({
46067
46536
  hexlifiedContractId: contractAddress.toB256(),
46068
46537
  amountToTransfer: bn(amount),
46069
- assetId
46538
+ assetId: assetIdToTransfer
46070
46539
  });
46071
46540
  const request = new ScriptTransactionRequest({
46072
- ...params,
46541
+ ...txParams,
46073
46542
  script,
46074
46543
  scriptData
46075
46544
  });
46076
46545
  request.addContractInputAndOutput(contractAddress);
46077
- const { maxFee, requiredQuantities, gasUsed } = await this.provider.getTransactionCost(
46078
- request,
46079
- [{ amount: bn(amount), assetId: String(assetId) }]
46080
- );
46081
- request.gasLimit = bn(params.gasLimit ?? gasUsed);
46082
- this.validateGas({
46083
- gasUsed,
46084
- gasPrice: request.gasPrice,
46085
- gasLimit: request.gasLimit,
46086
- minGasPrice
46546
+ const txCost = await this.provider.getTransactionCost(request, {
46547
+ resourcesOwner: this,
46548
+ quantitiesToContract: [{ amount: bn(amount), assetId: String(assetIdToTransfer) }]
46549
+ });
46550
+ this.validateGasLimitAndMaxFee({
46551
+ gasUsed: txCost.gasUsed,
46552
+ maxFee: txCost.maxFee,
46553
+ txParams
46087
46554
  });
46088
- await this.fund(request, requiredQuantities, maxFee);
46555
+ request.gasLimit = txCost.gasUsed;
46556
+ request.maxFee = txCost.maxFee;
46557
+ await this.fund(request, txCost);
46089
46558
  return this.sendTransaction(request);
46090
46559
  }
46091
46560
  /**
@@ -46097,7 +46566,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46097
46566
  * @returns A promise that resolves to the transaction response.
46098
46567
  */
46099
46568
  async withdrawToBaseLayer(recipient, amount, txParams = {}) {
46100
- const { minGasPrice } = this.provider.getGasConfig();
46101
46569
  const recipientAddress = Address.fromAddressOrString(recipient);
46102
46570
  const recipientDataArray = arrayify(
46103
46571
  "0x".concat(recipientAddress.toHexString().substring(2).padStart(64, "0"))
@@ -46110,21 +46578,19 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46110
46578
  ...recipientDataArray,
46111
46579
  ...amountDataArray
46112
46580
  ]);
46113
- const params = { script, gasPrice: minGasPrice, ...txParams };
46581
+ const params = { script, ...txParams };
46582
+ const baseAssetId = this.provider.getBaseAssetId();
46114
46583
  const request = new ScriptTransactionRequest(params);
46115
- const forwardingQuantities = [{ amount: bn(amount), assetId: BaseAssetId }];
46116
- const { requiredQuantities, maxFee, gasUsed } = await this.provider.getTransactionCost(
46117
- request,
46118
- forwardingQuantities
46119
- );
46120
- request.gasLimit = bn(params.gasLimit ?? gasUsed);
46121
- this.validateGas({
46122
- gasUsed,
46123
- gasPrice: request.gasPrice,
46124
- gasLimit: request.gasLimit,
46125
- minGasPrice
46584
+ const quantitiesToContract = [{ amount: bn(amount), assetId: baseAssetId }];
46585
+ const txCost = await this.provider.getTransactionCost(request, { quantitiesToContract });
46586
+ this.validateGasLimitAndMaxFee({
46587
+ gasUsed: txCost.gasUsed,
46588
+ maxFee: txCost.maxFee,
46589
+ txParams
46126
46590
  });
46127
- await this.fund(request, requiredQuantities, maxFee);
46591
+ request.maxFee = txCost.maxFee;
46592
+ request.gasLimit = txCost.gasUsed;
46593
+ await this.fund(request, txCost);
46128
46594
  return this.sendTransaction(request);
46129
46595
  }
46130
46596
  async signMessage(message) {
@@ -46182,22 +46648,21 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46182
46648
  }
46183
46649
  return this.provider.simulate(transactionRequest, { estimateTxDependencies: false });
46184
46650
  }
46185
- validateGas({
46651
+ validateGasLimitAndMaxFee({
46652
+ txParams: { gasLimit: setGasLimit, maxFee: setMaxFee },
46186
46653
  gasUsed,
46187
- gasPrice,
46188
- gasLimit,
46189
- minGasPrice
46654
+ maxFee
46190
46655
  }) {
46191
- if (minGasPrice.gt(gasPrice)) {
46656
+ if (isDefined(setGasLimit) && gasUsed.gt(setGasLimit)) {
46192
46657
  throw new FuelError(
46193
- ErrorCode.GAS_PRICE_TOO_LOW,
46194
- `Gas price '${gasPrice}' is lower than the required: '${minGasPrice}'.`
46658
+ ErrorCode.GAS_LIMIT_TOO_LOW,
46659
+ `Gas limit '${setGasLimit}' is lower than the required: '${gasUsed}'.`
46195
46660
  );
46196
46661
  }
46197
- if (gasUsed.gt(gasLimit)) {
46662
+ if (isDefined(setMaxFee) && maxFee.gt(setMaxFee)) {
46198
46663
  throw new FuelError(
46199
- ErrorCode.GAS_LIMIT_TOO_LOW,
46200
- `Gas limit '${gasLimit}' is lower than the required: '${gasUsed}'.`
46664
+ ErrorCode.MAX_FEE_TOO_LOW,
46665
+ `Max fee '${setMaxFee}' is lower than the required: '${maxFee}'.`
46201
46666
  );
46202
46667
  }
46203
46668
  }
@@ -47782,7 +48247,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
47782
48247
  * @param transactionRequestLike - The transaction request to send.
47783
48248
  * @returns A promise that resolves to the TransactionResponse object.
47784
48249
  */
47785
- async sendTransaction(transactionRequestLike, { estimateTxDependencies = true, awaitExecution } = {}) {
48250
+ async sendTransaction(transactionRequestLike, { estimateTxDependencies = false, awaitExecution } = {}) {
47786
48251
  const transactionRequest = transactionRequestify(transactionRequestLike);
47787
48252
  if (estimateTxDependencies) {
47788
48253
  await this.provider.estimateTxDependencies(transactionRequest);
@@ -50542,14 +51007,15 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
50542
51007
  process.env.GENESIS_SECRET || randomBytes22(32),
50543
51008
  wallet.provider
50544
51009
  );
50545
- const resources = await genesisWallet.getResourcesToSpend(quantities);
50546
- const { minGasPrice } = genesisWallet.provider.getGasConfig();
50547
- const request = new ScriptTransactionRequest({
50548
- gasLimit: 1e4,
50549
- gasPrice: minGasPrice
51010
+ const request = new ScriptTransactionRequest();
51011
+ quantities.forEach((quantity) => {
51012
+ const { amount, assetId } = coinQuantityfy(quantity);
51013
+ request.addCoinOutput(wallet.address, amount, assetId);
50550
51014
  });
50551
- request.addResources(resources);
50552
- quantities.map(coinQuantityfy).forEach(({ amount, assetId }) => request.addCoinOutput(wallet.address, amount, assetId));
51015
+ const txCost = await genesisWallet.provider.getTransactionCost(request);
51016
+ request.gasLimit = txCost.gasUsed;
51017
+ request.maxFee = txCost.maxFee;
51018
+ await genesisWallet.fund(request, txCost);
50553
51019
  await genesisWallet.sendTransaction(request, { awaitExecution: true });
50554
51020
  };
50555
51021
 
@@ -50579,7 +51045,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
50579
51045
 
50580
51046
  // src/test-utils/launchNode.ts
50581
51047
  var import_child_process = __require("child_process");
50582
- var import_crypto21 = __require("crypto");
51048
+ var import_crypto22 = __require("crypto");
50583
51049
  var import_fs2 = __require("fs");
50584
51050
  var import_os = __toESM(__require("os"));
50585
51051
  var import_path8 = __toESM(__require("path"));
@@ -50628,12 +51094,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
50628
51094
  // eslint-disable-next-line no-async-promise-executor
50629
51095
  new Promise(async (resolve, reject) => {
50630
51096
  const remainingArgs = extractRemainingArgs(args, [
50631
- "--chain",
51097
+ "--snapshot",
50632
51098
  "--consensus-key",
50633
51099
  "--db-type",
50634
51100
  "--poa-instant"
50635
51101
  ]);
50636
- const chainConfigPath = getFlagValueFromArgs(args, "--chain");
51102
+ const snapshotDir = getFlagValueFromArgs(args, "--snapshot");
50637
51103
  const consensusKey = getFlagValueFromArgs(args, "--consensus-key") || defaultConsensusKey;
50638
51104
  const dbTypeFlagValue = getFlagValueFromArgs(args, "--db-type");
50639
51105
  const useInMemoryDb = dbTypeFlagValue === "in-memory" || dbTypeFlagValue === void 0;
@@ -50649,39 +51115,57 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
50649
51115
  stopPort: 5e3
50650
51116
  // don't try ports above 5000
50651
51117
  })).toString();
50652
- let chainConfigPathToUse;
51118
+ let snapshotDirToUse;
50653
51119
  const prefix = basePath || import_os.default.tmpdir();
50654
- const suffix = basePath ? "" : (0, import_crypto21.randomUUID)();
50655
- const tempDirPath = import_path8.default.join(prefix, ".fuels", suffix);
50656
- if (chainConfigPath) {
50657
- chainConfigPathToUse = chainConfigPath;
51120
+ const suffix = basePath ? "" : (0, import_crypto22.randomUUID)();
51121
+ const tempDirPath = import_path8.default.join(prefix, ".fuels", suffix, "snapshotDir");
51122
+ if (snapshotDir) {
51123
+ snapshotDirToUse = snapshotDir;
50658
51124
  } else {
50659
51125
  if (!(0, import_fs2.existsSync)(tempDirPath)) {
50660
51126
  (0, import_fs2.mkdirSync)(tempDirPath, { recursive: true });
50661
51127
  }
50662
- const tempChainConfigFilePath = import_path8.default.join(tempDirPath, "chainConfig.json");
50663
- let chainConfig = defaultChainConfig;
51128
+ let { stateConfigJson } = defaultSnapshotConfigs;
51129
+ const { chainConfigJson, metadataJson } = defaultSnapshotConfigs;
51130
+ stateConfigJson = {
51131
+ ...stateConfigJson,
51132
+ coins: [
51133
+ ...stateConfigJson.coins.map((coin) => ({
51134
+ ...coin,
51135
+ amount: "18446744073709551615"
51136
+ }))
51137
+ ],
51138
+ messages: stateConfigJson.messages.map((message) => ({
51139
+ ...message,
51140
+ amount: "18446744073709551615"
51141
+ }))
51142
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
51143
+ };
50664
51144
  if (!process.env.GENESIS_SECRET) {
50665
51145
  const pk = Signer.generatePrivateKey();
50666
51146
  const signer = new Signer(pk);
50667
51147
  process.env.GENESIS_SECRET = hexlify(pk);
50668
- chainConfig = {
50669
- ...defaultChainConfig,
50670
- initial_state: {
50671
- ...defaultChainConfig.initial_state,
50672
- coins: [
50673
- ...defaultChainConfig.initial_state.coins,
50674
- {
50675
- owner: signer.address.toHexString(),
50676
- amount: toHex(1e9),
50677
- asset_id: BaseAssetId
50678
- }
50679
- ]
50680
- }
50681
- };
51148
+ stateConfigJson.coins.push({
51149
+ tx_id: hexlify(randomBytes22(UTXO_ID_LEN)),
51150
+ owner: signer.address.toHexString(),
51151
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
51152
+ amount: "18446744073709551615",
51153
+ asset_id: chainConfigJson.consensus_parameters.V1.base_asset_id,
51154
+ output_index: 0,
51155
+ tx_pointer_block_height: 0,
51156
+ tx_pointer_tx_idx: 0
51157
+ });
50682
51158
  }
50683
- (0, import_fs2.writeFileSync)(tempChainConfigFilePath, JSON.stringify(chainConfig), "utf8");
50684
- chainConfigPathToUse = tempChainConfigFilePath;
51159
+ let fixedStateConfigJSON = JSON.stringify(stateConfigJson);
51160
+ const regexMakeNumber = /("amount":)"(\d+)"/gm;
51161
+ fixedStateConfigJSON = fixedStateConfigJSON.replace(regexMakeNumber, "$1$2");
51162
+ const chainConfigWritePath = import_path8.default.join(tempDirPath, "chainConfig.json");
51163
+ const stateConfigWritePath = import_path8.default.join(tempDirPath, "stateConfig.json");
51164
+ const metadataWritePath = import_path8.default.join(tempDirPath, "metadata.json");
51165
+ (0, import_fs2.writeFileSync)(chainConfigWritePath, JSON.stringify(chainConfigJson), "utf8");
51166
+ (0, import_fs2.writeFileSync)(stateConfigWritePath, fixedStateConfigJSON, "utf8");
51167
+ (0, import_fs2.writeFileSync)(metadataWritePath, JSON.stringify(metadataJson), "utf8");
51168
+ snapshotDirToUse = tempDirPath;
50685
51169
  }
50686
51170
  const child = (0, import_child_process.spawn)(
50687
51171
  command,
@@ -50690,10 +51174,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
50690
51174
  ["--ip", ipToUse],
50691
51175
  ["--port", portToUse],
50692
51176
  useInMemoryDb ? ["--db-type", "in-memory"] : ["--db-path", tempDirPath],
50693
- ["--min-gas-price", "0"],
51177
+ ["--min-gas-price", "1"],
50694
51178
  poaInstant ? ["--poa-instant", "true"] : [],
50695
51179
  ["--consensus-key", consensusKey],
50696
- ["--chain", chainConfigPathToUse],
51180
+ ["--snapshot", snapshotDirToUse],
50697
51181
  "--vm-backtrace",
50698
51182
  "--utxo-validation",
50699
51183
  "--debug",
@@ -50723,7 +51207,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
50723
51207
  cleanup: () => killNode(cleanupConfig),
50724
51208
  ip: ipToUse,
50725
51209
  port: portToUse,
50726
- chainConfigPath: chainConfigPathToUse
51210
+ snapshotDir: snapshotDirToUse
50727
51211
  });
50728
51212
  }
50729
51213
  if (/error/i.test(chunk)) {
@@ -50740,9 +51224,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
50740
51224
  })
50741
51225
  );
50742
51226
  var generateWallets = async (count, provider) => {
51227
+ const baseAssetId = provider.getBaseAssetId();
50743
51228
  const wallets = [];
50744
51229
  for (let i = 0; i < count; i += 1) {
50745
- const wallet = await generateTestWallet(provider, [[1e3, BaseAssetId]]);
51230
+ const wallet = await generateTestWallet(provider, [[1e5, baseAssetId]]);
50746
51231
  wallets.push(wallet);
50747
51232
  }
50748
51233
  return wallets;
@@ -50752,7 +51237,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
50752
51237
  walletCount = 10
50753
51238
  } = {}) => {
50754
51239
  const { cleanup: closeNode, ip, port } = await launchNode(launchNodeOptions || {});
50755
- const provider = await Provider.create(`http://${ip}:${port}/graphql`);
51240
+ const provider = await Provider.create(`http://${ip}:${port}/v1/graphql`);
50756
51241
  const wallets = await generateWallets(walletCount, provider);
50757
51242
  const cleanup = () => {
50758
51243
  closeNode();