@fuel-ts/account 0.0.0-pr-1699-20240214162234 → 0.0.0-pr-1784-20240221124858

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 (70) hide show
  1. package/dist/account.d.ts +7 -4
  2. package/dist/account.d.ts.map +1 -1
  3. package/dist/connectors/fuel.d.ts +5 -6
  4. package/dist/connectors/fuel.d.ts.map +1 -1
  5. package/dist/connectors/index.d.ts +0 -2
  6. package/dist/connectors/index.d.ts.map +1 -1
  7. package/dist/connectors/types/asset.d.ts +0 -14
  8. package/dist/connectors/types/asset.d.ts.map +1 -1
  9. package/dist/connectors/types/data-type.d.ts +0 -4
  10. package/dist/connectors/types/data-type.d.ts.map +1 -1
  11. package/dist/connectors/types/events.d.ts +0 -5
  12. package/dist/connectors/types/events.d.ts.map +1 -1
  13. package/dist/connectors/types/index.d.ts +0 -2
  14. package/dist/connectors/types/index.d.ts.map +1 -1
  15. package/dist/connectors/utils/cache.d.ts.map +1 -1
  16. package/dist/connectors/utils/index.d.ts +0 -1
  17. package/dist/connectors/utils/index.d.ts.map +1 -1
  18. package/dist/index.global.js +718 -605
  19. package/dist/index.global.js.map +1 -1
  20. package/dist/index.js +278 -162
  21. package/dist/index.js.map +1 -1
  22. package/dist/index.mjs +336 -220
  23. package/dist/index.mjs.map +1 -1
  24. package/dist/predicate/predicate.d.ts.map +1 -1
  25. package/dist/providers/assets/index.d.ts +4 -0
  26. package/dist/providers/assets/index.d.ts.map +1 -0
  27. package/dist/providers/assets/types.d.ts +36 -0
  28. package/dist/providers/assets/types.d.ts.map +1 -0
  29. package/dist/providers/assets/utils/index.d.ts +4 -0
  30. package/dist/providers/assets/utils/index.d.ts.map +1 -0
  31. package/dist/providers/assets/utils/network.d.ts +33 -0
  32. package/dist/providers/assets/utils/network.d.ts.map +1 -0
  33. package/dist/providers/assets/utils/resolveIconPaths.d.ts +14 -0
  34. package/dist/providers/assets/utils/resolveIconPaths.d.ts.map +1 -0
  35. package/dist/providers/assets/utils/url.d.ts +2 -0
  36. package/dist/providers/assets/utils/url.d.ts.map +1 -0
  37. package/dist/providers/chains.d.ts +11 -0
  38. package/dist/providers/chains.d.ts.map +1 -0
  39. package/dist/providers/index.d.ts +2 -0
  40. package/dist/providers/index.d.ts.map +1 -1
  41. package/dist/providers/provider.d.ts +14 -6
  42. package/dist/providers/provider.d.ts.map +1 -1
  43. package/dist/providers/transaction-request/transaction-request.d.ts +3 -10
  44. package/dist/providers/transaction-request/transaction-request.d.ts.map +1 -1
  45. package/dist/providers/utils/json.d.ts.map +1 -1
  46. package/dist/test-utils.global.js +593 -496
  47. package/dist/test-utils.global.js.map +1 -1
  48. package/dist/test-utils.js +176 -79
  49. package/dist/test-utils.js.map +1 -1
  50. package/dist/test-utils.mjs +231 -134
  51. package/dist/test-utils.mjs.map +1 -1
  52. package/dist/wallet/base-wallet-unlocked.d.ts +3 -3
  53. package/dist/wallet/base-wallet-unlocked.d.ts.map +1 -1
  54. package/package.json +17 -17
  55. package/dist/connectors/fixtures/generate-accounts.d.ts +0 -2
  56. package/dist/connectors/fixtures/generate-accounts.d.ts.map +0 -1
  57. package/dist/connectors/fixtures/mocked-connector.d.ts +0 -45
  58. package/dist/connectors/fixtures/mocked-connector.d.ts.map +0 -1
  59. package/dist/connectors/fixtures/promise-callback.d.ts +0 -7
  60. package/dist/connectors/fixtures/promise-callback.d.ts.map +0 -1
  61. package/dist/connectors/fuel-wallet-locked.d.ts +0 -13
  62. package/dist/connectors/fuel-wallet-locked.d.ts.map +0 -1
  63. package/dist/connectors/fuel-wallet-provider.d.ts +0 -14
  64. package/dist/connectors/fuel-wallet-provider.d.ts.map +0 -1
  65. package/dist/connectors/types/connection.d.ts +0 -7
  66. package/dist/connectors/types/connection.d.ts.map +0 -1
  67. package/dist/connectors/types/nertwork-data.d.ts +0 -7
  68. package/dist/connectors/types/nertwork-data.d.ts.map +0 -1
  69. package/dist/connectors/utils/get-asset-by-chain.d.ts +0 -3
  70. package/dist/connectors/utils/get-asset-by-chain.d.ts.map +0 -1
