@fuel-ts/account 0.0.0-rc-2272-20240517113706 → 0.0.0-rc-2143-20240517135655
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.
- package/dist/index.global.js +33 -15
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +33 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +33 -15
- package/dist/index.mjs.map +1 -1
- package/dist/providers/__generated__/operations.d.ts +8 -0
- package/dist/providers/__generated__/operations.d.ts.map +1 -1
- package/dist/providers/provider.d.ts +4 -1
- 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/extract-tx-error.d.ts +2 -4
- package/dist/providers/utils/extract-tx-error.d.ts.map +1 -1
- package/dist/test-utils/launchNode.d.ts +3 -3
- package/dist/test-utils/launchNode.d.ts.map +1 -1
- package/dist/test-utils.global.js +99 -97
- package/dist/test-utils.global.js.map +1 -1
- package/dist/test-utils.js +35 -19
- package/dist/test-utils.js.map +1 -1
- package/dist/test-utils.mjs +35 -19
- package/dist/test-utils.mjs.map +1 -1
- package/package.json +15 -15
package/dist/index.global.js
CHANGED
@@ -36816,6 +36816,7 @@ ${SqueezedOutStatusFragmentDoc}`;
|
|
36816
36816
|
${InputEstimatePredicatesFragmentDoc}`;
|
36817
36817
|
var DryRunFailureStatusFragmentDoc = lib_default2`
|
36818
36818
|
fragment dryRunFailureStatusFragment on DryRunFailureStatus {
|
36819
|
+
type: __typename
|
36819
36820
|
totalGas
|
36820
36821
|
totalFee
|
36821
36822
|
reason
|
@@ -36827,6 +36828,7 @@ ${SqueezedOutStatusFragmentDoc}`;
|
|
36827
36828
|
`;
|
36828
36829
|
var DryRunSuccessStatusFragmentDoc = lib_default2`
|
36829
36830
|
fragment dryRunSuccessStatusFragment on DryRunSuccessStatus {
|
36831
|
+
type: __typename
|
36830
36832
|
totalGas
|
36831
36833
|
totalFee
|
36832
36834
|
programState {
|
@@ -38335,17 +38337,16 @@ ${MessageCoinFragmentDoc}`;
|
|
38335
38337
|
}
|
38336
38338
|
|
38337
38339
|
// src/providers/utils/extract-tx-error.ts
|
38338
|
-
var assemblePanicError = (
|
38339
|
-
let errorMessage = `The transaction reverted with reason: "${
|
38340
|
-
|
38341
|
-
if (PANIC_REASONS.includes(status.reason)) {
|
38340
|
+
var assemblePanicError = (statusReason) => {
|
38341
|
+
let errorMessage = `The transaction reverted with reason: "${statusReason}".`;
|
38342
|
+
if (PANIC_REASONS.includes(statusReason)) {
|
38342
38343
|
errorMessage = `${errorMessage}
|
38343
38344
|
|
38344
38345
|
You can read more about this error at:
|
38345
38346
|
|
38346
|
-
${PANIC_DOC_URL}#variant.${
|
38347
|
+
${PANIC_DOC_URL}#variant.${statusReason}`;
|
38347
38348
|
}
|
38348
|
-
return { errorMessage, reason };
|
38349
|
+
return { errorMessage, reason: statusReason };
|
38349
38350
|
};
|
38350
38351
|
var stringify = (obj) => JSON.stringify(obj, null, 2);
|
38351
38352
|
var assembleRevertError = (receipts, logs) => {
|
@@ -38388,10 +38389,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
38388
38389
|
return { errorMessage, reason };
|
38389
38390
|
};
|
38390
38391
|
var extractTxError = (params) => {
|
38391
|
-
const { receipts,
|
38392
|
+
const { receipts, statusReason, logs } = params;
|
38392
38393
|
const isPanic = receipts.some(({ type: type3 }) => type3 === ReceiptType.Panic);
|
38393
38394
|
const isRevert = receipts.some(({ type: type3 }) => type3 === ReceiptType.Revert);
|
38394
|
-
const { errorMessage, reason } =
|
38395
|
+
const { errorMessage, reason } = isPanic ? assemblePanicError(statusReason) : assembleRevertError(receipts, logs);
|
38395
38396
|
const metadata = {
|
38396
38397
|
logs,
|
38397
38398
|
receipts,
|
@@ -40270,14 +40271,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
40270
40271
|
);
|
40271
40272
|
transactionResult.logs = logs;
|
40272
40273
|
}
|
40273
|
-
|
40274
|
-
|
40275
|
-
|
40276
|
-
gqlTransaction: { status }
|
40277
|
-
} = transactionResult;
|
40274
|
+
const { gqlTransaction, receipts } = transactionResult;
|
40275
|
+
if (gqlTransaction.status?.type === "FailureStatus") {
|
40276
|
+
const { reason } = gqlTransaction.status;
|
40278
40277
|
throw extractTxError({
|
40279
40278
|
receipts,
|
40280
|
-
|
40279
|
+
statusReason: reason,
|
40281
40280
|
logs
|
40282
40281
|
});
|
40283
40282
|
}
|
@@ -41009,7 +41008,10 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
41009
41008
|
await signatureCallback(txRequestClone);
|
41010
41009
|
}
|
41011
41010
|
({ receipts, missingContractIds, outputVariables, dryRunStatus } = await this.estimateTxDependencies(txRequestClone));
|
41012
|
-
|
41011
|
+
if (dryRunStatus && "reason" in dryRunStatus) {
|
41012
|
+
throw this.extractDryRunError(txRequestClone, receipts, dryRunStatus);
|
41013
|
+
}
|
41014
|
+
gasUsed = getGasUsedFromReceipts(receipts);
|
41013
41015
|
txRequestClone.gasLimit = gasUsed;
|
41014
41016
|
({ maxFee, maxGas, minFee, minGas, gasPrice } = await this.estimateTxGasAndFee({
|
41015
41017
|
transactionRequest: txRequestClone,
|
@@ -41461,6 +41463,22 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
41461
41463
|
}
|
41462
41464
|
return relayedTransactionStatus;
|
41463
41465
|
}
|
41466
|
+
extractDryRunError(transactionRequest, receipts, dryRunStatus) {
|
41467
|
+
const status = dryRunStatus;
|
41468
|
+
let logs = [];
|
41469
|
+
if (transactionRequest.abis) {
|
41470
|
+
logs = getDecodedLogs(
|
41471
|
+
receipts,
|
41472
|
+
transactionRequest.abis.main,
|
41473
|
+
transactionRequest.abis.otherContractsAbis
|
41474
|
+
);
|
41475
|
+
}
|
41476
|
+
return extractTxError({
|
41477
|
+
logs,
|
41478
|
+
receipts,
|
41479
|
+
statusReason: status.reason
|
41480
|
+
});
|
41481
|
+
}
|
41464
41482
|
};
|
41465
41483
|
var Provider = _Provider;
|
41466
41484
|
_cacheInputs = new WeakSet();
|