@fuel-ts/account 0.0.0-rc-2021-20240410132122 → 0.0.0-rc-2034-20240410133013

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 +4 -5
  3. package/dist/account.d.ts.map +1 -1
  4. package/dist/configs.d.ts.map +1 -1
  5. package/dist/configs.global.js +1 -1
  6. package/dist/configs.global.js.map +1 -1
  7. package/dist/configs.js +1 -1
  8. package/dist/configs.js.map +1 -1
  9. package/dist/configs.mjs +1 -1
  10. package/dist/configs.mjs.map +1 -1
  11. package/dist/index.global.js +560 -793
  12. package/dist/index.global.js.map +1 -1
  13. package/dist/index.js +523 -760
  14. package/dist/index.js.map +1 -1
  15. package/dist/index.mjs +404 -640
  16. package/dist/index.mjs.map +1 -1
  17. package/dist/predicate/predicate.d.ts +2 -11
  18. package/dist/predicate/predicate.d.ts.map +1 -1
  19. package/dist/providers/__generated__/operations.d.ts +328 -894
  20. package/dist/providers/__generated__/operations.d.ts.map +1 -1
  21. package/dist/providers/coin-quantity.d.ts +1 -1
  22. package/dist/providers/coin-quantity.d.ts.map +1 -1
  23. package/dist/providers/coin.d.ts +2 -4
  24. package/dist/providers/coin.d.ts.map +1 -1
  25. package/dist/providers/fuel-graphql-subscriber.d.ts.map +1 -1
  26. package/dist/providers/message.d.ts +1 -3
  27. package/dist/providers/message.d.ts.map +1 -1
  28. package/dist/providers/provider.d.ts +31 -36
  29. package/dist/providers/provider.d.ts.map +1 -1
  30. package/dist/providers/transaction-request/create-transaction-request.d.ts.map +1 -1
  31. package/dist/providers/transaction-request/input.d.ts +2 -2
  32. package/dist/providers/transaction-request/input.d.ts.map +1 -1
  33. package/dist/providers/transaction-request/script-transaction-request.d.ts.map +1 -1
  34. package/dist/providers/transaction-request/transaction-request.d.ts +25 -8
  35. package/dist/providers/transaction-request/transaction-request.d.ts.map +1 -1
  36. package/dist/providers/transaction-request/utils.d.ts +0 -3
  37. package/dist/providers/transaction-request/utils.d.ts.map +1 -1
  38. package/dist/providers/transaction-response/transaction-response.d.ts.map +1 -1
  39. package/dist/providers/transaction-summary/assemble-transaction-summary.d.ts +0 -2
  40. package/dist/providers/transaction-summary/assemble-transaction-summary.d.ts.map +1 -1
  41. package/dist/providers/transaction-summary/calculate-transaction-fee.d.ts +2 -3
  42. package/dist/providers/transaction-summary/calculate-transaction-fee.d.ts.map +1 -1
  43. package/dist/providers/transaction-summary/get-transaction-summary.d.ts.map +1 -1
  44. package/dist/providers/utils/gas.d.ts +2 -8
  45. package/dist/providers/utils/gas.d.ts.map +1 -1
  46. package/dist/test-utils/launchNode.d.ts.map +1 -1
  47. package/dist/test-utils.global.js +1059 -1506
  48. package/dist/test-utils.global.js.map +1 -1
  49. package/dist/test-utils.js +519 -735
  50. package/dist/test-utils.js.map +1 -1
  51. package/dist/test-utils.mjs +413 -629
  52. package/dist/test-utils.mjs.map +1 -1
  53. package/dist/wallet/base-wallet-unlocked.d.ts.map +1 -1
  54. package/package.json +17 -17
@@ -280,7 +280,7 @@
280
280
  }
281
281
  return num !== null && typeof num === "object" && num.constructor.wordSize === BN2.wordSize && Array.isArray(num.words);
282
282
  };
