@fuel-ts/account 0.0.0-rc-1976-20240408114146 → 0.0.0-rc-2021-20240409111335

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 (54) hide show
  1. package/README.md +1 -1
  2. package/dist/account.d.ts +5 -4
  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 -620
  12. package/dist/index.global.js.map +1 -1
  13. package/dist/index.js +848 -610
  14. package/dist/index.js.map +1 -1
  15. package/dist/index.mjs +690 -453
  16. package/dist/index.mjs.map +1 -1
  17. package/dist/predicate/predicate.d.ts +10 -2
  18. package/dist/predicate/predicate.d.ts.map +1 -1
  19. package/dist/providers/__generated__/operations.d.ts +888 -322
  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/fuel-graphql-subscriber.d.ts.map +1 -1
  26. package/dist/providers/message.d.ts +3 -1
  27. package/dist/providers/message.d.ts.map +1 -1
  28. package/dist/providers/provider.d.ts +45 -34
  29. package/dist/providers/provider.d.ts.map +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 +9 -29
  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/test-utils/launchNode.d.ts.map +1 -1
  47. package/dist/test-utils.global.js +1587 -1121
  48. package/dist/test-utils.global.js.map +1 -1
  49. package/dist/test-utils.js +824 -607
  50. package/dist/test-utils.js.map +1 -1
  51. package/dist/test-utils.mjs +682 -465
  52. package/dist/test-utils.mjs.map +1 -1
  53. package/dist/wallet/base-wallet-unlocked.d.ts.map +1 -1
  54. package/package.json +17 -17
@@ -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,8 +31914,8 @@ 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",
31917
+ FORC: "0.51.1",
31918
+ FUEL_CORE: "0.24.2",
31919
31919
  FUELS: "0.79.0"
31920
31920
  };
31921
31921
  }
@@ -32192,525 +32192,757 @@ This unreleased fuel-core build may include features and updates not yet support
32192
32192
  __publicField3(DateTime, "TAI64_NULL", "");
