@fuel-ts/account 0.0.0-rc-1356-20240522164420 → 0.0.0-rc-1356-20240523144307

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.

@@ -2602,6 +2602,13 @@ var ScriptTransactionRequest = class extends BaseTransactionRequest {
2602
2602
  }
2603
2603
  return this.outputs.length - 1;
2604
2604
  }
2605
+ /**
2606
+ * Calculates the maximum gas for the transaction.
2607
+ *
2608
+ * @param chainInfo - The chain information.
2609
+ * @param minGas - The minimum gas.
2610
+ * @returns the maximum gas.
2611
+ */
2605
2612
  calculateMaxGas(chainInfo, minGas) {
2606
2613
  const { consensusParameters } = chainInfo;
2607
2614
  const {
@@ -3716,7 +3723,6 @@ var _Provider = class {
3716
3723
  * Constructor to initialize a Provider.
3717
3724
  *
3718
3725
  * @param url - GraphQL endpoint of the Fuel node
3719
- * @param chainInfo - Chain info of the Fuel node
3720
3726
  * @param options - Additional options for the provider
3721
3727
  * @hidden
3722
3728
  */
@@ -3739,10 +3745,14 @@ var _Provider = class {
3739
3745
  this.operations = this.createOperations();
3740
3746
  this.cache = options.cacheUtxo ? new MemoryCache(options.cacheUtxo) : void 0;
3741
3747
  }
3748
+ /** @hidden */
3742
3749
  static clearChainAndNodeCaches() {
3743
3750
  _Provider.nodeInfoCache = {};
3744
3751
  _Provider.chainInfoCache = {};
3745
3752
  }
3753
+ /**
3754
+ * @hidden
3755
+ */
3746
3756
  static getFetchFn(options) {
3747
3757
  const { retryOptions, timeout } = options;
3748
3758
  return autoRetryFetch(async (...args) => {
@@ -3758,8 +3768,11 @@ var _Provider = class {
3758
3768
  }
3759
3769
  /**
3760
3770
  * Creates a new instance of the Provider class. This is the recommended way to initialize a Provider.
3771
+ *
3761
3772
  * @param url - GraphQL endpoint of the Fuel node
3762
3773
  * @param options - Additional options for the provider
3774
+ *
3775
+ * @returns A promise that resolves to a Provider instance.
3763
3776
  */
3764
3777
  static async create(url, options = {}) {
3765
3778
  const provider = new _Provider(url, options);
@@ -3768,6 +3781,8 @@ var _Provider = class {
3768
3781
  }
3769
3782
  /**
3770
3783
  * Returns the cached chainInfo for the current URL.
3784
+ *
3785
+ * @returns the chain information configuration.
3771
3786
  */
3772
3787
  getChain() {
3773
3788
  const chain = _Provider.chainInfoCache[this.url];
@@ -3781,6 +3796,8 @@ var _Provider = class {
3781
3796
  }
3782
3797
  /**
3783
3798
  * Returns the cached nodeInfo for the current URL.
3799
+ *
3800
+ * @returns the node information configuration.
3784
3801
  */
3785
3802
  getNode() {
3786
3803
  const node = _Provider.nodeInfoCache[this.url];
@@ -3812,6 +3829,9 @@ var _Provider = class {
3812
3829
  }
3813
3830
  /**
3814
3831
  * Updates the URL for the provider and fetches the consensus parameters for the new URL, if needed.
3832
+ *
3833
+ * @param url - The URL to connect to.
3834
+ * @param options - Additional options for the provider.
3815
3835
  */
3816
3836
  async connect(url, options) {
3817
3837
  this.url = url;
@@ -3820,9 +3840,9 @@ var _Provider = class {
3820
3840
  await this.fetchChainAndNodeInfo();
3821
3841
  }
3822
3842
  /**
3823
- * Fetches both the chain and node information, saves it to the cache, and return it.
3843
+ * Return the chain and node information.
3824
3844
  *
3825
- * @returns NodeInfo and Chain
3845
+ * @returns A promise that resolves to the Chain and NodeInfo.
3826
3846
  */
3827
3847
  async fetchChainAndNodeInfo() {
3828
3848
  const chain = await this.fetchChain();
@@ -3833,6 +3853,9 @@ var _Provider = class {
3833
3853
  nodeInfo
3834
3854
  };
3835
3855
  }
3856
+ /**
3857
+ * @hidden
3858
+ */
3836
3859
  static ensureClientVersionIsSupported(nodeInfo) {
3837
3860
  const { isMajorSupported, isMinorSupported, supportedVersion } = checkFuelCoreVersionCompatibility(nodeInfo.nodeVersion);
3838
3861
  if (!isMajorSupported || !isMinorSupported) {
@@ -3848,6 +3871,7 @@ Supported fuel-core version: ${supportedVersion}.`
3848
3871
  * Create GraphQL client and set operations.
3849
3872
  *
3850
3873
  * @returns The operation SDK object
3874
+ * @hidden
3851
3875
  */
3852
3876
  createOperations() {
3853
3877
  const fetchFn = _Provider.getFetchFn(this.options);
@@ -3892,18 +3916,18 @@ Supported fuel-core version: ${supportedVersion}.`
3892
3916
  return nodeVersion;
3893
3917
  }
3894
3918
  /**
3895
- * Returns the block number.
3919
+ * Returns the latest block number.
3896
3920
  *
3897
- * @returns A promise that resolves to the block number
3921
+ * @returns A promise that resolves to the latest block number.
3898
3922
  */
3899
3923
  async getBlockNumber() {
3900
3924
  const { chain } = await this.operations.getChain();
3901
3925
  return bn17(chain.latestBlock.height, 10);
3902
3926
  }
3903
3927
  /**
3904
- * Returns the chain information.
3905
- * @param url - The URL of the Fuel node
3906
- * @returns NodeInfo object
3928
+ * Returns the node information for the current provider network.
3929
+ *
3930
+ * @returns a promise that resolves to the node information.
3907
3931
  */
3908
3932
  async fetchNode() {
3909
3933
  const { nodeInfo } = await this.operations.getNodeInfo();
@@ -3918,9 +3942,9 @@ Supported fuel-core version: ${supportedVersion}.`
3918
3942
  return processedNodeInfo;
3919
3943
  }
3920
3944
  /**
3921
- * Fetches the `chainInfo` for the given node URL.
3922
- * @param url - The URL of the Fuel node
3923
- * @returns ChainInfo object
3945
+ * Returns the chain information for the current provider network.
3946
+ *
3947
+ * @returns a promise that resolves to the chain information.
3924
3948
  */
3925
3949
  async fetchChain() {
3926
3950
  const { chain } = await this.operations.getChain();
@@ -3929,8 +3953,9 @@ Supported fuel-core version: ${supportedVersion}.`
3929
3953
  return processedChain;
3930
3954
  }
3931
3955
  /**
3932
- * Returns the chain ID
3933
- * @returns A promise that resolves to the chain ID number
3956
+ * Returns the chain ID for the current provider network.
3957
+ *
3958
+ * @returns A promise that resolves to the chain ID number.
3934
3959
  */
3935
3960
  getChainId() {
3936
3961
  const {
@@ -3939,9 +3964,9 @@ Supported fuel-core version: ${supportedVersion}.`
3939
3964
  return chainId.toNumber();
3940
3965
  }
3941
3966
  /**
3942
- * Returns the base asset ID for the current provider network
3967
+ * Returns the base asset ID for the current provider network.
3943
3968
  *
3944
- * @returns the base asset ID
3969
+ * @returns the base asset ID.
3945
3970
  */
3946
3971
  getBaseAssetId() {
3947
3972
  const {
@@ -3956,6 +3981,7 @@ Supported fuel-core version: ${supportedVersion}.`
3956
3981
  * the transaction will be mutated and those dependencies will be added.
3957
3982
  *
3958
3983
  * @param transactionRequestLike - The transaction request object.
3984
+ * @param sendTransactionParams - The provider send transaction parameters (optional).
3959
3985
  * @returns A promise that resolves to the transaction response object.
3960
3986
  */
3961
3987
  // #region Provider-sendTransaction
@@ -4000,7 +4026,7 @@ Supported fuel-core version: ${supportedVersion}.`
4000
4026
  * the transaction will be mutated and those dependencies will be added.
4001
4027
  *
4002
4028
  * @param transactionRequestLike - The transaction request object.
4003
- * @param utxoValidation - Additional provider call parameters.
4029
+ * @param sendTransactionParams - The provider call parameters (optional).
4004
4030
  * @returns A promise that resolves to the call result object.
4005
4031
  */
4006
4032
  async call(transactionRequestLike, { utxoValidation, estimateTxDependencies = true } = {}) {
@@ -4020,6 +4046,8 @@ Supported fuel-core version: ${supportedVersion}.`
4020
4046
  /**
4021
4047
  * Verifies whether enough gas is available to complete transaction.
4022
4048
  *
4049
+ * @template T - The type of the transaction request object.
4050
+ *
4023
4051
  * @param transactionRequest - The transaction request object.
4024
4052
  * @returns A promise that resolves to the estimated transaction request object.
4025
4053
  */
@@ -4054,9 +4082,8 @@ Supported fuel-core version: ${supportedVersion}.`
4054
4082
  * If there are missing variable outputs,
4055
4083
  * `addVariableOutputs` is called on the transaction.
4056
4084
  *
4057
- *
4058
4085
  * @param transactionRequest - The transaction request object.
4059
- * @returns A promise.
4086
+ * @returns A promise that resolves to the estimate transaction dependencies.
4060
4087
  */
4061
4088
  async estimateTxDependencies(transactionRequest) {
4062
4089
  if (transactionRequest.type === TransactionType8.Create) {
@@ -4169,6 +4196,14 @@ Supported fuel-core version: ${supportedVersion}.`
4169
4196
  }
4170
4197
  return results;
4171
4198
  }
4199
+ /**
4200
+ * Dry runs multiple transactions.
4201
+ *
4202
+ * @param transactionRequests - Array of transaction request objects.
4203
+ * @param sendTransactionParams - The provider call parameters (optional).
4204
+ *
4205
+ * @returns A promise that resolves to an array of results for each transaction call.
4206
+ */
4172
4207
  async dryRunMultipleTransactions(transactionRequests, { utxoValidation, estimateTxDependencies = true } = {}) {
4173
4208
  if (estimateTxDependencies) {
4174
4209
  return this.estimateMultipleTxDependencies(transactionRequests);
@@ -4239,6 +4274,7 @@ Supported fuel-core version: ${supportedVersion}.`
4239
4274
  * the transaction will be mutated and those dependencies will be added
4240
4275
  *
4241
4276
  * @param transactionRequestLike - The transaction request object.
4277
+ * @param estimateTxParams - The estimate transaction params (optional).
4242
4278
  * @returns A promise that resolves to the call result object.
4243
4279
  */
4244
4280
  async simulate(transactionRequestLike, { estimateTxDependencies = true } = {}) {
@@ -4263,14 +4299,9 @@ Supported fuel-core version: ${supportedVersion}.`
4263
4299
  * to set gasLimit and also reserve balance amounts
4264
4300
  * on the the transaction.
4265
4301
  *
4266
- * @privateRemarks
4267
- * The tolerance is add on top of the gasUsed calculated
4268
- * from the node, this create a safe margin costs like
4269
- * change states on transfer that don't occur on the dryRun
4270
- * transaction. The default value is 0.2 or 20%
4271
- *
4272
4302
  * @param transactionRequestLike - The transaction request object.
4273
- * @param tolerance - The tolerance to add on top of the gasUsed.
4303
+ * @param transactionCostParams - The transaction cost parameters (optional).
4304
+ *
4274
4305
  * @returns A promise that resolves to the transaction cost object.
4275
4306
  */
4276
4307
  async getTransactionCost(transactionRequestLike, { resourcesOwner, signatureCallback, quantitiesToContract = [] } = {}) {
@@ -4338,6 +4369,15 @@ Supported fuel-core version: ${supportedVersion}.`
4338
4369
  updateMaxFee
4339
4370
  };
4340
4371
  }
4372
+ /**
4373
+ * Get the required quantities and associated resources for a transaction.
4374
+ *
4375
+ * @param owner - address to add resources from.
4376
+ * @param transactionRequestLike - transaction request to populate resources for.
4377
+ * @param quantitiesToContract - quantities for the contract (optional).
4378
+ *
4379
+ * @returns a promise resolving to the required quantities for the transaction.
4380
+ */
4341
4381
  async getResourcesForTransaction(owner, transactionRequestLike, quantitiesToContract = []) {
4342
4382
  const ownerAddress = Address2.fromAddressOrString(owner);
4343
4383
  const transactionRequest = transactionRequestify(clone3(transactionRequestLike));
@@ -4359,6 +4399,12 @@ Supported fuel-core version: ${supportedVersion}.`
4359
4399
  }
4360
4400
  /**
4361
4401
  * Returns coins for the given owner.
4402
+ *
4403
+ * @param owner - The address to get coins for.
4404
+ * @param assetId - The asset ID of coins to get (optional).
4405
+ * @param paginationArgs - Pagination arguments (optional).
4406
+ *
4407
+ * @returns A promise that resolves to the coins.
4362
4408
  */
4363
4409
  async getCoins(owner, assetId, paginationArgs) {
4364
4410
  const ownerAddress = Address2.fromAddressOrString(owner);
@@ -4381,8 +4427,8 @@ Supported fuel-core version: ${supportedVersion}.`
4381
4427
  * Returns resources for the given owner satisfying the spend query.
4382
4428
  *
4383
4429
  * @param owner - The address to get resources for.
4384
- * @param quantities - The quantities to get.
4385
- * @param excludedIds - IDs of excluded resources from the selection.
4430
+ * @param quantities - The coin quantities to get.
4431
+ * @param excludedIds - IDs of excluded resources from the selection (optional).
4386
4432
  * @returns A promise that resolves to the resources.
4387
4433
  */
4388
4434
  async getResourcesToSpend(owner, quantities, excludedIds) {
@@ -4437,7 +4483,7 @@ Supported fuel-core version: ${supportedVersion}.`
4437
4483
  * Returns block matching the given ID or height.
4438
4484
  *
4439
4485
  * @param idOrHeight - ID or height of the block.
4440
- * @returns A promise that resolves to the block.
4486
+ * @returns A promise that resolves to the block or null.
4441
4487
  */
4442
4488
  async getBlock(idOrHeight) {
4443
4489
  let variables;
@@ -4567,7 +4613,7 @@ Supported fuel-core version: ${supportedVersion}.`
4567
4613
  * Returns balances for the given owner.
4568
4614
  *
4569
4615
  * @param owner - The address to get coins for.
4570
- * @param paginationArgs - Pagination arguments.
4616
+ * @param paginationArgs - Pagination arguments (optional).
4571
4617
  * @returns A promise that resolves to the balances.
4572
4618
  */
4573
4619
  async getBalances(owner, paginationArgs) {
@@ -4586,7 +4632,7 @@ Supported fuel-core version: ${supportedVersion}.`
4586
4632
  * Returns message for the given address.
4587
4633
  *
4588
4634
  * @param address - The address to get message from.
4589
- * @param paginationArgs - Pagination arguments.
4635
+ * @param paginationArgs - Pagination arguments (optional).
4590
4636
  * @returns A promise that resolves to the messages.
4591
4637
  */
4592
4638
  async getMessages(address, paginationArgs) {
@@ -4617,8 +4663,8 @@ Supported fuel-core version: ${supportedVersion}.`
4617
4663
  *
4618
4664
  * @param transactionId - The transaction to get message from.
4619
4665
  * @param messageId - The message id from MessageOut receipt.
4620
- * @param commitBlockId - The commit block id.
4621
- * @param commitBlockHeight - The commit block height.
4666
+ * @param commitBlockId - The commit block id (optional).
4667
+ * @param commitBlockHeight - The commit block height (optional).
4622
4668
  * @returns A promise that resolves to the message proof.
4623
4669
  */
4624
4670
  async getMessageProof(transactionId, nonce, commitBlockId, commitBlockHeight) {
@@ -4706,10 +4752,21 @@ Supported fuel-core version: ${supportedVersion}.`
4706
4752
  data
4707
4753
  };
4708
4754
  }
4755
+ /**
4756
+ * Get the latest gas price from the node.
4757
+ *
4758
+ * @returns A promise that resolves to the latest gas price.
4759
+ */
4709
4760
  async getLatestGasPrice() {
4710
4761
  const { latestGasPrice } = await this.operations.getLatestGasPrice();
4711
4762
  return bn17(latestGasPrice.gasPrice);
4712
4763
  }
4764
+ /**
4765
+ * Returns the estimate gas price for the given block horizon.
4766
+ *
4767
+ * @param blockHorizon - The block horizon to estimate gas price for.
4768
+ * @returns A promise that resolves to the estimated gas price.
4769
+ */
4713
4770
  async estimateGasPrice(blockHorizon) {
4714
4771
  const { estimateGasPrice } = await this.operations.estimateGasPrice({
4715
4772
  blockHorizon: String(blockHorizon)
@@ -4729,8 +4786,8 @@ Supported fuel-core version: ${supportedVersion}.`
4729
4786
  /**
4730
4787
  * Lets you produce blocks with custom timestamps and the block number of the last block produced.
4731
4788
  *
4732
- * @param amount - The amount of blocks to produce
4733
- * @param startTime - The UNIX timestamp (milliseconds) to set for the first produced block
4789
+ * @param amount - The amount of blocks to produce.
4790
+ * @param startTime - The UNIX timestamp (milliseconds) to set for the first produced block (optional).
4734
4791
  * @returns A promise that resolves to the block number of the last produced block.
4735
4792
  */
4736
4793
  async produceBlocks(amount, startTime) {
@@ -4740,6 +4797,12 @@ Supported fuel-core version: ${supportedVersion}.`
4740
4797
  });
4741
4798
  return bn17(latestBlockHeight);
4742
4799
  }
4800
+ /**
4801
+ * Get the transaction response for the given transaction ID.
4802
+ *
4803
+ * @param transactionId - The transaction ID to get the response for.
4804
+ * @returns A promise that resolves to the transaction response.
4805
+ */
4743
4806
  // eslint-disable-next-line @typescript-eslint/require-await
4744
4807
  async getTransactionResponse(transactionId) {
4745
4808
  return new TransactionResponse(transactionId, this);
@@ -4748,7 +4811,7 @@ Supported fuel-core version: ${supportedVersion}.`
4748
4811
  * Returns Message for given nonce.
4749
4812
  *
4750
4813
  * @param nonce - The nonce of the message to retrieve.
4751
- * @returns A promise that resolves to the Message object.
4814
+ * @returns A promise that resolves to the Message object or null.
4752
4815
  */
4753
4816
  async getMessageByNonce(nonce) {
4754
4817
  const { message } = await this.operations.getMessageByNonce({ nonce });
@@ -4757,6 +4820,12 @@ Supported fuel-core version: ${supportedVersion}.`
4757
4820
  }
4758
4821
  return message;
4759
4822
  }
4823
+ /**
4824
+ * Get the relayed transaction for the given transaction ID.
4825
+ *
4826
+ * @param relayedTransactionId - The relayed transaction ID to get the response for.
4827
+ * @returns A promise that resolves to the relayed transaction.
4828
+ */
4760
4829
  async getRelayedTransactionStatus(relayedTransactionId) {
4761
4830
  const { relayedTransactionStatus } = await this.operations.getRelayedTransactionStatus({
4762
4831
  relayedTransactionId
@@ -4766,6 +4835,9 @@ Supported fuel-core version: ${supportedVersion}.`
4766
4835
  }
4767
4836
  return relayedTransactionStatus;
4768
4837
  }
4838
+ /**
4839
+ * @hidden
4840
+ */
4769
4841
  extractDryRunError(transactionRequest, receipts, dryRunStatus) {
4770
4842
  const status = dryRunStatus;
4771
4843
  let logs = [];
@@ -4795,7 +4867,9 @@ cacheInputs_fn = function(inputs) {
4795
4867
  }
4796
4868
  });
4797
4869
  };
4870
+ /** @hidden */
4798
4871
  __publicField(Provider, "chainInfoCache", {});
4872
+ /** @hidden */
4799
4873
  __publicField(Provider, "nodeInfoCache", {});
4800
4874
 
4801
4875
  // src/providers/transaction-summary/get-transaction-summary.ts
@@ -4922,12 +4996,16 @@ var Account = class extends AbstractAccount {
4922
4996
  * The provider used to interact with the network.
4923
4997
  */
4924
4998
  _provider;
4999
+ /**
5000
+ * The connector for use with external wallets
5001
+ */
4925
5002
  _connector;
4926
5003
  /**
4927
5004
  * Creates a new Account instance.
4928
5005
  *
4929
5006
  * @param address - The address of the account.
4930
5007
  * @param provider - A Provider instance (optional).
5008
+ * @param connector - A FuelConnector instance (optional).
4931
5009
  */
4932
5010
  constructor(address, provider, connector) {
4933
5011
  super();
@@ -4969,8 +5047,8 @@ var Account = class extends AbstractAccount {
4969
5047
  /**
4970
5048
  * Retrieves resources satisfying the spend query for the account.
4971
5049
  *
4972
- * @param quantities - IDs of coins to exclude.
4973
- * @param excludedIds - IDs of resources to be excluded from the query.
5050
+ * @param quantities - Quantities of resources to be obtained.
5051
+ * @param excludedIds - IDs of resources to be excluded from the query (optional).
4974
5052
  * @returns A promise that resolves to an array of Resources.
4975
5053
  */
4976
5054
  async getResourcesToSpend(quantities, excludedIds) {
@@ -4979,7 +5057,7 @@ var Account = class extends AbstractAccount {
4979
5057
  /**
4980
5058
  * Retrieves coins owned by the account.
4981
5059
  *
4982
- * @param assetId - The asset ID of the coins to retrieve.
5060
+ * @param assetId - The asset ID of the coins to retrieve (optional).
4983
5061
  * @returns A promise that resolves to an array of Coins.
4984
5062
  */
4985
5063
  async getCoins(assetId) {
@@ -5032,7 +5110,7 @@ var Account = class extends AbstractAccount {
5032
5110
  /**
5033
5111
  * Retrieves the balance of the account for the given asset.
5034
5112
  *
5035
- * @param assetId - The asset ID to check the balance for.
5113
+ * @param assetId - The asset ID to check the balance for (optional).
5036
5114
  * @returns A promise that resolves to the balance amount.
5037
5115
  */
5038
5116
  async getBalance(assetId) {
@@ -5072,7 +5150,7 @@ var Account = class extends AbstractAccount {
5072
5150
  * @typeParam T - The type of the TransactionRequest.
5073
5151
  * @param request - The transaction request to fund.
5074
5152
  * @param params - The estimated transaction parameters.
5075
- * @returns The funded transaction request.
5153
+ * @returns A promise that resolves to the funded transaction request.
5076
5154
  */
5077
5155
  async fund(request, params) {
5078
5156
  const { addedSignatures, estimatedPredicates, requiredQuantities, updateMaxFee } = params;
@@ -5165,8 +5243,8 @@ var Account = class extends AbstractAccount {
5165
5243
  *
5166
5244
  * @param destination - The address of the destination.
5167
5245
  * @param amount - The amount of coins to transfer.
5168
- * @param assetId - The asset ID of the coins to transfer.
5169
- * @param txParams - The transaction parameters (gasLimit, tip, maturity, maxFee, witnessLimit).
5246
+ * @param assetId - The asset ID of the coins to transfer (optional).
5247
+ * @param txParams - The transaction parameters (optional).
5170
5248
  * @returns A promise that resolves to the prepared transaction request.
5171
5249
  */
5172
5250
  async createTransfer(destination, amount, assetId, txParams = {}) {
@@ -5180,8 +5258,8 @@ var Account = class extends AbstractAccount {
5180
5258
  *
5181
5259
  * @param destination - The address of the destination.
5182
5260
  * @param amount - The amount of coins to transfer.
5183
- * @param assetId - The asset ID of the coins to transfer.
5184
- * @param txParams - The transaction parameters (gasLimit, maturity).
5261
+ * @param assetId - The asset ID of the coins to transfer (optional).
5262
+ * @param txParams - The transaction parameters (optional).
5185
5263
  * @returns A promise that resolves to the transaction response.
5186
5264
  */
5187
5265
  async transfer(destination, amount, assetId, txParams = {}) {
@@ -5241,8 +5319,8 @@ var Account = class extends AbstractAccount {
5241
5319
  *
5242
5320
  * @param contractId - The address of the contract.
5243
5321
  * @param amount - The amount of coins to transfer.
5244
- * @param assetId - The asset ID of the coins to transfer.
5245
- * @param txParams - The optional transaction parameters.
5322
+ * @param assetId - The asset ID of the coins to transfer (optional).
5323
+ * @param txParams - The transaction parameters (optional).
5246
5324
  * @returns A promise that resolves to the transaction response.
5247
5325
  */
5248
5326
  async transferToContract(contractId, amount, assetId, txParams = {}) {
@@ -5283,7 +5361,7 @@ var Account = class extends AbstractAccount {
5283
5361
  *
5284
5362
  * @param recipient - Address of the recipient on the base chain.
5285
5363
  * @param amount - Amount of base asset.
5286
- * @param txParams - The optional transaction parameters.
5364
+ * @param txParams - The transaction parameters (optional).
5287
5365
  * @returns A promise that resolves to the transaction response.
5288
5366
  */
5289
5367
  async withdrawToBaseLayer(recipient, amount, txParams = {}) {
@@ -5313,7 +5391,14 @@ var Account = class extends AbstractAccount {
5313
5391
  await this.fund(request, txCost);
5314
5392
  return this.sendTransaction(request);
5315
5393
  }
5316
- /** @hidden * */
5394
+ /**
5395
+ * Sign a message from the account via the connector.
5396
+ *
5397
+ * @param message - the message to sign.
5398
+ * @returns a promise that resolves to the signature.
5399
+ *
5400
+ * @hidden
5401
+ */
5317
5402
  async signMessage(message) {
5318
5403
  if (!this._connector) {
5319
5404
  throw new FuelError15(ErrorCode15.MISSING_CONNECTOR, "A connector is required to sign messages.");
@@ -5321,7 +5406,7 @@ var Account = class extends AbstractAccount {
5321
5406
  return this._connector.signMessage(this.address.toString(), message);
5322
5407
  }
5323
5408
  /**
5324
- * Signs a transaction with the wallet's private key.
5409
+ * Signs a transaction from the account via the connector..
5325
5410
  *
5326
5411
  * @param transactionRequestLike - The transaction request to sign.
5327
5412
  * @returns A promise that resolves to the signature of the transaction.
@@ -5339,6 +5424,7 @@ var Account = class extends AbstractAccount {
5339
5424
  * Sends a transaction to the network.
5340
5425
  *
5341
5426
  * @param transactionRequestLike - The transaction request to be sent.
5427
+ * @param sendTransactionParams - The provider send transaction parameters (optional).
5342
5428
  * @returns A promise that resolves to the transaction response.
5343
5429
  */
5344
5430
  async sendTransaction(transactionRequestLike, { estimateTxDependencies = true, awaitExecution } = {}) {
@@ -5360,6 +5446,7 @@ var Account = class extends AbstractAccount {
5360
5446
  * Simulates a transaction.
5361
5447
  *
5362
5448
  * @param transactionRequestLike - The transaction request to be simulated.
5449
+ * @param estimateTxParams - The estimate transaction params (optional).
5363
5450
  * @returns A promise that resolves to the call result.
5364
5451
  */
5365
5452
  async simulateTransaction(transactionRequestLike, { estimateTxDependencies = true } = {}) {
@@ -5701,6 +5788,8 @@ var BaseWalletUnlocked = class extends Account {
5701
5788
  * Populates the witness signature for a transaction and sends it to the network using `provider.sendTransaction`.
5702
5789
  *
5703
5790
  * @param transactionRequestLike - The transaction request to send.
5791
+ * @param estimateTxDependencies - Whether to estimate the transaction dependencies.
5792
+ * @param awaitExecution - Whether to wait for the transaction to be executed.
5704
5793
  * @returns A promise that resolves to the TransactionResponse object.
5705
5794
  */
5706
5795
  async sendTransaction(transactionRequestLike, { estimateTxDependencies = false, awaitExecution } = {}) {
@@ -5732,6 +5821,12 @@ var BaseWalletUnlocked = class extends Account {
5732
5821
  }
5733
5822
  );
5734
5823
  }
5824
+ /**
5825
+ * Encrypts an unlocked wallet with a password.
5826
+ *
5827
+ * @param password - the password to encrypt the wallet with.
5828
+ * @returns - the encrypted wallet.
5829
+ */
5735
5830
  async encrypt(password) {
5736
5831
  return encryptKeystoreWallet(this.privateKey, this.address, password);
5737
5832
  }