283
- BN2.max = function max(left, right) {
283
+ BN2.max = function max2(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 clone3(instance) {
5107
+ function clone(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(clone3(this), {
6041
+ return new Response2(clone(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 ? clone3(input) : null;
6091
+ let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(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.51.1",
31918
- FUEL_CORE: "0.24.2",
31917
+ FORC: "0.49.3",
31918
+ FUEL_CORE: "0.22.1",
31919
31919
  FUELS: "0.79.0"
31920
31920
  };
31921
31921
  }
@@ -32193,753 +32193,520 @@ This unreleased fuel-core build may include features and updates not yet support
32193
32193
  __publicField3(DateTime, "TAI64_NULL", "");
32194
32194
  var chainConfig_default = {
32195
32195
  chain_name: "local_testnet",
32196
- consensus_parameters: {
32197
- V1: {
32198
- tx_params: {
32199
- V1: {
32200
- max_inputs: 255,
32201
- max_outputs: 255,
32202
- max_witnesses: 255,
32203
- max_gas_per_tx: 3e7,
32204
- max_size: 112640
32205
- }
32206
- },
32207
- predicate_params: {
32208
- V1: {
32209
- max_predicate_length: 102400,
32210
- max_predicate_data_length: 102400,
32211
- max_message_data_length: 102400,
32212
- max_gas_per_predicate: 3e7
32213
- }
32214
- },
32215
- script_params: {
32216
- V1: {
32217
- max_script_length: 102400,
32218
- max_script_data_length: 102400
32219
- }
32220
- },
32221
- contract_params: {
32222
- V1: {
32223
- contract_max_size: 102400,
32224
- max_storage_slots: 1760
32225
- }
32226
- },
32227
- fee_params: {
32228
- V1: {
32229
- gas_price_factor: 92,
32230
- gas_per_byte: 63
32231
- }
32232
- },
32233
- chain_id: 0,
32234
- gas_costs: {
32235
- V1: {
32236
- add: 2,
32237
- addi: 2,
32238
- aloc: 1,
32239
- and: 2,
32240
- andi: 2,
32241
- bal: 366,
32242
- bhei: 2,
32243
- bhsh: 2,
32244
- burn: 33949,
32245
- cb: 2,
32246
- cfei: 2,
32247
- cfsi: 2,
32248
- div: 2,
32249
- divi: 2,
32250
- eck1: 3347,
32251
- ecr1: 46165,
32252
- ed19: 4210,
32253
- eq: 2,
32254
- exp: 2,
32255
- expi: 2,
32256
- flag: 1,
32257
- gm: 2,
32258
- gt: 2,
32259
- gtf: 16,
32260
- ji: 2,
32261
- jmp: 2,
32262
- jne: 2,
32263
- jnei: 2,
32264
- jnzi: 2,
32265
- jmpf: 2,
32266
- jmpb: 2,
32267
- jnzf: 2,
32268
- jnzb: 2,
32269
- jnef: 2,
32270
- jneb: 2,
32271
- lb: 2,
32272
- log: 754,
32273
- lt: 2,
32274
- lw: 2,
32275
- mint: 35718,
32276
- mlog: 2,
32277
- mod: 2,
32278
- modi: 2,
32279
- move: 2,
32280
- movi: 2,
32281
- mroo: 5,
32282
- mul: 2,
32283
- muli: 2,
32284
- mldv: 4,
32285
- noop: 1,
32286
- not: 2,
32287
- or: 2,
32288
- ori: 2,
32289
- poph: 3,
32290
- popl: 3,
32291
- pshh: 4,
32292
- pshl: 4,
32293
- ret_contract: 733,
32294
- rvrt_contract: 722,
32295
- sb: 2,
32296
- sll: 2,
32297
- slli: 2,
32298
- srl: 2,
32299
- srli: 2,
32300
- srw: 253,
32301
- sub: 2,
32302
- subi: 2,
32303
- sw: 2,
32304
- sww: 29053,
32305
- time: 79,
32306
- tr: 46242,
32307
- tro: 33251,
32308
- wdcm: 3,
32309
- wqcm: 3,
32310
- wdop: 3,
32311
- wqop: 3,
32312
- wdml: 3,
32313
- wqml: 4,
32314
- wddv: 5,
32315
- wqdv: 7,
32316
- wdmd: 11,
32317
- wqmd: 18,
32318
- wdam: 9,
32319
- wqam: 12,
32320
- wdmm: 11,
32321
- wqmm: 11,
32322
- xor: 2,
32323
- xori: 2,
32324
- call: {
32325
- LightOperation: {
32326
- base: 21687,
32327
- units_per_gas: 4
32328
- }
32329
- },
32330
- ccp: {
32331
- LightOperation: {
32332
- base: 59,
32333
- units_per_gas: 20
32334
- }
32335
- },
32336
- croo: {
32337
- LightOperation: {
32338
- base: 1,
32339
- units_per_gas: 1
32340
- }
32341
- },
32342
- csiz: {
32343
- LightOperation: {
32344
- base: 59,
32345
- units_per_gas: 195
32346
- }
32347
- },
32348
- k256: {
32349
- LightOperation: {
32350
- base: 282,
32351
- units_per_gas: 3
32352
- }
32353
- },
32354
- ldc: {
32355
- LightOperation: {
32356
- base: 45,
32357
- units_per_gas: 65
32358
- }
32359
- },
32360
- logd: {
32361
- LightOperation: {
32362
- base: 1134,
32363
- units_per_gas: 2
32364
- }
32365
- },
32366
- mcl: {
32367
- LightOperation: {
32368
- base: 3,
32369
- units_per_gas: 523
32370
- }
32371
- },
32372
- mcli: {
32373
- LightOperation: {
32374
- base: 3,
32375
- units_per_gas: 526
32376
- }
32377
- },
32378
- mcp: {
32379
- LightOperation: {
32380
- base: 3,
32381
- units_per_gas: 448
32382
- }
32383
- },
32384
- mcpi: {
32385
- LightOperation: {
32386
- base: 7,
32387
- units_per_gas: 585
32388
- }
32389
- },
32390
- meq: {
32391
- LightOperation: {
32392
- base: 11,
32393
- units_per_gas: 1097
32394
- }
32395
- },
32396
- retd_contract: {
32397
- LightOperation: {
32398
- base: 1086,
32399
- units_per_gas: 2
32400
- }
32401
- },
32402
- s256: {
32403
- LightOperation: {
32404
- base: 45,
32405
- units_per_gas: 3
32406
- }
32407
- },
32408
- scwq: {
32409
- HeavyOperation: {
32410
- base: 30375,
32411
- gas_per_unit: 28628
32412
- }
32413
- },
32414
- smo: {
32415
- LightOperation: {
32416
- base: 64196,
32417
- units_per_gas: 1
32418
- }
32419
- },
32420
- srwq: {
32421
- HeavyOperation: {
32422
- base: 262,
32423
- gas_per_unit: 249
32424
- }
32425
- },
32426
- swwq: {
32427
- HeavyOperation: {
32428
- base: 28484,
32429
- gas_per_unit: 26613
32430
- }
32431
- },
32432
- contract_root: {
32433
- LightOperation: {
32434
- base: 45,
32435
- units_per_gas: 1
32436
- }
32437
- },
32438
- state_root: {
32439
- HeavyOperation: {
32440
- base: 350,
32441
- gas_per_unit: 176
32442
- }
32443
- },
32444
- new_storage_per_byte: 63,
32445
- vm_initialization: {
32446
- LightOperation: {
32447
- base: 1645,
32448
- units_per_gas: 14
32449
- }
32450
- }
32451
- }
32196
+ block_gas_limit: 5e9,
32197
+ initial_state: {
32198
+ coins: [
32199
+ {
32200
+ owner: "0x94ffcc53b892684acefaebc8a3d4a595e528a8cf664eeb3ef36f1020b0809d0d",
32201
+ amount: "0xFFFFFFFFFFFFFFFF",
32202
+ asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32452
32203
  },
32453
- base_asset_id: "0000000000000000000000000000000000000000000000000000000000000000",
32454
- block_gas_limit: 3e7,
32455
- privileged_address: "0000000000000000000000000000000000000000000000000000000000000000"
32456
- }
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"
32453
+ },
32454
+ {
32455
+ sender: "0x69a2b736b60159b43bb8a4f98c0589f6da5fa3a3d101e8e269c499eb942753ba",
32456
+ recipient: "0xc43454aa38dd91f88109a4b7aef5efb96ce34e3f24992fe0f81d233ca686f80f",
32457
+ nonce: "0e1ef2963832068b0e1ef2963832068b0e1ef2963832068b0e1ef2963832068b",
32458
+ amount: "0xb04f3c08f59b309e",
32459
+ data: "",
32460
+ da_height: "0x00"
32461
+ }
32462
+ ]
32457
32463
  },
32458
- consensus: {
32459
- PoA: {
32460
- signing_key: "0x94ffcc53b892684acefaebc8a3d4a595e528a8cf664eeb3ef36f1020b0809d0d"
32461
- }
32462
- }
32463
- };
32464
- var metadata_default = {
32465
- chain_config: "chainConfig.json",
32466
- table_encoding: {
32467
- Json: {
32468
- filepath: "stateConfig.json"
32469
- }
32470
- }
32471
- };
32472
- var stateConfig_default = {
32473
- coins: [
32474
- {
32475
- tx_id: "0x260eabfd50937e92939fd92687e9302a72e91c5065f64f853f2ccbe02396fe09d665",
32476
- output_index: 0,
32477
- tx_pointer_block_height: 0,
32478
- tx_pointer_tx_idx: 0,
32479
- owner: "0x94ffcc53b892684acefaebc8a3d4a595e528a8cf664eeb3ef36f1020b0809d0d",
32480
- amount: 18446744073709552e3,
32481
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32482
- },
32483
- {
32484
- tx_id: "0x2a757c2317236f7883ac9bbbf7d402f034e0b725c544ef1c8725b1d2bd960f8c690f",
32485
- output_index: 0,
32486
- tx_pointer_block_height: 0,
32487
- tx_pointer_tx_idx: 0,
32488
- owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
32489
- amount: 18446744073709552e3,
32490
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32491
- },
32492
- {
32493
- tx_id: "0x634ef6cda00bac63992bbde80c6d694d484d58025a5ca0c9c848f0d35a5a3eee74b2",
32494
- output_index: 0,
32495
- tx_pointer_block_height: 0,
32496
- tx_pointer_tx_idx: 0,
32497
- owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
32498
- amount: 18446744073709552e3,
32499
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32500
- },
32501
- {
32502
- tx_id: "0xd3543bb1da137a7987a96a1bb71681fdd195ff25318c0d4a923aa30eb27ffa80bc7b",
32503
- output_index: 0,
32504
- tx_pointer_block_height: 0,
32505
- tx_pointer_tx_idx: 0,
32506
- owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
32507
- amount: 18446744073709552e3,
32508
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32509
- },
32510
- {
32511
- tx_id: "0xa4d42cbb02adb32f5f3a9eab33a0ee7bdab8910ad9f615dfc86a7bb9e49a732bc58c",
32512
- output_index: 0,
32513
- tx_pointer_block_height: 0,
32514
- tx_pointer_tx_idx: 0,
32515
- owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
32516
- amount: 18446744073709552e3,
32517
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32518
- },
32519
- {
32520
- tx_id: "0xc197cb09b1d89a7862b238e9500631bd43f291aadb7ff55c8129335349634e9fde3f",
32521
- output_index: 0,
32522
- tx_pointer_block_height: 0,
32523
- tx_pointer_tx_idx: 0,
32524
- owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
32525
- amount: 18446744073709552e3,
32526
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32527
- },
32528
- {
32529
- tx_id: "0x4c4fc2451b9a9b16c520c1b89ec8968ce46823dd0396d84f7e3155861352fdce12c5",
32530
- output_index: 0,
32531
- tx_pointer_block_height: 0,
32532
- tx_pointer_tx_idx: 0,
32533
- owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
32534
- amount: 18446744073709552e3,
32535
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32536
- },
32537
- {
32538
- tx_id: "0x68df8f08555086a1ab45591e6fe4bf2f538bcb80dd519108030b7e886d6a230c2531",
32539
- output_index: 0,
32540
- tx_pointer_block_height: 0,
32541
- tx_pointer_tx_idx: 0,
32542
- owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
32543
- amount: 18446744073709552e3,
32544
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32545
- },
32546
- {
32547
- tx_id: "0x1b9bdaa290518373eb905e45ce7fcb89acedd24341ca7749ad47a938e4bf3ca9b7ce",
32548
- output_index: 0,
32549
- tx_pointer_block_height: 0,
32550
- tx_pointer_tx_idx: 0,
32551
- owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
32552
- amount: 18446744073709552e3,
32553
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32554
- },
32555
- {
32556
- tx_id: "0xa5a2e9db3d1285337fe1183dc1eabe8f9cdcd470daf95cd5c522bbae292f53977f26",
32557
- output_index: 0,
32558
- tx_pointer_block_height: 0,
32559
- tx_pointer_tx_idx: 0,
32560
- owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
32561
- amount: 18446744073709552e3,
32562
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32563
- },
32564
- {
32565
- tx_id: "0x13b685a1ea7c56309a92d69dd7e4808987ec90d62a1f9c9f2ec18e54746855c8c93c",
32566
- output_index: 0,
32567
- tx_pointer_block_height: 0,
32568
- tx_pointer_tx_idx: 0,
32569
- owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
32570
- amount: 18446744073709552e3,
32571
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32572
- },
32573
- {
32574
- tx_id: "0xf8f00a234cf3fbab86befc3fd9346d7fd1ac085233c9cb58c7447f30c75cbf87ed38",
32575
- output_index: 0,
32576
- tx_pointer_block_height: 0,
32577
- tx_pointer_tx_idx: 0,
32578
- owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
32579
- amount: 18446744073709552e3,
32580
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32581
- },
32582
- {
32583
- tx_id: "0x2a36c870f624b60fbd6f2b71332ca7f704c69296ceae4ddbf3a8ede79408088934be",
32584
- output_index: 0,
32585
- tx_pointer_block_height: 0,
32586
- tx_pointer_tx_idx: 0,
32587
- owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
32588
- amount: 18446744073709552e3,
32589
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32590
- },
32591
- {
32592
- tx_id: "0x9cd180d41e67a422da8a7683f036b463a7ed7efc0de31c1692adac90decbfebce78c",
32593
- output_index: 0,
32594
- tx_pointer_block_height: 0,
32595
- tx_pointer_tx_idx: 0,
32596
- owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
32597
- amount: 18446744073709552e3,
32598
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32599
- },
32600
- {
32601
- tx_id: "0xfeb4f2388fa22e6613ff85cf4e655f58acdfaa6299eba7f93b812cd1f0d7bbac48f0",
32602
- output_index: 0,
32603
- tx_pointer_block_height: 0,
32604
- tx_pointer_tx_idx: 0,
32605
- owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
32606
- amount: 18446744073709552e3,
32607
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32608
- },
32609
- {
32610
- tx_id: "0xc4d20299f43358dc32ab853f6631340b09278511b6adbaf34597ade6ef37efd018f1",
32611
- output_index: 0,
32612
- tx_pointer_block_height: 0,
32613
- tx_pointer_tx_idx: 0,
32614
- owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
32615
- amount: 18446744073709552e3,
32616
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32617
- },
32618
- {
32619
- tx_id: "0x437291414110b0aebaa8be5c0d9ff1e97d1130a24a6c9e028f2b1f6b0576be6aa961",
32620
- output_index: 0,
32621
- tx_pointer_block_height: 0,
32622
- tx_pointer_tx_idx: 0,
32623
- owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
32624
- amount: 18446744073709552e3,
32625
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32626
- },
32627
- {
32628
- tx_id: "0x28131b9acc90c2058ee14f4094a474146ba5b779cb9021867164b3d41abad3d047a7",
32629
- output_index: 0,
32630
- tx_pointer_block_height: 0,
32631
- tx_pointer_tx_idx: 0,
32632
- owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
32633
- amount: 18446744073709552e3,
32634
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32635
- },
32636
- {
32637
- tx_id: "0x033bb5f9b0e4f530d50af3a0f12dd510f799af495ef88baea3cf854a37da728d214b",
32638
- output_index: 0,
32639
- tx_pointer_block_height: 0,
32640
- tx_pointer_tx_idx: 0,
32641
- owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
32642
- amount: 18446744073709552e3,
32643
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32644
- },
32645
- {
32646
- tx_id: "0x460591398552eca338dd9577f362b91b0f9297f308258734870350004dcc303c67e9",
32647
- output_index: 0,
32648
- tx_pointer_block_height: 0,
32649
- tx_pointer_tx_idx: 0,
32650
- owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
32651
- amount: 18446744073709552e3,
32652
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32653
- },
32654
- {
32655
- tx_id: "0x447a7c37aee972dcba72f05255c5145dd63125f0fc46ef98c216f775ee0421e23d2b",
32656
- output_index: 0,
32657
- tx_pointer_block_height: 0,
32658
- tx_pointer_tx_idx: 0,
32659
- owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
32660
- amount: 18446744073709552e3,
32661
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32662
- },
32663
- {
32664
- tx_id: "0xf4a5d727606260c7ac6333fa89e7aef474df8a13326716d4d02f6392ebb7b997d268",
32665
- output_index: 0,
32666
- tx_pointer_block_height: 0,
32667
- tx_pointer_tx_idx: 0,
32668
- owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
32669
- amount: 18446744073709552e3,
32670
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32671
- },
32672
- {
32673
- tx_id: "0x25a49b0731bf610f6706aa9e9e96e5967f7c50f4302a3c75d7c8141595896551c18d",
32674
- output_index: 0,
32675
- tx_pointer_block_height: 0,
32676
- tx_pointer_tx_idx: 0,
32677
- owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
32678
- amount: 18446744073709552e3,
32679
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32680
- },
32681
- {
32682
- tx_id: "0x0a6e3585881ef2edf3f7727762799089dc0b5923e8b3718b49044dd9ddcb33b68459",
32683
- output_index: 0,
32684
- tx_pointer_block_height: 0,
32685
- tx_pointer_tx_idx: 0,
32686
- owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
32687
- amount: 18446744073709552e3,
32688
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32689
- },
32690
- {
32691
- tx_id: "0xf73bbe0635f7b6d59a090a21d87288b82164d0f6101da830ce64eff64a2d2ff2ac37",
32692
- output_index: 0,
32693
- tx_pointer_block_height: 0,
32694
- tx_pointer_tx_idx: 0,
32695
- owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
32696
- amount: 18446744073709552e3,
32697
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32698
- },
32699
- {
32700
- tx_id: "0x6cc44cb8d2a6462a591a77b6b9917eb6b22ad80d23d3cfd4f94c9da49c14b3cbac6e",
32701
- output_index: 0,
32702
- tx_pointer_block_height: 0,
32703
- tx_pointer_tx_idx: 0,
32704
- owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
32705
- amount: 18446744073709552e3,
32706
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
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
32707
32471
  },
32708
- {
32709
- tx_id: "0xbf2305d284ea95227040df4cc727156cccc2ca6aa3b92ed86fea4db1c37e5905f926",
32710
- output_index: 0,
32711
- tx_pointer_block_height: 0,
32712
- tx_pointer_tx_idx: 0,
32713
- owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
32714
- amount: 18446744073709552e3,
32715
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
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
32716
32477
  },
32717
- {
32718
- tx_id: "0xf4e1c76c72ecae699696f5e7a62ccf1425f7395080d0ca7b25ab63d1f841f425b807",
32719
- output_index: 0,
32720
- tx_pointer_block_height: 0,
32721
- tx_pointer_tx_idx: 0,
32722
- owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
32723
- amount: 18446744073709552e3,
32724
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32478
+ script_params: {
32479
+ max_script_length: 1048576,
32480
+ max_script_data_length: 1048576
32725
32481
  },
32726
- {
32727
- tx_id: "0x619c80ee9f4c27c2e134cec6c67bdb268ce7fb1d2ac229ca2a44ec7ac88b2da99669",
32728
- output_index: 0,
32729
- tx_pointer_block_height: 0,
32730
- tx_pointer_tx_idx: 0,
32731
- owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
32732
- amount: 18446744073709552e3,
32733
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32482
+ contract_params: {
32483
+ contract_max_size: 16777216,
32484
+ max_storage_slots: 255
32734
32485
  },
32735
- {
32736
- tx_id: "0x978d5b6be047ffbf1474dc376a6baa33264629b809e4a8210d11aaa805ec6451585d",
32737
- output_index: 0,
32738
- tx_pointer_block_height: 0,
32739
- tx_pointer_tx_idx: 0,
32740
- owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
32741
- amount: 18446744073709552e3,
32742
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
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
+ }
32743
32586
  },
32744
- {
32745
- tx_id: "0x673ba12fca6e52429896096262b8c59b61751976e552649fb1fe7369488fc10aa83c",
32746
- output_index: 0,
32747
- tx_pointer_block_height: 0,
32748
- tx_pointer_tx_idx: 0,
32749
- owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
32750
- amount: 18446744073709552e3,
32751
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32587
+ ccp: {
32588
+ LightOperation: {
32589
+ base: 15,
32590
+ units_per_gas: 103
32591
+ }
32752
32592
  },
32753
- {
32754
- tx_id: "0xc42a165104b9fcfa4a9ebffc707781ace233f1c0609c24c36a5c4bfcd407480ddb6c",
32755
- output_index: 0,
32756
- tx_pointer_block_height: 0,
32757
- tx_pointer_tx_idx: 0,
32758
- owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
32759
- amount: 18446744073709552e3,
32760
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32593
+ csiz: {
32594
+ LightOperation: {
32595
+ base: 17,
32596
+ units_per_gas: 790
32597
+ }
32761
32598
  },
32762
- {
32763
- tx_id: "0xb353fbcd94abba347f3ba25e17744e98da26e608ebccbbbd2e9d004997644bdf993c",
32764
- output_index: 0,
32765
- tx_pointer_block_height: 0,
32766
- tx_pointer_tx_idx: 0,
32767
- owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
32768
- amount: 18446744073709552e3,
32769
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32599
+ k256: {
32600
+ LightOperation: {
32601
+ base: 11,
32602
+ units_per_gas: 214
32603
+ }
32770
32604
  },
32771
- {
32772
- tx_id: "0xc34a6fcb241dec82f885019caf5e14bb6708b435afebfef0037ac447fbb6d30378a3",
32773
- output_index: 0,
32774
- tx_pointer_block_height: 0,
32775
- tx_pointer_tx_idx: 0,
32776
- owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
32777
- amount: 18446744073709552e3,
32778
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32605
+ ldc: {
32606
+ LightOperation: {
32607
+ base: 15,
32608
+ units_per_gas: 272
32609
+ }
32779
32610
  },
32780
- {
32781
- tx_id: "0x421dfb5811c905724f2f4c6370cd15eaeb590ddeb966f9a4b9f8d65991dfe5142e12",
32782
- output_index: 0,
32783
- tx_pointer_block_height: 0,
32784
- tx_pointer_tx_idx: 0,
32785
- owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
32786
- amount: 18446744073709552e3,
32787
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32611
+ logd: {
32612
+ LightOperation: {
32613
+ base: 26,
32614
+ units_per_gas: 64
32615
+ }
32788
32616
  },
32789
- {
32790
- tx_id: "0xa952c0487eefac5dda612011c4c82554c8660834461b9b815c6ae257b56b68005235",
32791
- output_index: 0,
32792
- tx_pointer_block_height: 0,
32793
- tx_pointer_tx_idx: 0,
32794
- owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
32795
- amount: 18446744073709552e3,
32796
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32617
+ mcl: {
32618
+ LightOperation: {
32619
+ base: 1,
32620
+ units_per_gas: 3333
32621
+ }
32797
32622
  },
32798
- {
32799
- tx_id: "0xebaccf91b3b213341d047b6e6af214f1f9729b3d6dadf9c1918a9fe412486af871db",
32800
- output_index: 0,
32801
- tx_pointer_block_height: 0,
32802
- tx_pointer_tx_idx: 0,
32803
- owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
32804
- amount: 18446744073709552e3,
32805
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32623
+ mcli: {
32624
+ LightOperation: {
32625
+ base: 1,
32626
+ units_per_gas: 3333
32627
+ }
32806
32628
  },
32807
- {
32808
- tx_id: "0xda6d61c153e7d735954408274f4ffe8459c2dbab720ce22a1ae9ffedd33077b5b19d",
32809
- output_index: 0,
32810
- tx_pointer_block_height: 0,
32811
- tx_pointer_tx_idx: 0,
32812
- owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
32813
- amount: 18446744073709552e3,
32814
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32629
+ mcp: {
32630
+ LightOperation: {
32631
+ base: 1,
32632
+ units_per_gas: 2e3
32633
+ }
32815
32634
  },
32816
- {
32817
- tx_id: "0x508871600ef68c4f1e021dd0db219c733107151338aa95de530bd10dc61f6a69c144",
32818
- output_index: 0,
32819
- tx_pointer_block_height: 0,
32820
- tx_pointer_tx_idx: 0,
32821
- owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
32822
- amount: 18446744073709552e3,
32823
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32635
+ mcpi: {
32636
+ LightOperation: {
32637
+ base: 3,
32638
+ units_per_gas: 2e3
32639
+ }
32824
32640
  },
32825
- {
32826
- tx_id: "0x509994738b4973e2dbbff9596b176a89fb07ee95f0ed575a4fe07a735a2a181f3200",
32827
- output_index: 0,
32828
- tx_pointer_block_height: 0,
32829
- tx_pointer_tx_idx: 0,
32830
- owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
32831
- amount: 18446744073709552e3,
32832
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32641
+ meq: {
32642
+ LightOperation: {
32643
+ base: 1,
32644
+ units_per_gas: 2500
32645
+ }
32833
32646
  },
32834
- {
32835
- tx_id: "0x6cc0cb58df0e0606fc85481aaaf5f47e145a67240b298c184bcb7fd7367c3bbf9453",
32836
- output_index: 0,
32837
- tx_pointer_block_height: 0,
32838
- tx_pointer_tx_idx: 0,
32839
- owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
32840
- amount: 18446744073709552e3,
32841
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32647
+ retd: {
32648
+ LightOperation: {
32649
+ base: 29,
32650
+ units_per_gas: 62
32651
+ }
32842
32652
  },
32843
- {
32844
- tx_id: "0x9ddea761afc31516307e1553647ac6cc26d4a82fed9a9e6a03b994cdbf2293b3e3b6",
32845
- output_index: 0,
32846
- tx_pointer_block_height: 0,
32847
- tx_pointer_tx_idx: 0,
32848
- owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
32849
- amount: 18446744073709552e3,
32850
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32653
+ s256: {
32654
+ LightOperation: {
32655
+ base: 2,
32656
+ units_per_gas: 214
32657
+ }
32851
32658
  },
32852
- {
32853
- tx_id: "0x82dbc478ba63abf28b92d9dce0cb8c2e6c02833d436fe812a33cf78417e4a80c1306",
32854
- output_index: 0,
32855
- tx_pointer_block_height: 0,
32856
- tx_pointer_tx_idx: 0,
32857
- owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
32858
- amount: 18446744073709552e3,
32859
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32659
+ scwq: {
32660
+ LightOperation: {
32661
+ base: 13,
32662
+ units_per_gas: 5
32663
+ }
32860
32664
  },
32861
- {
32862
- tx_id: "0xc3b0cb232c74009fd226a6246403f78bcc33d116579f41d9387c0d76c76942749c7c",
32863
- output_index: 0,
32864
- tx_pointer_block_height: 0,
32865
- tx_pointer_tx_idx: 0,
32866
- owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
32867
- amount: 18446744073709552e3,
32868
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32665
+ smo: {
32666
+ LightOperation: {
32667
+ base: 209,
32668
+ units_per_gas: 55
32669
+ }
32869
32670
  },
32870
- {
32871
- tx_id: "0x708ee45d18f94ab06458712745c92c7b9b6049ba345219d6697eae5208ec0328aeaf",
32872
- output_index: 0,
32873
- tx_pointer_block_height: 0,
32874
- tx_pointer_tx_idx: 0,
32875
- owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
32876
- amount: 18446744073709552e3,
32877
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32671
+ srwq: {
32672
+ LightOperation: {
32673
+ base: 47,
32674
+ units_per_gas: 5
32675
+ }
32878
32676
  },
32879
- {
32880
- tx_id: "0xfe26968c44ac5becc608ce543075ae9e677b7631f3beb7a11ba20703fdca3c0e3569",
32881
- output_index: 0,
32882
- tx_pointer_block_height: 0,
32883
- tx_pointer_tx_idx: 0,
32884
- owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
32885
- amount: 18446744073709552e3,
32886
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32677
+ swwq: {
32678
+ LightOperation: {
32679
+ base: 44,
32680
+ units_per_gas: 5
32681
+ }
32887
32682
  },
32888
- {
32889
- tx_id: "0xe0ec1d2c991feac69be4d0e84ad7c964616de08e16dccc4d2000b1900ba31082b993",
32890
- output_index: 0,
32891
- tx_pointer_block_height: 0,
32892
- tx_pointer_tx_idx: 0,
32893
- owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
32894
- amount: 18446744073709552e3,
32895
- asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
32683
+ contract_root: {
32684
+ LightOperation: {
32685
+ base: 75,
32686
+ units_per_gas: 1
32687
+ }
32896
32688
  },
32897
- {
32898
- tx_id: "0xfa82dbdd72252d1e6c76ee818bbac0441c3a705aff447f041c8b9fc3cb03f9ccd7e2",
32899
- output_index: 0,
32900
- tx_pointer_block_height: 0,
32901
- tx_pointer_tx_idx: 0,
32902
- owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
32903
- amount: 18446744073709552e3,
32904
- asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
32689
+ state_root: {
32690
+ LightOperation: {
32691
+ base: 412,
32692
+ units_per_gas: 1
32693
+ }
32905
32694
  },
32906
- {
32907
- tx_id: "0x324f45e47cef892ac3e0759f3b72207c77046f9938267af4bd4af2ae031b97cb36c8",
32908
- output_index: 0,
32909
- tx_pointer_block_height: 0,
32910
- tx_pointer_tx_idx: 0,
32911
- owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
32912
- amount: 18446744073709552e3,
32913
- asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
32914
- }
32915
- ],
32916
- messages: [
32917
- {
32918
- sender: "0xc43454aa38dd91f88109a4b7aef5efb96ce34e3f24992fe0f81d233ca686f80f",
32919
- recipient: "0x69a2b736b60159b43bb8a4f98c0589f6da5fa3a3d101e8e269c499eb942753ba",
32920
- nonce: "0101010101010101010101010101010101010101010101010101010101010101",
32921
- amount: 18446744073709552e3,
32922
- data: "",
32923
- da_height: 0
32695
+ vm_initialization: {
32696
+ HeavyOperation: {
32697
+ base: 2e3,
32698
+ gas_per_unit: 0
32699
+ }
32924
32700
  },
32925
- {
32926
- sender: "0x69a2b736b60159b43bb8a4f98c0589f6da5fa3a3d101e8e269c499eb942753ba",
32927
- recipient: "0xc43454aa38dd91f88109a4b7aef5efb96ce34e3f24992fe0f81d233ca686f80f",
32928
- nonce: "0e1ef2963832068b0e1ef2963832068b0e1ef2963832068b0e1ef2963832068b",
32929
- amount: 12704439083013452e3,
32930
- data: "",
32931
- da_height: 0
32701
+ new_storage_per_byte: 1
32702
+ },
32703
+ consensus: {
32704
+ PoA: {
32705
+ signing_key: "0x94ffcc53b892684acefaebc8a3d4a595e528a8cf664eeb3ef36f1020b0809d0d"
32932
32706
  }
32933
- ],
32934
- contracts: [],
32935
- block_height: 0,
32936
- da_block_height: 0
32937
- };
32938
- var defaultChainConfigs = {
32939
- chainConfigJson: chainConfig_default,
32940
- metadataJson: metadata_default,
32941
- stateConfigJson: stateConfig_default
32707
+ }
32942
32708
  };
32709
+ var defaultChainConfig = chainConfig_default;
32943
32710
  var defaultConsensusKey = "0xa449b1ffee0e2205fa924c6740cc48b3b473aa28587df6dab12abc245d1f5298";
32944
32711
 
32945
32712
  // ../crypto/dist/index.mjs
@@ -35232,182 +34999,32 @@ This unreleased fuel-core build may include features and updates not yet support
35232
34999
  function toBytes3(value, bytesPadding) {
35233
35000
  return bn(value).toBytes(bytesPadding);
35234
35001
  }
35235
-
35236
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isPlaceholder.js
35237
- function _isPlaceholder(a) {
35238
- return a != null && typeof a === "object" && a["@@functional/placeholder"] === true;
35239
- }
35240
-
35241
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_curry1.js
35242
- function _curry1(fn) {
35243
- return function f1(a) {
35244
- if (arguments.length === 0 || _isPlaceholder(a)) {
35245
- return f1;
35246
- } else {
35247
- return fn.apply(this, arguments);
35248
- }
35249
- };
35250
- }
35251
-
35252
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isArray.js
35253
- var isArray_default = Array.isArray || function _isArray(val) {
35254
- return val != null && val.length >= 0 && Object.prototype.toString.call(val) === "[object Array]";
35255
- };
35256
-
35257
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/type.js
35258
- var type = /* @__PURE__ */ _curry1(function type2(val) {
35259
- return val === null ? "Null" : val === void 0 ? "Undefined" : Object.prototype.toString.call(val).slice(8, -1);
35260
- });
35261
- var type_default = type;
35262
-
35263
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_toISOString.js
35264
- var pad = function pad2(n) {
35265
- return (n < 10 ? "0" : "") + n;
35266
- };
35267
- var _toISOString = typeof Date.prototype.toISOString === "function" ? function _toISOString2(d) {
35268
- return d.toISOString();
35269
- } : function _toISOString3(d) {
35270
- return d.getUTCFullYear() + "-" + pad(d.getUTCMonth() + 1) + "-" + pad(d.getUTCDate()) + "T" + pad(d.getUTCHours()) + ":" + pad(d.getUTCMinutes()) + ":" + pad(d.getUTCSeconds()) + "." + (d.getUTCMilliseconds() / 1e3).toFixed(3).slice(2, 5) + "Z";
35271
- };
35272
-
35273
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isInteger.js
35274
- var isInteger_default = Number.isInteger || function _isInteger(n) {
35275
- return n << 0 === n;
35276
- };
35277
-
35278
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_cloneRegExp.js
35279
- function _cloneRegExp(pattern) {
35280
- return new RegExp(pattern.source, pattern.flags ? pattern.flags : (pattern.global ? "g" : "") + (pattern.ignoreCase ? "i" : "") + (pattern.multiline ? "m" : "") + (pattern.sticky ? "y" : "") + (pattern.unicode ? "u" : "") + (pattern.dotAll ? "s" : ""));
35281
- }
35282
-
35283
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_clone.js
35284
- function _clone(value, deep, map) {
35285
- map || (map = new _ObjectMap());
35286
- if (_isPrimitive(value)) {
35287
- return value;
35288
- }
35289
- var copy = function copy2(copiedValue) {
35290
- var cachedCopy = map.get(value);
35291
- if (cachedCopy) {
35292
- return cachedCopy;
35293
- }
35294
- map.set(value, copiedValue);
35295
- for (var key in value) {
35296
- if (Object.prototype.hasOwnProperty.call(value, key)) {
35297
- copiedValue[key] = deep ? _clone(value[key], true, map) : value[key];
35298
- }
35299
- }
35300
- return copiedValue;
35301
- };
35302
- switch (type_default(value)) {
35303
- case "Object":
35304
- return copy(Object.create(Object.getPrototypeOf(value)));
35305
- case "Array":
35306
- return copy([]);
35307
- case "Date":
35308
- return new Date(value.valueOf());
35309
- case "RegExp":
35310
- return _cloneRegExp(value);
35311
- case "Int8Array":
35312
- case "Uint8Array":
35313
- case "Uint8ClampedArray":
35314
- case "Int16Array":
35315
- case "Uint16Array":
35316
- case "Int32Array":
35317
- case "Uint32Array":
35318
- case "Float32Array":
35319
- case "Float64Array":
35320
- case "BigInt64Array":
35321
- case "BigUint64Array":
35322
- return value.slice();
35323
- default:
35324
- return value;
35325
- }
35326
- }
35327
- function _isPrimitive(param) {
35328
- var type3 = typeof param;
35329
- return param == null || type3 != "object" && type3 != "function";
35002
+ function max(...numbers) {
35003
+ return numbers.reduce((prev, cur) => bn(cur).gt(prev) ? bn(cur) : prev, bn(0));
35330
35004
  }
35331
- var _ObjectMap = /* @__PURE__ */ function() {
35332
- function _ObjectMap2() {
35333
- this.map = {};
35334
- this.length = 0;
35335
- }
35336
- _ObjectMap2.prototype.set = function(key, value) {
35337
- const hashedKey = this.hash(key);
35338
- let bucket = this.map[hashedKey];
35339
- if (!bucket) {
35340
- this.map[hashedKey] = bucket = [];
35341
- }
35342
- bucket.push([key, value]);
35343
- this.length += 1;
35344
- };
35345
- _ObjectMap2.prototype.hash = function(key) {
35346
- let hashedKey = [];
35347
- for (var value in key) {
35348
- hashedKey.push(Object.prototype.toString.call(key[value]));
35349
- }
35350
- return hashedKey.join();
35351
- };
35352
- _ObjectMap2.prototype.get = function(key) {
35353
- if (this.length <= 180) {
35354
- for (const p in this.map) {
35355
- const bucket2 = this.map[p];
35356
- for (let i = 0; i < bucket2.length; i += 1) {
35357
- const element = bucket2[i];
35358
- if (element[0] === key) {
35359
- return element[1];
35360
- }
35361
- }
35362
- }
35363
- return;
35364
- }
35365
- const hashedKey = this.hash(key);
35366
- const bucket = this.map[hashedKey];
35367
- if (!bucket) {
35368
- return;
35369
- }
35370
- for (let i = 0; i < bucket.length; i += 1) {
35371
- const element = bucket[i];
35372
- if (element[0] === key) {
35373
- return element[1];
35374
- }
35375
- }
35376
- };
35377
- return _ObjectMap2;
35378
- }();
35379
-
35380
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/clone.js
35381
- var clone = /* @__PURE__ */ _curry1(function clone2(value) {
35382
- return value != null && typeof value.clone === "function" ? value.clone() : _clone(value, true);
35383
- });
35384
- var clone_default = clone;
35385
-
35386
- // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/trim.js
35387
- var hasProtoTrim = typeof String.prototype.trim === "function";
35388
35005
 
35389
35006
  // src/providers/coin-quantity.ts
35390
35007
  var coinQuantityfy = (coinQuantityLike) => {
35391
35008
  let assetId;
35392
35009
  let amount;
35393
- let max;
35010
+ let max2;
35394
35011
  if (Array.isArray(coinQuantityLike)) {
35395
35012
  amount = coinQuantityLike[0];
35396
35013
  assetId = coinQuantityLike[1] ?? BaseAssetId;
35397
- max = coinQuantityLike[2] ?? void 0;
35014
+ max2 = coinQuantityLike[2] ?? void 0;
35398
35015
  } else {
35399
35016
  amount = coinQuantityLike.amount;
35400
35017
  assetId = coinQuantityLike.assetId ?? BaseAssetId;
35401
- max = coinQuantityLike.max ?? void 0;
35018
+ max2 = coinQuantityLike.max ?? void 0;
35402
35019
  }
35403
35020
  const bnAmount = bn(amount);
35404
35021
  return {
35405
35022
  assetId: hexlify(assetId),
35406
35023
  amount: bnAmount.lt(1) ? bn(1) : bnAmount,
35407
- max: max ? bn(max) : void 0
35024
+ max: max2 ? bn(max2) : void 0
35408
35025
  };
35409
35026
  };
35410
- var addAmountToCoinQuantities = (params) => {
35027
+ var addAmountToAsset = (params) => {
35411
35028
  const { amount, assetId } = params;
35412
35029
  const coinQuantities = [...params.coinQuantities];
35413
35030
  const assetIdx = coinQuantities.findIndex((coinQuantity) => coinQuantity.assetId === assetId);
@@ -35481,9 +35098,9 @@ This unreleased fuel-core build may include features and updates not yet support
35481
35098
  var TX_POINTER_LEN = WORD_SIZE * 2;
35482
35099
  var MAX_BYTES = 2 ** 32 - 1;
35483
35100
  var calculateVmTxMemory = ({ maxInputs }) => BYTES_32 + // Tx ID
35484
- ASSET_ID_LEN + // Base asset ID
35101
+ WORD_SIZE + // Tx size
35485
35102
  // Asset ID/Balance coin input pairs
35486
- maxInputs * (ASSET_ID_LEN + WORD_SIZE) + WORD_SIZE;
35103
+ maxInputs * (ASSET_ID_LEN + WORD_SIZE);
35487
35104
  var SCRIPT_FIXED_SIZE = WORD_SIZE + // Identifier
35488
35105
  WORD_SIZE + // Gas limit
35489
35106
  WORD_SIZE + // Script size
@@ -35501,6 +35118,7 @@ This unreleased fuel-core build may include features and updates not yet support
35501
35118
  ASSET_ID_LEN + // Asset id
35502
35119
  TX_POINTER_LEN + // TxPointer
35503
35120
  WORD_SIZE + // Witnesses index
35121
+ WORD_SIZE + // Maturity
35504
35122
  WORD_SIZE + // Predicate size
35505
35123
  WORD_SIZE + // Predicate data size
35506
35124
  WORD_SIZE;
@@ -35822,7 +35440,7 @@ This unreleased fuel-core build may include features and updates not yet support
35822
35440
  constructor(name, coders) {
35823
35441
  const caseIndexCoder = new BigNumberCoder("u64");
35824
35442
  const encodedValueSize = Object.values(coders).reduce(
35825
- (max, coder) => Math.max(max, coder.encodedLength),
35443
+ (max2, coder) => Math.max(max2, coder.encodedLength),
35826
35444
  0
35827
35445
  );
35828
35446
  super(`enum ${name}`, `enum ${name}`, caseIndexCoder.encodedLength + encodedValueSize);
@@ -36526,7 +36144,7 @@ This unreleased fuel-core build may include features and updates not yet support
36526
36144
  constructor(name, coders) {
36527
36145
  const caseIndexCoder = new BigNumberCoder("u64");
36528
36146
  const encodedValueSize = Object.values(coders).reduce(
36529
- (max, coder) => Math.max(max, coder.encodedLength),
36147
+ (max2, coder) => Math.max(max2, coder.encodedLength),
36530
36148
  0
36531
36149
  );
36532
36150
  super(`enum ${name}`, `enum ${name}`, caseIndexCoder.encodedLength + encodedValueSize);
@@ -37228,19 +36846,18 @@ This unreleased fuel-core build may include features and updates not yet support
37228
36846
  encode(value) {
37229
36847
  const parts = [];
37230
36848
  parts.push(new B256Coder().encode(value.txID));
37231
- parts.push(new NumberCoder("u16").encode(value.outputIndex));
36849
+ parts.push(new NumberCoder("u8").encode(value.outputIndex));
37232
36850
  parts.push(new B256Coder().encode(value.owner));
37233
36851
  parts.push(new BigNumberCoder("u64").encode(value.amount));
37234
36852
  parts.push(new B256Coder().encode(value.assetId));
37235
36853
  parts.push(new TxPointerCoder().encode(value.txPointer));
37236
- parts.push(new NumberCoder("u16").encode(value.witnessIndex));
36854
+ parts.push(new NumberCoder("u8").encode(value.witnessIndex));
36855
+ parts.push(new NumberCoder("u32").encode(value.maturity));
37237
36856
  parts.push(new BigNumberCoder("u64").encode(value.predicateGasUsed));
37238
- parts.push(new BigNumberCoder("u64").encode(value.predicateLength));
37239
- parts.push(new BigNumberCoder("u64").encode(value.predicateDataLength));
37240
- parts.push(new ByteArrayCoder(value.predicateLength.toNumber()).encode(value.predicate));
37241
- parts.push(
37242
- new ByteArrayCoder(value.predicateDataLength.toNumber()).encode(value.predicateData)
37243
- );
36857
+ parts.push(new NumberCoder("u32").encode(value.predicateLength));
36858
+ parts.push(new NumberCoder("u32").encode(value.predicateDataLength));
36859
+ parts.push(new ByteArrayCoder(value.predicateLength).encode(value.predicate));
36860
+ parts.push(new ByteArrayCoder(value.predicateDataLength).encode(value.predicateData));
37244
36861
  return concat(parts);
37245
36862
  }
37246
36863
  decode(data, offset) {
@@ -37248,7 +36865,7 @@ This unreleased fuel-core build may include features and updates not yet support
37248
36865
  let o = offset;
37249
36866
  [decoded, o] = new B256Coder().decode(data, o);
37250
36867
  const txID = decoded;
37251
- [decoded, o] = new NumberCoder("u16").decode(data, o);
36868
+ [decoded, o] = new NumberCoder("u8").decode(data, o);
37252
36869
  const outputIndex = decoded;
37253
36870
  [decoded, o] = new B256Coder().decode(data, o);
37254
36871
  const owner = decoded;
@@ -37258,17 +36875,19 @@ This unreleased fuel-core build may include features and updates not yet support
37258
36875
  const assetId = decoded;
37259
36876
  [decoded, o] = new TxPointerCoder().decode(data, o);
37260
36877
  const txPointer = decoded;
37261
- [decoded, o] = new NumberCoder("u16").decode(data, o);
36878
+ [decoded, o] = new NumberCoder("u8").decode(data, o);
37262
36879
  const witnessIndex = Number(decoded);
36880
+ [decoded, o] = new NumberCoder("u32").decode(data, o);
36881
+ const maturity = decoded;
37263
36882
  [decoded, o] = new BigNumberCoder("u64").decode(data, o);
37264
36883
  const predicateGasUsed = decoded;
37265
- [decoded, o] = new BigNumberCoder("u64").decode(data, o);
36884
+ [decoded, o] = new NumberCoder("u32").decode(data, o);
37266
36885
  const predicateLength = decoded;
37267
- [decoded, o] = new BigNumberCoder("u64").decode(data, o);
36886
+ [decoded, o] = new NumberCoder("u32").decode(data, o);
37268
36887
  const predicateDataLength = decoded;
37269
- [decoded, o] = new ByteArrayCoder(predicateLength.toNumber()).decode(data, o);
36888
+ [decoded, o] = new ByteArrayCoder(predicateLength).decode(data, o);
37270
36889
  const predicate = decoded;
37271
- [decoded, o] = new ByteArrayCoder(predicateDataLength.toNumber()).decode(data, o);
36890
+ [decoded, o] = new ByteArrayCoder(predicateDataLength).decode(data, o);
37272
36891
  const predicateData = decoded;
37273
36892
  return [
37274
36893
  {
@@ -37280,6 +36899,7 @@ This unreleased fuel-core build may include features and updates not yet support
37280
36899
  assetId,
37281
36900
  txPointer,
37282
36901
  witnessIndex,
36902
+ maturity,
37283
36903
  predicateGasUsed,
37284
36904
  predicateLength,
37285
36905
  predicateDataLength,
@@ -37297,7 +36917,7 @@ This unreleased fuel-core build may include features and updates not yet support
37297
36917
  encode(value) {
37298
36918
  const parts = [];
37299
36919
  parts.push(new B256Coder().encode(value.txID));
37300
- parts.push(new NumberCoder("u16").encode(value.outputIndex));
36920
+ parts.push(new NumberCoder("u8").encode(value.outputIndex));
37301
36921
  parts.push(new B256Coder().encode(value.balanceRoot));
37302
36922
  parts.push(new B256Coder().encode(value.stateRoot));
37303
36923
  parts.push(new TxPointerCoder().encode(value.txPointer));
@@ -37309,7 +36929,7 @@ This unreleased fuel-core build may include features and updates not yet support
37309
36929
  let o = offset;
37310
36930
  [decoded, o] = new B256Coder().decode(data, o);
37311
36931
  const txID = decoded;
37312
- [decoded, o] = new NumberCoder("u16").decode(data, o);
36932
+ [decoded, o] = new NumberCoder("u8").decode(data, o);
37313
36933
  const outputIndex = decoded;
37314
36934
  [decoded, o] = new B256Coder().decode(data, o);
37315
36935
  const balanceRoot = decoded;
@@ -37358,16 +36978,14 @@ This unreleased fuel-core build may include features and updates not yet support
37358
36978
  parts.push(new ByteArrayCoder(32).encode(value.recipient));
37359
36979
  parts.push(new BigNumberCoder("u64").encode(value.amount));
37360
36980
  parts.push(new ByteArrayCoder(32).encode(value.nonce));
37361
- parts.push(new NumberCoder("u16").encode(value.witnessIndex));
36981
+ parts.push(new NumberCoder("u8").encode(value.witnessIndex));
37362
36982
  parts.push(new BigNumberCoder("u64").encode(value.predicateGasUsed));
37363
- parts.push(new BigNumberCoder("u64").encode(data.length));
37364
- parts.push(new BigNumberCoder("u64").encode(value.predicateLength));
37365
- parts.push(new BigNumberCoder("u64").encode(value.predicateDataLength));
36983
+ parts.push(new NumberCoder("u32").encode(data.length));
36984
+ parts.push(new NumberCoder("u32").encode(value.predicateLength));
36985
+ parts.push(new NumberCoder("u32").encode(value.predicateDataLength));
37366
36986
  parts.push(new ByteArrayCoder(data.length).encode(data));
37367
- parts.push(new ByteArrayCoder(value.predicateLength.toNumber()).encode(value.predicate));
37368
- parts.push(
37369
- new ByteArrayCoder(value.predicateDataLength.toNumber()).encode(value.predicateData)
37370
- );
36987
+ parts.push(new ByteArrayCoder(value.predicateLength).encode(value.predicate));
36988
+ parts.push(new ByteArrayCoder(value.predicateDataLength).encode(value.predicateData));
37371
36989
  return concat(parts);
37372
36990
  }
37373
36991
  static decodeData(messageData) {
@@ -37387,21 +37005,21 @@ This unreleased fuel-core build may include features and updates not yet support
37387
37005
  const amount = decoded;
37388
37006
  [decoded, o] = new B256Coder().decode(data, o);
37389
37007
  const nonce = decoded;
37390
- [decoded, o] = new NumberCoder("u16").decode(data, o);
37008
+ [decoded, o] = new NumberCoder("u8").decode(data, o);
37391
37009
  const witnessIndex = Number(decoded);
37392
37010
  [decoded, o] = new BigNumberCoder("u64").decode(data, o);
37393
37011
  const predicateGasUsed = decoded;
37394
37012
  [decoded, o] = new NumberCoder("u32").decode(data, o);
37395
37013
  const dataLength2 = decoded;
37396
- [decoded, o] = new BigNumberCoder("u64").decode(data, o);
37014
+ [decoded, o] = new NumberCoder("u32").decode(data, o);
37397
37015
  const predicateLength = decoded;
37398
- [decoded, o] = new BigNumberCoder("u64").decode(data, o);
37016
+ [decoded, o] = new NumberCoder("u32").decode(data, o);
37399
37017
  const predicateDataLength = decoded;
37400
37018
  [decoded, o] = new ByteArrayCoder(dataLength2).decode(data, o);
37401
37019
  const messageData = decoded;
37402
- [decoded, o] = new ByteArrayCoder(predicateLength.toNumber()).decode(data, o);
37020
+ [decoded, o] = new ByteArrayCoder(predicateLength).decode(data, o);
37403
37021
  const predicate = decoded;
37404
- [decoded, o] = new ByteArrayCoder(predicateDataLength.toNumber()).decode(data, o);
37022
+ [decoded, o] = new ByteArrayCoder(predicateDataLength).decode(data, o);
37405
37023
  const predicateData = decoded;
37406
37024
  return [
37407
37025
  {
@@ -37713,7 +37331,7 @@ This unreleased fuel-core build may include features and updates not yet support
37713
37331
  }
37714
37332
  };
37715
37333
  var PolicyType = /* @__PURE__ */ ((PolicyType2) => {
37716
- PolicyType2[PolicyType2["Tip"] = 1] = "Tip";
37334
+ PolicyType2[PolicyType2["GasPrice"] = 1] = "GasPrice";
37717
37335
  PolicyType2[PolicyType2["WitnessLimit"] = 2] = "WitnessLimit";
37718
37336
  PolicyType2[PolicyType2["Maturity"] = 4] = "Maturity";
37719
37337
  PolicyType2[PolicyType2["MaxFee"] = 8] = "MaxFee";
@@ -37761,9 +37379,9 @@ This unreleased fuel-core build may include features and updates not yet support
37761
37379
  let o = offset;
37762
37380
  const policies = [];
37763
37381
  if (policyTypes & 1) {
37764
- const [tip, nextOffset] = new BigNumberCoder("u64").decode(data, o);
37382
+ const [gasPrice, nextOffset] = new BigNumberCoder("u64").decode(data, o);
37765
37383
  o = nextOffset;
37766
- policies.push({ type: 1, data: tip });
37384
+ policies.push({ type: 1, data: gasPrice });
37767
37385
  }
37768
37386
  if (policyTypes & 2) {
37769
37387
  const [witnessLimit, nextOffset] = new BigNumberCoder("u64").decode(data, o);
@@ -37995,15 +37613,15 @@ This unreleased fuel-core build may include features and updates not yet support
37995
37613
  encode(value) {
37996
37614
  const parts = [];
37997
37615
  parts.push(new BigNumberCoder("u64").encode(value.scriptGasLimit));
37998
- parts.push(new B256Coder().encode(value.receiptsRoot));
37999
- parts.push(new BigNumberCoder("u64").encode(value.scriptLength));
38000
- parts.push(new BigNumberCoder("u64").encode(value.scriptDataLength));
37616
+ parts.push(new NumberCoder("u32").encode(value.scriptLength));
37617
+ parts.push(new NumberCoder("u32").encode(value.scriptDataLength));
38001
37618
  parts.push(new NumberCoder("u32").encode(value.policyTypes));
38002
- parts.push(new NumberCoder("u16").encode(value.inputsCount));
38003
- parts.push(new NumberCoder("u16").encode(value.outputsCount));
38004
- parts.push(new NumberCoder("u16").encode(value.witnessesCount));
38005
- parts.push(new ByteArrayCoder(value.scriptLength.toNumber()).encode(value.script));
38006
- parts.push(new ByteArrayCoder(value.scriptDataLength.toNumber()).encode(value.scriptData));
37619
+ parts.push(new NumberCoder("u8").encode(value.inputsCount));
37620
+ parts.push(new NumberCoder("u8").encode(value.outputsCount));
37621
+ parts.push(new NumberCoder("u8").encode(value.witnessesCount));
37622
+ parts.push(new B256Coder().encode(value.receiptsRoot));
37623
+ parts.push(new ByteArrayCoder(value.scriptLength).encode(value.script));
37624
+ parts.push(new ByteArrayCoder(value.scriptDataLength).encode(value.scriptData));
38007
37625
  parts.push(new PoliciesCoder().encode(value.policies));
38008
37626
  parts.push(new ArrayCoder(new InputCoder(), value.inputsCount).encode(value.inputs));
38009
37627
  parts.push(new ArrayCoder(new OutputCoder(), value.outputsCount).encode(value.outputs));
@@ -38015,23 +37633,23 @@ This unreleased fuel-core build may include features and updates not yet support
38015
37633
  let o = offset;
38016
37634
  [decoded, o] = new BigNumberCoder("u64").decode(data, o);
38017
37635
  const scriptGasLimit = decoded;
38018
- [decoded, o] = new B256Coder().decode(data, o);
38019
- const receiptsRoot = decoded;
38020
- [decoded, o] = new BigNumberCoder("u64").decode(data, o);
37636
+ [decoded, o] = new NumberCoder("u32").decode(data, o);
38021
37637
  const scriptLength = decoded;
38022
- [decoded, o] = new BigNumberCoder("u64").decode(data, o);
37638
+ [decoded, o] = new NumberCoder("u32").decode(data, o);
38023
37639
  const scriptDataLength = decoded;
38024
37640
  [decoded, o] = new NumberCoder("u32").decode(data, o);
38025
37641
  const policyTypes = decoded;
38026
- [decoded, o] = new NumberCoder("u16").decode(data, o);
37642
+ [decoded, o] = new NumberCoder("u8").decode(data, o);
38027
37643
  const inputsCount = decoded;
38028
- [decoded, o] = new NumberCoder("u16").decode(data, o);
37644
+ [decoded, o] = new NumberCoder("u8").decode(data, o);
38029
37645
  const outputsCount = decoded;
38030
- [decoded, o] = new NumberCoder("u16").decode(data, o);
37646
+ [decoded, o] = new NumberCoder("u8").decode(data, o);
38031
37647
  const witnessesCount = decoded;
38032
- [decoded, o] = new ByteArrayCoder(scriptLength.toNumber()).decode(data, o);
37648
+ [decoded, o] = new B256Coder().decode(data, o);
37649
+ const receiptsRoot = decoded;
37650
+ [decoded, o] = new ByteArrayCoder(scriptLength).decode(data, o);
38033
37651
  const script = decoded;
38034
- [decoded, o] = new ByteArrayCoder(scriptDataLength.toNumber()).decode(data, o);
37652
+ [decoded, o] = new ByteArrayCoder(scriptDataLength).decode(data, o);
38035
37653
  const scriptData = decoded;
38036
37654
  [decoded, o] = new PoliciesCoder().decode(data, o, policyTypes);
38037
37655
  const policies = decoded;
@@ -38069,19 +37687,18 @@ This unreleased fuel-core build may include features and updates not yet support
38069
37687
  }
38070
37688
  encode(value) {
38071
37689
  const parts = [];
38072
- parts.push(new NumberCoder("u16").encode(value.bytecodeWitnessIndex));
38073
- parts.push(new B256Coder().encode(value.salt));
38074
- parts.push(new BigNumberCoder("u64").encode(value.storageSlotsCount));
37690
+ parts.push(new NumberCoder("u32").encode(value.bytecodeLength));
37691
+ parts.push(new NumberCoder("u8").encode(value.bytecodeWitnessIndex));
38075
37692
  parts.push(new NumberCoder("u32").encode(value.policyTypes));
38076
- parts.push(new NumberCoder("u16").encode(value.inputsCount));
38077
- parts.push(new NumberCoder("u16").encode(value.outputsCount));
38078
- parts.push(new NumberCoder("u16").encode(value.witnessesCount));
37693
+ parts.push(new NumberCoder("u16").encode(value.storageSlotsCount));
37694
+ parts.push(new NumberCoder("u8").encode(value.inputsCount));
37695
+ parts.push(new NumberCoder("u8").encode(value.outputsCount));
37696
+ parts.push(new NumberCoder("u8").encode(value.witnessesCount));
37697
+ parts.push(new B256Coder().encode(value.salt));
37698
+ parts.push(new PoliciesCoder().encode(value.policies));
38079
37699
  parts.push(
38080
- new ArrayCoder(new StorageSlotCoder(), value.storageSlotsCount.toNumber()).encode(
38081
- value.storageSlots
38082
- )
37700
+ new ArrayCoder(new StorageSlotCoder(), value.storageSlotsCount).encode(value.storageSlots)
38083
37701
  );
38084
- parts.push(new PoliciesCoder().encode(value.policies));
38085
37702
  parts.push(new ArrayCoder(new InputCoder(), value.inputsCount).encode(value.inputs));
38086
37703
  parts.push(new ArrayCoder(new OutputCoder(), value.outputsCount).encode(value.outputs));
38087
37704
  parts.push(new ArrayCoder(new WitnessCoder(), value.witnessesCount).encode(value.witnesses));
@@ -38090,27 +37707,26 @@ This unreleased fuel-core build may include features and updates not yet support
38090
37707
  decode(data, offset) {
38091
37708
  let decoded;
38092
37709
  let o = offset;
38093
- [decoded, o] = new NumberCoder("u16").decode(data, o);
37710
+ [decoded, o] = new NumberCoder("u32").decode(data, o);
37711
+ const bytecodeLength = decoded;
37712
+ [decoded, o] = new NumberCoder("u8").decode(data, o);
38094
37713
  const bytecodeWitnessIndex = decoded;
38095
- [decoded, o] = new B256Coder().decode(data, o);
38096
- const salt = decoded;
38097
- [decoded, o] = new BigNumberCoder("u64").decode(data, o);
38098
- const storageSlotsCount = decoded;
38099
37714
  [decoded, o] = new NumberCoder("u32").decode(data, o);
38100
37715
  const policyTypes = decoded;
38101
37716
  [decoded, o] = new NumberCoder("u16").decode(data, o);
37717
+ const storageSlotsCount = decoded;
37718
+ [decoded, o] = new NumberCoder("u8").decode(data, o);
38102
37719
  const inputsCount = decoded;
38103
- [decoded, o] = new NumberCoder("u16").decode(data, o);
37720
+ [decoded, o] = new NumberCoder("u8").decode(data, o);
38104
37721
  const outputsCount = decoded;
38105
- [decoded, o] = new NumberCoder("u16").decode(data, o);
37722
+ [decoded, o] = new NumberCoder("u8").decode(data, o);
38106
37723
  const witnessesCount = decoded;
38107
- [decoded, o] = new ArrayCoder(new StorageSlotCoder(), storageSlotsCount.toNumber()).decode(
38108
- data,
38109
- o
38110
- );
38111
- const storageSlots = decoded;
37724
+ [decoded, o] = new B256Coder().decode(data, o);
37725
+ const salt = decoded;
38112
37726
  [decoded, o] = new PoliciesCoder().decode(data, o, policyTypes);
38113
37727
  const policies = decoded;
37728
+ [decoded, o] = new ArrayCoder(new StorageSlotCoder(), storageSlotsCount).decode(data, o);
37729
+ const storageSlots = decoded;
38114
37730
  [decoded, o] = new ArrayCoder(new InputCoder(), inputsCount).decode(data, o);
38115
37731
  const inputs = decoded;
38116
37732
  [decoded, o] = new ArrayCoder(new OutputCoder(), outputsCount).decode(data, o);
@@ -38120,6 +37736,7 @@ This unreleased fuel-core build may include features and updates not yet support
38120
37736
  return [
38121
37737
  {
38122
37738
  type: 1,
37739
+ bytecodeLength,
38123
37740
  bytecodeWitnessIndex,
38124
37741
  policyTypes,
38125
37742
  storageSlotsCount,
@@ -38148,7 +37765,6 @@ This unreleased fuel-core build may include features and updates not yet support
38148
37765
  parts.push(new OutputContractCoder().encode(value.outputContract));
38149
37766
  parts.push(new BigNumberCoder("u64").encode(value.mintAmount));
38150
37767
  parts.push(new B256Coder().encode(value.mintAssetId));
38151
- parts.push(new BigNumberCoder("u64").encode(value.gasPrice));
38152
37768
  return concat(parts);
38153
37769
  }
38154
37770
  decode(data, offset) {
@@ -38164,8 +37780,6 @@ This unreleased fuel-core build may include features and updates not yet support
38164
37780
  const mintAmount = decoded;
38165
37781
  [decoded, o] = new B256Coder().decode(data, o);
38166
37782
  const mintAssetId = decoded;
38167
- [decoded, o] = new BigNumberCoder("u64").decode(data, o);
38168
- const gasPrice = decoded;
38169
37783
  return [
38170
37784
  {
38171
37785
  type: 2,
@@ -38173,8 +37787,7 @@ This unreleased fuel-core build may include features and updates not yet support
38173
37787
  inputContract,
38174
37788
  outputContract,
38175
37789
  mintAmount,
38176
- mintAssetId,
38177
- gasPrice
37790
+ mintAssetId
38178
37791
  },
38179
37792
  o
38180
37793
  ];
@@ -38481,6 +38094,159 @@ This unreleased fuel-core build may include features and updates not yet support
38481
38094
  // src/providers/provider.ts
38482
38095
  var import_graphql_request = __toESM(require_dist2());
38483
38096
 
38097
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isPlaceholder.js
38098
+ function _isPlaceholder(a) {
38099
+ return a != null && typeof a === "object" && a["@@functional/placeholder"] === true;
38100
+ }
38101
+
38102
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_curry1.js
38103
+ function _curry1(fn) {
38104
+ return function f1(a) {
38105
+ if (arguments.length === 0 || _isPlaceholder(a)) {
38106
+ return f1;
38107
+ } else {
38108
+ return fn.apply(this, arguments);
38109
+ }
38110
+ };
38111
+ }
38112
+
38113
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isArray.js
38114
+ var isArray_default = Array.isArray || function _isArray(val) {
38115
+ return val != null && val.length >= 0 && Object.prototype.toString.call(val) === "[object Array]";
38116
+ };
38117
+
38118
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/type.js
38119
+ var type = /* @__PURE__ */ _curry1(function type2(val) {
38120
+ return val === null ? "Null" : val === void 0 ? "Undefined" : Object.prototype.toString.call(val).slice(8, -1);
38121
+ });
38122
+ var type_default = type;
38123
+
38124
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_toISOString.js
38125
+ var pad = function pad2(n) {
38126
+ return (n < 10 ? "0" : "") + n;
38127
+ };
38128
+ var _toISOString = typeof Date.prototype.toISOString === "function" ? function _toISOString2(d) {
38129
+ return d.toISOString();
38130
+ } : function _toISOString3(d) {
38131
+ 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";
38132
+ };
38133
+
38134
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isInteger.js
38135
+ var isInteger_default = Number.isInteger || function _isInteger(n) {
38136
+ return n << 0 === n;
38137
+ };
38138
+
38139
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_cloneRegExp.js
38140
+ function _cloneRegExp(pattern) {
38141
+ 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" : ""));
38142
+ }
38143
+
38144
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_clone.js
38145
+ function _clone(value, deep, map) {
38146
+ map || (map = new _ObjectMap());
38147
+ if (_isPrimitive(value)) {
38148
+ return value;
38149
+ }
38150
+ var copy = function copy2(copiedValue) {
38151
+ var cachedCopy = map.get(value);
38152
+ if (cachedCopy) {
38153
+ return cachedCopy;
38154
+ }
38155
+ map.set(value, copiedValue);
38156
+ for (var key in value) {
38157
+ if (Object.prototype.hasOwnProperty.call(value, key)) {
38158
+ copiedValue[key] = deep ? _clone(value[key], true, map) : value[key];
38159
+ }
38160
+ }
38161
+ return copiedValue;
38162
+ };
38163
+ switch (type_default(value)) {
38164
+ case "Object":
38165
+ return copy(Object.create(Object.getPrototypeOf(value)));
38166
+ case "Array":
38167
+ return copy([]);
38168
+ case "Date":
38169
+ return new Date(value.valueOf());
38170
+ case "RegExp":
38171
+ return _cloneRegExp(value);
38172
+ case "Int8Array":
38173
+ case "Uint8Array":
38174
+ case "Uint8ClampedArray":
38175
+ case "Int16Array":
38176
+ case "Uint16Array":
38177
+ case "Int32Array":
38178
+ case "Uint32Array":
38179
+ case "Float32Array":
38180
+ case "Float64Array":
38181
+ case "BigInt64Array":
38182
+ case "BigUint64Array":
38183
+ return value.slice();
38184
+ default:
38185
+ return value;
38186
+ }
38187
+ }
38188
+ function _isPrimitive(param) {
38189
+ var type3 = typeof param;
38190
+ return param == null || type3 != "object" && type3 != "function";
38191
+ }
38192
+ var _ObjectMap = /* @__PURE__ */ function() {
38193
+ function _ObjectMap2() {
38194
+ this.map = {};
38195
+ this.length = 0;
38196
+ }
38197
+ _ObjectMap2.prototype.set = function(key, value) {
38198
+ const hashedKey = this.hash(key);
38199
+ let bucket = this.map[hashedKey];
38200
+ if (!bucket) {
38201
+ this.map[hashedKey] = bucket = [];
38202
+ }
38203
+ bucket.push([key, value]);
38204
+ this.length += 1;
38205
+ };
38206
+ _ObjectMap2.prototype.hash = function(key) {
38207
+ let hashedKey = [];
38208
+ for (var value in key) {
38209
+ hashedKey.push(Object.prototype.toString.call(key[value]));
38210
+ }
38211
+ return hashedKey.join();
38212
+ };
38213
+ _ObjectMap2.prototype.get = function(key) {
38214
+ if (this.length <= 180) {
38215
+ for (const p in this.map) {
38216
+ const bucket2 = this.map[p];
38217
+ for (let i = 0; i < bucket2.length; i += 1) {
38218
+ const element = bucket2[i];
38219
+ if (element[0] === key) {
38220
+ return element[1];
38221
+ }
38222
+ }
38223
+ }
38224
+ return;
38225
+ }
38226
+ const hashedKey = this.hash(key);
38227
+ const bucket = this.map[hashedKey];
38228
+ if (!bucket) {
38229
+ return;
38230
+ }
38231
+ for (let i = 0; i < bucket.length; i += 1) {
38232
+ const element = bucket[i];
38233
+ if (element[0] === key) {
38234
+ return element[1];
38235
+ }
38236
+ }
38237
+ };
38238
+ return _ObjectMap2;
38239
+ }();
38240
+
38241
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/clone.js
38242
+ var clone2 = /* @__PURE__ */ _curry1(function clone3(value) {
38243
+ return value != null && typeof value.clone === "function" ? value.clone() : _clone(value, true);
38244
+ });
38245
+ var clone_default = clone2;
38246
+
38247
+ // ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/trim.js
38248
+ var hasProtoTrim = typeof String.prototype.trim === "function";
38249
+
38484
38250
  // ../../node_modules/.pnpm/tslib@2.6.0/node_modules/tslib/tslib.es6.mjs
38485
38251
  var __assign = function() {
38486
38252
  __assign = Object.assign || function __assign2(t) {
@@ -41648,10 +41414,14 @@ spurious results.`);
41648
41414
  // src/providers/__generated__/operations.ts
41649
41415
  var ReceiptFragmentFragmentDoc = lib_default2`
41650
41416
  fragment receiptFragment on Receipt {
41651
- id
41417
+ contract {
41418
+ id
41419
+ }
41652
41420
  pc
41653
41421
  is
41654
- to
41422
+ to {
41423
+ id
41424
+ }
41655
41425
  toAddress
41656
41426
  amount
41657
41427
  assetId
@@ -41689,16 +41459,10 @@ spurious results.`);
41689
41459
  id
41690
41460
  }
41691
41461
  time
41692
- receipts {
41693
- ...receiptFragment
41694
- }
41695
41462
  programState {
41696
41463
  returnType
41697
41464
  data
41698
41465
  }
41699
- receipts {
41700
- ...receiptFragment
41701
- }
41702
41466
  }
41703
41467
  ... on FailureStatus {
41704
41468
  block {
@@ -41706,24 +41470,26 @@ spurious results.`);
41706
41470
  }
41707
41471
  time
41708
41472
  reason
41709
- receipts {
41710
- ...receiptFragment
41711
- }
41712
41473
  }
41713
41474
  ... on SqueezedOutStatus {
41714
41475
  reason
41715
41476
  }
41716
41477
  }
41717
- ${ReceiptFragmentFragmentDoc}`;
41478
+ `;
41718
41479
  var TransactionFragmentFragmentDoc = lib_default2`
41719
41480
  fragment transactionFragment on Transaction {
41720
41481
  id
41721
41482
  rawPayload
41483
+ gasPrice
41484
+ receipts {
41485
+ ...receiptFragment
41486
+ }
41722
41487
  status {
41723
41488
  ...transactionStatusFragment
41724
41489
  }
41725
41490
  }
41726
- ${TransactionStatusFragmentFragmentDoc}`;
41491
+ ${ReceiptFragmentFragmentDoc}
41492
+ ${TransactionStatusFragmentFragmentDoc}`;
41727
41493
  var InputEstimatePredicatesFragmentFragmentDoc = lib_default2`
41728
41494
  fragment inputEstimatePredicatesFragment on Input {
41729
41495
  ... on InputCoin {
@@ -41741,46 +41507,6 @@ spurious results.`);
41741
41507
  }
41742
41508
  }
41743
41509
  ${InputEstimatePredicatesFragmentFragmentDoc}`;
41744
- var DryRunFailureStatusFragmentFragmentDoc = lib_default2`
41745
- fragment dryRunFailureStatusFragment on DryRunFailureStatus {
41746
- reason
41747
- programState {
41748
- returnType
41749
- data
41750
- }
41751
- }
41752
- `;
41753
- var DryRunSuccessStatusFragmentFragmentDoc = lib_default2`
41754
- fragment dryRunSuccessStatusFragment on DryRunSuccessStatus {
41755
- programState {
41756
- returnType
41757
- data
41758
- }
41759
- }
41760
- `;
41761
- var DryRunTransactionStatusFragmentFragmentDoc = lib_default2`
41762
- fragment dryRunTransactionStatusFragment on DryRunTransactionStatus {
41763
- ... on DryRunFailureStatus {
41764
- ...dryRunFailureStatusFragment
41765
- }
41766
- ... on DryRunSuccessStatus {
41767
- ...dryRunSuccessStatusFragment
41768
- }
41769
- }
41770
- ${DryRunFailureStatusFragmentFragmentDoc}
41771
- ${DryRunSuccessStatusFragmentFragmentDoc}`;
41772
- var DryRunTransactionExecutionStatusFragmentFragmentDoc = lib_default2`
41773
- fragment dryRunTransactionExecutionStatusFragment on DryRunTransactionExecutionStatus {
41774
- id
41775
- status {
41776
- ...dryRunTransactionStatusFragment
41777
- }
41778
- receipts {
41779
- ...receiptFragment
41780
- }
41781
- }
41782
- ${DryRunTransactionStatusFragmentFragmentDoc}
41783
- ${ReceiptFragmentFragmentDoc}`;
41784
41510
  var CoinFragmentFragmentDoc = lib_default2`
41785
41511
  fragment coinFragment on Coin {
41786
41512
  __typename
@@ -41788,6 +41514,7 @@ ${ReceiptFragmentFragmentDoc}`;
41788
41514
  owner
41789
41515
  amount
41790
41516
  assetId
41517
+ maturity
41791
41518
  blockCreated
41792
41519
  txCreatedIdx
41793
41520
  }
@@ -41832,6 +41559,7 @@ ${ReceiptFragmentFragmentDoc}`;
41832
41559
  prevRoot
41833
41560
  time
41834
41561
  applicationHash
41562
+ messageReceiptRoot
41835
41563
  messageReceiptCount
41836
41564
  }
41837
41565
  commitBlockHeader {
@@ -41843,6 +41571,7 @@ ${ReceiptFragmentFragmentDoc}`;
41843
41571
  prevRoot
41844
41572
  time
41845
41573
  applicationHash
41574
+ messageReceiptRoot
41846
41575
  messageReceiptCount
41847
41576
  }
41848
41577
  sender
@@ -41862,8 +41591,8 @@ ${ReceiptFragmentFragmentDoc}`;
41862
41591
  var BlockFragmentFragmentDoc = lib_default2`
41863
41592
  fragment blockFragment on Block {
41864
41593
  id
41865
- height
41866
41594
  header {
41595
+ height
41867
41596
  time
41868
41597
  }
41869
41598
  transactions {
@@ -41921,11 +41650,6 @@ ${ReceiptFragmentFragmentDoc}`;
41921
41650
  `;
41922
41651
  var GasCostsFragmentFragmentDoc = lib_default2`
41923
41652
  fragment GasCostsFragment on GasCosts {
41924
- version {
41925
- ... on Version {
41926
- value
41927
- }
41928
- }
41929
41653
  add
41930
41654
  addi
41931
41655
  aloc
@@ -41938,6 +41662,7 @@ ${ReceiptFragmentFragmentDoc}`;
41938
41662
  cb
41939
41663
  cfei
41940
41664
  cfsi
41665
+ croo
41941
41666
  div
41942
41667
  divi
41943
41668
  ecr1
@@ -42020,9 +41745,6 @@ ${ReceiptFragmentFragmentDoc}`;
42020
41745
  ccp {
42021
41746
  ...DependentCostFragment
42022
41747
  }
42023
- croo {
42024
- ...DependentCostFragment
42025
- }
42026
41748
  csiz {
42027
41749
  ...DependentCostFragment
42028
41750
  }
@@ -42082,11 +41804,6 @@ ${ReceiptFragmentFragmentDoc}`;
42082
41804
  ${DependentCostFragmentFragmentDoc}`;
42083
41805
  var ConsensusParametersFragmentFragmentDoc = lib_default2`
42084
41806
  fragment consensusParametersFragment on ConsensusParameters {
42085
- version {
42086
- ... on Version {
42087
- value
42088
- }
42089
- }
42090
41807
  txParams {
42091
41808
  ...TxParametersFragment
42092
41809
  }
@@ -42146,9 +41863,18 @@ ${ConsensusParametersFragmentFragmentDoc}`;
42146
41863
  fragment nodeInfoFragment on NodeInfo {
42147
41864
  utxoValidation
42148
41865
  vmBacktrace
41866
+ minGasPrice
42149
41867
  maxTx
42150
41868
  maxDepth
42151
41869
  nodeVersion
41870
+ peers {
41871
+ id
41872
+ addresses
41873
+ clientVersion
41874
+ blockHeight
41875
+ lastHeartbeatMs
41876
+ appScore
41877
+ }
42152
41878
  }
42153
41879
  `;
42154
41880
  var GetVersionDocument = lib_default2`
@@ -42183,9 +41909,13 @@ ${ConsensusParametersFragmentFragmentDoc}`;
42183
41909
  query getTransactionWithReceipts($transactionId: TransactionId!) {
42184
41910
  transaction(id: $transactionId) {
42185
41911
  ...transactionFragment
41912
+ receipts {
41913
+ ...receiptFragment
41914
+ }
42186
41915
  }
42187
41916
  }
42188
- ${TransactionFragmentFragmentDoc}`;
41917
+ ${TransactionFragmentFragmentDoc}
41918
+ ${ReceiptFragmentFragmentDoc}`;
42189
41919
  var GetTransactionsDocument = lib_default2`
42190
41920
  query getTransactions($after: String, $before: String, $first: Int, $last: Int) {
42191
41921
  transactions(after: $after, before: $before, first: $first, last: $last) {
@@ -42313,20 +42043,6 @@ ${MessageCoinFragmentFragmentDoc}`;
42313
42043
  }
42314
42044
  }
42315
42045
  ${BalanceFragmentFragmentDoc}`;
42316
- var GetLatestGasPriceDocument = lib_default2`
42317
- query getLatestGasPrice {
42318
- latestGasPrice {
42319
- gasPrice
42320
- }
42321
- }
42322
- `;
42323
- var EstimateGasPriceDocument = lib_default2`
42324
- query estimateGasPrice($blockHorizon: U32!) {
42325
- estimateGasPrice(blockHorizon: $blockHorizon) {
42326
- gasPrice
42327
- }
42328
- }
42329
- `;
42330
42046
  var GetBalancesDocument = lib_default2`
42331
42047
  query getBalances($filter: BalanceFilterInput!, $after: String, $before: String, $first: Int, $last: Int) {
42332
42048
  balances(
@@ -42381,12 +42097,12 @@ ${MessageCoinFragmentFragmentDoc}`;
42381
42097
  }
42382
42098
  `;
42383
42099
  var DryRunDocument = lib_default2`
42384
- mutation dryRun($encodedTransactions: [HexString!]!, $utxoValidation: Boolean) {
42385
- dryRun(txs: $encodedTransactions, utxoValidation: $utxoValidation) {
42386
- ...dryRunTransactionExecutionStatusFragment
42100
+ mutation dryRun($encodedTransaction: HexString!, $utxoValidation: Boolean) {
42101
+ dryRun(tx: $encodedTransaction, utxoValidation: $utxoValidation) {
42102
+ ...receiptFragment
42387
42103
  }
42388
42104
  }
42389
- ${DryRunTransactionExecutionStatusFragmentFragmentDoc}`;
42105
+ ${ReceiptFragmentFragmentDoc}`;
42390
42106
  var SubmitDocument = lib_default2`
42391
42107
  mutation submit($encodedTransaction: HexString!) {
42392
42108
  submit(tx: $encodedTransaction) {
@@ -42469,12 +42185,6 @@ ${MessageCoinFragmentFragmentDoc}`;
42469
42185
  getBalance(variables, options) {
42470
42186
  return requester(GetBalanceDocument, variables, options);
42471
42187
  },
42472
- getLatestGasPrice(variables, options) {
42473
- return requester(GetLatestGasPriceDocument, variables, options);
42474
- },
42475
- estimateGasPrice(variables, options) {
42476
- return requester(EstimateGasPriceDocument, variables, options);
42477
- },
42478
42188
  getBalances(variables, options) {
42479
42189
  return requester(GetBalancesDocument, variables, options);
42480
42190
  },
@@ -42542,14 +42252,11 @@ ${MessageCoinFragmentFragmentDoc}`;
42542
42252
  let data;
42543
42253
  let errors;
42544
42254
  try {
42545
- const sanitizedText = text.replace(/\s/g, "");
42546
- ({ data, errors } = JSON.parse(sanitizedText.replace(/^data:/, "")));
42255
+ ({ data, errors } = JSON.parse(text.replace(/^data:/, "")));
42547
42256
  } catch (e) {
42548
42257
  throw new FuelError(
42549
42258
  ErrorCode.STREAM_PARSING_ERROR,
42550
- `Error while parsing stream data response: ${text}
42551
-
42552
- Thrown error: ${e}`
42259
+ `Error while parsing stream data response: ${text}`
42553
42260
  );
42554
42261
  }
42555
42262
  if (Array.isArray(errors)) {
@@ -42643,7 +42350,7 @@ Thrown error: ${e}`
42643
42350
  return {
42644
42351
  type: InputType.Coin,
42645
42352
  txID: hexlify(arrayify(value.id).slice(0, 32)),
42646
- outputIndex: toNumber2(arrayify(value.id).slice(32, 34)),
42353
+ outputIndex: toNumber2(arrayify(value.id).slice(32, 33)),
42647
42354
  owner: hexlify(value.owner),
42648
42355
  amount: bn(value.amount),
42649
42356
  assetId: hexlify(value.assetId),
@@ -42652,9 +42359,10 @@ Thrown error: ${e}`
42652
42359
  txIndex: toNumber2(arrayify(value.txPointer).slice(8, 16))
42653
42360
  },
42654
42361
  witnessIndex: value.witnessIndex,
42362
+ maturity: value.maturity ?? 0,
42655
42363
  predicateGasUsed: bn(value.predicateGasUsed),
42656
- predicateLength: bn(predicate.length),
42657
- predicateDataLength: bn(predicateData.length),
42364
+ predicateLength: predicate.length,
42365
+ predicateDataLength: predicateData.length,
42658
42366
  predicate: hexlify(predicate),
42659
42367
  predicateData: hexlify(predicateData)
42660
42368
  };
@@ -42685,8 +42393,8 @@ Thrown error: ${e}`
42685
42393
  nonce: hexlify(value.nonce),
42686
42394
  witnessIndex: value.witnessIndex,
42687
42395
  predicateGasUsed: bn(value.predicateGasUsed),
42688
- predicateLength: bn(predicate.length),
42689
- predicateDataLength: bn(predicateData.length),
42396
+ predicateLength: predicate.length,
42397
+ predicateDataLength: predicateData.length,
42690
42398
  predicate: hexlify(predicate),
42691
42399
  predicateData: hexlify(predicateData),
42692
42400
  data: hexlify(data),
@@ -42843,8 +42551,8 @@ Thrown error: ${e}`
42843
42551
  case "CALL" /* Call */: {
42844
42552
  const callReceipt = {
42845
42553
  type: ReceiptType.Call,
42846
- from: hexOrZero(receipt.id || receipt.contractId),
42847
- to: hexOrZero(receipt?.to),
42554
+ from: hexOrZero(receipt.contract?.id),
42555
+ to: hexOrZero(receipt?.to?.id),
42848
42556
  amount: bn(receipt.amount),
42849
42557
  assetId: hexOrZero(receipt.assetId),
42850
42558
  gas: bn(receipt.gas),
@@ -42858,7 +42566,7 @@ Thrown error: ${e}`
42858
42566
  case "RETURN" /* Return */: {
42859
42567
  const returnReceipt = {
42860
42568
  type: ReceiptType.Return,
42861
- id: hexOrZero(receipt.id || receipt.contractId),
42569
+ id: hexOrZero(receipt.contract?.id),
42862
42570
  val: bn(receipt.val),
42863
42571
  pc: bn(receipt.pc),
42864
42572
  is: bn(receipt.is)
@@ -42868,7 +42576,7 @@ Thrown error: ${e}`
42868
42576
  case "RETURN_DATA" /* ReturnData */: {
42869
42577
  const returnDataReceipt = {
42870
42578
  type: ReceiptType.ReturnData,
42871
- id: hexOrZero(receipt.id || receipt.contractId),
42579
+ id: hexOrZero(receipt.contract?.id),
42872
42580
  ptr: bn(receipt.ptr),
42873
42581
  len: bn(receipt.len),
42874
42582
  digest: hexOrZero(receipt.digest),
@@ -42880,7 +42588,7 @@ Thrown error: ${e}`
42880
42588
  case "PANIC" /* Panic */: {
42881
42589
  const panicReceipt = {
42882
42590
  type: ReceiptType.Panic,
42883
- id: hexOrZero(receipt.id),
42591
+ id: hexOrZero(receipt.contract?.id),
42884
42592
  reason: bn(receipt.reason),
42885
42593
  pc: bn(receipt.pc),
42886
42594
  is: bn(receipt.is),
@@ -42891,7 +42599,7 @@ Thrown error: ${e}`
42891
42599
  case "REVERT" /* Revert */: {
42892
42600
  const revertReceipt = {
42893
42601
  type: ReceiptType.Revert,
42894
- id: hexOrZero(receipt.id || receipt.contractId),
42602
+ id: hexOrZero(receipt.contract?.id),
42895
42603
  val: bn(receipt.ra),
42896
42604
  pc: bn(receipt.pc),
42897
42605
  is: bn(receipt.is)
@@ -42901,7 +42609,7 @@ Thrown error: ${e}`
42901
42609
  case "LOG" /* Log */: {
42902
42610
  const logReceipt = {
42903
42611
  type: ReceiptType.Log,
42904
- id: hexOrZero(receipt.id || receipt.contractId),
42612
+ id: hexOrZero(receipt.contract?.id),
42905
42613
  val0: bn(receipt.ra),
42906
42614
  val1: bn(receipt.rb),
42907
42615
  val2: bn(receipt.rc),
@@ -42914,7 +42622,7 @@ Thrown error: ${e}`
42914
42622
  case "LOG_DATA" /* LogData */: {
42915
42623
  const logDataReceipt = {
42916
42624
  type: ReceiptType.LogData,
42917
- id: hexOrZero(receipt.id || receipt.contractId),
42625
+ id: hexOrZero(receipt.contract?.id),
42918
42626
  val0: bn(receipt.ra),
42919
42627
  val1: bn(receipt.rb),
42920
42628
  ptr: bn(receipt.ptr),
@@ -42928,8 +42636,8 @@ Thrown error: ${e}`
42928
42636
  case "TRANSFER" /* Transfer */: {
42929
42637
  const transferReceipt = {
42930
42638
  type: ReceiptType.Transfer,
42931
- from: hexOrZero(receipt.id || receipt.contractId),
42932
- to: hexOrZero(receipt.toAddress || receipt?.to),
42639
+ from: hexOrZero(receipt.contract?.id),
42640
+ to: hexOrZero(receipt.toAddress || receipt?.to?.id),
42933
42641
  amount: bn(receipt.amount),
42934
42642
  assetId: hexOrZero(receipt.assetId),
42935
42643
  pc: bn(receipt.pc),
@@ -42940,8 +42648,8 @@ Thrown error: ${e}`
42940
42648
  case "TRANSFER_OUT" /* TransferOut */: {
42941
42649
  const transferOutReceipt = {
42942
42650
  type: ReceiptType.TransferOut,
42943
- from: hexOrZero(receipt.id || receipt.contractId),
42944
- to: hexOrZero(receipt.toAddress || receipt.to),
42651
+ from: hexOrZero(receipt.contract?.id),
42652
+ to: hexOrZero(receipt.toAddress || receipt.to?.id),
42945
42653
  amount: bn(receipt.amount),
42946
42654
  assetId: hexOrZero(receipt.assetId),
42947
42655
  pc: bn(receipt.pc),
@@ -42984,7 +42692,7 @@ Thrown error: ${e}`
42984
42692
  return receiptMessageOut;
42985
42693
  }
42986
42694
  case "MINT" /* Mint */: {
42987
- const contractId = hexOrZero(receipt.id || receipt.contractId);
42695
+ const contractId = hexOrZero(receipt.contract?.id);
42988
42696
  const subId = hexOrZero(receipt.subId);
42989
42697
  const assetId = ReceiptMintCoder.getAssetId(contractId, subId);
42990
42698
  const mintReceipt = {
@@ -42999,7 +42707,7 @@ Thrown error: ${e}`
42999
42707
  return mintReceipt;
43000
42708
  }
43001
42709
  case "BURN" /* Burn */: {
43002
- const contractId = hexOrZero(receipt.id || receipt.contractId);
42710
+ const contractId = hexOrZero(receipt.contract?.id);
43003
42711
  const subId = hexOrZero(receipt.subId);
43004
42712
  const assetId = ReceiptBurnCoder.getAssetId(contractId, subId);
43005
42713
  const burnReceipt = {
@@ -43019,6 +42727,7 @@ Thrown error: ${e}`
43019
42727
  }
43020
42728
 
43021
42729
  // src/providers/utils/gas.ts
42730
+ var calculatePriceWithFactor = (gas, gasPrice, priceFactor) => bn(Math.ceil(gas.mul(gasPrice).toNumber() / priceFactor.toNumber()));
43022
42731
  var getGasUsedFromReceipts = (receipts) => {
43023
42732
  const scriptResult = receipts.filter(
43024
42733
  (receipt) => receipt.type === ReceiptType.ScriptResult
@@ -43039,28 +42748,18 @@ Thrown error: ${e}`
43039
42748
  }
43040
42749
  function gasUsedByInputs(inputs, txBytesSize, gasCosts) {
43041
42750
  const witnessCache = [];
43042
- const chargeableInputs = inputs.filter((input) => {
43043
- const isCoinOrMessage = "owner" in input || "sender" in input;
43044
- if (isCoinOrMessage) {
43045
- if ("predicate" in input && input.predicate && input.predicate !== "0x") {
43046
- return true;
43047
- }
43048
- if (!witnessCache.includes(input.witnessIndex)) {
43049
- witnessCache.push(input.witnessIndex);
43050
- return true;
43051
- }
43052
- }
43053
- return false;
43054
- });
43055
- const vmInitializationCost = resolveGasDependentCosts(txBytesSize, gasCosts.vmInitialization);
43056
- const totalGas = chargeableInputs.reduce((total, input) => {
42751
+ const totalGas = inputs.reduce((total, input) => {
43057
42752
  if ("predicate" in input && input.predicate && input.predicate !== "0x") {
43058
42753
  return total.add(
43059
- vmInitializationCost.add(resolveGasDependentCosts(arrayify(input.predicate).length, gasCosts.contractRoot)).add(bn(input.predicateGasUsed))
42754
+ resolveGasDependentCosts(txBytesSize, gasCosts.vmInitialization).add(resolveGasDependentCosts(arrayify(input.predicate).length, gasCosts.contractRoot)).add(bn(input.predicateGasUsed))
43060
42755
  );
43061
42756
  }
43062
- return total.add(gasCosts.ecr1);
43063
- }, bn(0));
42757
+ if ("witnessIndex" in input && !witnessCache.includes(input.witnessIndex)) {
42758
+ witnessCache.push(input.witnessIndex);
42759
+ return total.add(gasCosts.ecr1);
42760
+ }
42761
+ return total;
42762
+ }, bn());
43064
42763
  return totalGas;
43065
42764
  }
43066
42765
  function getMinGas(params) {
@@ -43072,20 +42771,12 @@ Thrown error: ${e}`
43072
42771
  return minGas;
43073
42772
  }
43074
42773
  function getMaxGas(params) {
43075
- const {
43076
- gasPerByte,
43077
- witnessesLength,
43078
- witnessLimit,
43079
- minGas,
43080
- gasLimit = bn(0),
43081
- maxGasPerTx
43082
- } = params;
42774
+ const { gasPerByte, witnessesLength, witnessLimit, minGas, gasLimit = bn(0) } = params;
43083
42775
  let remainingAllowedWitnessGas = bn(0);
43084
42776
  if (witnessLimit?.gt(0) && witnessLimit.gte(witnessesLength)) {
43085
42777
  remainingAllowedWitnessGas = bn(witnessLimit).sub(witnessesLength).mul(gasPerByte);
43086
42778
  }
43087
- const maxGas = remainingAllowedWitnessGas.add(minGas).add(gasLimit);
43088
- return maxGas.gte(maxGasPerTx) ? maxGasPerTx : maxGas;
42779
+ return remainingAllowedWitnessGas.add(minGas).add(gasLimit);
43089
42780
  }
43090
42781
  function calculateMetadataGasForTxCreate({
43091
42782
  gasCosts,
@@ -43107,10 +42798,6 @@ Thrown error: ${e}`
43107
42798
  }) {
43108
42799
  return resolveGasDependentCosts(txBytesSize, gasCosts.s256);
43109
42800
  }
43110
- var calculateGasFee = (params) => {
43111
- const { gas, gasPrice, priceFactor, tip } = params;
43112
- return gas.mul(gasPrice).div(priceFactor).add(tip);
43113
- };
43114
42801
 
43115
42802
  // src/providers/utils/json.ts
43116
42803
  function normalize2(object) {
@@ -43240,7 +42927,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43240
42927
  // src/providers/transaction-request/transaction-request.ts
43241
42928
  var BaseTransactionRequest = class {
43242
42929
  /** Gas price for transaction */
43243
- tip;
42930
+ gasPrice;
43244
42931
  /** Block until which tx cannot be included */
43245
42932
  maturity;
43246
42933
  /** The maximum fee payable by this transaction using BASE_ASSET. */
@@ -43259,7 +42946,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43259
42946
  * @param baseTransactionRequest - Optional object containing properties to initialize the transaction request.
43260
42947
  */
43261
42948
  constructor({
43262
- tip,
42949
+ gasPrice,
43263
42950
  maturity,
43264
42951
  maxFee,
43265
42952
  witnessLimit,
@@ -43267,7 +42954,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43267
42954
  outputs,
43268
42955
  witnesses
43269
42956
  } = {}) {
43270
- this.tip = bn(tip);
42957
+ this.gasPrice = bn(gasPrice);
43271
42958
  this.maturity = maturity ?? 0;
43272
42959
  this.witnessLimit = witnessLimit ? bn(witnessLimit) : void 0;
43273
42960
  this.maxFee = maxFee ? bn(maxFee) : void 0;
@@ -43278,9 +42965,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43278
42965
  static getPolicyMeta(req) {
43279
42966
  let policyTypes = 0;
43280
42967
  const policies = [];
43281
- if (req.tip) {
43282
- policyTypes += PolicyType.Tip;
43283
- policies.push({ data: req.tip, type: PolicyType.Tip });
42968
+ if (req.gasPrice) {
42969
+ policyTypes += PolicyType.GasPrice;
42970
+ policies.push({ data: req.gasPrice, type: PolicyType.GasPrice });
43284
42971
  }
43285
42972
  if (req.witnessLimit) {
43286
42973
  policyTypes += PolicyType.WitnessLimit;
@@ -43467,10 +43154,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43467
43154
  * @param predicate - Predicate bytes.
43468
43155
  * @param predicateData - Predicate data bytes.
43469
43156
  */
43470
- addCoinInput(coin) {
43157
+ addCoinInput(coin, predicate) {
43471
43158
  const { assetId, owner, amount } = coin;
43472
43159
  let witnessIndex;
43473
- if (coin.predicate) {
43160
+ if (predicate) {
43474
43161
  witnessIndex = 0;
43475
43162
  } else {
43476
43163
  witnessIndex = this.getCoinInputWitnessIndexByOwner(owner);
@@ -43485,7 +43172,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43485
43172
  amount,
43486
43173
  assetId,
43487
43174
  txPointer: "0x00000000000000000000000000000000",
43488
- witnessIndex
43175
+ witnessIndex,
43176
+ predicate: predicate?.bytes
43489
43177
  };
43490
43178
  this.pushInput(input);
43491
43179
  this.addChangeOutput(owner, assetId);
@@ -43498,11 +43186,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43498
43186
  * @param predicate - Predicate bytes.
43499
43187
  * @param predicateData - Predicate data bytes.
43500
43188
  */
43501
- addMessageInput(message) {
43189
+ addMessageInput(message, predicate) {
43502
43190
  const { recipient, sender, amount } = message;
43503
43191
  const assetId = BaseAssetId;
43504
43192
  let witnessIndex;
43505
- if (message.predicate) {
43193
+ if (predicate) {
43506
43194
  witnessIndex = 0;
43507
43195
  } else {
43508
43196
  witnessIndex = this.getCoinInputWitnessIndexByOwner(recipient);
@@ -43516,7 +43204,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43516
43204
  sender: sender.toB256(),
43517
43205
  recipient: recipient.toB256(),
43518
43206
  amount,
43519
- witnessIndex
43207
+ witnessIndex,
43208
+ predicate: predicate?.bytes
43520
43209
  };
43521
43210
  this.pushInput(input);
43522
43211
  this.addChangeOutput(recipient, assetId);
@@ -43547,6 +43236,32 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43547
43236
  resources.forEach((resource) => this.addResource(resource));
43548
43237
  return this;
43549
43238
  }
43239
+ /**
43240
+ * Adds multiple resources to the transaction by adding coin/message inputs and change
43241
+ * outputs from the related assetIds.
43242
+ *
43243
+ * @param resources - The resources to add.
43244
+ * @returns This transaction.
43245
+ */
43246
+ addPredicateResource(resource, predicate) {
43247
+ if (isCoin(resource)) {
43248
+ this.addCoinInput(resource, predicate);
43249
+ } else {
43250
+ this.addMessageInput(resource, predicate);
43251
+ }
43252
+ return this;
43253
+ }
43254
+ /**
43255
+ * Adds multiple predicate coin/message inputs to the transaction and change outputs
43256
+ * from the related assetIds.
43257
+ *
43258
+ * @param resources - The resources to add.
43259
+ * @returns This transaction.
43260
+ */
43261
+ addPredicateResources(resources, predicate) {
43262
+ resources.forEach((resource) => this.addPredicateResource(resource, predicate));
43263
+ return this;
43264
+ }
43550
43265
  /**
43551
43266
  * Adds a coin output to the transaction.
43552
43267
  *
@@ -43626,7 +43341,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43626
43341
  }
43627
43342
  calculateMaxGas(chainInfo, minGas) {
43628
43343
  const { consensusParameters } = chainInfo;
43629
- const { gasPerByte, maxGasPerTx } = consensusParameters;
43344
+ const { gasPerByte } = consensusParameters;
43630
43345
  const witnessesLength = this.toTransaction().witnesses.reduce(
43631
43346
  (acc, wit) => acc + wit.dataLength,
43632
43347
  0
@@ -43635,8 +43350,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43635
43350
  gasPerByte,
43636
43351
  minGas,
43637
43352
  witnessesLength,
43638
- witnessLimit: this.witnessLimit,
43639
- maxGasPerTx
43353
+ witnessLimit: this.witnessLimit
43640
43354
  });
43641
43355
  }
43642
43356
  /**
@@ -43654,20 +43368,17 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43654
43368
  });
43655
43369
  const updateAssetInput = (assetId, quantity) => {
43656
43370
  const assetInput = findAssetInput(assetId);
43657
- let usedQuantity = quantity;
43658
- if (assetId === BaseAssetId) {
43659
- usedQuantity = bn("1000000000000000000");
43660
- }
43661
43371
  if (assetInput && "assetId" in assetInput) {
43662
- assetInput.id = hexlify(randomBytes3(34));
43663
- assetInput.amount = usedQuantity;
43372
+ assetInput.id = hexlify(randomBytes3(33));
43373
+ assetInput.amount = quantity;
43664
43374
  } else {
43665
43375
  this.addResources([
43666
43376
  {
43667
- id: hexlify(randomBytes3(34)),
43668
- amount: usedQuantity,
43377
+ id: hexlify(randomBytes3(33)),
43378
+ amount: quantity,
43669
43379
  assetId,
43670
43380
  owner: resourcesOwner || Address.fromRandom(),
43381
+ maturity: 0,
43671
43382
  blockCreated: bn(1),
43672
43383
  txCreatedIdx: bn(1)
43673
43384
  }
@@ -43699,7 +43410,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43699
43410
  toJSON() {
43700
43411
  return normalizeJSON(this);
43701
43412
  }
43702
- updatePredicateGasUsed(inputs) {
43413
+ updatePredicateInputs(inputs) {
43703
43414
  this.inputs.forEach((i) => {
43704
43415
  let correspondingInput;
43705
43416
  switch (i.type) {
@@ -43721,15 +43432,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43721
43432
  }
43722
43433
  });
43723
43434
  }
43724
- shiftPredicateData() {
43725
- this.inputs.forEach((input) => {
43726
- if ("predicateData" in input && "paddPredicateData" in input && typeof input.paddPredicateData === "function") {
43727
- input.predicateData = input.paddPredicateData(
43728
- BaseTransactionRequest.getPolicyMeta(this).policies.length
43729
- );
43730
- }
43731
- });
43732
- }
43733
43435
  };
43734
43436
 
43735
43437
  // src/providers/transaction-request/hash-transaction.ts
@@ -43863,8 +43565,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43863
43565
  return {
43864
43566
  type: TransactionType.Create,
43865
43567
  ...baseTransaction,
43568
+ bytecodeLength: baseTransaction.witnesses[bytecodeWitnessIndex].dataLength / 4,
43866
43569
  bytecodeWitnessIndex,
43867
- storageSlotsCount: bn(storageSlots.length),
43570
+ storageSlotsCount: storageSlots.length,
43868
43571
  salt: this.salt ? hexlify(this.salt) : ZeroBytes32,
43869
43572
  storageSlots
43870
43573
  };
@@ -43978,8 +43681,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
43978
43681
  type: TransactionType.Script,
43979
43682
  scriptGasLimit: this.gasLimit,
43980
43683
  ...super.getBaseTransaction(),
43981
- scriptLength: bn(script.length),
43982
- scriptDataLength: bn(scriptData.length),
43684
+ scriptLength: script.length,
43685
+ scriptDataLength: scriptData.length,
43983
43686
  receiptsRoot: ZeroBytes32,
43984
43687
  script: hexlify(script),
43985
43688
  scriptData: hexlify(scriptData)
@@ -44043,7 +43746,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44043
43746
  }
44044
43747
  calculateMaxGas(chainInfo, minGas) {
44045
43748
  const { consensusParameters } = chainInfo;
44046
- const { gasPerByte, maxGasPerTx } = consensusParameters;
43749
+ const { gasPerByte } = consensusParameters;
44047
43750
  const witnessesLength = this.toTransaction().witnesses.reduce(
44048
43751
  (acc, wit) => acc + wit.dataLength,
44049
43752
  0
@@ -44053,8 +43756,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44053
43756
  minGas,
44054
43757
  witnessesLength,
44055
43758
  witnessLimit: this.witnessLimit,
44056
- gasLimit: this.gasLimit,
44057
- maxGasPerTx
43759
+ gasLimit: this.gasLimit
44058
43760
  });
44059
43761
  }
44060
43762
  /**
@@ -44127,29 +43829,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44127
43829
  }
44128
43830
  }
44129
43831
  };
44130
- var cacheTxInputsFromOwner = (inputs, owner) => inputs.reduce(
44131
- (acc, input) => {
44132
- if (input.type === InputType.Coin && input.owner === owner) {
44133
- acc.utxos.push(input.id);
44134
- }
44135
- if (input.type === InputType.Message && input.recipient === owner) {
44136
- acc.messages.push(input.nonce);
44137
- }
44138
- return acc;
44139
- },
44140
- {
44141
- utxos: [],
44142
- messages: []
44143
- }
44144
- );
44145
43832
 
44146
43833
  // src/providers/transaction-summary/calculate-transaction-fee.ts
44147
43834
  var calculateTransactionFee = (params) => {
44148
43835
  const {
44149
- gasPrice,
43836
+ gasUsed,
44150
43837
  rawPayload,
44151
- tip,
44152
- consensusParameters: { gasCosts, feeParams, maxGasPerTx }
43838
+ consensusParameters: { gasCosts, feeParams }
44153
43839
  } = params;
44154
43840
  const gasPerByte = bn(feeParams.gasPerByte);
44155
43841
  const gasPriceFactor = bn(feeParams.gasPriceFactor);
@@ -44159,7 +43845,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44159
43845
  return {
44160
43846
  fee: bn(0),
44161
43847
  minFee: bn(0),
44162
- maxFee: bn(0)
43848
+ maxFee: bn(0),
43849
+ feeFromGasUsed: bn(0)
44163
43850
  };
44164
43851
  }
44165
43852
  const { type: type3, witnesses, inputs, policies } = transaction;
@@ -44191,6 +43878,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44191
43878
  metadataGas,
44192
43879
  txBytesSize: transactionBytes.length
44193
43880
  });
43881
+ const gasPrice = bn(policies.find((policy) => policy.type === PolicyType.GasPrice)?.data);
44194
43882
  const witnessLimit = policies.find((policy) => policy.type === PolicyType.WitnessLimit)?.data;
44195
43883
  const witnessesLength = witnesses.reduce((acc, wit) => acc + wit.dataLength, 0);
44196
43884
  const maxGas = getMaxGas({
@@ -44198,25 +43886,17 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44198
43886
  minGas,
44199
43887
  witnessesLength,
44200
43888
  gasLimit,
44201
- witnessLimit,
44202
- maxGasPerTx
44203
- });
44204
- const minFee = calculateGasFee({
44205
- gasPrice,
44206
- gas: minGas,
44207
- priceFactor: gasPriceFactor,
44208
- tip
44209
- });
44210
- const maxFee = calculateGasFee({
44211
- gasPrice,
44212
- gas: maxGas,
44213
- priceFactor: gasPriceFactor,
44214
- tip
43889
+ witnessLimit
44215
43890
  });
43891
+ const feeFromGasUsed = calculatePriceWithFactor(gasUsed, gasPrice, gasPriceFactor);
43892
+ const minFee = calculatePriceWithFactor(minGas, gasPrice, gasPriceFactor);
43893
+ const maxFee = calculatePriceWithFactor(maxGas, gasPrice, gasPriceFactor);
43894
+ const fee = minFee.add(feeFromGasUsed);
44216
43895
  return {
43896
+ fee,
44217
43897
  minFee,
44218
43898
  maxFee,
44219
- fee: maxFee
43899
+ feeFromGasUsed
44220
43900
  };
44221
43901
  };
44222
43902
 
@@ -44770,9 +44450,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44770
44450
  gqlTransactionStatus,
44771
44451
  abiMap = {},
44772
44452
  maxInputs,
44773
- gasCosts,
44774
- maxGasPerTx,
44775
- gasPrice
44453
+ gasCosts
44776
44454
  } = params;
44777
44455
  const gasUsed = getGasUsedFromReceipts(receipts);
44778
44456
  const rawPayload = hexlify(transactionBytes);
@@ -44786,14 +44464,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44786
44464
  maxInputs
44787
44465
  });
44788
44466
  const typeName = getTransactionTypeName(transaction.type);
44789
- const tip = bn(transaction.policies?.find((policy) => policy.type === PolicyType.Tip)?.data);
44790
44467
  const { fee } = calculateTransactionFee({
44791
- gasPrice,
44468
+ gasUsed,
44792
44469
  rawPayload,
44793
- tip,
44794
44470
  consensusParameters: {
44795
44471
  gasCosts,
44796
- maxGasPerTx,
44797
44472
  feeParams: {
44798
44473
  gasPerByte,
44799
44474
  gasPriceFactor
@@ -44929,13 +44604,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44929
44604
  const decodedTransaction = this.decodeTransaction(
44930
44605
  transaction
44931
44606
  );
44932
- let txReceipts = [];
44933
- if (transaction?.status && "receipts" in transaction.status) {
44934
- txReceipts = transaction.status.receipts;
44935
- }
44936
- const receipts = txReceipts.map(processGqlReceipt) || [];
44937
- const { gasPerByte, gasPriceFactor, gasCosts, maxGasPerTx } = this.provider.getGasConfig();
44938
- const gasPrice = await this.provider.getLatestGasPrice();
44607
+ const receipts = transaction.receipts?.map(processGqlReceipt) || [];
44608
+ const { gasPerByte, gasPriceFactor, gasCosts } = this.provider.getGasConfig();
44939
44609
  const maxInputs = this.provider.getChain().consensusParameters.maxInputs;
44940
44610
  const transactionSummary = assembleTransactionSummary({
44941
44611
  id: this.id,
@@ -44947,9 +44617,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
44947
44617
  gasPriceFactor,
44948
44618
  abiMap: contractsAbiMap,
44949
44619
  maxInputs,
44950
- gasCosts,
44951
- maxGasPerTx,
44952
- gasPrice
44620
+ gasCosts
44953
44621
  });
44954
44622
  return transactionSummary;
44955
44623
  }
@@ -45098,7 +44766,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45098
44766
  gasCosts,
45099
44767
  latestBlock: {
45100
44768
  id: latestBlock.id,
45101
- height: bn(latestBlock.height),
44769
+ height: bn(latestBlock.header.height),
45102
44770
  time: latestBlock.header.time,
45103
44771
  transactions: latestBlock.transactions.map((i) => ({
45104
44772
  id: i.id
@@ -45192,8 +44860,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45192
44860
  * Returns some helpful parameters related to gas fees.
45193
44861
  */
45194
44862
  getGasConfig() {
44863
+ const { minGasPrice } = this.getNode();
45195
44864
  const { maxGasPerTx, maxGasPerPredicate, gasPriceFactor, gasPerByte, gasCosts } = this.getChain().consensusParameters;
45196
44865
  return {
44866
+ minGasPrice,
45197
44867
  maxGasPerTx,
45198
44868
  maxGasPerPredicate,
45199
44869
  gasPriceFactor,
@@ -45291,7 +44961,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45291
44961
  */
45292
44962
  async getBlockNumber() {
45293
44963
  const { chain } = await this.operations.getChain();
45294
- return bn(chain.latestBlock.height, 10);
44964
+ return bn(chain.latestBlock.header.height, 10);
45295
44965
  }
45296
44966
  /**
45297
44967
  * Returns the chain information.
@@ -45303,9 +44973,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45303
44973
  const processedNodeInfo = {
45304
44974
  maxDepth: bn(nodeInfo.maxDepth),
45305
44975
  maxTx: bn(nodeInfo.maxTx),
44976
+ minGasPrice: bn(nodeInfo.minGasPrice),
45306
44977
  nodeVersion: nodeInfo.nodeVersion,
45307
44978
  utxoValidation: nodeInfo.utxoValidation,
45308
- vmBacktrace: nodeInfo.vmBacktrace
44979
+ vmBacktrace: nodeInfo.vmBacktrace,
44980
+ peers: nodeInfo.peers
45309
44981
  };
45310
44982
  _Provider.nodeInfoCache[this.url] = processedNodeInfo;
45311
44983
  return processedNodeInfo;
@@ -45391,13 +45063,14 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45391
45063
  return this.estimateTxDependencies(transactionRequest);
45392
45064
  }
45393
45065
  const encodedTransaction = hexlify(transactionRequest.toTransactionBytes());
45394
- const { dryRun: dryRunStatuses } = await this.operations.dryRun({
45395
- encodedTransactions: encodedTransaction,
45066
+ const { dryRun: gqlReceipts } = await this.operations.dryRun({
45067
+ encodedTransaction,
45396
45068
  utxoValidation: utxoValidation || false
45397
45069
  });
45398
- const [{ receipts: rawReceipts, status }] = dryRunStatuses;
45399
- const receipts = rawReceipts.map(processGqlReceipt);
45400
- return { receipts, dryrunStatus: status };
45070
+ const receipts = gqlReceipts.map(processGqlReceipt);
45071
+ return {
45072
+ receipts
45073
+ };
45401
45074
  }
45402
45075
  /**
45403
45076
  * Verifies whether enough gas is available to complete transaction.
@@ -45436,6 +45109,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45436
45109
  * If there are missing variable outputs,
45437
45110
  * `addVariableOutputs` is called on the transaction.
45438
45111
  *
45112
+ * @privateRemarks
45113
+ * TODO: Investigate support for missing contract IDs
45114
+ * TODO: Add support for missing output messages
45439
45115
  *
45440
45116
  * @param transactionRequest - The transaction request object.
45441
45117
  * @returns A promise.
@@ -45448,19 +45124,16 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45448
45124
  missingContractIds: []
45449
45125
  };
45450
45126
  }
45127
+ await this.estimatePredicates(transactionRequest);
45451
45128
  let receipts = [];
45452
45129
  const missingContractIds = [];
45453
45130
  let outputVariables = 0;
45454
- let dryrunStatus;
45455
45131
  for (let attempt = 0; attempt < MAX_RETRIES; attempt++) {
45456
- const {
45457
- dryRun: [{ receipts: rawReceipts, status }]
45458
- } = await this.operations.dryRun({
45459
- encodedTransactions: [hexlify(transactionRequest.toTransactionBytes())],
45132
+ const { dryRun: gqlReceipts } = await this.operations.dryRun({
45133
+ encodedTransaction: hexlify(transactionRequest.toTransactionBytes()),
45460
45134
  utxoValidation: false
45461
45135
  });
45462
- receipts = rawReceipts.map(processGqlReceipt);
45463
- dryrunStatus = status;
45136
+ receipts = gqlReceipts.map(processGqlReceipt);
45464
45137
  const { missingOutputVariables, missingOutputContractIds } = getReceiptsWithMissingData(receipts);
45465
45138
  const hasMissingOutputs = missingOutputVariables.length !== 0 || missingOutputContractIds.length !== 0;
45466
45139
  if (hasMissingOutputs) {
@@ -45470,11 +45143,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45470
45143
  transactionRequest.addContractInputAndOutput(Address.fromString(contractId));
45471
45144
  missingContractIds.push(contractId);
45472
45145
  });
45473
- const { maxFee } = await this.estimateTxGasAndFee({
45474
- transactionRequest,
45475
- optimizeGas: false
45476
- });
45477
- transactionRequest.maxFee = maxFee;
45478
45146
  } else {
45479
45147
  break;
45480
45148
  }
@@ -45482,133 +45150,38 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45482
45150
  return {
45483
45151
  receipts,
45484
45152
  outputVariables,
45485
- missingContractIds,
45486
- dryrunStatus
45153
+ missingContractIds
45487
45154
  };
45488
45155
  }
45489
45156
  /**
45490
- * Dry runs multiple transactions and checks for missing dependencies in batches.
45491
- *
45492
- * Transactions are dry run in batches. After each dry run, transactions requiring
45493
- * further modifications are identified. The method iteratively updates these transactions
45494
- * and performs subsequent dry runs until all dependencies for each transaction are satisfied.
45495
- *
45496
- * @param transactionRequests - Array of transaction request objects.
45497
- * @returns A promise that resolves to an array of results for each transaction.
45498
- */
45499
- async estimateMultipleTxDependencies(transactionRequests) {
45500
- const results = transactionRequests.map(() => ({
45501
- receipts: [],
45502
- outputVariables: 0,
45503
- missingContractIds: [],
45504
- dryrunStatus: void 0
45505
- }));
45506
- const allRequests = clone_default(transactionRequests);
45507
- const serializedTransactionsMap = /* @__PURE__ */ new Map();
45508
- allRequests.forEach((req, index) => {
45509
- if (req.type === TransactionType.Script) {
45510
- serializedTransactionsMap.set(index, hexlify(req.toTransactionBytes()));
45511
- }
45512
- });
45513
- let transactionsToProcess = Array.from(serializedTransactionsMap.keys());
45514
- let attempt = 0;
45515
- while (transactionsToProcess.length > 0 && attempt < MAX_RETRIES) {
45516
- const encodedTransactions = transactionsToProcess.map(
45517
- (index) => serializedTransactionsMap.get(index)
45518
- );
45519
- const dryRunResults = await this.operations.dryRun({
45520
- encodedTransactions,
45521
- utxoValidation: false
45522
- });
45523
- const nextRoundTransactions = [];
45524
- for (let i = 0; i < dryRunResults.dryRun.length; i++) {
45525
- const currentResultIndex = transactionsToProcess[i];
45526
- const { receipts: rawReceipts, status } = dryRunResults.dryRun[i];
45527
- results[currentResultIndex].receipts = rawReceipts.map(processGqlReceipt);
45528
- results[currentResultIndex].dryrunStatus = status;
45529
- const { missingOutputVariables, missingOutputContractIds } = getReceiptsWithMissingData(
45530
- results[currentResultIndex].receipts
45531
- );
45532
- const hasMissingOutputs = missingOutputVariables.length > 0 || missingOutputContractIds.length > 0;
45533
- const requestToProcess = allRequests[currentResultIndex];
45534
- if (hasMissingOutputs && requestToProcess?.type === TransactionType.Script) {
45535
- results[currentResultIndex].outputVariables += missingOutputVariables.length;
45536
- requestToProcess.addVariableOutputs(missingOutputVariables.length);
45537
- missingOutputContractIds.forEach(({ contractId }) => {
45538
- requestToProcess.addContractInputAndOutput(Address.fromString(contractId));
45539
- results[currentResultIndex].missingContractIds.push(contractId);
45540
- });
45541
- const { maxFee } = await this.estimateTxGasAndFee({
45542
- transactionRequest: requestToProcess,
45543
- optimizeGas: false
45544
- });
45545
- requestToProcess.maxFee = maxFee;
45546
- serializedTransactionsMap.set(
45547
- currentResultIndex,
45548
- hexlify(requestToProcess.toTransactionBytes())
45549
- );
45550
- nextRoundTransactions.push(currentResultIndex);
45551
- allRequests[currentResultIndex] = requestToProcess;
45552
- }
45553
- }
45554
- transactionsToProcess = nextRoundTransactions;
45555
- attempt += 1;
45556
- }
45557
- return results;
45558
- }
45559
- async dryRunMultipleTransactions(transactionRequests, { utxoValidation, estimateTxDependencies = true } = {}) {
45560
- if (estimateTxDependencies) {
45561
- return this.estimateMultipleTxDependencies(transactionRequests);
45562
- }
45563
- const encodedTransactions = transactionRequests.map((tx) => hexlify(tx.toTransactionBytes()));
45564
- const { dryRun: dryRunStatuses } = await this.operations.dryRun({
45565
- encodedTransactions,
45566
- utxoValidation: utxoValidation || false
45567
- });
45568
- const results = dryRunStatuses.map(({ receipts: rawReceipts, status }) => {
45569
- const receipts = rawReceipts.map(processGqlReceipt);
45570
- return { receipts, dryrunStatus: status };
45571
- });
45572
- return results;
45573
- }
45574
- async estimateTxGasAndFee(params) {
45575
- const { transactionRequest, optimizeGas = true } = params;
45576
- let { gasPrice } = params;
45157
+ * Estimates the transaction gas and fee based on the provided transaction request.
45158
+ * @param transactionRequest - The transaction request object.
45159
+ * @param optimizeGas - Optional. Specifies whether to optimize the gas. Default is false.
45160
+ * @returns An object containing the estimated minimum gas, minimum fee, maximum gas, and maximum fee.
45161
+ */
45162
+ estimateTxGasAndFee(params) {
45163
+ const { transactionRequest } = params;
45164
+ const { gasPriceFactor, minGasPrice, maxGasPerTx } = this.getGasConfig();
45577
45165
  const chainInfo = this.getChain();
45578
- const { gasPriceFactor } = this.getGasConfig();
45166
+ const gasPrice = transactionRequest.gasPrice.eq(0) ? minGasPrice : transactionRequest.gasPrice;
45167
+ transactionRequest.gasPrice = gasPrice;
45579
45168
  const minGas = transactionRequest.calculateMinGas(chainInfo);
45580
- if (!gasPrice) {
45581
- gasPrice = await this.estimateGasPrice(10);
45582
- }
45583
- const minFee = calculateGasFee({
45584
- gasPrice: bn(gasPrice),
45585
- gas: minGas,
45586
- priceFactor: gasPriceFactor,
45587
- tip: transactionRequest.tip
45588
- }).add(1);
45589
- let gasLimit = bn(0);
45169
+ const minFee = calculatePriceWithFactor(minGas, gasPrice, gasPriceFactor).normalizeZeroToOne();
45590
45170
  if (transactionRequest.type === TransactionType.Script) {
45591
- gasLimit = transactionRequest.gasLimit;
45592
- if (!optimizeGas) {
45171
+ if (transactionRequest.gasLimit.eq(0)) {
45593
45172
  transactionRequest.gasLimit = minGas;
45594
- gasLimit = transactionRequest.calculateMaxGas(chainInfo, minGas);
45595
- transactionRequest.gasLimit = gasLimit;
45173
+ transactionRequest.gasLimit = maxGasPerTx.sub(
45174
+ transactionRequest.calculateMaxGas(chainInfo, minGas)
45175
+ );
45596
45176
  }
45597
45177
  }
45598
45178
  const maxGas = transactionRequest.calculateMaxGas(chainInfo, minGas);
45599
- const maxFee = calculateGasFee({
45600
- gasPrice: bn(gasPrice),
45601
- gas: maxGas,
45602
- priceFactor: gasPriceFactor,
45603
- tip: transactionRequest.tip
45604
- }).add(1);
45179
+ const maxFee = calculatePriceWithFactor(maxGas, gasPrice, gasPriceFactor).normalizeZeroToOne();
45605
45180
  return {
45606
45181
  minGas,
45607
45182
  minFee,
45608
45183
  maxGas,
45609
- maxFee,
45610
- gasPrice,
45611
- gasLimit
45184
+ maxFee
45612
45185
  };
45613
45186
  }
45614
45187
  /**
@@ -45626,17 +45199,15 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45626
45199
  if (estimateTxDependencies) {
45627
45200
  return this.estimateTxDependencies(transactionRequest);
45628
45201
  }
45629
- const encodedTransactions = [hexlify(transactionRequest.toTransactionBytes())];
45630
- const { dryRun: dryRunStatuses } = await this.operations.dryRun({
45631
- encodedTransactions,
45202
+ const encodedTransaction = hexlify(transactionRequest.toTransactionBytes());
45203
+ const { dryRun: gqlReceipts } = await this.operations.dryRun({
45204
+ encodedTransaction,
45632
45205
  utxoValidation: true
45633
45206
  });
45634
- const callResult = dryRunStatuses.map((dryRunStatus) => {
45635
- const { id, receipts, status } = dryRunStatus;
45636
- const processedReceipts = receipts.map(processGqlReceipt);
45637
- return { id, receipts: processedReceipts, status };
45638
- });
45639
- return { receipts: callResult[0].receipts };
45207
+ const receipts = gqlReceipts.map(processGqlReceipt);
45208
+ return {
45209
+ receipts
45210
+ };
45640
45211
  }
45641
45212
  /**
45642
45213
  * Returns a transaction cost to enable user
@@ -45653,80 +45224,77 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45653
45224
  * @param tolerance - The tolerance to add on top of the gasUsed.
45654
45225
  * @returns A promise that resolves to the transaction cost object.
45655
45226
  */
45656
- async getTransactionCost(transactionRequestLike, { resourcesOwner, signatureCallback, quantitiesToContract = [] } = {}) {
45227
+ async getTransactionCost(transactionRequestLike, forwardingQuantities = [], {
45228
+ estimateTxDependencies = true,
45229
+ estimatePredicates = true,
45230
+ resourcesOwner,
45231
+ signatureCallback
45232
+ } = {}) {
45657
45233
  const txRequestClone = clone_default(transactionRequestify(transactionRequestLike));
45234
+ const { minGasPrice } = this.getGasConfig();
45235
+ const setGasPrice = max(txRequestClone.gasPrice, minGasPrice);
45658
45236
  const isScriptTransaction = txRequestClone.type === TransactionType.Script;
45659
45237
  const coinOutputsQuantities = txRequestClone.getCoinOutputsQuantities();
45660
- const allQuantities = mergeQuantities(coinOutputsQuantities, quantitiesToContract);
45238
+ const allQuantities = mergeQuantities(coinOutputsQuantities, forwardingQuantities);
45661
45239
  txRequestClone.fundWithFakeUtxos(allQuantities, resourcesOwner?.address);
45662
- txRequestClone.maxFee = bn(0);
45663
45240
  if (isScriptTransaction) {
45664
45241
  txRequestClone.gasLimit = bn(0);
45665
45242
  }
45666
- if (resourcesOwner && "populateTransactionPredicateData" in resourcesOwner) {
45667
- resourcesOwner.populateTransactionPredicateData(txRequestClone);
45243
+ if (estimatePredicates) {
45244
+ if (resourcesOwner && "populateTransactionPredicateData" in resourcesOwner) {
45245
+ resourcesOwner.populateTransactionPredicateData(txRequestClone);
45246
+ }
45247
+ await this.estimatePredicates(txRequestClone);
45668
45248
  }
45669
- const signedRequest = clone_default(txRequestClone);
45670
- let addedSignatures = 0;
45671
45249
  if (signatureCallback && isScriptTransaction) {
45672
- const lengthBefore = signedRequest.witnesses.length;
45673
- await signatureCallback(signedRequest);
45674
- addedSignatures = signedRequest.witnesses.length - lengthBefore;
45675
- }
45676
- await this.estimatePredicates(signedRequest);
45677
- let { maxFee, maxGas, minFee, minGas, gasPrice, gasLimit } = await this.estimateTxGasAndFee({
45678
- transactionRequest: signedRequest,
45679
- optimizeGas: false
45250
+ await signatureCallback(txRequestClone);
45251
+ }
45252
+ let { maxFee, maxGas, minFee, minGas } = this.estimateTxGasAndFee({
45253
+ transactionRequest: txRequestClone
45680
45254
  });
45681
- txRequestClone.maxFee = maxFee;
45682
45255
  let receipts = [];
45683
45256
  let missingContractIds = [];
45684
45257
  let outputVariables = 0;
45685
45258
  let gasUsed = bn(0);
45686
- txRequestClone.updatePredicateGasUsed(signedRequest.inputs);
45687
- if (isScriptTransaction) {
45688
- if (signatureCallback) {
45689
- await signatureCallback(txRequestClone);
45690
- }
45691
- txRequestClone.gasLimit = gasLimit;
45259
+ if (isScriptTransaction && estimateTxDependencies) {
45260
+ txRequestClone.gasPrice = bn(0);
45692
45261
  const result = await this.estimateTxDependencies(txRequestClone);
45693
45262
  receipts = result.receipts;
45694
45263
  outputVariables = result.outputVariables;
45695
45264
  missingContractIds = result.missingContractIds;
45696
- gasUsed = getGasUsedFromReceipts(receipts);
45265
+ gasUsed = isScriptTransaction ? getGasUsedFromReceipts(receipts) : gasUsed;
45697
45266
  txRequestClone.gasLimit = gasUsed;
45698
- ({ maxFee, maxGas, minFee, minGas, gasPrice } = await this.estimateTxGasAndFee({
45699
- transactionRequest: txRequestClone,
45700
- gasPrice
45267
+ txRequestClone.gasPrice = setGasPrice;
45268
+ ({ maxFee, maxGas, minFee, minGas } = this.estimateTxGasAndFee({
45269
+ transactionRequest: txRequestClone
45701
45270
  }));
45702
45271
  }
45703
45272
  return {
45704
45273
  requiredQuantities: allQuantities,
45705
45274
  receipts,
45706
45275
  gasUsed,
45707
- gasPrice,
45276
+ minGasPrice,
45277
+ gasPrice: setGasPrice,
45708
45278
  minGas,
45709
45279
  maxGas,
45710
45280
  minFee,
45711
45281
  maxFee,
45282
+ estimatedInputs: txRequestClone.inputs,
45712
45283
  outputVariables,
45713
- missingContractIds,
45714
- addedSignatures,
45715
- estimatedPredicates: txRequestClone.inputs
45284
+ missingContractIds
45716
45285
  };
45717
45286
  }
45718
- async getResourcesForTransaction(owner, transactionRequestLike, quantitiesToContract = []) {
45287
+ async getResourcesForTransaction(owner, transactionRequestLike, forwardingQuantities = []) {
45719
45288
  const ownerAddress = Address.fromAddressOrString(owner);
45720
45289
  const transactionRequest = transactionRequestify(clone_default(transactionRequestLike));
45721
- const transactionCost = await this.getTransactionCost(transactionRequest, {
45722
- quantitiesToContract
45723
- });
45290
+ const transactionCost = await this.getTransactionCost(transactionRequest, forwardingQuantities);
45724
45291
  transactionRequest.addResources(
45725
45292
  await this.getResourcesToSpend(ownerAddress, transactionCost.requiredQuantities)
45726
45293
  );
45727
- const { requiredQuantities, ...txCost } = await this.getTransactionCost(transactionRequest, {
45728
- quantitiesToContract
45729
- });
45294
+ const { requiredQuantities, ...txCost } = await this.getTransactionCost(
45295
+ transactionRequest,
45296
+ forwardingQuantities
45297
+ );
45730
45298
  const resources = await this.getResourcesToSpend(ownerAddress, requiredQuantities);
45731
45299
  return {
45732
45300
  resources,
@@ -45750,6 +45318,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45750
45318
  assetId: coin.assetId,
45751
45319
  amount: bn(coin.amount),
45752
45320
  owner: Address.fromAddressOrString(coin.owner),
45321
+ maturity: bn(coin.maturity).toNumber(),
45753
45322
  blockCreated: bn(coin.blockCreated),
45754
45323
  txCreatedIdx: bn(coin.txCreatedIdx)
45755
45324
  }));
@@ -45801,6 +45370,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45801
45370
  amount: bn(coin.amount),
45802
45371
  assetId: coin.assetId,
45803
45372
  owner: Address.fromAddressOrString(coin.owner),
45373
+ maturity: bn(coin.maturity).toNumber(),
45804
45374
  blockCreated: bn(coin.blockCreated),
45805
45375
  txCreatedIdx: bn(coin.txCreatedIdx)
45806
45376
  };
@@ -45833,7 +45403,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45833
45403
  }
45834
45404
  return {
45835
45405
  id: block2.id,
45836
- height: bn(block2.height),
45406
+ height: bn(block2.header.height),
45837
45407
  time: block2.header.time,
45838
45408
  transactionIds: block2.transactions.map((tx) => tx.id)
45839
45409
  };
@@ -45848,7 +45418,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45848
45418
  const { blocks: fetchedData } = await this.operations.getBlocks(params);
45849
45419
  const blocks = fetchedData.edges.map(({ node: block2 }) => ({
45850
45420
  id: block2.id,
45851
- height: bn(block2.height),
45421
+ height: bn(block2.header.height),
45852
45422
  time: block2.header.time,
45853
45423
  transactionIds: block2.transactions.map((tx) => tx.id)
45854
45424
  }));
@@ -45875,7 +45445,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45875
45445
  }
45876
45446
  return {
45877
45447
  id: block2.id,
45878
- height: bn(block2.height, 10),
45448
+ height: bn(block2.header.height, 10),
45879
45449
  time: block2.header.time,
45880
45450
  transactionIds: block2.transactions.map((tx) => tx.id),
45881
45451
  transactions: block2.transactions.map(
@@ -46055,6 +45625,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46055
45625
  prevRoot: messageBlockHeader.prevRoot,
46056
45626
  time: messageBlockHeader.time,
46057
45627
  applicationHash: messageBlockHeader.applicationHash,
45628
+ messageReceiptRoot: messageBlockHeader.messageReceiptRoot,
46058
45629
  messageReceiptCount: bn(messageBlockHeader.messageReceiptCount)
46059
45630
  },
46060
45631
  commitBlockHeader: {
@@ -46066,6 +45637,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46066
45637
  prevRoot: commitBlockHeader.prevRoot,
46067
45638
  time: commitBlockHeader.time,
46068
45639
  applicationHash: commitBlockHeader.applicationHash,
45640
+ messageReceiptRoot: commitBlockHeader.messageReceiptRoot,
46069
45641
  messageReceiptCount: bn(commitBlockHeader.messageReceiptCount)
46070
45642
  },
46071
45643
  sender: Address.fromAddressOrString(sender),
@@ -46075,16 +45647,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46075
45647
  data
46076
45648
  };
46077
45649
  }
46078
- async getLatestGasPrice() {
46079
- const { latestGasPrice } = await this.operations.getLatestGasPrice();
46080
- return bn(latestGasPrice.gasPrice);
46081
- }
46082
- async estimateGasPrice(blockHorizon) {
46083
- const { estimateGasPrice } = await this.operations.estimateGasPrice({
46084
- blockHorizon: String(blockHorizon)
46085
- });
46086
- return bn(estimateGasPrice.gasPrice);
46087
- }
46088
45650
  /**
46089
45651
  * Returns Message Proof for given transaction id and the message id from MessageOut receipt.
46090
45652
  *
@@ -46368,33 +45930,36 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46368
45930
  * @param fee - The estimated transaction fee.
46369
45931
  * @returns A promise that resolves when the resources are added to the transaction.
46370
45932
  */
46371
- async fund(request, params) {
46372
- const { addedSignatures, estimatedPredicates, maxFee: fee, requiredQuantities } = params;
46373
- const txRequest = request;
46374
- const requiredQuantitiesWithFee = addAmountToCoinQuantities({
45933
+ async fund(request, coinQuantities, fee) {
45934
+ const updatedQuantities = addAmountToAsset({
46375
45935
  amount: bn(fee),
46376
45936
  assetId: BaseAssetId,
46377
- coinQuantities: requiredQuantities
45937
+ coinQuantities
46378
45938
  });
46379
45939
  const quantitiesDict = {};
46380
- requiredQuantitiesWithFee.forEach(({ amount, assetId }) => {
45940
+ updatedQuantities.forEach(({ amount, assetId }) => {
46381
45941
  quantitiesDict[assetId] = {
46382
45942
  required: amount,
46383
45943
  owned: bn(0)
46384
45944
  };
46385
45945
  });
46386
- txRequest.inputs.forEach((input) => {
45946
+ const cachedUtxos = [];
45947
+ const cachedMessages = [];
45948
+ const owner = this.address.toB256();
45949
+ request.inputs.forEach((input) => {
46387
45950
  const isResource = "amount" in input;
46388
45951
  if (isResource) {
46389
45952
  const isCoin2 = "owner" in input;
46390
45953
  if (isCoin2) {
46391
45954
  const assetId = String(input.assetId);
46392
- if (quantitiesDict[assetId]) {
45955
+ if (input.owner === owner && quantitiesDict[assetId]) {
46393
45956
  const amount = bn(input.amount);
46394
45957
  quantitiesDict[assetId].owned = quantitiesDict[assetId].owned.add(amount);
45958
+ cachedUtxos.push(input.id);
46395
45959
  }
46396
- } else if (input.amount && quantitiesDict[BaseAssetId]) {
45960
+ } else if (input.recipient === owner && input.amount && quantitiesDict[BaseAssetId]) {
46397
45961
  quantitiesDict[BaseAssetId].owned = quantitiesDict[BaseAssetId].owned.add(input.amount);
45962
+ cachedMessages.push(input.nonce);
46398
45963
  }
46399
45964
  }
46400
45965
  });
@@ -46409,23 +45974,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46409
45974
  });
46410
45975
  const needsToBeFunded = missingQuantities.length;
46411
45976
  if (needsToBeFunded) {
46412
- const excludedIds = cacheTxInputsFromOwner(txRequest.inputs, this.address.toB256());
46413
- const resources = await this.getResourcesToSpend(missingQuantities, excludedIds);
46414
- txRequest.addResources(resources);
46415
- }
46416
- txRequest.shiftPredicateData();
46417
- txRequest.updatePredicateGasUsed(estimatedPredicates);
46418
- const requestToBeReEstimate = clone_default(txRequest);
46419
- if (addedSignatures) {
46420
- Array.from({ length: addedSignatures }).forEach(
46421
- () => requestToBeReEstimate.addEmptyWitness()
46422
- );
45977
+ const resources = await this.getResourcesToSpend(missingQuantities, {
45978
+ messages: cachedMessages,
45979
+ utxos: cachedUtxos
45980
+ });
45981
+ request.addResources(resources);
46423
45982
  }
46424
- const { maxFee } = await this.provider.estimateTxGasAndFee({
46425
- transactionRequest: requestToBeReEstimate
46426
- });
46427
- txRequest.maxFee = maxFee;
46428
- return txRequest;
46429
45983
  }
46430
45984
  /**
46431
45985
  * A helper that creates a transfer transaction request and returns it.
@@ -46433,25 +45987,28 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46433
45987
  * @param destination - The address of the destination.
46434
45988
  * @param amount - The amount of coins to transfer.
46435
45989
  * @param assetId - The asset ID of the coins to transfer.
46436
- * @param txParams - The transaction parameters (gasLimit, tip, maturity, maxFee, witnessLimit).
45990
+ * @param txParams - The transaction parameters (gasLimit, gasPrice, maturity).
46437
45991
  * @returns A promise that resolves to the prepared transaction request.
46438
45992
  */
46439
45993
  async createTransfer(destination, amount, assetId = BaseAssetId, txParams = {}) {
46440
- const request = new ScriptTransactionRequest(txParams);
45994
+ const { minGasPrice } = this.provider.getGasConfig();
45995
+ const params = { gasPrice: minGasPrice, ...txParams };
45996
+ const request = new ScriptTransactionRequest(params);
46441
45997
  request.addCoinOutput(Address.fromAddressOrString(destination), amount, assetId);
46442
- const txCost = await this.provider.getTransactionCost(request, {
45998
+ const { maxFee, requiredQuantities, gasUsed, estimatedInputs } = await this.provider.getTransactionCost(request, [], {
46443
45999
  estimateTxDependencies: true,
46444
46000
  resourcesOwner: this
46445
46001
  });
46446
- if ("gasLimit" in txParams) {
46447
- this.validateGas({
46448
- gasUsed: txCost.gasUsed,
46449
- gasLimit: request.gasLimit
46450
- });
46451
- }
46452
- request.gasLimit = txCost.gasUsed;
46453
- request.maxFee = txCost.maxFee;
46454
- await this.fund(request, txCost);
46002
+ request.gasPrice = bn(txParams.gasPrice ?? minGasPrice);
46003
+ request.gasLimit = bn(txParams.gasLimit ?? gasUsed);
46004
+ this.validateGas({
46005
+ gasUsed,
46006
+ gasPrice: request.gasPrice,
46007
+ gasLimit: request.gasLimit,
46008
+ minGasPrice
46009
+ });
46010
+ await this.fund(request, requiredQuantities, maxFee);
46011
+ request.updatePredicateInputs(estimatedInputs);
46455
46012
  return request;
46456
46013
  }
46457
46014
  /**
@@ -46490,30 +46047,31 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46490
46047
  );
46491
46048
  }
46492
46049
  const contractAddress = Address.fromAddressOrString(contractId);
46050
+ const { minGasPrice } = this.provider.getGasConfig();
46051
+ const params = { gasPrice: minGasPrice, ...txParams };
46493
46052
  const { script, scriptData } = await assembleTransferToContractScript({
46494
46053
  hexlifiedContractId: contractAddress.toB256(),
46495
46054
  amountToTransfer: bn(amount),
46496
46055
  assetId
46497
46056
  });
46498
46057
  const request = new ScriptTransactionRequest({
46499
- ...txParams,
46058
+ ...params,
46500
46059
  script,
46501
46060
  scriptData
46502
46061
  });
46503
46062
  request.addContractInputAndOutput(contractAddress);
46504
- const txCost = await this.provider.getTransactionCost(request, {
46505
- resourcesOwner: this,
46506
- quantitiesToContract: [{ amount: bn(amount), assetId: String(assetId) }]
46063
+ const { maxFee, requiredQuantities, gasUsed } = await this.provider.getTransactionCost(
46064
+ request,
46065
+ [{ amount: bn(amount), assetId: String(assetId) }]
46066
+ );
46067
+ request.gasLimit = bn(params.gasLimit ?? gasUsed);
46068
+ this.validateGas({
46069
+ gasUsed,
46070
+ gasPrice: request.gasPrice,
46071
+ gasLimit: request.gasLimit,
46072
+ minGasPrice
46507
46073
  });
46508
- if (txParams.gasLimit) {
46509
- this.validateGas({
46510
- gasUsed: txCost.gasUsed,
46511
- gasLimit: request.gasLimit
46512
- });
46513
- }
46514
- request.gasLimit = txCost.gasUsed;
46515
- request.maxFee = txCost.maxFee;
46516
- await this.fund(request, txCost);
46074
+ await this.fund(request, requiredQuantities, maxFee);
46517
46075
  return this.sendTransaction(request);
46518
46076
  }
46519
46077
  /**
@@ -46525,6 +46083,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46525
46083
  * @returns A promise that resolves to the transaction response.
46526
46084
  */
46527
46085
  async withdrawToBaseLayer(recipient, amount, txParams = {}) {
46086
+ const { minGasPrice } = this.provider.getGasConfig();
46528
46087
  const recipientAddress = Address.fromAddressOrString(recipient);
46529
46088
  const recipientDataArray = arrayify(
46530
46089
  "0x".concat(recipientAddress.toHexString().substring(2).padStart(64, "0"))
@@ -46537,19 +46096,21 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46537
46096
  ...recipientDataArray,
46538
46097
  ...amountDataArray
46539
46098
  ]);
46540
- const params = { script, ...txParams };
46099
+ const params = { script, gasPrice: minGasPrice, ...txParams };
46541
46100
  const request = new ScriptTransactionRequest(params);
46542
- const quantitiesToContract = [{ amount: bn(amount), assetId: BaseAssetId }];
46543
- const txCost = await this.provider.getTransactionCost(request, { quantitiesToContract });
46544
- if (txParams.gasLimit) {
46545
- this.validateGas({
46546
- gasUsed: txCost.gasUsed,
46547
- gasLimit: request.gasLimit
46548
- });
46549
- }
46550
- request.maxFee = txCost.maxFee;
46551
- request.gasLimit = txCost.gasUsed;
46552
- await this.fund(request, txCost);
46101
+ const forwardingQuantities = [{ amount: bn(amount), assetId: BaseAssetId }];
46102
+ const { requiredQuantities, maxFee, gasUsed } = await this.provider.getTransactionCost(
46103
+ request,
46104
+ forwardingQuantities
46105
+ );
46106
+ request.gasLimit = bn(params.gasLimit ?? gasUsed);
46107
+ this.validateGas({
46108
+ gasUsed,
46109
+ gasPrice: request.gasPrice,
46110
+ gasLimit: request.gasLimit,
46111
+ minGasPrice
46112
+ });
46113
+ await this.fund(request, requiredQuantities, maxFee);
46553
46114
  return this.sendTransaction(request);
46554
46115
  }
46555
46116
  async signMessage(message) {
@@ -46607,7 +46168,18 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46607
46168
  }
46608
46169
  return this.provider.simulate(transactionRequest, { estimateTxDependencies: false });
46609
46170
  }
46610
- validateGas({ gasUsed, gasLimit }) {
46171
+ validateGas({
46172
+ gasUsed,
46173
+ gasPrice,
46174
+ gasLimit,
46175
+ minGasPrice
46176
+ }) {
46177
+ if (minGasPrice.gt(gasPrice)) {
46178
+ throw new FuelError(
46179
+ ErrorCode.GAS_PRICE_TOO_LOW,
46180
+ `Gas price '${gasPrice}' is lower than the required: '${minGasPrice}'.`
46181
+ );
46182
+ }
46611
46183
  if (gasUsed.gt(gasLimit)) {
46612
46184
  throw new FuelError(
46613
46185
  ErrorCode.GAS_LIMIT_TOO_LOW,
@@ -48196,7 +47768,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
48196
47768
  * @param transactionRequestLike - The transaction request to send.
48197
47769
  * @returns A promise that resolves to the TransactionResponse object.
48198
47770
  */
48199
- async sendTransaction(transactionRequestLike, { estimateTxDependencies = false, awaitExecution } = {}) {
47771
+ async sendTransaction(transactionRequestLike, { estimateTxDependencies = true, awaitExecution } = {}) {
48200
47772
  const transactionRequest = transactionRequestify(transactionRequestLike);
48201
47773
  if (estimateTxDependencies) {
48202
47774
  await this.provider.estimateTxDependencies(transactionRequest);
@@ -50956,15 +50528,14 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
50956
50528
  process.env.GENESIS_SECRET || randomBytes22(32),
50957
50529
  wallet.provider
50958
50530
  );
50959
- const request = new ScriptTransactionRequest();
50960
- quantities.forEach((quantity) => {
50961
- const { amount, assetId } = coinQuantityfy(quantity);
50962
- request.addCoinOutput(wallet.address, amount, assetId);
50531
+ const resources = await genesisWallet.getResourcesToSpend(quantities);
50532
+ const { minGasPrice } = genesisWallet.provider.getGasConfig();
50533
+ const request = new ScriptTransactionRequest({
50534
+ gasLimit: 1e4,
50535
+ gasPrice: minGasPrice
50963
50536
  });
50964
- const txCost = await genesisWallet.provider.getTransactionCost(request);
50965
- request.gasLimit = txCost.gasUsed;
50966
- request.maxFee = txCost.maxFee;
50967
- await genesisWallet.fund(request, txCost);
50537
+ request.addResources(resources);
50538
+ quantities.map(coinQuantityfy).forEach(({ amount, assetId }) => request.addCoinOutput(wallet.address, amount, assetId));
50968
50539
  await genesisWallet.sendTransaction(request, { awaitExecution: true });
50969
50540
  };
50970
50541
 
@@ -51043,12 +50614,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
51043
50614
  // eslint-disable-next-line no-async-promise-executor
51044
50615
  new Promise(async (resolve, reject) => {
51045
50616
  const remainingArgs = extractRemainingArgs(args, [
51046
- "--snapshot",
50617
+ "--chain",
51047
50618
  "--consensus-key",
51048
50619
  "--db-type",
51049
50620
  "--poa-instant"
51050
50621
  ]);
51051
- const chainConfigPath = getFlagValueFromArgs(args, "--snapshot");
50622
+ const chainConfigPath = getFlagValueFromArgs(args, "--chain");
51052
50623
  const consensusKey = getFlagValueFromArgs(args, "--consensus-key") || defaultConsensusKey;
51053
50624
  const dbTypeFlagValue = getFlagValueFromArgs(args, "--db-type");
51054
50625
  const useInMemoryDb = dbTypeFlagValue === "in-memory" || dbTypeFlagValue === void 0;
@@ -51067,54 +50638,36 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
51067
50638
  let chainConfigPathToUse;
51068
50639
  const prefix = basePath || import_os.default.tmpdir();
51069
50640
  const suffix = basePath ? "" : (0, import_crypto21.randomUUID)();
51070
- const tempDirPath = import_path8.default.join(prefix, ".fuels", suffix, "chainConfigs");
50641
+ const tempDirPath = import_path8.default.join(prefix, ".fuels", suffix);
51071
50642
  if (chainConfigPath) {
51072
50643
  chainConfigPathToUse = chainConfigPath;
51073
50644
  } else {
51074
50645
  if (!(0, import_fs2.existsSync)(tempDirPath)) {
51075
50646
  (0, import_fs2.mkdirSync)(tempDirPath, { recursive: true });
51076
50647
  }
51077
- let { stateConfigJson } = defaultChainConfigs;
51078
- const { chainConfigJson, metadataJson } = defaultChainConfigs;
51079
- stateConfigJson = {
51080
- ...stateConfigJson,
51081
- coins: [
51082
- ...stateConfigJson.coins.map((coin) => ({
51083
- ...coin,
51084
- amount: "18446744073709551615"
51085
- }))
51086
- ],
51087
- messages: stateConfigJson.messages.map((message) => ({
51088
- ...message,
51089
- amount: "18446744073709551615"
51090
- }))
51091
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
51092
- };
50648
+ const tempChainConfigFilePath = import_path8.default.join(tempDirPath, "chainConfig.json");
50649
+ let chainConfig = defaultChainConfig;
51093
50650
  if (!process.env.GENESIS_SECRET) {
51094
50651
  const pk = Signer.generatePrivateKey();
51095
50652
  const signer = new Signer(pk);
51096
50653
  process.env.GENESIS_SECRET = hexlify(pk);
51097
- stateConfigJson.coins.push({
51098
- tx_id: hexlify(randomBytes3(34)),
51099
- owner: signer.address.toHexString(),
51100
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
51101
- amount: "18446744073709551615",
51102
- asset_id: BaseAssetId,
51103
- output_index: 0,
51104
- tx_pointer_block_height: 0,
51105
- tx_pointer_tx_idx: 0
51106
- });
50654
+ chainConfig = {
50655
+ ...defaultChainConfig,
50656
+ initial_state: {
50657
+ ...defaultChainConfig.initial_state,
50658
+ coins: [
50659
+ ...defaultChainConfig.initial_state.coins,
50660
+ {
50661
+ owner: signer.address.toHexString(),
50662
+ amount: toHex(1e9),
50663
+ asset_id: BaseAssetId
50664
+ }
50665
+ ]
50666
+ }
50667
+ };
51107
50668
  }
51108
- let fixedStateConfigJSON = JSON.stringify(stateConfigJson);
51109
- const regexMakeNumber = /("amount":)"(\d+)"/gm;
51110
- fixedStateConfigJSON = fixedStateConfigJSON.replace(regexMakeNumber, "$1$2");
51111
- const chainConfigWritePath = import_path8.default.join(tempDirPath, "chainConfig.json");
51112
- const stateConfigWritePath = import_path8.default.join(tempDirPath, "stateConfig.json");
51113
- const metadataWritePath = import_path8.default.join(tempDirPath, "metadata.json");
51114
- (0, import_fs2.writeFileSync)(chainConfigWritePath, JSON.stringify(chainConfigJson), "utf8");
51115
- (0, import_fs2.writeFileSync)(stateConfigWritePath, fixedStateConfigJSON, "utf8");
51116
- (0, import_fs2.writeFileSync)(metadataWritePath, JSON.stringify(metadataJson), "utf8");
51117
- chainConfigPathToUse = tempDirPath;
50669
+ (0, import_fs2.writeFileSync)(tempChainConfigFilePath, JSON.stringify(chainConfig), "utf8");
50670
+ chainConfigPathToUse = tempChainConfigFilePath;
51118
50671
  }
51119
50672
  const child = (0, import_child_process.spawn)(
51120
50673
  command,
@@ -51123,10 +50676,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
51123
50676
  ["--ip", ipToUse],
51124
50677
  ["--port", portToUse],
51125
50678
  useInMemoryDb ? ["--db-type", "in-memory"] : ["--db-path", tempDirPath],
51126
- ["--min-gas-price", "1"],
50679
+ ["--min-gas-price", "0"],
51127
50680
  poaInstant ? ["--poa-instant", "true"] : [],
51128
50681
  ["--consensus-key", consensusKey],
51129
- ["--snapshot", chainConfigPathToUse],
50682
+ ["--chain", chainConfigPathToUse],
51130
50683
  "--vm-backtrace",
51131
50684
  "--utxo-validation",
51132
50685
  "--debug",
@@ -51185,7 +50738,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
51185
50738
  walletCount = 10
51186
50739
  } = {}) => {
51187
50740
  const { cleanup: closeNode, ip, port } = await launchNode(launchNodeOptions || {});
51188
- const provider = await Provider.create(`http://${ip}:${port}/v1/graphql`);
50741
+ const provider = await Provider.create(`http://${ip}:${port}/graphql`);
51189
50742
  const wallets = await generateWallets(walletCount, provider);
51190
50743
  const cleanup = () => {
51191
50744
  closeNode();