@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.
- package/dist/account.d.ts +2 -2
- package/dist/account.d.ts.map +1 -1
- package/dist/connectors/fuel-connector.d.ts +3 -3
- package/dist/connectors/fuel-connector.d.ts.map +1 -1
- package/dist/index.global.js +34 -8
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +37 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +35 -7
- package/dist/index.mjs.map +1 -1
- package/dist/predicate/predicate.d.ts +15 -3
- package/dist/predicate/predicate.d.ts.map +1 -1
- package/dist/providers/index.d.ts +1 -0
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/provider.d.ts +2 -2
- package/dist/providers/provider.d.ts.map +1 -1
- package/dist/providers/transaction-response/transaction-response.d.ts.map +1 -1
- package/dist/providers/utils/transaction-response-serialization.d.ts +3 -2
- package/dist/providers/utils/transaction-response-serialization.d.ts.map +1 -1
- package/dist/test-utils.global.js +13 -32
- package/dist/test-utils.global.js.map +1 -1
- package/dist/test-utils.js +12 -31
- package/dist/test-utils.js.map +1 -1
- package/dist/test-utils.mjs +12 -31
- package/dist/test-utils.mjs.map +1 -1
- package/package.json +14 -14
package/dist/test-utils.js
CHANGED
@@ -5651,6 +5651,11 @@ var TransactionResponse = class _TransactionResponse {
|
|
5651
5651
|
if (statusChange.type === "PreconfirmationSuccessStatus" || statusChange.type === "PreconfirmationFailureStatus") {
|
5652
5652
|
this.preConfirmationStatus = statusChange;
|
5653
5653
|
this.resolveStatus("preConfirmation");
|
5654
|
+
const pendingConfirmationResolvers = this.statusResolvers.get("confirmation");
|
5655
|
+
if (!pendingConfirmationResolvers) {
|
5656
|
+
this.waitingForStreamData = false;
|
5657
|
+
break;
|
5658
|
+
}
|
5654
5659
|
}
|
5655
5660
|
if (statusChange.type === "SuccessStatus" || statusChange.type === "FailureStatus") {
|
5656
5661
|
this.resolveStatus("confirmation");
|
@@ -6773,7 +6778,7 @@ var Provider = class _Provider {
|
|
6773
6778
|
* @returns A promise that resolves to the transaction cost object.
|
6774
6779
|
*
|
6775
6780
|
* @deprecated Use provider.assembleTx instead
|
6776
|
-
* Check the migration guide https://docs.fuel.network/
|
6781
|
+
* Check the migration guide https://docs.fuel.network/docs/fuels-ts/transactions/assemble-tx-migration-guide/ for more information.
|
6777
6782
|
*/
|
6778
6783
|
async getTransactionCost(transactionRequestLike, { signatureCallback, gasPrice: gasPriceParam } = {}) {
|
6779
6784
|
const txRequestClone = (0, import_ramda8.clone)(transactionRequestify(transactionRequestLike));
|
@@ -6917,7 +6922,7 @@ var Provider = class _Provider {
|
|
6917
6922
|
requiredBalances,
|
6918
6923
|
estimatePredicates,
|
6919
6924
|
excludeInput,
|
6920
|
-
reserveGas: reserveGas ? reserveGas.toString(10) : void 0
|
6925
|
+
reserveGas: reserveGas ? (0, import_math20.bn)(reserveGas).toString(10) : void 0
|
6921
6926
|
});
|
6922
6927
|
if (status.type === "DryRunFailureStatus") {
|
6923
6928
|
const parsedReceipts = status.receipts.map(deserializeReceipt);
|
@@ -6929,8 +6934,8 @@ var Provider = class _Provider {
|
|
6929
6934
|
if (gqlTransaction.policies?.maxFee) {
|
6930
6935
|
request.maxFee = (0, import_math20.bn)(gqlTransaction.policies.maxFee);
|
6931
6936
|
}
|
6932
|
-
if (
|
6933
|
-
request.gasLimit = (0, import_math20.bn)(gqlTransaction.scriptGasLimit);
|
6937
|
+
if (request.type === import_transactions25.TransactionType.Script) {
|
6938
|
+
request.gasLimit = (0, import_math20.bn)(gqlTransaction.scriptGasLimit).add((0, import_math20.bn)(reserveGas));
|
6934
6939
|
}
|
6935
6940
|
const rawReceipts = status.receipts;
|
6936
6941
|
const chainId = await this.getChainId();
|
@@ -7704,30 +7709,6 @@ var import_transactions28 = require("@fuel-ts/transactions");
|
|
7704
7709
|
var import_utils38 = require("@fuel-ts/utils");
|
7705
7710
|
var import_ramda9 = require("ramda");
|
7706
7711
|
|
7707
|
-
// src/providers/utils/transaction-response-serialization.ts
|
7708
|
-
var deserializeTransactionResponseJson = /* @__PURE__ */ __name((json) => {
|
7709
|
-
const {
|
7710
|
-
id,
|
7711
|
-
abis,
|
7712
|
-
status,
|
7713
|
-
providerUrl,
|
7714
|
-
requestJson,
|
7715
|
-
providerCache,
|
7716
|
-
gqlTransaction,
|
7717
|
-
preConfirmationStatus
|
7718
|
-
} = json;
|
7719
|
-
const provider = new Provider(providerUrl, { cache: providerCache });
|
7720
|
-
const { chainId } = providerCache.chain.consensusParameters;
|
7721
|
-
const response = new TransactionResponse(id, provider, Number(chainId), abis);
|
7722
|
-
if (requestJson) {
|
7723
|
-
response.request = transactionRequestify(JSON.parse(requestJson));
|
7724
|
-
}
|
7725
|
-
response.status = status;
|
7726
|
-
response.gqlTransaction = gqlTransaction;
|
7727
|
-
response.preConfirmationStatus = preConfirmationStatus;
|
7728
|
-
return response;
|
7729
|
-
}, "deserializeTransactionResponseJson");
|
7730
|
-
|
7731
7712
|
// src/types.ts
|
7732
7713
|
var AbstractAccount = class {
|
7733
7714
|
static {
|
@@ -7904,7 +7885,7 @@ var Account = class extends AbstractAccount {
|
|
7904
7885
|
* @returns A promise that resolves to the funded transaction request.
|
7905
7886
|
*
|
7906
7887
|
* @deprecated Use provider.assembleTx instead
|
7907
|
-
* Check the migration guide https://docs.fuel.network/
|
7888
|
+
* Check the migration guide https://docs.fuel.network/docs/fuels-ts/transactions/assemble-tx-migration-guide/ for more information.
|
7908
7889
|
*/
|
7909
7890
|
async fund(request, params) {
|
7910
7891
|
const {
|
@@ -8323,7 +8304,7 @@ var Account = class extends AbstractAccount {
|
|
8323
8304
|
* @returns A promise that resolves to the transaction cost object.
|
8324
8305
|
*
|
8325
8306
|
* @deprecated Use provider.assembleTx instead
|
8326
|
-
* Check the migration guide https://docs.fuel.network/
|
8307
|
+
* Check the migration guide https://docs.fuel.network/docs/fuels-ts/transactions/assemble-tx-migration-guide/ for more information.
|
8327
8308
|
*/
|
8328
8309
|
async getTransactionCost(transactionRequestLike, { signatureCallback, quantities = [], gasPrice } = {}) {
|
8329
8310
|
const txRequestClone = (0, import_ramda9.clone)(transactionRequestify(transactionRequestLike));
|
@@ -8424,7 +8405,7 @@ var Account = class extends AbstractAccount {
|
|
8424
8405
|
transactionRequest,
|
8425
8406
|
params
|
8426
8407
|
);
|
8427
|
-
return typeof transaction === "string" ? this.provider.getTransactionResponse(transaction) :
|
8408
|
+
return typeof transaction === "string" ? this.provider.getTransactionResponse(transaction) : transaction;
|
8428
8409
|
}
|
8429
8410
|
if (estimateTxDependencies) {
|
8430
8411
|
await this.provider.estimateTxDependencies(transactionRequest);
|