@lifi/sdk 2.0.0-beta.12 → 2.0.0-beta.13
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/cjs/utils/errors.d.ts +4 -2
- package/dist/cjs/utils/errors.js +3 -1
- package/dist/cjs/utils/parseError.js +3 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/utils/errors.d.ts +4 -2
- package/dist/utils/errors.js +3 -1
- package/dist/utils/parseError.js +4 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -23,11 +23,13 @@ export declare enum LifiErrorCode {
|
|
|
23
23
|
SlippageError = 1011,
|
|
24
24
|
TransactionRejected = 1012,
|
|
25
25
|
BalanceError = 1013,
|
|
26
|
-
AllowanceRequired = 1014
|
|
26
|
+
AllowanceRequired = 1014,
|
|
27
|
+
InsufficientFunds = 1015
|
|
27
28
|
}
|
|
28
29
|
export declare enum EthersErrorType {
|
|
30
|
+
ActionRejected = "ACTION_REJECTED",
|
|
29
31
|
CallExecption = "CALL_EXCEPTION",
|
|
30
|
-
|
|
32
|
+
InsufficientFunds = "INSUFFICIENT_FUNDS"
|
|
31
33
|
}
|
|
32
34
|
export declare enum EthersErrorMessage {
|
|
33
35
|
ERC20Allowance = "ERC20: transfer amount exceeds allowance",
|
package/dist/cjs/utils/errors.js
CHANGED
|
@@ -29,11 +29,13 @@ var LifiErrorCode;
|
|
|
29
29
|
LifiErrorCode[LifiErrorCode["TransactionRejected"] = 1012] = "TransactionRejected";
|
|
30
30
|
LifiErrorCode[LifiErrorCode["BalanceError"] = 1013] = "BalanceError";
|
|
31
31
|
LifiErrorCode[LifiErrorCode["AllowanceRequired"] = 1014] = "AllowanceRequired";
|
|
32
|
+
LifiErrorCode[LifiErrorCode["InsufficientFunds"] = 1015] = "InsufficientFunds";
|
|
32
33
|
})(LifiErrorCode = exports.LifiErrorCode || (exports.LifiErrorCode = {}));
|
|
33
34
|
var EthersErrorType;
|
|
34
35
|
(function (EthersErrorType) {
|
|
35
|
-
EthersErrorType["CallExecption"] = "CALL_EXCEPTION";
|
|
36
36
|
EthersErrorType["ActionRejected"] = "ACTION_REJECTED";
|
|
37
|
+
EthersErrorType["CallExecption"] = "CALL_EXCEPTION";
|
|
38
|
+
EthersErrorType["InsufficientFunds"] = "INSUFFICIENT_FUNDS";
|
|
37
39
|
})(EthersErrorType = exports.EthersErrorType || (exports.EthersErrorType = {}));
|
|
38
40
|
var EthersErrorMessage;
|
|
39
41
|
(function (EthersErrorMessage) {
|
|
@@ -5,10 +5,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.parseBackendError = exports.parseError = exports.getTransactionFailedMessage = exports.getTransactionNotSentMessage = void 0;
|
|
7
7
|
const eth_rpc_errors_1 = require("eth-rpc-errors");
|
|
8
|
+
const helpers_1 = require("../helpers");
|
|
8
9
|
const ChainsService_1 = __importDefault(require("../services/ChainsService"));
|
|
9
10
|
const errors_1 = require("./errors");
|
|
10
11
|
const utils_1 = require("./utils");
|
|
11
|
-
const helpers_1 = require("../helpers");
|
|
12
12
|
/**
|
|
13
13
|
* Available MetaMask error codes:
|
|
14
14
|
*
|
|
@@ -115,6 +115,8 @@ const parseError = async (e, step, process) => {
|
|
|
115
115
|
catch (error) {
|
|
116
116
|
return new errors_1.ProviderError(errors_1.LifiErrorCode.TransactionFailed, e.reason, defaultErrorMessage, e.stack);
|
|
117
117
|
}
|
|
118
|
+
case errors_1.EthersErrorType.InsufficientFunds:
|
|
119
|
+
return new errors_1.TransactionError(errors_1.LifiErrorCode.InsufficientFunds, e.message, await (0, exports.getTransactionNotSentMessage)(step, process), e.stack);
|
|
118
120
|
case errors_1.EthersErrorType.ActionRejected:
|
|
119
121
|
case errors_1.MetaMaskProviderErrorCode.userRejectedRequest:
|
|
120
122
|
return new errors_1.TransactionError(errors_1.LifiErrorCode.TransactionRejected, e.message, await (0, exports.getTransactionNotSentMessage)(step, process), e.stack);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const name = "@lifi/sdk";
|
|
2
|
-
export declare const version = "2.0.0-beta.
|
|
2
|
+
export declare const version = "2.0.0-beta.13";
|
package/dist/cjs/version.js
CHANGED
package/dist/utils/errors.d.ts
CHANGED
|
@@ -23,11 +23,13 @@ export declare enum LifiErrorCode {
|
|
|
23
23
|
SlippageError = 1011,
|
|
24
24
|
TransactionRejected = 1012,
|
|
25
25
|
BalanceError = 1013,
|
|
26
|
-
AllowanceRequired = 1014
|
|
26
|
+
AllowanceRequired = 1014,
|
|
27
|
+
InsufficientFunds = 1015
|
|
27
28
|
}
|
|
28
29
|
export declare enum EthersErrorType {
|
|
30
|
+
ActionRejected = "ACTION_REJECTED",
|
|
29
31
|
CallExecption = "CALL_EXCEPTION",
|
|
30
|
-
|
|
32
|
+
InsufficientFunds = "INSUFFICIENT_FUNDS"
|
|
31
33
|
}
|
|
32
34
|
export declare enum EthersErrorMessage {
|
|
33
35
|
ERC20Allowance = "ERC20: transfer amount exceeds allowance",
|
package/dist/utils/errors.js
CHANGED
|
@@ -26,11 +26,13 @@ export var LifiErrorCode;
|
|
|
26
26
|
LifiErrorCode[LifiErrorCode["TransactionRejected"] = 1012] = "TransactionRejected";
|
|
27
27
|
LifiErrorCode[LifiErrorCode["BalanceError"] = 1013] = "BalanceError";
|
|
28
28
|
LifiErrorCode[LifiErrorCode["AllowanceRequired"] = 1014] = "AllowanceRequired";
|
|
29
|
+
LifiErrorCode[LifiErrorCode["InsufficientFunds"] = 1015] = "InsufficientFunds";
|
|
29
30
|
})(LifiErrorCode || (LifiErrorCode = {}));
|
|
30
31
|
export var EthersErrorType;
|
|
31
32
|
(function (EthersErrorType) {
|
|
32
|
-
EthersErrorType["CallExecption"] = "CALL_EXCEPTION";
|
|
33
33
|
EthersErrorType["ActionRejected"] = "ACTION_REJECTED";
|
|
34
|
+
EthersErrorType["CallExecption"] = "CALL_EXCEPTION";
|
|
35
|
+
EthersErrorType["InsufficientFunds"] = "INSUFFICIENT_FUNDS";
|
|
34
36
|
})(EthersErrorType || (EthersErrorType = {}));
|
|
35
37
|
export var EthersErrorMessage;
|
|
36
38
|
(function (EthersErrorMessage) {
|
package/dist/utils/parseError.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { errorCodes as MetaMaskErrorCodes, getMessageFromCode, } from 'eth-rpc-errors';
|
|
2
|
+
import { fetchTxErrorDetails } from '../helpers';
|
|
2
3
|
import ChainsService from '../services/ChainsService';
|
|
3
|
-
import { ErrorMessage,
|
|
4
|
+
import { ErrorMessage, EthersErrorMessage, EthersErrorType, LifiError, LifiErrorCode, MetaMaskProviderErrorCode, NotFoundError, ProviderError, RPCError, ServerError, SlippageError, TransactionError, UnknownError, ValidationError, } from './errors';
|
|
4
5
|
import { formatTokenAmountOnly } from './utils';
|
|
5
|
-
import { fetchTxErrorDetails } from '../helpers';
|
|
6
6
|
/**
|
|
7
7
|
* Available MetaMask error codes:
|
|
8
8
|
*
|
|
@@ -107,6 +107,8 @@ export const parseError = async (e, step, process) => {
|
|
|
107
107
|
catch (error) {
|
|
108
108
|
return new ProviderError(LifiErrorCode.TransactionFailed, e.reason, defaultErrorMessage, e.stack);
|
|
109
109
|
}
|
|
110
|
+
case EthersErrorType.InsufficientFunds:
|
|
111
|
+
return new TransactionError(LifiErrorCode.InsufficientFunds, e.message, await getTransactionNotSentMessage(step, process), e.stack);
|
|
110
112
|
case EthersErrorType.ActionRejected:
|
|
111
113
|
case MetaMaskProviderErrorCode.userRejectedRequest:
|
|
112
114
|
return new TransactionError(LifiErrorCode.TransactionRejected, e.message, await getTransactionNotSentMessage(step, process), e.stack);
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const name = "@lifi/sdk";
|
|
2
|
-
export declare const version = "2.0.0-beta.
|
|
2
|
+
export declare const version = "2.0.0-beta.13";
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = '@lifi/sdk';
|
|
2
|
-
export const version = '2.0.0-beta.
|
|
2
|
+
export const version = '2.0.0-beta.13';
|