@fuel-ts/account 0.0.0-rc-2143-20240424161332 → 0.0.0-rc-2021-20240424162616

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