@fuel-ts/account 0.0.0-rc-1895-20240328110906 → 0.0.0-rc-1895-20240328115555
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 +3 -3
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/dist/providers/utils/extract-tx-error.d.ts +16 -0
- package/dist/providers/utils/extract-tx-error.d.ts.map +1 -1
- package/dist/test-utils.global.js +3 -3
- package/dist/test-utils.global.js.map +1 -1
- package/dist/test-utils.js +3 -3
- package/dist/test-utils.js.map +1 -1
- package/dist/test-utils.mjs +3 -3
- package/dist/test-utils.mjs.map +1 -1
- package/package.json +16 -16
@@ -2,13 +2,29 @@ import { FuelError } from '@fuel-ts/errors';
|
|
2
2
|
import type { GqlTransactionStatusFragmentFragment } from '../__generated__/operations';
|
3
3
|
import type { TransactionResultReceipt } from '../transaction-response';
|
4
4
|
import type { FailureStatus } from '../transaction-summary';
|
5
|
+
/**
|
6
|
+
* Assembles an error message for a panic status.
|
7
|
+
* @param status - The transaction failure status.
|
8
|
+
* @returns The error message.
|
9
|
+
*/
|
5
10
|
export declare const assemblePanicError: (status: FailureStatus) => string;
|
11
|
+
/**
|
12
|
+
* Assembles an error message for a revert status.
|
13
|
+
* @param receipts - The transaction result processed receipts.
|
14
|
+
* @param logs - The transaction decoded logs.
|
15
|
+
* @returns The error message.
|
16
|
+
*/
|
6
17
|
export declare const assembleRevertError: (receipts: Array<TransactionResultReceipt>, logs: Array<unknown>) => string;
|
7
18
|
interface IExtractTxError {
|
8
19
|
receipts: Array<TransactionResultReceipt>;
|
9
20
|
status?: GqlTransactionStatusFragmentFragment | null;
|
10
21
|
logs: Array<unknown>;
|
11
22
|
}
|
23
|
+
/**
|
24
|
+
* Extracts the transaction error and returns a FuelError object.
|
25
|
+
* @param IExtractTxError - The parameters for extracting the error.
|
26
|
+
* @returns The FuelError object.
|
27
|
+
*/
|
12
28
|
export declare const extractTxError: (params: IExtractTxError) => FuelError;
|
13
29
|
export {};
|
14
30
|
//# sourceMappingURL=extract-tx-error.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"extract-tx-error.d.ts","sourceRoot":"","sources":["../../../src/providers/utils/extract-tx-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAcvD,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,6BAA6B,CAAC;AACxF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE5D,eAAO,MAAM,kBAAkB,WAAY,aAAa,WAQvD,CAAC;
|
1
|
+
{"version":3,"file":"extract-tx-error.d.ts","sourceRoot":"","sources":["../../../src/providers/utils/extract-tx-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAcvD,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,6BAA6B,CAAC;AACxF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE5D;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,WAAY,aAAa,WAQvD,CAAC;AAKF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,aACpB,MAAM,wBAAwB,CAAC,QACnC,MAAM,OAAO,CAAC,WA+CrB,CAAC;AAEF,UAAU,eAAe;IACvB,QAAQ,EAAE,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAC1C,MAAM,CAAC,EAAE,oCAAoC,GAAG,IAAI,CAAC;IACrD,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;CACtB;AAED;;;;GAIG;AACH,eAAO,MAAM,cAAc,WAAY,eAAe,KAAG,SAcxD,CAAC"}
|
@@ -42810,7 +42810,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
42810
42810
|
const reasonHex = bn(revertReceipt.val).toHex();
|
42811
42811
|
switch (reasonHex) {
|
42812
42812
|
case FAILED_REQUIRE_SIGNAL: {
|
42813
|
-
errorMessage = `The transaction reverted because
|
42813
|
+
errorMessage = `The transaction reverted because a "require" statement has thrown ${logs.length ? stringify2(logs[0]) : "an error."}.`;
|
42814
42814
|
break;
|
42815
42815
|
}
|
42816
42816
|
case FAILED_ASSERT_EQ_SIGNAL: {
|
@@ -42824,10 +42824,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
42824
42824
|
break;
|
42825
42825
|
}
|
42826
42826
|
case FAILED_ASSERT_SIGNAL:
|
42827
|
-
errorMessage = `The transaction reverted because
|
42827
|
+
errorMessage = `The transaction reverted because an "assert" statement failed to evaluate to true.`;
|
42828
42828
|
break;
|
42829
42829
|
case FAILED_TRANSFER_TO_ADDRESS_SIGNAL:
|
42830
|
-
errorMessage = `The transaction reverted because missing "OutputChange"
|
42830
|
+
errorMessage = `The transaction reverted because it's missing an "OutputChange".`;
|
42831
42831
|
break;
|
42832
42832
|
default:
|
42833
42833
|
errorMessage = `The transaction reverted with an unknown reason: ${revertReceipt.val}`;
|