@fuel-ts/account 0.100.5 → 0.101.0

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.
@@ -5636,6 +5636,11 @@ var TransactionResponse = class _TransactionResponse {
5636
5636
  if (statusChange.type === "PreconfirmationSuccessStatus" || statusChange.type === "PreconfirmationFailureStatus") {
5637
5637
  this.preConfirmationStatus = statusChange;
5638
5638
  this.resolveStatus("preConfirmation");
5639
+ const pendingConfirmationResolvers = this.statusResolvers.get("confirmation");
5640
+ if (!pendingConfirmationResolvers) {
5641
+ this.waitingForStreamData = false;
5642
+ break;
5643
+ }
5639
5644
  }
5640
5645
  if (statusChange.type === "SuccessStatus" || statusChange.type === "FailureStatus") {
5641
5646
  this.resolveStatus("confirmation");
@@ -6758,7 +6763,7 @@ var Provider = class _Provider {
6758
6763
  * @returns A promise that resolves to the transaction cost object.
6759
6764
  *
6760
6765
  * @deprecated Use provider.assembleTx instead
6761
- * Check the migration guide https://docs.fuel.network/guide/assembling-transactions/migration-guide.html for more information.
6766
+ * Check the migration guide https://docs.fuel.network/docs/fuels-ts/transactions/assemble-tx-migration-guide/ for more information.
6762
6767
  */
6763
6768
  async getTransactionCost(transactionRequestLike, { signatureCallback, gasPrice: gasPriceParam } = {}) {
6764
6769
  const txRequestClone = clone8(transactionRequestify(transactionRequestLike));
@@ -6902,7 +6907,7 @@ var Provider = class _Provider {
6902
6907
  requiredBalances,
6903
6908
  estimatePredicates,
6904
6909
  excludeInput,
6905
- reserveGas: reserveGas ? reserveGas.toString(10) : void 0
6910
+ reserveGas: reserveGas ? bn18(reserveGas).toString(10) : void 0
6906
6911
  });
6907
6912
  if (status.type === "DryRunFailureStatus") {
6908
6913
  const parsedReceipts = status.receipts.map(deserializeReceipt);
@@ -6914,8 +6919,8 @@ var Provider = class _Provider {
6914
6919
  if (gqlTransaction.policies?.maxFee) {
6915
6920
  request.maxFee = bn18(gqlTransaction.policies.maxFee);
6916
6921
  }
6917
- if (gqlTransaction.scriptGasLimit) {
6918
- request.gasLimit = bn18(gqlTransaction.scriptGasLimit);
6922
+ if (request.type === TransactionType11.Script) {
6923
+ request.gasLimit = bn18(gqlTransaction.scriptGasLimit).add(bn18(reserveGas));
6919
6924
  }
6920
6925
  const rawReceipts = status.receipts;
6921
6926
  const chainId = await this.getChainId();
@@ -7689,30 +7694,6 @@ import { InputType as InputType8, OutputType as OutputType9 } from "@fuel-ts/tra
7689
7694
  import { arrayify as arrayify17, hexlify as hexlify21, isDefined as isDefined4 } from "@fuel-ts/utils";
7690
7695
  import { clone as clone9 } from "ramda";
7691
7696
 
7692
- // src/providers/utils/transaction-response-serialization.ts
7693
- var deserializeTransactionResponseJson = /* @__PURE__ */ __name((json) => {
7694
- const {
7695
- id,
7696
- abis,
7697
- status,
7698
- providerUrl,
7699
- requestJson,
7700
- providerCache,
7701
- gqlTransaction,
7702
- preConfirmationStatus
7703
- } = json;
7704
- const provider = new Provider(providerUrl, { cache: providerCache });
7705
- const { chainId } = providerCache.chain.consensusParameters;
7706
- const response = new TransactionResponse(id, provider, Number(chainId), abis);
7707
- if (requestJson) {
7708
- response.request = transactionRequestify(JSON.parse(requestJson));
7709
- }
7710
- response.status = status;
7711
- response.gqlTransaction = gqlTransaction;
7712
- response.preConfirmationStatus = preConfirmationStatus;
7713
- return response;
7714
- }, "deserializeTransactionResponseJson");
7715
-
7716
7697
  // src/types.ts
7717
7698
  var AbstractAccount = class {
7718
7699
  static {
@@ -7889,7 +7870,7 @@ var Account = class extends AbstractAccount {
7889
7870
  * @returns A promise that resolves to the funded transaction request.
7890
7871
  *
7891
7872
  * @deprecated Use provider.assembleTx instead
7892
- * Check the migration guide https://docs.fuel.network/guide/assembling-transactions/migration-guide.html for more information.
7873
+ * Check the migration guide https://docs.fuel.network/docs/fuels-ts/transactions/assemble-tx-migration-guide/ for more information.
7893
7874
  */
7894
7875
  async fund(request, params) {
7895
7876
  const {
@@ -8308,7 +8289,7 @@ var Account = class extends AbstractAccount {
8308
8289
  * @returns A promise that resolves to the transaction cost object.
8309
8290
  *
8310
8291
  * @deprecated Use provider.assembleTx instead
8311
- * Check the migration guide https://docs.fuel.network/guide/assembling-transactions/migration-guide.html for more information.
8292
+ * Check the migration guide https://docs.fuel.network/docs/fuels-ts/transactions/assemble-tx-migration-guide/ for more information.
8312
8293
  */
8313
8294
  async getTransactionCost(transactionRequestLike, { signatureCallback, quantities = [], gasPrice } = {}) {
8314
8295
  const txRequestClone = clone9(transactionRequestify(transactionRequestLike));
@@ -8409,7 +8390,7 @@ var Account = class extends AbstractAccount {
8409
8390
  transactionRequest,
8410
8391
  params
8411
8392
  );
8412
- return typeof transaction === "string" ? this.provider.getTransactionResponse(transaction) : deserializeTransactionResponseJson(transaction);
8393
+ return typeof transaction === "string" ? this.provider.getTransactionResponse(transaction) : transaction;
8413
8394
  }
8414
8395
  if (estimateTxDependencies) {
8415
8396
  await this.provider.estimateTxDependencies(transactionRequest);