@lifi/sdk 4.1.0 → 4.2.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/CHANGELOG.md +6 -0
- package/dist/cjs/actions/getChains.d.ts +7 -8
- package/dist/cjs/actions/getConnections.d.ts +6 -7
- package/dist/cjs/actions/getContractCallsQuote.d.ts +7 -8
- package/dist/cjs/actions/getGasRecommendation.d.ts +7 -8
- package/dist/cjs/actions/getNameServiceAddress.d.ts +6 -7
- package/dist/cjs/actions/getQuote.d.ts +7 -8
- package/dist/cjs/actions/getRelayedTransactionStatus.d.ts +7 -8
- package/dist/cjs/actions/getRelayerQuote.d.ts +7 -8
- package/dist/cjs/actions/getRoutes.d.ts +7 -8
- package/dist/cjs/actions/getStatus.d.ts +7 -8
- package/dist/cjs/actions/getStepTransaction.d.ts +7 -8
- package/dist/cjs/actions/getStepTransaction.js +2 -0
- package/dist/cjs/actions/getStepTransaction.js.map +1 -1
- package/dist/cjs/actions/getToken.d.ts +8 -9
- package/dist/cjs/actions/getTokenBalance.d.ts +8 -9
- package/dist/cjs/actions/getTokenBalances.d.ts +8 -9
- package/dist/cjs/actions/getTokenBalancesByChain.d.ts +8 -9
- package/dist/cjs/actions/getTokenBalancesByChain.js +4 -2
- package/dist/cjs/actions/getTokenBalancesByChain.js.map +1 -1
- package/dist/cjs/actions/getTokens.d.ts +6 -7
- package/dist/cjs/actions/getTools.d.ts +6 -7
- package/dist/cjs/actions/getTransactionHistory.d.ts +13 -19
- package/dist/cjs/actions/getWalletBalances.d.ts +7 -8
- package/dist/cjs/actions/index.d.ts +109 -110
- package/dist/cjs/actions/patchContractCalls.d.ts +0 -1
- package/dist/cjs/actions/relayTransaction.d.ts +7 -8
- package/dist/cjs/client/createClient.d.ts +0 -1
- package/dist/cjs/client/getClientStorage.d.ts +0 -1
- package/dist/cjs/core/BaseStepExecutionTask.d.ts +0 -1
- package/dist/cjs/core/BaseStepExecutor.d.ts +0 -1
- package/dist/cjs/core/StatusManager.d.ts +40 -51
- package/dist/cjs/core/TaskPipeline.d.ts +0 -1
- package/dist/cjs/core/actionMessages.d.ts +0 -1
- package/dist/cjs/core/execution.d.ts +29 -30
- package/dist/cjs/core/executionState.d.ts +0 -1
- package/dist/cjs/core/prepareRestart.d.ts +0 -1
- package/dist/cjs/core/tasks/CheckBalanceTask.d.ts +6 -7
- package/dist/cjs/core/tasks/PrepareTransactionTask.d.ts +0 -1
- package/dist/cjs/core/tasks/WaitForTransactionStatusTask.d.ts +0 -1
- package/dist/cjs/core/tasks/helpers/checkBalance.d.ts +17 -18
- package/dist/cjs/core/tasks/helpers/getTransactionRequestData.d.ts +0 -1
- package/dist/cjs/core/tasks/helpers/stepComparison.d.ts +11 -12
- package/dist/cjs/core/tasks/helpers/waitForTransactionStatus.d.ts +0 -1
- package/dist/cjs/core/utils.d.ts +7 -8
- package/dist/cjs/errors/SDKError.d.ts +0 -1
- package/dist/cjs/errors/baseError.d.ts +0 -1
- package/dist/cjs/errors/errors.d.ts +4 -5
- package/dist/cjs/errors/httpError.d.ts +0 -1
- package/dist/cjs/errors/utils/baseErrorRootCause.d.ts +0 -1
- package/dist/cjs/types/actions.d.ts +7 -7
- package/dist/cjs/types/core.d.ts +3 -4
- package/dist/cjs/types/execution.d.ts +0 -1
- package/dist/cjs/utils/checkPackageUpdates.js +1 -1
- package/dist/cjs/utils/convertQuoteToRoute.d.ts +9 -10
- package/dist/cjs/utils/formatUnits.d.ts +2 -2
- package/dist/cjs/utils/getTransactionMessage.d.ts +0 -1
- package/dist/cjs/utils/isHex.d.ts +1 -3
- package/dist/cjs/utils/isRoutesRequest.d.ts +0 -1
- package/dist/cjs/utils/isStep.d.ts +0 -1
- package/dist/cjs/utils/isToken.d.ts +0 -1
- package/dist/cjs/utils/parseUnits.d.ts +2 -2
- package/dist/cjs/utils/request.d.ts +0 -1
- package/dist/cjs/utils/waitForResult.d.ts +8 -8
- package/dist/cjs/utils/withDedupe.d.ts +5 -8
- package/dist/cjs/utils/withTimeout.d.ts +10 -16
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/actions/getChains.d.ts +7 -8
- package/dist/esm/actions/getChains.d.ts.map +1 -1
- package/dist/esm/actions/getConnections.d.ts +6 -7
- package/dist/esm/actions/getConnections.d.ts.map +1 -1
- package/dist/esm/actions/getContractCallsQuote.d.ts +7 -8
- package/dist/esm/actions/getContractCallsQuote.d.ts.map +1 -1
- package/dist/esm/actions/getGasRecommendation.d.ts +7 -8
- package/dist/esm/actions/getGasRecommendation.d.ts.map +1 -1
- package/dist/esm/actions/getNameServiceAddress.d.ts +6 -7
- package/dist/esm/actions/getNameServiceAddress.d.ts.map +1 -1
- package/dist/esm/actions/getQuote.d.ts +7 -8
- package/dist/esm/actions/getQuote.d.ts.map +1 -1
- package/dist/esm/actions/getRelayedTransactionStatus.d.ts +7 -8
- package/dist/esm/actions/getRelayedTransactionStatus.d.ts.map +1 -1
- package/dist/esm/actions/getRelayerQuote.d.ts +7 -8
- package/dist/esm/actions/getRelayerQuote.d.ts.map +1 -1
- package/dist/esm/actions/getRoutes.d.ts +7 -8
- package/dist/esm/actions/getRoutes.d.ts.map +1 -1
- package/dist/esm/actions/getStatus.d.ts +7 -8
- package/dist/esm/actions/getStatus.d.ts.map +1 -1
- package/dist/esm/actions/getStepTransaction.d.ts +7 -8
- package/dist/esm/actions/getStepTransaction.d.ts.map +1 -1
- package/dist/esm/actions/getStepTransaction.js +2 -0
- package/dist/esm/actions/getStepTransaction.js.map +1 -1
- package/dist/esm/actions/getToken.d.ts +8 -9
- package/dist/esm/actions/getToken.d.ts.map +1 -1
- package/dist/esm/actions/getTokenBalance.d.ts +8 -9
- package/dist/esm/actions/getTokenBalance.d.ts.map +1 -1
- package/dist/esm/actions/getTokenBalances.d.ts +8 -9
- package/dist/esm/actions/getTokenBalances.d.ts.map +1 -1
- package/dist/esm/actions/getTokenBalancesByChain.d.ts +8 -9
- package/dist/esm/actions/getTokenBalancesByChain.d.ts.map +1 -1
- package/dist/esm/actions/getTokenBalancesByChain.js +4 -2
- package/dist/esm/actions/getTokenBalancesByChain.js.map +1 -1
- package/dist/esm/actions/getTokens.d.ts +6 -7
- package/dist/esm/actions/getTokens.d.ts.map +1 -1
- package/dist/esm/actions/getTools.d.ts +6 -7
- package/dist/esm/actions/getTools.d.ts.map +1 -1
- package/dist/esm/actions/getTransactionHistory.d.ts +13 -19
- package/dist/esm/actions/getTransactionHistory.d.ts.map +1 -1
- package/dist/esm/actions/getWalletBalances.d.ts +7 -8
- package/dist/esm/actions/getWalletBalances.d.ts.map +1 -1
- package/dist/esm/actions/index.d.ts +109 -110
- package/dist/esm/actions/index.d.ts.map +1 -1
- package/dist/esm/actions/patchContractCalls.d.ts +0 -1
- package/dist/esm/actions/patchContractCalls.d.ts.map +1 -1
- package/dist/esm/actions/relayTransaction.d.ts +7 -8
- package/dist/esm/actions/relayTransaction.d.ts.map +1 -1
- package/dist/esm/client/createClient.d.ts +0 -1
- package/dist/esm/client/createClient.d.ts.map +1 -1
- package/dist/esm/client/getClientStorage.d.ts +0 -1
- package/dist/esm/client/getClientStorage.d.ts.map +1 -1
- package/dist/esm/core/BaseStepExecutionTask.d.ts +0 -1
- package/dist/esm/core/BaseStepExecutionTask.d.ts.map +1 -1
- package/dist/esm/core/BaseStepExecutor.d.ts +0 -1
- package/dist/esm/core/BaseStepExecutor.d.ts.map +1 -1
- package/dist/esm/core/StatusManager.d.ts +40 -51
- package/dist/esm/core/StatusManager.d.ts.map +1 -1
- package/dist/esm/core/TaskPipeline.d.ts +0 -1
- package/dist/esm/core/TaskPipeline.d.ts.map +1 -1
- package/dist/esm/core/actionMessages.d.ts +0 -1
- package/dist/esm/core/actionMessages.d.ts.map +1 -1
- package/dist/esm/core/execution.d.ts +29 -30
- package/dist/esm/core/execution.d.ts.map +1 -1
- package/dist/esm/core/executionState.d.ts +0 -1
- package/dist/esm/core/executionState.d.ts.map +1 -1
- package/dist/esm/core/prepareRestart.d.ts +0 -1
- package/dist/esm/core/prepareRestart.d.ts.map +1 -1
- package/dist/esm/core/storage.d.ts.map +1 -1
- package/dist/esm/core/tasks/CheckBalanceTask.d.ts +6 -7
- package/dist/esm/core/tasks/CheckBalanceTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/PrepareTransactionTask.d.ts +0 -1
- package/dist/esm/core/tasks/PrepareTransactionTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/WaitForTransactionStatusTask.d.ts +0 -1
- package/dist/esm/core/tasks/WaitForTransactionStatusTask.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/checkBalance.d.ts +17 -18
- package/dist/esm/core/tasks/helpers/checkBalance.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/getTransactionRequestData.d.ts +0 -1
- package/dist/esm/core/tasks/helpers/getTransactionRequestData.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/stepComparison.d.ts +11 -12
- package/dist/esm/core/tasks/helpers/stepComparison.d.ts.map +1 -1
- package/dist/esm/core/tasks/helpers/waitForTransactionStatus.d.ts +0 -1
- package/dist/esm/core/tasks/helpers/waitForTransactionStatus.d.ts.map +1 -1
- package/dist/esm/core/utils.d.ts +7 -8
- package/dist/esm/core/utils.d.ts.map +1 -1
- package/dist/esm/errors/SDKError.d.ts +0 -1
- package/dist/esm/errors/SDKError.d.ts.map +1 -1
- package/dist/esm/errors/baseError.d.ts +0 -1
- package/dist/esm/errors/baseError.d.ts.map +1 -1
- package/dist/esm/errors/constants.d.ts.map +1 -1
- package/dist/esm/errors/errors.d.ts +4 -5
- package/dist/esm/errors/errors.d.ts.map +1 -1
- package/dist/esm/errors/httpError.d.ts +0 -1
- package/dist/esm/errors/httpError.d.ts.map +1 -1
- package/dist/esm/errors/utils/baseErrorRootCause.d.ts +0 -1
- package/dist/esm/errors/utils/baseErrorRootCause.d.ts.map +1 -1
- package/dist/esm/errors/utils/rootCause.d.ts.map +1 -1
- package/dist/esm/types/actions.d.ts +7 -7
- package/dist/esm/types/actions.d.ts.map +1 -1
- package/dist/esm/types/core.d.ts +3 -4
- package/dist/esm/types/core.d.ts.map +1 -1
- package/dist/esm/types/execution.d.ts +0 -1
- package/dist/esm/types/execution.d.ts.map +1 -1
- package/dist/esm/types/request.d.ts.map +1 -1
- package/dist/esm/utils/checkPackageUpdates.d.ts.map +1 -1
- package/dist/esm/utils/checkPackageUpdates.js +1 -1
- package/dist/esm/utils/convertQuoteToRoute.d.ts +9 -10
- package/dist/esm/utils/convertQuoteToRoute.d.ts.map +1 -1
- package/dist/esm/utils/decode.d.ts.map +1 -1
- package/dist/esm/utils/fetchTxErrorDetails.d.ts.map +1 -1
- package/dist/esm/utils/formatUnits.d.ts +2 -2
- package/dist/esm/utils/formatUnits.d.ts.map +1 -1
- package/dist/esm/utils/getTransactionMessage.d.ts +0 -1
- package/dist/esm/utils/getTransactionMessage.d.ts.map +1 -1
- package/dist/esm/utils/isHex.d.ts +1 -3
- package/dist/esm/utils/isHex.d.ts.map +1 -1
- package/dist/esm/utils/isRoutesRequest.d.ts +0 -1
- package/dist/esm/utils/isRoutesRequest.d.ts.map +1 -1
- package/dist/esm/utils/isStep.d.ts +0 -1
- package/dist/esm/utils/isStep.d.ts.map +1 -1
- package/dist/esm/utils/isToken.d.ts +0 -1
- package/dist/esm/utils/isToken.d.ts.map +1 -1
- package/dist/esm/utils/parseUnits.d.ts +2 -2
- package/dist/esm/utils/parseUnits.d.ts.map +1 -1
- package/dist/esm/utils/request.d.ts +0 -1
- package/dist/esm/utils/request.d.ts.map +1 -1
- package/dist/esm/utils/sleep.d.ts.map +1 -1
- package/dist/esm/utils/toQueryString.d.ts.map +1 -1
- package/dist/esm/utils/waitForResult.d.ts +8 -8
- package/dist/esm/utils/waitForResult.d.ts.map +1 -1
- package/dist/esm/utils/withDedupe.d.ts +5 -8
- package/dist/esm/utils/withDedupe.d.ts.map +1 -1
- package/dist/esm/utils/withTimeout.d.ts +10 -16
- package/dist/esm/utils/withTimeout.d.ts.map +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.d.ts.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/package.json +1 -1
- package/src/actions/getStepTransaction.ts +4 -0
- package/src/version.ts +1 -1
|
@@ -3,128 +3,127 @@ import { GetStatusRequestExtended, LiFiStepRequest, QuoteRequestFromAmount, Rout
|
|
|
3
3
|
import { getQuote } from "./getQuote.js";
|
|
4
4
|
import { PatchContractCallsResponse } from "./patchContractCalls.js";
|
|
5
5
|
import { ChainId, ChainKey, ChainType, ChainsRequest, ConnectionsRequest, ConnectionsResponse, ContractCallsQuoteRequest, ExtendedChain, GasRecommendationRequest, GasRecommendationResponse, LiFiStep, PatchCallDataRequest, RelayRequest, RelayResponseData, RelayStatusRequest, RelayStatusResponseData, RequestOptions, RoutesResponse, StatusResponse, Token, TokenAmount, TokenExtended, TokensExtendedResponse, TokensRequest, TokensResponse, ToolsRequest, ToolsResponse, TransactionAnalyticsRequest, TransactionAnalyticsResponse, WalletTokenExtended } from "@lifi/types";
|
|
6
|
-
|
|
7
6
|
//#region src/actions/index.d.ts
|
|
8
7
|
type Actions = {
|
|
9
8
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
* Get all available chains
|
|
10
|
+
* @param params - The configuration of the requested chains
|
|
11
|
+
* @param options - Request options
|
|
12
|
+
* @returns A list of all available chains
|
|
13
|
+
*/
|
|
15
14
|
getChains: (params?: ChainsRequest, options?: RequestOptions) => Promise<ExtendedChain[]>;
|
|
16
15
|
/**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
* Get connections between chains
|
|
17
|
+
* @param params - The configuration of the requested connections
|
|
18
|
+
* @param options - Request options
|
|
19
|
+
* @returns A list of connections
|
|
20
|
+
*/
|
|
22
21
|
getConnections: (params: ConnectionsRequest, options?: RequestOptions) => Promise<ConnectionsResponse>;
|
|
23
22
|
/**
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
* Get a quote for contract calls
|
|
24
|
+
* @param params - The configuration of the requested contract calls quote
|
|
25
|
+
* @param options - Request options
|
|
26
|
+
* @returns Quote for contract calls
|
|
27
|
+
*/
|
|
29
28
|
getContractCallsQuote: (params: ContractCallsQuoteRequest, options?: RequestOptions) => Promise<LiFiStep>;
|
|
30
29
|
/**
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
* Get gas recommendation for a chain
|
|
31
|
+
* @param params - The configuration of the requested gas recommendation
|
|
32
|
+
* @param options - Request options
|
|
33
|
+
* @returns Gas recommendation
|
|
34
|
+
*/
|
|
36
35
|
getGasRecommendation: (params: GasRecommendationRequest, options?: RequestOptions) => Promise<GasRecommendationResponse>;
|
|
37
36
|
/**
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
* Get the address of a name service
|
|
38
|
+
* @param name - The name to resolve
|
|
39
|
+
* @param chainType - The chain type to resolve the name on
|
|
40
|
+
* @returns The address of the name service
|
|
41
|
+
*/
|
|
43
42
|
getNameServiceAddress: (name: string, chainType?: ChainType) => Promise<string | undefined>;
|
|
44
43
|
/**
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
* Get a quote for a token transfer
|
|
45
|
+
* @param params - The configuration of the requested quote
|
|
46
|
+
* @param options - Request options
|
|
47
|
+
* @returns Quote for a token transfer
|
|
48
|
+
*/
|
|
50
49
|
getQuote: (params: Parameters<typeof getQuote>[1], options?: RequestOptions) => Promise<LiFiStep>;
|
|
51
50
|
/**
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
51
|
+
* Get the status of a relayed transaction
|
|
52
|
+
* @param params - The configuration of the requested relay status
|
|
53
|
+
* @param options - Request options
|
|
54
|
+
* @returns Status of the relayed transaction
|
|
55
|
+
*/
|
|
57
56
|
getRelayedTransactionStatus: (params: RelayStatusRequest, options?: RequestOptions) => Promise<RelayStatusResponseData>;
|
|
58
57
|
/**
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
58
|
+
* Get a quote from a relayer
|
|
59
|
+
* @param params - The configuration of the requested relayer quote
|
|
60
|
+
* @param options - Request options
|
|
61
|
+
* @returns Quote from a relayer
|
|
62
|
+
*/
|
|
64
63
|
getRelayerQuote: (params: QuoteRequestFromAmount, options?: RequestOptions) => Promise<LiFiStep>;
|
|
65
64
|
/**
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
65
|
+
* Get a set of routes for a request that describes a transfer of tokens.
|
|
66
|
+
* Optional limit-order fields (`toAmount`, `validUntil`, `partiallyFillable`)
|
|
67
|
+
* may be supplied and are resolved on the backend.
|
|
68
|
+
* @param params - A description of the transfer
|
|
69
|
+
* @param options - Request options
|
|
70
|
+
* @returns The resulting routes that can be used to realize the described transfer
|
|
71
|
+
*/
|
|
73
72
|
getRoutes: (params: RoutesRequest$1, options?: RequestOptions) => Promise<RoutesResponse>;
|
|
74
73
|
/**
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
74
|
+
* Get the status of a transaction
|
|
75
|
+
* @param params - The configuration of the requested status
|
|
76
|
+
* @param options - Request options
|
|
77
|
+
* @returns Status of the transaction
|
|
78
|
+
*/
|
|
80
79
|
getStatus: (params: GetStatusRequestExtended, options?: RequestOptions) => Promise<StatusResponse>;
|
|
81
80
|
/**
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
81
|
+
* Get a step transaction. The step's `action` may carry the optional
|
|
82
|
+
* limit-order fields, which are resolved on the backend.
|
|
83
|
+
* @param params - The configuration of the requested step transaction
|
|
84
|
+
* @param options - Request options
|
|
85
|
+
* @returns Step transaction
|
|
86
|
+
*/
|
|
88
87
|
getStepTransaction: (params: LiFiStepRequest, options?: RequestOptions) => Promise<LiFiStep>;
|
|
89
88
|
/**
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
89
|
+
* Get a specific token
|
|
90
|
+
* @param chain - Id or key of the chain that contains the token
|
|
91
|
+
* @param token - Address or symbol of the token on the requested chain
|
|
92
|
+
* @param options - Request options
|
|
93
|
+
* @returns Token information
|
|
94
|
+
*/
|
|
96
95
|
getToken: (chain: ChainKey | ChainId, token: string, options?: RequestOptions) => Promise<TokenExtended>;
|
|
97
96
|
/**
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
97
|
+
* Get token balance for a specific token
|
|
98
|
+
* @param walletAddress - A wallet address
|
|
99
|
+
* @param token - A Token object
|
|
100
|
+
* @returns Token balance
|
|
101
|
+
*/
|
|
103
102
|
getTokenBalance: (walletAddress: string, token: Token) => Promise<TokenAmount | null>;
|
|
104
103
|
/**
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
104
|
+
* Get token balances for multiple tokens
|
|
105
|
+
* @param walletAddress - A wallet address
|
|
106
|
+
* @param tokens - A list of Token objects
|
|
107
|
+
* @returns Token balances
|
|
108
|
+
*/
|
|
110
109
|
getTokenBalances: (walletAddress: string, tokens: Token[]) => Promise<TokenAmount[]>;
|
|
111
110
|
/**
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
111
|
+
* Get token balances by chain
|
|
112
|
+
* @param walletAddress - A wallet address
|
|
113
|
+
* @param tokensByChain - A list of token objects organized by chain ids
|
|
114
|
+
* @returns Token balances by chain
|
|
115
|
+
*/
|
|
117
116
|
getTokenBalancesByChain: (walletAddress: string, tokensByChain: {
|
|
118
117
|
[chainId: number]: Token[];
|
|
119
118
|
}) => Promise<{
|
|
120
119
|
[chainId: number]: TokenAmount[];
|
|
121
120
|
}>;
|
|
122
121
|
/**
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
122
|
+
* Get all available tokens
|
|
123
|
+
* @param params - The configuration of the requested tokens
|
|
124
|
+
* @param options - Request options
|
|
125
|
+
* @returns A list of all available tokens
|
|
126
|
+
*/
|
|
128
127
|
getTokens: {
|
|
129
128
|
(params?: TokensRequest & {
|
|
130
129
|
extended?: false | undefined;
|
|
@@ -134,39 +133,39 @@ type Actions = {
|
|
|
134
133
|
}, options?: RequestOptions): Promise<TokensExtendedResponse>;
|
|
135
134
|
};
|
|
136
135
|
/**
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
136
|
+
* Get all available tools (bridges and exchanges)
|
|
137
|
+
* @param params - The configuration of the requested tools
|
|
138
|
+
* @param options - Request options
|
|
139
|
+
* @returns A list of all available tools
|
|
140
|
+
*/
|
|
142
141
|
getTools: (params?: ToolsRequest, options?: RequestOptions) => Promise<ToolsResponse>;
|
|
143
142
|
/**
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
143
|
+
* Get transaction history
|
|
144
|
+
* @param params - The configuration of the requested transaction history
|
|
145
|
+
* @param options - Request options
|
|
146
|
+
* @returns Transaction history
|
|
147
|
+
*/
|
|
149
148
|
getTransactionHistory: (params: TransactionAnalyticsRequest, options?: RequestOptions) => Promise<TransactionAnalyticsResponse>;
|
|
150
149
|
/**
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
150
|
+
* Get wallet balances
|
|
151
|
+
* @param params - The configuration of the requested wallet balances
|
|
152
|
+
* @param options - Request options
|
|
153
|
+
* @returns Wallet balances
|
|
154
|
+
*/
|
|
156
155
|
getWalletBalances: (walletAddress: string, options?: RequestOptions) => Promise<Record<number, WalletTokenExtended[]>>;
|
|
157
156
|
/**
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
157
|
+
* Relay a transaction through the relayer service
|
|
158
|
+
* @param params - The configuration for the relay request
|
|
159
|
+
* @param options - Request options
|
|
160
|
+
* @returns Task ID and transaction link for the relayed transaction
|
|
161
|
+
*/
|
|
163
162
|
relayTransaction: (params: RelayRequest, options?: RequestOptions) => Promise<RelayResponseData>;
|
|
164
163
|
/**
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
164
|
+
* Patch contract calls
|
|
165
|
+
* @param params - The configuration for the patch contract calls request
|
|
166
|
+
* @param options - Request options
|
|
167
|
+
* @returns Patched contract calls
|
|
168
|
+
*/
|
|
170
169
|
patchContractCalls: (params: PatchCallDataRequest, options?: RequestOptions) => Promise<PatchContractCallsResponse[]>;
|
|
171
170
|
};
|
|
172
171
|
declare function actions(client: SDKClient): Actions;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { SDKClient } from "../types/core.js";
|
|
2
2
|
import { RelayRequest, RelayResponseData, RequestOptions } from "@lifi/types";
|
|
3
|
-
|
|
4
3
|
//#region src/actions/relayTransaction.d.ts
|
|
5
4
|
/**
|
|
6
|
-
* Relay a transaction through the relayer service
|
|
7
|
-
* @param client - The SDK client
|
|
8
|
-
* @param params - The configuration for the relay request
|
|
9
|
-
* @param options - Request options
|
|
10
|
-
* @throws {LiFiError} - Throws a LiFiError if request fails
|
|
11
|
-
* @returns Task ID and transaction link for the relayed transaction
|
|
12
|
-
*/
|
|
5
|
+
* Relay a transaction through the relayer service
|
|
6
|
+
* @param client - The SDK client
|
|
7
|
+
* @param params - The configuration for the relay request
|
|
8
|
+
* @param options - Request options
|
|
9
|
+
* @throws {LiFiError} - Throws a LiFiError if request fails
|
|
10
|
+
* @returns Task ID and transaction link for the relayed transaction
|
|
11
|
+
*/
|
|
13
12
|
declare const relayTransaction: (client: SDKClient, params: RelayRequest, options?: RequestOptions) => Promise<RelayResponseData>;
|
|
14
13
|
//#endregion
|
|
15
14
|
export { relayTransaction };
|
|
@@ -4,7 +4,6 @@ import { StepExecutorBaseContext, StepExecutorContext } from "../types/execution
|
|
|
4
4
|
import { ExecuteStepRetryError } from "../errors/errors.js";
|
|
5
5
|
import { SDKError } from "../errors/SDKError.js";
|
|
6
6
|
import { TaskPipeline } from "./TaskPipeline.js";
|
|
7
|
-
|
|
8
7
|
//#region src/core/BaseStepExecutor.d.ts
|
|
9
8
|
declare abstract class BaseStepExecutor implements StepExecutor {
|
|
10
9
|
protected executionOptions?: ExecutionOptions;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Execution, ExecutionAction, ExecutionActionStatus, ExecutionActionType, LiFiStepExtended } from "../types/core.js";
|
|
2
2
|
import { ChainId, LiFiStep } from "@lifi/types";
|
|
3
|
-
|
|
4
3
|
//#region src/core/StatusManager.d.ts
|
|
5
4
|
type ActionProps = {
|
|
6
5
|
step: LiFiStepExtended;
|
|
@@ -9,69 +8,59 @@ type ActionProps = {
|
|
|
9
8
|
status: ExecutionActionStatus;
|
|
10
9
|
};
|
|
11
10
|
/**
|
|
12
|
-
* Manages status updates of a route and provides various functions for tracking actions.
|
|
13
|
-
*/
|
|
11
|
+
* Manages status updates of a route and provides various functions for tracking actions.
|
|
12
|
+
*/
|
|
14
13
|
declare class StatusManager {
|
|
15
14
|
private readonly routeId;
|
|
16
15
|
private shouldUpdate;
|
|
17
16
|
constructor(routeId: string);
|
|
18
17
|
/**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
* Initializes the execution object of a Step.
|
|
19
|
+
* @param step The current step in execution
|
|
20
|
+
* @returns The initialized execution object for this step
|
|
21
|
+
*/
|
|
23
22
|
initializeExecution: (step: LiFiStepExtended) => Execution;
|
|
24
23
|
/**
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
* Updates the execution object of a Step.
|
|
25
|
+
* @param step The current step in execution
|
|
26
|
+
* @param execution Partial execution data to merge
|
|
27
|
+
* @returns The step with the updated execution object
|
|
28
|
+
*/
|
|
30
29
|
updateExecution(step: LiFiStepExtended, execution: Partial<Execution>): LiFiStep;
|
|
31
30
|
/**
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
* Finds an action of the specified type in the step's execution
|
|
32
|
+
* @param step The step to search in
|
|
33
|
+
* @param type The action type to find
|
|
34
|
+
* @returns The found action or undefined if not found
|
|
35
|
+
*/
|
|
37
36
|
findAction(step: LiFiStepExtended, type: ExecutionActionType): ExecutionAction | undefined;
|
|
38
37
|
/**
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
createAction: ({
|
|
48
|
-
step,
|
|
49
|
-
type,
|
|
50
|
-
chainId,
|
|
51
|
-
status
|
|
52
|
-
}: ActionProps) => ExecutionAction;
|
|
38
|
+
* Create and push a new action into the execution.
|
|
39
|
+
* Caller is responsible for ensuring an action of this type does not already exist.
|
|
40
|
+
* @param step The step that should contain the new action.
|
|
41
|
+
* @param type Type of the action.
|
|
42
|
+
* @param chainId Chain Id of the action.
|
|
43
|
+
* @param status The initial status for the new action.
|
|
44
|
+
* @returns The created action.
|
|
45
|
+
*/
|
|
46
|
+
createAction: ({ step, type, chainId, status }: ActionProps) => ExecutionAction;
|
|
53
47
|
/**
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
initializeAction: ({
|
|
62
|
-
step,
|
|
63
|
-
type,
|
|
64
|
-
chainId,
|
|
65
|
-
status
|
|
66
|
-
}: ActionProps) => ExecutionAction;
|
|
48
|
+
* Find an existing action by type and update it, or create a new one if none exists.
|
|
49
|
+
* @param step The step that should contain the action.
|
|
50
|
+
* @param type Type of the action. Used to identify already existing actions.
|
|
51
|
+
* @param chainId Chain Id of the action (used when creating).
|
|
52
|
+
* @param status The status to set on the found or newly created action.
|
|
53
|
+
* @returns The updated or newly created action.
|
|
54
|
+
*/
|
|
55
|
+
initializeAction: ({ step, type, chainId, status }: ActionProps) => ExecutionAction;
|
|
67
56
|
/**
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
57
|
+
* Update an action object.
|
|
58
|
+
* @param step The step where the action should be updated
|
|
59
|
+
* @param type The action type to update
|
|
60
|
+
* @param status The status the action gets.
|
|
61
|
+
* @param [params] Additional parameters to append to the action.
|
|
62
|
+
* @returns The updated action
|
|
63
|
+
*/
|
|
75
64
|
updateAction: (step: LiFiStepExtended, type: ExecutionActionType, status: ExecutionActionStatus, params?: Partial<ExecutionAction & {
|
|
76
65
|
signedAt?: number;
|
|
77
66
|
}>) => ExecutionAction;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ExecutionActionStatus, ExecutionActionType } from "../types/core.js";
|
|
2
2
|
import { StatusMessage, Substatus } from "@lifi/types";
|
|
3
|
-
|
|
4
3
|
//#region src/core/actionMessages.d.ts
|
|
5
4
|
declare function getActionMessage(type: ExecutionActionType, status: ExecutionActionStatus): string | undefined;
|
|
6
5
|
declare function getSubstatusMessage(status: StatusMessage, substatus?: Substatus): string | undefined;
|
|
@@ -1,47 +1,46 @@
|
|
|
1
1
|
import { ExecutionOptions, RouteExtended, SDKClient } from "../types/core.js";
|
|
2
2
|
import { Route } from "@lifi/types";
|
|
3
|
-
|
|
4
3
|
//#region src/core/execution.d.ts
|
|
5
4
|
/**
|
|
6
|
-
* Execute a route.
|
|
7
|
-
* @param client - The SDK client.
|
|
8
|
-
* @param route - The route that should be executed. Cannot be an active route.
|
|
9
|
-
* @param executionOptions - An object containing settings and callbacks.
|
|
10
|
-
* @returns The executed route.
|
|
11
|
-
* @throws {LiFiError} Throws a LiFiError if the execution fails.
|
|
12
|
-
*/
|
|
5
|
+
* Execute a route.
|
|
6
|
+
* @param client - The SDK client.
|
|
7
|
+
* @param route - The route that should be executed. Cannot be an active route.
|
|
8
|
+
* @param executionOptions - An object containing settings and callbacks.
|
|
9
|
+
* @returns The executed route.
|
|
10
|
+
* @throws {LiFiError} Throws a LiFiError if the execution fails.
|
|
11
|
+
*/
|
|
13
12
|
declare const executeRoute: (client: SDKClient, route: Route, executionOptions?: ExecutionOptions) => Promise<RouteExtended>;
|
|
14
13
|
/**
|
|
15
|
-
* Resume the execution of a route that has been stopped or had an error while executing.
|
|
16
|
-
* @param client - The SDK client.
|
|
17
|
-
* @param route - The route that is to be executed. Cannot be an active route.
|
|
18
|
-
* @param executionOptions - An object containing settings and callbacks.
|
|
19
|
-
* @returns The executed route.
|
|
20
|
-
* @throws {LiFiError} Throws a LiFiError if the execution fails.
|
|
21
|
-
*/
|
|
14
|
+
* Resume the execution of a route that has been stopped or had an error while executing.
|
|
15
|
+
* @param client - The SDK client.
|
|
16
|
+
* @param route - The route that is to be executed. Cannot be an active route.
|
|
17
|
+
* @param executionOptions - An object containing settings and callbacks.
|
|
18
|
+
* @returns The executed route.
|
|
19
|
+
* @throws {LiFiError} Throws a LiFiError if the execution fails.
|
|
20
|
+
*/
|
|
22
21
|
declare const resumeRoute: (client: SDKClient, route: Route, executionOptions?: ExecutionOptions) => Promise<RouteExtended>;
|
|
23
22
|
/**
|
|
24
|
-
* Updates route execution to background or foreground state.
|
|
25
|
-
* @param route - A route that is currently in execution.
|
|
26
|
-
* @param options - An object with execution settings.
|
|
27
|
-
*/
|
|
23
|
+
* Updates route execution to background or foreground state.
|
|
24
|
+
* @param route - A route that is currently in execution.
|
|
25
|
+
* @param options - An object with execution settings.
|
|
26
|
+
*/
|
|
28
27
|
declare const updateRouteExecution: (route: Route, options: ExecutionOptions) => void;
|
|
29
28
|
/**
|
|
30
|
-
* Stops the execution of an active route.
|
|
31
|
-
* @param route - A route that is currently in execution.
|
|
32
|
-
* @returns The stopped route.
|
|
33
|
-
*/
|
|
29
|
+
* Stops the execution of an active route.
|
|
30
|
+
* @param route - A route that is currently in execution.
|
|
31
|
+
* @returns The stopped route.
|
|
32
|
+
*/
|
|
34
33
|
declare const stopRouteExecution: (route: Route) => Route;
|
|
35
34
|
/**
|
|
36
|
-
* Get the list of active routes.
|
|
37
|
-
* @returns A list of routes.
|
|
38
|
-
*/
|
|
35
|
+
* Get the list of active routes.
|
|
36
|
+
* @returns A list of routes.
|
|
37
|
+
*/
|
|
39
38
|
declare const getActiveRoutes: () => RouteExtended[];
|
|
40
39
|
/**
|
|
41
|
-
* Return the current route information for given route. The route has to be active.
|
|
42
|
-
* @param routeId - A route id.
|
|
43
|
-
* @returns The updated route.
|
|
44
|
-
*/
|
|
40
|
+
* Return the current route information for given route. The route has to be active.
|
|
41
|
+
* @param routeId - A route id.
|
|
42
|
+
* @returns The updated route.
|
|
43
|
+
*/
|
|
45
44
|
declare const getActiveRoute: (routeId: string) => RouteExtended | undefined;
|
|
46
45
|
//#endregion
|
|
47
46
|
export { executeRoute, getActiveRoute, getActiveRoutes, resumeRoute, stopRouteExecution, updateRouteExecution };
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { StepExecutorContext, TaskResult } from "../../types/execution.js";
|
|
2
2
|
import { BaseStepExecutionTask } from "../BaseStepExecutionTask.js";
|
|
3
3
|
import { CheckBalanceOptions } from "./helpers/checkBalance.js";
|
|
4
|
-
|
|
5
4
|
//#region src/core/tasks/CheckBalanceTask.d.ts
|
|
6
5
|
declare class CheckBalanceTask extends BaseStepExecutionTask {
|
|
7
6
|
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
* Per-step options hook for chain-specific subclasses (e.g. skip the
|
|
8
|
+
* gas check for smart-contract wallets or relayed steps). Default `{}`
|
|
9
|
+
* keeps behavior unchanged for every provider that doesn't override.
|
|
10
|
+
* Resolved lazily inside `run()` — pipelines that resume past
|
|
11
|
+
* `CheckBalance` pay no cost.
|
|
12
|
+
*/
|
|
14
13
|
protected getCheckBalanceOptions(_context: StepExecutorContext): Promise<CheckBalanceOptions>;
|
|
15
14
|
run(context: StepExecutorContext): Promise<TaskResult>;
|
|
16
15
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { StepExecutorContext, TaskResult } from "../../types/execution.js";
|
|
2
2
|
import { BaseStepExecutionTask } from "../BaseStepExecutionTask.js";
|
|
3
|
-
|
|
4
3
|
//#region src/core/tasks/PrepareTransactionTask.d.ts
|
|
5
4
|
declare class PrepareTransactionTask extends BaseStepExecutionTask {
|
|
6
5
|
run(context: StepExecutorContext): Promise<TaskResult>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ExecutionActionType } from "../../types/core.js";
|
|
2
2
|
import { StepExecutorContext, TaskResult } from "../../types/execution.js";
|
|
3
3
|
import { BaseStepExecutionTask } from "../BaseStepExecutionTask.js";
|
|
4
|
-
|
|
5
4
|
//#region src/core/tasks/WaitForTransactionStatusTask.d.ts
|
|
6
5
|
declare class WaitForTransactionStatusTask extends BaseStepExecutionTask {
|
|
7
6
|
readonly actionType: ExecutionActionType;
|