@fuel-ts/account 0.0.0-rc-2037-20240411135757 → 0.0.0-rc-2021-20240411141803

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 +844 -560
  12. package/dist/index.global.js.map +1 -1
  13. package/dist/index.js +786 -518
  14. package/dist/index.js.map +1 -1
  15. package/dist/index.mjs +666 -399
  16. package/dist/index.mjs.map +1 -1
  17. package/dist/predicate/predicate.d.ts +10 -10
  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 +1 -1
  22. package/dist/providers/coin-quantity.d.ts.map +1 -1
  23. package/dist/providers/coin.d.ts +2 -1
  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 +2 -1
  27. package/dist/providers/message.d.ts.map +1 -1
  28. package/dist/providers/provider.d.ts +45 -27
  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 +6 -5
  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 +1562 -1046
  48. package/dist/test-utils.global.js.map +1 -1
  49. package/dist/test-utils.js +764 -499
  50. package/dist/test-utils.js.map +1 -1
  51. package/dist/test-utils.mjs +660 -395
  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
  }
@@ -32193,524 +32193,757 @@ This unreleased fuel-core build may include features and updates not yet support
32193
32193
  __publicField3(DateTime, "TAI64_NULL", "");
32194
32194
  var chainConfig_default = {
32195
32195
  chain_name: "local_testnet",
32196
- block_gas_limit: 5e9,
32197
- initial_state: {
32198
- coins: [
32199
- {
32200
- owner: "0x94ffcc53b892684acefaebc8a3d4a595e528a8cf664eeb3ef36f1020b0809d0d",
32201
- amount: "0xFFFFFFFFFFFFFFFF",
32202
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32203
- },
32204
- {
32205
- owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
32206
- amount: "0xFFFFFFFFFFFFFFFF",
32207
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32208
- },
32209
- {
32210
- owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
32211
- amount: "0xFFFFFFFFFFFFFFFF",
32212
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32213
- },
32214
- {
32215
- owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
32216
- amount: "0xFFFFFFFFFFFFFFFF",
32217
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32218
- },
32219
- {
32220
- owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
32221
- amount: "0xFFFFFFFFFFFFFFFF",
32222
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32223
- },
32224
- {
32225
- owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
32226
- amount: "0xFFFFFFFFFFFFFFFF",
32227
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32228
- },
32229
- {
32230
- owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
32231
- amount: "0xFFFFFFFFFFFFFFFF",
32232
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32233
- },
32234
- {
32235
- owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
32236
- amount: "0xFFFFFFFFFFFFFFFF",
32237
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32238
- },
32239
- {
32240
- owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
32241
- amount: "0xFFFFFFFFFFFFFFFF",
32242
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32243
- },
32244
- {
32245
- owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
32246
- amount: "0xFFFFFFFFFFFFFFFF",
32247
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32248
- },
32249
- {
32250
- owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
32251
- amount: "0xFFFFFFFFFFFFFFFF",
32252
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32253
- },
32254
- {
32255
- owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
32256
- amount: "0xFFFFFFFFFFFFFFFF",
32257
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32258
- },
32259
- {
32260
- owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
32261
- amount: "0xFFFFFFFFFFFFFFFF",
32262
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32263
- },
32264
- {
32265
- owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
32266
- amount: "0xFFFFFFFFFFFFFFFF",
32267
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32268
- },
32269
- {
32270
- owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
32271
- amount: "0xFFFFFFFFFFFFFFFF",
32272
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32273
- },
32274
- {
32275
- owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
32276
- amount: "0xFFFFFFFFFFFFFFFF",
32277
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32278
- },
32279
- {
32280
- owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
32281
- amount: "0xFFFFFFFFFFFFFFFF",
32282
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32283
- },
32284
- {
32285
- owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
32286
- amount: "0xFFFFFFFFFFFFFFFF",
32287
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32288
- },
32289
- {
32290
- owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
32291
- amount: "0xFFFFFFFFFFFFFFFF",
32292
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32293
- },
32294
- {
32295
- owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
32296
- amount: "0xFFFFFFFFFFFFFFFF",
32297
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32298
- },
32299
- {
32300
- owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
32301
- amount: "0xFFFFFFFFFFFFFFFF",
32302
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32303
- },
32304
- {
32305
- owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
32306
- amount: "0xFFFFFFFFFFFFFFFF",
32307
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32308
- },
32309
- {
32310
- owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
32311
- amount: "0xFFFFFFFFFFFFFFFF",
32312
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32313
- },
32314
- {
32315
- owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
32316
- amount: "0xFFFFFFFFFFFFFFFF",
32317
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32318
- },
32319
- {
32320
- owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
32321
- amount: "0xFFFFFFFFFFFFFFFF",
32322
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32323
- },
32324
- {
32325
- owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
32326
- amount: "0xFFFFFFFFFFFFFFFF",
32327
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32328
- },
32329
- {
32330
- owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
32331
- amount: "0xFFFFFFFFFFFFFFFF",
32332
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32333
- },
32334
- {
32335
- owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
32336
- amount: "0xFFFFFFFFFFFFFFFF",
32337
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32338
- },
32339
- {
32340
- owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
32341
- amount: "0xFFFFFFFFFFFFFFFF",
32342
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32343
- },
32344
- {
32345
- owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
32346
- amount: "0xFFFFFFFFFFFFFFFF",
32347
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32348
- },
32349
- {
32350
- owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
32351
- amount: "0xFFFFFFFFFFFFFFFF",
32352
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32353
- },
32354
- {
32355
- owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
32356
- amount: "0xFFFFFFFFFFFFFFFF",
32357
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32358
- },
32359
- {
32360
- owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
32361
- amount: "0xFFFFFFFFFFFFFFFF",
32362
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32363
- },
32364
- {
32365
- owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
32366
- amount: "0xFFFFFFFFFFFFFFFF",
32367
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32368
- },
32369
- {
32370
- owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
32371
- amount: "0xFFFFFFFFFFFFFFFF",
32372
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32373
- },
32374
- {
32375
- owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
32376
- amount: "0xFFFFFFFFFFFFFFFF",
32377
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32378
- },
32379
- {
32380
- owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
32381
- amount: "0xFFFFFFFFFFFFFFFF",
32382
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32383
- },
32384
- {
32385
- owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
32386
- amount: "0xFFFFFFFFFFFFFFFF",
32387
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32388
- },
32389
- {
32390
- owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
32391
- amount: "0xFFFFFFFFFFFFFFFF",
32392
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32393
- },
32394
- {
32395
- owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
32396
- amount: "0xFFFFFFFFFFFFFFFF",
32397
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32398
- },
32399
- {
32400
- owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
32401
- amount: "0xFFFFFFFFFFFFFFFF",
32402
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32403
- },
32404
- {
32405
- owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
32406
- amount: "0xFFFFFFFFFFFFFFFF",
32407
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32408
- },
32409
- {
32410
- owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
32411
- amount: "0xFFFFFFFFFFFFFFFF",
32412
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32413
- },
32414
- {
32415
- owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
32416
- amount: "0xFFFFFFFFFFFFFFFF",
32417
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32418
- },
32419
- {
32420
- owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
32421
- amount: "0xFFFFFFFFFFFFFFFF",
32422
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32423
- },
32424
- {
32425
- owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
32426
- amount: "0xFFFFFFFFFFFFFFFF",
32427
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32428
- },
32429
- {
32430
- owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
32431
- amount: "0xFFFFFFFFFFFFFFFF",
32432
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32433
- },
32434
- {
32435
- owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
32436
- amount: "0xFFFFFFFFFFFFFFFF",
32437
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32438
- },
32439
- {
32440
- owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
32441
- amount: "0xFFFFFFFFFFFFFFFF",
32442
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32443
- }
32444
- ],
32445
- messages: [
32446
- {
32447
- sender: "0xc43454aa38dd91f88109a4b7aef5efb96ce34e3f24992fe0f81d233ca686f80f",
32448
- recipient: "0x69a2b736b60159b43bb8a4f98c0589f6da5fa3a3d101e8e269c499eb942753ba",
32449
- nonce: "0101010101010101010101010101010101010101010101010101010101010101",
32450
- amount: "0x000000000000FFFF",
32451
- data: "",
32452
- da_height: "0x00"
32196
+ consensus_parameters: {
32197
+ V1: {
32198
+ tx_params: {
32199
+ V1: {
32200
+ max_inputs: 255,
32201
+ max_outputs: 255,
32202
+ max_witnesses: 255,
32203
+ max_gas_per_tx: 3e7,
32204
+ max_size: 112640
32205
+ }
32206
+ },
32207
+ predicate_params: {
32208
+ V1: {
32209
+ max_predicate_length: 102400,
32210
+ max_predicate_data_length: 102400,
32211
+ max_message_data_length: 102400,
32212
+ max_gas_per_predicate: 3e7
32213
+ }
32214
+ },
32215
+ script_params: {
32216
+ V1: {
32217
+ max_script_length: 102400,
32218
+ max_script_data_length: 102400
32219
+ }
32220
+ },
32221
+ contract_params: {
32222
+ V1: {
32223
+ contract_max_size: 102400,
32224
+ max_storage_slots: 1760
32225
+ }
32226
+ },
32227
+ fee_params: {
32228
+ V1: {
32229
+ gas_price_factor: 92,
32230
+ gas_per_byte: 63
32231
+ }
32232
+ },
32233
+ chain_id: 0,
32234
+ gas_costs: {
32235
+ V1: {
32236
+ add: 2,
32237
+ addi: 2,
32238
+ aloc: 1,
32239
+ and: 2,
32240
+ andi: 2,
32241
+ bal: 366,
32242
+ bhei: 2,
32243
+ bhsh: 2,
32244
+ burn: 33949,
32245
+ cb: 2,
32246
+ cfei: 2,
32247
+ cfsi: 2,
32248
+ div: 2,
32249
+ divi: 2,
32250
+ eck1: 3347,
32251
+ ecr1: 46165,
32252
+ ed19: 4210,
32253
+ eq: 2,
32254
+ exp: 2,
32255
+ expi: 2,
32256
+ flag: 1,
32257
+ gm: 2,
32258
+ gt: 2,
32259
+ gtf: 16,
32260
+ ji: 2,
32261
+ jmp: 2,
32262
+ jne: 2,
32263
+ jnei: 2,
32264
+ jnzi: 2,
32265
+ jmpf: 2,
32266
+ jmpb: 2,
32267
+ jnzf: 2,
32268
+ jnzb: 2,
32269
+ jnef: 2,
32270
+ jneb: 2,
32271
+ lb: 2,
32272
+ log: 754,
32273
+ lt: 2,
32274
+ lw: 2,
32275
+ mint: 35718,
32276
+ mlog: 2,
32277
+ mod: 2,
32278
+ modi: 2,
32279
+ move: 2,
32280
+ movi: 2,
32281
+ mroo: 5,
32282
+ mul: 2,
32283
+ muli: 2,
32284
+ mldv: 4,
32285
+ noop: 1,
32286
+ not: 2,
32287
+ or: 2,
32288
+ ori: 2,
32289
+ poph: 3,
32290
+ popl: 3,
32291
+ pshh: 4,
32292
+ pshl: 4,
32293
+ ret_contract: 733,
32294
+ rvrt_contract: 722,
32295
+ sb: 2,
32296
+ sll: 2,
32297
+ slli: 2,
32298
+ srl: 2,
32299
+ srli: 2,
32300
+ srw: 253,
32301
+ sub: 2,
32302
+ subi: 2,
32303
+ sw: 2,
32304
+ sww: 29053,
32305
+ time: 79,
32306
+ tr: 46242,
32307
+ tro: 33251,
32308
+ wdcm: 3,
32309
+ wqcm: 3,
32310
+ wdop: 3,
32311
+ wqop: 3,
32312
+ wdml: 3,
32313
+ wqml: 4,
32314
+ wddv: 5,
32315
+ wqdv: 7,
32316
+ wdmd: 11,
32317
+ wqmd: 18,
32318
+ wdam: 9,
32319
+ wqam: 12,
32320
+ wdmm: 11,
32321
+ wqmm: 11,
32322
+ xor: 2,
32323
+ xori: 2,
32324
+ call: {
32325
+ LightOperation: {
32326
+ base: 21687,
32327
+ units_per_gas: 4
32328
+ }
32329
+ },
32330
+ ccp: {
32331
+ LightOperation: {
32332
+ base: 59,
32333
+ units_per_gas: 20
32334
+ }
32335
+ },
32336
+ croo: {
32337
+ LightOperation: {
32338
+ base: 1,
32339
+ units_per_gas: 1
32340
+ }
32341
+ },
32342
+ csiz: {
32343
+ LightOperation: {
32344
+ base: 59,
32345
+ units_per_gas: 195
32346
+ }
32347
+ },
32348
+ k256: {
32349
+ LightOperation: {
32350
+ base: 282,
32351
+ units_per_gas: 3
32352
+ }
32353
+ },
32354
+ ldc: {
32355
+ LightOperation: {
32356
+ base: 45,
32357
+ units_per_gas: 65
32358
+ }
32359
+ },
32360
+ logd: {
32361
+ LightOperation: {
32362
+ base: 1134,
32363
+ units_per_gas: 2
32364
+ }
32365
+ },
32366
+ mcl: {
32367
+ LightOperation: {
32368
+ base: 3,
32369
+ units_per_gas: 523
32370
+ }
32371
+ },
32372
+ mcli: {
32373
+ LightOperation: {
32374
+ base: 3,
32375
+ units_per_gas: 526
32376
+ }
32377
+ },
32378
+ mcp: {
32379
+ LightOperation: {
32380
+ base: 3,
32381
+ units_per_gas: 448
32382
+ }
32383
+ },
32384
+ mcpi: {
32385
+ LightOperation: {
32386
+ base: 7,
32387
+ units_per_gas: 585
32388
+ }
32389
+ },
32390
+ meq: {
32391
+ LightOperation: {
32392
+ base: 11,
32393
+ units_per_gas: 1097
32394
+ }
32395
+ },
32396
+ retd_contract: {
32397
+ LightOperation: {
32398
+ base: 1086,
32399
+ units_per_gas: 2
32400
+ }
32401
+ },
32402
+ s256: {
32403
+ LightOperation: {
32404
+ base: 45,
32405
+ units_per_gas: 3
32406
+ }
32407
+ },
32408
+ scwq: {
32409
+ HeavyOperation: {
32410
+ base: 30375,
32411
+ gas_per_unit: 28628
32412
+ }
32413
+ },
32414
+ smo: {
32415
+ LightOperation: {
32416
+ base: 64196,
32417
+ units_per_gas: 1
32418
+ }
32419
+ },
32420
+ srwq: {
32421
+ HeavyOperation: {
32422
+ base: 262,
32423
+ gas_per_unit: 249
32424
+ }
32425
+ },
32426
+ swwq: {
32427
+ HeavyOperation: {
32428
+ base: 28484,
32429
+ gas_per_unit: 26613
32430
+ }
32431
+ },
32432
+ contract_root: {
32433
+ LightOperation: {
32434
+ base: 45,
32435
+ units_per_gas: 1
32436
+ }
32437
+ },
32438
+ state_root: {
32439
+ HeavyOperation: {
32440
+ base: 350,
32441
+ gas_per_unit: 176
32442
+ }
32443
+ },
32444
+ new_storage_per_byte: 63,
32445
+ vm_initialization: {
32446
+ LightOperation: {
32447
+ base: 1645,
32448
+ units_per_gas: 14
32449
+ }
32450
+ }
32451
+ }
32453
32452
  },
32454
- {
32455
- sender: "0x69a2b736b60159b43bb8a4f98c0589f6da5fa3a3d101e8e269c499eb942753ba",
32456
- recipient: "0xc43454aa38dd91f88109a4b7aef5efb96ce34e3f24992fe0f81d233ca686f80f",
32457
- nonce: "0e1ef2963832068b0e1ef2963832068b0e1ef2963832068b0e1ef2963832068b",
32458
- amount: "0xb04f3c08f59b309e",
32459
- data: "",
32460
- da_height: "0x00"
32461
- }
32462
- ]
32453
+ base_asset_id: "0000000000000000000000000000000000000000000000000000000000000000",
32454
+ block_gas_limit: 3e7,
32455
+ privileged_address: "0000000000000000000000000000000000000000000000000000000000000000"
32456
+ }
32463
32457
  },
32464
- consensus_parameters: {
32465
- tx_params: {
32466
- max_inputs: 255,
32467
- max_outputs: 255,
32468
- max_witnesses: 255,
32469
- max_gas_per_tx: 1e7,
32470
- max_size: 17825792
32458
+ consensus: {
32459
+ PoA: {
32460
+ signing_key: "0x94ffcc53b892684acefaebc8a3d4a595e528a8cf664eeb3ef36f1020b0809d0d"
32461
+ }
32462
+ }
32463
+ };
32464
+ var metadata_default = {
32465
+ chain_config: "chainConfig.json",
32466
+ table_encoding: {
32467
+ Json: {
32468
+ filepath: "stateConfig.json"
32469
+ }
32470
+ }
32471
+ };
32472
+ var stateConfig_default = {
32473
+ coins: [
32474
+ {
32475
+ tx_id: "0x260eabfd50937e92939fd92687e9302a72e91c5065f64f853f2ccbe02396fe09d665",
32476
+ output_index: 0,
32477
+ tx_pointer_block_height: 0,
32478
+ tx_pointer_tx_idx: 0,
32479
+ owner: "0x94ffcc53b892684acefaebc8a3d4a595e528a8cf664eeb3ef36f1020b0809d0d",
32480
+ amount: 18446744073709552e3,
32481
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32471
32482
  },
32472
- predicate_params: {
32473
- max_predicate_length: 1048576,
32474
- max_predicate_data_length: 1048576,
32475
- max_gas_per_predicate: 1e7,
32476
- max_message_data_length: 1048576
32483
+ {
32484
+ tx_id: "0x2a757c2317236f7883ac9bbbf7d402f034e0b725c544ef1c8725b1d2bd960f8c690f",
32485
+ output_index: 0,
32486
+ tx_pointer_block_height: 0,
32487
+ tx_pointer_tx_idx: 0,
32488
+ owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
32489
+ amount: 18446744073709552e3,
32490
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32477
32491
  },
32478
- script_params: {
32479
- max_script_length: 1048576,
32480
- max_script_data_length: 1048576
32492
+ {
32493
+ tx_id: "0x634ef6cda00bac63992bbde80c6d694d484d58025a5ca0c9c848f0d35a5a3eee74b2",
32494
+ output_index: 0,
32495
+ tx_pointer_block_height: 0,
32496
+ tx_pointer_tx_idx: 0,
32497
+ owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
32498
+ amount: 18446744073709552e3,
32499
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32481
32500
  },
32482
- contract_params: {
32483
- contract_max_size: 16777216,
32484
- max_storage_slots: 255
32501
+ {
32502
+ tx_id: "0xd3543bb1da137a7987a96a1bb71681fdd195ff25318c0d4a923aa30eb27ffa80bc7b",
32503
+ output_index: 0,
32504
+ tx_pointer_block_height: 0,
32505
+ tx_pointer_tx_idx: 0,
32506
+ owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
32507
+ amount: 18446744073709552e3,
32508
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32485
32509
  },
32486
- fee_params: {
32487
- gas_price_factor: 92,
32488
- gas_per_byte: 4
32489
- }
32490
- },
32491
- gas_costs: {
32492
- add: 1,
32493
- addi: 1,
32494
- aloc: 1,
32495
- and: 1,
32496
- andi: 1,
32497
- bal: 13,
32498
- bhei: 1,
32499
- bhsh: 1,
32500
- burn: 132,
32501
- cb: 1,
32502
- cfei: 1,
32503
- cfsi: 1,
32504
- croo: 16,
32505
- div: 1,
32506
- divi: 1,
32507
- ecr1: 3e3,
32508
- eck1: 951,
32509
- ed19: 3e3,
32510
- eq: 1,
32511
- exp: 1,
32512
- expi: 1,
32513
- flag: 1,
32514
- gm: 1,
32515
- gt: 1,
32516
- gtf: 1,
32517
- ji: 1,
32518
- jmp: 1,
32519
- jne: 1,
32520
- jnei: 1,
32521
- jnzi: 1,
32522
- jmpf: 1,
32523
- jmpb: 1,
32524
- jnzf: 1,
32525
- jnzb: 1,
32526
- jnef: 1,
32527
- jneb: 1,
32528
- lb: 1,
32529
- log: 9,
32530
- lt: 1,
32531
- lw: 1,
32532
- mint: 135,
32533
- mlog: 1,
32534
- modOp: 1,
32535
- modi: 1,
32536
- moveOp: 1,
32537
- movi: 1,
32538
- mroo: 2,
32539
- mul: 1,
32540
- muli: 1,
32541
- mldv: 1,
32542
- noop: 1,
32543
- not: 1,
32544
- or: 1,
32545
- ori: 1,
32546
- poph: 2,
32547
- popl: 2,
32548
- pshh: 2,
32549
- pshl: 2,
32550
- ret: 13,
32551
- rvrt: 13,
32552
- sb: 1,
32553
- sll: 1,
32554
- slli: 1,
32555
- srl: 1,
32556
- srli: 1,
32557
- srw: 12,
32558
- sub: 1,
32559
- subi: 1,
32560
- sw: 1,
32561
- sww: 67,
32562
- time: 1,
32563
- tr: 105,
32564
- tro: 60,
32565
- wdcm: 1,
32566
- wqcm: 1,
32567
- wdop: 1,
32568
- wqop: 1,
32569
- wdml: 1,
32570
- wqml: 1,
32571
- wddv: 1,
32572
- wqdv: 2,
32573
- wdmd: 3,
32574
- wqmd: 4,
32575
- wdam: 2,
32576
- wqam: 3,
32577
- wdmm: 3,
32578
- wqmm: 3,
32579
- xor: 1,
32580
- xori: 1,
32581
- call: {
32582
- LightOperation: {
32583
- base: 144,
32584
- units_per_gas: 214
32585
- }
32510
+ {
32511
+ tx_id: "0xa4d42cbb02adb32f5f3a9eab33a0ee7bdab8910ad9f615dfc86a7bb9e49a732bc58c",
32512
+ output_index: 0,
32513
+ tx_pointer_block_height: 0,
32514
+ tx_pointer_tx_idx: 0,
32515
+ owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
32516
+ amount: 18446744073709552e3,
32517
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32586
32518
  },
32587
- ccp: {
32588
- LightOperation: {
32589
- base: 15,
32590
- units_per_gas: 103
32591
- }
32519
+ {
32520
+ tx_id: "0xc197cb09b1d89a7862b238e9500631bd43f291aadb7ff55c8129335349634e9fde3f",
32521
+ output_index: 0,
32522
+ tx_pointer_block_height: 0,
32523
+ tx_pointer_tx_idx: 0,
32524
+ owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
32525
+ amount: 18446744073709552e3,
32526
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32592
32527
  },
32593
- csiz: {
32594
- LightOperation: {
32595
- base: 17,
32596
- units_per_gas: 790
32597
- }
32528
+ {
32529
+ tx_id: "0x4c4fc2451b9a9b16c520c1b89ec8968ce46823dd0396d84f7e3155861352fdce12c5",
32530
+ output_index: 0,
32531
+ tx_pointer_block_height: 0,
32532
+ tx_pointer_tx_idx: 0,
32533
+ owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
32534
+ amount: 18446744073709552e3,
32535
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32598
32536
  },
32599
- k256: {
32600
- LightOperation: {
32601
- base: 11,
32602
- units_per_gas: 214
32603
- }
32537
+ {
32538
+ tx_id: "0x68df8f08555086a1ab45591e6fe4bf2f538bcb80dd519108030b7e886d6a230c2531",
32539
+ output_index: 0,
32540
+ tx_pointer_block_height: 0,
32541
+ tx_pointer_tx_idx: 0,
32542
+ owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
32543
+ amount: 18446744073709552e3,
32544
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32604
32545
  },
32605
- ldc: {
32606
- LightOperation: {
32607
- base: 15,
32608
- units_per_gas: 272
32609
- }
32546
+ {
32547
+ tx_id: "0x1b9bdaa290518373eb905e45ce7fcb89acedd24341ca7749ad47a938e4bf3ca9b7ce",
32548
+ output_index: 0,
32549
+ tx_pointer_block_height: 0,
32550
+ tx_pointer_tx_idx: 0,
32551
+ owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
32552
+ amount: 18446744073709552e3,
32553
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32610
32554
  },
32611
- logd: {
32612
- LightOperation: {
32613
- base: 26,
32614
- units_per_gas: 64
32615
- }
32555
+ {
32556
+ tx_id: "0xa5a2e9db3d1285337fe1183dc1eabe8f9cdcd470daf95cd5c522bbae292f53977f26",
32557
+ output_index: 0,
32558
+ tx_pointer_block_height: 0,
32559
+ tx_pointer_tx_idx: 0,
32560
+ owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
32561
+ amount: 18446744073709552e3,
32562
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32616
32563
  },
32617
- mcl: {
32618
- LightOperation: {
32619
- base: 1,
32620
- units_per_gas: 3333
32621
- }
32564
+ {
32565
+ tx_id: "0x13b685a1ea7c56309a92d69dd7e4808987ec90d62a1f9c9f2ec18e54746855c8c93c",
32566
+ output_index: 0,
32567
+ tx_pointer_block_height: 0,
32568
+ tx_pointer_tx_idx: 0,
32569
+ owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
32570
+ amount: 18446744073709552e3,
32571
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32622
32572
  },
32623
- mcli: {
32624
- LightOperation: {
32625
- base: 1,
32626
- units_per_gas: 3333
32627
- }
32573
+ {
32574
+ tx_id: "0xf8f00a234cf3fbab86befc3fd9346d7fd1ac085233c9cb58c7447f30c75cbf87ed38",
32575
+ output_index: 0,
32576
+ tx_pointer_block_height: 0,
32577
+ tx_pointer_tx_idx: 0,
32578
+ owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
32579
+ amount: 18446744073709552e3,
32580
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32628
32581
  },
32629
- mcp: {
32630
- LightOperation: {
32631
- base: 1,
32632
- units_per_gas: 2e3
32633
- }
32582
+ {
32583
+ tx_id: "0x2a36c870f624b60fbd6f2b71332ca7f704c69296ceae4ddbf3a8ede79408088934be",
32584
+ output_index: 0,
32585
+ tx_pointer_block_height: 0,
32586
+ tx_pointer_tx_idx: 0,
32587
+ owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
32588
+ amount: 18446744073709552e3,
32589
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32634
32590
  },
32635
- mcpi: {
32636
- LightOperation: {
32637
- base: 3,
32638
- units_per_gas: 2e3
32639
- }
32591
+ {
32592
+ tx_id: "0x9cd180d41e67a422da8a7683f036b463a7ed7efc0de31c1692adac90decbfebce78c",
32593
+ output_index: 0,
32594
+ tx_pointer_block_height: 0,
32595
+ tx_pointer_tx_idx: 0,
32596
+ owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
32597
+ amount: 18446744073709552e3,
32598
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32640
32599
  },
32641
- meq: {
32642
- LightOperation: {
32643
- base: 1,
32644
- units_per_gas: 2500
32645
- }
32600
+ {
32601
+ tx_id: "0xfeb4f2388fa22e6613ff85cf4e655f58acdfaa6299eba7f93b812cd1f0d7bbac48f0",
32602
+ output_index: 0,
32603
+ tx_pointer_block_height: 0,
32604
+ tx_pointer_tx_idx: 0,
32605
+ owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
32606
+ amount: 18446744073709552e3,
32607
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32646
32608
  },
32647
- retd: {
32648
- LightOperation: {
32649
- base: 29,
32650
- units_per_gas: 62
32651
- }
32609
+ {
32610
+ tx_id: "0xc4d20299f43358dc32ab853f6631340b09278511b6adbaf34597ade6ef37efd018f1",
32611
+ output_index: 0,
32612
+ tx_pointer_block_height: 0,
32613
+ tx_pointer_tx_idx: 0,
32614
+ owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
32615
+ amount: 18446744073709552e3,
32616
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32652
32617
  },
32653
- s256: {
32654
- LightOperation: {
32655
- base: 2,
32656
- units_per_gas: 214
32657
- }
32618
+ {
32619
+ tx_id: "0x437291414110b0aebaa8be5c0d9ff1e97d1130a24a6c9e028f2b1f6b0576be6aa961",
32620
+ output_index: 0,
32621
+ tx_pointer_block_height: 0,
32622
+ tx_pointer_tx_idx: 0,
32623
+ owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
32624
+ amount: 18446744073709552e3,
32625
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32658
32626
  },
32659
- scwq: {
32660
- LightOperation: {
32661
- base: 13,
32662
- units_per_gas: 5
32663
- }
32627
+ {
32628
+ tx_id: "0x28131b9acc90c2058ee14f4094a474146ba5b779cb9021867164b3d41abad3d047a7",
32629
+ output_index: 0,
32630
+ tx_pointer_block_height: 0,
32631
+ tx_pointer_tx_idx: 0,
32632
+ owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
32633
+ amount: 18446744073709552e3,
32634
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32664
32635
  },
32665
- smo: {
32666
- LightOperation: {
32667
- base: 209,
32668
- units_per_gas: 55
32669
- }
32636
+ {
32637
+ tx_id: "0x033bb5f9b0e4f530d50af3a0f12dd510f799af495ef88baea3cf854a37da728d214b",
32638
+ output_index: 0,
32639
+ tx_pointer_block_height: 0,
32640
+ tx_pointer_tx_idx: 0,
32641
+ owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
32642
+ amount: 18446744073709552e3,
32643
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32670
32644
  },
32671
- srwq: {
32672
- LightOperation: {
32673
- base: 47,
32674
- units_per_gas: 5
32675
- }
32645
+ {
32646
+ tx_id: "0x460591398552eca338dd9577f362b91b0f9297f308258734870350004dcc303c67e9",
32647
+ output_index: 0,
32648
+ tx_pointer_block_height: 0,
32649
+ tx_pointer_tx_idx: 0,
32650
+ owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
32651
+ amount: 18446744073709552e3,
32652
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32676
32653
  },
32677
- swwq: {
32678
- LightOperation: {
32679
- base: 44,
32680
- units_per_gas: 5
32681
- }
32654
+ {
32655
+ tx_id: "0x447a7c37aee972dcba72f05255c5145dd63125f0fc46ef98c216f775ee0421e23d2b",
32656
+ output_index: 0,
32657
+ tx_pointer_block_height: 0,
32658
+ tx_pointer_tx_idx: 0,
32659
+ owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
32660
+ amount: 18446744073709552e3,
32661
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32682
32662
  },
32683
- contract_root: {
32684
- LightOperation: {
32685
- base: 75,
32686
- units_per_gas: 1
32687
- }
32663
+ {
32664
+ tx_id: "0xf4a5d727606260c7ac6333fa89e7aef474df8a13326716d4d02f6392ebb7b997d268",
32665
+ output_index: 0,
32666
+ tx_pointer_block_height: 0,
32667
+ tx_pointer_tx_idx: 0,
32668
+ owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
32669
+ amount: 18446744073709552e3,
32670
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32688
32671
  },
32689
- state_root: {
32690
- LightOperation: {
32691
- base: 412,
32692
- units_per_gas: 1
32693
- }
32672
+ {
32673
+ tx_id: "0x25a49b0731bf610f6706aa9e9e96e5967f7c50f4302a3c75d7c8141595896551c18d",
32674
+ output_index: 0,
32675
+ tx_pointer_block_height: 0,
32676
+ tx_pointer_tx_idx: 0,
32677
+ owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
32678
+ amount: 18446744073709552e3,
32679
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32694
32680
  },
32695
- vm_initialization: {
32696
- HeavyOperation: {
32697
- base: 2e3,
32698
- gas_per_unit: 0
32699
- }
32681
+ {
32682
+ tx_id: "0x0a6e3585881ef2edf3f7727762799089dc0b5923e8b3718b49044dd9ddcb33b68459",
32683
+ output_index: 0,
32684
+ tx_pointer_block_height: 0,
32685
+ tx_pointer_tx_idx: 0,
32686
+ owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
32687
+ amount: 18446744073709552e3,
32688
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32700
32689
  },
32701
- new_storage_per_byte: 1
32702
- },
32703
- consensus: {
32704
- PoA: {
32705
- signing_key: "0x94ffcc53b892684acefaebc8a3d4a595e528a8cf664eeb3ef36f1020b0809d0d"
32690
+ {
32691
+ tx_id: "0xf73bbe0635f7b6d59a090a21d87288b82164d0f6101da830ce64eff64a2d2ff2ac37",
32692
+ output_index: 0,
32693
+ tx_pointer_block_height: 0,
32694
+ tx_pointer_tx_idx: 0,
32695
+ owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
32696
+ amount: 18446744073709552e3,
32697
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32698
+ },
32699
+ {
32700
+ tx_id: "0x6cc44cb8d2a6462a591a77b6b9917eb6b22ad80d23d3cfd4f94c9da49c14b3cbac6e",
32701
+ output_index: 0,
32702
+ tx_pointer_block_height: 0,
32703
+ tx_pointer_tx_idx: 0,
32704
+ owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
32705
+ amount: 18446744073709552e3,
32706
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32707
+ },
32708
+ {
32709
+ tx_id: "0xbf2305d284ea95227040df4cc727156cccc2ca6aa3b92ed86fea4db1c37e5905f926",
32710
+ output_index: 0,
32711
+ tx_pointer_block_height: 0,
32712
+ tx_pointer_tx_idx: 0,
32713
+ owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
32714
+ amount: 18446744073709552e3,
32715
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32716
+ },
32717
+ {
32718
+ tx_id: "0xf4e1c76c72ecae699696f5e7a62ccf1425f7395080d0ca7b25ab63d1f841f425b807",
32719
+ output_index: 0,
32720
+ tx_pointer_block_height: 0,
32721
+ tx_pointer_tx_idx: 0,
32722
+ owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
32723
+ amount: 18446744073709552e3,
32724
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32725
+ },
32726
+ {
32727
+ tx_id: "0x619c80ee9f4c27c2e134cec6c67bdb268ce7fb1d2ac229ca2a44ec7ac88b2da99669",
32728
+ output_index: 0,
32729
+ tx_pointer_block_height: 0,
32730
+ tx_pointer_tx_idx: 0,
32731
+ owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
32732
+ amount: 18446744073709552e3,
32733
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32734
+ },
32735
+ {
32736
+ tx_id: "0x978d5b6be047ffbf1474dc376a6baa33264629b809e4a8210d11aaa805ec6451585d",
32737
+ output_index: 0,
32738
+ tx_pointer_block_height: 0,
32739
+ tx_pointer_tx_idx: 0,
32740
+ owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
32741
+ amount: 18446744073709552e3,
32742
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32743
+ },
32744
+ {
32745
+ tx_id: "0x673ba12fca6e52429896096262b8c59b61751976e552649fb1fe7369488fc10aa83c",
32746
+ output_index: 0,
32747
+ tx_pointer_block_height: 0,
32748
+ tx_pointer_tx_idx: 0,
32749
+ owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
32750
+ amount: 18446744073709552e3,
32751
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32752
+ },
32753
+ {
32754
+ tx_id: "0xc42a165104b9fcfa4a9ebffc707781ace233f1c0609c24c36a5c4bfcd407480ddb6c",
32755
+ output_index: 0,
32756
+ tx_pointer_block_height: 0,
32757
+ tx_pointer_tx_idx: 0,
32758
+ owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
32759
+ amount: 18446744073709552e3,
32760
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32761
+ },
32762
+ {
32763
+ tx_id: "0xb353fbcd94abba347f3ba25e17744e98da26e608ebccbbbd2e9d004997644bdf993c",
32764
+ output_index: 0,
32765
+ tx_pointer_block_height: 0,
32766
+ tx_pointer_tx_idx: 0,
32767
+ owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
32768
+ amount: 18446744073709552e3,
32769
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32770
+ },
32771
+ {
32772
+ tx_id: "0xc34a6fcb241dec82f885019caf5e14bb6708b435afebfef0037ac447fbb6d30378a3",
32773
+ output_index: 0,
32774
+ tx_pointer_block_height: 0,
32775
+ tx_pointer_tx_idx: 0,
32776
+ owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
32777
+ amount: 18446744073709552e3,
32778
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32779
+ },
32780
+ {
32781
+ tx_id: "0x421dfb5811c905724f2f4c6370cd15eaeb590ddeb966f9a4b9f8d65991dfe5142e12",
32782
+ output_index: 0,
32783
+ tx_pointer_block_height: 0,
32784
+ tx_pointer_tx_idx: 0,
32785
+ owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
32786
+ amount: 18446744073709552e3,
32787
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32788
+ },
32789
+ {
32790
+ tx_id: "0xa952c0487eefac5dda612011c4c82554c8660834461b9b815c6ae257b56b68005235",
32791
+ output_index: 0,
32792
+ tx_pointer_block_height: 0,
32793
+ tx_pointer_tx_idx: 0,
32794
+ owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
32795
+ amount: 18446744073709552e3,
32796
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32797
+ },
32798
+ {
32799
+ tx_id: "0xebaccf91b3b213341d047b6e6af214f1f9729b3d6dadf9c1918a9fe412486af871db",
32800
+ output_index: 0,
32801
+ tx_pointer_block_height: 0,
32802
+ tx_pointer_tx_idx: 0,
32803
+ owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
32804
+ amount: 18446744073709552e3,
32805
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32806
+ },
32807
+ {
32808
+ tx_id: "0xda6d61c153e7d735954408274f4ffe8459c2dbab720ce22a1ae9ffedd33077b5b19d",
32809
+ output_index: 0,
32810
+ tx_pointer_block_height: 0,
32811
+ tx_pointer_tx_idx: 0,
32812
+ owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
32813
+ amount: 18446744073709552e3,
32814
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32815
+ },
32816
+ {
32817
+ tx_id: "0x508871600ef68c4f1e021dd0db219c733107151338aa95de530bd10dc61f6a69c144",
32818
+ output_index: 0,
32819
+ tx_pointer_block_height: 0,
32820
+ tx_pointer_tx_idx: 0,
32821
+ owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
32822
+ amount: 18446744073709552e3,
32823
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32824
+ },
32825
+ {
32826
+ tx_id: "0x509994738b4973e2dbbff9596b176a89fb07ee95f0ed575a4fe07a735a2a181f3200",
32827
+ output_index: 0,
32828
+ tx_pointer_block_height: 0,
32829
+ tx_pointer_tx_idx: 0,
32830
+ owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
32831
+ amount: 18446744073709552e3,
32832
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32833
+ },
32834
+ {
32835
+ tx_id: "0x6cc0cb58df0e0606fc85481aaaf5f47e145a67240b298c184bcb7fd7367c3bbf9453",
32836
+ output_index: 0,
32837
+ tx_pointer_block_height: 0,
32838
+ tx_pointer_tx_idx: 0,
32839
+ owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
32840
+ amount: 18446744073709552e3,
32841
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32842
+ },
32843
+ {
32844
+ tx_id: "0x9ddea761afc31516307e1553647ac6cc26d4a82fed9a9e6a03b994cdbf2293b3e3b6",
32845
+ output_index: 0,
32846
+ tx_pointer_block_height: 0,
32847
+ tx_pointer_tx_idx: 0,
32848
+ owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
32849
+ amount: 18446744073709552e3,
32850
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32851
+ },
32852
+ {
32853
+ tx_id: "0x82dbc478ba63abf28b92d9dce0cb8c2e6c02833d436fe812a33cf78417e4a80c1306",
32854
+ output_index: 0,
32855
+ tx_pointer_block_height: 0,
32856
+ tx_pointer_tx_idx: 0,
32857
+ owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
32858
+ amount: 18446744073709552e3,
32859
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32860
+ },
32861
+ {
32862
+ tx_id: "0xc3b0cb232c74009fd226a6246403f78bcc33d116579f41d9387c0d76c76942749c7c",
32863
+ output_index: 0,
32864
+ tx_pointer_block_height: 0,
32865
+ tx_pointer_tx_idx: 0,
32866
+ owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
32867
+ amount: 18446744073709552e3,
32868
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32869
+ },
32870
+ {
32871
+ tx_id: "0x708ee45d18f94ab06458712745c92c7b9b6049ba345219d6697eae5208ec0328aeaf",
32872
+ output_index: 0,
32873
+ tx_pointer_block_height: 0,
32874
+ tx_pointer_tx_idx: 0,
32875
+ owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
32876
+ amount: 18446744073709552e3,
32877
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32878
+ },
32879
+ {
32880
+ tx_id: "0xfe26968c44ac5becc608ce543075ae9e677b7631f3beb7a11ba20703fdca3c0e3569",
32881
+ output_index: 0,
32882
+ tx_pointer_block_height: 0,
32883
+ tx_pointer_tx_idx: 0,
32884
+ owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
32885
+ amount: 18446744073709552e3,
32886
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32887
+ },
32888
+ {
32889
+ tx_id: "0xe0ec1d2c991feac69be4d0e84ad7c964616de08e16dccc4d2000b1900ba31082b993",
32890
+ output_index: 0,
32891
+ tx_pointer_block_height: 0,
32892
+ tx_pointer_tx_idx: 0,
32893
+ owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
32894
+ amount: 18446744073709552e3,
32895
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32896
+ },
32897
+ {
32898
+ tx_id: "0xfa82dbdd72252d1e6c76ee818bbac0441c3a705aff447f041c8b9fc3cb03f9ccd7e2",
32899
+ output_index: 0,
32900
+ tx_pointer_block_height: 0,
32901
+ tx_pointer_tx_idx: 0,
32902
+ owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
32903
+ amount: 18446744073709552e3,
32904
+ asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32905
+ },
32906
+ {
32907
+ tx_id: "0x324f45e47cef892ac3e0759f3b72207c77046f9938267af4bd4af2ae031b97cb36c8",
32908
+ output_index: 0,
32909
+ tx_pointer_block_height: 0,
32910
+ tx_pointer_tx_idx: 0,
32911
+ owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
32912
+ amount: 18446744073709552e3,
32913
+ asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32706
32914
  }
32707
- }
32915
+ ],
32916
+ messages: [
32917
+ {
32918
+ sender: "0xc43454aa38dd91f88109a4b7aef5efb96ce34e3f24992fe0f81d233ca686f80f",
32919
+ recipient: "0x69a2b736b60159b43bb8a4f98c0589f6da5fa3a3d101e8e269c499eb942753ba",
32920
+ nonce: "0101010101010101010101010101010101010101010101010101010101010101",
32921
+ amount: 18446744073709552e3,
32922
+ data: "",
32923
+ da_height: 0
32924
+ },
32925
+ {
32926
+ sender: "0x69a2b736b60159b43bb8a4f98c0589f6da5fa3a3d101e8e269c499eb942753ba",
32927
+ recipient: "0xc43454aa38dd91f88109a4b7aef5efb96ce34e3f24992fe0f81d233ca686f80f",
32928
+ nonce: "0e1ef2963832068b0e1ef2963832068b0e1ef2963832068b0e1ef2963832068b",
32929
+ amount: 12704439083013452e3,
32930
+ data: "",
32931
+ da_height: 0
32932
+ }
32933
+ ],
32934
+ contracts: [],
32935
+ block_height: 0,
32936
+ da_block_height: 0
32937
+ };
32938
+ var defaultChainConfigs = {
32939
+ chainConfigJson: chainConfig_default,
32940
+ metadataJson: metadata_default,
32941
+ stateConfigJson: stateConfig_default
32708
32942
  };
32709
- var defaultChainConfig = chainConfig_default;
32710
32943
  var defaultConsensusKey = "0xa449b1ffee0e2205fa924c6740cc48b3b473aa28587df6dab12abc245d1f5298";
32711
32944
 
32712
32945
  // ../crypto/dist/index.mjs
32713
- var import_crypto8 = __toESM(__require("crypto"), 1);
32946
+ var import_crypto9 = __toESM(__require("crypto"), 1);
32714
32947
 
32715
32948
  // ../../node_modules/.pnpm/ethers@6.7.1/node_modules/ethers/lib.esm/_version.js
32716
32949
  var version = "6.7.1";
@@ -33782,6 +34015,27 @@ This unreleased fuel-core build may include features and updates not yet support
33782
34015
  };
33783
34016
  Object.freeze(pbkdf22);
33784
34017
 
34018
+ // ../../node_modules/.pnpm/ethers@6.7.1/node_modules/ethers/lib.esm/crypto/random.js
34019
+ var locked5 = false;
34020
+ var _randomBytes = function(length) {
34021
+ return new Uint8Array((0, import_crypto2.randomBytes)(length));
34022
+ };
34023
+ var __randomBytes = _randomBytes;
34024
+ function randomBytes3(length) {
34025
+ return __randomBytes(length);
34026
+ }
34027
+ randomBytes3._ = _randomBytes;
34028
+ randomBytes3.lock = function() {
34029
+ locked5 = true;
34030
+ };
34031
+ randomBytes3.register = function(func) {
34032
+ if (locked5) {
34033
+ throw new Error("randomBytes is locked");
34034
+ }
34035
+ __randomBytes = func;
34036
+ };
34037
+ Object.freeze(randomBytes3);
34038
+
33785
34039
  // ../../node_modules/.pnpm/ethers@6.7.1/node_modules/ethers/lib.esm/address/address.js
33786
34040
  var BN_03 = BigInt(0);
33787
34041
  var BN_36 = BigInt(36);
@@ -34366,8 +34620,8 @@ This unreleased fuel-core build may include features and updates not yet support
34366
34620
  }
34367
34621
 
34368
34622
  // ../crypto/dist/index.mjs
34369
- var import_crypto9 = __toESM(__require("crypto"), 1);
34370
34623
  var import_crypto10 = __toESM(__require("crypto"), 1);
34624
+ var import_crypto11 = __toESM(__require("crypto"), 1);
34371
34625
  var scrypt3 = (params) => {
34372
34626
  const { password, salt, n, p, r, dklen } = params;
34373
34627
  const derivedKey = scrypt(password, salt, { N: n, r, p, dkLen: dklen });
@@ -34376,7 +34630,7 @@ This unreleased fuel-core build may include features and updates not yet support
34376
34630
  var keccak2562 = (data) => keccak_256(data);
34377
34631
  var bufferFromString = (string, encoding = "base64") => Uint8Array.from(Buffer.from(string, encoding));
34378
34632
  var randomBytes4 = (length) => {
34379
- const randomValues = Uint8Array.from(import_crypto9.default.randomBytes(length));
34633
+ const randomValues = Uint8Array.from(import_crypto10.default.randomBytes(length));
34380
34634
  return randomValues;
34381
34635
  };
34382
34636
  var stringFromBuffer = (buffer, encoding = "base64") => Buffer.from(buffer).toString(encoding);
@@ -34391,7 +34645,7 @@ This unreleased fuel-core build may include features and updates not yet support
34391
34645
  const salt = randomBytes4(32);
34392
34646
  const secret = keyFromPassword(password, salt);
34393
34647
  const dataBuffer = Uint8Array.from(Buffer.from(JSON.stringify(data), "utf-8"));
34394
- const cipher = await import_crypto8.default.createCipheriv(ALGORITHM, secret, iv);
34648
+ const cipher = await import_crypto9.default.createCipheriv(ALGORITHM, secret, iv);
34395
34649
  let cipherData = cipher.update(dataBuffer);
34396
34650
  cipherData = Buffer.concat([cipherData, cipher.final()]);
34397
34651
  return {
@@ -34405,7 +34659,7 @@ This unreleased fuel-core build may include features and updates not yet support
34405
34659
  const salt = bufferFromString(keystore.salt);
34406
34660
  const secret = keyFromPassword(password, salt);
34407
34661
  const encryptedText = bufferFromString(keystore.data);
34408
- const decipher = await import_crypto8.default.createDecipheriv(ALGORITHM, secret, iv);
34662
+ const decipher = await import_crypto9.default.createDecipheriv(ALGORITHM, secret, iv);
34409
34663
  const decrypted = decipher.update(encryptedText);
34410
34664
  const deBuff = Buffer.concat([decrypted, decipher.final()]);
34411
34665
  const decryptedData = Buffer.from(deBuff).toString("utf-8");
@@ -34416,12 +34670,12 @@ This unreleased fuel-core build may include features and updates not yet support
34416
34670
  }
34417
34671
  };
34418
34672
  async function encryptJsonWalletData(data, key, iv) {
34419
- const cipher = await import_crypto10.default.createCipheriv("aes-128-ctr", key.subarray(0, 16), iv);
34673
+ const cipher = await import_crypto11.default.createCipheriv("aes-128-ctr", key.subarray(0, 16), iv);
34420
34674
  const encrypted = Buffer.concat([cipher.update(data), cipher.final()]);
34421
34675
  return new Uint8Array(encrypted);
34422
34676
  }
34423
34677
  async function decryptJsonWalletData(data, key, iv) {
34424
- const decipher = import_crypto10.default.createDecipheriv("aes-128-ctr", key.subarray(0, 16), iv);
34678
+ const decipher = import_crypto11.default.createDecipheriv("aes-128-ctr", key.subarray(0, 16), iv);
34425
34679
  const decrypted = await Buffer.concat([decipher.update(data), decipher.final()]);
34426
34680
  return new Uint8Array(decrypted);
34427
34681
  }
@@ -34978,32 +35232,182 @@ This unreleased fuel-core build may include features and updates not yet support
34978
35232
  function toBytes3(value, bytesPadding) {
34979
35233
  return bn(value).toBytes(bytesPadding);
34980
35234
  }
34981
- function max(...numbers) {
34982
- return numbers.reduce((prev, cur) => bn(cur).gt(prev) ? bn(cur) : prev, bn(0));
35235
+
35236
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isPlaceholder.js
35237
+ function _isPlaceholder(a) {
35238
+ return a != null && typeof a === "object" && a["@@functional/placeholder"] === true;
35239
+ }
35240
+
35241
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_curry1.js
35242
+ function _curry1(fn) {
35243
+ return function f1(a) {
35244
+ if (arguments.length === 0 || _isPlaceholder(a)) {
35245
+ return f1;
35246
+ } else {
35247
+ return fn.apply(this, arguments);
35248
+ }
35249
+ };
35250
+ }
35251
+
35252
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isArray.js
35253
+ var isArray_default = Array.isArray || function _isArray(val) {
35254
+ return val != null && val.length >= 0 && Object.prototype.toString.call(val) === "[object Array]";
35255
+ };
35256
+
35257
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/type.js
35258
+ var type = /* @__PURE__ */ _curry1(function type2(val) {
35259
+ return val === null ? "Null" : val === void 0 ? "Undefined" : Object.prototype.toString.call(val).slice(8, -1);
35260
+ });
35261
+ var type_default = type;
35262
+
35263
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_toISOString.js
35264
+ var pad = function pad2(n) {
35265
+ return (n < 10 ? "0" : "") + n;
35266
+ };
35267
+ var _toISOString = typeof Date.prototype.toISOString === "function" ? function _toISOString2(d) {
35268
+ return d.toISOString();
35269
+ } : function _toISOString3(d) {
35270
+ 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";
35271
+ };
35272
+
35273
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isInteger.js
35274
+ var isInteger_default = Number.isInteger || function _isInteger(n) {
35275
+ return n << 0 === n;
35276
+ };
35277
+
35278
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_cloneRegExp.js
35279
+ function _cloneRegExp(pattern) {
35280
+ 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" : ""));
35281
+ }
35282
+
35283
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_clone.js
35284
+ function _clone(value, deep, map) {
35285
+ map || (map = new _ObjectMap());
35286
+ if (_isPrimitive(value)) {
35287
+ return value;
35288
+ }
35289
+ var copy = function copy2(copiedValue) {
35290
+ var cachedCopy = map.get(value);
35291
+ if (cachedCopy) {
35292
+ return cachedCopy;
35293
+ }
35294
+ map.set(value, copiedValue);
35295
+ for (var key in value) {
35296
+ if (Object.prototype.hasOwnProperty.call(value, key)) {
35297
+ copiedValue[key] = deep ? _clone(value[key], true, map) : value[key];
35298
+ }
35299
+ }
35300
+ return copiedValue;
35301
+ };
35302
+ switch (type_default(value)) {
35303
+ case "Object":
35304
+ return copy(Object.create(Object.getPrototypeOf(value)));
35305
+ case "Array":
35306
+ return copy([]);
35307
+ case "Date":
35308
+ return new Date(value.valueOf());
35309
+ case "RegExp":
35310
+ return _cloneRegExp(value);
35311
+ case "Int8Array":
35312
+ case "Uint8Array":
35313
+ case "Uint8ClampedArray":
35314
+ case "Int16Array":
35315
+ case "Uint16Array":
35316
+ case "Int32Array":
35317
+ case "Uint32Array":
35318
+ case "Float32Array":
35319
+ case "Float64Array":
35320
+ case "BigInt64Array":
35321
+ case "BigUint64Array":
35322
+ return value.slice();
35323
+ default:
35324
+ return value;
35325
+ }
35326
+ }
35327
+ function _isPrimitive(param) {
35328
+ var type3 = typeof param;
35329
+ return param == null || type3 != "object" && type3 != "function";
34983
35330
  }
35331
+ var _ObjectMap = /* @__PURE__ */ function() {
35332
+ function _ObjectMap2() {
35333
+ this.map = {};
35334
+ this.length = 0;
35335
+ }
35336
+ _ObjectMap2.prototype.set = function(key, value) {
35337
+ const hashedKey = this.hash(key);
35338
+ let bucket = this.map[hashedKey];
35339
+ if (!bucket) {
35340
+ this.map[hashedKey] = bucket = [];
35341
+ }
35342
+ bucket.push([key, value]);
35343
+ this.length += 1;
35344
+ };
35345
+ _ObjectMap2.prototype.hash = function(key) {
35346
+ let hashedKey = [];
35347
+ for (var value in key) {
35348
+ hashedKey.push(Object.prototype.toString.call(key[value]));
35349
+ }
35350
+ return hashedKey.join();
35351
+ };
35352
+ _ObjectMap2.prototype.get = function(key) {
35353
+ if (this.length <= 180) {
35354
+ for (const p in this.map) {
35355
+ const bucket2 = this.map[p];
35356
+ for (let i = 0; i < bucket2.length; i += 1) {
35357
+ const element = bucket2[i];
35358
+ if (element[0] === key) {
35359
+ return element[1];
35360
+ }
35361
+ }
35362
+ }
35363
+ return;
35364
+ }
35365
+ const hashedKey = this.hash(key);
35366
+ const bucket = this.map[hashedKey];
35367
+ if (!bucket) {
35368
+ return;
35369
+ }
35370
+ for (let i = 0; i < bucket.length; i += 1) {
35371
+ const element = bucket[i];
35372
+ if (element[0] === key) {
35373
+ return element[1];
35374
+ }
35375
+ }
35376
+ };
35377
+ return _ObjectMap2;
35378
+ }();
35379
+
35380
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/clone.js
35381
+ var clone = /* @__PURE__ */ _curry1(function clone2(value) {
35382
+ return value != null && typeof value.clone === "function" ? value.clone() : _clone(value, true);
35383
+ });
35384
+ var clone_default = clone;
35385
+
35386
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/trim.js
35387
+ var hasProtoTrim = typeof String.prototype.trim === "function";
34984
35388
 
34985
35389
  // src/providers/coin-quantity.ts
34986
35390
  var coinQuantityfy = (coinQuantityLike) => {
34987
35391
  let assetId;
34988
35392
  let amount;
34989
- let max2;
35393
+ let max;
34990
35394
  if (Array.isArray(coinQuantityLike)) {
34991
35395
  amount = coinQuantityLike[0];
34992
35396
  assetId = coinQuantityLike[1] ?? BaseAssetId;
34993
- max2 = coinQuantityLike[2] ?? void 0;
35397
+ max = coinQuantityLike[2] ?? void 0;
34994
35398
  } else {
34995
35399
  amount = coinQuantityLike.amount;
34996
35400
  assetId = coinQuantityLike.assetId ?? BaseAssetId;
34997
- max2 = coinQuantityLike.max ?? void 0;
35401
+ max = coinQuantityLike.max ?? void 0;
34998
35402
  }
34999
35403
  const bnAmount = bn(amount);
35000
35404
  return {
35001
35405
  assetId: hexlify(assetId),
35002
35406
  amount: bnAmount.lt(1) ? bn(1) : bnAmount,
35003
- max: max2 ? bn(max2) : void 0
35407
+ max: max ? bn(max) : void 0
35004
35408
  };
35005
35409
  };
35006
- var addAmountToAsset = (params) => {
35410
+ var addAmountToCoinQuantities = (params) => {
35007
35411
  const { amount, assetId } = params;
35008
35412
  const coinQuantities = [...params.coinQuantities];
35009
35413
  const assetIdx = coinQuantities.findIndex((coinQuantity) => coinQuantity.assetId === assetId);
@@ -35077,9 +35481,9 @@ This unreleased fuel-core build may include features and updates not yet support
35077
35481
  var TX_POINTER_LEN = WORD_SIZE * 2;
35078
35482
  var MAX_BYTES = 2 ** 32 - 1;
35079
35483
  var calculateVmTxMemory = ({ maxInputs }) => BYTES_32 + // Tx ID
35080
- WORD_SIZE + // Tx size
35484
+ ASSET_ID_LEN + // Base asset ID
35081
35485
  // Asset ID/Balance coin input pairs
35082
- maxInputs * (ASSET_ID_LEN + WORD_SIZE);
35486
+ maxInputs * (ASSET_ID_LEN + WORD_SIZE) + WORD_SIZE;
35083
35487
  var SCRIPT_FIXED_SIZE = WORD_SIZE + // Identifier
35084
35488
  WORD_SIZE + // Gas limit
35085
35489
  WORD_SIZE + // Script size
@@ -35097,7 +35501,6 @@ This unreleased fuel-core build may include features and updates not yet support
35097
35501
  ASSET_ID_LEN + // Asset id
35098
35502
  TX_POINTER_LEN + // TxPointer
35099
35503
  WORD_SIZE + // Witnesses index
35100
- WORD_SIZE + // Maturity
35101
35504
  WORD_SIZE + // Predicate size
35102
35505
  WORD_SIZE + // Predicate data size
35103
35506
  WORD_SIZE;
@@ -35419,7 +35822,7 @@ This unreleased fuel-core build may include features and updates not yet support
35419
35822
  constructor(name, coders) {
35420
35823
  const caseIndexCoder = new BigNumberCoder("u64");
35421
35824
  const encodedValueSize = Object.values(coders).reduce(
35422
- (max2, coder) => Math.max(max2, coder.encodedLength),
35825
+ (max, coder) => Math.max(max, coder.encodedLength),
35423
35826
  0
35424
35827
  );
35425
35828
  super(`enum ${name}`, `enum ${name}`, caseIndexCoder.encodedLength + encodedValueSize);
@@ -36123,7 +36526,7 @@ This unreleased fuel-core build may include features and updates not yet support
36123
36526
  constructor(name, coders) {
36124
36527
  const caseIndexCoder = new BigNumberCoder("u64");
36125
36528
  const encodedValueSize = Object.values(coders).reduce(
36126
- (max2, coder) => Math.max(max2, coder.encodedLength),
36529
+ (max, coder) => Math.max(max, coder.encodedLength),
36127
36530
  0
36128
36531
  );
36129
36532
  super(`enum ${name}`, `enum ${name}`, caseIndexCoder.encodedLength + encodedValueSize);
@@ -36835,18 +37238,19 @@ This unreleased fuel-core build may include features and updates not yet support
36835
37238
  encode(value) {
36836
37239
  const parts = [];
36837
37240
  parts.push(new B256Coder().encode(value.txID));
36838
- parts.push(new NumberCoder("u8").encode(value.outputIndex));
37241
+ parts.push(new NumberCoder("u16").encode(value.outputIndex));
36839
37242
  parts.push(new B256Coder().encode(value.owner));
36840
37243
  parts.push(new BigNumberCoder("u64").encode(value.amount));
36841
37244
  parts.push(new B256Coder().encode(value.assetId));
36842
37245
  parts.push(new TxPointerCoder().encode(value.txPointer));
36843
- parts.push(new NumberCoder("u8").encode(value.witnessIndex));
36844
- parts.push(new NumberCoder("u32").encode(value.maturity));
37246
+ parts.push(new NumberCoder("u16").encode(value.witnessIndex));
36845
37247
  parts.push(new BigNumberCoder("u64").encode(value.predicateGasUsed));
36846
- parts.push(new NumberCoder("u32").encode(value.predicateLength));
36847
- parts.push(new NumberCoder("u32").encode(value.predicateDataLength));
36848
- parts.push(new ByteArrayCoder(value.predicateLength).encode(value.predicate));
36849
- parts.push(new ByteArrayCoder(value.predicateDataLength).encode(value.predicateData));
37248
+ parts.push(new BigNumberCoder("u64").encode(value.predicateLength));
37249
+ parts.push(new BigNumberCoder("u64").encode(value.predicateDataLength));
37250
+ parts.push(new ByteArrayCoder(value.predicateLength.toNumber()).encode(value.predicate));
37251
+ parts.push(
37252
+ new ByteArrayCoder(value.predicateDataLength.toNumber()).encode(value.predicateData)
37253
+ );
36850
37254
  return concat(parts);
36851
37255
  }
36852
37256
  decode(data, offset) {
@@ -36854,7 +37258,7 @@ This unreleased fuel-core build may include features and updates not yet support
36854
37258
  let o = offset;
36855
37259
  [decoded, o] = new B256Coder().decode(data, o);
36856
37260
  const txID = decoded;
36857
- [decoded, o] = new NumberCoder("u8").decode(data, o);
37261
+ [decoded, o] = new NumberCoder("u16").decode(data, o);
36858
37262
  const outputIndex = decoded;
36859
37263
  [decoded, o] = new B256Coder().decode(data, o);
36860
37264
  const owner = decoded;
@@ -36864,19 +37268,17 @@ This unreleased fuel-core build may include features and updates not yet support
36864
37268
  const assetId = decoded;
36865
37269
  [decoded, o] = new TxPointerCoder().decode(data, o);
36866
37270
  const txPointer = decoded;
36867
- [decoded, o] = new NumberCoder("u8").decode(data, o);
37271
+ [decoded, o] = new NumberCoder("u16").decode(data, o);
36868
37272
  const witnessIndex = Number(decoded);
36869
- [decoded, o] = new NumberCoder("u32").decode(data, o);
36870
- const maturity = decoded;
36871
37273
  [decoded, o] = new BigNumberCoder("u64").decode(data, o);
36872
37274
  const predicateGasUsed = decoded;
36873
- [decoded, o] = new NumberCoder("u32").decode(data, o);
37275
+ [decoded, o] = new BigNumberCoder("u64").decode(data, o);
36874
37276
  const predicateLength = decoded;
36875
- [decoded, o] = new NumberCoder("u32").decode(data, o);
37277
+ [decoded, o] = new BigNumberCoder("u64").decode(data, o);
36876
37278
  const predicateDataLength = decoded;
36877
- [decoded, o] = new ByteArrayCoder(predicateLength).decode(data, o);
37279
+ [decoded, o] = new ByteArrayCoder(predicateLength.toNumber()).decode(data, o);
36878
37280
  const predicate = decoded;
36879
- [decoded, o] = new ByteArrayCoder(predicateDataLength).decode(data, o);
37281
+ [decoded, o] = new ByteArrayCoder(predicateDataLength.toNumber()).decode(data, o);
36880
37282
  const predicateData = decoded;
36881
37283
  return [
36882
37284
  {
@@ -36888,7 +37290,6 @@ This unreleased fuel-core build may include features and updates not yet support
36888
37290
  assetId,
36889
37291
  txPointer,
36890
37292
  witnessIndex,
36891
- maturity,
36892
37293
  predicateGasUsed,
36893
37294
  predicateLength,
36894
37295
  predicateDataLength,
@@ -36906,7 +37307,7 @@ This unreleased fuel-core build may include features and updates not yet support
36906
37307
  encode(value) {
36907
37308
  const parts = [];
36908
37309
  parts.push(new B256Coder().encode(value.txID));
36909
- parts.push(new NumberCoder("u8").encode(value.outputIndex));
37310
+ parts.push(new NumberCoder("u16").encode(value.outputIndex));
36910
37311
  parts.push(new B256Coder().encode(value.balanceRoot));
36911
37312
  parts.push(new B256Coder().encode(value.stateRoot));
36912
37313
  parts.push(new TxPointerCoder().encode(value.txPointer));
@@ -36918,7 +37319,7 @@ This unreleased fuel-core build may include features and updates not yet support
36918
37319
  let o = offset;
36919
37320
  [decoded, o] = new B256Coder().decode(data, o);
36920
37321
  const txID = decoded;
36921
- [decoded, o] = new NumberCoder("u8").decode(data, o);
37322
+ [decoded, o] = new NumberCoder("u16").decode(data, o);
36922
37323
  const outputIndex = decoded;
36923
37324
  [decoded, o] = new B256Coder().decode(data, o);
36924
37325
  const balanceRoot = decoded;
@@ -36967,14 +37368,16 @@ This unreleased fuel-core build may include features and updates not yet support
36967
37368
  parts.push(new ByteArrayCoder(32).encode(value.recipient));
36968
37369
  parts.push(new BigNumberCoder("u64").encode(value.amount));
36969
37370
  parts.push(new ByteArrayCoder(32).encode(value.nonce));
36970
- parts.push(new NumberCoder("u8").encode(value.witnessIndex));
37371
+ parts.push(new NumberCoder("u16").encode(value.witnessIndex));
36971
37372
  parts.push(new BigNumberCoder("u64").encode(value.predicateGasUsed));
36972
- parts.push(new NumberCoder("u32").encode(data.length));
36973
- parts.push(new NumberCoder("u32").encode(value.predicateLength));
36974
- parts.push(new NumberCoder("u32").encode(value.predicateDataLength));
37373
+ parts.push(new BigNumberCoder("u64").encode(data.length));
37374
+ parts.push(new BigNumberCoder("u64").encode(value.predicateLength));
37375
+ parts.push(new BigNumberCoder("u64").encode(value.predicateDataLength));
36975
37376
  parts.push(new ByteArrayCoder(data.length).encode(data));
36976
- parts.push(new ByteArrayCoder(value.predicateLength).encode(value.predicate));
36977
- parts.push(new ByteArrayCoder(value.predicateDataLength).encode(value.predicateData));
37377
+ parts.push(new ByteArrayCoder(value.predicateLength.toNumber()).encode(value.predicate));
37378
+ parts.push(
37379
+ new ByteArrayCoder(value.predicateDataLength.toNumber()).encode(value.predicateData)
37380
+ );
36978
37381
  return concat(parts);
36979
37382
  }
36980
37383
  static decodeData(messageData) {
@@ -36994,21 +37397,21 @@ This unreleased fuel-core build may include features and updates not yet support
36994
37397
  const amount = decoded;
36995
37398
  [decoded, o] = new B256Coder().decode(data, o);
36996
37399
  const nonce = decoded;
36997
- [decoded, o] = new NumberCoder("u8").decode(data, o);
37400
+ [decoded, o] = new NumberCoder("u16").decode(data, o);
36998
37401
  const witnessIndex = Number(decoded);
36999
37402
  [decoded, o] = new BigNumberCoder("u64").decode(data, o);
37000
37403
  const predicateGasUsed = decoded;
37001
37404
  [decoded, o] = new NumberCoder("u32").decode(data, o);
37002
37405
  const dataLength2 = decoded;
37003
- [decoded, o] = new NumberCoder("u32").decode(data, o);
37406
+ [decoded, o] = new BigNumberCoder("u64").decode(data, o);
37004
37407
  const predicateLength = decoded;
37005
- [decoded, o] = new NumberCoder("u32").decode(data, o);
37408
+ [decoded, o] = new BigNumberCoder("u64").decode(data, o);
37006
37409
  const predicateDataLength = decoded;
37007
37410
  [decoded, o] = new ByteArrayCoder(dataLength2).decode(data, o);
37008
37411
  const messageData = decoded;
37009
- [decoded, o] = new ByteArrayCoder(predicateLength).decode(data, o);
37412
+ [decoded, o] = new ByteArrayCoder(predicateLength.toNumber()).decode(data, o);
37010
37413
  const predicate = decoded;
37011
- [decoded, o] = new ByteArrayCoder(predicateDataLength).decode(data, o);
37414
+ [decoded, o] = new ByteArrayCoder(predicateDataLength.toNumber()).decode(data, o);
37012
37415
  const predicateData = decoded;
37013
37416
  return [
37014
37417
  {
@@ -37320,7 +37723,7 @@ This unreleased fuel-core build may include features and updates not yet support
37320
37723
  }
37321
37724
  };
37322
37725
  var PolicyType = /* @__PURE__ */ ((PolicyType2) => {
37323
- PolicyType2[PolicyType2["GasPrice"] = 1] = "GasPrice";
37726
+ PolicyType2[PolicyType2["Tip"] = 1] = "Tip";
37324
37727
  PolicyType2[PolicyType2["WitnessLimit"] = 2] = "WitnessLimit";
37325
37728
  PolicyType2[PolicyType2["Maturity"] = 4] = "Maturity";
37326
37729
  PolicyType2[PolicyType2["MaxFee"] = 8] = "MaxFee";
@@ -37368,9 +37771,9 @@ This unreleased fuel-core build may include features and updates not yet support
37368
37771
  let o = offset;
37369
37772
  const policies = [];
37370
37773
  if (policyTypes & 1) {
37371
- const [gasPrice, nextOffset] = new BigNumberCoder("u64").decode(data, o);
37774
+ const [tip, nextOffset] = new BigNumberCoder("u64").decode(data, o);
37372
37775
  o = nextOffset;
37373
- policies.push({ type: 1, data: gasPrice });
37776
+ policies.push({ type: 1, data: tip });
37374
37777
  }
37375
37778
  if (policyTypes & 2) {
37376
37779
  const [witnessLimit, nextOffset] = new BigNumberCoder("u64").decode(data, o);
@@ -37602,15 +38005,15 @@ This unreleased fuel-core build may include features and updates not yet support
37602
38005
  encode(value) {
37603
38006
  const parts = [];
37604
38007
  parts.push(new BigNumberCoder("u64").encode(value.scriptGasLimit));
37605
- parts.push(new NumberCoder("u32").encode(value.scriptLength));
37606
- parts.push(new NumberCoder("u32").encode(value.scriptDataLength));
37607
- parts.push(new NumberCoder("u32").encode(value.policyTypes));
37608
- parts.push(new NumberCoder("u8").encode(value.inputsCount));
37609
- parts.push(new NumberCoder("u8").encode(value.outputsCount));
37610
- parts.push(new NumberCoder("u8").encode(value.witnessesCount));
37611
38008
  parts.push(new B256Coder().encode(value.receiptsRoot));
37612
- parts.push(new ByteArrayCoder(value.scriptLength).encode(value.script));
37613
- parts.push(new ByteArrayCoder(value.scriptDataLength).encode(value.scriptData));
38009
+ parts.push(new BigNumberCoder("u64").encode(value.scriptLength));
38010
+ parts.push(new BigNumberCoder("u64").encode(value.scriptDataLength));
38011
+ parts.push(new NumberCoder("u32").encode(value.policyTypes));
38012
+ parts.push(new NumberCoder("u16").encode(value.inputsCount));
38013
+ parts.push(new NumberCoder("u16").encode(value.outputsCount));
38014
+ parts.push(new NumberCoder("u16").encode(value.witnessesCount));
38015
+ parts.push(new ByteArrayCoder(value.scriptLength.toNumber()).encode(value.script));
38016
+ parts.push(new ByteArrayCoder(value.scriptDataLength.toNumber()).encode(value.scriptData));
37614
38017
  parts.push(new PoliciesCoder().encode(value.policies));
37615
38018
  parts.push(new ArrayCoder(new InputCoder(), value.inputsCount).encode(value.inputs));
37616
38019
  parts.push(new ArrayCoder(new OutputCoder(), value.outputsCount).encode(value.outputs));
@@ -37622,23 +38025,23 @@ This unreleased fuel-core build may include features and updates not yet support
37622
38025
  let o = offset;
37623
38026
  [decoded, o] = new BigNumberCoder("u64").decode(data, o);
37624
38027
  const scriptGasLimit = decoded;
37625
- [decoded, o] = new NumberCoder("u32").decode(data, o);
38028
+ [decoded, o] = new B256Coder().decode(data, o);
38029
+ const receiptsRoot = decoded;
38030
+ [decoded, o] = new BigNumberCoder("u64").decode(data, o);
37626
38031
  const scriptLength = decoded;
37627
- [decoded, o] = new NumberCoder("u32").decode(data, o);
38032
+ [decoded, o] = new BigNumberCoder("u64").decode(data, o);
37628
38033
  const scriptDataLength = decoded;
37629
38034
  [decoded, o] = new NumberCoder("u32").decode(data, o);
37630
38035
  const policyTypes = decoded;
37631
- [decoded, o] = new NumberCoder("u8").decode(data, o);
38036
+ [decoded, o] = new NumberCoder("u16").decode(data, o);
37632
38037
  const inputsCount = decoded;
37633
- [decoded, o] = new NumberCoder("u8").decode(data, o);
38038
+ [decoded, o] = new NumberCoder("u16").decode(data, o);
37634
38039
  const outputsCount = decoded;
37635
- [decoded, o] = new NumberCoder("u8").decode(data, o);
38040
+ [decoded, o] = new NumberCoder("u16").decode(data, o);
37636
38041
  const witnessesCount = decoded;
37637
- [decoded, o] = new B256Coder().decode(data, o);
37638
- const receiptsRoot = decoded;
37639
- [decoded, o] = new ByteArrayCoder(scriptLength).decode(data, o);
38042
+ [decoded, o] = new ByteArrayCoder(scriptLength.toNumber()).decode(data, o);
37640
38043
  const script = decoded;
37641
- [decoded, o] = new ByteArrayCoder(scriptDataLength).decode(data, o);
38044
+ [decoded, o] = new ByteArrayCoder(scriptDataLength.toNumber()).decode(data, o);
37642
38045
  const scriptData = decoded;
37643
38046
  [decoded, o] = new PoliciesCoder().decode(data, o, policyTypes);
37644
38047
  const policies = decoded;
@@ -37676,18 +38079,19 @@ This unreleased fuel-core build may include features and updates not yet support
37676
38079
  }
37677
38080
  encode(value) {
37678
38081
  const parts = [];
37679
- parts.push(new NumberCoder("u32").encode(value.bytecodeLength));
37680
- parts.push(new NumberCoder("u8").encode(value.bytecodeWitnessIndex));
37681
- parts.push(new NumberCoder("u32").encode(value.policyTypes));
37682
- parts.push(new NumberCoder("u16").encode(value.storageSlotsCount));
37683
- parts.push(new NumberCoder("u8").encode(value.inputsCount));
37684
- parts.push(new NumberCoder("u8").encode(value.outputsCount));
37685
- parts.push(new NumberCoder("u8").encode(value.witnessesCount));
38082
+ parts.push(new NumberCoder("u16").encode(value.bytecodeWitnessIndex));
37686
38083
  parts.push(new B256Coder().encode(value.salt));
37687
- parts.push(new PoliciesCoder().encode(value.policies));
38084
+ parts.push(new BigNumberCoder("u64").encode(value.storageSlotsCount));
38085
+ parts.push(new NumberCoder("u32").encode(value.policyTypes));
38086
+ parts.push(new NumberCoder("u16").encode(value.inputsCount));
38087
+ parts.push(new NumberCoder("u16").encode(value.outputsCount));
38088
+ parts.push(new NumberCoder("u16").encode(value.witnessesCount));
37688
38089
  parts.push(
37689
- new ArrayCoder(new StorageSlotCoder(), value.storageSlotsCount).encode(value.storageSlots)
38090
+ new ArrayCoder(new StorageSlotCoder(), value.storageSlotsCount.toNumber()).encode(
38091
+ value.storageSlots
38092
+ )
37690
38093
  );
38094
+ parts.push(new PoliciesCoder().encode(value.policies));
37691
38095
  parts.push(new ArrayCoder(new InputCoder(), value.inputsCount).encode(value.inputs));
37692
38096
  parts.push(new ArrayCoder(new OutputCoder(), value.outputsCount).encode(value.outputs));
37693
38097
  parts.push(new ArrayCoder(new WitnessCoder(), value.witnessesCount).encode(value.witnesses));
@@ -37696,26 +38100,27 @@ This unreleased fuel-core build may include features and updates not yet support
37696
38100
  decode(data, offset) {
37697
38101
  let decoded;
37698
38102
  let o = offset;
37699
- [decoded, o] = new NumberCoder("u32").decode(data, o);
37700
- const bytecodeLength = decoded;
37701
- [decoded, o] = new NumberCoder("u8").decode(data, o);
38103
+ [decoded, o] = new NumberCoder("u16").decode(data, o);
37702
38104
  const bytecodeWitnessIndex = decoded;
38105
+ [decoded, o] = new B256Coder().decode(data, o);
38106
+ const salt = decoded;
38107
+ [decoded, o] = new BigNumberCoder("u64").decode(data, o);
38108
+ const storageSlotsCount = decoded;
37703
38109
  [decoded, o] = new NumberCoder("u32").decode(data, o);
37704
38110
  const policyTypes = decoded;
37705
38111
  [decoded, o] = new NumberCoder("u16").decode(data, o);
37706
- const storageSlotsCount = decoded;
37707
- [decoded, o] = new NumberCoder("u8").decode(data, o);
37708
38112
  const inputsCount = decoded;
37709
- [decoded, o] = new NumberCoder("u8").decode(data, o);
38113
+ [decoded, o] = new NumberCoder("u16").decode(data, o);
37710
38114
  const outputsCount = decoded;
37711
- [decoded, o] = new NumberCoder("u8").decode(data, o);
38115
+ [decoded, o] = new NumberCoder("u16").decode(data, o);
37712
38116
  const witnessesCount = decoded;
37713
- [decoded, o] = new B256Coder().decode(data, o);
37714
- const salt = decoded;
38117
+ [decoded, o] = new ArrayCoder(new StorageSlotCoder(), storageSlotsCount.toNumber()).decode(
38118
+ data,
38119
+ o
38120
+ );
38121
+ const storageSlots = decoded;
37715
38122
  [decoded, o] = new PoliciesCoder().decode(data, o, policyTypes);
37716
38123
  const policies = decoded;
37717
- [decoded, o] = new ArrayCoder(new StorageSlotCoder(), storageSlotsCount).decode(data, o);
37718
- const storageSlots = decoded;
37719
38124
  [decoded, o] = new ArrayCoder(new InputCoder(), inputsCount).decode(data, o);
37720
38125
  const inputs = decoded;
37721
38126
  [decoded, o] = new ArrayCoder(new OutputCoder(), outputsCount).decode(data, o);
@@ -37725,7 +38130,6 @@ This unreleased fuel-core build may include features and updates not yet support
37725
38130
  return [
37726
38131
  {
37727
38132
  type: 1,
37728
- bytecodeLength,
37729
38133
  bytecodeWitnessIndex,
37730
38134
  policyTypes,
37731
38135
  storageSlotsCount,
@@ -37754,6 +38158,7 @@ This unreleased fuel-core build may include features and updates not yet support
37754
38158
  parts.push(new OutputContractCoder().encode(value.outputContract));
37755
38159
  parts.push(new BigNumberCoder("u64").encode(value.mintAmount));
37756
38160
  parts.push(new B256Coder().encode(value.mintAssetId));
38161
+ parts.push(new BigNumberCoder("u64").encode(value.gasPrice));
37757
38162
  return concat(parts);
37758
38163
  }
37759
38164
  decode(data, offset) {
@@ -37769,6 +38174,8 @@ This unreleased fuel-core build may include features and updates not yet support
37769
38174
  const mintAmount = decoded;
37770
38175
  [decoded, o] = new B256Coder().decode(data, o);
37771
38176
  const mintAssetId = decoded;
38177
+ [decoded, o] = new BigNumberCoder("u64").decode(data, o);
38178
+ const gasPrice = decoded;
37772
38179
  return [
37773
38180
  {
37774
38181
  type: 2,
@@ -37776,7 +38183,8 @@ This unreleased fuel-core build may include features and updates not yet support
37776
38183
  inputContract,
37777
38184
  outputContract,
37778
38185
  mintAmount,
37779
- mintAssetId
38186
+ mintAssetId,
38187
+ gasPrice
37780
38188
  },
37781
38189
  o
37782
38190
  ];
@@ -38083,159 +38491,6 @@ This unreleased fuel-core build may include features and updates not yet support
38083
38491
  // src/providers/provider.ts
38084
38492
  var import_graphql_request = __toESM(require_dist2());
38085
38493
 
38086
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isPlaceholder.js
38087
- function _isPlaceholder(a) {
38088
- return a != null && typeof a === "object" && a["@@functional/placeholder"] === true;
38089
- }
38090
-
38091
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_curry1.js
38092
- function _curry1(fn) {
38093
- return function f1(a) {
38094
- if (arguments.length === 0 || _isPlaceholder(a)) {
38095
- return f1;
38096
- } else {
38097
- return fn.apply(this, arguments);
38098
- }
38099
- };
38100
- }
38101
-
38102
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isArray.js
38103
- var isArray_default = Array.isArray || function _isArray(val) {
38104
- return val != null && val.length >= 0 && Object.prototype.toString.call(val) === "[object Array]";
38105
- };
38106
-
38107
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/type.js
38108
- var type = /* @__PURE__ */ _curry1(function type2(val) {
38109
- return val === null ? "Null" : val === void 0 ? "Undefined" : Object.prototype.toString.call(val).slice(8, -1);
38110
- });
38111
- var type_default = type;
38112
-
38113
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_toISOString.js
38114
- var pad = function pad2(n) {
38115
- return (n < 10 ? "0" : "") + n;
38116
- };
38117
- var _toISOString = typeof Date.prototype.toISOString === "function" ? function _toISOString2(d) {
38118
- return d.toISOString();
38119
- } : function _toISOString3(d) {
38120
- 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";
38121
- };
38122
-
38123
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isInteger.js
38124
- var isInteger_default = Number.isInteger || function _isInteger(n) {
38125
- return n << 0 === n;
38126
- };
38127
-
38128
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_cloneRegExp.js
38129
- function _cloneRegExp(pattern) {
38130
- 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" : ""));
38131
- }
38132
-
38133
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_clone.js
38134
- function _clone(value, deep, map) {
38135
- map || (map = new _ObjectMap());
38136
- if (_isPrimitive(value)) {
38137
- return value;
38138
- }
38139
- var copy = function copy2(copiedValue) {
38140
- var cachedCopy = map.get(value);
38141
- if (cachedCopy) {
38142
- return cachedCopy;
38143
- }
38144
- map.set(value, copiedValue);
38145
- for (var key in value) {
38146
- if (Object.prototype.hasOwnProperty.call(value, key)) {
38147
- copiedValue[key] = deep ? _clone(value[key], true, map) : value[key];
38148
- }
38149
- }
38150
- return copiedValue;
38151
- };
38152
- switch (type_default(value)) {
38153
- case "Object":
38154
- return copy(Object.create(Object.getPrototypeOf(value)));
38155
- case "Array":
38156
- return copy([]);
38157
- case "Date":
38158
- return new Date(value.valueOf());
38159
- case "RegExp":
38160
- return _cloneRegExp(value);
38161
- case "Int8Array":
38162
- case "Uint8Array":
38163
- case "Uint8ClampedArray":
38164
- case "Int16Array":
38165
- case "Uint16Array":
38166
- case "Int32Array":
38167
- case "Uint32Array":
38168
- case "Float32Array":
38169
- case "Float64Array":
38170
- case "BigInt64Array":
38171
- case "BigUint64Array":
38172
- return value.slice();
38173
- default:
38174
- return value;
38175
- }
38176
- }
38177
- function _isPrimitive(param) {
38178
- var type3 = typeof param;
38179
- return param == null || type3 != "object" && type3 != "function";
38180
- }
38181
- var _ObjectMap = /* @__PURE__ */ function() {
38182
- function _ObjectMap2() {
38183
- this.map = {};
38184
- this.length = 0;
38185
- }
38186
- _ObjectMap2.prototype.set = function(key, value) {
38187
- const hashedKey = this.hash(key);
38188
- let bucket = this.map[hashedKey];
38189
- if (!bucket) {
38190
- this.map[hashedKey] = bucket = [];
38191
- }
38192
- bucket.push([key, value]);
38193
- this.length += 1;
38194
- };
38195
- _ObjectMap2.prototype.hash = function(key) {
38196
- let hashedKey = [];
38197
- for (var value in key) {
38198
- hashedKey.push(Object.prototype.toString.call(key[value]));
38199
- }
38200
- return hashedKey.join();
38201
- };
38202
- _ObjectMap2.prototype.get = function(key) {
38203
- if (this.length <= 180) {
38204
- for (const p in this.map) {
38205
- const bucket2 = this.map[p];
38206
- for (let i = 0; i < bucket2.length; i += 1) {
38207
- const element = bucket2[i];
38208
- if (element[0] === key) {
38209
- return element[1];
38210
- }
38211
- }
38212
- }
38213
- return;
38214
- }
38215
- const hashedKey = this.hash(key);
38216
- const bucket = this.map[hashedKey];
38217
- if (!bucket) {
38218
- return;
38219
- }
38220
- for (let i = 0; i < bucket.length; i += 1) {
38221
- const element = bucket[i];
38222
- if (element[0] === key) {
38223
- return element[1];
38224
- }
38225
- }
38226
- };
38227
- return _ObjectMap2;
38228
- }();
38229
-
38230
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/clone.js
38231
- var clone2 = /* @__PURE__ */ _curry1(function clone3(value) {
38232
- return value != null && typeof value.clone === "function" ? value.clone() : _clone(value, true);
38233
- });
38234
- var clone_default = clone2;
38235
-
38236
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/trim.js
38237
- var hasProtoTrim = typeof String.prototype.trim === "function";
38238
-
38239
38494
  // ../../node_modules/.pnpm/tslib@2.6.0/node_modules/tslib/tslib.es6.mjs
38240
38495
  var __assign = function() {
38241
38496
  __assign = Object.assign || function __assign2(t) {
@@ -41403,14 +41658,10 @@ spurious results.`);
41403
41658
  // src/providers/__generated__/operations.ts
41404
41659
  var ReceiptFragmentFragmentDoc = lib_default2`
41405
41660
  fragment receiptFragment on Receipt {
41406
- contract {
41407
- id
41408
- }
41661
+ id
41409
41662
  pc
41410
41663
  is
41411
- to {
41412
- id
41413
- }
41664
+ to
41414
41665
  toAddress
41415
41666
  amount
41416
41667
  assetId
@@ -41448,10 +41699,16 @@ spurious results.`);
41448
41699
  id
41449
41700
  }
41450
41701
  time
41702
+ receipts {
41703
+ ...receiptFragment
41704
+ }
41451
41705
  programState {
41452
41706
  returnType
41453
41707
  data
41454
41708
  }
41709
+ receipts {
41710
+ ...receiptFragment
41711
+ }
41455
41712
  }
41456
41713
  ... on FailureStatus {
41457
41714
  block {
@@ -41459,26 +41716,24 @@ spurious results.`);
41459
41716
  }
41460
41717
  time
41461
41718
  reason
41719
+ receipts {
41720
+ ...receiptFragment
41721
+ }
41462
41722
  }
41463
41723
  ... on SqueezedOutStatus {
41464
41724
  reason
41465
41725
  }
41466
41726
  }
41467
- `;
41727
+ ${ReceiptFragmentFragmentDoc}`;
41468
41728
  var TransactionFragmentFragmentDoc = lib_default2`
41469
41729
  fragment transactionFragment on Transaction {
41470
41730
  id
41471
41731
  rawPayload
41472
- gasPrice
41473
- receipts {
41474
- ...receiptFragment
41475
- }
41476
41732
  status {
41477
41733
  ...transactionStatusFragment
41478
41734
  }
41479
41735
  }
41480
- ${ReceiptFragmentFragmentDoc}
41481
- ${TransactionStatusFragmentFragmentDoc}`;
41736
+ ${TransactionStatusFragmentFragmentDoc}`;
41482
41737
  var InputEstimatePredicatesFragmentFragmentDoc = lib_default2`
41483
41738
  fragment inputEstimatePredicatesFragment on Input {
41484
41739
  ... on InputCoin {
@@ -41496,6 +41751,46 @@ ${TransactionStatusFragmentFragmentDoc}`;
41496
41751
  }
41497
41752
  }
41498
41753
  ${InputEstimatePredicatesFragmentFragmentDoc}`;
41754
+ var DryRunFailureStatusFragmentFragmentDoc = lib_default2`
41755
+ fragment dryRunFailureStatusFragment on DryRunFailureStatus {
41756
+ reason
41757
+ programState {
41758
+ returnType
41759
+ data
41760
+ }
41761
+ }
41762
+ `;
41763
+ var DryRunSuccessStatusFragmentFragmentDoc = lib_default2`
41764
+ fragment dryRunSuccessStatusFragment on DryRunSuccessStatus {
41765
+ programState {
41766
+ returnType
41767
+ data
41768
+ }
41769
+ }
41770
+ `;
41771
+ var DryRunTransactionStatusFragmentFragmentDoc = lib_default2`
41772
+ fragment dryRunTransactionStatusFragment on DryRunTransactionStatus {
41773
+ ... on DryRunFailureStatus {
41774
+ ...dryRunFailureStatusFragment
41775
+ }
41776
+ ... on DryRunSuccessStatus {
41777
+ ...dryRunSuccessStatusFragment
41778
+ }
41779
+ }
41780
+ ${DryRunFailureStatusFragmentFragmentDoc}
41781
+ ${DryRunSuccessStatusFragmentFragmentDoc}`;
41782
+ var DryRunTransactionExecutionStatusFragmentFragmentDoc = lib_default2`
41783
+ fragment dryRunTransactionExecutionStatusFragment on DryRunTransactionExecutionStatus {
41784
+ id
41785
+ status {
41786
+ ...dryRunTransactionStatusFragment
41787
+ }
41788
+ receipts {
41789
+ ...receiptFragment
41790
+ }
41791
+ }
41792
+ ${DryRunTransactionStatusFragmentFragmentDoc}
41793
+ ${ReceiptFragmentFragmentDoc}`;
41499
41794
  var CoinFragmentFragmentDoc = lib_default2`
41500
41795
  fragment coinFragment on Coin {
41501
41796
  __typename
@@ -41503,7 +41798,6 @@ ${TransactionStatusFragmentFragmentDoc}`;
41503
41798
  owner
41504
41799
  amount
41505
41800
  assetId
41506
- maturity
41507
41801
  blockCreated
41508
41802
  txCreatedIdx
41509
41803
  }
@@ -41548,7 +41842,6 @@ ${TransactionStatusFragmentFragmentDoc}`;
41548
41842
  prevRoot
41549
41843
  time
41550
41844
  applicationHash
41551
- messageReceiptRoot
41552
41845
  messageReceiptCount
41553
41846
  }
41554
41847
  commitBlockHeader {
@@ -41560,7 +41853,6 @@ ${TransactionStatusFragmentFragmentDoc}`;
41560
41853
  prevRoot
41561
41854
  time
41562
41855
  applicationHash
41563
- messageReceiptRoot
41564
41856
  messageReceiptCount
41565
41857
  }
41566
41858
  sender
@@ -41580,8 +41872,8 @@ ${TransactionStatusFragmentFragmentDoc}`;
41580
41872
  var BlockFragmentFragmentDoc = lib_default2`
41581
41873
  fragment blockFragment on Block {
41582
41874
  id
41875
+ height
41583
41876
  header {
41584
- height
41585
41877
  time
41586
41878
  }
41587
41879
  transactions {
@@ -41639,6 +41931,11 @@ ${TransactionStatusFragmentFragmentDoc}`;
41639
41931
  `;
41640
41932
  var GasCostsFragmentFragmentDoc = lib_default2`
41641
41933
  fragment GasCostsFragment on GasCosts {
41934
+ version {
41935
+ ... on Version {
41936
+ value
41937
+ }
41938
+ }
41642
41939
  add
41643
41940
  addi
41644
41941
  aloc
@@ -41651,7 +41948,6 @@ ${TransactionStatusFragmentFragmentDoc}`;
41651
41948
  cb
41652
41949
  cfei
41653
41950
  cfsi
41654
- croo
41655
41951
  div
41656
41952
  divi
41657
41953
  ecr1
@@ -41734,6 +42030,9 @@ ${TransactionStatusFragmentFragmentDoc}`;
41734
42030
  ccp {
41735
42031
  ...DependentCostFragment
41736
42032
  }
42033
+ croo {
42034
+ ...DependentCostFragment
42035
+ }
41737
42036
  csiz {
41738
42037
  ...DependentCostFragment
41739
42038
  }
@@ -41793,6 +42092,11 @@ ${TransactionStatusFragmentFragmentDoc}`;
41793
42092
  ${DependentCostFragmentFragmentDoc}`;
41794
42093
  var ConsensusParametersFragmentFragmentDoc = lib_default2`
41795
42094
  fragment consensusParametersFragment on ConsensusParameters {
42095
+ version {
42096
+ ... on Version {
42097
+ value
42098
+ }
42099
+ }
41796
42100
  txParams {
41797
42101
  ...TxParametersFragment
41798
42102
  }
@@ -41852,18 +42156,9 @@ ${ConsensusParametersFragmentFragmentDoc}`;
41852
42156
  fragment nodeInfoFragment on NodeInfo {
41853
42157
  utxoValidation
41854
42158
  vmBacktrace
41855
- minGasPrice
41856
42159
  maxTx
41857
42160
  maxDepth
41858
42161
  nodeVersion
41859
- peers {
41860
- id
41861
- addresses
41862
- clientVersion
41863
- blockHeight
41864
- lastHeartbeatMs
41865
- appScore
41866
- }
41867
42162
  }
41868
42163
  `;
41869
42164
  var GetVersionDocument = lib_default2`
@@ -41898,13 +42193,9 @@ ${ConsensusParametersFragmentFragmentDoc}`;
41898
42193
  query getTransactionWithReceipts($transactionId: TransactionId!) {
41899
42194
  transaction(id: $transactionId) {
41900
42195
  ...transactionFragment
41901
- receipts {
41902
- ...receiptFragment
41903
- }
41904
42196
  }
41905
42197
  }
41906
- ${TransactionFragmentFragmentDoc}
41907
- ${ReceiptFragmentFragmentDoc}`;
42198
+ ${TransactionFragmentFragmentDoc}`;
41908
42199
  var GetTransactionsDocument = lib_default2`
41909
42200
  query getTransactions($after: String, $before: String, $first: Int, $last: Int) {
41910
42201
  transactions(after: $after, before: $before, first: $first, last: $last) {
@@ -42032,6 +42323,20 @@ ${MessageCoinFragmentFragmentDoc}`;
42032
42323
  }
42033
42324
  }
42034
42325
  ${BalanceFragmentFragmentDoc}`;
42326
+ var GetLatestGasPriceDocument = lib_default2`
42327
+ query getLatestGasPrice {
42328
+ latestGasPrice {
42329
+ gasPrice
42330
+ }
42331
+ }
42332
+ `;
42333
+ var EstimateGasPriceDocument = lib_default2`
42334
+ query estimateGasPrice($blockHorizon: U32!) {
42335
+ estimateGasPrice(blockHorizon: $blockHorizon) {
42336
+ gasPrice
42337
+ }
42338
+ }
42339
+ `;
42035
42340
  var GetBalancesDocument = lib_default2`
42036
42341
  query getBalances($filter: BalanceFilterInput!, $after: String, $before: String, $first: Int, $last: Int) {
42037
42342
  balances(
@@ -42086,12 +42391,12 @@ ${MessageCoinFragmentFragmentDoc}`;
42086
42391
  }
42087
42392
  `;
42088
42393
  var DryRunDocument = lib_default2`
42089
- mutation dryRun($encodedTransaction: HexString!, $utxoValidation: Boolean) {
42090
- dryRun(tx: $encodedTransaction, utxoValidation: $utxoValidation) {
42091
- ...receiptFragment
42394
+ mutation dryRun($encodedTransactions: [HexString!]!, $utxoValidation: Boolean) {
42395
+ dryRun(txs: $encodedTransactions, utxoValidation: $utxoValidation) {
42396
+ ...dryRunTransactionExecutionStatusFragment
42092
42397
  }
42093
42398
  }
42094
- ${ReceiptFragmentFragmentDoc}`;
42399
+ ${DryRunTransactionExecutionStatusFragmentFragmentDoc}`;
42095
42400
  var SubmitDocument = lib_default2`
42096
42401
  mutation submit($encodedTransaction: HexString!) {
42097
42402
  submit(tx: $encodedTransaction) {
@@ -42174,6 +42479,12 @@ ${MessageCoinFragmentFragmentDoc}`;
42174
42479
  getBalance(variables, options) {
42175
42480
  return requester(GetBalanceDocument, variables, options);
42176
42481
  },
42482
+ getLatestGasPrice(variables, options) {
42483
+ return requester(GetLatestGasPriceDocument, variables, options);
42484
+ },
42485
+ estimateGasPrice(variables, options) {
42486
+ return requester(EstimateGasPriceDocument, variables, options);
42487
+ },
42177
42488
  getBalances(variables, options) {
42178
42489
  return requester(GetBalancesDocument, variables, options);
42179
42490
  },
@@ -42241,11 +42552,14 @@ ${MessageCoinFragmentFragmentDoc}`;
42241
42552
  let data;
42242
42553
  let errors;
42243
42554
  try {
42244
- ({ data, errors } = JSON.parse(text.replace(/^data:/, "")));
42555
+ const sanitizedText = text.replace(/\s/g, "");
42556
+ ({ data, errors } = JSON.parse(sanitizedText.replace(/^data:/, "")));
42245
42557
  } catch (e) {
42246
42558
  throw new FuelError(
42247
42559
  ErrorCode.STREAM_PARSING_ERROR,
42248
- `Error while parsing stream data response: ${text}`
42560
+ `Error while parsing stream data response: ${text}
42561
+
42562
+ Thrown error: ${e}`
42249
42563
  );
42250
42564
  }
42251
42565
  if (Array.isArray(errors)) {
@@ -42339,7 +42653,7 @@ ${MessageCoinFragmentFragmentDoc}`;
42339
42653
  return {
42340
42654
  type: InputType.Coin,
42341
42655
  txID: hexlify(arrayify(value.id).slice(0, 32)),
42342
- outputIndex: arrayify(value.id)[32],
42656
+ outputIndex: toNumber2(arrayify(value.id).slice(32, 34)),
42343
42657
  owner: hexlify(value.owner),
42344
42658
  amount: bn(value.amount),
42345
42659
  assetId: hexlify(value.assetId),
@@ -42348,10 +42662,9 @@ ${MessageCoinFragmentFragmentDoc}`;
42348
42662
  txIndex: toNumber2(arrayify(value.txPointer).slice(8, 16))
42349
42663
  },
42350
42664
  witnessIndex: value.witnessIndex,
42351
- maturity: value.maturity ?? 0,
42352
42665
  predicateGasUsed: bn(value.predicateGasUsed),
42353
- predicateLength: predicate.length,
42354
- predicateDataLength: predicateData.length,
42666
+ predicateLength: bn(predicate.length),
42667
+ predicateDataLength: bn(predicateData.length),
42355
42668
  predicate: hexlify(predicate),
42356
42669
  predicateData: hexlify(predicateData)
42357
42670
  };
@@ -42382,8 +42695,8 @@ ${MessageCoinFragmentFragmentDoc}`;
42382
42695
  nonce: hexlify(value.nonce),
42383
42696
  witnessIndex: value.witnessIndex,
42384
42697
  predicateGasUsed: bn(value.predicateGasUsed),
42385
- predicateLength: predicate.length,
42386
- predicateDataLength: predicateData.length,
42698
+ predicateLength: bn(predicate.length),
42699
+ predicateDataLength: bn(predicateData.length),
42387
42700
  predicate: hexlify(predicate),
42388
42701
  predicateData: hexlify(predicateData),
42389
42702
  data: hexlify(data),
@@ -42540,8 +42853,8 @@ ${MessageCoinFragmentFragmentDoc}`;
42540
42853
  case "CALL" /* Call */: {
42541
42854
  const callReceipt = {
42542
42855
  type: ReceiptType.Call,
42543
- from: hexOrZero(receipt.contract?.id),
42544
- to: hexOrZero(receipt?.to?.id),
42856
+ from: hexOrZero(receipt.id || receipt.contractId),
42857
+ to: hexOrZero(receipt?.to),
42545
42858
  amount: bn(receipt.amount),
42546
42859
  assetId: hexOrZero(receipt.assetId),
42547
42860
  gas: bn(receipt.gas),
@@ -42555,7 +42868,7 @@ ${MessageCoinFragmentFragmentDoc}`;
42555
42868
  case "RETURN" /* Return */: {
42556
42869
  const returnReceipt = {
42557
42870
  type: ReceiptType.Return,
42558
- id: hexOrZero(receipt.contract?.id),
42871
+ id: hexOrZero(receipt.id || receipt.contractId),
42559
42872
  val: bn(receipt.val),
42560
42873
  pc: bn(receipt.pc),
42561
42874
  is: bn(receipt.is)
@@ -42565,7 +42878,7 @@ ${MessageCoinFragmentFragmentDoc}`;
42565
42878
  case "RETURN_DATA" /* ReturnData */: {
42566
42879
  const returnDataReceipt = {
42567
42880
  type: ReceiptType.ReturnData,
42568
- id: hexOrZero(receipt.contract?.id),
42881
+ id: hexOrZero(receipt.id || receipt.contractId),
42569
42882
  ptr: bn(receipt.ptr),
42570
42883
  len: bn(receipt.len),
42571
42884
  digest: hexOrZero(receipt.digest),
@@ -42577,7 +42890,7 @@ ${MessageCoinFragmentFragmentDoc}`;
42577
42890
  case "PANIC" /* Panic */: {
42578
42891
  const panicReceipt = {
42579
42892
  type: ReceiptType.Panic,
42580
- id: hexOrZero(receipt.contract?.id),
42893
+ id: hexOrZero(receipt.id),
42581
42894
  reason: bn(receipt.reason),
42582
42895
  pc: bn(receipt.pc),
42583
42896
  is: bn(receipt.is),
@@ -42588,7 +42901,7 @@ ${MessageCoinFragmentFragmentDoc}`;
42588
42901
  case "REVERT" /* Revert */: {
42589
42902
  const revertReceipt = {
42590
42903
  type: ReceiptType.Revert,
42591
- id: hexOrZero(receipt.contract?.id),
42904
+ id: hexOrZero(receipt.id || receipt.contractId),
42592
42905
  val: bn(receipt.ra),
42593
42906
  pc: bn(receipt.pc),
42594
42907
  is: bn(receipt.is)
@@ -42598,7 +42911,7 @@ ${MessageCoinFragmentFragmentDoc}`;
42598
42911
  case "LOG" /* Log */: {
42599
42912
  const logReceipt = {
42600
42913
  type: ReceiptType.Log,
42601
- id: hexOrZero(receipt.contract?.id),
42914
+ id: hexOrZero(receipt.id || receipt.contractId),
42602
42915
  val0: bn(receipt.ra),
42603
42916
  val1: bn(receipt.rb),
42604
42917
  val2: bn(receipt.rc),
@@ -42611,7 +42924,7 @@ ${MessageCoinFragmentFragmentDoc}`;
42611
42924
  case "LOG_DATA" /* LogData */: {
42612
42925
  const logDataReceipt = {
42613
42926
  type: ReceiptType.LogData,
42614
- id: hexOrZero(receipt.contract?.id),
42927
+ id: hexOrZero(receipt.id || receipt.contractId),
42615
42928
  val0: bn(receipt.ra),
42616
42929
  val1: bn(receipt.rb),
42617
42930
  ptr: bn(receipt.ptr),
@@ -42625,8 +42938,8 @@ ${MessageCoinFragmentFragmentDoc}`;
42625
42938
  case "TRANSFER" /* Transfer */: {
42626
42939
  const transferReceipt = {
42627
42940
  type: ReceiptType.Transfer,
42628
- from: hexOrZero(receipt.contract?.id),
42629
- to: hexOrZero(receipt.toAddress || receipt?.to?.id),
42941
+ from: hexOrZero(receipt.id || receipt.contractId),
42942
+ to: hexOrZero(receipt.toAddress || receipt?.to),
42630
42943
  amount: bn(receipt.amount),
42631
42944
  assetId: hexOrZero(receipt.assetId),
42632
42945
  pc: bn(receipt.pc),
@@ -42637,8 +42950,8 @@ ${MessageCoinFragmentFragmentDoc}`;
42637
42950
  case "TRANSFER_OUT" /* TransferOut */: {
42638
42951
  const transferOutReceipt = {
42639
42952
  type: ReceiptType.TransferOut,
42640
- from: hexOrZero(receipt.contract?.id),
42641
- to: hexOrZero(receipt.toAddress || receipt.to?.id),
42953
+ from: hexOrZero(receipt.id || receipt.contractId),
42954
+ to: hexOrZero(receipt.toAddress || receipt.to),
42642
42955
  amount: bn(receipt.amount),
42643
42956
  assetId: hexOrZero(receipt.assetId),
42644
42957
  pc: bn(receipt.pc),
@@ -42681,7 +42994,7 @@ ${MessageCoinFragmentFragmentDoc}`;
42681
42994
  return receiptMessageOut;
42682
42995
  }
42683
42996
  case "MINT" /* Mint */: {
42684
- const contractId = hexOrZero(receipt.contract?.id);
42997
+ const contractId = hexOrZero(receipt.id || receipt.contractId);
42685
42998
  const subId = hexOrZero(receipt.subId);
42686
42999
  const assetId = ReceiptMintCoder.getAssetId(contractId, subId);
42687
43000
  const mintReceipt = {
@@ -42696,7 +43009,7 @@ ${MessageCoinFragmentFragmentDoc}`;
42696
43009
  return mintReceipt;
42697
43010
  }
42698
43011
  case "BURN" /* Burn */: {
42699
- const contractId = hexOrZero(receipt.contract?.id);
43012
+ const contractId = hexOrZero(receipt.id || receipt.contractId);
42700
43013
  const subId = hexOrZero(receipt.subId);
42701
43014
  const assetId = ReceiptBurnCoder.getAssetId(contractId, subId);
42702
43015
  const burnReceipt = {
@@ -42716,7 +43029,6 @@ ${MessageCoinFragmentFragmentDoc}`;
42716
43029
  }
42717
43030
 
42718
43031
  // src/providers/utils/gas.ts
42719
- var calculatePriceWithFactor = (gas, gasPrice, priceFactor) => bn(Math.ceil(gas.mul(gasPrice).toNumber() / priceFactor.toNumber()));
42720
43032
  var getGasUsedFromReceipts = (receipts) => {
42721
43033
  const scriptResult = receipts.filter(
42722
43034
  (receipt) => receipt.type === ReceiptType.ScriptResult
@@ -42737,18 +43049,28 @@ ${MessageCoinFragmentFragmentDoc}`;
42737
43049
  }
42738
43050
  function gasUsedByInputs(inputs, txBytesSize, gasCosts) {
42739
43051
  const witnessCache = [];
42740
- 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) => {
42741
43067
  if ("predicate" in input && input.predicate && input.predicate !== "0x") {
42742
43068
  return total.add(
42743
- 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))
42744
43070
  );
42745
43071
  }
42746
- if ("witnessIndex" in input && !witnessCache.includes(input.witnessIndex)) {
42747
- witnessCache.push(input.witnessIndex);
42748
- return total.add(gasCosts.ecr1);
42749
- }
42750
- return total;
42751
- }, bn());
43072
+ return total.add(gasCosts.ecr1);
43073
+ }, bn(0));
42752
43074
  return totalGas;
42753
43075
  }
42754
43076
  function getMinGas(params) {
@@ -42760,12 +43082,20 @@ ${MessageCoinFragmentFragmentDoc}`;
42760
43082
  return minGas;
42761
43083
  }
42762
43084
  function getMaxGas(params) {
42763
- 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;
42764
43093
  let remainingAllowedWitnessGas = bn(0);
42765
43094
  if (witnessLimit?.gt(0) && witnessLimit.gte(witnessesLength)) {
42766
43095
  remainingAllowedWitnessGas = bn(witnessLimit).sub(witnessesLength).mul(gasPerByte);
42767
43096
  }
42768
- return remainingAllowedWitnessGas.add(minGas).add(gasLimit);
43097
+ const maxGas = remainingAllowedWitnessGas.add(minGas).add(gasLimit);
43098
+ return maxGas.gte(maxGasPerTx) ? maxGasPerTx : maxGas;
42769
43099
  }
42770
43100
  function calculateMetadataGasForTxCreate({
42771
43101
  gasCosts,
@@ -42787,6 +43117,10 @@ ${MessageCoinFragmentFragmentDoc}`;
42787
43117
  }) {
42788
43118
  return resolveGasDependentCosts(txBytesSize, gasCosts.s256);
42789
43119
  }
43120
+ var calculateGasFee = (params) => {
43121
+ const { gas, gasPrice, priceFactor, tip } = params;
43122
+ return gas.mul(gasPrice).div(priceFactor).add(tip);
43123
+ };
42790
43124
 
42791
43125
  // src/providers/utils/json.ts
42792
43126
  function normalize2(object) {
@@ -42916,7 +43250,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42916
43250
  // src/providers/transaction-request/transaction-request.ts
42917
43251
  var BaseTransactionRequest = class {
42918
43252
  /** Gas price for transaction */
42919
- gasPrice;
43253
+ tip;
42920
43254
  /** Block until which tx cannot be included */
42921
43255
  maturity;
42922
43256
  /** The maximum fee payable by this transaction using BASE_ASSET. */
@@ -42935,7 +43269,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42935
43269
  * @param baseTransactionRequest - Optional object containing properties to initialize the transaction request.
42936
43270
  */
42937
43271
  constructor({
42938
- gasPrice,
43272
+ tip,
42939
43273
  maturity,
42940
43274
  maxFee,
42941
43275
  witnessLimit,
@@ -42943,7 +43277,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42943
43277
  outputs,
42944
43278
  witnesses
42945
43279
  } = {}) {
42946
- this.gasPrice = bn(gasPrice);
43280
+ this.tip = bn(tip);
42947
43281
  this.maturity = maturity ?? 0;
42948
43282
  this.witnessLimit = witnessLimit ? bn(witnessLimit) : void 0;
42949
43283
  this.maxFee = maxFee ? bn(maxFee) : void 0;
@@ -42954,9 +43288,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
42954
43288
  static getPolicyMeta(req) {
42955
43289
  let policyTypes = 0;
42956
43290
  const policies = [];
42957
- if (req.gasPrice) {
42958
- policyTypes += PolicyType.GasPrice;
42959
- 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 });
42960
43294
  }
42961
43295
  if (req.witnessLimit) {
42962
43296
  policyTypes += PolicyType.WitnessLimit;
@@ -43144,9 +43478,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43144
43478
  * @param predicateData - Predicate data bytes.
43145
43479
  */
43146
43480
  addCoinInput(coin) {
43147
- const { assetId, owner, amount, id, predicate } = coin;
43481
+ const { assetId, owner, amount } = coin;
43148
43482
  let witnessIndex;
43149
- if (predicate) {
43483
+ if (coin.predicate) {
43150
43484
  witnessIndex = 0;
43151
43485
  } else {
43152
43486
  witnessIndex = this.getCoinInputWitnessIndexByOwner(owner);
@@ -43155,14 +43489,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43155
43489
  }
43156
43490
  }
43157
43491
  const input = {
43158
- id,
43492
+ ...coin,
43159
43493
  type: InputType.Coin,
43160
43494
  owner: owner.toB256(),
43161
43495
  amount,
43162
43496
  assetId,
43163
43497
  txPointer: "0x00000000000000000000000000000000",
43164
- witnessIndex,
43165
- predicate
43498
+ witnessIndex
43166
43499
  };
43167
43500
  this.pushInput(input);
43168
43501
  this.addChangeOutput(owner, assetId);
@@ -43176,10 +43509,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43176
43509
  * @param predicateData - Predicate data bytes.
43177
43510
  */
43178
43511
  addMessageInput(message) {
43179
- const { recipient, sender, amount, predicate, nonce } = message;
43512
+ const { recipient, sender, amount } = message;
43180
43513
  const assetId = BaseAssetId;
43181
43514
  let witnessIndex;
43182
- if (predicate) {
43515
+ if (message.predicate) {
43183
43516
  witnessIndex = 0;
43184
43517
  } else {
43185
43518
  witnessIndex = this.getCoinInputWitnessIndexByOwner(recipient);
@@ -43188,13 +43521,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43188
43521
  }
43189
43522
  }
43190
43523
  const input = {
43191
- nonce,
43524
+ ...message,
43192
43525
  type: InputType.Message,
43193
43526
  sender: sender.toB256(),
43194
43527
  recipient: recipient.toB256(),
43195
43528
  amount,
43196
- witnessIndex,
43197
- predicate
43529
+ witnessIndex
43198
43530
  };
43199
43531
  this.pushInput(input);
43200
43532
  this.addChangeOutput(recipient, assetId);
@@ -43304,7 +43636,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43304
43636
  }
43305
43637
  calculateMaxGas(chainInfo, minGas) {
43306
43638
  const { consensusParameters } = chainInfo;
43307
- const { gasPerByte } = consensusParameters;
43639
+ const { gasPerByte, maxGasPerTx } = consensusParameters;
43308
43640
  const witnessesLength = this.toTransaction().witnesses.reduce(
43309
43641
  (acc, wit) => acc + wit.dataLength,
43310
43642
  0
@@ -43313,7 +43645,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43313
43645
  gasPerByte,
43314
43646
  minGas,
43315
43647
  witnessesLength,
43316
- witnessLimit: this.witnessLimit
43648
+ witnessLimit: this.witnessLimit,
43649
+ maxGasPerTx
43317
43650
  });
43318
43651
  }
43319
43652
  /**
@@ -43323,12 +43656,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43323
43656
  * @param quantities - CoinQuantity Array.
43324
43657
  */
43325
43658
  fundWithFakeUtxos(quantities, resourcesOwner) {
43326
- let idCounter = 0;
43327
- const generateId = () => {
43328
- const counterString = String(idCounter++);
43329
- const id = ZeroBytes32.slice(0, -counterString.length).concat(counterString);
43330
- return id;
43331
- };
43332
43659
  const findAssetInput = (assetId) => this.inputs.find((input) => {
43333
43660
  if ("assetId" in input) {
43334
43661
  return input.assetId === assetId;
@@ -43337,17 +43664,20 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43337
43664
  });
43338
43665
  const updateAssetInput = (assetId, quantity) => {
43339
43666
  const assetInput = findAssetInput(assetId);
43667
+ let usedQuantity = quantity;
43668
+ if (assetId === BaseAssetId) {
43669
+ usedQuantity = bn("1000000000000000000");
43670
+ }
43340
43671
  if (assetInput && "assetId" in assetInput) {
43341
- assetInput.id = generateId();
43342
- assetInput.amount = quantity;
43672
+ assetInput.id = hexlify(randomBytes3(34));
43673
+ assetInput.amount = usedQuantity;
43343
43674
  } else {
43344
43675
  this.addResources([
43345
43676
  {
43346
- id: generateId(),
43347
- amount: quantity,
43677
+ id: hexlify(randomBytes3(34)),
43678
+ amount: usedQuantity,
43348
43679
  assetId,
43349
43680
  owner: resourcesOwner || Address.fromRandom(),
43350
- maturity: 0,
43351
43681
  blockCreated: bn(1),
43352
43682
  txCreatedIdx: bn(1)
43353
43683
  }
@@ -43379,7 +43709,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43379
43709
  toJSON() {
43380
43710
  return normalizeJSON(this);
43381
43711
  }
43382
- updatePredicateInputs(inputs) {
43712
+ updatePredicateGasUsed(inputs) {
43383
43713
  this.inputs.forEach((i) => {
43384
43714
  let correspondingInput;
43385
43715
  switch (i.type) {
@@ -43401,6 +43731,15 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43401
43731
  }
43402
43732
  });
43403
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
+ }
43404
43743
  };
43405
43744
 
43406
43745
  // src/providers/transaction-request/hash-transaction.ts
@@ -43534,9 +43873,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43534
43873
  return {
43535
43874
  type: TransactionType.Create,
43536
43875
  ...baseTransaction,
43537
- bytecodeLength: baseTransaction.witnesses[bytecodeWitnessIndex].dataLength / 4,
43538
43876
  bytecodeWitnessIndex,
43539
- storageSlotsCount: storageSlots.length,
43877
+ storageSlotsCount: bn(storageSlots.length),
43540
43878
  salt: this.salt ? hexlify(this.salt) : ZeroBytes32,
43541
43879
  storageSlots
43542
43880
  };
@@ -43650,8 +43988,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43650
43988
  type: TransactionType.Script,
43651
43989
  scriptGasLimit: this.gasLimit,
43652
43990
  ...super.getBaseTransaction(),
43653
- scriptLength: script.length,
43654
- scriptDataLength: scriptData.length,
43991
+ scriptLength: bn(script.length),
43992
+ scriptDataLength: bn(scriptData.length),
43655
43993
  receiptsRoot: ZeroBytes32,
43656
43994
  script: hexlify(script),
43657
43995
  scriptData: hexlify(scriptData)
@@ -43715,7 +44053,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43715
44053
  }
43716
44054
  calculateMaxGas(chainInfo, minGas) {
43717
44055
  const { consensusParameters } = chainInfo;
43718
- const { gasPerByte } = consensusParameters;
44056
+ const { gasPerByte, maxGasPerTx } = consensusParameters;
43719
44057
  const witnessesLength = this.toTransaction().witnesses.reduce(
43720
44058
  (acc, wit) => acc + wit.dataLength,
43721
44059
  0
@@ -43725,7 +44063,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43725
44063
  minGas,
43726
44064
  witnessesLength,
43727
44065
  witnessLimit: this.witnessLimit,
43728
- gasLimit: this.gasLimit
44066
+ gasLimit: this.gasLimit,
44067
+ maxGasPerTx
43729
44068
  });
43730
44069
  }
43731
44070
  /**
@@ -43798,13 +44137,29 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43798
44137
  }
43799
44138
  }
43800
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
+ );
43801
44155
 
43802
44156
  // src/providers/transaction-summary/calculate-transaction-fee.ts
43803
44157
  var calculateTransactionFee = (params) => {
43804
44158
  const {
43805
- gasUsed,
44159
+ gasPrice,
43806
44160
  rawPayload,
43807
- consensusParameters: { gasCosts, feeParams }
44161
+ tip,
44162
+ consensusParameters: { gasCosts, feeParams, maxGasPerTx }
43808
44163
  } = params;
43809
44164
  const gasPerByte = bn(feeParams.gasPerByte);
43810
44165
  const gasPriceFactor = bn(feeParams.gasPriceFactor);
@@ -43814,8 +44169,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43814
44169
  return {
43815
44170
  fee: bn(0),
43816
44171
  minFee: bn(0),
43817
- maxFee: bn(0),
43818
- feeFromGasUsed: bn(0)
44172
+ maxFee: bn(0)
43819
44173
  };
43820
44174
  }
43821
44175
  const { type: type3, witnesses, inputs, policies } = transaction;
@@ -43847,7 +44201,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43847
44201
  metadataGas,
43848
44202
  txBytesSize: transactionBytes.length
43849
44203
  });
43850
- const gasPrice = bn(policies.find((policy) => policy.type === PolicyType.GasPrice)?.data);
43851
44204
  const witnessLimit = policies.find((policy) => policy.type === PolicyType.WitnessLimit)?.data;
43852
44205
  const witnessesLength = witnesses.reduce((acc, wit) => acc + wit.dataLength, 0);
43853
44206
  const maxGas = getMaxGas({
@@ -43855,17 +44208,25 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43855
44208
  minGas,
43856
44209
  witnessesLength,
43857
44210
  gasLimit,
43858
- 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
43859
44225
  });
43860
- const feeFromGasUsed = calculatePriceWithFactor(gasUsed, gasPrice, gasPriceFactor);
43861
- const minFee = calculatePriceWithFactor(minGas, gasPrice, gasPriceFactor);
43862
- const maxFee = calculatePriceWithFactor(maxGas, gasPrice, gasPriceFactor);
43863
- const fee = minFee.add(feeFromGasUsed);
43864
44226
  return {
43865
- fee,
43866
44227
  minFee,
43867
44228
  maxFee,
43868
- feeFromGasUsed
44229
+ fee: maxFee
43869
44230
  };
43870
44231
  };
43871
44232
 
@@ -44419,7 +44780,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44419
44780
  gqlTransactionStatus,
44420
44781
  abiMap = {},
44421
44782
  maxInputs,
44422
- gasCosts
44783
+ gasCosts,
44784
+ maxGasPerTx,
44785
+ gasPrice
44423
44786
  } = params;
44424
44787
  const gasUsed = getGasUsedFromReceipts(receipts);
44425
44788
  const rawPayload = hexlify(transactionBytes);
@@ -44433,11 +44796,14 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44433
44796
  maxInputs
44434
44797
  });
44435
44798
  const typeName = getTransactionTypeName(transaction.type);
44799
+ const tip = bn(transaction.policies?.find((policy) => policy.type === PolicyType.Tip)?.data);
44436
44800
  const { fee } = calculateTransactionFee({
44437
- gasUsed,
44801
+ gasPrice,
44438
44802
  rawPayload,
44803
+ tip,
44439
44804
  consensusParameters: {
44440
44805
  gasCosts,
44806
+ maxGasPerTx,
44441
44807
  feeParams: {
44442
44808
  gasPerByte,
44443
44809
  gasPriceFactor
@@ -44573,8 +44939,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44573
44939
  const decodedTransaction = this.decodeTransaction(
44574
44940
  transaction
44575
44941
  );
44576
- const receipts = transaction.receipts?.map(processGqlReceipt) || [];
44577
- 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();
44578
44949
  const maxInputs = this.provider.getChain().consensusParameters.maxInputs;
44579
44950
  const transactionSummary = assembleTransactionSummary({
44580
44951
  id: this.id,
@@ -44586,7 +44957,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44586
44957
  gasPriceFactor,
44587
44958
  abiMap: contractsAbiMap,
44588
44959
  maxInputs,
44589
- gasCosts
44960
+ gasCosts,
44961
+ maxGasPerTx,
44962
+ gasPrice
44590
44963
  });
44591
44964
  return transactionSummary;
44592
44965
  }
@@ -44735,7 +45108,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44735
45108
  gasCosts,
44736
45109
  latestBlock: {
44737
45110
  id: latestBlock.id,
44738
- height: bn(latestBlock.header.height),
45111
+ height: bn(latestBlock.height),
44739
45112
  time: latestBlock.header.time,
44740
45113
  transactions: latestBlock.transactions.map((i) => ({
44741
45114
  id: i.id
@@ -44829,10 +45202,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44829
45202
  * Returns some helpful parameters related to gas fees.
44830
45203
  */
44831
45204
  getGasConfig() {
44832
- const { minGasPrice } = this.getNode();
44833
45205
  const { maxGasPerTx, maxGasPerPredicate, gasPriceFactor, gasPerByte, gasCosts } = this.getChain().consensusParameters;
44834
45206
  return {
44835
- minGasPrice,
44836
45207
  maxGasPerTx,
44837
45208
  maxGasPerPredicate,
44838
45209
  gasPriceFactor,
@@ -44930,7 +45301,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44930
45301
  */
44931
45302
  async getBlockNumber() {
44932
45303
  const { chain } = await this.operations.getChain();
44933
- return bn(chain.latestBlock.header.height, 10);
45304
+ return bn(chain.latestBlock.height, 10);
44934
45305
  }
44935
45306
  /**
44936
45307
  * Returns the chain information.
@@ -44942,11 +45313,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44942
45313
  const processedNodeInfo = {
44943
45314
  maxDepth: bn(nodeInfo.maxDepth),
44944
45315
  maxTx: bn(nodeInfo.maxTx),
44945
- minGasPrice: bn(nodeInfo.minGasPrice),
44946
45316
  nodeVersion: nodeInfo.nodeVersion,
44947
45317
  utxoValidation: nodeInfo.utxoValidation,
44948
- vmBacktrace: nodeInfo.vmBacktrace,
44949
- peers: nodeInfo.peers
45318
+ vmBacktrace: nodeInfo.vmBacktrace
44950
45319
  };
44951
45320
  _Provider.nodeInfoCache[this.url] = processedNodeInfo;
44952
45321
  return processedNodeInfo;
@@ -45032,14 +45401,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45032
45401
  return this.estimateTxDependencies(transactionRequest);
45033
45402
  }
45034
45403
  const encodedTransaction = hexlify(transactionRequest.toTransactionBytes());
45035
- const { dryRun: gqlReceipts } = await this.operations.dryRun({
45036
- encodedTransaction,
45404
+ const { dryRun: dryRunStatuses } = await this.operations.dryRun({
45405
+ encodedTransactions: encodedTransaction,
45037
45406
  utxoValidation: utxoValidation || false
45038
45407
  });
45039
- const receipts = gqlReceipts.map(processGqlReceipt);
45040
- return {
45041
- receipts
45042
- };
45408
+ const [{ receipts: rawReceipts, status }] = dryRunStatuses;
45409
+ const receipts = rawReceipts.map(processGqlReceipt);
45410
+ return { receipts, dryrunStatus: status };
45043
45411
  }
45044
45412
  /**
45045
45413
  * Verifies whether enough gas is available to complete transaction.
@@ -45078,9 +45446,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45078
45446
  * If there are missing variable outputs,
45079
45447
  * `addVariableOutputs` is called on the transaction.
45080
45448
  *
45081
- * @privateRemarks
45082
- * TODO: Investigate support for missing contract IDs
45083
- * TODO: Add support for missing output messages
45084
45449
  *
45085
45450
  * @param transactionRequest - The transaction request object.
45086
45451
  * @returns A promise.
@@ -45093,16 +45458,19 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45093
45458
  missingContractIds: []
45094
45459
  };
45095
45460
  }
45096
- await this.estimatePredicates(transactionRequest);
45097
45461
  let receipts = [];
45098
45462
  const missingContractIds = [];
45099
45463
  let outputVariables = 0;
45464
+ let dryrunStatus;
45100
45465
  for (let attempt = 0; attempt < MAX_RETRIES; attempt++) {
45101
- const { dryRun: gqlReceipts } = await this.operations.dryRun({
45102
- encodedTransaction: hexlify(transactionRequest.toTransactionBytes()),
45466
+ const {
45467
+ dryRun: [{ receipts: rawReceipts, status }]
45468
+ } = await this.operations.dryRun({
45469
+ encodedTransactions: [hexlify(transactionRequest.toTransactionBytes())],
45103
45470
  utxoValidation: false
45104
45471
  });
45105
- receipts = gqlReceipts.map(processGqlReceipt);
45472
+ receipts = rawReceipts.map(processGqlReceipt);
45473
+ dryrunStatus = status;
45106
45474
  const { missingOutputVariables, missingOutputContractIds } = getReceiptsWithMissingData(receipts);
45107
45475
  const hasMissingOutputs = missingOutputVariables.length !== 0 || missingOutputContractIds.length !== 0;
45108
45476
  if (hasMissingOutputs) {
@@ -45112,6 +45480,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45112
45480
  transactionRequest.addContractInputAndOutput(Address.fromString(contractId));
45113
45481
  missingContractIds.push(contractId);
45114
45482
  });
45483
+ const { maxFee } = await this.estimateTxGasAndFee({
45484
+ transactionRequest,
45485
+ optimizeGas: false
45486
+ });
45487
+ transactionRequest.maxFee = maxFee;
45115
45488
  } else {
45116
45489
  break;
45117
45490
  }
@@ -45119,7 +45492,133 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45119
45492
  return {
45120
45493
  receipts,
45121
45494
  outputVariables,
45122
- 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
45123
45622
  };
45124
45623
  }
45125
45624
  /**
@@ -45137,15 +45636,17 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45137
45636
  if (estimateTxDependencies) {
45138
45637
  return this.estimateTxDependencies(transactionRequest);
45139
45638
  }
45140
- const encodedTransaction = hexlify(transactionRequest.toTransactionBytes());
45141
- const { dryRun: gqlReceipts } = await this.operations.dryRun({
45142
- encodedTransaction,
45639
+ const encodedTransactions = [hexlify(transactionRequest.toTransactionBytes())];
45640
+ const { dryRun: dryRunStatuses } = await this.operations.dryRun({
45641
+ encodedTransactions,
45143
45642
  utxoValidation: true
45144
45643
  });
45145
- const receipts = gqlReceipts.map(processGqlReceipt);
45146
- return {
45147
- receipts
45148
- };
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 };
45149
45650
  }
45150
45651
  /**
45151
45652
  * Returns a transaction cost to enable user
@@ -45162,80 +45663,80 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45162
45663
  * @param tolerance - The tolerance to add on top of the gasUsed.
45163
45664
  * @returns A promise that resolves to the transaction cost object.
45164
45665
  */
45165
- async getTransactionCost(transactionRequestLike, forwardingQuantities = [], {
45166
- estimateTxDependencies = true,
45167
- estimatePredicates = true,
45168
- resourcesOwner,
45169
- signatureCallback
45170
- } = {}) {
45666
+ async getTransactionCost(transactionRequestLike, { resourcesOwner, signatureCallback, quantitiesToContract = [] } = {}) {
45171
45667
  const txRequestClone = clone_default(transactionRequestify(transactionRequestLike));
45172
- const chainInfo = this.getChain();
45173
- const { gasPriceFactor, minGasPrice, maxGasPerTx } = this.getGasConfig();
45174
- const gasPrice = max(txRequestClone.gasPrice, minGasPrice);
45175
45668
  const isScriptTransaction = txRequestClone.type === TransactionType.Script;
45176
45669
  const coinOutputsQuantities = txRequestClone.getCoinOutputsQuantities();
45177
- const allQuantities = mergeQuantities(coinOutputsQuantities, forwardingQuantities);
45670
+ const allQuantities = mergeQuantities(coinOutputsQuantities, quantitiesToContract);
45178
45671
  txRequestClone.fundWithFakeUtxos(allQuantities, resourcesOwner?.address);
45179
- if (estimatePredicates) {
45180
- if (isScriptTransaction) {
45181
- txRequestClone.gasLimit = bn(0);
45182
- }
45183
- if (resourcesOwner && "populateTransactionPredicateData" in resourcesOwner) {
45184
- resourcesOwner.populateTransactionPredicateData(txRequestClone);
45185
- }
45186
- await this.estimatePredicates(txRequestClone);
45672
+ txRequestClone.maxFee = bn(0);
45673
+ if (isScriptTransaction) {
45674
+ txRequestClone.gasLimit = bn(0);
45187
45675
  }
45188
- if (signatureCallback && isScriptTransaction) {
45189
- await signatureCallback(txRequestClone);
45676
+ if (resourcesOwner && "populateTransactionPredicateData" in resourcesOwner) {
45677
+ resourcesOwner.populateTransactionPredicateData(txRequestClone);
45190
45678
  }
45191
- const minGas = txRequestClone.calculateMinGas(chainInfo);
45192
- 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;
45193
45692
  let receipts = [];
45194
45693
  let missingContractIds = [];
45195
45694
  let outputVariables = 0;
45196
- if (isScriptTransaction && estimateTxDependencies) {
45197
- txRequestClone.gasPrice = bn(0);
45198
- 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;
45199
45702
  const result = await this.estimateTxDependencies(txRequestClone);
45200
45703
  receipts = result.receipts;
45201
45704
  outputVariables = result.outputVariables;
45202
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
+ }));
45203
45712
  }
45204
- const gasUsed = isScriptTransaction ? getGasUsedFromReceipts(receipts) : minGas;
45205
- const usedFee = calculatePriceWithFactor(
45206
- gasUsed,
45207
- gasPrice,
45208
- gasPriceFactor
45209
- ).normalizeZeroToOne();
45210
- const minFee = calculatePriceWithFactor(minGas, gasPrice, gasPriceFactor).normalizeZeroToOne();
45211
- const maxFee = calculatePriceWithFactor(maxGas, gasPrice, gasPriceFactor).normalizeZeroToOne();
45212
45713
  return {
45213
45714
  requiredQuantities: allQuantities,
45214
45715
  receipts,
45215
45716
  gasUsed,
45216
- minGasPrice,
45217
45717
  gasPrice,
45218
45718
  minGas,
45219
45719
  maxGas,
45220
- usedFee,
45221
45720
  minFee,
45222
45721
  maxFee,
45223
- estimatedInputs: txRequestClone.inputs,
45224
45722
  outputVariables,
45225
- missingContractIds
45723
+ missingContractIds,
45724
+ addedSignatures,
45725
+ estimatedPredicates: txRequestClone.inputs
45226
45726
  };
45227
45727
  }
45228
- async getResourcesForTransaction(owner, transactionRequestLike, forwardingQuantities = []) {
45728
+ async getResourcesForTransaction(owner, transactionRequestLike, quantitiesToContract = []) {
45229
45729
  const ownerAddress = Address.fromAddressOrString(owner);
45230
45730
  const transactionRequest = transactionRequestify(clone_default(transactionRequestLike));
45231
- const transactionCost = await this.getTransactionCost(transactionRequest, forwardingQuantities);
45731
+ const transactionCost = await this.getTransactionCost(transactionRequest, {
45732
+ quantitiesToContract
45733
+ });
45232
45734
  transactionRequest.addResources(
45233
45735
  await this.getResourcesToSpend(ownerAddress, transactionCost.requiredQuantities)
45234
45736
  );
45235
- const { requiredQuantities, ...txCost } = await this.getTransactionCost(
45236
- transactionRequest,
45237
- forwardingQuantities
45238
- );
45737
+ const { requiredQuantities, ...txCost } = await this.getTransactionCost(transactionRequest, {
45738
+ quantitiesToContract
45739
+ });
45239
45740
  const resources = await this.getResourcesToSpend(ownerAddress, requiredQuantities);
45240
45741
  return {
45241
45742
  resources,
@@ -45259,7 +45760,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45259
45760
  assetId: coin.assetId,
45260
45761
  amount: bn(coin.amount),
45261
45762
  owner: Address.fromAddressOrString(coin.owner),
45262
- maturity: bn(coin.maturity).toNumber(),
45263
45763
  blockCreated: bn(coin.blockCreated),
45264
45764
  txCreatedIdx: bn(coin.txCreatedIdx)
45265
45765
  }));
@@ -45311,7 +45811,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45311
45811
  amount: bn(coin.amount),
45312
45812
  assetId: coin.assetId,
45313
45813
  owner: Address.fromAddressOrString(coin.owner),
45314
- maturity: bn(coin.maturity).toNumber(),
45315
45814
  blockCreated: bn(coin.blockCreated),
45316
45815
  txCreatedIdx: bn(coin.txCreatedIdx)
45317
45816
  };
@@ -45344,7 +45843,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45344
45843
  }
45345
45844
  return {
45346
45845
  id: block2.id,
45347
- height: bn(block2.header.height),
45846
+ height: bn(block2.height),
45348
45847
  time: block2.header.time,
45349
45848
  transactionIds: block2.transactions.map((tx) => tx.id)
45350
45849
  };
@@ -45359,7 +45858,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45359
45858
  const { blocks: fetchedData } = await this.operations.getBlocks(params);
45360
45859
  const blocks = fetchedData.edges.map(({ node: block2 }) => ({
45361
45860
  id: block2.id,
45362
- height: bn(block2.header.height),
45861
+ height: bn(block2.height),
45363
45862
  time: block2.header.time,
45364
45863
  transactionIds: block2.transactions.map((tx) => tx.id)
45365
45864
  }));
@@ -45386,7 +45885,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45386
45885
  }
45387
45886
  return {
45388
45887
  id: block2.id,
45389
- height: bn(block2.header.height, 10),
45888
+ height: bn(block2.height, 10),
45390
45889
  time: block2.header.time,
45391
45890
  transactionIds: block2.transactions.map((tx) => tx.id),
45392
45891
  transactions: block2.transactions.map(
@@ -45566,7 +46065,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45566
46065
  prevRoot: messageBlockHeader.prevRoot,
45567
46066
  time: messageBlockHeader.time,
45568
46067
  applicationHash: messageBlockHeader.applicationHash,
45569
- messageReceiptRoot: messageBlockHeader.messageReceiptRoot,
45570
46068
  messageReceiptCount: bn(messageBlockHeader.messageReceiptCount)
45571
46069
  },
45572
46070
  commitBlockHeader: {
@@ -45578,7 +46076,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45578
46076
  prevRoot: commitBlockHeader.prevRoot,
45579
46077
  time: commitBlockHeader.time,
45580
46078
  applicationHash: commitBlockHeader.applicationHash,
45581
- messageReceiptRoot: commitBlockHeader.messageReceiptRoot,
45582
46079
  messageReceiptCount: bn(commitBlockHeader.messageReceiptCount)
45583
46080
  },
45584
46081
  sender: Address.fromAddressOrString(sender),
@@ -45588,6 +46085,16 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45588
46085
  data
45589
46086
  };
45590
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
+ }
45591
46098
  /**
45592
46099
  * Returns Message Proof for given transaction id and the message id from MessageOut receipt.
45593
46100
  *
@@ -45871,36 +46378,33 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45871
46378
  * @param fee - The estimated transaction fee.
45872
46379
  * @returns A promise that resolves when the resources are added to the transaction.
45873
46380
  */
45874
- async fund(request, coinQuantities, fee) {
45875
- const updatedQuantities = addAmountToAsset({
46381
+ async fund(request, params) {
46382
+ const { addedSignatures, estimatedPredicates, maxFee: fee, requiredQuantities } = params;
46383
+ const txRequest = request;
46384
+ const requiredQuantitiesWithFee = addAmountToCoinQuantities({
45876
46385
  amount: bn(fee),
45877
46386
  assetId: BaseAssetId,
45878
- coinQuantities
46387
+ coinQuantities: requiredQuantities
45879
46388
  });
45880
46389
  const quantitiesDict = {};
45881
- updatedQuantities.forEach(({ amount, assetId }) => {
46390
+ requiredQuantitiesWithFee.forEach(({ amount, assetId }) => {
45882
46391
  quantitiesDict[assetId] = {
45883
46392
  required: amount,
45884
46393
  owned: bn(0)
45885
46394
  };
45886
46395
  });
45887
- const cachedUtxos = [];
45888
- const cachedMessages = [];
45889
- const owner = this.address.toB256();
45890
- request.inputs.forEach((input) => {
46396
+ txRequest.inputs.forEach((input) => {
45891
46397
  const isResource = "amount" in input;
45892
46398
  if (isResource) {
45893
46399
  const isCoin2 = "owner" in input;
45894
46400
  if (isCoin2) {
45895
46401
  const assetId = String(input.assetId);
45896
- if (input.owner === owner && quantitiesDict[assetId]) {
46402
+ if (quantitiesDict[assetId]) {
45897
46403
  const amount = bn(input.amount);
45898
46404
  quantitiesDict[assetId].owned = quantitiesDict[assetId].owned.add(amount);
45899
- cachedUtxos.push(input.id);
45900
46405
  }
45901
- } else if (input.recipient === owner && input.amount && quantitiesDict[BaseAssetId]) {
46406
+ } else if (input.amount && quantitiesDict[BaseAssetId]) {
45902
46407
  quantitiesDict[BaseAssetId].owned = quantitiesDict[BaseAssetId].owned.add(input.amount);
45903
- cachedMessages.push(input.nonce);
45904
46408
  }
45905
46409
  }
45906
46410
  });
@@ -45915,12 +46419,23 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45915
46419
  });
45916
46420
  const needsToBeFunded = missingQuantities.length;
45917
46421
  if (needsToBeFunded) {
45918
- const resources = await this.getResourcesToSpend(missingQuantities, {
45919
- messages: cachedMessages,
45920
- utxos: cachedUtxos
45921
- });
45922
- 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
+ );
45923
46433
  }
46434
+ const { maxFee } = await this.provider.estimateTxGasAndFee({
46435
+ transactionRequest: requestToBeReEstimate
46436
+ });
46437
+ txRequest.maxFee = maxFee;
46438
+ return txRequest;
45924
46439
  }
45925
46440
  /**
45926
46441
  * A helper that creates a transfer transaction request and returns it.
@@ -45928,28 +46443,25 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45928
46443
  * @param destination - The address of the destination.
45929
46444
  * @param amount - The amount of coins to transfer.
45930
46445
  * @param assetId - The asset ID of the coins to transfer.
45931
- * @param txParams - The transaction parameters (gasLimit, gasPrice, maturity).
46446
+ * @param txParams - The transaction parameters (gasLimit, tip, maturity, maxFee, witnessLimit).
45932
46447
  * @returns A promise that resolves to the prepared transaction request.
45933
46448
  */
45934
46449
  async createTransfer(destination, amount, assetId = BaseAssetId, txParams = {}) {
45935
- const { minGasPrice } = this.provider.getGasConfig();
45936
- const params = { gasPrice: minGasPrice, ...txParams };
45937
- const request = new ScriptTransactionRequest(params);
46450
+ const request = new ScriptTransactionRequest(txParams);
45938
46451
  request.addCoinOutput(Address.fromAddressOrString(destination), amount, assetId);
45939
- const { maxFee, requiredQuantities, gasUsed, estimatedInputs } = await this.provider.getTransactionCost(request, [], {
46452
+ const txCost = await this.provider.getTransactionCost(request, {
45940
46453
  estimateTxDependencies: true,
45941
46454
  resourcesOwner: this
45942
46455
  });
45943
- request.gasPrice = bn(txParams.gasPrice ?? minGasPrice);
45944
- request.gasLimit = bn(txParams.gasLimit ?? gasUsed);
45945
- this.validateGas({
45946
- gasUsed,
45947
- gasPrice: request.gasPrice,
45948
- gasLimit: request.gasLimit,
45949
- minGasPrice
45950
- });
45951
- await this.fund(request, requiredQuantities, maxFee);
45952
- 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);
45953
46465
  return request;
45954
46466
  }
45955
46467
  /**
@@ -45988,31 +46500,30 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45988
46500
  );
45989
46501
  }
45990
46502
  const contractAddress = Address.fromAddressOrString(contractId);
45991
- const { minGasPrice } = this.provider.getGasConfig();
45992
- const params = { gasPrice: minGasPrice, ...txParams };
45993
46503
  const { script, scriptData } = await assembleTransferToContractScript({
45994
46504
  hexlifiedContractId: contractAddress.toB256(),
45995
46505
  amountToTransfer: bn(amount),
45996
46506
  assetId
45997
46507
  });
45998
46508
  const request = new ScriptTransactionRequest({
45999
- ...params,
46509
+ ...txParams,
46000
46510
  script,
46001
46511
  scriptData
46002
46512
  });
46003
46513
  request.addContractInputAndOutput(contractAddress);
46004
- const { maxFee, requiredQuantities, gasUsed } = await this.provider.getTransactionCost(
46005
- request,
46006
- [{ amount: bn(amount), assetId: String(assetId) }]
46007
- );
46008
- request.gasLimit = bn(params.gasLimit ?? gasUsed);
46009
- this.validateGas({
46010
- gasUsed,
46011
- gasPrice: request.gasPrice,
46012
- gasLimit: request.gasLimit,
46013
- minGasPrice
46514
+ const txCost = await this.provider.getTransactionCost(request, {
46515
+ resourcesOwner: this,
46516
+ quantitiesToContract: [{ amount: bn(amount), assetId: String(assetId) }]
46014
46517
  });
46015
- 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);
46016
46527
  return this.sendTransaction(request);
46017
46528
  }
46018
46529
  /**
@@ -46024,7 +46535,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46024
46535
  * @returns A promise that resolves to the transaction response.
46025
46536
  */
46026
46537
  async withdrawToBaseLayer(recipient, amount, txParams = {}) {
46027
- const { minGasPrice } = this.provider.getGasConfig();
46028
46538
  const recipientAddress = Address.fromAddressOrString(recipient);
46029
46539
  const recipientDataArray = arrayify(
46030
46540
  "0x".concat(recipientAddress.toHexString().substring(2).padStart(64, "0"))
@@ -46037,21 +46547,19 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46037
46547
  ...recipientDataArray,
46038
46548
  ...amountDataArray
46039
46549
  ]);
46040
- const params = { script, gasPrice: minGasPrice, ...txParams };
46550
+ const params = { script, ...txParams };
46041
46551
  const request = new ScriptTransactionRequest(params);
46042
- const forwardingQuantities = [{ amount: bn(amount), assetId: BaseAssetId }];
46043
- const { requiredQuantities, maxFee, gasUsed } = await this.provider.getTransactionCost(
46044
- request,
46045
- forwardingQuantities
46046
- );
46047
- request.gasLimit = bn(params.gasLimit ?? gasUsed);
46048
- this.validateGas({
46049
- gasUsed,
46050
- gasPrice: request.gasPrice,
46051
- gasLimit: request.gasLimit,
46052
- minGasPrice
46053
- });
46054
- 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);
46055
46563
  return this.sendTransaction(request);
46056
46564
  }
46057
46565
  async signMessage(message) {
@@ -46109,18 +46617,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46109
46617
  }
46110
46618
  return this.provider.simulate(transactionRequest, { estimateTxDependencies: false });
46111
46619
  }
46112
- validateGas({
46113
- gasUsed,
46114
- gasPrice,
46115
- gasLimit,
46116
- minGasPrice
46117
- }) {
46118
- if (minGasPrice.gt(gasPrice)) {
46119
- throw new FuelError(
46120
- ErrorCode.GAS_PRICE_TOO_LOW,
46121
- `Gas price '${gasPrice}' is lower than the required: '${minGasPrice}'.`
46122
- );
46123
- }
46620
+ validateGas({ gasUsed, gasLimit }) {
46124
46621
  if (gasUsed.gt(gasLimit)) {
46125
46622
  throw new FuelError(
46126
46623
  ErrorCode.GAS_LIMIT_TOO_LOW,
@@ -47503,12 +48000,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
47503
48000
  };
47504
48001
 
47505
48002
  // ../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-node/rng.js
47506
- var import_crypto15 = __toESM(__require("crypto"));
48003
+ var import_crypto16 = __toESM(__require("crypto"));
47507
48004
  var rnds8Pool = new Uint8Array(256);
47508
48005
  var poolPtr = rnds8Pool.length;
47509
48006
  function rng() {
47510
48007
  if (poolPtr > rnds8Pool.length - 16) {
47511
- import_crypto15.default.randomFillSync(rnds8Pool);
48008
+ import_crypto16.default.randomFillSync(rnds8Pool);
47512
48009
  poolPtr = 0;
47513
48010
  }
47514
48011
  return rnds8Pool.slice(poolPtr, poolPtr += 16);
@@ -47524,9 +48021,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
47524
48021
  }
47525
48022
 
47526
48023
  // ../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-node/native.js
47527
- var import_crypto16 = __toESM(__require("crypto"));
48024
+ var import_crypto17 = __toESM(__require("crypto"));
47528
48025
  var native_default = {
47529
- randomUUID: import_crypto16.default.randomUUID
48026
+ randomUUID: import_crypto17.default.randomUUID
47530
48027
  };
47531
48028
 
47532
48029
  // ../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-node/v4.js
@@ -47709,7 +48206,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
47709
48206
  * @param transactionRequestLike - The transaction request to send.
47710
48207
  * @returns A promise that resolves to the TransactionResponse object.
47711
48208
  */
47712
- async sendTransaction(transactionRequestLike, { estimateTxDependencies = true, awaitExecution } = {}) {
48209
+ async sendTransaction(transactionRequestLike, { estimateTxDependencies = false, awaitExecution } = {}) {
47713
48210
  const transactionRequest = transactionRequestify(transactionRequestLike);
47714
48211
  if (estimateTxDependencies) {
47715
48212
  await this.provider.estimateTxDependencies(transactionRequest);
@@ -50469,14 +50966,15 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
50469
50966
  process.env.GENESIS_SECRET || randomBytes22(32),
50470
50967
  wallet.provider
50471
50968
  );
50472
- const resources = await genesisWallet.getResourcesToSpend(quantities);
50473
- const { minGasPrice } = genesisWallet.provider.getGasConfig();
50474
- const request = new ScriptTransactionRequest({
50475
- gasLimit: 1e4,
50476
- gasPrice: minGasPrice
50969
+ const request = new ScriptTransactionRequest();
50970
+ quantities.forEach((quantity) => {
50971
+ const { amount, assetId } = coinQuantityfy(quantity);
50972
+ request.addCoinOutput(wallet.address, amount, assetId);
50477
50973
  });
50478
- request.addResources(resources);
50479
- 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);
50480
50978
  await genesisWallet.sendTransaction(request, { awaitExecution: true });
50481
50979
  };
50482
50980
 
@@ -50506,7 +51004,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
50506
51004
 
50507
51005
  // src/test-utils/launchNode.ts
50508
51006
  var import_child_process = __require("child_process");
50509
- var import_crypto20 = __require("crypto");
51007
+ var import_crypto21 = __require("crypto");
50510
51008
  var import_fs2 = __require("fs");
50511
51009
  var import_os = __toESM(__require("os"));
50512
51010
  var import_path8 = __toESM(__require("path"));
@@ -50555,12 +51053,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
50555
51053
  // eslint-disable-next-line no-async-promise-executor
50556
51054
  new Promise(async (resolve, reject) => {
50557
51055
  const remainingArgs = extractRemainingArgs(args, [
50558
- "--chain",
51056
+ "--snapshot",
50559
51057
  "--consensus-key",
50560
51058
  "--db-type",
50561
51059
  "--poa-instant"
50562
51060
  ]);
50563
- const chainConfigPath = getFlagValueFromArgs(args, "--chain");
51061
+ const chainConfigPath = getFlagValueFromArgs(args, "--snapshot");
50564
51062
  const consensusKey = getFlagValueFromArgs(args, "--consensus-key") || defaultConsensusKey;
50565
51063
  const dbTypeFlagValue = getFlagValueFromArgs(args, "--db-type");
50566
51064
  const useInMemoryDb = dbTypeFlagValue === "in-memory" || dbTypeFlagValue === void 0;
@@ -50578,37 +51076,55 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
50578
51076
  })).toString();
50579
51077
  let chainConfigPathToUse;
50580
51078
  const prefix = basePath || import_os.default.tmpdir();
50581
- const suffix = basePath ? "" : (0, import_crypto20.randomUUID)();
50582
- 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");
50583
51081
  if (chainConfigPath) {
50584
51082
  chainConfigPathToUse = chainConfigPath;
50585
51083
  } else {
50586
51084
  if (!(0, import_fs2.existsSync)(tempDirPath)) {
50587
51085
  (0, import_fs2.mkdirSync)(tempDirPath, { recursive: true });
50588
51086
  }
50589
- const tempChainConfigFilePath = import_path8.default.join(tempDirPath, "chainConfig.json");
50590
- 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
+ };
50591
51103
  if (!process.env.GENESIS_SECRET) {
50592
51104
  const pk = Signer.generatePrivateKey();
50593
51105
  const signer = new Signer(pk);
50594
51106
  process.env.GENESIS_SECRET = hexlify(pk);
50595
- chainConfig = {
50596
- ...defaultChainConfig,
50597
- initial_state: {
50598
- ...defaultChainConfig.initial_state,
50599
- coins: [
50600
- ...defaultChainConfig.initial_state.coins,
50601
- {
50602
- owner: signer.address.toHexString(),
50603
- amount: toHex(1e9),
50604
- asset_id: BaseAssetId
50605
- }
50606
- ]
50607
- }
50608
- };
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
+ });
50609
51117
  }
50610
- (0, import_fs2.writeFileSync)(tempChainConfigFilePath, JSON.stringify(chainConfig), "utf8");
50611
- 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;
50612
51128
  }
50613
51129
  const child = (0, import_child_process.spawn)(
50614
51130
  command,
@@ -50617,10 +51133,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
50617
51133
  ["--ip", ipToUse],
50618
51134
  ["--port", portToUse],
50619
51135
  useInMemoryDb ? ["--db-type", "in-memory"] : ["--db-path", tempDirPath],
50620
- ["--min-gas-price", "0"],
51136
+ ["--min-gas-price", "1"],
50621
51137
  poaInstant ? ["--poa-instant", "true"] : [],
50622
51138
  ["--consensus-key", consensusKey],
50623
- ["--chain", chainConfigPathToUse],
51139
+ ["--snapshot", chainConfigPathToUse],
50624
51140
  "--vm-backtrace",
50625
51141
  "--utxo-validation",
50626
51142
  "--debug",
@@ -50679,7 +51195,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
50679
51195
  walletCount = 10
50680
51196
  } = {}) => {
50681
51197
  const { cleanup: closeNode, ip, port } = await launchNode(launchNodeOptions || {});
50682
- const provider = await Provider.create(`http://${ip}:${port}/graphql`);
51198
+ const provider = await Provider.create(`http://${ip}:${port}/v1/graphql`);
50683
51199
  const wallets = await generateWallets(walletCount, provider);
50684
51200
  const cleanup = () => {
50685
51201
  closeNode();