@fuel-ts/account 0.0.0-rc-2021-20240411141803 → 0.0.0-rc-1976-20240411153008

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