32193
32193
  var chainConfig_default = {
32194
32194
  chain_name: "local_testnet",
32195
- block_gas_limit: 5e9,
32196
- initial_state: {
32197
- coins: [
32198
- {
32199
- owner: "0x94ffcc53b892684acefaebc8a3d4a595e528a8cf664eeb3ef36f1020b0809d0d",
32200
- amount: "0xFFFFFFFFFFFFFFFF",
32201
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32202
- },
32203
- {
32204
- owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
32205
- amount: "0xFFFFFFFFFFFFFFFF",
32206
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32207
- },
32208
- {
32209
- owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
32210
- amount: "0xFFFFFFFFFFFFFFFF",
32211
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32212
- },
32213
- {
32214
- owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
32215
- amount: "0xFFFFFFFFFFFFFFFF",
32216
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32217
- },
32218
- {
32219
- owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
32220
- amount: "0xFFFFFFFFFFFFFFFF",
32221
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32222
- },
32223
- {
32224
- owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
32225
- amount: "0xFFFFFFFFFFFFFFFF",
32226
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32227
- },
32228
- {
32229
- owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
32230
- amount: "0xFFFFFFFFFFFFFFFF",
32231
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32232
- },
32233
- {
32234
- owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
32235
- amount: "0xFFFFFFFFFFFFFFFF",
32236
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32237
- },
32238
- {
32239
- owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
32240
- amount: "0xFFFFFFFFFFFFFFFF",
32241
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32242
- },
32243
- {
32244
- owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
32245
- amount: "0xFFFFFFFFFFFFFFFF",
32246
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32247
- },
32248
- {
32249
- owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
32250
- amount: "0xFFFFFFFFFFFFFFFF",
32251
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32252
- },
32253
- {
32254
- owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
32255
- amount: "0xFFFFFFFFFFFFFFFF",
32256
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32257
- },
32258
- {
32259
- owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
32260
- amount: "0xFFFFFFFFFFFFFFFF",
32261
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32262
- },
32263
- {
32264
- owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
32265
- amount: "0xFFFFFFFFFFFFFFFF",
32266
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32267
- },
32268
- {
32269
- owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
32270
- amount: "0xFFFFFFFFFFFFFFFF",
32271
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32272
- },
32273
- {
32274
- owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
32275
- amount: "0xFFFFFFFFFFFFFFFF",
32276
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32277
- },
32278
- {
32279
- owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
32280
- amount: "0xFFFFFFFFFFFFFFFF",
32281
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32282
- },
32283
- {
32284
- owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
32285
- amount: "0xFFFFFFFFFFFFFFFF",
32286
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32287
- },
32288
- {
32289
- owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
32290
- amount: "0xFFFFFFFFFFFFFFFF",
32291
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32292
- },
32293
- {
32294
- owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
32295
- amount: "0xFFFFFFFFFFFFFFFF",
32296
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32297
- },
32298
- {
32299
- owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
32300
- amount: "0xFFFFFFFFFFFFFFFF",
32301
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32302
- },
32303
- {
32304
- owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
32305
- amount: "0xFFFFFFFFFFFFFFFF",
32306
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32307
- },
32308
- {
32309
- owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
32310
- amount: "0xFFFFFFFFFFFFFFFF",
32311
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32312
- },
32313
- {
32314
- owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
32315
- amount: "0xFFFFFFFFFFFFFFFF",
32316
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32317
- },
32318
- {
32319
- owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
32320
- amount: "0xFFFFFFFFFFFFFFFF",
32321
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32322
- },
32323
- {
32324
- owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
32325
- amount: "0xFFFFFFFFFFFFFFFF",
32326
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32327
- },
32328
- {
32329
- owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
32330
- amount: "0xFFFFFFFFFFFFFFFF",
32331
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32332
- },
32333
- {
32334
- owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
32335
- amount: "0xFFFFFFFFFFFFFFFF",
32336
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32337
- },
32338
- {
32339
- owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
32340
- amount: "0xFFFFFFFFFFFFFFFF",
32341
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32342
- },
32343
- {
32344
- owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
32345
- amount: "0xFFFFFFFFFFFFFFFF",
32346
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32347
- },
32348
- {
32349
- owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
32350
- amount: "0xFFFFFFFFFFFFFFFF",
32351
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32352
- },
32353
- {
32354
- owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
32355
- amount: "0xFFFFFFFFFFFFFFFF",
32356
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32357
- },
32358
- {
32359
- owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
32360
- amount: "0xFFFFFFFFFFFFFFFF",
32361
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32362
- },
32363
- {
32364
- owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
32365
- amount: "0xFFFFFFFFFFFFFFFF",
32366
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32367
- },
32368
- {
32369
- owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
32370
- amount: "0xFFFFFFFFFFFFFFFF",
32371
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32372
- },
32373
- {
32374
- owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
32375
- amount: "0xFFFFFFFFFFFFFFFF",
32376
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32377
- },
32378
- {
32379
- owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
32380
- amount: "0xFFFFFFFFFFFFFFFF",
32381
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32382
- },
32383
- {
32384
- owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
32385
- amount: "0xFFFFFFFFFFFFFFFF",
32386
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32387
- },
32388
- {
32389
- owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
32390
- amount: "0xFFFFFFFFFFFFFFFF",
32391
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32392
- },
32393
- {
32394
- owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
32395
- amount: "0xFFFFFFFFFFFFFFFF",
32396
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32397
- },
32398
- {
32399
- owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
32400
- amount: "0xFFFFFFFFFFFFFFFF",
32401
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32402
- },
32403
- {
32404
- owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
32405
- amount: "0xFFFFFFFFFFFFFFFF",
32406
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32407
- },
32408
- {
32409
- owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
32410
- amount: "0xFFFFFFFFFFFFFFFF",
32411
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32412
- },
32413
- {
32414
- owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
32415
- amount: "0xFFFFFFFFFFFFFFFF",
32416
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32417
- },
32418
- {
32419
- owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
32420
- amount: "0xFFFFFFFFFFFFFFFF",
32421
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32422
- },
32423
- {
32424
- owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
32425
- amount: "0xFFFFFFFFFFFFFFFF",
32426
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32427
- },
32428
- {
32429
- owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
32430
- amount: "0xFFFFFFFFFFFFFFFF",
32431
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32432
- },
32433
- {
32434
- owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
32435
- amount: "0xFFFFFFFFFFFFFFFF",
32436
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32437
- },
32438
- {
32439
- owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
32440
- amount: "0xFFFFFFFFFFFFFFFF",
32441
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32442
- }
32443
- ],
32444
- messages: [
32445
- {
32446
- sender: "0xc43454aa38dd91f88109a4b7aef5efb96ce34e3f24992fe0f81d233ca686f80f",
32447
- recipient: "0x69a2b736b60159b43bb8a4f98c0589f6da5fa3a3d101e8e269c499eb942753ba",
32448
- nonce: "0101010101010101010101010101010101010101010101010101010101010101",
32449
- amount: "0x000000000000FFFF",
32450
- data: "",
32451
- da_height: "0x00"
32195
+ consensus_parameters: {
32196
+ V1: {
32197
+ tx_params: {
32198
+ V1: {
32199
+ max_inputs: 255,
32200
+ max_outputs: 255,
32201
+ max_witnesses: 255,
32202
+ max_gas_per_tx: 3e7,
32203
+ max_size: 112640
32204
+ }
32205
+ },
32206
+ predicate_params: {
32207
+ V1: {
32208
+ max_predicate_length: 102400,
32209
+ max_predicate_data_length: 102400,
32210
+ max_message_data_length: 102400,
32211
+ max_gas_per_predicate: 3e7
32212
+ }
32213
+ },
32214
+ script_params: {
32215
+ V1: {
32216
+ max_script_length: 102400,
32217
+ max_script_data_length: 102400
32218
+ }
32219
+ },
32220
+ contract_params: {
32221
+ V1: {
32222
+ contract_max_size: 102400,
32223
+ max_storage_slots: 1760
32224
+ }
32225
+ },
32226
+ fee_params: {
32227
+ V1: {
32228
+ gas_price_factor: 92,
32229
+ gas_per_byte: 63
32230
+ }
32231
+ },
32232
+ chain_id: 0,
32233
+ gas_costs: {
32234
+ V1: {
32235
+ add: 2,
32236
+ addi: 2,
32237
+ aloc: 1,
32238
+ and: 2,
32239
+ andi: 2,
32240
+ bal: 366,
32241
+ bhei: 2,
32242
+ bhsh: 2,
32243
+ burn: 33949,
32244
+ cb: 2,
32245
+ cfei: 2,
32246
+ cfsi: 2,
32247
+ div: 2,
32248
+ divi: 2,
32249
+ eck1: 3347,
32250
+ ecr1: 46165,
32251
+ ed19: 4210,
32252
+ eq: 2,
32253
+ exp: 2,
32254
+ expi: 2,
32255
+ flag: 1,
32256
+ gm: 2,
32257
+ gt: 2,
32258
+ gtf: 16,
32259
+ ji: 2,
32260
+ jmp: 2,
32261
+ jne: 2,
32262
+ jnei: 2,
32263
+ jnzi: 2,
32264
+ jmpf: 2,
32265
+ jmpb: 2,
32266
+ jnzf: 2,
32267
+ jnzb: 2,
32268
+ jnef: 2,
32269
+ jneb: 2,
32270
+ lb: 2,
32271
+ log: 754,
32272
+ lt: 2,
32273
+ lw: 2,
32274
+ mint: 35718,
32275
+ mlog: 2,
32276
+ mod: 2,
32277
+ modi: 2,
32278
+ move: 2,
32279
+ movi: 2,
32280
+ mroo: 5,
32281
+ mul: 2,
32282
+ muli: 2,
32283
+ mldv: 4,
32284
+ noop: 1,
32285
+ not: 2,
32286
+ or: 2,
32287
+ ori: 2,
32288
+ poph: 3,
32289
+ popl: 3,
32290
+ pshh: 4,
32291
+ pshl: 4,
32292
+ ret_contract: 733,
32293
+ rvrt_contract: 722,
32294
+ sb: 2,
32295
+ sll: 2,
32296
+ slli: 2,
32297
+ srl: 2,
32298
+ srli: 2,
32299
+ srw: 253,
32300
+ sub: 2,
32301
+ subi: 2,
32302
+ sw: 2,
32303
+ sww: 29053,
32304
+ time: 79,
32305
+ tr: 46242,
32306
+ tro: 33251,
32307
+ wdcm: 3,
32308
+ wqcm: 3,
32309
+ wdop: 3,
32310
+ wqop: 3,
32311
+ wdml: 3,
32312
+ wqml: 4,
32313
+ wddv: 5,
32314
+ wqdv: 7,
32315
+ wdmd: 11,
32316
+ wqmd: 18,
32317
+ wdam: 9,
32318
+ wqam: 12,
32319
+ wdmm: 11,
32320
+ wqmm: 11,
32321
+ xor: 2,
32322
+ xori: 2,
32323
+ call: {
32324
+ LightOperation: {
32325
+ base: 21687,
32326
+ units_per_gas: 4
32327
+ }
32328
+ },
32329
+ ccp: {
32330
+ LightOperation: {
32331
+ base: 59,
32332
+ units_per_gas: 20
32333
+ }
32334
+ },
32335
+ croo: {
32336
+ LightOperation: {
32337
+ base: 1,
32338
+ units_per_gas: 1
32339
+ }
32340
+ },
32341
+ csiz: {
32342
+ LightOperation: {
32343
+ base: 59,
32344
+ units_per_gas: 195
32345
+ }
32346
+ },
32347
+ k256: {
32348
+ LightOperation: {
32349
+ base: 282,
32350
+ units_per_gas: 3
32351
+ }
32352
+ },
32353
+ ldc: {
32354
+ LightOperation: {
32355
+ base: 45,
32356
+ units_per_gas: 65
32357
+ }
32358
+ },
32359
+ logd: {
32360
+ LightOperation: {
32361
+ base: 1134,
32362
+ units_per_gas: 2
32363
+ }
32364
+ },
32365
+ mcl: {
32366
+ LightOperation: {
32367
+ base: 3,
32368
+ units_per_gas: 523
32369
+ }
32370
+ },
32371
+ mcli: {
32372
+ LightOperation: {
32373
+ base: 3,
32374
+ units_per_gas: 526
32375
+ }
32376
+ },
32377
+ mcp: {
32378
+ LightOperation: {
32379
+ base: 3,
32380
+ units_per_gas: 448
32381
+ }
32382
+ },
32383
+ mcpi: {
32384
+ LightOperation: {
32385
+ base: 7,
32386
+ units_per_gas: 585
32387
+ }
32388
+ },
32389
+ meq: {
32390
+ LightOperation: {
32391
+ base: 11,
32392
+ units_per_gas: 1097
32393
+ }
32394
+ },
32395
+ retd_contract: {
32396
+ LightOperation: {
32397
+ base: 1086,
32398
+ units_per_gas: 2
32399
+ }
32400
+ },
32401
+ s256: {
32402
+ LightOperation: {
32403
+ base: 45,
32404
+ units_per_gas: 3
32405
+ }
32406
+ },
32407
+ scwq: {
32408
+ HeavyOperation: {
32409
+ base: 30375,
32410
+ gas_per_unit: 28628
32411
+ }
32412
+ },
32413
+ smo: {
32414
+ LightOperation: {
32415
+ base: 64196,
32416
+ units_per_gas: 1
32417
+ }
32418
+ },
32419
+ srwq: {
32420
+ HeavyOperation: {
32421
+ base: 262,
32422
+ gas_per_unit: 249
32423
+ }
32424
+ },
32425
+ swwq: {
32426
+ HeavyOperation: {
32427
+ base: 28484,
32428
+ gas_per_unit: 26613
32429
+ }
32430
+ },
32431
+ contract_root: {
32432
+ LightOperation: {
32433
+ base: 45,
32434
+ units_per_gas: 1
32435
+ }
32436
+ },
32437
+ state_root: {
32438
+ HeavyOperation: {
32439
+ base: 350,
32440
+ gas_per_unit: 176
32441
+ }
32442
+ },
32443
+ new_storage_per_byte: 63,
32444
+ vm_initialization: {
32445
+ LightOperation: {
32446
+ base: 1645,
32447
+ units_per_gas: 14
32448
+ }
32449
+ }
32450
+ }
32452
32451
  },
32453
- {
32454
- sender: "0x69a2b736b60159b43bb8a4f98c0589f6da5fa3a3d101e8e269c499eb942753ba",
32455
- recipient: "0xc43454aa38dd91f88109a4b7aef5efb96ce34e3f24992fe0f81d233ca686f80f",
32456
- nonce: "0e1ef2963832068b0e1ef2963832068b0e1ef2963832068b0e1ef2963832068b",
32457
- amount: "0xb04f3c08f59b309e",
32458
- data: "",
32459
- da_height: "0x00"
32460
- }
32461
- ]
32452
+ base_asset_id: "0000000000000000000000000000000000000000000000000000000000000000",
32453
+ block_gas_limit: 3e7,
32454
+ privileged_address: "0000000000000000000000000000000000000000000000000000000000000000"
32455
+ }
32462
32456
  },
32463
- consensus_parameters: {
32464
- tx_params: {
32465
- max_inputs: 255,
32466
- max_outputs: 255,
32467
- max_witnesses: 255,
32468
- max_gas_per_tx: 1e7,
32469
- max_size: 17825792
32457
+ consensus: {
32458
+ PoA: {
32459
+ signing_key: "0x94ffcc53b892684acefaebc8a3d4a595e528a8cf664eeb3ef36f1020b0809d0d"
32460
+ }
32461
+ }
32462
+ };
32463
+ var metadata_default = {
32464
+ chain_config: "chainConfig.json",
32465
+ table_encoding: {
32466
+ Json: {
32467
+ filepath: "stateConfig.json"
32468
+ }
32469
+ }
32470
+ };
32471
+ var stateConfig_default = {
32472
+ coins: [
32473
+ {
32474
+ tx_id: "0x260eabfd50937e92939fd92687e9302a72e91c5065f64f853f2ccbe02396fe09d665",
32475
+ output_index: 0,
32476
+ tx_pointer_block_height: 0,
32477
+ tx_pointer_tx_idx: 0,
32478
+ owner: "0x94ffcc53b892684acefaebc8a3d4a595e528a8cf664eeb3ef36f1020b0809d0d",
32479
+ amount: 18446744073709552e3,
32480
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32470
32481
  },
32471
- predicate_params: {
32472
- max_predicate_length: 1048576,
32473
- max_predicate_data_length: 1048576,
32474
- max_gas_per_predicate: 1e7,
32475
- max_message_data_length: 1048576
32482
+ {
32483
+ tx_id: "0x2a757c2317236f7883ac9bbbf7d402f034e0b725c544ef1c8725b1d2bd960f8c690f",
32484
+ output_index: 0,
32485
+ tx_pointer_block_height: 0,
32486
+ tx_pointer_tx_idx: 0,
32487
+ owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
32488
+ amount: 18446744073709552e3,
32489
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32476
32490
  },
32477
- script_params: {
32478
- max_script_length: 1048576,
32479
- max_script_data_length: 1048576
32491
+ {
32492
+ tx_id: "0x634ef6cda00bac63992bbde80c6d694d484d58025a5ca0c9c848f0d35a5a3eee74b2",
32493
+ output_index: 0,
32494
+ tx_pointer_block_height: 0,
32495
+ tx_pointer_tx_idx: 0,
32496
+ owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
32497
+ amount: 18446744073709552e3,
32498
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32480
32499
  },
32481
- contract_params: {
32482
- contract_max_size: 16777216,
32483
- max_storage_slots: 255
32500
+ {
32501
+ tx_id: "0xd3543bb1da137a7987a96a1bb71681fdd195ff25318c0d4a923aa30eb27ffa80bc7b",
32502
+ output_index: 0,
32503
+ tx_pointer_block_height: 0,
32504
+ tx_pointer_tx_idx: 0,
32505
+ owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
32506
+ amount: 18446744073709552e3,
32507
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32484
32508
  },
32485
- fee_params: {
32486
- gas_price_factor: 92,
32487
- gas_per_byte: 4
32509
+ {
32510
+ tx_id: "0xa4d42cbb02adb32f5f3a9eab33a0ee7bdab8910ad9f615dfc86a7bb9e49a732bc58c",
32511
+ output_index: 0,
32512
+ tx_pointer_block_height: 0,
32513
+ tx_pointer_tx_idx: 0,
32514
+ owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
32515
+ amount: 18446744073709552e3,
32516
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32488
32517
  },
32489
- base_asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
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
- }
32518
+ {
32519
+ tx_id: "0xc197cb09b1d89a7862b238e9500631bd43f291aadb7ff55c8129335349634e9fde3f",
32520
+ output_index: 0,
32521
+ tx_pointer_block_height: 0,
32522
+ tx_pointer_tx_idx: 0,
32523
+ owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
32524
+ amount: 18446744073709552e3,
32525
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32586
32526
  },
32587
- ccp: {
32588
- LightOperation: {
32589
- base: 15,
32590
- units_per_gas: 103
32591
- }
32527
+ {
32528
+ tx_id: "0x4c4fc2451b9a9b16c520c1b89ec8968ce46823dd0396d84f7e3155861352fdce12c5",
32529
+ output_index: 0,
32530
+ tx_pointer_block_height: 0,
32531
+ tx_pointer_tx_idx: 0,
32532
+ owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
32533
+ amount: 18446744073709552e3,
32534
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32592
32535
  },
32593
- csiz: {
32594
- LightOperation: {
32595
- base: 17,
32596
- units_per_gas: 790
32597
- }
32536
+ {
32537
+ tx_id: "0x68df8f08555086a1ab45591e6fe4bf2f538bcb80dd519108030b7e886d6a230c2531",
32538
+ output_index: 0,
32539
+ tx_pointer_block_height: 0,
32540
+ tx_pointer_tx_idx: 0,
32541
+ owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
32542
+ amount: 18446744073709552e3,
32543
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32598
32544
  },
32599
- k256: {
32600
- LightOperation: {
32601
- base: 11,
32602
- units_per_gas: 214
32603
- }
32545
+ {
32546
+ tx_id: "0x1b9bdaa290518373eb905e45ce7fcb89acedd24341ca7749ad47a938e4bf3ca9b7ce",
32547
+ output_index: 0,
32548
+ tx_pointer_block_height: 0,
32549
+ tx_pointer_tx_idx: 0,
32550
+ owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
32551
+ amount: 18446744073709552e3,
32552
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32604
32553
  },
32605
- ldc: {
32606
- LightOperation: {
32607
- base: 15,
32608
- units_per_gas: 272
32609
- }
32554
+ {
32555
+ tx_id: "0xa5a2e9db3d1285337fe1183dc1eabe8f9cdcd470daf95cd5c522bbae292f53977f26",
32556
+ output_index: 0,
32557
+ tx_pointer_block_height: 0,
32558
+ tx_pointer_tx_idx: 0,
32559
+ owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
32560
+ amount: 18446744073709552e3,
32561
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32610
32562
  },
32611
- logd: {
32612
- LightOperation: {
32613
- base: 26,
32614
- units_per_gas: 64
32615
- }
32563
+ {
32564
+ tx_id: "0x13b685a1ea7c56309a92d69dd7e4808987ec90d62a1f9c9f2ec18e54746855c8c93c",
32565
+ output_index: 0,
32566
+ tx_pointer_block_height: 0,
32567
+ tx_pointer_tx_idx: 0,
32568
+ owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
32569
+ amount: 18446744073709552e3,
32570
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32616
32571
  },
32617
- mcl: {
32618
- LightOperation: {
32619
- base: 1,
32620
- units_per_gas: 3333
32621
- }
32572
+ {
32573
+ tx_id: "0xf8f00a234cf3fbab86befc3fd9346d7fd1ac085233c9cb58c7447f30c75cbf87ed38",
32574
+ output_index: 0,
32575
+ tx_pointer_block_height: 0,
32576
+ tx_pointer_tx_idx: 0,
32577
+ owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
32578
+ amount: 18446744073709552e3,
32579
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32622
32580
  },
32623
- mcli: {
32624
- LightOperation: {
32625
- base: 1,
32626
- units_per_gas: 3333
32627
- }
32581
+ {
32582
+ tx_id: "0x2a36c870f624b60fbd6f2b71332ca7f704c69296ceae4ddbf3a8ede79408088934be",
32583
+ output_index: 0,
32584
+ tx_pointer_block_height: 0,
32585
+ tx_pointer_tx_idx: 0,
32586
+ owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
32587
+ amount: 18446744073709552e3,
32588
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32628
32589
  },
32629
- mcp: {
32630
- LightOperation: {
32631
- base: 1,
32632
- units_per_gas: 2e3
32633
- }
32590
+ {
32591
+ tx_id: "0x9cd180d41e67a422da8a7683f036b463a7ed7efc0de31c1692adac90decbfebce78c",
32592
+ output_index: 0,
32593
+ tx_pointer_block_height: 0,
32594
+ tx_pointer_tx_idx: 0,
32595
+ owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
32596
+ amount: 18446744073709552e3,
32597
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32634
32598
  },
32635
- mcpi: {
32636
- LightOperation: {
32637
- base: 3,
32638
- units_per_gas: 2e3
32639
- }
32599
+ {
32600
+ tx_id: "0xfeb4f2388fa22e6613ff85cf4e655f58acdfaa6299eba7f93b812cd1f0d7bbac48f0",
32601
+ output_index: 0,
32602
+ tx_pointer_block_height: 0,
32603
+ tx_pointer_tx_idx: 0,
32604
+ owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
32605
+ amount: 18446744073709552e3,
32606
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32640
32607
  },
32641
- meq: {
32642
- LightOperation: {
32643
- base: 1,
32644
- units_per_gas: 2500
32645
- }
32608
+ {
32609
+ tx_id: "0xc4d20299f43358dc32ab853f6631340b09278511b6adbaf34597ade6ef37efd018f1",
32610
+ output_index: 0,
32611
+ tx_pointer_block_height: 0,
32612
+ tx_pointer_tx_idx: 0,
32613
+ owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
32614
+ amount: 18446744073709552e3,
32615
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32646
32616
  },
32647
- retd: {
32648
- LightOperation: {
32649
- base: 29,
32650
- units_per_gas: 62
32651
- }
32617
+ {
32618
+ tx_id: "0x437291414110b0aebaa8be5c0d9ff1e97d1130a24a6c9e028f2b1f6b0576be6aa961",
32619
+ output_index: 0,
32620
+ tx_pointer_block_height: 0,
32621
+ tx_pointer_tx_idx: 0,
32622
+ owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
32623
+ amount: 18446744073709552e3,
32624
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32652
32625
  },
32653
- s256: {
32654
- LightOperation: {
32655
- base: 2,
32656
- units_per_gas: 214
32657
- }
32626
+ {
32627
+ tx_id: "0x28131b9acc90c2058ee14f4094a474146ba5b779cb9021867164b3d41abad3d047a7",
32628
+ output_index: 0,
32629
+ tx_pointer_block_height: 0,
32630
+ tx_pointer_tx_idx: 0,
32631
+ owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
32632
+ amount: 18446744073709552e3,
32633
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32658
32634
  },
32659
- scwq: {
32660
- LightOperation: {
32661
- base: 13,
32662
- units_per_gas: 5
32663
- }
32635
+ {
32636
+ tx_id: "0x033bb5f9b0e4f530d50af3a0f12dd510f799af495ef88baea3cf854a37da728d214b",
32637
+ output_index: 0,
32638
+ tx_pointer_block_height: 0,
32639
+ tx_pointer_tx_idx: 0,
32640
+ owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
32641
+ amount: 18446744073709552e3,
32642
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32664
32643
  },
32665
- smo: {
32666
- LightOperation: {
32667
- base: 209,
32668
- units_per_gas: 55
32669
- }
32644
+ {
32645
+ tx_id: "0x460591398552eca338dd9577f362b91b0f9297f308258734870350004dcc303c67e9",
32646
+ output_index: 0,
32647
+ tx_pointer_block_height: 0,
32648
+ tx_pointer_tx_idx: 0,
32649
+ owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
32650
+ amount: 18446744073709552e3,
32651
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32670
32652
  },
32671
- srwq: {
32672
- LightOperation: {
32673
- base: 47,
32674
- units_per_gas: 5
32675
- }
32653
+ {
32654
+ tx_id: "0x447a7c37aee972dcba72f05255c5145dd63125f0fc46ef98c216f775ee0421e23d2b",
32655
+ output_index: 0,
32656
+ tx_pointer_block_height: 0,
32657
+ tx_pointer_tx_idx: 0,
32658
+ owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
32659
+ amount: 18446744073709552e3,
32660
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32676
32661
  },
32677
- swwq: {
32678
- LightOperation: {
32679
- base: 44,
32680
- units_per_gas: 5
32681
- }
32662
+ {
32663
+ tx_id: "0xf4a5d727606260c7ac6333fa89e7aef474df8a13326716d4d02f6392ebb7b997d268",
32664
+ output_index: 0,
32665
+ tx_pointer_block_height: 0,
32666
+ tx_pointer_tx_idx: 0,
32667
+ owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
32668
+ amount: 18446744073709552e3,
32669
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32682
32670
  },
32683
- contract_root: {
32684
- LightOperation: {
32685
- base: 75,
32686
- units_per_gas: 1
32687
- }
32671
+ {
32672
+ tx_id: "0x25a49b0731bf610f6706aa9e9e96e5967f7c50f4302a3c75d7c8141595896551c18d",
32673
+ output_index: 0,
32674
+ tx_pointer_block_height: 0,
32675
+ tx_pointer_tx_idx: 0,
32676
+ owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
32677
+ amount: 18446744073709552e3,
32678
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32688
32679
  },
32689
- state_root: {
32690
- LightOperation: {
32691
- base: 412,
32692
- units_per_gas: 1
32693
- }
32680
+ {
32681
+ tx_id: "0x0a6e3585881ef2edf3f7727762799089dc0b5923e8b3718b49044dd9ddcb33b68459",
32682
+ output_index: 0,
32683
+ tx_pointer_block_height: 0,
32684
+ tx_pointer_tx_idx: 0,
32685
+ owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
32686
+ amount: 18446744073709552e3,
32687
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32694
32688
  },
32695
- vm_initialization: {
32696
- HeavyOperation: {
32697
- base: 2e3,
32698
- gas_per_unit: 0
32699
- }
32689
+ {
32690
+ tx_id: "0xf73bbe0635f7b6d59a090a21d87288b82164d0f6101da830ce64eff64a2d2ff2ac37",
32691
+ output_index: 0,
32692
+ tx_pointer_block_height: 0,
32693
+ tx_pointer_tx_idx: 0,
32694
+ owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
32695
+ amount: 18446744073709552e3,
32696
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32700
32697
  },
32701
- new_storage_per_byte: 1
32702
- },
32703
- consensus: {
32704
- PoA: {
32705
- signing_key: "0x94ffcc53b892684acefaebc8a3d4a595e528a8cf664eeb3ef36f1020b0809d0d"
32698
+ {
32699
+ tx_id: "0x6cc44cb8d2a6462a591a77b6b9917eb6b22ad80d23d3cfd4f94c9da49c14b3cbac6e",
32700
+ output_index: 0,
32701
+ tx_pointer_block_height: 0,
32702
+ tx_pointer_tx_idx: 0,
32703
+ owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
32704
+ amount: 18446744073709552e3,
32705
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32706
+ },
32707
+ {
32708
+ tx_id: "0xbf2305d284ea95227040df4cc727156cccc2ca6aa3b92ed86fea4db1c37e5905f926",
32709
+ output_index: 0,
32710
+ tx_pointer_block_height: 0,
32711
+ tx_pointer_tx_idx: 0,
32712
+ owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
32713
+ amount: 18446744073709552e3,
32714
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32715
+ },
32716
+ {
32717
+ tx_id: "0xf4e1c76c72ecae699696f5e7a62ccf1425f7395080d0ca7b25ab63d1f841f425b807",
32718
+ output_index: 0,
32719
+ tx_pointer_block_height: 0,
32720
+ tx_pointer_tx_idx: 0,
32721
+ owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
32722
+ amount: 18446744073709552e3,
32723
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32724
+ },
32725
+ {
32726
+ tx_id: "0x619c80ee9f4c27c2e134cec6c67bdb268ce7fb1d2ac229ca2a44ec7ac88b2da99669",
32727
+ output_index: 0,
32728
+ tx_pointer_block_height: 0,
32729
+ tx_pointer_tx_idx: 0,
32730
+ owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
32731
+ amount: 18446744073709552e3,
32732
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32733
+ },
32734
+ {
32735
+ tx_id: "0x978d5b6be047ffbf1474dc376a6baa33264629b809e4a8210d11aaa805ec6451585d",
32736
+ output_index: 0,
32737
+ tx_pointer_block_height: 0,
32738
+ tx_pointer_tx_idx: 0,
32739
+ owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
32740
+ amount: 18446744073709552e3,
32741
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32742
+ },
32743
+ {
32744
+ tx_id: "0x673ba12fca6e52429896096262b8c59b61751976e552649fb1fe7369488fc10aa83c",
32745
+ output_index: 0,
32746
+ tx_pointer_block_height: 0,
32747
+ tx_pointer_tx_idx: 0,
32748
+ owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
32749
+ amount: 18446744073709552e3,
32750
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32751
+ },
32752
+ {
32753
+ tx_id: "0xc42a165104b9fcfa4a9ebffc707781ace233f1c0609c24c36a5c4bfcd407480ddb6c",
32754
+ output_index: 0,
32755
+ tx_pointer_block_height: 0,
32756
+ tx_pointer_tx_idx: 0,
32757
+ owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
32758
+ amount: 18446744073709552e3,
32759
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32760
+ },
32761
+ {
32762
+ tx_id: "0xb353fbcd94abba347f3ba25e17744e98da26e608ebccbbbd2e9d004997644bdf993c",
32763
+ output_index: 0,
32764
+ tx_pointer_block_height: 0,
32765
+ tx_pointer_tx_idx: 0,
32766
+ owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
32767
+ amount: 18446744073709552e3,
32768
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32769
+ },
32770
+ {
32771
+ tx_id: "0xc34a6fcb241dec82f885019caf5e14bb6708b435afebfef0037ac447fbb6d30378a3",
32772
+ output_index: 0,
32773
+ tx_pointer_block_height: 0,
32774
+ tx_pointer_tx_idx: 0,
32775
+ owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
32776
+ amount: 18446744073709552e3,
32777
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32778
+ },
32779
+ {
32780
+ tx_id: "0x421dfb5811c905724f2f4c6370cd15eaeb590ddeb966f9a4b9f8d65991dfe5142e12",
32781
+ output_index: 0,
32782
+ tx_pointer_block_height: 0,
32783
+ tx_pointer_tx_idx: 0,
32784
+ owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
32785
+ amount: 18446744073709552e3,
32786
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32787
+ },
32788
+ {
32789
+ tx_id: "0xa952c0487eefac5dda612011c4c82554c8660834461b9b815c6ae257b56b68005235",
32790
+ output_index: 0,
32791
+ tx_pointer_block_height: 0,
32792
+ tx_pointer_tx_idx: 0,
32793
+ owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
32794
+ amount: 18446744073709552e3,
32795
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32796
+ },
32797
+ {
32798
+ tx_id: "0xebaccf91b3b213341d047b6e6af214f1f9729b3d6dadf9c1918a9fe412486af871db",
32799
+ output_index: 0,
32800
+ tx_pointer_block_height: 0,
32801
+ tx_pointer_tx_idx: 0,
32802
+ owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
32803
+ amount: 18446744073709552e3,
32804
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32805
+ },
32806
+ {
32807
+ tx_id: "0xda6d61c153e7d735954408274f4ffe8459c2dbab720ce22a1ae9ffedd33077b5b19d",
32808
+ output_index: 0,
32809
+ tx_pointer_block_height: 0,
32810
+ tx_pointer_tx_idx: 0,
32811
+ owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
32812
+ amount: 18446744073709552e3,
32813
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32814
+ },
32815
+ {
32816
+ tx_id: "0x508871600ef68c4f1e021dd0db219c733107151338aa95de530bd10dc61f6a69c144",
32817
+ output_index: 0,
32818
+ tx_pointer_block_height: 0,
32819
+ tx_pointer_tx_idx: 0,
32820
+ owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
32821
+ amount: 18446744073709552e3,
32822
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32823
+ },
32824
+ {
32825
+ tx_id: "0x509994738b4973e2dbbff9596b176a89fb07ee95f0ed575a4fe07a735a2a181f3200",
32826
+ output_index: 0,
32827
+ tx_pointer_block_height: 0,
32828
+ tx_pointer_tx_idx: 0,
32829
+ owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
32830
+ amount: 18446744073709552e3,
32831
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32832
+ },
32833
+ {
32834
+ tx_id: "0x6cc0cb58df0e0606fc85481aaaf5f47e145a67240b298c184bcb7fd7367c3bbf9453",
32835
+ output_index: 0,
32836
+ tx_pointer_block_height: 0,
32837
+ tx_pointer_tx_idx: 0,
32838
+ owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
32839
+ amount: 18446744073709552e3,
32840
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32841
+ },
32842
+ {
32843
+ tx_id: "0x9ddea761afc31516307e1553647ac6cc26d4a82fed9a9e6a03b994cdbf2293b3e3b6",
32844
+ output_index: 0,
32845
+ tx_pointer_block_height: 0,
32846
+ tx_pointer_tx_idx: 0,
32847
+ owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
32848
+ amount: 18446744073709552e3,
32849
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32850
+ },
32851
+ {
32852
+ tx_id: "0x82dbc478ba63abf28b92d9dce0cb8c2e6c02833d436fe812a33cf78417e4a80c1306",
32853
+ output_index: 0,
32854
+ tx_pointer_block_height: 0,
32855
+ tx_pointer_tx_idx: 0,
32856
+ owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
32857
+ amount: 18446744073709552e3,
32858
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32859
+ },
32860
+ {
32861
+ tx_id: "0xc3b0cb232c74009fd226a6246403f78bcc33d116579f41d9387c0d76c76942749c7c",
32862
+ output_index: 0,
32863
+ tx_pointer_block_height: 0,
32864
+ tx_pointer_tx_idx: 0,
32865
+ owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
32866
+ amount: 18446744073709552e3,
32867
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32868
+ },
32869
+ {
32870
+ tx_id: "0x708ee45d18f94ab06458712745c92c7b9b6049ba345219d6697eae5208ec0328aeaf",
32871
+ output_index: 0,
32872
+ tx_pointer_block_height: 0,
32873
+ tx_pointer_tx_idx: 0,
32874
+ owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
32875
+ amount: 18446744073709552e3,
32876
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32877
+ },
32878
+ {
32879
+ tx_id: "0xfe26968c44ac5becc608ce543075ae9e677b7631f3beb7a11ba20703fdca3c0e3569",
32880
+ output_index: 0,
32881
+ tx_pointer_block_height: 0,
32882
+ tx_pointer_tx_idx: 0,
32883
+ owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
32884
+ amount: 18446744073709552e3,
32885
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32886
+ },
32887
+ {
32888
+ tx_id: "0xe0ec1d2c991feac69be4d0e84ad7c964616de08e16dccc4d2000b1900ba31082b993",
32889
+ output_index: 0,
32890
+ tx_pointer_block_height: 0,
32891
+ tx_pointer_tx_idx: 0,
32892
+ owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
32893
+ amount: 18446744073709552e3,
32894
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32895
+ },
32896
+ {
32897
+ tx_id: "0xfa82dbdd72252d1e6c76ee818bbac0441c3a705aff447f041c8b9fc3cb03f9ccd7e2",
32898
+ output_index: 0,
32899
+ tx_pointer_block_height: 0,
32900
+ tx_pointer_tx_idx: 0,
32901
+ owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
32902
+ amount: 18446744073709552e3,
32903
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32904
+ },
32905
+ {
32906
+ tx_id: "0x324f45e47cef892ac3e0759f3b72207c77046f9938267af4bd4af2ae031b97cb36c8",
32907
+ output_index: 0,
32908
+ tx_pointer_block_height: 0,
32909
+ tx_pointer_tx_idx: 0,
32910
+ owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
32911
+ amount: 18446744073709552e3,
32912
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32706
32913
  }
32707
- }
32914
+ ],
32915
+ messages: [
32916
+ {
32917
+ sender: "0xc43454aa38dd91f88109a4b7aef5efb96ce34e3f24992fe0f81d233ca686f80f",
32918
+ recipient: "0x69a2b736b60159b43bb8a4f98c0589f6da5fa3a3d101e8e269c499eb942753ba",
32919
+ nonce: "0101010101010101010101010101010101010101010101010101010101010101",
32920
+ amount: 18446744073709552e3,
32921
+ data: "",
32922
+ da_height: 0
32923
+ },
32924
+ {
32925
+ sender: "0x69a2b736b60159b43bb8a4f98c0589f6da5fa3a3d101e8e269c499eb942753ba",
32926
+ recipient: "0xc43454aa38dd91f88109a4b7aef5efb96ce34e3f24992fe0f81d233ca686f80f",
32927
+ nonce: "0e1ef2963832068b0e1ef2963832068b0e1ef2963832068b0e1ef2963832068b",
32928
+ amount: 12704439083013452e3,
32929
+ data: "",
32930
+ da_height: 0
32931
+ }
32932
+ ],
32933
+ contracts: [],
32934
+ block_height: 0,
32935
+ da_block_height: 0
32936
+ };
32937
+ var defaultChainConfigs = {
32938
+ chainConfigJson: chainConfig_default,
32939
+ metadataJson: metadata_default,
32940
+ stateConfigJson: stateConfig_default
32708
32941
  };
32709
- var defaultChainConfig = chainConfig_default;
32710
32942
  var defaultConsensusKey = "0xa449b1ffee0e2205fa924c6740cc48b3b473aa28587df6dab12abc245d1f5298";
32711
32943
 
32712
32944
  // ../crypto/dist/index.mjs
32713
- var import_crypto8 = __toESM(__require("crypto"), 1);
32945
+ var import_crypto9 = __toESM(__require("crypto"), 1);
32714
32946
 
32715
32947
  // ../../node_modules/.pnpm/ethers@6.7.1/node_modules/ethers/lib.esm/_version.js
32716
32948
  var version = "6.7.1";
@@ -33782,6 +34014,27 @@ This unreleased fuel-core build may include features and updates not yet support
33782
34014
  };
33783
34015
  Object.freeze(pbkdf22);
33784
34016
 
34017
+ // ../../node_modules/.pnpm/ethers@6.7.1/node_modules/ethers/lib.esm/crypto/random.js
34018
+ var locked5 = false;
34019
+ var _randomBytes = function(length) {
34020
+ return new Uint8Array((0, import_crypto2.randomBytes)(length));
34021
+ };
34022
+ var __randomBytes = _randomBytes;
34023
+ function randomBytes3(length) {
34024
+ return __randomBytes(length);
34025
+ }
34026
+ randomBytes3._ = _randomBytes;
34027
+ randomBytes3.lock = function() {
34028
+ locked5 = true;
34029
+ };
34030
+ randomBytes3.register = function(func) {
34031
+ if (locked5) {
34032
+ throw new Error("randomBytes is locked");
34033
+ }
34034
+ __randomBytes = func;
34035
+ };
34036
+ Object.freeze(randomBytes3);
34037
+
33785
34038
  // ../../node_modules/.pnpm/ethers@6.7.1/node_modules/ethers/lib.esm/address/address.js
33786
34039
  var BN_03 = BigInt(0);
33787
34040
  var BN_36 = BigInt(36);
@@ -34366,8 +34619,8 @@ This unreleased fuel-core build may include features and updates not yet support
34366
34619
  }
34367
34620
 
34368
34621
  // ../crypto/dist/index.mjs
34369
- var import_crypto9 = __toESM(__require("crypto"), 1);
34370
34622
  var import_crypto10 = __toESM(__require("crypto"), 1);
34623
+ var import_crypto11 = __toESM(__require("crypto"), 1);
34371
34624
  var scrypt3 = (params) => {
34372
34625
  const { password, salt, n, p, r, dklen } = params;
34373
34626
  const derivedKey = scrypt(password, salt, { N: n, r, p, dkLen: dklen });
@@ -34376,7 +34629,7 @@ This unreleased fuel-core build may include features and updates not yet support
34376
34629
  var keccak2562 = (data) => keccak_256(data);
34377
34630
  var bufferFromString = (string, encoding = "base64") => Uint8Array.from(Buffer.from(string, encoding));
34378
34631
  var randomBytes4 = (length) => {
34379
- const randomValues = Uint8Array.from(import_crypto9.default.randomBytes(length));
34632
+ const randomValues = Uint8Array.from(import_crypto10.default.randomBytes(length));
34380
34633
  return randomValues;
34381
34634
  };
34382
34635
  var stringFromBuffer = (buffer, encoding = "base64") => Buffer.from(buffer).toString(encoding);
@@ -34391,7 +34644,7 @@ This unreleased fuel-core build may include features and updates not yet support
34391
34644
  const salt = randomBytes4(32);
34392
34645
  const secret = keyFromPassword(password, salt);
34393
34646
  const dataBuffer = Uint8Array.from(Buffer.from(JSON.stringify(data), "utf-8"));
34394
- const cipher = await import_crypto8.default.createCipheriv(ALGORITHM, secret, iv);
34647
+ const cipher = await import_crypto9.default.createCipheriv(ALGORITHM, secret, iv);
34395
34648
  let cipherData = cipher.update(dataBuffer);
34396
34649
  cipherData = Buffer.concat([cipherData, cipher.final()]);
34397
34650
  return {
@@ -34405,7 +34658,7 @@ This unreleased fuel-core build may include features and updates not yet support
34405
34658
  const salt = bufferFromString(keystore.salt);
34406
34659
  const secret = keyFromPassword(password, salt);
34407
34660
  const encryptedText = bufferFromString(keystore.data);
34408
- const decipher = await import_crypto8.default.createDecipheriv(ALGORITHM, secret, iv);
34661
+ const decipher = await import_crypto9.default.createDecipheriv(ALGORITHM, secret, iv);
34409
34662
  const decrypted = decipher.update(encryptedText);
34410
34663
  const deBuff = Buffer.concat([decrypted, decipher.final()]);
34411
34664
  const decryptedData = Buffer.from(deBuff).toString("utf-8");
@@ -34416,12 +34669,12 @@ This unreleased fuel-core build may include features and updates not yet support
34416
34669
  }
34417
34670
  };
34418
34671
  async function encryptJsonWalletData(data, key, iv) {
34419
- const cipher = await import_crypto10.default.createCipheriv("aes-128-ctr", key.subarray(0, 16), iv);
34672
+ const cipher = await import_crypto11.default.createCipheriv("aes-128-ctr", key.subarray(0, 16), iv);
34420
34673
  const encrypted = Buffer.concat([cipher.update(data), cipher.final()]);
34421
34674
  return new Uint8Array(encrypted);
34422
34675
  }
34423
34676
  async function decryptJsonWalletData(data, key, iv) {
34424
- const decipher = import_crypto10.default.createDecipheriv("aes-128-ctr", key.subarray(0, 16), iv);
34677
+ const decipher = import_crypto11.default.createDecipheriv("aes-128-ctr", key.subarray(0, 16), iv);
34425
34678
  const decrypted = await Buffer.concat([decipher.update(data), decipher.final()]);
34426
34679
  return new Uint8Array(decrypted);
34427
34680
  }
@@ -34755,11 +35008,15 @@ This unreleased fuel-core build may include features and updates not yet support
34755
35008
  }
34756
35009
  };
34757
35010
 
35011
+ // ../address/dist/configs.mjs
35012
+ var ZeroBytes32 = "0x0000000000000000000000000000000000000000000000000000000000000000";
35013
+ var BaseAssetId = ZeroBytes32;
35014
+
34758
35015
  // ../math/dist/index.mjs
34759
35016
  var import_bn = __toESM(require_bn(), 1);
34760
35017
  var DEFAULT_PRECISION = 9;
34761
35018
  var DEFAULT_MIN_PRECISION = 3;
34762
- var DECIMAL_UNITS = 9;
35019
+ var DEFAULT_DECIMAL_UNITS = 9;
34763
35020
  function toFixed(value, options) {
34764
35021
  const { precision = DEFAULT_PRECISION, minPrecision = DEFAULT_MIN_PRECISION } = options || {};
34765
35022
  const [valueUnits = "0", valueDecimals = "0"] = String(value || "0.0").split(".");
@@ -34825,7 +35082,7 @@ This unreleased fuel-core build may include features and updates not yet support
34825
35082
  }
34826
35083
  format(options) {
34827
35084
  const {
34828
- units = DECIMAL_UNITS,
35085
+ units = DEFAULT_DECIMAL_UNITS,
34829
35086
  precision = DEFAULT_PRECISION,
34830
35087
  minPrecision = DEFAULT_MIN_PRECISION
34831
35088
  } = options || {};
@@ -34841,7 +35098,7 @@ This unreleased fuel-core build may include features and updates not yet support
34841
35098
  }
34842
35099
  return formattedFixed;
34843
35100
  }
34844
- formatUnits(units = DECIMAL_UNITS) {
35101
+ formatUnits(units = DEFAULT_DECIMAL_UNITS) {
34845
35102
  const valueUnits = this.toString().slice(0, units * -1);
34846
35103
  const valueDecimals = this.toString().slice(units * -1);
34847
35104
  const length = valueDecimals.length;
@@ -34950,7 +35207,7 @@ This unreleased fuel-core build may include features and updates not yet support
34950
35207
  // END ANCHOR: OVERRIDES to avoid losing references
34951
35208
  };
34952
35209
  var bn = (value, base, endian) => new BN(value, base, endian);
34953
- bn.parseUnits = (value, units = DECIMAL_UNITS) => {
35210
+ bn.parseUnits = (value, units = DEFAULT_DECIMAL_UNITS) => {
34954
35211
  const valueToParse = value === "." ? "0." : value;
34955
35212
  const [valueUnits = "0", valueDecimals = "0"] = valueToParse.split(".");
34956
35213
  const length = valueDecimals.length;
@@ -34974,32 +35231,182 @@ This unreleased fuel-core build may include features and updates not yet support
34974
35231
  function toBytes3(value, bytesPadding) {
34975
35232
  return bn(value).toBytes(bytesPadding);
34976
35233
  }
34977
- function max(...numbers) {
34978
- return numbers.reduce((prev, cur) => bn(cur).gt(prev) ? bn(cur) : prev, bn(0));
35234
+
35235
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isPlaceholder.js
35236
+ function _isPlaceholder(a) {
35237
+ return a != null && typeof a === "object" && a["@@functional/placeholder"] === true;
35238
+ }
35239
+
35240
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_curry1.js
35241
+ function _curry1(fn) {
35242
+ return function f1(a) {
35243
+ if (arguments.length === 0 || _isPlaceholder(a)) {
35244
+ return f1;
35245
+ } else {
35246
+ return fn.apply(this, arguments);
35247
+ }
35248
+ };
35249
+ }
35250
+
35251
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isArray.js
35252
+ var isArray_default = Array.isArray || function _isArray(val) {
35253
+ return val != null && val.length >= 0 && Object.prototype.toString.call(val) === "[object Array]";
35254
+ };
35255
+
35256
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/type.js
35257
+ var type = /* @__PURE__ */ _curry1(function type2(val) {
35258
+ return val === null ? "Null" : val === void 0 ? "Undefined" : Object.prototype.toString.call(val).slice(8, -1);
35259
+ });
35260
+ var type_default = type;
35261
+
35262
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_toISOString.js
35263
+ var pad = function pad2(n) {
35264
+ return (n < 10 ? "0" : "") + n;
35265
+ };
35266
+ var _toISOString = typeof Date.prototype.toISOString === "function" ? function _toISOString2(d) {
35267
+ return d.toISOString();
35268
+ } : function _toISOString3(d) {
35269
+ 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";
35270
+ };
35271
+
35272
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isInteger.js
35273
+ var isInteger_default = Number.isInteger || function _isInteger(n) {
35274
+ return n << 0 === n;
35275
+ };
35276
+
35277
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_cloneRegExp.js
35278
+ function _cloneRegExp(pattern) {
35279
+ 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" : ""));
35280
+ }
35281
+
35282
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_clone.js
35283
+ function _clone(value, deep, map) {
35284
+ map || (map = new _ObjectMap());
35285
+ if (_isPrimitive(value)) {
35286
+ return value;
35287
+ }
35288
+ var copy = function copy2(copiedValue) {
35289
+ var cachedCopy = map.get(value);
35290
+ if (cachedCopy) {
35291
+ return cachedCopy;
35292
+ }
35293
+ map.set(value, copiedValue);
35294
+ for (var key in value) {
35295
+ if (Object.prototype.hasOwnProperty.call(value, key)) {
35296
+ copiedValue[key] = deep ? _clone(value[key], true, map) : value[key];
35297
+ }
35298
+ }
35299
+ return copiedValue;
35300
+ };
35301
+ switch (type_default(value)) {
35302
+ case "Object":
35303
+ return copy(Object.create(Object.getPrototypeOf(value)));
35304
+ case "Array":
35305
+ return copy([]);
35306
+ case "Date":
35307
+ return new Date(value.valueOf());
35308
+ case "RegExp":
35309
+ return _cloneRegExp(value);
35310
+ case "Int8Array":
35311
+ case "Uint8Array":
35312
+ case "Uint8ClampedArray":
35313
+ case "Int16Array":
35314
+ case "Uint16Array":
35315
+ case "Int32Array":
35316
+ case "Uint32Array":
35317
+ case "Float32Array":
35318
+ case "Float64Array":
35319
+ case "BigInt64Array":
35320
+ case "BigUint64Array":
35321
+ return value.slice();
35322
+ default:
35323
+ return value;
35324
+ }
35325
+ }
35326
+ function _isPrimitive(param) {
35327
+ var type3 = typeof param;
35328
+ return param == null || type3 != "object" && type3 != "function";
34979
35329
  }
35330
+ var _ObjectMap = /* @__PURE__ */ function() {
35331
+ function _ObjectMap2() {
35332
+ this.map = {};
35333
+ this.length = 0;
35334
+ }
35335
+ _ObjectMap2.prototype.set = function(key, value) {
35336
+ const hashedKey = this.hash(key);
35337
+ let bucket = this.map[hashedKey];
35338
+ if (!bucket) {
35339
+ this.map[hashedKey] = bucket = [];
35340
+ }
35341
+ bucket.push([key, value]);
35342
+ this.length += 1;
35343
+ };
35344
+ _ObjectMap2.prototype.hash = function(key) {
35345
+ let hashedKey = [];
35346
+ for (var value in key) {
35347
+ hashedKey.push(Object.prototype.toString.call(key[value]));
35348
+ }
35349
+ return hashedKey.join();
35350
+ };
35351
+ _ObjectMap2.prototype.get = function(key) {
35352
+ if (this.length <= 180) {
35353
+ for (const p in this.map) {
35354
+ const bucket2 = this.map[p];
35355
+ for (let i = 0; i < bucket2.length; i += 1) {
35356
+ const element = bucket2[i];
35357
+ if (element[0] === key) {
35358
+ return element[1];
35359
+ }
35360
+ }
35361
+ }
35362
+ return;
35363
+ }
35364
+ const hashedKey = this.hash(key);
35365
+ const bucket = this.map[hashedKey];
35366
+ if (!bucket) {
35367
+ return;
35368
+ }
35369
+ for (let i = 0; i < bucket.length; i += 1) {
35370
+ const element = bucket[i];
35371
+ if (element[0] === key) {
35372
+ return element[1];
35373
+ }
35374
+ }
35375
+ };
35376
+ return _ObjectMap2;
35377
+ }();
35378
+
35379
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/clone.js
35380
+ var clone = /* @__PURE__ */ _curry1(function clone2(value) {
35381
+ return value != null && typeof value.clone === "function" ? value.clone() : _clone(value, true);
35382
+ });
35383
+ var clone_default = clone;
35384
+
35385
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/trim.js
35386
+ var hasProtoTrim = typeof String.prototype.trim === "function";
34980
35387
 
34981
35388
  // src/providers/coin-quantity.ts
34982
35389
  var coinQuantityfy = (coinQuantityLike) => {
34983
35390
  let assetId;
34984
35391
  let amount;
34985
- let max2;
35392
+ let max;
34986
35393
  if (Array.isArray(coinQuantityLike)) {
34987
35394
  amount = coinQuantityLike[0];
34988
- assetId = coinQuantityLike[1];
34989
- max2 = coinQuantityLike[2];
35395
+ assetId = coinQuantityLike[1] ?? BaseAssetId;
35396
+ max = coinQuantityLike[2] ?? void 0;
34990
35397
  } else {
34991
35398
  amount = coinQuantityLike.amount;
34992
- assetId = coinQuantityLike.assetId;
34993
- max2 = coinQuantityLike.max ?? void 0;
35399
+ assetId = coinQuantityLike.assetId ?? BaseAssetId;
35400
+ max = coinQuantityLike.max ?? void 0;
34994
35401
  }
34995
35402
  const bnAmount = bn(amount);
34996
35403
  return {
34997
35404
  assetId: hexlify(assetId),
34998
35405
  amount: bnAmount.lt(1) ? bn(1) : bnAmount,
34999
- max: max2 ? bn(max2) : void 0
35406
+ max: max ? bn(max) : void 0
35000
35407
  };
35001
35408
  };
35002
- var addAmountToAsset = (params) => {
35409
+ var addAmountToCoinQuantities = (params) => {
35003
35410
  const { amount, assetId } = params;
35004
35411
  const coinQuantities = [...params.coinQuantities];
35005
35412
  const assetIdx = coinQuantities.findIndex((coinQuantity) => coinQuantity.assetId === assetId);
@@ -35073,9 +35480,9 @@ This unreleased fuel-core build may include features and updates not yet support
35073
35480
  var TX_POINTER_LEN = WORD_SIZE * 2;
35074
35481
  var MAX_BYTES = 2 ** 32 - 1;
35075
35482
  var calculateVmTxMemory = ({ maxInputs }) => BYTES_32 + // Tx ID
35076
- WORD_SIZE + // Tx size
35483
+ ASSET_ID_LEN + // Base asset ID
35077
35484
  // Asset ID/Balance coin input pairs
35078
- maxInputs * (ASSET_ID_LEN + WORD_SIZE);
35485
+ maxInputs * (ASSET_ID_LEN + WORD_SIZE) + WORD_SIZE;
35079
35486
  var SCRIPT_FIXED_SIZE = WORD_SIZE + // Identifier
35080
35487
  WORD_SIZE + // Gas limit
35081
35488
  WORD_SIZE + // Script size
@@ -35093,7 +35500,6 @@ This unreleased fuel-core build may include features and updates not yet support
35093
35500
  ASSET_ID_LEN + // Asset id
35094
35501
  TX_POINTER_LEN + // TxPointer
35095
35502
  WORD_SIZE + // Witnesses index
35096
- WORD_SIZE + // Maturity
35097
35503
  WORD_SIZE + // Predicate size
35098
35504
  WORD_SIZE + // Predicate data size
35099
35505
  WORD_SIZE;
@@ -35423,7 +35829,7 @@ This unreleased fuel-core build may include features and updates not yet support
35423
35829
  constructor(name, coders) {
35424
35830
  const caseIndexCoder = new BigNumberCoder("u64");
35425
35831
  const encodedValueSize = Object.values(coders).reduce(
35426
- (max2, coder) => Math.max(max2, coder.encodedLength),
35832
+ (max, coder) => Math.max(max, coder.encodedLength),
35427
35833
  0
35428
35834
  );
35429
35835
  super(`enum ${name}`, `enum ${name}`, caseIndexCoder.encodedLength + encodedValueSize);
@@ -36110,7 +36516,7 @@ This unreleased fuel-core build may include features and updates not yet support
36110
36516
  constructor(name, coders) {
36111
36517
  const caseIndexCoder = new BigNumberCoder("u64");
36112
36518
  const encodedValueSize = Object.values(coders).reduce(
36113
- (max2, coder) => Math.max(max2, coder.encodedLength),
36519
+ (max, coder) => Math.max(max, coder.encodedLength),
36114
36520
  0
36115
36521
  );
36116
36522
  super(`enum ${name}`, `enum ${name}`, caseIndexCoder.encodedLength + encodedValueSize);
@@ -36833,18 +37239,19 @@ This unreleased fuel-core build may include features and updates not yet support
36833
37239
  encode(value) {
36834
37240
  const parts = [];
36835
37241
  parts.push(new B256Coder().encode(value.txID));
36836
- parts.push(new NumberCoder("u8").encode(value.outputIndex));
37242
+ parts.push(new NumberCoder("u16").encode(value.outputIndex));
36837
37243
  parts.push(new B256Coder().encode(value.owner));
36838
37244
  parts.push(new BigNumberCoder("u64").encode(value.amount));
36839
37245
  parts.push(new B256Coder().encode(value.assetId));
36840
37246
  parts.push(new TxPointerCoder().encode(value.txPointer));
36841
- parts.push(new NumberCoder("u8").encode(value.witnessIndex));
36842
- parts.push(new NumberCoder("u32").encode(value.maturity));
37247
+ parts.push(new NumberCoder("u16").encode(value.witnessIndex));
36843
37248
  parts.push(new BigNumberCoder("u64").encode(value.predicateGasUsed));
36844
- parts.push(new NumberCoder("u32").encode(value.predicateLength));
36845
- parts.push(new NumberCoder("u32").encode(value.predicateDataLength));
36846
- parts.push(new ByteArrayCoder(value.predicateLength).encode(value.predicate));
36847
- parts.push(new ByteArrayCoder(value.predicateDataLength).encode(value.predicateData));
37249
+ parts.push(new BigNumberCoder("u64").encode(value.predicateLength));
37250
+ parts.push(new BigNumberCoder("u64").encode(value.predicateDataLength));
37251
+ parts.push(new ByteArrayCoder(value.predicateLength.toNumber()).encode(value.predicate));
37252
+ parts.push(
37253
+ new ByteArrayCoder(value.predicateDataLength.toNumber()).encode(value.predicateData)
37254
+ );
36848
37255
  return concat(parts);
36849
37256
  }
36850
37257
  decode(data, offset) {
@@ -36852,7 +37259,7 @@ This unreleased fuel-core build may include features and updates not yet support
36852
37259
  let o = offset;
36853
37260
  [decoded, o] = new B256Coder().decode(data, o);
36854
37261
  const txID = decoded;
36855
- [decoded, o] = new NumberCoder("u8").decode(data, o);
37262
+ [decoded, o] = new NumberCoder("u16").decode(data, o);
36856
37263
  const outputIndex = decoded;
36857
37264
  [decoded, o] = new B256Coder().decode(data, o);
36858
37265
  const owner = decoded;
@@ -36862,19 +37269,17 @@ This unreleased fuel-core build may include features and updates not yet support
36862
37269
  const assetId = decoded;
36863
37270
  [decoded, o] = new TxPointerCoder().decode(data, o);
36864
37271
  const txPointer = decoded;
36865
- [decoded, o] = new NumberCoder("u8").decode(data, o);
37272
+ [decoded, o] = new NumberCoder("u16").decode(data, o);
36866
37273
  const witnessIndex = Number(decoded);
36867
- [decoded, o] = new NumberCoder("u32").decode(data, o);
36868
- const maturity = decoded;
36869
37274
  [decoded, o] = new BigNumberCoder("u64").decode(data, o);
36870
37275
  const predicateGasUsed = decoded;
36871
- [decoded, o] = new NumberCoder("u32").decode(data, o);
37276
+ [decoded, o] = new BigNumberCoder("u64").decode(data, o);
36872
37277
  const predicateLength = decoded;
36873
- [decoded, o] = new NumberCoder("u32").decode(data, o);
37278
+ [decoded, o] = new BigNumberCoder("u64").decode(data, o);
36874
37279
  const predicateDataLength = decoded;
36875
- [decoded, o] = new ByteArrayCoder(predicateLength).decode(data, o);
37280
+ [decoded, o] = new ByteArrayCoder(predicateLength.toNumber()).decode(data, o);
36876
37281
  const predicate = decoded;
36877
- [decoded, o] = new ByteArrayCoder(predicateDataLength).decode(data, o);
37282
+ [decoded, o] = new ByteArrayCoder(predicateDataLength.toNumber()).decode(data, o);
36878
37283
  const predicateData = decoded;
36879
37284
  return [
36880
37285
  {
@@ -36886,7 +37291,6 @@ This unreleased fuel-core build may include features and updates not yet support
36886
37291
  assetId,
36887
37292
  txPointer,
36888
37293
  witnessIndex,
36889
- maturity,
36890
37294
  predicateGasUsed,
36891
37295
  predicateLength,
36892
37296
  predicateDataLength,
@@ -36904,7 +37308,7 @@ This unreleased fuel-core build may include features and updates not yet support
36904
37308
  encode(value) {
36905
37309
  const parts = [];
36906
37310
  parts.push(new B256Coder().encode(value.txID));
36907
- parts.push(new NumberCoder("u8").encode(value.outputIndex));
37311
+ parts.push(new NumberCoder("u16").encode(value.outputIndex));
36908
37312
  parts.push(new B256Coder().encode(value.balanceRoot));
36909
37313
  parts.push(new B256Coder().encode(value.stateRoot));
36910
37314
  parts.push(new TxPointerCoder().encode(value.txPointer));
@@ -36916,7 +37320,7 @@ This unreleased fuel-core build may include features and updates not yet support
36916
37320
  let o = offset;
36917
37321
  [decoded, o] = new B256Coder().decode(data, o);
36918
37322
  const txID = decoded;
36919
- [decoded, o] = new NumberCoder("u8").decode(data, o);
37323
+ [decoded, o] = new NumberCoder("u16").decode(data, o);
36920
37324
  const outputIndex = decoded;
36921
37325
  [decoded, o] = new B256Coder().decode(data, o);
36922
37326
  const balanceRoot = decoded;
@@ -36965,14 +37369,16 @@ This unreleased fuel-core build may include features and updates not yet support
36965
37369
  parts.push(new ByteArrayCoder(32).encode(value.recipient));
36966
37370
  parts.push(new BigNumberCoder("u64").encode(value.amount));
36967
37371
  parts.push(new ByteArrayCoder(32).encode(value.nonce));
36968
- parts.push(new NumberCoder("u8").encode(value.witnessIndex));
37372
+ parts.push(new NumberCoder("u16").encode(value.witnessIndex));
36969
37373
  parts.push(new BigNumberCoder("u64").encode(value.predicateGasUsed));
36970
- parts.push(new NumberCoder("u32").encode(data.length));
36971
- parts.push(new NumberCoder("u32").encode(value.predicateLength));
36972
- parts.push(new NumberCoder("u32").encode(value.predicateDataLength));
37374
+ parts.push(new BigNumberCoder("u64").encode(data.length));
37375
+ parts.push(new BigNumberCoder("u64").encode(value.predicateLength));
37376
+ parts.push(new BigNumberCoder("u64").encode(value.predicateDataLength));
36973
37377
  parts.push(new ByteArrayCoder(data.length).encode(data));
36974
- parts.push(new ByteArrayCoder(value.predicateLength).encode(value.predicate));
36975
- parts.push(new ByteArrayCoder(value.predicateDataLength).encode(value.predicateData));
37378
+ parts.push(new ByteArrayCoder(value.predicateLength.toNumber()).encode(value.predicate));
37379
+ parts.push(
37380
+ new ByteArrayCoder(value.predicateDataLength.toNumber()).encode(value.predicateData)
37381
+ );
36976
37382
  return concat(parts);
36977
37383
  }
36978
37384
  static decodeData(messageData) {
@@ -36992,21 +37398,21 @@ This unreleased fuel-core build may include features and updates not yet support
36992
37398
  const amount = decoded;
36993
37399
  [decoded, o] = new B256Coder().decode(data, o);
36994
37400
  const nonce = decoded;
36995
- [decoded, o] = new NumberCoder("u8").decode(data, o);
37401
+ [decoded, o] = new NumberCoder("u16").decode(data, o);
36996
37402
  const witnessIndex = Number(decoded);
36997
37403
  [decoded, o] = new BigNumberCoder("u64").decode(data, o);
36998
37404
  const predicateGasUsed = decoded;
36999
37405
  [decoded, o] = new NumberCoder("u32").decode(data, o);
37000
37406
  const dataLength2 = decoded;
37001
- [decoded, o] = new NumberCoder("u32").decode(data, o);
37407
+ [decoded, o] = new BigNumberCoder("u64").decode(data, o);
37002
37408
  const predicateLength = decoded;
37003
- [decoded, o] = new NumberCoder("u32").decode(data, o);
37409
+ [decoded, o] = new BigNumberCoder("u64").decode(data, o);
37004
37410
  const predicateDataLength = decoded;
37005
37411
  [decoded, o] = new ByteArrayCoder(dataLength2).decode(data, o);
37006
37412
  const messageData = decoded;
37007
- [decoded, o] = new ByteArrayCoder(predicateLength).decode(data, o);
37413
+ [decoded, o] = new ByteArrayCoder(predicateLength.toNumber()).decode(data, o);
37008
37414
  const predicate = decoded;
37009
- [decoded, o] = new ByteArrayCoder(predicateDataLength).decode(data, o);
37415
+ [decoded, o] = new ByteArrayCoder(predicateDataLength.toNumber()).decode(data, o);
37010
37416
  const predicateData = decoded;
37011
37417
  return [
37012
37418
  {
@@ -37318,7 +37724,7 @@ This unreleased fuel-core build may include features and updates not yet support
37318
37724
  }
37319
37725
  };
37320
37726
  var PolicyType = /* @__PURE__ */ ((PolicyType2) => {
37321
- PolicyType2[PolicyType2["GasPrice"] = 1] = "GasPrice";
37727
+ PolicyType2[PolicyType2["Tip"] = 1] = "Tip";
37322
37728
  PolicyType2[PolicyType2["WitnessLimit"] = 2] = "WitnessLimit";
37323
37729
  PolicyType2[PolicyType2["Maturity"] = 4] = "Maturity";
37324
37730
  PolicyType2[PolicyType2["MaxFee"] = 8] = "MaxFee";
@@ -37366,9 +37772,9 @@ This unreleased fuel-core build may include features and updates not yet support
37366
37772
  let o = offset;
37367
37773
  const policies = [];
37368
37774
  if (policyTypes & 1) {
37369
- const [gasPrice, nextOffset] = new BigNumberCoder("u64").decode(data, o);
37775
+ const [tip, nextOffset] = new BigNumberCoder("u64").decode(data, o);
37370
37776
  o = nextOffset;
37371
- policies.push({ type: 1, data: gasPrice });
37777
+ policies.push({ type: 1, data: tip });
37372
37778
  }
37373
37779
  if (policyTypes & 2) {
37374
37780
  const [witnessLimit, nextOffset] = new BigNumberCoder("u64").decode(data, o);
@@ -37600,15 +38006,15 @@ This unreleased fuel-core build may include features and updates not yet support
37600
38006
  encode(value) {
37601
38007
  const parts = [];
37602
38008
  parts.push(new BigNumberCoder("u64").encode(value.scriptGasLimit));
37603
- parts.push(new NumberCoder("u32").encode(value.scriptLength));
37604
- parts.push(new NumberCoder("u32").encode(value.scriptDataLength));
37605
- parts.push(new NumberCoder("u32").encode(value.policyTypes));
37606
- parts.push(new NumberCoder("u8").encode(value.inputsCount));
37607
- parts.push(new NumberCoder("u8").encode(value.outputsCount));
37608
- parts.push(new NumberCoder("u8").encode(value.witnessesCount));
37609
38009
  parts.push(new B256Coder().encode(value.receiptsRoot));
37610
- parts.push(new ByteArrayCoder(value.scriptLength).encode(value.script));
37611
- parts.push(new ByteArrayCoder(value.scriptDataLength).encode(value.scriptData));
38010
+ parts.push(new BigNumberCoder("u64").encode(value.scriptLength));
38011
+ parts.push(new BigNumberCoder("u64").encode(value.scriptDataLength));
38012
+ parts.push(new NumberCoder("u32").encode(value.policyTypes));
38013
+ parts.push(new NumberCoder("u16").encode(value.inputsCount));
38014
+ parts.push(new NumberCoder("u16").encode(value.outputsCount));
38015
+ parts.push(new NumberCoder("u16").encode(value.witnessesCount));
38016
+ parts.push(new ByteArrayCoder(value.scriptLength.toNumber()).encode(value.script));
38017
+ parts.push(new ByteArrayCoder(value.scriptDataLength.toNumber()).encode(value.scriptData));
37612
38018
  parts.push(new PoliciesCoder().encode(value.policies));
37613
38019
  parts.push(new ArrayCoder(new InputCoder(), value.inputsCount).encode(value.inputs));
37614
38020
  parts.push(new ArrayCoder(new OutputCoder(), value.outputsCount).encode(value.outputs));
@@ -37620,23 +38026,23 @@ This unreleased fuel-core build may include features and updates not yet support
37620
38026
  let o = offset;
37621
38027
  [decoded, o] = new BigNumberCoder("u64").decode(data, o);
37622
38028
  const scriptGasLimit = decoded;
37623
- [decoded, o] = new NumberCoder("u32").decode(data, o);
38029
+ [decoded, o] = new B256Coder().decode(data, o);
38030
+ const receiptsRoot = decoded;
38031
+ [decoded, o] = new BigNumberCoder("u64").decode(data, o);
37624
38032
  const scriptLength = decoded;
37625
- [decoded, o] = new NumberCoder("u32").decode(data, o);
38033
+ [decoded, o] = new BigNumberCoder("u64").decode(data, o);
37626
38034
  const scriptDataLength = decoded;
37627
38035
  [decoded, o] = new NumberCoder("u32").decode(data, o);
37628
38036
  const policyTypes = decoded;
37629
- [decoded, o] = new NumberCoder("u8").decode(data, o);
38037
+ [decoded, o] = new NumberCoder("u16").decode(data, o);
37630
38038
  const inputsCount = decoded;
37631
- [decoded, o] = new NumberCoder("u8").decode(data, o);
38039
+ [decoded, o] = new NumberCoder("u16").decode(data, o);
37632
38040
  const outputsCount = decoded;
37633
- [decoded, o] = new NumberCoder("u8").decode(data, o);
38041
+ [decoded, o] = new NumberCoder("u16").decode(data, o);
37634
38042
  const witnessesCount = decoded;
37635
- [decoded, o] = new B256Coder().decode(data, o);
37636
- const receiptsRoot = decoded;
37637
- [decoded, o] = new ByteArrayCoder(scriptLength).decode(data, o);
38043
+ [decoded, o] = new ByteArrayCoder(scriptLength.toNumber()).decode(data, o);
37638
38044
  const script = decoded;
37639
- [decoded, o] = new ByteArrayCoder(scriptDataLength).decode(data, o);
38045
+ [decoded, o] = new ByteArrayCoder(scriptDataLength.toNumber()).decode(data, o);
37640
38046
  const scriptData = decoded;
37641
38047
  [decoded, o] = new PoliciesCoder().decode(data, o, policyTypes);
37642
38048
  const policies = decoded;
@@ -37674,18 +38080,19 @@ This unreleased fuel-core build may include features and updates not yet support
37674
38080
  }
37675
38081
  encode(value) {
37676
38082
  const parts = [];
37677
- parts.push(new NumberCoder("u32").encode(value.bytecodeLength));
37678
- parts.push(new NumberCoder("u8").encode(value.bytecodeWitnessIndex));
37679
- parts.push(new NumberCoder("u32").encode(value.policyTypes));
37680
- parts.push(new NumberCoder("u16").encode(value.storageSlotsCount));
37681
- parts.push(new NumberCoder("u8").encode(value.inputsCount));
37682
- parts.push(new NumberCoder("u8").encode(value.outputsCount));
37683
- parts.push(new NumberCoder("u8").encode(value.witnessesCount));
38083
+ parts.push(new NumberCoder("u16").encode(value.bytecodeWitnessIndex));
37684
38084
  parts.push(new B256Coder().encode(value.salt));
37685
- parts.push(new PoliciesCoder().encode(value.policies));
38085
+ parts.push(new BigNumberCoder("u64").encode(value.storageSlotsCount));
38086
+ parts.push(new NumberCoder("u32").encode(value.policyTypes));
38087
+ parts.push(new NumberCoder("u16").encode(value.inputsCount));
38088
+ parts.push(new NumberCoder("u16").encode(value.outputsCount));
38089
+ parts.push(new NumberCoder("u16").encode(value.witnessesCount));
37686
38090
  parts.push(
37687
- new ArrayCoder(new StorageSlotCoder(), value.storageSlotsCount).encode(value.storageSlots)
38091
+ new ArrayCoder(new StorageSlotCoder(), value.storageSlotsCount.toNumber()).encode(
38092
+ value.storageSlots
38093
+ )
37688
38094
  );
38095
+ parts.push(new PoliciesCoder().encode(value.policies));
37689
38096
  parts.push(new ArrayCoder(new InputCoder(), value.inputsCount).encode(value.inputs));
37690
38097
  parts.push(new ArrayCoder(new OutputCoder(), value.outputsCount).encode(value.outputs));
37691
38098
  parts.push(new ArrayCoder(new WitnessCoder(), value.witnessesCount).encode(value.witnesses));
@@ -37694,26 +38101,27 @@ This unreleased fuel-core build may include features and updates not yet support
37694
38101
  decode(data, offset) {
37695
38102
  let decoded;
37696
38103
  let o = offset;
37697
- [decoded, o] = new NumberCoder("u32").decode(data, o);
37698
- const bytecodeLength = decoded;
37699
- [decoded, o] = new NumberCoder("u8").decode(data, o);
38104
+ [decoded, o] = new NumberCoder("u16").decode(data, o);
37700
38105
  const bytecodeWitnessIndex = decoded;
38106
+ [decoded, o] = new B256Coder().decode(data, o);
38107
+ const salt = decoded;
38108
+ [decoded, o] = new BigNumberCoder("u64").decode(data, o);
38109
+ const storageSlotsCount = decoded;
37701
38110
  [decoded, o] = new NumberCoder("u32").decode(data, o);
37702
38111
  const policyTypes = decoded;
37703
38112
  [decoded, o] = new NumberCoder("u16").decode(data, o);
37704
- const storageSlotsCount = decoded;
37705
- [decoded, o] = new NumberCoder("u8").decode(data, o);
37706
38113
  const inputsCount = decoded;
37707
- [decoded, o] = new NumberCoder("u8").decode(data, o);
38114
+ [decoded, o] = new NumberCoder("u16").decode(data, o);
37708
38115
  const outputsCount = decoded;
37709
- [decoded, o] = new NumberCoder("u8").decode(data, o);
38116
+ [decoded, o] = new NumberCoder("u16").decode(data, o);
37710
38117
  const witnessesCount = decoded;
37711
- [decoded, o] = new B256Coder().decode(data, o);
37712
- const salt = decoded;
38118
+ [decoded, o] = new ArrayCoder(new StorageSlotCoder(), storageSlotsCount.toNumber()).decode(
38119
+ data,
38120
+ o
38121
+ );
38122
+ const storageSlots = decoded;
37713
38123
  [decoded, o] = new PoliciesCoder().decode(data, o, policyTypes);
37714
38124
  const policies = decoded;
37715
- [decoded, o] = new ArrayCoder(new StorageSlotCoder(), storageSlotsCount).decode(data, o);
37716
- const storageSlots = decoded;
37717
38125
  [decoded, o] = new ArrayCoder(new InputCoder(), inputsCount).decode(data, o);
37718
38126
  const inputs = decoded;
37719
38127
  [decoded, o] = new ArrayCoder(new OutputCoder(), outputsCount).decode(data, o);
@@ -37723,7 +38131,6 @@ This unreleased fuel-core build may include features and updates not yet support
37723
38131
  return [
37724
38132
  {
37725
38133
  type: 1,
37726
- bytecodeLength,
37727
38134
  bytecodeWitnessIndex,
37728
38135
  policyTypes,
37729
38136
  storageSlotsCount,
@@ -37752,6 +38159,7 @@ This unreleased fuel-core build may include features and updates not yet support
37752
38159
  parts.push(new OutputContractCoder().encode(value.outputContract));
37753
38160
  parts.push(new BigNumberCoder("u64").encode(value.mintAmount));
37754
38161
  parts.push(new B256Coder().encode(value.mintAssetId));
38162
+ parts.push(new BigNumberCoder("u64").encode(value.gasPrice));
37755
38163
  return concat(parts);
37756
38164
  }
37757
38165
  decode(data, offset) {
@@ -37767,6 +38175,8 @@ This unreleased fuel-core build may include features and updates not yet support
37767
38175
  const mintAmount = decoded;
37768
38176
  [decoded, o] = new B256Coder().decode(data, o);
37769
38177
  const mintAssetId = decoded;
38178
+ [decoded, o] = new BigNumberCoder("u64").decode(data, o);
38179
+ const gasPrice = decoded;
37770
38180
  return [
37771
38181
  {
37772
38182
  type: 2,
@@ -37774,7 +38184,8 @@ This unreleased fuel-core build may include features and updates not yet support
37774
38184
  inputContract,
37775
38185
  outputContract,
37776
38186
  mintAmount,
37777
- mintAssetId
38187
+ mintAssetId,
38188
+ gasPrice
37778
38189
  },
37779
38190
  o
37780
38191
  ];
@@ -38081,159 +38492,6 @@ This unreleased fuel-core build may include features and updates not yet support
38081
38492
  // src/providers/provider.ts
38082
38493
  var import_graphql_request = __toESM(require_dist2());
38083
38494
 
38084
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isPlaceholder.js
38085
- function _isPlaceholder(a) {
38086
- return a != null && typeof a === "object" && a["@@functional/placeholder"] === true;
38087
- }
38088
-
38089
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_curry1.js
38090
- function _curry1(fn) {
38091
- return function f1(a) {
38092
- if (arguments.length === 0 || _isPlaceholder(a)) {
38093
- return f1;
38094
- } else {
38095
- return fn.apply(this, arguments);
38096
- }
38097
- };
38098
- }
38099
-
38100
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isArray.js
38101
- var isArray_default = Array.isArray || function _isArray(val) {
38102
- return val != null && val.length >= 0 && Object.prototype.toString.call(val) === "[object Array]";
38103
- };
38104
-
38105
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/type.js
38106
- var type = /* @__PURE__ */ _curry1(function type2(val) {
38107
- return val === null ? "Null" : val === void 0 ? "Undefined" : Object.prototype.toString.call(val).slice(8, -1);
38108
- });
38109
- var type_default = type;
38110
-
38111
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_toISOString.js
38112
- var pad = function pad2(n) {
38113
- return (n < 10 ? "0" : "") + n;
38114
- };
38115
- var _toISOString = typeof Date.prototype.toISOString === "function" ? function _toISOString2(d) {
38116
- return d.toISOString();
38117
- } : function _toISOString3(d) {
38118
- 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";
38119
- };
38120
-
38121
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isInteger.js
38122
- var isInteger_default = Number.isInteger || function _isInteger(n) {
38123
- return n << 0 === n;
38124
- };
38125
-
38126
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_cloneRegExp.js
38127
- function _cloneRegExp(pattern) {
38128
- 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" : ""));
38129
- }
38130
-
38131
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_clone.js
38132
- function _clone(value, deep, map) {
38133
- map || (map = new _ObjectMap());
38134
- if (_isPrimitive(value)) {
38135
- return value;
38136
- }
38137
- var copy = function copy2(copiedValue) {
38138
- var cachedCopy = map.get(value);
38139
- if (cachedCopy) {
38140
- return cachedCopy;
38141
- }
38142
- map.set(value, copiedValue);
38143
- for (var key in value) {
38144
- if (Object.prototype.hasOwnProperty.call(value, key)) {
38145
- copiedValue[key] = deep ? _clone(value[key], true, map) : value[key];
38146
- }
38147
- }
38148
- return copiedValue;
38149
- };
38150
- switch (type_default(value)) {
38151
- case "Object":
38152
- return copy(Object.create(Object.getPrototypeOf(value)));
38153
- case "Array":
38154
- return copy([]);
38155
- case "Date":
38156
- return new Date(value.valueOf());
38157
- case "RegExp":
38158
- return _cloneRegExp(value);
38159
- case "Int8Array":
38160
- case "Uint8Array":
38161
- case "Uint8ClampedArray":
38162
- case "Int16Array":
38163
- case "Uint16Array":
38164
- case "Int32Array":
38165
- case "Uint32Array":
38166
- case "Float32Array":
38167
- case "Float64Array":
38168
- case "BigInt64Array":
38169
- case "BigUint64Array":
38170
- return value.slice();
38171
- default:
38172
- return value;
38173
- }
38174
- }
38175
- function _isPrimitive(param) {
38176
- var type3 = typeof param;
38177
- return param == null || type3 != "object" && type3 != "function";
38178
- }
38179
- var _ObjectMap = /* @__PURE__ */ function() {
38180
- function _ObjectMap2() {
38181
- this.map = {};
38182
- this.length = 0;
38183
- }
38184
- _ObjectMap2.prototype.set = function(key, value) {
38185
- const hashedKey = this.hash(key);
38186
- let bucket = this.map[hashedKey];
38187
- if (!bucket) {
38188
- this.map[hashedKey] = bucket = [];
38189
- }
38190
- bucket.push([key, value]);
38191
- this.length += 1;
38192
- };
38193
- _ObjectMap2.prototype.hash = function(key) {
38194
- let hashedKey = [];
38195
- for (var value in key) {
38196
- hashedKey.push(Object.prototype.toString.call(key[value]));
38197
- }
38198
- return hashedKey.join();
38199
- };
38200
- _ObjectMap2.prototype.get = function(key) {
38201
- if (this.length <= 180) {
38202
- for (const p in this.map) {
38203
- const bucket2 = this.map[p];
38204
- for (let i = 0; i < bucket2.length; i += 1) {
38205
- const element = bucket2[i];
38206
- if (element[0] === key) {
38207
- return element[1];
38208
- }
38209
- }
38210
- }
38211
- return;
38212
- }
38213
- const hashedKey = this.hash(key);
38214
- const bucket = this.map[hashedKey];
38215
- if (!bucket) {
38216
- return;
38217
- }
38218
- for (let i = 0; i < bucket.length; i += 1) {
38219
- const element = bucket[i];
38220
- if (element[0] === key) {
38221
- return element[1];
38222
- }
38223
- }
38224
- };
38225
- return _ObjectMap2;
38226
- }();
38227
-
38228
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/clone.js
38229
- var clone2 = /* @__PURE__ */ _curry1(function clone3(value) {
38230
- return value != null && typeof value.clone === "function" ? value.clone() : _clone(value, true);
38231
- });
38232
- var clone_default = clone2;
38233
-
38234
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/trim.js
38235
- var hasProtoTrim = typeof String.prototype.trim === "function";
38236
-
38237
38495
  // ../../node_modules/.pnpm/tslib@2.6.0/node_modules/tslib/tslib.es6.mjs
38238
38496
  var __assign = function() {
38239
38497
  __assign = Object.assign || function __assign2(t) {
@@ -41401,14 +41659,10 @@ spurious results.`);
41401
41659
  // src/providers/__generated__/operations.ts
41402
41660
  var ReceiptFragmentFragmentDoc = lib_default2`
41403
41661
  fragment receiptFragment on Receipt {
41404
- contract {
41405
- id
41406
- }
41662
+ id
41407
41663
  pc
41408
41664
  is
41409
- to {
41410
- id
41411
- }
41665
+ to
41412
41666
  toAddress
41413
41667
  amount
41414
41668
  assetId
@@ -41446,10 +41700,16 @@ spurious results.`);
41446
41700
  id
41447
41701
  }
41448
41702
  time
41703
+ receipts {
41704
+ ...receiptFragment
41705
+ }
41449
41706
  programState {
41450
41707
  returnType
41451
41708
  data
41452
41709
  }
41710
+ receipts {
41711
+ ...receiptFragment
41712
+ }
41453
41713
  }
41454
41714
  ... on FailureStatus {
41455
41715
  block {
@@ -41457,26 +41717,24 @@ spurious results.`);
41457
41717
  }
41458
41718
  time
41459
41719
  reason
41720
+ receipts {
41721
+ ...receiptFragment
41722
+ }
41460
41723
  }
41461
41724
  ... on SqueezedOutStatus {
41462
41725
  reason
41463
41726
  }
41464
41727
  }
41465
- `;
41728
+ ${ReceiptFragmentFragmentDoc}`;
41466
41729
  var TransactionFragmentFragmentDoc = lib_default2`
41467
41730
  fragment transactionFragment on Transaction {
41468
41731
  id
41469
41732
  rawPayload
41470
- gasPrice
41471
- receipts {
41472
- ...receiptFragment
41473
- }
41474
41733
  status {
41475
41734
  ...transactionStatusFragment
41476
41735
  }
41477
41736
  }
41478
- ${ReceiptFragmentFragmentDoc}
41479
- ${TransactionStatusFragmentFragmentDoc}`;
41737
+ ${TransactionStatusFragmentFragmentDoc}`;
41480
41738
  var InputEstimatePredicatesFragmentFragmentDoc = lib_default2`
41481
41739
  fragment inputEstimatePredicatesFragment on Input {
41482
41740
  ... on InputCoin {
@@ -41494,6 +41752,46 @@ ${TransactionStatusFragmentFragmentDoc}`;
41494
41752
  }
41495
41753
  }
41496
41754
  ${InputEstimatePredicatesFragmentFragmentDoc}`;
41755
+ var DryRunFailureStatusFragmentFragmentDoc = lib_default2`
41756
+ fragment dryRunFailureStatusFragment on DryRunFailureStatus {
41757
+ reason
41758
+ programState {
41759
+ returnType
41760
+ data
41761
+ }
41762
+ }
41763
+ `;
41764
+ var DryRunSuccessStatusFragmentFragmentDoc = lib_default2`
41765
+ fragment dryRunSuccessStatusFragment on DryRunSuccessStatus {
41766
+ programState {
41767
+ returnType
41768
+ data
41769
+ }
41770
+ }
41771
+ `;
41772
+ var DryRunTransactionStatusFragmentFragmentDoc = lib_default2`
41773
+ fragment dryRunTransactionStatusFragment on DryRunTransactionStatus {
41774
+ ... on DryRunFailureStatus {
41775
+ ...dryRunFailureStatusFragment
41776
+ }
41777
+ ... on DryRunSuccessStatus {
41778
+ ...dryRunSuccessStatusFragment
41779
+ }
41780
+ }
41781
+ ${DryRunFailureStatusFragmentFragmentDoc}
41782
+ ${DryRunSuccessStatusFragmentFragmentDoc}`;
41783
+ var DryRunTransactionExecutionStatusFragmentFragmentDoc = lib_default2`
41784
+ fragment dryRunTransactionExecutionStatusFragment on DryRunTransactionExecutionStatus {
41785
+ id
41786
+ status {
41787
+ ...dryRunTransactionStatusFragment
41788
+ }
41789
+ receipts {
41790
+ ...receiptFragment
41791
+ }
41792
+ }
41793
+ ${DryRunTransactionStatusFragmentFragmentDoc}
41794
+ ${ReceiptFragmentFragmentDoc}`;
41497
41795
  var CoinFragmentFragmentDoc = lib_default2`
41498
41796
  fragment coinFragment on Coin {
41499
41797
  __typename
@@ -41501,7 +41799,6 @@ ${TransactionStatusFragmentFragmentDoc}`;
41501
41799
  owner
41502
41800
  amount
41503
41801
  assetId
41504
- maturity
41505
41802
  blockCreated
41506
41803
  txCreatedIdx
41507
41804
  }
@@ -41546,7 +41843,6 @@ ${TransactionStatusFragmentFragmentDoc}`;
41546
41843
  prevRoot
41547
41844
  time
41548
41845
  applicationHash
41549
- messageReceiptRoot
41550
41846
  messageReceiptCount
41551
41847
  }
41552
41848
  commitBlockHeader {
@@ -41558,7 +41854,6 @@ ${TransactionStatusFragmentFragmentDoc}`;
41558
41854
  prevRoot
41559
41855
  time
41560
41856
  applicationHash
41561
- messageReceiptRoot
41562
41857
  messageReceiptCount
41563
41858
  }
41564
41859
  sender
@@ -41578,8 +41873,8 @@ ${TransactionStatusFragmentFragmentDoc}`;
41578
41873
  var BlockFragmentFragmentDoc = lib_default2`
41579
41874
  fragment blockFragment on Block {
41580
41875
  id
41876
+ height
41581
41877
  header {
41582
- height
41583
41878
  time
41584
41879
  }
41585
41880
  transactions {
@@ -41637,6 +41932,11 @@ ${TransactionStatusFragmentFragmentDoc}`;
41637
41932
  `;
41638
41933
  var GasCostsFragmentFragmentDoc = lib_default2`
41639
41934
  fragment GasCostsFragment on GasCosts {
41935
+ version {
41936
+ ... on Version {
41937
+ value
41938
+ }
41939
+ }
41640
41940
  add
41641
41941
  addi
41642
41942
  aloc
@@ -41649,7 +41949,6 @@ ${TransactionStatusFragmentFragmentDoc}`;
41649
41949
  cb
41650
41950
  cfei
41651
41951
  cfsi
41652
- croo
41653
41952
  div
41654
41953
  divi
41655
41954
  ecr1
@@ -41732,6 +42031,9 @@ ${TransactionStatusFragmentFragmentDoc}`;
41732
42031
  ccp {
41733
42032
  ...DependentCostFragment
41734
42033
  }
42034
+ croo {
42035
+ ...DependentCostFragment
42036
+ }
41735
42037
  csiz {
41736
42038
  ...DependentCostFragment
41737
42039
  }
@@ -41791,6 +42093,11 @@ ${TransactionStatusFragmentFragmentDoc}`;
41791
42093
  ${DependentCostFragmentFragmentDoc}`;
41792
42094
  var ConsensusParametersFragmentFragmentDoc = lib_default2`
41793
42095
  fragment consensusParametersFragment on ConsensusParameters {
42096
+ version {
42097
+ ... on Version {
42098
+ value
42099
+ }
42100
+ }
41794
42101
  txParams {
41795
42102
  ...TxParametersFragment
41796
42103
  }
@@ -41850,18 +42157,9 @@ ${ConsensusParametersFragmentFragmentDoc}`;
41850
42157
  fragment nodeInfoFragment on NodeInfo {
41851
42158
  utxoValidation
41852
42159
  vmBacktrace
41853
- minGasPrice
41854
42160
  maxTx
41855
42161
  maxDepth
41856
42162
  nodeVersion
41857
- peers {
41858
- id
41859
- addresses
41860
- clientVersion
41861
- blockHeight
41862
- lastHeartbeatMs
41863
- appScore
41864
- }
41865
42163
  }
41866
42164
  `;
41867
42165
  var GetVersionDocument = lib_default2`
@@ -41896,13 +42194,9 @@ ${ConsensusParametersFragmentFragmentDoc}`;
41896
42194
  query getTransactionWithReceipts($transactionId: TransactionId!) {
41897
42195
  transaction(id: $transactionId) {
41898
42196
  ...transactionFragment
41899
- receipts {
41900
- ...receiptFragment
41901
- }
41902
42197
  }
41903
42198
  }
41904
- ${TransactionFragmentFragmentDoc}
41905
- ${ReceiptFragmentFragmentDoc}`;
42199
+ ${TransactionFragmentFragmentDoc}`;
41906
42200
  var GetTransactionsDocument = lib_default2`
41907
42201
  query getTransactions($after: String, $before: String, $first: Int, $last: Int) {
41908
42202
  transactions(after: $after, before: $before, first: $first, last: $last) {
@@ -42030,6 +42324,20 @@ ${MessageCoinFragmentFragmentDoc}`;
42030
42324
  }
42031
42325
  }
42032
42326
  ${BalanceFragmentFragmentDoc}`;
42327
+ var GetLatestGasPriceDocument = lib_default2`
42328
+ query getLatestGasPrice {
42329
+ latestGasPrice {
42330
+ gasPrice
42331
+ }
42332
+ }
42333
+ `;
42334
+ var EstimateGasPriceDocument = lib_default2`
42335
+ query estimateGasPrice($blockHorizon: U32!) {
42336
+ estimateGasPrice(blockHorizon: $blockHorizon) {
42337
+ gasPrice
42338
+ }
42339
+ }
42340
+ `;
42033
42341
  var GetBalancesDocument = lib_default2`
42034
42342
  query getBalances($filter: BalanceFilterInput!, $after: String, $before: String, $first: Int, $last: Int) {
42035
42343
  balances(
@@ -42084,12 +42392,12 @@ ${MessageCoinFragmentFragmentDoc}`;
42084
42392
  }
42085
42393
  `;
42086
42394
  var DryRunDocument = lib_default2`
42087
- mutation dryRun($encodedTransaction: HexString!, $utxoValidation: Boolean) {
42088
- dryRun(tx: $encodedTransaction, utxoValidation: $utxoValidation) {
42089
- ...receiptFragment
42395
+ mutation dryRun($encodedTransactions: [HexString!]!, $utxoValidation: Boolean) {
42396
+ dryRun(txs: $encodedTransactions, utxoValidation: $utxoValidation) {
42397
+ ...dryRunTransactionExecutionStatusFragment
42090
42398
  }
42091
42399
  }
42092
- ${ReceiptFragmentFragmentDoc}`;
42400
+ ${DryRunTransactionExecutionStatusFragmentFragmentDoc}`;
42093
42401
  var SubmitDocument = lib_default2`
42094
42402
  mutation submit($encodedTransaction: HexString!) {
42095
42403
  submit(tx: $encodedTransaction) {
@@ -42172,6 +42480,12 @@ ${MessageCoinFragmentFragmentDoc}`;
42172
42480
  getBalance(variables, options) {
42173
42481
  return requester(GetBalanceDocument, variables, options);
42174
42482
  },
42483
+ getLatestGasPrice(variables, options) {
42484
+ return requester(GetLatestGasPriceDocument, variables, options);
42485
+ },
42486
+ estimateGasPrice(variables, options) {
42487
+ return requester(EstimateGasPriceDocument, variables, options);
42488
+ },
42175
42489
  getBalances(variables, options) {
42176
42490
  return requester(GetBalancesDocument, variables, options);
42177
42491
  },
@@ -42243,7 +42557,9 @@ ${MessageCoinFragmentFragmentDoc}`;
42243
42557
  } catch (e) {
42244
42558
  throw new FuelError(
42245
42559
  ErrorCode.STREAM_PARSING_ERROR,
42246
- `Error while parsing stream data response: ${text}`
42560
+ `Error while parsing stream data response: ${text}
42561
+
42562
+ Thrown error: ${e}`
42247
42563
  );
42248
42564
  }
42249
42565
  if (Array.isArray(errors)) {
@@ -42327,9 +42643,6 @@ ${MessageCoinFragmentFragmentDoc}`;
42327
42643
  }
42328
42644
  };
42329
42645
 
42330
- // ../address/dist/configs.mjs
42331
- var ZeroBytes32 = "0x0000000000000000000000000000000000000000000000000000000000000000";
42332
-
42333
42646
  // src/providers/transaction-request/input.ts
42334
42647
  var inputify = (value) => {
42335
42648
  const { type: type3 } = value;
@@ -42340,7 +42653,7 @@ ${MessageCoinFragmentFragmentDoc}`;
42340
42653
  return {
42341
42654
  type: InputType.Coin,
42342
42655
  txID: hexlify(arrayify(value.id).slice(0, 32)),
42343
- outputIndex: arrayify(value.id)[32],
42656
+ outputIndex: toNumber2(arrayify(value.id).slice(32, 34)),
42344
42657
  owner: hexlify(value.owner),
42345
42658
  amount: bn(value.amount),
42346
42659
  assetId: hexlify(value.assetId),
@@ -42349,10 +42662,9 @@ ${MessageCoinFragmentFragmentDoc}`;
42349
42662
  txIndex: toNumber2(arrayify(value.txPointer).slice(8, 16))
42350
42663
  },
42351
42664
  witnessIndex: value.witnessIndex,
42352
- maturity: value.maturity ?? 0,
42353
42665
  predicateGasUsed: bn(value.predicateGasUsed),
42354
- predicateLength: predicate.length,
42355
- predicateDataLength: predicateData.length,
42666
+ predicateLength: bn(predicate.length),
42667
+ predicateDataLength: bn(predicateData.length),
42356
42668
  predicate: hexlify(predicate),
42357
42669
  predicateData: hexlify(predicateData)
42358
42670
  };
@@ -42383,8 +42695,8 @@ ${MessageCoinFragmentFragmentDoc}`;
42383
42695
  nonce: hexlify(value.nonce),
42384
42696
  witnessIndex: value.witnessIndex,
42385
42697
  predicateGasUsed: bn(value.predicateGasUsed),
42386
- predicateLength: predicate.length,
42387
- predicateDataLength: predicateData.length,
42698
+ predicateLength: bn(predicate.length),
42699
+ predicateDataLength: bn(predicateData.length),
42388
42700
  predicate: hexlify(predicate),
42389
42701
  predicateData: hexlify(predicateData),
42390
42702
  data: hexlify(data),
@@ -42541,8 +42853,8 @@ ${MessageCoinFragmentFragmentDoc}`;
42541
42853
  case "CALL" /* Call */: {
42542
42854
  const callReceipt = {
42543
42855
  type: ReceiptType.Call,
42544
- from: hexOrZero(receipt.contract?.id),
42545
- to: hexOrZero(receipt?.to?.id),
42856
+ from: hexOrZero(receipt.id || receipt.contractId),
42857
+ to: hexOrZero(receipt?.to),
42546
42858
  amount: bn(receipt.amount),
42547
42859
  assetId: hexOrZero(receipt.assetId),
42548
42860
  gas: bn(receipt.gas),
@@ -42556,7 +42868,7 @@ ${MessageCoinFragmentFragmentDoc}`;
42556
42868
  case "RETURN" /* Return */: {
42557
42869
  const returnReceipt = {
42558
42870
  type: ReceiptType.Return,
42559
- id: hexOrZero(receipt.contract?.id),
42871
+ id: hexOrZero(receipt.id || receipt.contractId),
42560
42872
  val: bn(receipt.val),
42561
42873
  pc: bn(receipt.pc),
42562
42874
  is: bn(receipt.is)
@@ -42566,7 +42878,7 @@ ${MessageCoinFragmentFragmentDoc}`;
42566
42878
  case "RETURN_DATA" /* ReturnData */: {
42567
42879
  const returnDataReceipt = {
42568
42880
  type: ReceiptType.ReturnData,
42569
- id: hexOrZero(receipt.contract?.id),
42881
+ id: hexOrZero(receipt.id || receipt.contractId),
42570
42882
  ptr: bn(receipt.ptr),
42571
42883
  len: bn(receipt.len),
42572
42884
  digest: hexOrZero(receipt.digest),
@@ -42578,7 +42890,7 @@ ${MessageCoinFragmentFragmentDoc}`;
42578
42890
  case "PANIC" /* Panic */: {
42579
42891
  const panicReceipt = {
42580
42892
  type: ReceiptType.Panic,
42581
- id: hexOrZero(receipt.contract?.id),
42893
+ id: hexOrZero(receipt.id),
42582
42894
  reason: bn(receipt.reason),
42583
42895
  pc: bn(receipt.pc),
42584
42896
  is: bn(receipt.is),
@@ -42589,7 +42901,7 @@ ${MessageCoinFragmentFragmentDoc}`;
42589
42901
  case "REVERT" /* Revert */: {
42590
42902
  const revertReceipt = {
42591
42903
  type: ReceiptType.Revert,
42592
- id: hexOrZero(receipt.contract?.id),
42904
+ id: hexOrZero(receipt.id || receipt.contractId),
42593
42905
  val: bn(receipt.ra),
42594
42906
  pc: bn(receipt.pc),
42595
42907
  is: bn(receipt.is)
@@ -42599,7 +42911,7 @@ ${MessageCoinFragmentFragmentDoc}`;
42599
42911
  case "LOG" /* Log */: {
42600
42912
  const logReceipt = {
42601
42913
  type: ReceiptType.Log,
42602
- id: hexOrZero(receipt.contract?.id),
42914
+ id: hexOrZero(receipt.id || receipt.contractId),
42603
42915
  val0: bn(receipt.ra),
42604
42916
  val1: bn(receipt.rb),
42605
42917
  val2: bn(receipt.rc),
@@ -42612,7 +42924,7 @@ ${MessageCoinFragmentFragmentDoc}`;
42612
42924
  case "LOG_DATA" /* LogData */: {
42613
42925
  const logDataReceipt = {
42614
42926
  type: ReceiptType.LogData,
42615
- id: hexOrZero(receipt.contract?.id),
42927
+ id: hexOrZero(receipt.id || receipt.contractId),
42616
42928
  val0: bn(receipt.ra),
42617
42929
  val1: bn(receipt.rb),
42618
42930
  ptr: bn(receipt.ptr),
@@ -42626,8 +42938,8 @@ ${MessageCoinFragmentFragmentDoc}`;
42626
42938
  case "TRANSFER" /* Transfer */: {
42627
42939
  const transferReceipt = {
42628
42940
  type: ReceiptType.Transfer,
42629
- from: hexOrZero(receipt.contract?.id),
42630
- to: hexOrZero(receipt.toAddress || receipt?.to?.id),
42941
+ from: hexOrZero(receipt.id || receipt.contractId),
42942
+ to: hexOrZero(receipt.toAddress || receipt?.to),
42631
42943
  amount: bn(receipt.amount),
42632
42944
  assetId: hexOrZero(receipt.assetId),
42633
42945
  pc: bn(receipt.pc),
@@ -42638,8 +42950,8 @@ ${MessageCoinFragmentFragmentDoc}`;
42638
42950
  case "TRANSFER_OUT" /* TransferOut */: {
42639
42951
  const transferOutReceipt = {
42640
42952
  type: ReceiptType.TransferOut,
42641
- from: hexOrZero(receipt.contract?.id),
42642
- to: hexOrZero(receipt.toAddress || receipt.to?.id),
42953
+ from: hexOrZero(receipt.id || receipt.contractId),
42954
+ to: hexOrZero(receipt.toAddress || receipt.to),
42643
42955
  amount: bn(receipt.amount),
42644
42956
  assetId: hexOrZero(receipt.assetId),
42645
42957
  pc: bn(receipt.pc),
@@ -42682,7 +42994,7 @@ ${MessageCoinFragmentFragmentDoc}`;
42682
42994
  return receiptMessageOut;
42683
42995
  }
42684
42996
  case "MINT" /* Mint */: {
42685
- const contractId = hexOrZero(receipt.contract?.id);
42997
+ const contractId = hexOrZero(receipt.id || receipt.contractId);
42686
42998
  const subId = hexOrZero(receipt.subId);
42687
42999
  const assetId = ReceiptMintCoder.getAssetId(contractId, subId);
42688
43000
  const mintReceipt = {
@@ -42697,7 +43009,7 @@ ${MessageCoinFragmentFragmentDoc}`;
42697
43009
  return mintReceipt;
42698
43010
  }
42699
43011
  case "BURN" /* Burn */: {
42700
- const contractId = hexOrZero(receipt.contract?.id);
43012
+ const contractId = hexOrZero(receipt.id || receipt.contractId);
42701
43013
  const subId = hexOrZero(receipt.subId);
42702
43014
  const assetId = ReceiptBurnCoder.getAssetId(contractId, subId);
42703
43015
  const burnReceipt = {
@@ -42717,7 +43029,6 @@ ${MessageCoinFragmentFragmentDoc}`;
42717
43029
  }
42718
43030
 
42719
43031
  // src/providers/utils/gas.ts
42720
- var calculatePriceWithFactor = (gas, gasPrice, priceFactor) => bn(Math.ceil(gas.mul(gasPrice).toNumber() / priceFactor.toNumber()));
42721
43032
  var getGasUsedFromReceipts = (receipts) => {
42722
43033
  const scriptResult = receipts.filter(
42723
43034
  (receipt) => receipt.type === ReceiptType.ScriptResult
@@ -42738,18 +43049,28 @@ ${MessageCoinFragmentFragmentDoc}`;
42738
43049
  }
42739
43050
  function gasUsedByInputs(inputs, txBytesSize, gasCosts) {
42740
43051
  const witnessCache = [];
42741
- const totalGas = inputs.reduce((total, input) => {
43052
+ const chargeableInputs = inputs.filter((input) => {
43053
+ const isCoinOrMessage = "owner" in input || "sender" in input;
43054
+ if (isCoinOrMessage) {
43055
+ if ("predicate" in input && input.predicate && input.predicate !== "0x") {
43056
+ return true;
43057
+ }
43058
+ if (!witnessCache.includes(input.witnessIndex)) {
43059
+ witnessCache.push(input.witnessIndex);
43060
+ return true;
43061
+ }
43062
+ }
43063
+ return false;
43064
+ });
43065
+ const vmInitializationCost = resolveGasDependentCosts(txBytesSize, gasCosts.vmInitialization);
43066
+ const totalGas = chargeableInputs.reduce((total, input) => {
42742
43067
  if ("predicate" in input && input.predicate && input.predicate !== "0x") {
42743
43068
  return total.add(
42744
- resolveGasDependentCosts(txBytesSize, gasCosts.vmInitialization).add(resolveGasDependentCosts(arrayify(input.predicate).length, gasCosts.contractRoot)).add(bn(input.predicateGasUsed))
43069
+ vmInitializationCost.add(resolveGasDependentCosts(arrayify(input.predicate).length, gasCosts.contractRoot)).add(bn(input.predicateGasUsed))
42745
43070
  );
42746
43071
  }
42747
- if ("witnessIndex" in input && !witnessCache.includes(input.witnessIndex)) {
42748
- witnessCache.push(input.witnessIndex);
42749
- return total.add(gasCosts.ecr1);
42750
- }
42751
- return total;
42752
- }, bn());
43072
+ return total.add(gasCosts.ecr1);
43073
+ }, bn(0));
42753
43074
  return totalGas;
42754
43075
  }
42755
43076
  function getMinGas(params) {
@@ -42761,12 +43082,20 @@ ${MessageCoinFragmentFragmentDoc}`;
42761
43082
  return minGas;
42762
43083
  }
42763
43084
  function getMaxGas(params) {
42764
- const { gasPerByte, witnessesLength, witnessLimit, minGas, gasLimit = bn(0) } = params;
43085
+ const {
43086
+ gasPerByte,
43087
+ witnessesLength,
43088
+ witnessLimit,
43089
+ minGas,
43090
+ gasLimit = bn(0),
43091
+ maxGasPerTx
43092
+ } = params;
42765
43093
  let remainingAllowedWitnessGas = bn(0);
42766
43094
  if (witnessLimit?.gt(0) && witnessLimit.gte(witnessesLength)) {
42767
43095
  remainingAllowedWitnessGas = bn(witnessLimit).sub(witnessesLength).mul(gasPerByte);
42768
43096
  }
42769
- return remainingAllowedWitnessGas.add(minGas).add(gasLimit);
43097
+ const maxGas = remainingAllowedWitnessGas.add(minGas).add(gasLimit);
43098
+ return maxGas.gte(maxGasPerTx) ? maxGasPerTx : maxGas;
42770
43099
  }
42771
43100
  function calculateMetadataGasForTxCreate({
42772
43101
  gasCosts,
@@ -42788,6 +43117,10 @@ ${MessageCoinFragmentFragmentDoc}`;
42788
43117
  }) {
42789
43118
  return resolveGasDependentCosts(txBytesSize, gasCosts.s256);
42790
43119
  }
43120
+ var calculateGasFee = (params) => {
43121
+ const { gas, gasPrice, priceFactor, tip } = params;
43122
+ return gas.mul(gasPrice).div(priceFactor).add(tip);
43123
+ };
42791
43124
 
42792
43125
  // src/providers/utils/json.ts
42793
43126
  function normalize2(object) {
@@ -42917,7 +43250,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42917
43250
  // src/providers/transaction-request/transaction-request.ts
42918
43251
  var BaseTransactionRequest = class {
42919
43252
  /** Gas price for transaction */
42920
- gasPrice;
43253
+ tip;
42921
43254
  /** Block until which tx cannot be included */
42922
43255
  maturity;
42923
43256
  /** The maximum fee payable by this transaction using BASE_ASSET. */
@@ -42930,38 +43263,34 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42930
43263
  outputs = [];
42931
43264
  /** List of witnesses */
42932
43265
  witnesses = [];
42933
- /** Base asset ID - should be fetched from the chain */
42934
- baseAssetId = ZeroBytes32;
42935
43266
  /**
42936
43267
  * Constructor for initializing a base transaction request.
42937
43268
  *
42938
43269
  * @param baseTransactionRequest - Optional object containing properties to initialize the transaction request.
42939
43270
  */
42940
43271
  constructor({
42941
- gasPrice,
43272
+ tip,
42942
43273
  maturity,
42943
43274
  maxFee,
42944
43275
  witnessLimit,
42945
43276
  inputs,
42946
43277
  outputs,
42947
- witnesses,
42948
- baseAssetId
43278
+ witnesses
42949
43279
  } = {}) {
42950
- this.gasPrice = bn(gasPrice);
43280
+ this.tip = bn(tip);
42951
43281
  this.maturity = maturity ?? 0;
42952
43282
  this.witnessLimit = witnessLimit ? bn(witnessLimit) : void 0;
42953
43283
  this.maxFee = maxFee ? bn(maxFee) : void 0;
42954
43284
  this.inputs = inputs ?? [];
42955
43285
  this.outputs = outputs ?? [];
42956
43286
  this.witnesses = witnesses ?? [];
42957
- this.baseAssetId = baseAssetId ?? ZeroBytes32;
42958
43287
  }
42959
43288
  static getPolicyMeta(req) {
42960
43289
  let policyTypes = 0;
42961
43290
  const policies = [];
42962
- if (req.gasPrice) {
42963
- policyTypes += PolicyType.GasPrice;
42964
- policies.push({ data: req.gasPrice, type: PolicyType.GasPrice });
43291
+ if (req.tip) {
43292
+ policyTypes += PolicyType.Tip;
43293
+ policies.push({ data: req.tip, type: PolicyType.Tip });
42965
43294
  }
42966
43295
  if (req.witnessLimit) {
42967
43296
  policyTypes += PolicyType.WitnessLimit;
@@ -43148,10 +43477,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43148
43477
  * @param predicate - Predicate bytes.
43149
43478
  * @param predicateData - Predicate data bytes.
43150
43479
  */
43151
- addCoinInput(coin, predicate) {
43480
+ addCoinInput(coin) {
43152
43481
  const { assetId, owner, amount } = coin;
43153
43482
  let witnessIndex;
43154
- if (predicate) {
43483
+ if (coin.predicate) {
43155
43484
  witnessIndex = 0;
43156
43485
  } else {
43157
43486
  witnessIndex = this.getCoinInputWitnessIndexByOwner(owner);
@@ -43166,9 +43495,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43166
43495
  amount,
43167
43496
  assetId,
43168
43497
  txPointer: "0x00000000000000000000000000000000",
43169
- witnessIndex,
43170
- predicate: predicate?.bytes,
43171
- predicateData: predicate?.predicateDataBytes
43498
+ witnessIndex
43172
43499
  };
43173
43500
  this.pushInput(input);
43174
43501
  this.addChangeOutput(owner, assetId);
@@ -43179,11 +43506,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43179
43506
  *
43180
43507
  * @param message - Message resource.
43181
43508
  * @param predicate - Predicate bytes.
43509
+ * @param predicateData - Predicate data bytes.
43182
43510
  */
43183
- addMessageInput(message, predicate) {
43511
+ addMessageInput(message) {
43184
43512
  const { recipient, sender, amount } = message;
43513
+ const assetId = BaseAssetId;
43185
43514
  let witnessIndex;
43186
- if (predicate) {
43515
+ if (message.predicate) {
43187
43516
  witnessIndex = 0;
43188
43517
  } else {
43189
43518
  witnessIndex = this.getCoinInputWitnessIndexByOwner(recipient);
@@ -43197,12 +43526,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43197
43526
  sender: sender.toB256(),
43198
43527
  recipient: recipient.toB256(),
43199
43528
  amount,
43200
- witnessIndex,
43201
- predicate: predicate?.bytes,
43202
- predicateData: predicate?.predicateDataBytes
43529
+ witnessIndex
43203
43530
  };
43204
43531
  this.pushInput(input);
43205
- this.addChangeOutput(recipient, this.baseAssetId);
43532
+ this.addChangeOutput(recipient, assetId);
43206
43533
  }
43207
43534
  /**
43208
43535
  * Adds a single resource to the transaction by adding a coin/message input and a
@@ -43230,32 +43557,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43230
43557
  resources.forEach((resource) => this.addResource(resource));
43231
43558
  return this;
43232
43559
  }
43233
- /**
43234
- * Adds multiple resources to the transaction by adding coin/message inputs and change
43235
- * outputs from the related assetIds.
43236
- *
43237
- * @param resources - The resources to add.
43238
- * @returns This transaction.
43239
- */
43240
- addPredicateResource(resource, predicate) {
43241
- if (isCoin(resource)) {
43242
- this.addCoinInput(resource, predicate);
43243
- } else {
43244
- this.addMessageInput(resource, predicate);
43245
- }
43246
- return this;
43247
- }
43248
- /**
43249
- * Adds multiple predicate coin/message inputs to the transaction and change outputs
43250
- * from the related assetIds.
43251
- *
43252
- * @param resources - The resources to add.
43253
- * @returns This transaction.
43254
- */
43255
- addPredicateResources(resources, predicate) {
43256
- resources.forEach((resource) => this.addPredicateResource(resource, predicate));
43257
- return this;
43258
- }
43259
43560
  /**
43260
43561
  * Adds a coin output to the transaction.
43261
43562
  *
@@ -43263,12 +43564,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43263
43564
  * @param amount - Amount of coin.
43264
43565
  * @param assetId - Asset ID of coin.
43265
43566
  */
43266
- addCoinOutput(to, amount, assetId) {
43567
+ addCoinOutput(to, amount, assetId = BaseAssetId) {
43267
43568
  this.pushOutput({
43268
43569
  type: OutputType.Coin,
43269
43570
  to: addressify(to).toB256(),
43270
43571
  amount,
43271
- assetId: assetId ?? this.baseAssetId
43572
+ assetId
43272
43573
  });
43273
43574
  return this;
43274
43575
  }
@@ -43295,7 +43596,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43295
43596
  * @param to - Address of the owner.
43296
43597
  * @param assetId - Asset ID of coin.
43297
43598
  */
43298
- addChangeOutput(to, assetId) {
43599
+ addChangeOutput(to, assetId = BaseAssetId) {
43299
43600
  const changeOutput = this.getChangeOutputs().find(
43300
43601
  (output3) => hexlify(output3.assetId) === assetId
43301
43602
  );
@@ -43303,7 +43604,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43303
43604
  this.pushOutput({
43304
43605
  type: OutputType.Change,
43305
43606
  to: addressify(to).toB256(),
43306
- assetId: assetId ?? this.baseAssetId
43607
+ assetId
43307
43608
  });
43308
43609
  }
43309
43610
  }
@@ -43335,7 +43636,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43335
43636
  }
43336
43637
  calculateMaxGas(chainInfo, minGas) {
43337
43638
  const { consensusParameters } = chainInfo;
43338
- const { gasPerByte } = consensusParameters;
43639
+ const { gasPerByte, maxGasPerTx } = consensusParameters;
43339
43640
  const witnessesLength = this.toTransaction().witnesses.reduce(
43340
43641
  (acc, wit) => acc + wit.dataLength,
43341
43642
  0
@@ -43344,7 +43645,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43344
43645
  gasPerByte,
43345
43646
  minGas,
43346
43647
  witnessesLength,
43347
- witnessLimit: this.witnessLimit
43648
+ witnessLimit: this.witnessLimit,
43649
+ maxGasPerTx
43348
43650
  });
43349
43651
  }
43350
43652
  /**
@@ -43354,12 +43656,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43354
43656
  * @param quantities - CoinQuantity Array.
43355
43657
  */
43356
43658
  fundWithFakeUtxos(quantities, resourcesOwner) {
43357
- let idCounter = 0;
43358
- const generateId = () => {
43359
- const counterString = String(idCounter++);
43360
- const id = ZeroBytes32.slice(0, -counterString.length).concat(counterString);
43361
- return id;
43362
- };
43363
43659
  const findAssetInput = (assetId) => this.inputs.find((input) => {
43364
43660
  if ("assetId" in input) {
43365
43661
  return input.assetId === assetId;
@@ -43368,24 +43664,27 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43368
43664
  });
43369
43665
  const updateAssetInput = (assetId, quantity) => {
43370
43666
  const assetInput = findAssetInput(assetId);
43667
+ let usedQuantity = quantity;
43668
+ if (assetId === BaseAssetId) {
43669
+ usedQuantity = bn("1000000000000000000");
43670
+ }
43371
43671
  if (assetInput && "assetId" in assetInput) {
43372
- assetInput.id = generateId();
43373
- assetInput.amount = quantity;
43672
+ assetInput.id = hexlify(randomBytes3(34));
43673
+ assetInput.amount = usedQuantity;
43374
43674
  } else {
43375
43675
  this.addResources([
43376
43676
  {
43377
- id: generateId(),
43378
- amount: quantity,
43677
+ id: hexlify(randomBytes3(34)),
43678
+ amount: usedQuantity,
43379
43679
  assetId,
43380
43680
  owner: resourcesOwner || Address.fromRandom(),
43381
- maturity: 0,
43382
43681
  blockCreated: bn(1),
43383
43682
  txCreatedIdx: bn(1)
43384
43683
  }
43385
43684
  ]);
43386
43685
  }
43387
43686
  };
43388
- updateAssetInput(this.baseAssetId, bn(1e11));
43687
+ updateAssetInput(BaseAssetId, bn(1e11));
43389
43688
  quantities.forEach((q) => updateAssetInput(q.assetId, q.amount));
43390
43689
  }
43391
43690
  /**
@@ -43410,7 +43709,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43410
43709
  toJSON() {
43411
43710
  return normalizeJSON(this);
43412
43711
  }
43413
- updatePredicateInputs(inputs) {
43712
+ updatePredicateGasUsed(inputs) {
43414
43713
  this.inputs.forEach((i) => {
43415
43714
  let correspondingInput;
43416
43715
  switch (i.type) {
@@ -43432,6 +43731,15 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43432
43731
  }
43433
43732
  });
43434
43733
  }
43734
+ shiftPredicateData() {
43735
+ this.inputs.forEach((input) => {
43736
+ if ("predicateData" in input && "paddPredicateData" in input && typeof input.paddPredicateData === "function") {
43737
+ input.predicateData = input.paddPredicateData(
43738
+ BaseTransactionRequest.getPolicyMeta(this).policies.length
43739
+ );
43740
+ }
43741
+ });
43742
+ }
43435
43743
  };
43436
43744
 
43437
43745
  // src/providers/transaction-request/hash-transaction.ts
@@ -43565,9 +43873,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43565
43873
  return {
43566
43874
  type: TransactionType.Create,
43567
43875
  ...baseTransaction,
43568
- bytecodeLength: baseTransaction.witnesses[bytecodeWitnessIndex].dataLength / 4,
43569
43876
  bytecodeWitnessIndex,
43570
- storageSlotsCount: storageSlots.length,
43877
+ storageSlotsCount: bn(storageSlots.length),
43571
43878
  salt: this.salt ? hexlify(this.salt) : ZeroBytes32,
43572
43879
  storageSlots
43573
43880
  };
@@ -43681,8 +43988,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43681
43988
  type: TransactionType.Script,
43682
43989
  scriptGasLimit: this.gasLimit,
43683
43990
  ...super.getBaseTransaction(),
43684
- scriptLength: script.length,
43685
- scriptDataLength: scriptData.length,
43991
+ scriptLength: bn(script.length),
43992
+ scriptDataLength: bn(scriptData.length),
43686
43993
  receiptsRoot: ZeroBytes32,
43687
43994
  script: hexlify(script),
43688
43995
  scriptData: hexlify(scriptData)
@@ -43746,7 +44053,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43746
44053
  }
43747
44054
  calculateMaxGas(chainInfo, minGas) {
43748
44055
  const { consensusParameters } = chainInfo;
43749
- const { gasPerByte } = consensusParameters;
44056
+ const { gasPerByte, maxGasPerTx } = consensusParameters;
43750
44057
  const witnessesLength = this.toTransaction().witnesses.reduce(
43751
44058
  (acc, wit) => acc + wit.dataLength,
43752
44059
  0
@@ -43756,7 +44063,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43756
44063
  minGas,
43757
44064
  witnessesLength,
43758
44065
  witnessLimit: this.witnessLimit,
43759
- gasLimit: this.gasLimit
44066
+ gasLimit: this.gasLimit,
44067
+ maxGasPerTx
43760
44068
  });
43761
44069
  }
43762
44070
  /**
@@ -43829,13 +44137,29 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43829
44137
  }
43830
44138
  }
43831
44139
  };
44140
+ var cacheTxInputsFromOwner = (inputs, owner) => inputs.reduce(
44141
+ (acc, input) => {
44142
+ if (input.type === InputType.Coin && input.owner === owner) {
44143
+ acc.utxos.push(input.id);
44144
+ }
44145
+ if (input.type === InputType.Message && input.recipient === owner) {
44146
+ acc.messages.push(input.nonce);
44147
+ }
44148
+ return acc;
44149
+ },
44150
+ {
44151
+ utxos: [],
44152
+ messages: []
44153
+ }
44154
+ );
43832
44155
 
43833
44156
  // src/providers/transaction-summary/calculate-transaction-fee.ts
43834
44157
  var calculateTransactionFee = (params) => {
43835
44158
  const {
43836
- gasUsed,
44159
+ gasPrice,
43837
44160
  rawPayload,
43838
- consensusParameters: { gasCosts, feeParams }
44161
+ tip,
44162
+ consensusParameters: { gasCosts, feeParams, maxGasPerTx }
43839
44163
  } = params;
43840
44164
  const gasPerByte = bn(feeParams.gasPerByte);
43841
44165
  const gasPriceFactor = bn(feeParams.gasPriceFactor);
@@ -43845,8 +44169,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43845
44169
  return {
43846
44170
  fee: bn(0),
43847
44171
  minFee: bn(0),
43848
- maxFee: bn(0),
43849
- feeFromGasUsed: bn(0)
44172
+ maxFee: bn(0)
43850
44173
  };
43851
44174
  }
43852
44175
  const { type: type3, witnesses, inputs, policies } = transaction;
@@ -43878,7 +44201,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43878
44201
  metadataGas,
43879
44202
  txBytesSize: transactionBytes.length
43880
44203
  });
43881
- const gasPrice = bn(policies.find((policy) => policy.type === PolicyType.GasPrice)?.data);
43882
44204
  const witnessLimit = policies.find((policy) => policy.type === PolicyType.WitnessLimit)?.data;
43883
44205
  const witnessesLength = witnesses.reduce((acc, wit) => acc + wit.dataLength, 0);
43884
44206
  const maxGas = getMaxGas({
@@ -43886,17 +44208,25 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43886
44208
  minGas,
43887
44209
  witnessesLength,
43888
44210
  gasLimit,
43889
- witnessLimit
44211
+ witnessLimit,
44212
+ maxGasPerTx
44213
+ });
44214
+ const minFee = calculateGasFee({
44215
+ gasPrice,
44216
+ gas: minGas,
44217
+ priceFactor: gasPriceFactor,
44218
+ tip
44219
+ });
44220
+ const maxFee = calculateGasFee({
44221
+ gasPrice,
44222
+ gas: maxGas,
44223
+ priceFactor: gasPriceFactor,
44224
+ tip
43890
44225
  });
43891
- const feeFromGasUsed = calculatePriceWithFactor(gasUsed, gasPrice, gasPriceFactor);
43892
- const minFee = calculatePriceWithFactor(minGas, gasPrice, gasPriceFactor);
43893
- const maxFee = calculatePriceWithFactor(maxGas, gasPrice, gasPriceFactor);
43894
- const fee = minFee.add(feeFromGasUsed);
43895
44226
  return {
43896
- fee,
43897
44227
  minFee,
43898
44228
  maxFee,
43899
- feeFromGasUsed
44229
+ fee: maxFee
43900
44230
  };
43901
44231
  };
43902
44232
 
@@ -44450,7 +44780,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44450
44780
  gqlTransactionStatus,
44451
44781
  abiMap = {},
44452
44782
  maxInputs,
44453
- gasCosts
44783
+ gasCosts,
44784
+ maxGasPerTx,
44785
+ gasPrice
44454
44786
  } = params;
44455
44787
  const gasUsed = getGasUsedFromReceipts(receipts);
44456
44788
  const rawPayload = hexlify(transactionBytes);
@@ -44464,11 +44796,14 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44464
44796
  maxInputs
44465
44797
  });
44466
44798
  const typeName = getTransactionTypeName(transaction.type);
44799
+ const tip = bn(transaction.policies?.find((policy) => policy.type === PolicyType.Tip)?.data);
44467
44800
  const { fee } = calculateTransactionFee({
44468
- gasUsed,
44801
+ gasPrice,
44469
44802
  rawPayload,
44803
+ tip,
44470
44804
  consensusParameters: {
44471
44805
  gasCosts,
44806
+ maxGasPerTx,
44472
44807
  feeParams: {
44473
44808
  gasPerByte,
44474
44809
  gasPriceFactor
@@ -44604,8 +44939,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44604
44939
  const decodedTransaction = this.decodeTransaction(
44605
44940
  transaction
44606
44941
  );
44607
- const receipts = transaction.receipts?.map(processGqlReceipt) || [];
44608
- const { gasPerByte, gasPriceFactor, gasCosts } = this.provider.getGasConfig();
44942
+ let txReceipts = [];
44943
+ if (transaction?.status && "receipts" in transaction.status) {
44944
+ txReceipts = transaction.status.receipts;
44945
+ }
44946
+ const receipts = txReceipts.map(processGqlReceipt) || [];
44947
+ const { gasPerByte, gasPriceFactor, gasCosts, maxGasPerTx } = this.provider.getGasConfig();
44948
+ const gasPrice = await this.provider.getLatestGasPrice();
44609
44949
  const maxInputs = this.provider.getChain().consensusParameters.maxInputs;
44610
44950
  const transactionSummary = assembleTransactionSummary({
44611
44951
  id: this.id,
@@ -44617,7 +44957,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44617
44957
  gasPriceFactor,
44618
44958
  abiMap: contractsAbiMap,
44619
44959
  maxInputs,
44620
- gasCosts
44960
+ gasCosts,
44961
+ maxGasPerTx,
44962
+ gasPrice
44621
44963
  });
44622
44964
  return transactionSummary;
44623
44965
  }
@@ -44761,13 +45103,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44761
45103
  gasPerByte: bn(feeParams.gasPerByte),
44762
45104
  maxMessageDataLength: bn(predicateParams.maxMessageDataLength),
44763
45105
  chainId: bn(consensusParameters.chainId),
44764
- baseAssetId: consensusParameters.baseAssetId,
44765
45106
  gasCosts
44766
45107
  },
44767
45108
  gasCosts,
44768
45109
  latestBlock: {
44769
45110
  id: latestBlock.id,
44770
- height: bn(latestBlock.header.height),
45111
+ height: bn(latestBlock.height),
44771
45112
  time: latestBlock.header.time,
44772
45113
  transactions: latestBlock.transactions.map((i) => ({
44773
45114
  id: i.id
@@ -44861,10 +45202,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44861
45202
  * Returns some helpful parameters related to gas fees.
44862
45203
  */
44863
45204
  getGasConfig() {
44864
- const { minGasPrice } = this.getNode();
44865
45205
  const { maxGasPerTx, maxGasPerPredicate, gasPriceFactor, gasPerByte, gasCosts } = this.getChain().consensusParameters;
44866
45206
  return {
44867
- minGasPrice,
44868
45207
  maxGasPerTx,
44869
45208
  maxGasPerPredicate,
44870
45209
  gasPriceFactor,
@@ -44962,7 +45301,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44962
45301
  */
44963
45302
  async getBlockNumber() {
44964
45303
  const { chain } = await this.operations.getChain();
44965
- return bn(chain.latestBlock.header.height, 10);
45304
+ return bn(chain.latestBlock.height, 10);
44966
45305
  }
44967
45306
  /**
44968
45307
  * Returns the chain information.
@@ -44974,11 +45313,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44974
45313
  const processedNodeInfo = {
44975
45314
  maxDepth: bn(nodeInfo.maxDepth),
44976
45315
  maxTx: bn(nodeInfo.maxTx),
44977
- minGasPrice: bn(nodeInfo.minGasPrice),
44978
45316
  nodeVersion: nodeInfo.nodeVersion,
44979
45317
  utxoValidation: nodeInfo.utxoValidation,
44980
- vmBacktrace: nodeInfo.vmBacktrace,
44981
- peers: nodeInfo.peers
45318
+ vmBacktrace: nodeInfo.vmBacktrace
44982
45319
  };
44983
45320
  _Provider.nodeInfoCache[this.url] = processedNodeInfo;
44984
45321
  return processedNodeInfo;
@@ -45004,17 +45341,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45004
45341
  } = this.getChain();
45005
45342
  return chainId.toNumber();
45006
45343
  }
45007
- /**
45008
- * Returns the base asset ID
45009
- *
45010
- * @returns A promise that resolves to the base asset ID
45011
- */
45012
- getBaseAssetId() {
45013
- const {
45014
- consensusParameters: { baseAssetId }
45015
- } = this.getChain();
45016
- return baseAssetId;
45017
- }
45018
45344
  /**
45019
45345
  * Submits a transaction to the chain to be executed.
45020
45346
  *
@@ -45075,14 +45401,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45075
45401
  return this.estimateTxDependencies(transactionRequest);
45076
45402
  }
45077
45403
  const encodedTransaction = hexlify(transactionRequest.toTransactionBytes());
45078
- const { dryRun: gqlReceipts } = await this.operations.dryRun({
45079
- encodedTransaction,
45404
+ const { dryRun: dryRunStatuses } = await this.operations.dryRun({
45405
+ encodedTransactions: encodedTransaction,
45080
45406
  utxoValidation: utxoValidation || false
45081
45407
  });
45082
- const receipts = gqlReceipts.map(processGqlReceipt);
45083
- return {
45084
- receipts
45085
- };
45408
+ const [{ receipts: rawReceipts, status }] = dryRunStatuses;
45409
+ const receipts = rawReceipts.map(processGqlReceipt);
45410
+ return { receipts, dryrunStatus: status };
45086
45411
  }
45087
45412
  /**
45088
45413
  * Verifies whether enough gas is available to complete transaction.
@@ -45121,9 +45446,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45121
45446
  * If there are missing variable outputs,
45122
45447
  * `addVariableOutputs` is called on the transaction.
45123
45448
  *
45124
- * @privateRemarks
45125
- * TODO: Investigate support for missing contract IDs
45126
- * TODO: Add support for missing output messages
45127
45449
  *
45128
45450
  * @param transactionRequest - The transaction request object.
45129
45451
  * @returns A promise.
@@ -45136,16 +45458,19 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45136
45458
  missingContractIds: []
45137
45459
  };
45138
45460
  }
45139
- await this.estimatePredicates(transactionRequest);
45140
45461
  let receipts = [];
45141
45462
  const missingContractIds = [];
45142
45463
  let outputVariables = 0;
45464
+ let dryrunStatus;
45143
45465
  for (let attempt = 0; attempt < MAX_RETRIES; attempt++) {
45144
- const { dryRun: gqlReceipts } = await this.operations.dryRun({
45145
- encodedTransaction: hexlify(transactionRequest.toTransactionBytes()),
45466
+ const {
45467
+ dryRun: [{ receipts: rawReceipts, status }]
45468
+ } = await this.operations.dryRun({
45469
+ encodedTransactions: [hexlify(transactionRequest.toTransactionBytes())],
45146
45470
  utxoValidation: false
45147
45471
  });
45148
- receipts = gqlReceipts.map(processGqlReceipt);
45472
+ receipts = rawReceipts.map(processGqlReceipt);
45473
+ dryrunStatus = status;
45149
45474
  const { missingOutputVariables, missingOutputContractIds } = getReceiptsWithMissingData(receipts);
45150
45475
  const hasMissingOutputs = missingOutputVariables.length !== 0 || missingOutputContractIds.length !== 0;
45151
45476
  if (hasMissingOutputs) {
@@ -45155,6 +45480,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45155
45480
  transactionRequest.addContractInputAndOutput(Address.fromString(contractId));
45156
45481
  missingContractIds.push(contractId);
45157
45482
  });
45483
+ const { maxFee } = await this.estimateTxGasAndFee({
45484
+ transactionRequest,
45485
+ optimizeGas: false
45486
+ });
45487
+ transactionRequest.maxFee = maxFee;
45158
45488
  } else {
45159
45489
  break;
45160
45490
  }
@@ -45162,7 +45492,133 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45162
45492
  return {
45163
45493
  receipts,
45164
45494
  outputVariables,
45165
- missingContractIds
45495
+ missingContractIds,
45496
+ dryrunStatus
45497
+ };
45498
+ }
45499
+ /**
45500
+ * Dry runs multiple transactions and checks for missing dependencies in batches.
45501
+ *
45502
+ * Transactions are dry run in batches. After each dry run, transactions requiring
45503
+ * further modifications are identified. The method iteratively updates these transactions
45504
+ * and performs subsequent dry runs until all dependencies for each transaction are satisfied.
45505
+ *
45506
+ * @param transactionRequests - Array of transaction request objects.
45507
+ * @returns A promise that resolves to an array of results for each transaction.
45508
+ */
45509
+ async estimateMultipleTxDependencies(transactionRequests) {
45510
+ const results = transactionRequests.map(() => ({
45511
+ receipts: [],
45512
+ outputVariables: 0,
45513
+ missingContractIds: [],
45514
+ dryrunStatus: void 0
45515
+ }));
45516
+ const allRequests = clone_default(transactionRequests);
45517
+ const serializedTransactionsMap = /* @__PURE__ */ new Map();
45518
+ allRequests.forEach((req, index) => {
45519
+ if (req.type === TransactionType.Script) {
45520
+ serializedTransactionsMap.set(index, hexlify(req.toTransactionBytes()));
45521
+ }
45522
+ });
45523
+ let transactionsToProcess = Array.from(serializedTransactionsMap.keys());
45524
+ let attempt = 0;
45525
+ while (transactionsToProcess.length > 0 && attempt < MAX_RETRIES) {
45526
+ const encodedTransactions = transactionsToProcess.map(
45527
+ (index) => serializedTransactionsMap.get(index)
45528
+ );
45529
+ const dryRunResults = await this.operations.dryRun({
45530
+ encodedTransactions,
45531
+ utxoValidation: false
45532
+ });
45533
+ const nextRoundTransactions = [];
45534
+ for (let i = 0; i < dryRunResults.dryRun.length; i++) {
45535
+ const currentResultIndex = transactionsToProcess[i];
45536
+ const { receipts: rawReceipts, status } = dryRunResults.dryRun[i];
45537
+ results[currentResultIndex].receipts = rawReceipts.map(processGqlReceipt);
45538
+ results[currentResultIndex].dryrunStatus = status;
45539
+ const { missingOutputVariables, missingOutputContractIds } = getReceiptsWithMissingData(
45540
+ results[currentResultIndex].receipts
45541
+ );
45542
+ const hasMissingOutputs = missingOutputVariables.length > 0 || missingOutputContractIds.length > 0;
45543
+ const requestToProcess = allRequests[currentResultIndex];
45544
+ if (hasMissingOutputs && requestToProcess?.type === TransactionType.Script) {
45545
+ results[currentResultIndex].outputVariables += missingOutputVariables.length;
45546
+ requestToProcess.addVariableOutputs(missingOutputVariables.length);
45547
+ missingOutputContractIds.forEach(({ contractId }) => {
45548
+ requestToProcess.addContractInputAndOutput(Address.fromString(contractId));
45549
+ results[currentResultIndex].missingContractIds.push(contractId);
45550
+ });
45551
+ const { maxFee } = await this.estimateTxGasAndFee({
45552
+ transactionRequest: requestToProcess,
45553
+ optimizeGas: false
45554
+ });
45555
+ requestToProcess.maxFee = maxFee;
45556
+ serializedTransactionsMap.set(
45557
+ currentResultIndex,
45558
+ hexlify(requestToProcess.toTransactionBytes())
45559
+ );
45560
+ nextRoundTransactions.push(currentResultIndex);
45561
+ allRequests[currentResultIndex] = requestToProcess;
45562
+ }
45563
+ }
45564
+ transactionsToProcess = nextRoundTransactions;
45565
+ attempt += 1;
45566
+ }
45567
+ return results;
45568
+ }
45569
+ async dryRunMultipleTransactions(transactionRequests, { utxoValidation, estimateTxDependencies = true } = {}) {
45570
+ if (estimateTxDependencies) {
45571
+ return this.estimateMultipleTxDependencies(transactionRequests);
45572
+ }
45573
+ const encodedTransactions = transactionRequests.map((tx) => hexlify(tx.toTransactionBytes()));
45574
+ const { dryRun: dryRunStatuses } = await this.operations.dryRun({
45575
+ encodedTransactions,
45576
+ utxoValidation: utxoValidation || false
45577
+ });
45578
+ const results = dryRunStatuses.map(({ receipts: rawReceipts, status }) => {
45579
+ const receipts = rawReceipts.map(processGqlReceipt);
45580
+ return { receipts, dryrunStatus: status };
45581
+ });
45582
+ return results;
45583
+ }
45584
+ async estimateTxGasAndFee(params) {
45585
+ const { transactionRequest, optimizeGas = true } = params;
45586
+ let { gasPrice } = params;
45587
+ const chainInfo = this.getChain();
45588
+ const { gasPriceFactor } = this.getGasConfig();
45589
+ const minGas = transactionRequest.calculateMinGas(chainInfo);
45590
+ if (!gasPrice) {
45591
+ gasPrice = await this.estimateGasPrice(10);
45592
+ }
45593
+ const minFee = calculateGasFee({
45594
+ gasPrice: bn(gasPrice),
45595
+ gas: minGas,
45596
+ priceFactor: gasPriceFactor,
45597
+ tip: transactionRequest.tip
45598
+ }).add(1);
45599
+ let gasLimit = bn(0);
45600
+ if (transactionRequest.type === TransactionType.Script) {
45601
+ gasLimit = transactionRequest.gasLimit;
45602
+ if (!optimizeGas) {
45603
+ transactionRequest.gasLimit = minGas;
45604
+ gasLimit = transactionRequest.calculateMaxGas(chainInfo, minGas);
45605
+ transactionRequest.gasLimit = gasLimit;
45606
+ }
45607
+ }
45608
+ const maxGas = transactionRequest.calculateMaxGas(chainInfo, minGas);
45609
+ const maxFee = calculateGasFee({
45610
+ gasPrice: bn(gasPrice),
45611
+ gas: maxGas,
45612
+ priceFactor: gasPriceFactor,
45613
+ tip: transactionRequest.tip
45614
+ }).add(1);
45615
+ return {
45616
+ minGas,
45617
+ minFee,
45618
+ maxGas,
45619
+ maxFee,
45620
+ gasPrice,
45621
+ gasLimit
45166
45622
  };
45167
45623
  }
45168
45624
  /**
@@ -45180,15 +45636,17 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45180
45636
  if (estimateTxDependencies) {
45181
45637
  return this.estimateTxDependencies(transactionRequest);
45182
45638
  }
45183
- const encodedTransaction = hexlify(transactionRequest.toTransactionBytes());
45184
- const { dryRun: gqlReceipts } = await this.operations.dryRun({
45185
- encodedTransaction,
45639
+ const encodedTransactions = [hexlify(transactionRequest.toTransactionBytes())];
45640
+ const { dryRun: dryRunStatuses } = await this.operations.dryRun({
45641
+ encodedTransactions,
45186
45642
  utxoValidation: true
45187
45643
  });
45188
- const receipts = gqlReceipts.map(processGqlReceipt);
45189
- return {
45190
- receipts
45191
- };
45644
+ const callResult = dryRunStatuses.map((dryRunStatus) => {
45645
+ const { id, receipts, status } = dryRunStatus;
45646
+ const processedReceipts = receipts.map(processGqlReceipt);
45647
+ return { id, receipts: processedReceipts, status };
45648
+ });
45649
+ return { receipts: callResult[0].receipts };
45192
45650
  }
45193
45651
  /**
45194
45652
  * Returns a transaction cost to enable user
@@ -45205,80 +45663,80 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45205
45663
  * @param tolerance - The tolerance to add on top of the gasUsed.
45206
45664
  * @returns A promise that resolves to the transaction cost object.
45207
45665
  */
45208
- async getTransactionCost(transactionRequestLike, forwardingQuantities = [], {
45209
- estimateTxDependencies = true,
45210
- estimatePredicates = true,
45211
- resourcesOwner,
45212
- signatureCallback
45213
- } = {}) {
45666
+ async getTransactionCost(transactionRequestLike, { resourcesOwner, signatureCallback, quantitiesToContract = [] } = {}) {
45214
45667
  const txRequestClone = clone_default(transactionRequestify(transactionRequestLike));
45215
- const chainInfo = this.getChain();
45216
- const { gasPriceFactor, minGasPrice, maxGasPerTx } = this.getGasConfig();
45217
- const gasPrice = max(txRequestClone.gasPrice, minGasPrice);
45218
45668
  const isScriptTransaction = txRequestClone.type === TransactionType.Script;
45219
45669
  const coinOutputsQuantities = txRequestClone.getCoinOutputsQuantities();
45220
- const allQuantities = mergeQuantities(coinOutputsQuantities, forwardingQuantities);
45670
+ const allQuantities = mergeQuantities(coinOutputsQuantities, quantitiesToContract);
45221
45671
  txRequestClone.fundWithFakeUtxos(allQuantities, resourcesOwner?.address);
45222
- if (estimatePredicates) {
45223
- if (isScriptTransaction) {
45224
- txRequestClone.gasLimit = bn(0);
45225
- }
45226
- if (resourcesOwner && "populateTransactionPredicateData" in resourcesOwner) {
45227
- resourcesOwner.populateTransactionPredicateData(txRequestClone);
45228
- }
45229
- await this.estimatePredicates(txRequestClone);
45672
+ txRequestClone.maxFee = bn(0);
45673
+ if (isScriptTransaction) {
45674
+ txRequestClone.gasLimit = bn(0);
45230
45675
  }
45231
- if (signatureCallback && isScriptTransaction) {
45232
- await signatureCallback(txRequestClone);
45676
+ if (resourcesOwner && "populateTransactionPredicateData" in resourcesOwner) {
45677
+ resourcesOwner.populateTransactionPredicateData(txRequestClone);
45233
45678
  }
45234
- const minGas = txRequestClone.calculateMinGas(chainInfo);
45235
- const maxGas = txRequestClone.calculateMaxGas(chainInfo, minGas);
45679
+ const signedRequest = clone_default(txRequestClone);
45680
+ let addedSignatures = 0;
45681
+ if (signatureCallback && isScriptTransaction) {
45682
+ const lengthBefore = signedRequest.witnesses.length;
45683
+ await signatureCallback(signedRequest);
45684
+ addedSignatures = signedRequest.witnesses.length - lengthBefore;
45685
+ }
45686
+ await this.estimatePredicates(signedRequest);
45687
+ let { maxFee, maxGas, minFee, minGas, gasPrice, gasLimit } = await this.estimateTxGasAndFee({
45688
+ transactionRequest: signedRequest,
45689
+ optimizeGas: false
45690
+ });
45691
+ txRequestClone.maxFee = maxFee;
45236
45692
  let receipts = [];
45237
45693
  let missingContractIds = [];
45238
45694
  let outputVariables = 0;
45239
- if (isScriptTransaction && estimateTxDependencies) {
45240
- txRequestClone.gasPrice = bn(0);
45241
- txRequestClone.gasLimit = bn(maxGasPerTx.sub(maxGas).toNumber() * 0.9);
45695
+ let gasUsed = bn(0);
45696
+ txRequestClone.updatePredicateGasUsed(signedRequest.inputs);
45697
+ if (isScriptTransaction) {
45698
+ if (signatureCallback) {
45699
+ await signatureCallback(txRequestClone);
45700
+ }
45701
+ txRequestClone.gasLimit = gasLimit;
45242
45702
  const result = await this.estimateTxDependencies(txRequestClone);
45243
45703
  receipts = result.receipts;
45244
45704
  outputVariables = result.outputVariables;
45245
45705
  missingContractIds = result.missingContractIds;
45706
+ gasUsed = getGasUsedFromReceipts(receipts);
45707
+ txRequestClone.gasLimit = gasUsed;
45708
+ ({ maxFee, maxGas, minFee, minGas, gasPrice } = await this.estimateTxGasAndFee({
45709
+ transactionRequest: txRequestClone,
45710
+ gasPrice
45711
+ }));
45246
45712
  }
45247
- const gasUsed = isScriptTransaction ? getGasUsedFromReceipts(receipts) : minGas;
45248
- const usedFee = calculatePriceWithFactor(
45249
- gasUsed,
45250
- gasPrice,
45251
- gasPriceFactor
45252
- ).normalizeZeroToOne();
45253
- const minFee = calculatePriceWithFactor(minGas, gasPrice, gasPriceFactor).normalizeZeroToOne();
45254
- const maxFee = calculatePriceWithFactor(maxGas, gasPrice, gasPriceFactor).normalizeZeroToOne();
45255
45713
  return {
45256
45714
  requiredQuantities: allQuantities,
45257
45715
  receipts,
45258
45716
  gasUsed,
45259
- minGasPrice,
45260
45717
  gasPrice,
45261
45718
  minGas,
45262
45719
  maxGas,
45263
- usedFee,
45264
45720
  minFee,
45265
45721
  maxFee,
45266
- estimatedInputs: txRequestClone.inputs,
45267
45722
  outputVariables,
45268
- missingContractIds
45723
+ missingContractIds,
45724
+ addedSignatures,
45725
+ estimatedPredicates: txRequestClone.inputs
45269
45726
  };
45270
45727
  }
45271
- async getResourcesForTransaction(owner, transactionRequestLike, forwardingQuantities = []) {
45728
+ async getResourcesForTransaction(owner, transactionRequestLike, quantitiesToContract = []) {
45272
45729
  const ownerAddress = Address.fromAddressOrString(owner);
45273
45730
  const transactionRequest = transactionRequestify(clone_default(transactionRequestLike));
45274
- const transactionCost = await this.getTransactionCost(transactionRequest, forwardingQuantities);
45731
+ const transactionCost = await this.getTransactionCost(transactionRequest, {
45732
+ quantitiesToContract
45733
+ });
45275
45734
  transactionRequest.addResources(
45276
45735
  await this.getResourcesToSpend(ownerAddress, transactionCost.requiredQuantities)
45277
45736
  );
45278
- const { requiredQuantities, ...txCost } = await this.getTransactionCost(
45279
- transactionRequest,
45280
- forwardingQuantities
45281
- );
45737
+ const { requiredQuantities, ...txCost } = await this.getTransactionCost(transactionRequest, {
45738
+ quantitiesToContract
45739
+ });
45282
45740
  const resources = await this.getResourcesToSpend(ownerAddress, requiredQuantities);
45283
45741
  return {
45284
45742
  resources,
@@ -45302,7 +45760,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45302
45760
  assetId: coin.assetId,
45303
45761
  amount: bn(coin.amount),
45304
45762
  owner: Address.fromAddressOrString(coin.owner),
45305
- maturity: bn(coin.maturity).toNumber(),
45306
45763
  blockCreated: bn(coin.blockCreated),
45307
45764
  txCreatedIdx: bn(coin.txCreatedIdx)
45308
45765
  }));
@@ -45354,7 +45811,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45354
45811
  amount: bn(coin.amount),
45355
45812
  assetId: coin.assetId,
45356
45813
  owner: Address.fromAddressOrString(coin.owner),
45357
- maturity: bn(coin.maturity).toNumber(),
45358
45814
  blockCreated: bn(coin.blockCreated),
45359
45815
  txCreatedIdx: bn(coin.txCreatedIdx)
45360
45816
  };
@@ -45387,7 +45843,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45387
45843
  }
45388
45844
  return {
45389
45845
  id: block2.id,
45390
- height: bn(block2.header.height),
45846
+ height: bn(block2.height),
45391
45847
  time: block2.header.time,
45392
45848
  transactionIds: block2.transactions.map((tx) => tx.id)
45393
45849
  };
@@ -45402,7 +45858,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45402
45858
  const { blocks: fetchedData } = await this.operations.getBlocks(params);
45403
45859
  const blocks = fetchedData.edges.map(({ node: block2 }) => ({
45404
45860
  id: block2.id,
45405
- height: bn(block2.header.height),
45861
+ height: bn(block2.height),
45406
45862
  time: block2.header.time,
45407
45863
  transactionIds: block2.transactions.map((tx) => tx.id)
45408
45864
  }));
@@ -45429,7 +45885,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45429
45885
  }
45430
45886
  return {
45431
45887
  id: block2.id,
45432
- height: bn(block2.header.height, 10),
45888
+ height: bn(block2.height, 10),
45433
45889
  time: block2.header.time,
45434
45890
  transactionIds: block2.transactions.map((tx) => tx.id),
45435
45891
  transactions: block2.transactions.map(
@@ -45609,7 +46065,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45609
46065
  prevRoot: messageBlockHeader.prevRoot,
45610
46066
  time: messageBlockHeader.time,
45611
46067
  applicationHash: messageBlockHeader.applicationHash,
45612
- messageReceiptRoot: messageBlockHeader.messageReceiptRoot,
45613
46068
  messageReceiptCount: bn(messageBlockHeader.messageReceiptCount)
45614
46069
  },
45615
46070
  commitBlockHeader: {
@@ -45621,7 +46076,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45621
46076
  prevRoot: commitBlockHeader.prevRoot,
45622
46077
  time: commitBlockHeader.time,
45623
46078
  applicationHash: commitBlockHeader.applicationHash,
45624
- messageReceiptRoot: commitBlockHeader.messageReceiptRoot,
45625
46079
  messageReceiptCount: bn(commitBlockHeader.messageReceiptCount)
45626
46080
  },
45627
46081
  sender: Address.fromAddressOrString(sender),
@@ -45631,6 +46085,16 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45631
46085
  data
45632
46086
  };
45633
46087
  }
46088
+ async getLatestGasPrice() {
46089
+ const { latestGasPrice } = await this.operations.getLatestGasPrice();
46090
+ return bn(latestGasPrice.gasPrice);
46091
+ }
46092
+ async estimateGasPrice(blockHorizon) {
46093
+ const { estimateGasPrice } = await this.operations.estimateGasPrice({
46094
+ blockHorizon: String(blockHorizon)
46095
+ });
46096
+ return bn(estimateGasPrice.gasPrice);
46097
+ }
45634
46098
  /**
45635
46099
  * Returns Message Proof for given transaction id and the message id from MessageOut receipt.
45636
46100
  *
@@ -45876,9 +46340,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45876
46340
  * @param assetId - The asset ID to check the balance for.
45877
46341
  * @returns A promise that resolves to the balance amount.
45878
46342
  */
45879
- async getBalance(assetId) {
45880
- const assetIdToFetch = assetId ?? this.provider.getBaseAssetId();
45881
- const amount = await this.provider.getBalance(this.address, assetIdToFetch);
46343
+ async getBalance(assetId = BaseAssetId) {
46344
+ const amount = await this.provider.getBalance(this.address, assetId);
45882
46345
  return amount;
45883
46346
  }
45884
46347
  /**
@@ -45915,37 +46378,33 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45915
46378
  * @param fee - The estimated transaction fee.
45916
46379
  * @returns A promise that resolves when the resources are added to the transaction.
45917
46380
  */
45918
- async fund(request, coinQuantities, fee) {
45919
- const baseAssetId = this.provider.getBaseAssetId();
45920
- const updatedQuantities = addAmountToAsset({
46381
+ async fund(request, params) {
46382
+ const { addedSignatures, estimatedPredicates, maxFee: fee, requiredQuantities } = params;
46383
+ const txRequest = request;
46384
+ const requiredQuantitiesWithFee = addAmountToCoinQuantities({
45921
46385
  amount: bn(fee),
45922
- assetId: baseAssetId,
45923
- coinQuantities
46386
+ assetId: BaseAssetId,
46387
+ coinQuantities: requiredQuantities
45924
46388
  });
45925
46389
  const quantitiesDict = {};
45926
- updatedQuantities.forEach(({ amount, assetId }) => {
46390
+ requiredQuantitiesWithFee.forEach(({ amount, assetId }) => {
45927
46391
  quantitiesDict[assetId] = {
45928
46392
  required: amount,
45929
46393
  owned: bn(0)
45930
46394
  };
45931
46395
  });
45932
- const cachedUtxos = [];
45933
- const cachedMessages = [];
45934
- const owner = this.address.toB256();
45935
- request.inputs.forEach((input) => {
46396
+ txRequest.inputs.forEach((input) => {
45936
46397
  const isResource = "amount" in input;
45937
46398
  if (isResource) {
45938
46399
  const isCoin2 = "owner" in input;
45939
46400
  if (isCoin2) {
45940
46401
  const assetId = String(input.assetId);
45941
- if (input.owner === owner && quantitiesDict[assetId]) {
46402
+ if (quantitiesDict[assetId]) {
45942
46403
  const amount = bn(input.amount);
45943
46404
  quantitiesDict[assetId].owned = quantitiesDict[assetId].owned.add(amount);
45944
- cachedUtxos.push(input.id);
45945
46405
  }
45946
- } else if (input.recipient === owner && input.amount && quantitiesDict[baseAssetId]) {
45947
- quantitiesDict[baseAssetId].owned = quantitiesDict[baseAssetId].owned.add(input.amount);
45948
- cachedMessages.push(input.nonce);
46406
+ } else if (input.amount && quantitiesDict[BaseAssetId]) {
46407
+ quantitiesDict[BaseAssetId].owned = quantitiesDict[BaseAssetId].owned.add(input.amount);
45949
46408
  }
45950
46409
  }
45951
46410
  });
@@ -45960,12 +46419,23 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45960
46419
  });
45961
46420
  const needsToBeFunded = missingQuantities.length;
45962
46421
  if (needsToBeFunded) {
45963
- const resources = await this.getResourcesToSpend(missingQuantities, {
45964
- messages: cachedMessages,
45965
- utxos: cachedUtxos
45966
- });
45967
- request.addResources(resources);
46422
+ const excludedIds = cacheTxInputsFromOwner(txRequest.inputs, this.address.toB256());
46423
+ const resources = await this.getResourcesToSpend(missingQuantities, excludedIds);
46424
+ txRequest.addResources(resources);
46425
+ }
46426
+ txRequest.shiftPredicateData();
46427
+ txRequest.updatePredicateGasUsed(estimatedPredicates);
46428
+ const requestToBeReEstimate = clone_default(txRequest);
46429
+ if (addedSignatures) {
46430
+ Array.from({ length: addedSignatures }).forEach(
46431
+ () => requestToBeReEstimate.addEmptyWitness()
46432
+ );
45968
46433
  }
46434
+ const { maxFee } = await this.provider.estimateTxGasAndFee({
46435
+ transactionRequest: requestToBeReEstimate
46436
+ });
46437
+ txRequest.maxFee = maxFee;
46438
+ return txRequest;
45969
46439
  }
45970
46440
  /**
45971
46441
  * A helper that creates a transfer transaction request and returns it.
@@ -45973,29 +46443,25 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45973
46443
  * @param destination - The address of the destination.
45974
46444
  * @param amount - The amount of coins to transfer.
45975
46445
  * @param assetId - The asset ID of the coins to transfer.
45976
- * @param txParams - The transaction parameters (gasLimit, gasPrice, maturity).
46446
+ * @param txParams - The transaction parameters (gasLimit, tip, maturity, maxFee, witnessLimit).
45977
46447
  * @returns A promise that resolves to the prepared transaction request.
45978
46448
  */
45979
- async createTransfer(destination, amount, assetId, txParams = {}) {
45980
- const { minGasPrice } = this.provider.getGasConfig();
45981
- const assetIdToTransfer = assetId ?? this.provider.getBaseAssetId();
45982
- const params = { gasPrice: minGasPrice, ...txParams };
45983
- const request = new ScriptTransactionRequest(params);
45984
- request.addCoinOutput(Address.fromAddressOrString(destination), amount, assetIdToTransfer);
45985
- const { maxFee, requiredQuantities, gasUsed, estimatedInputs } = await this.provider.getTransactionCost(request, [], {
46449
+ async createTransfer(destination, amount, assetId = BaseAssetId, txParams = {}) {
46450
+ const request = new ScriptTransactionRequest(txParams);
46451
+ request.addCoinOutput(Address.fromAddressOrString(destination), amount, assetId);
46452
+ const txCost = await this.provider.getTransactionCost(request, {
45986
46453
  estimateTxDependencies: true,
45987
46454
  resourcesOwner: this
45988
46455
  });
45989
- request.gasPrice = bn(txParams.gasPrice ?? minGasPrice);
45990
- request.gasLimit = bn(txParams.gasLimit ?? gasUsed);
45991
- this.validateGas({
45992
- gasUsed,
45993
- gasPrice: request.gasPrice,
45994
- gasLimit: request.gasLimit,
45995
- minGasPrice
45996
- });
45997
- await this.fund(request, requiredQuantities, maxFee);
45998
- request.updatePredicateInputs(estimatedInputs);
46456
+ if ("gasLimit" in txParams) {
46457
+ this.validateGas({
46458
+ gasUsed: txCost.gasUsed,
46459
+ gasLimit: request.gasLimit
46460
+ });
46461
+ }
46462
+ request.gasLimit = txCost.gasUsed;
46463
+ request.maxFee = txCost.maxFee;
46464
+ await this.fund(request, txCost);
45999
46465
  return request;
46000
46466
  }
46001
46467
  /**
@@ -46007,15 +46473,14 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46007
46473
  * @param txParams - The transaction parameters (gasLimit, gasPrice, maturity).
46008
46474
  * @returns A promise that resolves to the transaction response.
46009
46475
  */
46010
- async transfer(destination, amount, assetId, txParams = {}) {
46476
+ async transfer(destination, amount, assetId = BaseAssetId, txParams = {}) {
46011
46477
  if (bn(amount).lte(0)) {
46012
46478
  throw new FuelError(
46013
46479
  ErrorCode.INVALID_TRANSFER_AMOUNT,
46014
46480
  "Transfer amount must be a positive number."
46015
46481
  );
46016
46482
  }
46017
- const assetIdToTransfer = assetId ?? this.provider.getBaseAssetId();
46018
- const request = await this.createTransfer(destination, amount, assetIdToTransfer, txParams);
46483
+ const request = await this.createTransfer(destination, amount, assetId, txParams);
46019
46484
  return this.sendTransaction(request, { estimateTxDependencies: false });
46020
46485
  }
46021
46486
  /**
@@ -46027,7 +46492,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46027
46492
  * @param txParams - The optional transaction parameters.
46028
46493
  * @returns A promise that resolves to the transaction response.
46029
46494
  */
46030
- async transferToContract(contractId, amount, assetId, txParams = {}) {
46495
+ async transferToContract(contractId, amount, assetId = BaseAssetId, txParams = {}) {
46031
46496
  if (bn(amount).lte(0)) {
46032
46497
  throw new FuelError(
46033
46498
  ErrorCode.INVALID_TRANSFER_AMOUNT,
@@ -46035,32 +46500,30 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46035
46500
  );
46036
46501
  }
46037
46502
  const contractAddress = Address.fromAddressOrString(contractId);
46038
- const { minGasPrice } = this.provider.getGasConfig();
46039
- const assetIdToTransfer = assetId ?? this.provider.getBaseAssetId();
46040
- const params = { gasPrice: minGasPrice, ...txParams };
46041
46503
  const { script, scriptData } = await assembleTransferToContractScript({
46042
46504
  hexlifiedContractId: contractAddress.toB256(),
46043
46505
  amountToTransfer: bn(amount),
46044
- assetId: assetIdToTransfer
46506
+ assetId
46045
46507
  });
46046
46508
  const request = new ScriptTransactionRequest({
46047
- ...params,
46509
+ ...txParams,
46048
46510
  script,
46049
46511
  scriptData
46050
46512
  });
46051
46513
  request.addContractInputAndOutput(contractAddress);
46052
- const { maxFee, requiredQuantities, gasUsed } = await this.provider.getTransactionCost(
46053
- request,
46054
- [{ amount: bn(amount), assetId: String(assetIdToTransfer) }]
46055
- );
46056
- request.gasLimit = bn(params.gasLimit ?? gasUsed);
46057
- this.validateGas({
46058
- gasUsed,
46059
- gasPrice: request.gasPrice,
46060
- gasLimit: request.gasLimit,
46061
- minGasPrice
46514
+ const txCost = await this.provider.getTransactionCost(request, {
46515
+ resourcesOwner: this,
46516
+ quantitiesToContract: [{ amount: bn(amount), assetId: String(assetId) }]
46062
46517
  });
46063
- await this.fund(request, requiredQuantities, maxFee);
46518
+ if (txParams.gasLimit) {
46519
+ this.validateGas({
46520
+ gasUsed: txCost.gasUsed,
46521
+ gasLimit: request.gasLimit
46522
+ });
46523
+ }
46524
+ request.gasLimit = txCost.gasUsed;
46525
+ request.maxFee = txCost.maxFee;
46526
+ await this.fund(request, txCost);
46064
46527
  return this.sendTransaction(request);
46065
46528
  }
46066
46529
  /**
@@ -46072,8 +46535,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46072
46535
  * @returns A promise that resolves to the transaction response.
46073
46536
  */
46074
46537
  async withdrawToBaseLayer(recipient, amount, txParams = {}) {
46075
- const { minGasPrice } = this.provider.getGasConfig();
46076
- const baseAssetId = this.provider.getBaseAssetId();
46077
46538
  const recipientAddress = Address.fromAddressOrString(recipient);
46078
46539
  const recipientDataArray = arrayify(
46079
46540
  "0x".concat(recipientAddress.toHexString().substring(2).padStart(64, "0"))
@@ -46086,21 +46547,19 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46086
46547
  ...recipientDataArray,
46087
46548
  ...amountDataArray
46088
46549
  ]);
46089
- const params = { script, gasPrice: minGasPrice, ...txParams };
46550
+ const params = { script, ...txParams };
46090
46551
  const request = new ScriptTransactionRequest(params);
46091
- const forwardingQuantities = [{ amount: bn(amount), assetId: baseAssetId }];
46092
- const { requiredQuantities, maxFee, gasUsed } = await this.provider.getTransactionCost(
46093
- request,
46094
- forwardingQuantities
46095
- );
46096
- request.gasLimit = bn(params.gasLimit ?? gasUsed);
46097
- this.validateGas({
46098
- gasUsed,
46099
- gasPrice: request.gasPrice,
46100
- gasLimit: request.gasLimit,
46101
- minGasPrice
46102
- });
46103
- await this.fund(request, requiredQuantities, maxFee);
46552
+ const quantitiesToContract = [{ amount: bn(amount), assetId: BaseAssetId }];
46553
+ const txCost = await this.provider.getTransactionCost(request, { quantitiesToContract });
46554
+ if (txParams.gasLimit) {
46555
+ this.validateGas({
46556
+ gasUsed: txCost.gasUsed,
46557
+ gasLimit: request.gasLimit
46558
+ });
46559
+ }
46560
+ request.maxFee = txCost.maxFee;
46561
+ request.gasLimit = txCost.gasUsed;
46562
+ await this.fund(request, txCost);
46104
46563
  return this.sendTransaction(request);
46105
46564
  }
46106
46565
  async signMessage(message) {
@@ -46158,18 +46617,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46158
46617
  }
46159
46618
  return this.provider.simulate(transactionRequest, { estimateTxDependencies: false });
46160
46619
  }
46161
- validateGas({
46162
- gasUsed,
46163
- gasPrice,
46164
- gasLimit,
46165
- minGasPrice
46166
- }) {
46167
- if (minGasPrice.gt(gasPrice)) {
46168
- throw new FuelError(
46169
- ErrorCode.GAS_PRICE_TOO_LOW,
46170
- `Gas price '${gasPrice}' is lower than the required: '${minGasPrice}'.`
46171
- );
46172
- }
46620
+ validateGas({ gasUsed, gasLimit }) {
46173
46621
  if (gasUsed.gt(gasLimit)) {
46174
46622
  throw new FuelError(
46175
46623
  ErrorCode.GAS_LIMIT_TOO_LOW,
@@ -47552,12 +48000,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
47552
48000
  };
47553
48001
 
47554
48002
  // ../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-node/rng.js
47555
- var import_crypto15 = __toESM(__require("crypto"));
48003
+ var import_crypto16 = __toESM(__require("crypto"));
47556
48004
  var rnds8Pool = new Uint8Array(256);
47557
48005
  var poolPtr = rnds8Pool.length;
47558
48006
  function rng() {
47559
48007
  if (poolPtr > rnds8Pool.length - 16) {
47560
- import_crypto15.default.randomFillSync(rnds8Pool);
48008
+ import_crypto16.default.randomFillSync(rnds8Pool);
47561
48009
  poolPtr = 0;
47562
48010
  }
47563
48011
  return rnds8Pool.slice(poolPtr, poolPtr += 16);
@@ -47573,9 +48021,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
47573
48021
  }
47574
48022
 
47575
48023
  // ../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-node/native.js
47576
- var import_crypto16 = __toESM(__require("crypto"));
48024
+ var import_crypto17 = __toESM(__require("crypto"));
47577
48025
  var native_default = {
47578
- randomUUID: import_crypto16.default.randomUUID
48026
+ randomUUID: import_crypto17.default.randomUUID
47579
48027
  };
47580
48028
 
47581
48029
  // ../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-node/v4.js
@@ -47758,7 +48206,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
47758
48206
  * @param transactionRequestLike - The transaction request to send.
47759
48207
  * @returns A promise that resolves to the TransactionResponse object.
47760
48208
  */
47761
- async sendTransaction(transactionRequestLike, { estimateTxDependencies = true, awaitExecution } = {}) {
48209
+ async sendTransaction(transactionRequestLike, { estimateTxDependencies = false, awaitExecution } = {}) {
47762
48210
  const transactionRequest = transactionRequestify(transactionRequestLike);
47763
48211
  if (estimateTxDependencies) {
47764
48212
  await this.provider.estimateTxDependencies(transactionRequest);
@@ -50518,14 +50966,15 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
50518
50966
  process.env.GENESIS_SECRET || randomBytes22(32),
50519
50967
  wallet.provider
50520
50968
  );
50521
- const resources = await genesisWallet.getResourcesToSpend(quantities);
50522
- const { minGasPrice } = genesisWallet.provider.getGasConfig();
50523
- const request = new ScriptTransactionRequest({
50524
- gasLimit: 1e4,
50525
- gasPrice: minGasPrice
50969
+ const request = new ScriptTransactionRequest();
50970
+ quantities.forEach((quantity) => {
50971
+ const { amount, assetId } = coinQuantityfy(quantity);
50972
+ request.addCoinOutput(wallet.address, amount, assetId);
50526
50973
  });
50527
- request.addResources(resources);
50528
- quantities.map(coinQuantityfy).forEach(({ amount, assetId }) => request.addCoinOutput(wallet.address, amount, assetId));
50974
+ const txCost = await genesisWallet.provider.getTransactionCost(request);
50975
+ request.gasLimit = txCost.gasUsed;
50976
+ request.maxFee = txCost.maxFee;
50977
+ await genesisWallet.fund(request, txCost);
50529
50978
  await genesisWallet.sendTransaction(request, { awaitExecution: true });
50530
50979
  };
50531
50980
 
@@ -50555,7 +51004,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
50555
51004
 
50556
51005
  // src/test-utils/launchNode.ts
50557
51006
  var import_child_process = __require("child_process");
50558
- var import_crypto20 = __require("crypto");
51007
+ var import_crypto21 = __require("crypto");
50559
51008
  var import_fs2 = __require("fs");
50560
51009
  var import_os = __toESM(__require("os"));
50561
51010
  var import_path8 = __toESM(__require("path"));
@@ -50604,12 +51053,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
50604
51053
  // eslint-disable-next-line no-async-promise-executor
50605
51054
  new Promise(async (resolve, reject) => {
50606
51055
  const remainingArgs = extractRemainingArgs(args, [
50607
- "--chain",
51056
+ "--snapshot",
50608
51057
  "--consensus-key",
50609
51058
  "--db-type",
50610
51059
  "--poa-instant"
50611
51060
  ]);
50612
- const chainConfigPath = getFlagValueFromArgs(args, "--chain");
51061
+ const chainConfigPath = getFlagValueFromArgs(args, "--snapshot");
50613
51062
  const consensusKey = getFlagValueFromArgs(args, "--consensus-key") || defaultConsensusKey;
50614
51063
  const dbTypeFlagValue = getFlagValueFromArgs(args, "--db-type");
50615
51064
  const useInMemoryDb = dbTypeFlagValue === "in-memory" || dbTypeFlagValue === void 0;
@@ -50627,37 +51076,55 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
50627
51076
  })).toString();
50628
51077
  let chainConfigPathToUse;
50629
51078
  const prefix = basePath || import_os.default.tmpdir();
50630
- const suffix = basePath ? "" : (0, import_crypto20.randomUUID)();
50631
- const tempDirPath = import_path8.default.join(prefix, ".fuels", suffix);
51079
+ const suffix = basePath ? "" : (0, import_crypto21.randomUUID)();
51080
+ const tempDirPath = import_path8.default.join(prefix, ".fuels", suffix, "chainConfigs");
50632
51081
  if (chainConfigPath) {
50633
51082
  chainConfigPathToUse = chainConfigPath;
50634
51083
  } else {
50635
51084
  if (!(0, import_fs2.existsSync)(tempDirPath)) {
50636
51085
  (0, import_fs2.mkdirSync)(tempDirPath, { recursive: true });
50637
51086
  }
50638
- const tempChainConfigFilePath = import_path8.default.join(tempDirPath, "chainConfig.json");
50639
- let chainConfig = defaultChainConfig;
51087
+ let { stateConfigJson } = defaultChainConfigs;
51088
+ const { chainConfigJson, metadataJson } = defaultChainConfigs;
51089
+ stateConfigJson = {
51090
+ ...stateConfigJson,
51091
+ coins: [
51092
+ ...stateConfigJson.coins.map((coin) => ({
51093
+ ...coin,
51094
+ amount: "18446744073709551615"
51095
+ }))
51096
+ ],
51097
+ messages: stateConfigJson.messages.map((message) => ({
51098
+ ...message,
51099
+ amount: "18446744073709551615"
51100
+ }))
51101
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
51102
+ };
50640
51103
  if (!process.env.GENESIS_SECRET) {
50641
51104
  const pk = Signer.generatePrivateKey();
50642
51105
  const signer = new Signer(pk);
50643
51106
  process.env.GENESIS_SECRET = hexlify(pk);
50644
- chainConfig = {
50645
- ...defaultChainConfig,
50646
- initial_state: {
50647
- ...defaultChainConfig.initial_state,
50648
- coins: [
50649
- ...defaultChainConfig.initial_state.coins,
50650
- {
50651
- owner: signer.address.toHexString(),
50652
- amount: toHex(1e9),
50653
- asset_id: defaultChainConfig?.consensus_parameters?.base_asset_id ?? ZeroBytes32
50654
- }
50655
- ]
50656
- }
50657
- };
51107
+ stateConfigJson.coins.push({
51108
+ tx_id: hexlify(randomBytes3(34)),
51109
+ owner: signer.address.toHexString(),
51110
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
51111
+ amount: "18446744073709551615",
51112
+ asset_id: BaseAssetId,
51113
+ output_index: 0,
51114
+ tx_pointer_block_height: 0,
51115
+ tx_pointer_tx_idx: 0
51116
+ });
50658
51117
  }
50659
- (0, import_fs2.writeFileSync)(tempChainConfigFilePath, JSON.stringify(chainConfig), "utf8");
50660
- chainConfigPathToUse = tempChainConfigFilePath;
51118
+ let fixedStateConfigJSON = JSON.stringify(stateConfigJson);
51119
+ const regexMakeNumber = /("amount":)"(\d+)"/gm;
51120
+ fixedStateConfigJSON = fixedStateConfigJSON.replace(regexMakeNumber, "$1$2");
51121
+ const chainConfigWritePath = import_path8.default.join(tempDirPath, "chainConfig.json");
51122
+ const stateConfigWritePath = import_path8.default.join(tempDirPath, "stateConfig.json");
51123
+ const metadataWritePath = import_path8.default.join(tempDirPath, "metadata.json");
51124
+ (0, import_fs2.writeFileSync)(chainConfigWritePath, JSON.stringify(chainConfigJson), "utf8");
51125
+ (0, import_fs2.writeFileSync)(stateConfigWritePath, fixedStateConfigJSON, "utf8");
51126
+ (0, import_fs2.writeFileSync)(metadataWritePath, JSON.stringify(metadataJson), "utf8");
51127
+ chainConfigPathToUse = tempDirPath;
50661
51128
  }
50662
51129
  const child = (0, import_child_process.spawn)(
50663
51130
  command,
@@ -50666,10 +51133,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
50666
51133
  ["--ip", ipToUse],
50667
51134
  ["--port", portToUse],
50668
51135
  useInMemoryDb ? ["--db-type", "in-memory"] : ["--db-path", tempDirPath],
50669
- ["--min-gas-price", "0"],
51136
+ ["--min-gas-price", "1"],
50670
51137
  poaInstant ? ["--poa-instant", "true"] : [],
50671
51138
  ["--consensus-key", consensusKey],
50672
- ["--chain", chainConfigPathToUse],
51139
+ ["--snapshot", chainConfigPathToUse],
50673
51140
  "--vm-backtrace",
50674
51141
  "--utxo-validation",
50675
51142
  "--debug",
@@ -50716,10 +51183,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
50716
51183
  })
50717
51184
  );
50718
51185
  var generateWallets = async (count, provider) => {
50719
- const baseAssetId = provider.getBaseAssetId();
50720
51186
  const wallets = [];
50721
51187
  for (let i = 0; i < count; i += 1) {
50722
- const wallet = await generateTestWallet(provider, [[1e3, baseAssetId]]);
51188
+ const wallet = await generateTestWallet(provider, [[1e3, BaseAssetId]]);
50723
51189
  wallets.push(wallet);
50724
51190
  }
50725
51191
  return wallets;
@@ -50729,7 +51195,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
50729
51195
  walletCount = 10
50730
51196
  } = {}) => {
50731
51197
  const { cleanup: closeNode, ip, port } = await launchNode(launchNodeOptions || {});
50732
- const provider = await Provider.create(`http://${ip}:${port}/graphql`);
51198
+ const provider = await Provider.create(`http://${ip}:${port}/v1/graphql`);
50733
51199
  const wallets = await generateWallets(walletCount, provider);
50734
51200
  const cleanup = () => {
50735
51201
  closeNode();