@@ -108,7 +108,9 @@ var import_address3 = require("@fuel-ts/address");
108
108
  var import_errors13 = require("@fuel-ts/errors");
109
109
  var import_math14 = require("@fuel-ts/math");
110
110
  var import_transactions17 = require("@fuel-ts/transactions");
111
+ var import_utils5 = require("@fuel-ts/utils");
111
112
  var import_versions = require("@fuel-ts/versions");
113
+ var import_utils6 = require("@noble/curves/abstract/utils");
112
114
  var import_ethers18 = require("ethers");
113
115
  var import_graphql_request = require("graphql-request");
114
116
  var import_ramda3 = require("ramda");
@@ -1939,7 +1941,7 @@ var BaseTransactionRequest = class {
1939
1941
  *
1940
1942
  * @param quantities - CoinQuantity Array.
1941
1943
  */
1942
- fundWithFakeUtxos(quantities) {
1944
+ fundWithFakeUtxos(quantities, resourcesOwner) {
1943
1945
  let idCounter = 0;
1944
1946
  const generateId = () => {
1945
1947
  const counterString = String(idCounter++);
@@ -1963,7 +1965,7 @@ var BaseTransactionRequest = class {
1963
1965
  id: generateId(),
1964
1966
  amount: quantity,
1965
1967
  assetId,
1966
- owner: import_address.Address.fromRandom(),
1968
+ owner: resourcesOwner || import_address.Address.fromRandom(),
1967
1969
  maturity: 0,
1968
1970
  blockCreated: (0, import_math6.bn)(1),
1969
1971
  txCreatedIdx: (0, import_math6.bn)(1)
@@ -1996,19 +1998,29 @@ var BaseTransactionRequest = class {
1996
1998
  toJSON() {
1997
1999
  return normalizeJSON(this);
1998
2000
  }
1999
- /**
2000
- * @hidden
2001
- *
2002
- * Determines whether the transaction has a predicate input.
2003
- *
2004
- * @returns Whether the transaction has a predicate input.
2005
- */
2006
- hasPredicateInput() {
2007
- return Boolean(
2008
- this.inputs.find(
2009
- (input) => "predicate" in input && input.predicate && input.predicate !== (0, import_ethers9.getBytesCopy)("0x")
2010
- )
2011
- );
2001
+ updatePredicateInputs(inputs) {
2002
+ this.inputs.forEach((i) => {
2003
+ let correspondingInput;
2004
+ switch (i.type) {
2005
+ case import_transactions5.InputType.Contract:
2006
+ return;
2007
+ case import_transactions5.InputType.Coin:
2008
+ correspondingInput = inputs.find((x) => x.type === import_transactions5.InputType.Coin && x.owner === i.owner);
2009
+ break;
2010
+ case import_transactions5.InputType.Message:
2011
+ correspondingInput = inputs.find(
2012
+ (x) => x.type === import_transactions5.InputType.Message && x.sender === i.sender
2013
+ );
2014
+ break;
2015
+ default:
2016
+ break;
2017
+ }
2018
+ if (correspondingInput && "predicateGasUsed" in correspondingInput && (0, import_math6.bn)(correspondingInput.predicateGasUsed).gt(0)) {
2019
+ i.predicate = correspondingInput.predicate;
2020
+ i.predicateData = correspondingInput.predicateData;
2021
+ i.predicateGasUsed = correspondingInput.predicateGasUsed;
2022
+ }
2023
+ });
2012
2024
  }
2013
2025
  };
2014
2026
 
@@ -3674,7 +3686,7 @@ var _Provider = class {
3674
3686
  async call(transactionRequestLike, { utxoValidation, estimateTxDependencies = true } = {}) {
3675
3687
  const transactionRequest = transactionRequestify(transactionRequestLike);
3676
3688
  if (estimateTxDependencies) {
3677
- await this.estimateTxDependencies(transactionRequest);
3689
+ return this.estimateTxDependencies(transactionRequest);
3678
3690
  }
3679
3691
  const encodedTransaction = (0, import_ethers18.hexlify)(transactionRequest.toTransactionBytes());
3680
3692
  const { dryRun: gqlReceipts } = await this.operations.dryRun({
@@ -3693,6 +3705,14 @@ var _Provider = class {
3693
3705
  * @returns A promise that resolves to the estimated transaction request object.
3694
3706
  */
3695
3707
  async estimatePredicates(transactionRequest) {
3708
+ const shouldEstimatePredicates = Boolean(
3709
+ transactionRequest.inputs.find(
3710
+ (input) => "predicate" in input && input.predicate && !(0, import_utils6.equalBytes)((0, import_utils5.arrayify)(input.predicate), (0, import_utils5.arrayify)("0x")) && new import_math14.BN(input.predicateGasUsed).isZero()
3711
+ )
3712
+ );
3713
+ if (!shouldEstimatePredicates) {
3714
+ return transactionRequest;
3715
+ }
3696
3716
  const encodedTransaction = (0, import_ethers18.hexlify)(transactionRequest.toTransactionBytes());
3697
3717
  const response = await this.operations.estimatePredicates({
3698
3718
  encodedTransaction
@@ -3723,34 +3743,33 @@ var _Provider = class {
3723
3743
  * @returns A promise.
3724
3744
  */
3725
3745
  async estimateTxDependencies(transactionRequest) {
3726
- let missingOutputVariableCount = 0;
3727
- let missingOutputContractIdsCount = 0;
3728
- let tries = 0;
3729
3746
  if (transactionRequest.type === import_transactions17.TransactionType.Create) {
3730
- return;
3731
- }
3732
- let txRequest = transactionRequest;
3733
- if (txRequest.hasPredicateInput()) {
3734
- txRequest = await this.estimatePredicates(txRequest);
3747
+ return {
3748
+ receipts: []
3749
+ };
3735
3750
  }
3736
- while (tries < MAX_RETRIES) {
3751
+ await this.estimatePredicates(transactionRequest);
3752
+ let receipts = [];
3753
+ for (let attempt = 0; attempt < MAX_RETRIES; attempt++) {
3737
3754
  const { dryRun: gqlReceipts } = await this.operations.dryRun({
3738
- encodedTransaction: (0, import_ethers18.hexlify)(txRequest.toTransactionBytes()),
3755
+ encodedTransaction: (0, import_ethers18.hexlify)(transactionRequest.toTransactionBytes()),
3739
3756
  utxoValidation: false
3740
3757
  });
3741
- const receipts = gqlReceipts.map(processGqlReceipt);
3758
+ receipts = gqlReceipts.map(processGqlReceipt);
3742
3759
  const { missingOutputVariables, missingOutputContractIds } = getReceiptsWithMissingData(receipts);
3743
- missingOutputVariableCount = missingOutputVariables.length;
3744
- missingOutputContractIdsCount = missingOutputContractIds.length;
3745
- if (missingOutputVariableCount === 0 && missingOutputContractIdsCount === 0) {
3746
- return;
3760
+ const hasMissingOutputs = missingOutputVariables.length !== 0 || missingOutputContractIds.length !== 0;
3761
+ if (hasMissingOutputs) {
3762
+ transactionRequest.addVariableOutputs(missingOutputVariables.length);
3763
+ missingOutputContractIds.forEach(({ contractId }) => {
3764
+ transactionRequest.addContractInputAndOutput(import_address3.Address.fromString(contractId));
3765
+ });
3766
+ } else {
3767
+ break;
3747
3768
  }
3748
- txRequest.addVariableOutputs(missingOutputVariableCount);
3749
- missingOutputContractIds.forEach(
3750
- ({ contractId }) => txRequest.addContractInputAndOutput(import_address3.Address.fromString(contractId))
3751
- );
3752
- tries += 1;
3753
3769
  }
3770
+ return {
3771
+ receipts
3772
+ };
3754
3773
  }
3755
3774
  /**
3756
3775
  * Executes a signed transaction without applying the states changes
@@ -3765,7 +3784,7 @@ var _Provider = class {
3765
3784
  async simulate(transactionRequestLike, { estimateTxDependencies = true } = {}) {
3766
3785
  const transactionRequest = transactionRequestify(transactionRequestLike);
3767
3786
  if (estimateTxDependencies) {
3768
- await this.estimateTxDependencies(transactionRequest);
3787
+ return this.estimateTxDependencies(transactionRequest);
3769
3788
  }
3770
3789
  const encodedTransaction = (0, import_ethers18.hexlify)(transactionRequest.toTransactionBytes());
3771
3790
  const { dryRun: gqlReceipts } = await this.operations.dryRun({
@@ -3792,36 +3811,38 @@ var _Provider = class {
3792
3811
  * @param tolerance - The tolerance to add on top of the gasUsed.
3793
3812
  * @returns A promise that resolves to the transaction cost object.
3794
3813
  */
3795
- async getTransactionCost(transactionRequestLike, forwardingQuantities = [], { estimateTxDependencies = true, estimatePredicates = true } = {}) {
3796
- const transactionRequest = transactionRequestify((0, import_ramda3.clone)(transactionRequestLike));
3814
+ async getTransactionCost(transactionRequestLike, forwardingQuantities = [], {
3815
+ estimateTxDependencies = true,
3816
+ estimatePredicates = true,
3817
+ resourcesOwner
3818
+ } = {}) {
3819
+ const txRequestClone = (0, import_ramda3.clone)(transactionRequestify(transactionRequestLike));
3797
3820
  const chainInfo = this.getChain();
3798
3821
  const { gasPriceFactor, minGasPrice, maxGasPerTx } = this.getGasConfig();
3799
- const gasPrice = (0, import_math14.max)(transactionRequest.gasPrice, minGasPrice);
3800
- const isScriptTransaction = transactionRequest.type === import_transactions17.TransactionType.Script;
3801
- if (transactionRequest.hasPredicateInput() && estimatePredicates) {
3822
+ const gasPrice = (0, import_math14.max)(txRequestClone.gasPrice, minGasPrice);
3823
+ const isScriptTransaction = txRequestClone.type === import_transactions17.TransactionType.Script;
3824
+ const coinOutputsQuantities = txRequestClone.getCoinOutputsQuantities();
3825
+ const allQuantities = mergeQuantities(coinOutputsQuantities, forwardingQuantities);
3826
+ txRequestClone.fundWithFakeUtxos(allQuantities, resourcesOwner?.address);
3827
+ if (estimatePredicates) {
3802
3828
  if (isScriptTransaction) {
3803
- transactionRequest.gasLimit = (0, import_math14.bn)(0);
3829
+ txRequestClone.gasLimit = (0, import_math14.bn)(0);
3830
+ }
3831
+ if (resourcesOwner && "populateTransactionPredicateData" in resourcesOwner) {
3832
+ resourcesOwner.populateTransactionPredicateData(txRequestClone);
3804
3833
  }
3805
- await this.estimatePredicates(transactionRequest);
3834
+ await this.estimatePredicates(txRequestClone);
3806
3835
  }
3807
- const minGas = transactionRequest.calculateMinGas(chainInfo);
3808
- const maxGas = transactionRequest.calculateMaxGas(chainInfo, minGas);
3809
- const coinOutputsQuantities = transactionRequest.getCoinOutputsQuantities();
3810
- const allQuantities = mergeQuantities(coinOutputsQuantities, forwardingQuantities);
3811
- transactionRequest.fundWithFakeUtxos(allQuantities);
3812
- let gasUsed = minGas;
3836
+ const minGas = txRequestClone.calculateMinGas(chainInfo);
3837
+ const maxGas = txRequestClone.calculateMaxGas(chainInfo, minGas);
3813
3838
  let receipts = [];
3814
- if (isScriptTransaction) {
3815
- transactionRequest.gasPrice = (0, import_math14.bn)(0);
3816
- transactionRequest.gasLimit = (0, import_math14.bn)(maxGasPerTx.sub(maxGas).toNumber() * 0.9);
3817
- const result = await this.call(transactionRequest, {
3818
- estimateTxDependencies
3819
- });
3839
+ if (isScriptTransaction && estimateTxDependencies) {
3840
+ txRequestClone.gasPrice = (0, import_math14.bn)(0);
3841
+ txRequestClone.gasLimit = (0, import_math14.bn)(maxGasPerTx.sub(maxGas).toNumber() * 0.9);
3842
+ const result = await this.estimateTxDependencies(txRequestClone);
3820
3843
  receipts = result.receipts;
3821
- gasUsed = getGasUsedFromReceipts(receipts);
3822
- } else {
3823
- gasUsed = minGas;
3824
3844
  }
3845
+ const gasUsed = isScriptTransaction ? getGasUsedFromReceipts(receipts) : minGas;
3825
3846
  const usedFee = calculatePriceWithFactor(
3826
3847
  gasUsed,
3827
3848
  gasPrice,
@@ -3839,7 +3860,9 @@ var _Provider = class {
3839
3860
  maxGas,
3840
3861
  usedFee,
3841
3862
  minFee,
3842
- maxFee
3863
+ maxFee,
3864
+ estimatedInputs: txRequestClone.inputs,
3865
+ estimatedOutputs: txRequestClone.outputs
3843
3866
  };
3844
3867
  }
3845
3868
  async getResourcesForTransaction(owner, transactionRequestLike, forwardingQuantities = []) {
@@ -4229,6 +4252,10 @@ var _Provider = class {
4229
4252
  });
4230
4253
  return (0, import_math14.bn)(latestBlockHeight);
4231
4254
  }
4255
+ // eslint-disable-next-line @typescript-eslint/require-await
4256
+ async getTransactionResponse(transactionId) {
4257
+ return new TransactionResponse(transactionId, this);
4258
+ }
4232
4259
  };
4233
4260
  var Provider = _Provider;
4234
4261
  _cacheInputs = new WeakSet();
@@ -4251,6 +4278,51 @@ var import_math15 = require("@fuel-ts/math");
4251
4278
  var import_transactions18 = require("@fuel-ts/transactions");
4252
4279
  var import_ethers19 = require("ethers");
4253
4280
 
4281
+ // src/providers/chains.ts
4282
+ var CHAIN_IDS = {
4283
+ eth: {
4284
+ sepolia: 11155111,
4285
+ foundry: 31337
4286
+ },
4287
+ fuel: {
4288
+ beta5: 0,
4289
+ devnet: 10
4290
+ }
4291
+ };
4292
+
4293
+ // src/providers/assets/index.ts
4294
+ var assets = [
4295
+ {
4296
+ name: "Ethereum",
4297
+ symbol: "ETH",
4298
+ icon: "eth.svg",
4299
+ networks: [
4300
+ {
4301
+ type: "ethereum",
4302
+ chainId: CHAIN_IDS.eth.sepolia,
4303
+ decimals: 18
4304
+ },
4305
+ {
4306
+ type: "ethereum",
4307
+ chainId: CHAIN_IDS.eth.foundry,
4308
+ decimals: 18
4309
+ },
4310
+ {
4311
+ type: "fuel",
4312
+ chainId: CHAIN_IDS.fuel.beta5,
4313
+ decimals: 9,
4314
+ assetId: "0x0000000000000000000000000000000000000000000000000000000000000000"
4315
+ },
4316
+ {
4317
+ type: "fuel",
4318
+ chainId: CHAIN_IDS.fuel.devnet,
4319
+ decimals: 9,
4320
+ assetId: "0x0000000000000000000000000000000000000000000000000000000000000000"
4321
+ }
4322
+ ]
4323
+ }
4324
+ ];
4325
+
4254
4326
  // src/utils/formatTransferToContractScriptData.ts
4255
4327
  var import_abi_coder4 = require("@fuel-ts/abi-coder");
4256
4328
  var import_math16 = require("@fuel-ts/math");
@@ -4297,15 +4369,17 @@ var Account = class extends import_interfaces.AbstractAccount {
4297
4369
  * The provider used to interact with the network.
4298
4370
  */
4299
4371
  _provider;
4372
+ _connector;
4300
4373
  /**
4301
4374
  * Creates a new Account instance.
4302
4375
  *
4303
4376
  * @param address - The address of the account.
4304
4377
  * @param provider - A Provider instance (optional).
4305
4378
  */
4306
- constructor(address, provider) {
4379
+ constructor(address, provider, connector) {
4307
4380
  super();
4308
4381
  this._provider = provider;
4382
+ this._connector = connector;
4309
4383
  this.address = import_address4.Address.fromDynamicInput(address);
4310
4384
  }
4311
4385
  /**
@@ -4511,7 +4585,10 @@ var Account = class extends import_interfaces.AbstractAccount {
4511
4585
  const params = { gasPrice: minGasPrice, ...txParams };
4512
4586
  const request = new ScriptTransactionRequest(params);
4513
4587
  request.addCoinOutput(import_address4.Address.fromAddressOrString(destination), amount, assetId);
4514
- const { maxFee, requiredQuantities, gasUsed } = await this.provider.getTransactionCost(request);
4588
+ const { maxFee, requiredQuantities, gasUsed, estimatedInputs } = await this.provider.getTransactionCost(request, [], {
4589
+ estimateTxDependencies: true,
4590
+ resourcesOwner: this
4591
+ });
4515
4592
  request.gasPrice = (0, import_math17.bn)(txParams.gasPrice ?? minGasPrice);
4516
4593
  request.gasLimit = (0, import_math17.bn)(txParams.gasLimit ?? gasUsed);
4517
4594
  this.validateGas({
@@ -4521,6 +4598,7 @@ var Account = class extends import_interfaces.AbstractAccount {
4521
4598
  minGasPrice
4522
4599
  });
4523
4600
  await this.fund(request, requiredQuantities, maxFee);
4601
+ request.updatePredicateInputs(estimatedInputs);
4524
4602
  return request;
4525
4603
  }
4526
4604
  /**
@@ -4534,7 +4612,7 @@ var Account = class extends import_interfaces.AbstractAccount {
4534
4612
  */
4535
4613
  async transfer(destination, amount, assetId = import_configs10.BaseAssetId, txParams = {}) {
4536
4614
  const request = await this.createTransfer(destination, amount, assetId, txParams);
4537
- return this.sendTransaction(request);
4615
+ return this.sendTransaction(request, { estimateTxDependencies: false });
4538
4616
  }
4539
4617
  /**
4540
4618
  * Transfers coins to a contract address.
@@ -4613,17 +4691,30 @@ var Account = class extends import_interfaces.AbstractAccount {
4613
4691
  await this.fund(request, requiredQuantities, maxFee);
4614
4692
  return this.sendTransaction(request);
4615
4693
  }
4694
+ async signMessage(message) {
4695
+ if (!this._connector) {
4696
+ throw new import_errors15.FuelError(import_errors15.ErrorCode.MISSING_CONNECTOR, "A connector is required to sign messages.");
4697
+ }
4698
+ return this._connector.signMessage(this.address.toString(), message);
4699
+ }
4616
4700
  /**
4617
4701
  * Sends a transaction to the network.
4618
4702
  *
4619
4703
  * @param transactionRequestLike - The transaction request to be sent.
4620
4704
  * @returns A promise that resolves to the transaction response.
4621
4705
  */
4622
- async sendTransaction(transactionRequestLike, options) {
4706
+ async sendTransaction(transactionRequestLike, { estimateTxDependencies = true, awaitExecution } = {}) {
4707
+ if (this._connector) {
4708
+ return this.provider.getTransactionResponse(
4709
+ await this._connector.sendTransaction(this.address.toString(), transactionRequestLike)
4710
+ );
4711
+ }
4623
4712
  const transactionRequest = transactionRequestify(transactionRequestLike);
4624
- await this.provider.estimateTxDependencies(transactionRequest);
4713
+ if (estimateTxDependencies) {
4714
+ await this.provider.estimateTxDependencies(transactionRequest);
4715
+ }
4625
4716
  return this.provider.sendTransaction(transactionRequest, {
4626
- ...options,
4717
+ awaitExecution,
4627
4718
  estimateTxDependencies: false
4628
4719
  });
4629
4720
  }
@@ -4633,9 +4724,11 @@ var Account = class extends import_interfaces.AbstractAccount {
4633
4724
  * @param transactionRequestLike - The transaction request to be simulated.
4634
4725
  * @returns A promise that resolves to the call result.
4635
4726
  */
4636
- async simulateTransaction(transactionRequestLike) {
4727
+ async simulateTransaction(transactionRequestLike, { estimateTxDependencies = true } = {}) {
4637
4728
  const transactionRequest = transactionRequestify(transactionRequestLike);
4638
- await this.provider.estimateTxDependencies(transactionRequest);
4729
+ if (estimateTxDependencies) {
4730
+ await this.provider.estimateTxDependencies(transactionRequest);
4731
+ }
4639
4732
  return this.provider.simulate(transactionRequest, { estimateTxDependencies: false });
4640
4733
  }
4641
4734
  validateGas({
@@ -4933,12 +5026,14 @@ var BaseWalletUnlocked = class extends Account {
4933
5026
  * @param transactionRequestLike - The transaction request to send.
4934
5027
  * @returns A promise that resolves to the TransactionResponse object.
4935
5028
  */
4936
- async sendTransaction(transactionRequestLike, options) {
5029
+ async sendTransaction(transactionRequestLike, { estimateTxDependencies = true, awaitExecution } = {}) {
4937
5030
  const transactionRequest = transactionRequestify(transactionRequestLike);
4938
- await this.provider.estimateTxDependencies(transactionRequest);
5031
+ if (estimateTxDependencies) {
5032
+ await this.provider.estimateTxDependencies(transactionRequest);
5033
+ }
4939
5034
  return this.provider.sendTransaction(
4940
5035
  await this.populateTransactionWitnessesSignature(transactionRequest),
4941
- { ...options, estimateTxDependencies: false }
5036
+ { awaitExecution, estimateTxDependencies: false }
4942
5037
  );
4943
5038
  }
4944
5039
  /**
@@ -4947,9 +5042,11 @@ var BaseWalletUnlocked = class extends Account {
4947
5042
  * @param transactionRequestLike - The transaction request to simulate.
4948
5043
  * @returns A promise that resolves to the CallResult object.
4949
5044
  */
4950
- async simulateTransaction(transactionRequestLike) {
5045
+ async simulateTransaction(transactionRequestLike, { estimateTxDependencies = true } = {}) {
4951
5046
  const transactionRequest = transactionRequestify(transactionRequestLike);
4952
- await this.provider.estimateTxDependencies(transactionRequest);
5047
+ if (estimateTxDependencies) {
5048
+ await this.provider.estimateTxDependencies(transactionRequest);
5049
+ }
4953
5050
  return this.provider.call(
4954
5051
  await this.populateTransactionWitnessesSignature(transactionRequest),
4955
5052
  {
@@ -7727,7 +7824,7 @@ var generateTestWallet = async (provider, quantities) => {
7727
7824
  // src/test-utils/launchNode.ts
7728
7825
  var import_configs11 = require("@fuel-ts/address/configs");
7729
7826
  var import_math20 = require("@fuel-ts/math");
7730
- var import_utils7 = require("@fuel-ts/utils");
7827
+ var import_utils9 = require("@fuel-ts/utils");
7731
7828
  var import_cli_utils = require("@fuel-ts/utils/cli-utils");
7732
7829
  var import_child_process = require("child_process");
7733
7830
  var import_crypto5 = require("crypto");
@@ -7786,7 +7883,7 @@ var launchNode = async ({
7786
7883
  "--poa-instant"
7787
7884
  ]);
7788
7885
  const chainConfigPath = getFlagValueFromArgs(args, "--chain");
7789
- const consensusKey = getFlagValueFromArgs(args, "--consensus-key") || import_utils7.defaultConsensusKey;
7886
+ const consensusKey = getFlagValueFromArgs(args, "--consensus-key") || import_utils9.defaultConsensusKey;
7790
7887
  const dbTypeFlagValue = getFlagValueFromArgs(args, "--db-type");
7791
7888
  const useInMemoryDb = dbTypeFlagValue === "in-memory" || dbTypeFlagValue === void 0;
7792
7889
  const poaInstantFlagValue = getFlagValueFromArgs(args, "--poa-instant");
@@ -7812,17 +7909,17 @@ var launchNode = async ({
7812
7909
  (0, import_fs.mkdirSync)(tempDirPath, { recursive: true });
7813
7910
  }
7814
7911
  const tempChainConfigFilePath = import_path.default.join(tempDirPath, "chainConfig.json");
7815
- let chainConfig = import_utils7.defaultChainConfig;
7912
+ let chainConfig = import_utils9.defaultChainConfig;
7816
7913
  if (!process.env.GENESIS_SECRET) {
7817
7914
  const pk = Signer.generatePrivateKey();
7818
7915
  const signer = new Signer(pk);
7819
7916
  process.env.GENESIS_SECRET = (0, import_ethers27.hexlify)(pk);
7820
7917
  chainConfig = {
7821
- ...import_utils7.defaultChainConfig,
7918
+ ...import_utils9.defaultChainConfig,
7822
7919
  initial_state: {
7823
- ...import_utils7.defaultChainConfig.initial_state,
7920
+ ...import_utils9.defaultChainConfig.initial_state,
7824
7921
  coins: [
7825
- ...import_utils7.defaultChainConfig.initial_state.coins,
7922
+ ...import_utils9.defaultChainConfig.initial_state.coins,
7826
7923
  {
7827
7924
  owner: signer.address.toHexString(),
7828
7925
  amount: (0, import_math20.toHex)(1e9),