@lifi/sdk 3.0.1 → 3.1.0-beta.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/package.json +4 -4
- package/src/_cjs/constants.js +2 -1
- package/src/_cjs/constants.js.map +1 -1
- package/src/_cjs/core/EVM/EVMStepExecutor.js +16 -15
- package/src/_cjs/core/EVM/EVMStepExecutor.js.map +1 -1
- package/src/_cjs/core/EVM/checkAllowance.js +3 -4
- package/src/_cjs/core/EVM/checkAllowance.js.map +1 -1
- package/src/_cjs/core/EVM/multisig.js +4 -3
- package/src/_cjs/core/EVM/multisig.js.map +1 -1
- package/src/_cjs/core/EVM/parseEVMErrors.js +38 -0
- package/src/_cjs/core/EVM/parseEVMErrors.js.map +1 -0
- package/src/_cjs/core/EVM/publicClient.js +8 -3
- package/src/_cjs/core/EVM/publicClient.js.map +1 -1
- package/src/_cjs/core/EVM/switchChain.js +4 -3
- package/src/_cjs/core/EVM/switchChain.js.map +1 -1
- package/src/_cjs/core/Solana/SolanaStepExecutor.js +54 -32
- package/src/_cjs/core/Solana/SolanaStepExecutor.js.map +1 -1
- package/src/_cjs/core/Solana/connection.js.map +1 -1
- package/src/_cjs/core/Solana/getSolanaBalance.js +1 -2
- package/src/_cjs/core/Solana/getSolanaBalance.js.map +1 -1
- package/src/_cjs/core/Solana/parseSolanaErrors.js +33 -0
- package/src/_cjs/core/Solana/parseSolanaErrors.js.map +1 -0
- package/src/_cjs/core/StatusManager.js +3 -3
- package/src/_cjs/core/StatusManager.js.map +1 -1
- package/src/_cjs/core/checkBalance.js +4 -5
- package/src/_cjs/core/checkBalance.js.map +1 -1
- package/src/_cjs/core/processMessages.js +61 -0
- package/src/_cjs/core/processMessages.js.map +1 -0
- package/src/_cjs/core/stepComparison.js +3 -3
- package/src/_cjs/core/stepComparison.js.map +1 -1
- package/src/_cjs/core/utils.js +6 -58
- package/src/_cjs/core/utils.js.map +1 -1
- package/src/_cjs/core/waitForReceivingTransaction.js +3 -3
- package/src/_cjs/core/waitForReceivingTransaction.js.map +1 -1
- package/src/_cjs/errors/SDKError.js +48 -0
- package/src/_cjs/errors/SDKError.js.map +1 -0
- package/src/_cjs/errors/baseError.js +30 -0
- package/src/_cjs/errors/baseError.js.map +1 -0
- package/src/_cjs/errors/constants.js +48 -0
- package/src/_cjs/errors/constants.js.map +1 -0
- package/src/_cjs/errors/errors.js +48 -0
- package/src/_cjs/errors/errors.js.map +1 -0
- package/src/_cjs/errors/httpError.js +101 -0
- package/src/_cjs/errors/httpError.js.map +1 -0
- package/src/_cjs/errors/index.js +11 -0
- package/src/_cjs/errors/index.js.map +1 -0
- package/src/_cjs/errors/utils/baseErrorRootCause.js +21 -0
- package/src/_cjs/errors/utils/baseErrorRootCause.js.map +1 -0
- package/src/_cjs/errors/utils/rootCause.js +12 -0
- package/src/_cjs/errors/utils/rootCause.js.map +1 -0
- package/src/_cjs/helpers.js +13 -8
- package/src/_cjs/helpers.js.map +1 -1
- package/src/_cjs/index.js +2 -4
- package/src/_cjs/index.js.map +1 -1
- package/src/_cjs/request.js +37 -34
- package/src/_cjs/request.js.map +1 -1
- package/src/_cjs/services/api.js +61 -132
- package/src/_cjs/services/api.js.map +1 -1
- package/src/_cjs/services/balance.js +1 -1
- package/src/_cjs/services/balance.js.map +1 -1
- package/src/_cjs/types/request.js +3 -0
- package/src/_cjs/types/request.js.map +1 -0
- package/src/_cjs/utils/errors.js +0 -182
- package/src/_cjs/utils/errors.js.map +1 -1
- package/src/_cjs/utils/index.js +1 -2
- package/src/_cjs/utils/index.js.map +1 -1
- package/src/_cjs/version.js +1 -1
- package/src/_cjs/version.js.map +1 -1
- package/src/_esm/constants.js +1 -0
- package/src/_esm/constants.js.map +1 -1
- package/src/_esm/core/EVM/EVMStepExecutor.js +9 -8
- package/src/_esm/core/EVM/EVMStepExecutor.js.map +1 -1
- package/src/_esm/core/EVM/checkAllowance.js +3 -4
- package/src/_esm/core/EVM/checkAllowance.js.map +1 -1
- package/src/_esm/core/EVM/multisig.js +2 -1
- package/src/_esm/core/EVM/multisig.js.map +1 -1
- package/src/_esm/core/EVM/parseEVMErrors.js +35 -0
- package/src/_esm/core/EVM/parseEVMErrors.js.map +1 -0
- package/src/_esm/core/EVM/publicClient.js +9 -4
- package/src/_esm/core/EVM/publicClient.js.map +1 -1
- package/src/_esm/core/EVM/switchChain.js +2 -1
- package/src/_esm/core/EVM/switchChain.js.map +1 -1
- package/src/_esm/core/Solana/SolanaStepExecutor.js +67 -36
- package/src/_esm/core/Solana/SolanaStepExecutor.js.map +1 -1
- package/src/_esm/core/Solana/connection.js +2 -3
- package/src/_esm/core/Solana/connection.js.map +1 -1
- package/src/_esm/core/Solana/getSolanaBalance.js +2 -3
- package/src/_esm/core/Solana/getSolanaBalance.js.map +1 -1
- package/src/_esm/core/Solana/parseSolanaErrors.js +29 -0
- package/src/_esm/core/Solana/parseSolanaErrors.js.map +1 -0
- package/src/_esm/core/StatusManager.js +1 -1
- package/src/_esm/core/StatusManager.js.map +1 -1
- package/src/_esm/core/checkBalance.js +4 -5
- package/src/_esm/core/checkBalance.js.map +1 -1
- package/src/_esm/core/processMessages.js +58 -0
- package/src/_esm/core/processMessages.js.map +1 -0
- package/src/_esm/core/stepComparison.js +3 -3
- package/src/_esm/core/stepComparison.js.map +1 -1
- package/src/_esm/core/utils.js +7 -58
- package/src/_esm/core/utils.js.map +1 -1
- package/src/_esm/core/waitForReceivingTransaction.js +2 -2
- package/src/_esm/core/waitForReceivingTransaction.js.map +1 -1
- package/src/_esm/errors/SDKError.js +47 -0
- package/src/_esm/errors/SDKError.js.map +1 -0
- package/src/_esm/errors/baseError.js +28 -0
- package/src/_esm/errors/baseError.js.map +1 -0
- package/src/_esm/errors/constants.js +45 -0
- package/src/_esm/errors/constants.js.map +1 -0
- package/src/_esm/errors/errors.js +38 -0
- package/src/_esm/errors/errors.js.map +1 -0
- package/src/_esm/errors/httpError.js +97 -0
- package/src/_esm/errors/httpError.js.map +1 -0
- package/src/_esm/errors/index.js +8 -0
- package/src/_esm/errors/index.js.map +1 -0
- package/src/_esm/errors/utils/baseErrorRootCause.js +16 -0
- package/src/_esm/errors/utils/baseErrorRootCause.js.map +1 -0
- package/src/_esm/errors/utils/rootCause.js +8 -0
- package/src/_esm/errors/utils/rootCause.js.map +1 -0
- package/src/_esm/helpers.js +16 -9
- package/src/_esm/helpers.js.map +1 -1
- package/src/_esm/index.js +2 -2
- package/src/_esm/index.js.map +1 -1
- package/src/_esm/request.js +38 -35
- package/src/_esm/request.js.map +1 -1
- package/src/_esm/services/api.js +61 -133
- package/src/_esm/services/api.js.map +1 -1
- package/src/_esm/services/balance.js +4 -4
- package/src/_esm/services/balance.js.map +1 -1
- package/src/_esm/types/request.js +2 -0
- package/src/_esm/types/request.js.map +1 -0
- package/src/_esm/utils/errors.js +1 -172
- package/src/_esm/utils/errors.js.map +1 -1
- package/src/_esm/utils/index.js +1 -2
- package/src/_esm/utils/index.js.map +1 -1
- package/src/_esm/version.js +1 -1
- package/src/_esm/version.js.map +1 -1
- package/src/_types/constants.d.ts +1 -0
- package/src/_types/constants.d.ts.map +1 -1
- package/src/_types/core/EVM/EVMStepExecutor.d.ts.map +1 -1
- package/src/_types/core/EVM/checkAllowance.d.ts.map +1 -1
- package/src/_types/core/EVM/multisig.d.ts.map +1 -1
- package/src/_types/core/EVM/parseEVMErrors.d.ts +4 -0
- package/src/_types/core/EVM/parseEVMErrors.d.ts.map +1 -0
- package/src/_types/core/EVM/publicClient.d.ts.map +1 -1
- package/src/_types/core/EVM/switchChain.d.ts.map +1 -1
- package/src/_types/core/Solana/SolanaStepExecutor.d.ts.map +1 -1
- package/src/_types/core/Solana/connection.d.ts +2 -3
- package/src/_types/core/Solana/connection.d.ts.map +1 -1
- package/src/_types/core/Solana/parseSolanaErrors.d.ts +4 -0
- package/src/_types/core/Solana/parseSolanaErrors.d.ts.map +1 -0
- package/src/_types/core/StatusManager.d.ts.map +1 -1
- package/src/_types/core/checkBalance.d.ts.map +1 -1
- package/src/_types/core/processMessages.d.ts +4 -0
- package/src/_types/core/processMessages.d.ts.map +1 -0
- package/src/_types/core/stepComparison.d.ts.map +1 -1
- package/src/_types/core/utils.d.ts +4 -5
- package/src/_types/core/utils.d.ts.map +1 -1
- package/src/_types/errors/SDKError.d.ts +12 -0
- package/src/_types/errors/SDKError.d.ts.map +1 -0
- package/src/_types/errors/baseError.d.ts +7 -0
- package/src/_types/errors/baseError.d.ts.map +1 -0
- package/src/_types/errors/constants.d.ts +43 -0
- package/src/_types/errors/constants.d.ts.map +1 -0
- package/src/_types/errors/errors.d.ts +24 -0
- package/src/_types/errors/errors.d.ts.map +1 -0
- package/src/_types/errors/httpError.d.ts +21 -0
- package/src/_types/errors/httpError.d.ts.map +1 -0
- package/src/_types/errors/index.d.ts +8 -0
- package/src/_types/errors/index.d.ts.map +1 -0
- package/src/_types/errors/utils/baseErrorRootCause.d.ts +4 -0
- package/src/_types/errors/utils/baseErrorRootCause.d.ts.map +1 -0
- package/src/_types/errors/utils/rootCause.d.ts +2 -0
- package/src/_types/errors/utils/rootCause.d.ts.map +1 -0
- package/src/_types/helpers.d.ts +5 -4
- package/src/_types/helpers.d.ts.map +1 -1
- package/src/_types/index.d.ts +2 -2
- package/src/_types/index.d.ts.map +1 -1
- package/src/_types/request.d.ts +1 -5
- package/src/_types/request.d.ts.map +1 -1
- package/src/_types/services/api.d.ts.map +1 -1
- package/src/_types/services/balance.d.ts +3 -3
- package/src/_types/types/request.d.ts +4 -0
- package/src/_types/types/request.d.ts.map +1 -0
- package/src/_types/utils/errors.d.ts +0 -108
- package/src/_types/utils/errors.d.ts.map +1 -1
- package/src/_types/utils/index.d.ts +1 -2
- package/src/_types/utils/index.d.ts.map +1 -1
- package/src/_types/version.d.ts +1 -1
- package/src/_types/version.d.ts.map +1 -1
- package/src/constants.ts +1 -0
- package/src/core/EVM/EVMStepExecutor.ts +15 -13
- package/src/core/EVM/checkAllowance.ts +3 -4
- package/src/core/EVM/multisig.ts +2 -1
- package/src/core/EVM/parseEVMErrors.ts +60 -0
- package/src/core/EVM/publicClient.ts +9 -4
- package/src/core/EVM/switchChain.ts +2 -1
- package/src/core/Solana/SolanaStepExecutor.ts +92 -52
- package/src/core/Solana/connection.ts +2 -3
- package/src/core/Solana/getSolanaBalance.ts +2 -3
- package/src/core/Solana/parseSolanaErrors.ts +45 -0
- package/src/core/StatusManager.ts +1 -1
- package/src/core/checkBalance.ts +4 -5
- package/src/core/processMessages.ts +81 -0
- package/src/core/stepComparison.ts +3 -4
- package/src/core/utils.ts +9 -84
- package/src/core/waitForReceivingTransaction.ts +2 -2
- package/src/errors/SDKError.ts +25 -0
- package/src/errors/baseError.ts +22 -0
- package/src/errors/constants.ts +45 -0
- package/src/errors/errors.ts +44 -0
- package/src/errors/httpError.ts +93 -0
- package/src/errors/index.ts +7 -0
- package/src/errors/utils/baseErrorRootCause.ts +18 -0
- package/src/errors/utils/rootCause.ts +7 -0
- package/src/helpers.ts +23 -16
- package/src/index.ts +2 -2
- package/src/request.ts +52 -38
- package/src/services/api.ts +109 -157
- package/src/services/balance.ts +4 -4
- package/src/types/request.ts +3 -0
- package/src/utils/errors.ts +0 -232
- package/src/utils/index.ts +1 -2
- package/src/version.ts +1 -1
- package/src/_cjs/utils/parseBackendError.js +0 -27
- package/src/_cjs/utils/parseBackendError.js.map +0 -1
- package/src/_cjs/utils/parseError.js +0 -69
- package/src/_cjs/utils/parseError.js.map +0 -1
- package/src/_esm/utils/parseBackendError.js +0 -24
- package/src/_esm/utils/parseBackendError.js.map +0 -1
- package/src/_esm/utils/parseError.js +0 -100
- package/src/_esm/utils/parseError.js.map +0 -1
- package/src/_types/utils/parseBackendError.d.ts +0 -3
- package/src/_types/utils/parseBackendError.d.ts.map +0 -1
- package/src/_types/utils/parseError.d.ts +0 -35
- package/src/_types/utils/parseError.d.ts.map +0 -1
- package/src/utils/parseBackendError.ts +0 -50
- package/src/utils/parseError.ts +0 -210
|
@@ -4,7 +4,7 @@ import type { Token, TokenAmount } from '@lifi/types';
|
|
|
4
4
|
* @param walletAddress - A wallet address.
|
|
5
5
|
* @param token - A Token object.
|
|
6
6
|
* @returns An object containing the token and the amounts on different chains.
|
|
7
|
-
* @throws {
|
|
7
|
+
* @throws {BaseError} Throws a ValidationError if parameters are invalid.
|
|
8
8
|
*/
|
|
9
9
|
export declare const getTokenBalance: (walletAddress: string, token: Token) => Promise<TokenAmount | null>;
|
|
10
10
|
/**
|
|
@@ -12,7 +12,7 @@ export declare const getTokenBalance: (walletAddress: string, token: Token) => P
|
|
|
12
12
|
* @param walletAddress - A wallet address.
|
|
13
13
|
* @param tokens - A list of Token objects.
|
|
14
14
|
* @returns A list of objects containing the tokens and the amounts on different chains.
|
|
15
|
-
* @throws {
|
|
15
|
+
* @throws {BaseError} Throws a ValidationError if parameters are invalid.
|
|
16
16
|
*/
|
|
17
17
|
export declare const getTokenBalances: (walletAddress: string, tokens: Token[]) => Promise<TokenAmount[]>;
|
|
18
18
|
/**
|
|
@@ -20,7 +20,7 @@ export declare const getTokenBalances: (walletAddress: string, tokens: Token[])
|
|
|
20
20
|
* @param walletAddress - A walletaddress.
|
|
21
21
|
* @param tokensByChain - A list of Token objects organized by chain ids.
|
|
22
22
|
* @returns A list of objects containing the tokens and the amounts on different chains organized by the chosen chains.
|
|
23
|
-
* @throws {
|
|
23
|
+
* @throws {BaseError} Throws a ValidationError if parameters are invalid.
|
|
24
24
|
*/
|
|
25
25
|
export declare const getTokenBalancesByChain: (walletAddress: string, tokensByChain: {
|
|
26
26
|
[chainId: number]: Token[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../types/request.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAoB,SAAQ,WAAW;IACtD,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB"}
|
|
@@ -1,109 +1 @@
|
|
|
1
|
-
declare enum ErrorType {
|
|
2
|
-
RPCError = "RPCError",
|
|
3
|
-
ProviderError = "ProviderError",
|
|
4
|
-
ServerError = "ServerError",
|
|
5
|
-
TransactionError = "TransactionError",
|
|
6
|
-
ValidationError = "ValidationError",
|
|
7
|
-
NotFoundError = "NotFoundError",
|
|
8
|
-
UnknownError = "UnknownError",
|
|
9
|
-
SlippageError = "SlippageError"
|
|
10
|
-
}
|
|
11
|
-
export declare enum LiFiErrorCode {
|
|
12
|
-
InternalError = 1000,
|
|
13
|
-
ValidationError = 1001,
|
|
14
|
-
TransactionUnderpriced = 1002,
|
|
15
|
-
TransactionFailed = 1003,
|
|
16
|
-
Timeout = 1004,
|
|
17
|
-
ProviderUnavailable = 1005,
|
|
18
|
-
NotFound = 1006,
|
|
19
|
-
ChainSwitchError = 1007,
|
|
20
|
-
TransactionUnprepared = 1008,
|
|
21
|
-
GasLimitError = 1009,
|
|
22
|
-
TransactionCanceled = 1010,
|
|
23
|
-
SlippageError = 1011,
|
|
24
|
-
SignatureRejected = 1012,
|
|
25
|
-
BalanceError = 1013,
|
|
26
|
-
AllowanceRequired = 1014,
|
|
27
|
-
InsufficientFunds = 1015,
|
|
28
|
-
ExchangeRateUpdateCanceled = 1016,
|
|
29
|
-
WalletChangedDuringExecution = 1017
|
|
30
|
-
}
|
|
31
|
-
export declare enum EthersErrorType {
|
|
32
|
-
ActionRejected = "ACTION_REJECTED",
|
|
33
|
-
CallExecption = "CALL_EXCEPTION",
|
|
34
|
-
InsufficientFunds = "INSUFFICIENT_FUNDS"
|
|
35
|
-
}
|
|
36
|
-
export declare enum EthersErrorMessage {
|
|
37
|
-
ERC20Allowance = "ERC20: transfer amount exceeds allowance",
|
|
38
|
-
LowGas = "intrinsic gas too low",
|
|
39
|
-
OutOfGas = "out of gas",
|
|
40
|
-
Underpriced = "underpriced",
|
|
41
|
-
LowReplacementFee = "replacement fee too low"
|
|
42
|
-
}
|
|
43
|
-
export declare enum ErrorMessage {
|
|
44
|
-
UnknownError = "Unknown error occurred.",
|
|
45
|
-
SlippageError = "The slippage is larger than the defined threshold. Please request a new route to get a fresh quote.",
|
|
46
|
-
GasLimitLow = "Gas limit is too low.",
|
|
47
|
-
TransactionUnderpriced = "Transaction is underpriced.",
|
|
48
|
-
Default = "Something went wrong."
|
|
49
|
-
}
|
|
50
|
-
export declare enum MetaMaskRPCErrorCode {
|
|
51
|
-
invalidInput = -32000,
|
|
52
|
-
resourceNotFound = -32001,
|
|
53
|
-
resourceUnavailable = -32002,
|
|
54
|
-
transactionRejected = -32003,
|
|
55
|
-
methodNotSupported = -32004,
|
|
56
|
-
limitExceeded = -32005,
|
|
57
|
-
parse = -32700,
|
|
58
|
-
invalidRequest = -32600,
|
|
59
|
-
methodNotFound = -32601,
|
|
60
|
-
invalidParams = -32602,
|
|
61
|
-
internal = -32603
|
|
62
|
-
}
|
|
63
|
-
export declare enum MetaMaskProviderErrorCode {
|
|
64
|
-
userRejectedRequest = 4001,
|
|
65
|
-
unauthorized = 4100,
|
|
66
|
-
unsupportedMethod = 4200,
|
|
67
|
-
disconnected = 4900,
|
|
68
|
-
chainDisconnected = 4901
|
|
69
|
-
}
|
|
70
|
-
export type ErrorCode = LiFiErrorCode | MetaMaskRPCErrorCode | MetaMaskProviderErrorCode;
|
|
71
|
-
export declare class LiFiError extends Error {
|
|
72
|
-
code: ErrorCode;
|
|
73
|
-
htmlMessage?: string;
|
|
74
|
-
constructor(type: ErrorType, code: number, message: string, htmlMessage?: string, stack?: string);
|
|
75
|
-
}
|
|
76
|
-
export declare class RPCError extends LiFiError {
|
|
77
|
-
constructor(code: ErrorCode, message: string, htmlMessage?: string, stack?: string);
|
|
78
|
-
}
|
|
79
|
-
export declare class ProviderError extends LiFiError {
|
|
80
|
-
constructor(code: ErrorCode, message: string, htmlMessage?: string, stack?: string);
|
|
81
|
-
}
|
|
82
|
-
export declare class ServerError extends LiFiError {
|
|
83
|
-
constructor(message: string, htmlMessage?: string, stack?: string);
|
|
84
|
-
}
|
|
85
|
-
export declare class ValidationError extends LiFiError {
|
|
86
|
-
constructor(message: string, htmlMessage?: string, stack?: string);
|
|
87
|
-
}
|
|
88
|
-
export declare class TransactionError extends LiFiError {
|
|
89
|
-
constructor(code: ErrorCode, message: string, htmlMessage?: string, stack?: string);
|
|
90
|
-
}
|
|
91
|
-
export declare class SlippageError extends LiFiError {
|
|
92
|
-
constructor(message: string, htmlMessage?: string, stack?: string);
|
|
93
|
-
}
|
|
94
|
-
export declare class BalanceError extends LiFiError {
|
|
95
|
-
constructor(message: string, htmlMessage?: string, stack?: string);
|
|
96
|
-
}
|
|
97
|
-
export declare class NotFoundError extends LiFiError {
|
|
98
|
-
constructor(message: string, htmlMessage?: string, stack?: string);
|
|
99
|
-
}
|
|
100
|
-
export declare class UnknownError extends LiFiError {
|
|
101
|
-
constructor(code: ErrorCode, message: string, htmlMessage?: string, stack?: string);
|
|
102
|
-
}
|
|
103
|
-
export declare class HTTPError extends Error {
|
|
104
|
-
response: Response;
|
|
105
|
-
status: number;
|
|
106
|
-
constructor(response: Response);
|
|
107
|
-
}
|
|
108
|
-
export {};
|
|
109
1
|
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../utils/errors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../utils/errors.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA"}
|
package/src/_types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,cAAc,CAAA;AAC/B,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,cAAc,CAAA;AAC/B,eAAO,MAAM,OAAO,iBAAiB,CAAA"}
|
package/src/constants.ts
CHANGED
|
@@ -2,3 +2,4 @@ export const AddressZero = '0x0000000000000000000000000000000000000000'
|
|
|
2
2
|
export const AlternativeAddressZero =
|
|
3
3
|
'0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'
|
|
4
4
|
export const wrappedSolAddress = 'So11111111111111111111111111111111111111112'
|
|
5
|
+
export const SolSystemProgram = '11111111111111111111111111111111'
|
|
@@ -13,22 +13,21 @@ import { publicActions } from 'viem'
|
|
|
13
13
|
import { config } from '../../config.js'
|
|
14
14
|
import { getStepTransaction } from '../../services/api.js'
|
|
15
15
|
import {
|
|
16
|
-
LiFiErrorCode,
|
|
17
|
-
TransactionError,
|
|
18
|
-
ValidationError,
|
|
19
16
|
getTransactionFailedMessage,
|
|
20
17
|
isZeroAddress,
|
|
21
|
-
parseError,
|
|
22
18
|
} from '../../utils/index.js'
|
|
19
|
+
import { ValidationError, TransactionError } from '../../errors/errors.js'
|
|
20
|
+
import { LiFiErrorCode } from '../../errors/constants.js'
|
|
21
|
+
import { parseEVMErrors } from './parseEVMErrors.js'
|
|
23
22
|
import { BaseStepExecutor } from '../BaseStepExecutor.js'
|
|
24
23
|
import { checkBalance } from '../checkBalance.js'
|
|
24
|
+
import { getSubstatusMessage } from '../processMessages.js'
|
|
25
25
|
import { stepComparison } from '../stepComparison.js'
|
|
26
26
|
import type {
|
|
27
27
|
LiFiStepExtended,
|
|
28
28
|
StepExecutorOptions,
|
|
29
29
|
TransactionParameters,
|
|
30
30
|
} from '../types.js'
|
|
31
|
-
import { getSubstatusMessage } from '../utils.js'
|
|
32
31
|
import { waitForReceivingTransaction } from '../waitForReceivingTransaction.js'
|
|
33
32
|
import { checkAllowance } from './checkAllowance.js'
|
|
34
33
|
import { updateMultisigRouteProcess } from './multisig.js'
|
|
@@ -87,9 +86,13 @@ export class EVMStepExecutor extends BaseStepExecutor {
|
|
|
87
86
|
},
|
|
88
87
|
})
|
|
89
88
|
this.statusManager.updateExecution(step, 'FAILED')
|
|
90
|
-
throw
|
|
91
|
-
|
|
92
|
-
|
|
89
|
+
throw await parseEVMErrors(
|
|
90
|
+
new TransactionError(
|
|
91
|
+
LiFiErrorCode.WalletChangedDuringExecution,
|
|
92
|
+
errorMessage
|
|
93
|
+
),
|
|
94
|
+
step,
|
|
95
|
+
process
|
|
93
96
|
)
|
|
94
97
|
}
|
|
95
98
|
return updatedWalletClient
|
|
@@ -397,20 +400,20 @@ export class EVMStepExecutor extends BaseStepExecutor {
|
|
|
397
400
|
process = this.statusManager.updateProcess(step, process.type, 'DONE')
|
|
398
401
|
}
|
|
399
402
|
} catch (e: any) {
|
|
400
|
-
const error = await
|
|
403
|
+
const error = await parseEVMErrors(e, step, process)
|
|
401
404
|
process = this.statusManager.updateProcess(
|
|
402
405
|
step,
|
|
403
406
|
process.type,
|
|
404
407
|
'FAILED',
|
|
405
408
|
{
|
|
406
409
|
error: {
|
|
407
|
-
message: error.message,
|
|
408
|
-
htmlMessage: error.htmlMessage,
|
|
410
|
+
message: error.cause.message,
|
|
409
411
|
code: error.code,
|
|
410
412
|
},
|
|
411
413
|
}
|
|
412
414
|
)
|
|
413
415
|
this.statusManager.updateExecution(step, 'FAILED')
|
|
416
|
+
|
|
414
417
|
throw error
|
|
415
418
|
}
|
|
416
419
|
}
|
|
@@ -479,8 +482,7 @@ export class EVMStepExecutor extends BaseStepExecutor {
|
|
|
479
482
|
},
|
|
480
483
|
})
|
|
481
484
|
this.statusManager.updateExecution(step, 'FAILED')
|
|
482
|
-
|
|
483
|
-
throw e
|
|
485
|
+
throw await parseEVMErrors(e as Error, step, process)
|
|
484
486
|
}
|
|
485
487
|
|
|
486
488
|
// DONE
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Chain, LiFiStep, Process, ProcessType } from '@lifi/types'
|
|
2
2
|
import type { Address, Hash, WalletClient } from 'viem'
|
|
3
3
|
import { maxUint256 } from 'viem'
|
|
4
|
-
import {
|
|
4
|
+
import { parseEVMErrors } from './parseEVMErrors.js'
|
|
5
5
|
import type { StatusManager } from '../StatusManager.js'
|
|
6
6
|
import type { ExecutionOptions } from '../types.js'
|
|
7
7
|
import { getAllowance } from './getAllowance.js'
|
|
@@ -100,15 +100,14 @@ export const checkAllowance = async (
|
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
} catch (e: any) {
|
|
103
|
-
const error = await
|
|
103
|
+
const error = await parseEVMErrors(e, step, allowanceProcess)
|
|
104
104
|
allowanceProcess = statusManager.updateProcess(
|
|
105
105
|
step,
|
|
106
106
|
allowanceProcess.type,
|
|
107
107
|
'FAILED',
|
|
108
108
|
{
|
|
109
109
|
error: {
|
|
110
|
-
message: error.message,
|
|
111
|
-
htmlMessage: error.htmlMessage,
|
|
110
|
+
message: error.cause.message,
|
|
112
111
|
code: error.code,
|
|
113
112
|
},
|
|
114
113
|
}
|
package/src/core/EVM/multisig.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ExtendedChain, LiFiStep, ProcessType } from '@lifi/types'
|
|
2
2
|
import type { Hash } from 'viem'
|
|
3
|
-
import { LiFiErrorCode
|
|
3
|
+
import { LiFiErrorCode } from '../../errors/constants.js'
|
|
4
|
+
import { TransactionError } from '../../errors/errors.js'
|
|
4
5
|
import type { StatusManager } from '../StatusManager.js'
|
|
5
6
|
import type { MultisigConfig, MultisigTxDetails } from './types.js'
|
|
6
7
|
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { type LiFiStep, type Process } from '@lifi/types'
|
|
2
|
+
import { TransactionError, UnknownError } from '../../errors/errors.js'
|
|
3
|
+
import { SDKError } from '../../errors/SDKError.js'
|
|
4
|
+
import { ErrorMessage, LiFiErrorCode } from '../../errors/constants.js'
|
|
5
|
+
import { BaseError } from '../../utils/index.js'
|
|
6
|
+
import { fetchTxErrorDetails } from '../../helpers.js'
|
|
7
|
+
|
|
8
|
+
export const parseEVMErrors = async (
|
|
9
|
+
e: Error,
|
|
10
|
+
step?: LiFiStep,
|
|
11
|
+
process?: Process
|
|
12
|
+
): Promise<SDKError> => {
|
|
13
|
+
if (e instanceof SDKError) {
|
|
14
|
+
e.step = e.step ?? step
|
|
15
|
+
e.process = e.process ?? process
|
|
16
|
+
return e
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const baseError = await handleSpecificErrors(e, step, process)
|
|
20
|
+
|
|
21
|
+
return new SDKError(baseError, step, process)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const handleSpecificErrors = async (
|
|
25
|
+
e: any,
|
|
26
|
+
step?: LiFiStep,
|
|
27
|
+
process?: Process
|
|
28
|
+
) => {
|
|
29
|
+
if (e.cause?.name === 'UserRejectedRequestError') {
|
|
30
|
+
return new TransactionError(LiFiErrorCode.SignatureRejected, e.message, e)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (
|
|
34
|
+
step &&
|
|
35
|
+
process?.txHash &&
|
|
36
|
+
e.code === LiFiErrorCode.TransactionFailed &&
|
|
37
|
+
e.message === ErrorMessage.TransactionReverted
|
|
38
|
+
) {
|
|
39
|
+
const response = await fetchTxErrorDetails(
|
|
40
|
+
process.txHash,
|
|
41
|
+
step.action.fromChainId
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
const errorMessage = response?.error_message
|
|
45
|
+
|
|
46
|
+
if (errorMessage?.toLowerCase().includes('out of gas')) {
|
|
47
|
+
return new TransactionError(
|
|
48
|
+
LiFiErrorCode.GasLimitError,
|
|
49
|
+
ErrorMessage.GasLimitLow,
|
|
50
|
+
e
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (e instanceof BaseError) {
|
|
56
|
+
return e
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return new UnknownError(e.message || ErrorMessage.UnknownError, e)
|
|
60
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChainId } from '@lifi/types'
|
|
2
2
|
import type { PublicClient } from 'viem'
|
|
3
|
-
import { createPublicClient, fallback, http } from 'viem'
|
|
3
|
+
import { createPublicClient, fallback, http, webSocket } from 'viem'
|
|
4
4
|
import { mainnet, type Chain } from 'viem/chains'
|
|
5
5
|
import { config } from '../../config.js'
|
|
6
6
|
import { getRpcUrls } from '../rpc.js'
|
|
@@ -19,9 +19,11 @@ export const getPublicClient = async (
|
|
|
19
19
|
if (!publicClients[chainId]) {
|
|
20
20
|
const urls = await getRpcUrls(chainId)
|
|
21
21
|
const fallbackTransports = urls.map((url) =>
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
url.startsWith('wss')
|
|
23
|
+
? webSocket(url)
|
|
24
|
+
: http(url, {
|
|
25
|
+
batch: true,
|
|
26
|
+
})
|
|
25
27
|
)
|
|
26
28
|
const _chain = await config.getChainById(chainId)
|
|
27
29
|
const chain: Chain = {
|
|
@@ -43,6 +45,9 @@ export const getPublicClient = async (
|
|
|
43
45
|
publicClients[chainId] = createPublicClient({
|
|
44
46
|
chain: chain,
|
|
45
47
|
transport: fallback(fallbackTransports),
|
|
48
|
+
batch: {
|
|
49
|
+
multicall: true,
|
|
50
|
+
},
|
|
46
51
|
})
|
|
47
52
|
}
|
|
48
53
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { WalletClient } from 'viem'
|
|
2
|
-
import { LiFiErrorCode
|
|
2
|
+
import { LiFiErrorCode } from '../../errors/constants.js'
|
|
3
|
+
import { ProviderError } from '../../errors/errors.js'
|
|
3
4
|
import type { StatusManager } from '../StatusManager.js'
|
|
4
5
|
import type { LiFiStepExtended, SwitchChainHook } from '../types.js'
|
|
5
6
|
|
|
@@ -1,39 +1,36 @@
|
|
|
1
1
|
import type { ExtendedTransactionInfo, FullStatusData } from '@lifi/types'
|
|
2
2
|
import { type SignerWalletAdapter } from '@solana/wallet-adapter-base'
|
|
3
3
|
import {
|
|
4
|
+
TransactionExpiredBlockheightExceededError,
|
|
4
5
|
VersionedTransaction,
|
|
5
6
|
type SendOptions,
|
|
6
7
|
type SignatureResult,
|
|
7
8
|
} from '@solana/web3.js'
|
|
9
|
+
import bs58 from 'bs58'
|
|
8
10
|
import { config } from '../../config.js'
|
|
11
|
+
import { LiFiErrorCode } from '../../errors/constants.js'
|
|
12
|
+
import { TransactionError } from '../../errors/errors.js'
|
|
9
13
|
import { getStepTransaction } from '../../services/api.js'
|
|
10
14
|
import { base64ToUint8Array } from '../../utils/base64ToUint8Array.js'
|
|
11
|
-
import {
|
|
12
|
-
LiFiErrorCode,
|
|
13
|
-
TransactionError,
|
|
14
|
-
getTransactionFailedMessage,
|
|
15
|
-
parseError,
|
|
16
|
-
} from '../../utils/index.js'
|
|
15
|
+
import { getTransactionFailedMessage } from '../../utils/index.js'
|
|
17
16
|
import { BaseStepExecutor } from '../BaseStepExecutor.js'
|
|
18
17
|
import { checkBalance } from '../checkBalance.js'
|
|
18
|
+
import { getSubstatusMessage } from '../processMessages.js'
|
|
19
19
|
import { stepComparison } from '../stepComparison.js'
|
|
20
20
|
import type {
|
|
21
21
|
LiFiStepExtended,
|
|
22
22
|
StepExecutorOptions,
|
|
23
23
|
TransactionParameters,
|
|
24
24
|
} from '../types.js'
|
|
25
|
-
import {
|
|
25
|
+
import { sleep } from '../utils.js'
|
|
26
26
|
import { waitForReceivingTransaction } from '../waitForReceivingTransaction.js'
|
|
27
27
|
import { getSolanaConnection } from './connection.js'
|
|
28
|
+
import { parseSolanaErrors } from './parseSolanaErrors.js'
|
|
28
29
|
|
|
29
30
|
export interface SolanaStepExecutorOptions extends StepExecutorOptions {
|
|
30
31
|
walletAdapter: SignerWalletAdapter
|
|
31
32
|
}
|
|
32
33
|
|
|
33
|
-
const TX_RETRY_INTERVAL = 500
|
|
34
|
-
// https://solana.com/docs/advanced/confirmation
|
|
35
|
-
const TIMEOUT_PERIOD = 60_000
|
|
36
|
-
|
|
37
34
|
export class SolanaStepExecutor extends BaseStepExecutor {
|
|
38
35
|
private walletAdapter: SignerWalletAdapter
|
|
39
36
|
|
|
@@ -117,6 +114,10 @@ export class SolanaStepExecutor extends BaseStepExecutor {
|
|
|
117
114
|
data: step.transactionRequest.data,
|
|
118
115
|
}
|
|
119
116
|
|
|
117
|
+
const blockhashResult = await connection.getLatestBlockhash({
|
|
118
|
+
commitment: 'confirmed',
|
|
119
|
+
})
|
|
120
|
+
|
|
120
121
|
if (this.executionOptions?.updateTransactionRequestHook) {
|
|
121
122
|
const customizedTransactionRequest: TransactionParameters =
|
|
122
123
|
await this.executionOptions.updateTransactionRequestHook({
|
|
@@ -141,18 +142,25 @@ export class SolanaStepExecutor extends BaseStepExecutor {
|
|
|
141
142
|
base64ToUint8Array(transactionRequest.data)
|
|
142
143
|
)
|
|
143
144
|
|
|
144
|
-
|
|
145
|
-
commitment: 'confirmed',
|
|
146
|
-
})
|
|
145
|
+
this.checkWalletAdapter(step)
|
|
147
146
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
blockhashResult.value.blockhash
|
|
147
|
+
const signedTxPromise =
|
|
148
|
+
this.walletAdapter.signTransaction(versionedTransaction)
|
|
151
149
|
|
|
152
|
-
|
|
150
|
+
// We give users 2 minutes to sign the transaction or it should be considered expired
|
|
151
|
+
const signedTx = await Promise.race([
|
|
152
|
+
signedTxPromise,
|
|
153
|
+
// https://solana.com/docs/advanced/confirmation#transaction-expiration
|
|
154
|
+
// Use 2 minutes to account for fluctuations
|
|
155
|
+
sleep(120_000),
|
|
156
|
+
])
|
|
153
157
|
|
|
154
|
-
|
|
155
|
-
|
|
158
|
+
if (!signedTx) {
|
|
159
|
+
throw new TransactionError(
|
|
160
|
+
LiFiErrorCode.TransactionExpired,
|
|
161
|
+
'Transaction has expired: blockhash is no longer recent enough.'
|
|
162
|
+
)
|
|
163
|
+
}
|
|
156
164
|
|
|
157
165
|
process = this.statusManager.updateProcess(
|
|
158
166
|
step,
|
|
@@ -160,63 +168,96 @@ export class SolanaStepExecutor extends BaseStepExecutor {
|
|
|
160
168
|
'PENDING'
|
|
161
169
|
)
|
|
162
170
|
|
|
163
|
-
const
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
171
|
+
const simulationResult = await connection.simulateTransaction(
|
|
172
|
+
signedTx,
|
|
173
|
+
{
|
|
174
|
+
commitment: 'processed',
|
|
175
|
+
replaceRecentBlockhash: true,
|
|
176
|
+
}
|
|
177
|
+
)
|
|
178
|
+
|
|
179
|
+
if (simulationResult.value.err) {
|
|
180
|
+
throw new TransactionError(
|
|
181
|
+
LiFiErrorCode.TransactionSimulationFailed,
|
|
182
|
+
'Transaction simulation failed'
|
|
183
|
+
)
|
|
172
184
|
}
|
|
173
185
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
186
|
+
// Create transaction hash (signature)
|
|
187
|
+
const txSignature = bs58.encode(signedTx.signatures[0])
|
|
188
|
+
|
|
189
|
+
// A known weirdness - MAX_RECENT_BLOCKHASHES is 300
|
|
190
|
+
// https://github.com/solana-labs/solana/blob/master/sdk/program/src/clock.rs#L123
|
|
191
|
+
// but MAX_PROCESSING_AGE is 150
|
|
192
|
+
// https://github.com/solana-labs/solana/blob/master/sdk/program/src/clock.rs#L129
|
|
193
|
+
// the blockhash queue in the bank tells you 300 + current slot, but it won't be accepted 150 blocks later.
|
|
194
|
+
// https://solana.com/docs/advanced/confirmation#transaction-expiration
|
|
195
|
+
const lastValidBlockHeight = blockhashResult.lastValidBlockHeight - 150
|
|
178
196
|
|
|
179
197
|
// In the following section, we wait and constantly check for the transaction to be confirmed
|
|
180
198
|
// and resend the transaction if it is not confirmed within a certain time interval
|
|
181
199
|
// thus handling tx retries on the client side rather than relying on the RPC
|
|
200
|
+
const abortController = new AbortController()
|
|
182
201
|
const confirmTransactionPromise = connection
|
|
183
202
|
.confirmTransaction(
|
|
184
203
|
{
|
|
185
204
|
signature: txSignature,
|
|
186
|
-
blockhash: blockhashResult.
|
|
187
|
-
lastValidBlockHeight:
|
|
205
|
+
blockhash: blockhashResult.blockhash,
|
|
206
|
+
lastValidBlockHeight: lastValidBlockHeight,
|
|
207
|
+
abortSignal: abortController.signal,
|
|
188
208
|
},
|
|
189
209
|
'confirmed'
|
|
190
210
|
)
|
|
191
211
|
.then((result) => result.value)
|
|
192
212
|
|
|
193
213
|
let confirmedTx: SignatureResult | null = null
|
|
194
|
-
|
|
214
|
+
let blockHeight = await connection.getBlockHeight()
|
|
215
|
+
|
|
216
|
+
const rawTransactionOptions: SendOptions = {
|
|
217
|
+
// We can skip preflight check after the first transaction has been sent
|
|
218
|
+
// https://solana.com/docs/advanced/retry#the-cost-of-skipping-preflight
|
|
219
|
+
skipPreflight: true,
|
|
220
|
+
// Setting max retries to 0 as we are handling retries manually
|
|
221
|
+
maxRetries: 0,
|
|
222
|
+
// https://solana.com/docs/advanced/confirmation#use-an-appropriate-preflight-commitment-level
|
|
223
|
+
preflightCommitment: 'confirmed',
|
|
224
|
+
}
|
|
195
225
|
|
|
196
|
-
|
|
226
|
+
const signedTxSerialized = signedTx.serialize()
|
|
227
|
+
|
|
228
|
+
// https://solana.com/docs/advanced/retry#customizing-rebroadcast-logic
|
|
229
|
+
while (!confirmedTx && blockHeight < lastValidBlockHeight) {
|
|
230
|
+
await connection.sendRawTransaction(
|
|
231
|
+
signedTxSerialized,
|
|
232
|
+
rawTransactionOptions
|
|
233
|
+
)
|
|
197
234
|
confirmedTx = await Promise.race([
|
|
198
235
|
confirmTransactionPromise,
|
|
199
|
-
|
|
200
|
-
setTimeout(() => {
|
|
201
|
-
resolve(null)
|
|
202
|
-
}, TX_RETRY_INTERVAL)
|
|
203
|
-
),
|
|
236
|
+
sleep(1000),
|
|
204
237
|
])
|
|
205
238
|
if (confirmedTx) {
|
|
206
239
|
break
|
|
207
240
|
}
|
|
208
|
-
|
|
209
|
-
await connection.sendRawTransaction(
|
|
210
|
-
signedTx.serialize(),
|
|
211
|
-
rawTransactionOptions
|
|
212
|
-
)
|
|
241
|
+
blockHeight = await connection.getBlockHeight()
|
|
213
242
|
}
|
|
214
243
|
|
|
244
|
+
// Stop waiting for tx confirmation
|
|
245
|
+
abortController.abort()
|
|
246
|
+
|
|
215
247
|
if (confirmedTx?.err) {
|
|
216
248
|
const reason =
|
|
217
249
|
typeof confirmedTx.err === 'object'
|
|
218
250
|
? JSON.stringify(confirmedTx.err)
|
|
219
251
|
: confirmedTx.err
|
|
252
|
+
if (
|
|
253
|
+
confirmedTx.err instanceof
|
|
254
|
+
TransactionExpiredBlockheightExceededError
|
|
255
|
+
) {
|
|
256
|
+
throw new TransactionError(
|
|
257
|
+
LiFiErrorCode.TransactionExpired,
|
|
258
|
+
`${reason}`
|
|
259
|
+
)
|
|
260
|
+
}
|
|
220
261
|
throw new TransactionError(
|
|
221
262
|
LiFiErrorCode.TransactionFailed,
|
|
222
263
|
`Transaction failed: ${reason}`
|
|
@@ -225,8 +266,8 @@ export class SolanaStepExecutor extends BaseStepExecutor {
|
|
|
225
266
|
|
|
226
267
|
if (!confirmedTx) {
|
|
227
268
|
throw new TransactionError(
|
|
228
|
-
LiFiErrorCode.
|
|
229
|
-
'
|
|
269
|
+
LiFiErrorCode.TransactionExpired,
|
|
270
|
+
'Transaction has expired: The block height has exceeded the maximum allowed limit.'
|
|
230
271
|
)
|
|
231
272
|
}
|
|
232
273
|
|
|
@@ -245,15 +286,14 @@ export class SolanaStepExecutor extends BaseStepExecutor {
|
|
|
245
286
|
process = this.statusManager.updateProcess(step, process.type, 'DONE')
|
|
246
287
|
}
|
|
247
288
|
} catch (e: any) {
|
|
248
|
-
const error = await
|
|
289
|
+
const error = await parseSolanaErrors(e, step, process)
|
|
249
290
|
process = this.statusManager.updateProcess(
|
|
250
291
|
step,
|
|
251
292
|
process.type,
|
|
252
293
|
'FAILED',
|
|
253
294
|
{
|
|
254
295
|
error: {
|
|
255
|
-
message: error.message,
|
|
256
|
-
htmlMessage: error.htmlMessage,
|
|
296
|
+
message: error.cause.message,
|
|
257
297
|
code: error.code,
|
|
258
298
|
},
|
|
259
299
|
}
|
|
@@ -5,9 +5,8 @@ import { getRpcUrl } from '../rpc.js'
|
|
|
5
5
|
let connection: Connection | undefined = undefined
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* getSolanaConnection is just a thin wrapper around getting the
|
|
9
|
-
*
|
|
10
|
-
* @returns - Solana rpc connection
|
|
8
|
+
* getSolanaConnection is just a thin wrapper around getting the connection (RPC provider) for Solana
|
|
9
|
+
* @returns - Solana RPC connection
|
|
11
10
|
*/
|
|
12
11
|
export const getSolanaConnection = async (): Promise<Connection> => {
|
|
13
12
|
if (!connection) {
|