@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/index.mjs
CHANGED
@@ -6136,6 +6136,11 @@ var TransactionResponse = class _TransactionResponse {
|
|
6136
6136
|
if (statusChange.type === "PreconfirmationSuccessStatus" || statusChange.type === "PreconfirmationFailureStatus") {
|
6137
6137
|
this.preConfirmationStatus = statusChange;
|
6138
6138
|
this.resolveStatus("preConfirmation");
|
6139
|
+
const pendingConfirmationResolvers = this.statusResolvers.get("confirmation");
|
6140
|
+
if (!pendingConfirmationResolvers) {
|
6141
|
+
this.waitingForStreamData = false;
|
6142
|
+
break;
|
6143
|
+
}
|
6139
6144
|
}
|
6140
6145
|
if (statusChange.type === "SuccessStatus" || statusChange.type === "FailureStatus") {
|
6141
6146
|
this.resolveStatus("confirmation");
|
@@ -7281,7 +7286,7 @@ var Provider = class _Provider {
|
|
7281
7286
|
* @returns A promise that resolves to the transaction cost object.
|
7282
7287
|
*
|
7283
7288
|
* @deprecated Use provider.assembleTx instead
|
7284
|
-
* Check the migration guide https://docs.fuel.network/
|
7289
|
+
* Check the migration guide https://docs.fuel.network/docs/fuels-ts/transactions/assemble-tx-migration-guide/ for more information.
|
7285
7290
|
*/
|
7286
7291
|
async getTransactionCost(transactionRequestLike, { signatureCallback, gasPrice: gasPriceParam } = {}) {
|
7287
7292
|
const txRequestClone = clone8(transactionRequestify(transactionRequestLike));
|
@@ -7425,7 +7430,7 @@ var Provider = class _Provider {
|
|
7425
7430
|
requiredBalances,
|
7426
7431
|
estimatePredicates,
|
7427
7432
|
excludeInput,
|
7428
|
-
reserveGas: reserveGas ? reserveGas.toString(10) : void 0
|
7433
|
+
reserveGas: reserveGas ? bn18(reserveGas).toString(10) : void 0
|
7429
7434
|
});
|
7430
7435
|
if (status.type === "DryRunFailureStatus") {
|
7431
7436
|
const parsedReceipts = status.receipts.map(deserializeReceipt);
|
@@ -7437,8 +7442,8 @@ var Provider = class _Provider {
|
|
7437
7442
|
if (gqlTransaction.policies?.maxFee) {
|
7438
7443
|
request2.maxFee = bn18(gqlTransaction.policies.maxFee);
|
7439
7444
|
}
|
7440
|
-
if (
|
7441
|
-
request2.gasLimit = bn18(gqlTransaction.scriptGasLimit);
|
7445
|
+
if (request2.type === TransactionType11.Script) {
|
7446
|
+
request2.gasLimit = bn18(gqlTransaction.scriptGasLimit).add(bn18(reserveGas));
|
7442
7447
|
}
|
7443
7448
|
const rawReceipts = status.receipts;
|
7444
7449
|
const chainId = await this.getChainId();
|
@@ -8328,6 +8333,19 @@ var assembleTransactionSummaryFromJson = /* @__PURE__ */ __name(async (opts) =>
|
|
8328
8333
|
}, "assembleTransactionSummaryFromJson");
|
8329
8334
|
|
8330
8335
|
// src/providers/utils/transaction-response-serialization.ts
|
8336
|
+
var serializeTransactionResponseJson = /* @__PURE__ */ __name(async (response) => {
|
8337
|
+
const { id, status, abis, request: request2, provider, gqlTransaction, preConfirmationStatus } = response;
|
8338
|
+
return {
|
8339
|
+
id,
|
8340
|
+
status,
|
8341
|
+
abis,
|
8342
|
+
requestJson: request2 ? JSON.stringify(request2.toJSON()) : void 0,
|
8343
|
+
providerUrl: provider.url,
|
8344
|
+
providerCache: await serializeProviderCache(provider),
|
8345
|
+
gqlTransaction,
|
8346
|
+
preConfirmationStatus
|
8347
|
+
};
|
8348
|
+
}, "serializeTransactionResponseJson");
|
8331
8349
|
var deserializeTransactionResponseJson = /* @__PURE__ */ __name((json) => {
|
8332
8350
|
const {
|
8333
8351
|
id,
|
@@ -8527,7 +8545,7 @@ var Account = class extends AbstractAccount {
|
|
8527
8545
|
* @returns A promise that resolves to the funded transaction request.
|
8528
8546
|
*
|
8529
8547
|
* @deprecated Use provider.assembleTx instead
|
8530
|
-
* Check the migration guide https://docs.fuel.network/
|
8548
|
+
* Check the migration guide https://docs.fuel.network/docs/fuels-ts/transactions/assemble-tx-migration-guide/ for more information.
|
8531
8549
|
*/
|
8532
8550
|
async fund(request2, params) {
|
8533
8551
|
const {
|
@@ -8946,7 +8964,7 @@ var Account = class extends AbstractAccount {
|
|
8946
8964
|
* @returns A promise that resolves to the transaction cost object.
|
8947
8965
|
*
|
8948
8966
|
* @deprecated Use provider.assembleTx instead
|
8949
|
-
* Check the migration guide https://docs.fuel.network/
|
8967
|
+
* Check the migration guide https://docs.fuel.network/docs/fuels-ts/transactions/assemble-tx-migration-guide/ for more information.
|
8950
8968
|
*/
|
8951
8969
|
async getTransactionCost(transactionRequestLike, { signatureCallback, quantities = [], gasPrice } = {}) {
|
8952
8970
|
const txRequestClone = clone9(transactionRequestify(transactionRequestLike));
|
@@ -9047,7 +9065,7 @@ var Account = class extends AbstractAccount {
|
|
9047
9065
|
transactionRequest,
|
9048
9066
|
params
|
9049
9067
|
);
|
9050
|
-
return typeof transaction === "string" ? this.provider.getTransactionResponse(transaction) :
|
9068
|
+
return typeof transaction === "string" ? this.provider.getTransactionResponse(transaction) : transaction;
|
9051
9069
|
}
|
9052
9070
|
if (estimateTxDependencies) {
|
9053
9071
|
await this.provider.estimateTxDependencies(transactionRequest);
|
@@ -13026,6 +13044,14 @@ var Predicate = class _Predicate extends Account {
|
|
13026
13044
|
configurableConstants: overrides.configurableConstants ?? this.configurableConstants
|
13027
13045
|
});
|
13028
13046
|
}
|
13047
|
+
/**
|
13048
|
+
* Sets the predicate data.
|
13049
|
+
*
|
13050
|
+
* @param data - The data to be set for the predicate.
|
13051
|
+
*/
|
13052
|
+
setData(data) {
|
13053
|
+
this.predicateData = data;
|
13054
|
+
}
|
13029
13055
|
/**
|
13030
13056
|
* Processes the predicate data and returns the altered bytecode and interface.
|
13031
13057
|
*
|
@@ -13954,6 +13980,7 @@ export {
|
|
13954
13980
|
deserializeProcessedTxOutput,
|
13955
13981
|
deserializeProviderCache,
|
13956
13982
|
deserializeReceipt,
|
13983
|
+
deserializeTransactionResponseJson,
|
13957
13984
|
dispatchFuelConnectorEvent,
|
13958
13985
|
english,
|
13959
13986
|
extractBurnedAssetsFromReceipts,
|
@@ -14054,6 +14081,7 @@ export {
|
|
14054
14081
|
serializeChain,
|
14055
14082
|
serializeNodeInfo,
|
14056
14083
|
serializeProviderCache,
|
14084
|
+
serializeTransactionResponseJson,
|
14057
14085
|
setAndValidateGasAndFeeForAssembledTx,
|
14058
14086
|
transactionRequestify,
|
14059
14087
|
urlJoin,
|