@fuel-ts/account 0.0.0-rc-2021-20240408141516 → 0.0.0-rc-1976-20240409133547

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