@lifi/sdk 4.1.0 → 4.3.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 +16 -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/index.d.ts +105 -113
- package/dist/cjs/actions/index.js +0 -2
- package/dist/cjs/actions/index.js.map +1 -1
- 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/execution.js.map +1 -1
- 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/index.d.ts +1 -2
- package/dist/cjs/index.js +0 -2
- 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/index.d.ts +105 -113
- package/dist/esm/actions/index.d.ts.map +1 -1
- package/dist/esm/actions/index.js +0 -2
- package/dist/esm/actions/index.js.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/execution.js.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/index.d.ts +1 -2
- package/dist/esm/index.js +1 -2
- 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 +2 -2
- package/src/actions/getStepTransaction.ts +4 -0
- package/src/actions/index.ts +0 -15
- package/src/index.ts +0 -1
- package/src/version.ts +1 -1
- package/dist/cjs/actions/getWalletBalances.d.ts +0 -16
- package/dist/cjs/actions/getWalletBalances.js +0 -20
- package/dist/cjs/actions/getWalletBalances.js.map +0 -1
- package/dist/esm/actions/getWalletBalances.d.ts +0 -16
- package/dist/esm/actions/getWalletBalances.d.ts.map +0 -1
- package/dist/esm/actions/getWalletBalances.js +0 -19
- package/dist/esm/actions/getWalletBalances.js.map +0 -1
- package/src/actions/getWalletBalances.ts +0 -36
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { SDKBaseConfig, SDKClient } from "../types/core.js";
|
|
2
2
|
import { ChainsRequest, ExtendedChain, RequestOptions } from "@lifi/types";
|
|
3
|
-
|
|
4
3
|
//#region src/actions/getChains.d.ts
|
|
5
4
|
/**
|
|
6
|
-
* Get all available chains
|
|
7
|
-
* @param client - The SDK client
|
|
8
|
-
* @param params - The configuration of the requested chains
|
|
9
|
-
* @param options - Request options
|
|
10
|
-
* @returns A list of all available chains
|
|
11
|
-
* @throws {LiFiError} Throws a LiFiError if request fails.
|
|
12
|
-
*/
|
|
5
|
+
* Get all available chains
|
|
6
|
+
* @param client - The SDK client
|
|
7
|
+
* @param params - The configuration of the requested chains
|
|
8
|
+
* @param options - Request options
|
|
9
|
+
* @returns A list of all available chains
|
|
10
|
+
* @throws {LiFiError} Throws a LiFiError if request fails.
|
|
11
|
+
*/
|
|
13
12
|
declare const getChains: (client: SDKClient, params?: ChainsRequest, options?: RequestOptions) => Promise<ExtendedChain[]>;
|
|
14
13
|
declare const _getChains: (config: SDKBaseConfig, params?: ChainsRequest, options?: RequestOptions) => Promise<ExtendedChain[]>;
|
|
15
14
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getChains.d.ts","names":[],"sources":["../../../src/actions/getChains.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getChains.d.ts","names":[],"sources":["../../../src/actions/getChains.ts"],"mappings":";;;;;;;;;;;cAkBa,YACX,QAAQ,WACR,SAAS,eACT,UAAU,mBACT,QAAQ;cAIE,aACX,QAAQ,eACR,SAAS,eACT,UAAU,mBACT,QAAQ"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { SDKClient } from "../types/core.js";
|
|
2
2
|
import { ConnectionsRequest, ConnectionsResponse, RequestOptions } from "@lifi/types";
|
|
3
|
-
|
|
4
3
|
//#region src/actions/getConnections.d.ts
|
|
5
4
|
/**
|
|
6
|
-
* Get all the available connections for swap/bridging tokens
|
|
7
|
-
* @param client - The SDK client
|
|
8
|
-
* @param connectionRequest ConnectionsRequest
|
|
9
|
-
* @param options - Request options
|
|
10
|
-
* @returns ConnectionsResponse
|
|
11
|
-
*/
|
|
5
|
+
* Get all the available connections for swap/bridging tokens
|
|
6
|
+
* @param client - The SDK client
|
|
7
|
+
* @param connectionRequest ConnectionsRequest
|
|
8
|
+
* @param options - Request options
|
|
9
|
+
* @returns ConnectionsResponse
|
|
10
|
+
*/
|
|
12
11
|
declare const getConnections: (client: SDKClient, connectionRequest: ConnectionsRequest, options?: RequestOptions) => Promise<ConnectionsResponse>;
|
|
13
12
|
//#endregion
|
|
14
13
|
export { getConnections };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getConnections.d.ts","names":[],"sources":["../../../src/actions/getConnections.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getConnections.d.ts","names":[],"sources":["../../../src/actions/getConnections.ts"],"mappings":";;;;;;;;;;cAea,iBACX,QAAQ,WACR,mBAAmB,oBACnB,UAAU,mBACT,QAAQ"}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { SDKClient } from "../types/core.js";
|
|
2
2
|
import { ContractCallsQuoteRequest, LiFiStep, RequestOptions } from "@lifi/types";
|
|
3
|
-
|
|
4
3
|
//#region src/actions/getContractCallsQuote.d.ts
|
|
5
4
|
/**
|
|
6
|
-
* Get a quote for a destination contract call
|
|
7
|
-
* @param client - The SDK client
|
|
8
|
-
* @param params - The configuration of the requested destination call
|
|
9
|
-
* @param options - Request options
|
|
10
|
-
* @throws {LiFiError} - Throws a LiFiError if request fails
|
|
11
|
-
* @returns - Returns step.
|
|
12
|
-
*/
|
|
5
|
+
* Get a quote for a destination contract call
|
|
6
|
+
* @param client - The SDK client
|
|
7
|
+
* @param params - The configuration of the requested destination call
|
|
8
|
+
* @param options - Request options
|
|
9
|
+
* @throws {LiFiError} - Throws a LiFiError if request fails
|
|
10
|
+
* @returns - Returns step.
|
|
11
|
+
*/
|
|
13
12
|
declare const getContractCallsQuote: (client: SDKClient, params: ContractCallsQuoteRequest, options?: RequestOptions) => Promise<LiFiStep>;
|
|
14
13
|
//#endregion
|
|
15
14
|
export { getContractCallsQuote };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getContractCallsQuote.d.ts","names":[],"sources":["../../../src/actions/getContractCallsQuote.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getContractCallsQuote.d.ts","names":[],"sources":["../../../src/actions/getContractCallsQuote.ts"],"mappings":";;;;;;;;;;;cAsBa,wBACX,QAAQ,WACR,QAAQ,2BACR,UAAU,mBACT,QAAQ"}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { SDKClient } from "../types/core.js";
|
|
2
2
|
import { GasRecommendationRequest, GasRecommendationResponse, RequestOptions } from "@lifi/types";
|
|
3
|
-
|
|
4
3
|
//#region src/actions/getGasRecommendation.d.ts
|
|
5
4
|
/**
|
|
6
|
-
* Get gas recommendation for a certain chain
|
|
7
|
-
* @param client - The SDK client
|
|
8
|
-
* @param params - Configuration of the requested gas recommendation.
|
|
9
|
-
* @param options - Request options
|
|
10
|
-
* @throws {LiFiError} Throws a LiFiError if request fails.
|
|
11
|
-
* @returns Gas recommendation response.
|
|
12
|
-
*/
|
|
5
|
+
* Get gas recommendation for a certain chain
|
|
6
|
+
* @param client - The SDK client
|
|
7
|
+
* @param params - Configuration of the requested gas recommendation.
|
|
8
|
+
* @param options - Request options
|
|
9
|
+
* @throws {LiFiError} Throws a LiFiError if request fails.
|
|
10
|
+
* @returns Gas recommendation response.
|
|
11
|
+
*/
|
|
13
12
|
declare const getGasRecommendation: (client: SDKClient, params: GasRecommendationRequest, options?: RequestOptions) => Promise<GasRecommendationResponse>;
|
|
14
13
|
//#endregion
|
|
15
14
|
export { getGasRecommendation };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getGasRecommendation.d.ts","names":[],"sources":["../../../src/actions/getGasRecommendation.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getGasRecommendation.d.ts","names":[],"sources":["../../../src/actions/getGasRecommendation.ts"],"mappings":";;;;;;;;;;;cAkBa,uBACX,QAAQ,WACR,QAAQ,0BACR,UAAU,mBACT,QAAQ"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { SDKClient } from "../types/core.js";
|
|
2
2
|
import { ChainType } from "@lifi/types";
|
|
3
|
-
|
|
4
3
|
//#region src/actions/getNameServiceAddress.d.ts
|
|
5
4
|
/**
|
|
6
|
-
* Get the address of a name service
|
|
7
|
-
* @param client - The SDK client
|
|
8
|
-
* @param name - The name to resolve
|
|
9
|
-
* @param chainType - The chain type to resolve the name on
|
|
10
|
-
* @returns The address of the name service
|
|
11
|
-
*/
|
|
5
|
+
* Get the address of a name service
|
|
6
|
+
* @param client - The SDK client
|
|
7
|
+
* @param name - The name to resolve
|
|
8
|
+
* @param chainType - The chain type to resolve the name on
|
|
9
|
+
* @returns The address of the name service
|
|
10
|
+
*/
|
|
12
11
|
declare const getNameServiceAddress: (client: SDKClient, name: string, chainType?: ChainType) => Promise<string | undefined>;
|
|
13
12
|
//#endregion
|
|
14
13
|
export { getNameServiceAddress };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getNameServiceAddress.d.ts","names":[],"sources":["../../../src/actions/getNameServiceAddress.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getNameServiceAddress.d.ts","names":[],"sources":["../../../src/actions/getNameServiceAddress.ts"],"mappings":";;;;;;;;;;cAUa,wBACX,QAAQ,WACR,cACA,YAAY,cACX"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { SDKClient } from "../types/core.js";
|
|
2
2
|
import { QuoteRequestFromAmount, QuoteRequestToAmount } from "../types/actions.js";
|
|
3
3
|
import { LiFiStep, RequestOptions } from "@lifi/types";
|
|
4
|
-
|
|
5
4
|
//#region src/actions/getQuote.d.ts
|
|
6
5
|
/**
|
|
7
|
-
* Get a quote for a token transfer
|
|
8
|
-
* @param client - The SDK client
|
|
9
|
-
* @param params - The configuration of the requested quote
|
|
10
|
-
* @param options - Request options
|
|
11
|
-
* @throws {LiFiError} - Throws a LiFiError if request fails
|
|
12
|
-
* @returns Quote for a token transfer
|
|
13
|
-
*/
|
|
6
|
+
* Get a quote for a token transfer
|
|
7
|
+
* @param client - The SDK client
|
|
8
|
+
* @param params - The configuration of the requested quote
|
|
9
|
+
* @param options - Request options
|
|
10
|
+
* @throws {LiFiError} - Throws a LiFiError if request fails
|
|
11
|
+
* @returns Quote for a token transfer
|
|
12
|
+
*/
|
|
14
13
|
declare function getQuote(client: SDKClient, params: QuoteRequestFromAmount, options?: RequestOptions): Promise<LiFiStep>;
|
|
15
14
|
declare function getQuote(client: SDKClient, params: QuoteRequestToAmount, options?: RequestOptions): Promise<LiFiStep>;
|
|
16
15
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getQuote.d.ts","names":[],"sources":["../../../src/actions/getQuote.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getQuote.d.ts","names":[],"sources":["../../../src/actions/getQuote.ts"],"mappings":";;;;;;;;;;;;iBAoBsB,SACpB,QAAQ,WACR,QAAQ,wBACR,UAAU,iBACT,QAAQ;iBACW,SACpB,QAAQ,WACR,QAAQ,sBACR,UAAU,iBACT,QAAQ"}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { SDKClient } from "../types/core.js";
|
|
2
2
|
import { RelayStatusRequest, RelayStatusResponseData, RequestOptions } from "@lifi/types";
|
|
3
|
-
|
|
4
3
|
//#region src/actions/getRelayedTransactionStatus.d.ts
|
|
5
4
|
/**
|
|
6
|
-
* Get the status of a relayed transaction
|
|
7
|
-
* @param client - The SDK client
|
|
8
|
-
* @param params - Parameters for the relay status request
|
|
9
|
-
* @param options - Request options
|
|
10
|
-
* @throws {LiFiError} - Throws a LiFiError if request fails
|
|
11
|
-
* @returns Status of the relayed transaction
|
|
12
|
-
*/
|
|
5
|
+
* Get the status of a relayed transaction
|
|
6
|
+
* @param client - The SDK client
|
|
7
|
+
* @param params - Parameters for the relay status request
|
|
8
|
+
* @param options - Request options
|
|
9
|
+
* @throws {LiFiError} - Throws a LiFiError if request fails
|
|
10
|
+
* @returns Status of the relayed transaction
|
|
11
|
+
*/
|
|
13
12
|
declare const getRelayedTransactionStatus: (client: SDKClient, params: RelayStatusRequest, options?: RequestOptions) => Promise<RelayStatusResponseData>;
|
|
14
13
|
//#endregion
|
|
15
14
|
export { getRelayedTransactionStatus };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRelayedTransactionStatus.d.ts","names":[],"sources":["../../../src/actions/getRelayedTransactionStatus.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getRelayedTransactionStatus.d.ts","names":[],"sources":["../../../src/actions/getRelayedTransactionStatus.ts"],"mappings":";;;;;;;;;;;cAuBa,8BACX,QAAQ,WACR,QAAQ,oBACR,UAAU,mBACT,QAAQ"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { SDKClient } from "../types/core.js";
|
|
2
2
|
import { QuoteRequestFromAmount } from "../types/actions.js";
|
|
3
3
|
import { LiFiStep, RequestOptions } from "@lifi/types";
|
|
4
|
-
|
|
5
4
|
//#region src/actions/getRelayerQuote.d.ts
|
|
6
5
|
/**
|
|
7
|
-
* Get a relayer quote for a token transfer
|
|
8
|
-
* @param client - The SDK client
|
|
9
|
-
* @param params - The configuration of the requested quote
|
|
10
|
-
* @param options - Request options
|
|
11
|
-
* @throws {LiFiError} - Throws a LiFiError if request fails
|
|
12
|
-
* @returns Relayer quote for a token transfer
|
|
13
|
-
*/
|
|
6
|
+
* Get a relayer quote for a token transfer
|
|
7
|
+
* @param client - The SDK client
|
|
8
|
+
* @param params - The configuration of the requested quote
|
|
9
|
+
* @param options - Request options
|
|
10
|
+
* @throws {LiFiError} - Throws a LiFiError if request fails
|
|
11
|
+
* @returns Relayer quote for a token transfer
|
|
12
|
+
*/
|
|
14
13
|
declare const getRelayerQuote: (client: SDKClient, params: QuoteRequestFromAmount, options?: RequestOptions) => Promise<LiFiStep>;
|
|
15
14
|
//#endregion
|
|
16
15
|
export { getRelayerQuote };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRelayerQuote.d.ts","names":[],"sources":["../../../src/actions/getRelayerQuote.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getRelayerQuote.d.ts","names":[],"sources":["../../../src/actions/getRelayerQuote.ts"],"mappings":";;;;;;;;;;;;cAqBa,kBACX,QAAQ,WACR,QAAQ,wBACR,UAAU,mBACT,QAAQ"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { SDKClient } from "../types/core.js";
|
|
2
2
|
import { RoutesRequest as RoutesRequest$1 } from "../types/actions.js";
|
|
3
3
|
import { RequestOptions, RoutesResponse } from "@lifi/types";
|
|
4
|
-
|
|
5
4
|
//#region src/actions/getRoutes.d.ts
|
|
6
5
|
/**
|
|
7
|
-
* Get a set of routes for a request that describes a transfer of tokens.
|
|
8
|
-
* @param client - The SDK client.
|
|
9
|
-
* @param params - A description of the transfer.
|
|
10
|
-
* @param options - Request options
|
|
11
|
-
* @returns The resulting routes that can be used to realize the described transfer of tokens.
|
|
12
|
-
* @throws {LiFiError} Throws a LiFiError if request fails.
|
|
13
|
-
*/
|
|
6
|
+
* Get a set of routes for a request that describes a transfer of tokens.
|
|
7
|
+
* @param client - The SDK client.
|
|
8
|
+
* @param params - A description of the transfer.
|
|
9
|
+
* @param options - Request options
|
|
10
|
+
* @returns The resulting routes that can be used to realize the described transfer of tokens.
|
|
11
|
+
* @throws {LiFiError} Throws a LiFiError if request fails.
|
|
12
|
+
*/
|
|
14
13
|
declare const getRoutes: (client: SDKClient, params: RoutesRequest$1, options?: RequestOptions) => Promise<RoutesResponse>;
|
|
15
14
|
//#endregion
|
|
16
15
|
export { getRoutes };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRoutes.d.ts","names":[],"sources":["../../../src/actions/getRoutes.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getRoutes.d.ts","names":[],"sources":["../../../src/actions/getRoutes.ts"],"mappings":";;;;;;;;;;;;cAgBa,YACX,QAAQ,WACR,QAAQ,iBACR,UAAU,mBACT,QAAQ"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { SDKClient } from "../types/core.js";
|
|
2
2
|
import { GetStatusRequestExtended } from "../types/actions.js";
|
|
3
3
|
import { RequestOptions, StatusResponse } from "@lifi/types";
|
|
4
|
-
|
|
5
4
|
//#region src/actions/getStatus.d.ts
|
|
6
5
|
/**
|
|
7
|
-
* Check the status of a transfer. For cross chain transfers, the "bridge" parameter is required.
|
|
8
|
-
* @param client - The SDK client
|
|
9
|
-
* @param params - Configuration of the requested status
|
|
10
|
-
* @param options - Request options.
|
|
11
|
-
* @throws {LiFiError} - Throws a LiFiError if request fails
|
|
12
|
-
* @returns Returns status response.
|
|
13
|
-
*/
|
|
6
|
+
* Check the status of a transfer. For cross chain transfers, the "bridge" parameter is required.
|
|
7
|
+
* @param client - The SDK client
|
|
8
|
+
* @param params - Configuration of the requested status
|
|
9
|
+
* @param options - Request options.
|
|
10
|
+
* @throws {LiFiError} - Throws a LiFiError if request fails
|
|
11
|
+
* @returns Returns status response.
|
|
12
|
+
*/
|
|
14
13
|
declare const getStatus: (client: SDKClient, params: GetStatusRequestExtended, options?: RequestOptions) => Promise<StatusResponse>;
|
|
15
14
|
//#endregion
|
|
16
15
|
export { getStatus };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getStatus.d.ts","names":[],"sources":["../../../src/actions/getStatus.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getStatus.d.ts","names":[],"sources":["../../../src/actions/getStatus.ts"],"mappings":";;;;;;;;;;;;cAea,YACX,QAAQ,WACR,QAAQ,0BACR,UAAU,mBACT,QAAQ"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { SDKClient } from "../types/core.js";
|
|
2
2
|
import { LiFiStepRequest } from "../types/actions.js";
|
|
3
3
|
import { LiFiStep, RequestOptions } from "@lifi/types";
|
|
4
|
-
|
|
5
4
|
//#region src/actions/getStepTransaction.d.ts
|
|
6
5
|
/**
|
|
7
|
-
* Get the transaction data for a single step of a route
|
|
8
|
-
* @param client - The SDK client
|
|
9
|
-
* @param step - The step object.
|
|
10
|
-
* @param options - Request options
|
|
11
|
-
* @returns The step populated with the transaction data.
|
|
12
|
-
* @throws {LiFiError} Throws a LiFiError if request fails.
|
|
13
|
-
*/
|
|
6
|
+
* Get the transaction data for a single step of a route
|
|
7
|
+
* @param client - The SDK client
|
|
8
|
+
* @param step - The step object.
|
|
9
|
+
* @param options - Request options
|
|
10
|
+
* @returns The step populated with the transaction data.
|
|
11
|
+
* @throws {LiFiError} Throws a LiFiError if request fails.
|
|
12
|
+
*/
|
|
14
13
|
declare const getStepTransaction: (client: SDKClient, step: LiFiStepRequest, options?: RequestOptions) => Promise<LiFiStep>;
|
|
15
14
|
//#endregion
|
|
16
15
|
export { getStepTransaction };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getStepTransaction.d.ts","names":[],"sources":["../../../src/actions/getStepTransaction.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getStepTransaction.d.ts","names":[],"sources":["../../../src/actions/getStepTransaction.ts"],"mappings":";;;;;;;;;;;;cAea,qBACX,QAAQ,WACR,MAAM,iBACN,UAAU,mBACT,QAAQ"}
|
|
@@ -16,10 +16,12 @@ const getStepTransaction = async (client, step, options) => {
|
|
|
16
16
|
let requestUrl = `${config.apiUrl}/advanced/stepTransaction`;
|
|
17
17
|
const jitoBundle = config.routeOptions?.jitoBundle;
|
|
18
18
|
const svmSponsor = config.routeOptions?.svmSponsor;
|
|
19
|
+
const svmPriorityFeeLevel = config.routeOptions?.svmPriorityFeeLevel;
|
|
19
20
|
if (step.action.fromChainId === ChainId.SOL) {
|
|
20
21
|
const queryParams = new URLSearchParams();
|
|
21
22
|
if (jitoBundle) queryParams.set("jitoBundle", jitoBundle.toString());
|
|
22
23
|
if (svmSponsor) queryParams.set("svmSponsor", svmSponsor);
|
|
24
|
+
if (svmPriorityFeeLevel) queryParams.set("svmPriorityFeeLevel", svmPriorityFeeLevel);
|
|
23
25
|
if (queryParams.size > 0) requestUrl = `${requestUrl}?${queryParams}`;
|
|
24
26
|
}
|
|
25
27
|
return await request(config, requestUrl, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getStepTransaction.js","names":[],"sources":["../../../src/actions/getStepTransaction.ts"],"sourcesContent":["import type { LiFiStep, RequestOptions } from '@lifi/types'\nimport { ChainId } from '@lifi/types'\nimport type { LiFiStepRequest } from '../types/actions.js'\nimport type { SDKClient } from '../types/core.js'\nimport { isStep } from '../utils/isStep.js'\nimport { request } from '../utils/request.js'\n\n/**\n * Get the transaction data for a single step of a route\n * @param client - The SDK client\n * @param step - The step object.\n * @param options - Request options\n * @returns The step populated with the transaction data.\n * @throws {LiFiError} Throws a LiFiError if request fails.\n */\nexport const getStepTransaction = async (\n client: SDKClient,\n step: LiFiStepRequest,\n options?: RequestOptions\n): Promise<LiFiStep> => {\n if (!isStep(step)) {\n // While the validation fails for some users we should not enforce it\n console.warn('SDK Validation: Invalid Step', step)\n }\n\n const { config } = client\n\n let requestUrl = `${config.apiUrl}/advanced/stepTransaction`\n const jitoBundle = config.routeOptions?.jitoBundle\n const svmSponsor = config.routeOptions?.svmSponsor\n\n if (step.action.fromChainId === ChainId.SOL) {\n const queryParams = new URLSearchParams()\n if (jitoBundle) {\n queryParams.set('jitoBundle', jitoBundle.toString())\n }\n if (svmSponsor) {\n queryParams.set('svmSponsor', svmSponsor)\n }\n if (queryParams.size > 0) {\n requestUrl = `${requestUrl}?${queryParams}`\n }\n }\n\n return await request<LiFiStep>(config, requestUrl, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(step),\n signal: options?.signal,\n })\n}\n"],"mappings":";;;;;;;;;;;;AAeA,MAAa,qBAAqB,OAChC,QACA,MACA,YACsB;CACtB,IAAI,CAAC,OAAO,IAAI,GAEd,QAAQ,KAAK,gCAAgC,IAAI;CAGnD,MAAM,EAAE,WAAW;CAEnB,IAAI,aAAa,GAAG,OAAO,OAAO;CAClC,MAAM,aAAa,OAAO,cAAc;CACxC,MAAM,aAAa,OAAO,cAAc;
|
|
1
|
+
{"version":3,"file":"getStepTransaction.js","names":[],"sources":["../../../src/actions/getStepTransaction.ts"],"sourcesContent":["import type { LiFiStep, RequestOptions } from '@lifi/types'\nimport { ChainId } from '@lifi/types'\nimport type { LiFiStepRequest } from '../types/actions.js'\nimport type { SDKClient } from '../types/core.js'\nimport { isStep } from '../utils/isStep.js'\nimport { request } from '../utils/request.js'\n\n/**\n * Get the transaction data for a single step of a route\n * @param client - The SDK client\n * @param step - The step object.\n * @param options - Request options\n * @returns The step populated with the transaction data.\n * @throws {LiFiError} Throws a LiFiError if request fails.\n */\nexport const getStepTransaction = async (\n client: SDKClient,\n step: LiFiStepRequest,\n options?: RequestOptions\n): Promise<LiFiStep> => {\n if (!isStep(step)) {\n // While the validation fails for some users we should not enforce it\n console.warn('SDK Validation: Invalid Step', step)\n }\n\n const { config } = client\n\n let requestUrl = `${config.apiUrl}/advanced/stepTransaction`\n const jitoBundle = config.routeOptions?.jitoBundle\n const svmSponsor = config.routeOptions?.svmSponsor\n const svmPriorityFeeLevel = config.routeOptions?.svmPriorityFeeLevel\n\n if (step.action.fromChainId === ChainId.SOL) {\n const queryParams = new URLSearchParams()\n if (jitoBundle) {\n queryParams.set('jitoBundle', jitoBundle.toString())\n }\n if (svmSponsor) {\n queryParams.set('svmSponsor', svmSponsor)\n }\n if (svmPriorityFeeLevel) {\n queryParams.set('svmPriorityFeeLevel', svmPriorityFeeLevel)\n }\n if (queryParams.size > 0) {\n requestUrl = `${requestUrl}?${queryParams}`\n }\n }\n\n return await request<LiFiStep>(config, requestUrl, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(step),\n signal: options?.signal,\n })\n}\n"],"mappings":";;;;;;;;;;;;AAeA,MAAa,qBAAqB,OAChC,QACA,MACA,YACsB;CACtB,IAAI,CAAC,OAAO,IAAI,GAEd,QAAQ,KAAK,gCAAgC,IAAI;CAGnD,MAAM,EAAE,WAAW;CAEnB,IAAI,aAAa,GAAG,OAAO,OAAO;CAClC,MAAM,aAAa,OAAO,cAAc;CACxC,MAAM,aAAa,OAAO,cAAc;CACxC,MAAM,sBAAsB,OAAO,cAAc;CAEjD,IAAI,KAAK,OAAO,gBAAgB,QAAQ,KAAK;EAC3C,MAAM,cAAc,IAAI,gBAAgB;EACxC,IAAI,YACF,YAAY,IAAI,cAAc,WAAW,SAAS,CAAC;EAErD,IAAI,YACF,YAAY,IAAI,cAAc,UAAU;EAE1C,IAAI,qBACF,YAAY,IAAI,uBAAuB,mBAAmB;EAE5D,IAAI,YAAY,OAAO,GACrB,aAAa,GAAG,WAAW,GAAG;CAElC;CAEA,OAAO,MAAM,QAAkB,QAAQ,YAAY;EACjD,QAAQ;EACR,SAAS,EACP,gBAAgB,mBAClB;EACA,MAAM,KAAK,UAAU,IAAI;EACzB,QAAQ,SAAS;CACnB,CAAC;AACH"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { SDKClient } from "../types/core.js";
|
|
2
2
|
import { ChainId, ChainKey, RequestOptions, TokenExtended } from "@lifi/types";
|
|
3
|
-
|
|
4
3
|
//#region src/actions/getToken.d.ts
|
|
5
4
|
/**
|
|
6
|
-
* Fetch information about a Token
|
|
7
|
-
* @param client - The SDK client
|
|
8
|
-
* @param chain - Id or key of the chain that contains the token
|
|
9
|
-
* @param token - Address or symbol of the token on the requested chain
|
|
10
|
-
* @param options - Request options
|
|
11
|
-
* @throws {LiFiError} - Throws a LiFiError if request fails
|
|
12
|
-
* @returns Token information
|
|
13
|
-
*/
|
|
5
|
+
* Fetch information about a Token
|
|
6
|
+
* @param client - The SDK client
|
|
7
|
+
* @param chain - Id or key of the chain that contains the token
|
|
8
|
+
* @param token - Address or symbol of the token on the requested chain
|
|
9
|
+
* @param options - Request options
|
|
10
|
+
* @throws {LiFiError} - Throws a LiFiError if request fails
|
|
11
|
+
* @returns Token information
|
|
12
|
+
*/
|
|
14
13
|
declare const getToken: (client: SDKClient, chain: ChainKey | ChainId, token: string, options?: RequestOptions) => Promise<TokenExtended>;
|
|
15
14
|
//#endregion
|
|
16
15
|
export { getToken };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getToken.d.ts","names":[],"sources":["../../../src/actions/getToken.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getToken.d.ts","names":[],"sources":["../../../src/actions/getToken.ts"],"mappings":";;;;;;;;;;;;cAoBa,WACX,QAAQ,WACR,OAAO,WAAW,SAClB,eACA,UAAU,mBACT,QAAQ"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { SDKClient } from "../types/core.js";
|
|
2
2
|
import { Token, TokenAmount } from "@lifi/types";
|
|
3
|
-
|
|
4
3
|
//#region src/actions/getTokenBalance.d.ts
|
|
5
4
|
/**
|
|
6
|
-
* Returns the balances of a specific token a wallet holds across all aggregated chains.
|
|
7
|
-
* @param client - The SDK client.
|
|
8
|
-
* @param walletAddress - A wallet address.
|
|
9
|
-
* @param token - A Token object.
|
|
10
|
-
* @returns An object containing the token and the amounts on different chains.
|
|
11
|
-
* @throws {ValidationError} Throws a ValidationError if validation fails.
|
|
12
|
-
* @throws {Error} Throws an Error if the SDK Provider for the wallet address is not found.
|
|
13
|
-
*/
|
|
5
|
+
* Returns the balances of a specific token a wallet holds across all aggregated chains.
|
|
6
|
+
* @param client - The SDK client.
|
|
7
|
+
* @param walletAddress - A wallet address.
|
|
8
|
+
* @param token - A Token object.
|
|
9
|
+
* @returns An object containing the token and the amounts on different chains.
|
|
10
|
+
* @throws {ValidationError} Throws a ValidationError if validation fails.
|
|
11
|
+
* @throws {Error} Throws an Error if the SDK Provider for the wallet address is not found.
|
|
12
|
+
*/
|
|
14
13
|
declare const getTokenBalance: (client: SDKClient, walletAddress: string, token: Token) => Promise<TokenAmount | null>;
|
|
15
14
|
//#endregion
|
|
16
15
|
export { getTokenBalance };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTokenBalance.d.ts","names":[],"sources":["../../../src/actions/getTokenBalance.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getTokenBalance.d.ts","names":[],"sources":["../../../src/actions/getTokenBalance.ts"],"mappings":";;;;;;;;;;;;cAaa,kBACX,QAAQ,WACR,uBACA,OAAO,UACN,QAAQ"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { SDKClient } from "../types/core.js";
|
|
2
2
|
import { Token, TokenAmount } from "@lifi/types";
|
|
3
|
-
|
|
4
3
|
//#region src/actions/getTokenBalances.d.ts
|
|
5
4
|
/**
|
|
6
|
-
* Returns the balances for a list tokens a wallet holds across all aggregated chains.
|
|
7
|
-
* @param client - The SDK client.
|
|
8
|
-
* @param walletAddress - A wallet address.
|
|
9
|
-
* @param tokens - A list of Token (or TokenExtended) objects.
|
|
10
|
-
* @returns A list of objects containing the tokens and the amounts on different chains.
|
|
11
|
-
* @throws {ValidationError} Throws a ValidationError if validation fails.
|
|
12
|
-
* @throws {Error} Throws an Error if the SDK Provider for the wallet address is not found.
|
|
13
|
-
*/
|
|
5
|
+
* Returns the balances for a list tokens a wallet holds across all aggregated chains.
|
|
6
|
+
* @param client - The SDK client.
|
|
7
|
+
* @param walletAddress - A wallet address.
|
|
8
|
+
* @param tokens - A list of Token (or TokenExtended) objects.
|
|
9
|
+
* @returns A list of objects containing the tokens and the amounts on different chains.
|
|
10
|
+
* @throws {ValidationError} Throws a ValidationError if validation fails.
|
|
11
|
+
* @throws {Error} Throws an Error if the SDK Provider for the wallet address is not found.
|
|
12
|
+
*/
|
|
14
13
|
declare function getTokenBalances(client: SDKClient, walletAddress: string, tokens: Token[]): Promise<TokenAmount[]>;
|
|
15
14
|
//#endregion
|
|
16
15
|
export { getTokenBalances };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTokenBalances.d.ts","names":[],"sources":["../../../src/actions/getTokenBalances.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getTokenBalances.d.ts","names":[],"sources":["../../../src/actions/getTokenBalances.ts"],"mappings":";;;;;;;;;;;;iBAkBsB,iBACpB,QAAQ,WACR,uBACA,QAAQ,UACP,QAAQ"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { SDKClient } from "../types/core.js";
|
|
2
2
|
import { Token, TokenAmount } from "@lifi/types";
|
|
3
|
-
|
|
4
3
|
//#region src/actions/getTokenBalancesByChain.d.ts
|
|
5
4
|
/**
|
|
6
|
-
* This method queries the balances of tokens for a specific list of chains for a given wallet.
|
|
7
|
-
* @param client - The SDK client.
|
|
8
|
-
* @param walletAddress - A wallet address.
|
|
9
|
-
* @param tokensByChain - A list of token objects organized by chain ids.
|
|
10
|
-
* @returns A list of objects containing the tokens and the amounts on different chains organized by the chosen chains.
|
|
11
|
-
* @throws {ValidationError} Throws a ValidationError if validation fails.
|
|
12
|
-
* @throws {Error} Throws an Error if the SDK Provider for the wallet address is not found.
|
|
13
|
-
*/
|
|
5
|
+
* This method queries the balances of tokens for a specific list of chains for a given wallet.
|
|
6
|
+
* @param client - The SDK client.
|
|
7
|
+
* @param walletAddress - A wallet address.
|
|
8
|
+
* @param tokensByChain - A list of token objects organized by chain ids.
|
|
9
|
+
* @returns A list of objects containing the tokens and the amounts on different chains organized by the chosen chains.
|
|
10
|
+
* @throws {ValidationError} Throws a ValidationError if validation fails.
|
|
11
|
+
* @throws {Error} Throws an Error if the SDK Provider for the wallet address is not found.
|
|
12
|
+
*/
|
|
14
13
|
declare function getTokenBalancesByChain(client: SDKClient, walletAddress: string, tokensByChain: {
|
|
15
14
|
[chainId: number]: Token[];
|
|
16
15
|
}): Promise<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTokenBalancesByChain.d.ts","names":[],"sources":["../../../src/actions/getTokenBalancesByChain.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getTokenBalancesByChain.d.ts","names":[],"sources":["../../../src/actions/getTokenBalancesByChain.ts"],"mappings":";;;;;;;;;;;;iBAmBsB,wBACpB,QAAQ,WACR,uBACA;GAAoC,kBAAA;IACnC;GAA6B,kBAAA"}
|
|
@@ -10,8 +10,10 @@ async function getTokenBalancesByChain(client, walletAddress, tokensByChain) {
|
|
|
10
10
|
const tokenAmountsSettled = await Promise.allSettled(Object.keys(tokensByChain).map(async (chainIdStr) => {
|
|
11
11
|
const chainId = Number.parseInt(chainIdStr, 10);
|
|
12
12
|
const chain = await client.getChainById(chainId);
|
|
13
|
-
if (provider.type === chain.chainType)
|
|
14
|
-
|
|
13
|
+
if (provider.type === chain.chainType) {
|
|
14
|
+
const tokenAmounts = await provider.getBalance(client, walletAddress, tokensByChain[chainId]);
|
|
15
|
+
tokenAmountsByChain[chainId] = tokenAmounts;
|
|
16
|
+
} else tokenAmountsByChain[chainId] = tokensByChain[chainId];
|
|
15
17
|
}));
|
|
16
18
|
if (client.config.debug) {
|
|
17
19
|
for (const result of tokenAmountsSettled) if (result.status === "rejected") console.warn("Couldn't fetch token balance.", result.reason);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTokenBalancesByChain.js","names":[],"sources":["../../../src/actions/getTokenBalancesByChain.ts"],"sourcesContent":["import type {\n Token,\n TokenAmount,\n TokenAmountExtended,\n TokenExtended,\n} from '@lifi/types'\nimport { ValidationError } from '../errors/errors.js'\nimport type { SDKClient } from '../types/core.js'\nimport { isToken } from '../utils/isToken.js'\n\n/**\n * This method queries the balances of tokens for a specific list of chains for a given wallet.\n * @param client - The SDK client.\n * @param walletAddress - A wallet address.\n * @param tokensByChain - A list of token objects organized by chain ids.\n * @returns A list of objects containing the tokens and the amounts on different chains organized by the chosen chains.\n * @throws {ValidationError} Throws a ValidationError if validation fails.\n * @throws {Error} Throws an Error if the SDK Provider for the wallet address is not found.\n */\nexport async function getTokenBalancesByChain(\n client: SDKClient,\n walletAddress: string,\n tokensByChain: { [chainId: number]: Token[] }\n): Promise<{ [chainId: number]: TokenAmount[] }>\nexport async function getTokenBalancesByChain(\n client: SDKClient,\n walletAddress: string,\n tokensByChain: { [chainId: number]: TokenExtended[] }\n): Promise<{ [chainId: number]: TokenAmountExtended[] }> {\n if (!walletAddress) {\n throw new ValidationError('Missing walletAddress.')\n }\n\n const tokenList = Object.values(tokensByChain).flat()\n const invalidTokens = tokenList.filter((token) => !isToken(token))\n if (invalidTokens.length) {\n throw new ValidationError('Invalid tokens passed.')\n }\n\n const provider = client.providers.find((provider) =>\n provider.isAddress(walletAddress)\n )\n if (!provider) {\n throw new Error(`SDK Token Provider for ${walletAddress} is not found.`)\n }\n\n const tokenAmountsByChain: {\n [chainId: number]: TokenAmount[] | TokenAmountExtended[]\n } = {}\n const tokenAmountsSettled = await Promise.allSettled(\n Object.keys(tokensByChain).map(async (chainIdStr) => {\n const chainId = Number.parseInt(chainIdStr, 10)\n const chain = await client.getChainById(chainId)\n if (provider.type === chain.chainType) {\n const tokenAmounts = await provider.getBalance(\n client,\n walletAddress,\n tokensByChain[chainId]\n )\n tokenAmountsByChain[chainId] = tokenAmounts\n } else {\n // if the provider is not the same as the chain type,\n // return the tokens as is\n tokenAmountsByChain[chainId] = tokensByChain[chainId]\n }\n })\n )\n if (client.config.debug) {\n for (const result of tokenAmountsSettled) {\n if (result.status === 'rejected') {\n console.warn(\"Couldn't fetch token balance.\", result.reason)\n }\n }\n }\n return tokenAmountsByChain\n}\n"],"mappings":";;;AAwBA,eAAsB,wBACpB,QACA,eACA,eACuD;CACvD,IAAI,CAAC,eACH,MAAM,IAAI,gBAAgB,wBAAwB;CAKpD,IAFkB,OAAO,OAAO,aAAa,CAAC,CAAC,KACjB,CAAC,CAAC,QAAQ,UAAU,CAAC,QAAQ,KAAK,CAChD,CAAC,CAAC,QAChB,MAAM,IAAI,gBAAgB,wBAAwB;CAGpD,MAAM,WAAW,OAAO,UAAU,MAAM,aACtC,SAAS,UAAU,aAAa,CAClC;CACA,IAAI,CAAC,UACH,MAAM,IAAI,MAAM,0BAA0B,cAAc,eAAe;CAGzE,MAAM,sBAEF,CAAC;CACL,MAAM,sBAAsB,MAAM,QAAQ,WACxC,OAAO,KAAK,aAAa,CAAC,CAAC,IAAI,OAAO,eAAe;EACnD,MAAM,UAAU,OAAO,SAAS,YAAY,EAAE;EAC9C,MAAM,QAAQ,MAAM,OAAO,aAAa,OAAO;EAC/C,IAAI,SAAS,SAAS,MAAM,
|
|
1
|
+
{"version":3,"file":"getTokenBalancesByChain.js","names":[],"sources":["../../../src/actions/getTokenBalancesByChain.ts"],"sourcesContent":["import type {\n Token,\n TokenAmount,\n TokenAmountExtended,\n TokenExtended,\n} from '@lifi/types'\nimport { ValidationError } from '../errors/errors.js'\nimport type { SDKClient } from '../types/core.js'\nimport { isToken } from '../utils/isToken.js'\n\n/**\n * This method queries the balances of tokens for a specific list of chains for a given wallet.\n * @param client - The SDK client.\n * @param walletAddress - A wallet address.\n * @param tokensByChain - A list of token objects organized by chain ids.\n * @returns A list of objects containing the tokens and the amounts on different chains organized by the chosen chains.\n * @throws {ValidationError} Throws a ValidationError if validation fails.\n * @throws {Error} Throws an Error if the SDK Provider for the wallet address is not found.\n */\nexport async function getTokenBalancesByChain(\n client: SDKClient,\n walletAddress: string,\n tokensByChain: { [chainId: number]: Token[] }\n): Promise<{ [chainId: number]: TokenAmount[] }>\nexport async function getTokenBalancesByChain(\n client: SDKClient,\n walletAddress: string,\n tokensByChain: { [chainId: number]: TokenExtended[] }\n): Promise<{ [chainId: number]: TokenAmountExtended[] }> {\n if (!walletAddress) {\n throw new ValidationError('Missing walletAddress.')\n }\n\n const tokenList = Object.values(tokensByChain).flat()\n const invalidTokens = tokenList.filter((token) => !isToken(token))\n if (invalidTokens.length) {\n throw new ValidationError('Invalid tokens passed.')\n }\n\n const provider = client.providers.find((provider) =>\n provider.isAddress(walletAddress)\n )\n if (!provider) {\n throw new Error(`SDK Token Provider for ${walletAddress} is not found.`)\n }\n\n const tokenAmountsByChain: {\n [chainId: number]: TokenAmount[] | TokenAmountExtended[]\n } = {}\n const tokenAmountsSettled = await Promise.allSettled(\n Object.keys(tokensByChain).map(async (chainIdStr) => {\n const chainId = Number.parseInt(chainIdStr, 10)\n const chain = await client.getChainById(chainId)\n if (provider.type === chain.chainType) {\n const tokenAmounts = await provider.getBalance(\n client,\n walletAddress,\n tokensByChain[chainId]\n )\n tokenAmountsByChain[chainId] = tokenAmounts\n } else {\n // if the provider is not the same as the chain type,\n // return the tokens as is\n tokenAmountsByChain[chainId] = tokensByChain[chainId]\n }\n })\n )\n if (client.config.debug) {\n for (const result of tokenAmountsSettled) {\n if (result.status === 'rejected') {\n console.warn(\"Couldn't fetch token balance.\", result.reason)\n }\n }\n }\n return tokenAmountsByChain\n}\n"],"mappings":";;;AAwBA,eAAsB,wBACpB,QACA,eACA,eACuD;CACvD,IAAI,CAAC,eACH,MAAM,IAAI,gBAAgB,wBAAwB;CAKpD,IAFkB,OAAO,OAAO,aAAa,CAAC,CAAC,KACjB,CAAC,CAAC,QAAQ,UAAU,CAAC,QAAQ,KAAK,CAChD,CAAC,CAAC,QAChB,MAAM,IAAI,gBAAgB,wBAAwB;CAGpD,MAAM,WAAW,OAAO,UAAU,MAAM,aACtC,SAAS,UAAU,aAAa,CAClC;CACA,IAAI,CAAC,UACH,MAAM,IAAI,MAAM,0BAA0B,cAAc,eAAe;CAGzE,MAAM,sBAEF,CAAC;CACL,MAAM,sBAAsB,MAAM,QAAQ,WACxC,OAAO,KAAK,aAAa,CAAC,CAAC,IAAI,OAAO,eAAe;EACnD,MAAM,UAAU,OAAO,SAAS,YAAY,EAAE;EAC9C,MAAM,QAAQ,MAAM,OAAO,aAAa,OAAO;EAC/C,IAAI,SAAS,SAAS,MAAM,WAAW;GACrC,MAAM,eAAe,MAAM,SAAS,WAClC,QACA,eACA,cAAc,QAChB;GACA,oBAAoB,WAAW;EACjC,OAGE,oBAAoB,WAAW,cAAc;CAEjD,CAAC,CACH;CACA,IAAI,OAAO,OAAO,OACX;OAAA,MAAM,UAAU,qBACnB,IAAI,OAAO,WAAW,YACpB,QAAQ,KAAK,iCAAiC,OAAO,MAAM;CAAA;CAIjE,OAAO;AACT"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { SDKClient } from "../types/core.js";
|
|
2
2
|
import { RequestOptions, TokensExtendedResponse, TokensRequest, TokensResponse } from "@lifi/types";
|
|
3
|
-
|
|
4
3
|
//#region src/actions/getTokens.d.ts
|
|
5
4
|
/**
|
|
6
|
-
* Get all known tokens.
|
|
7
|
-
* @param client - The SDK client
|
|
8
|
-
* @param params - The configuration of the requested tokens
|
|
9
|
-
* @param options - Request options
|
|
10
|
-
* @returns The tokens that are available on the requested chains
|
|
11
|
-
*/
|
|
5
|
+
* Get all known tokens.
|
|
6
|
+
* @param client - The SDK client
|
|
7
|
+
* @param params - The configuration of the requested tokens
|
|
8
|
+
* @param options - Request options
|
|
9
|
+
* @returns The tokens that are available on the requested chains
|
|
10
|
+
*/
|
|
12
11
|
declare function getTokens(client: SDKClient, params?: TokensRequest & {
|
|
13
12
|
extended?: false | undefined;
|
|
14
13
|
}, options?: RequestOptions): Promise<TokensResponse>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTokens.d.ts","names":[],"sources":["../../../src/actions/getTokens.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getTokens.d.ts","names":[],"sources":["../../../src/actions/getTokens.ts"],"mappings":";;;;;;;;;;iBAiBsB,UACpB,QAAQ,WACR,SAAS;EAAkB;GAC3B,UAAU,iBACT,QAAQ;iBACW,UACpB,QAAQ,WACR,QAAQ;EAAkB;GAC1B,UAAU,iBACT,QAAQ"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { SDKClient } from "../types/core.js";
|
|
2
2
|
import { RequestOptions, ToolsRequest, ToolsResponse } from "@lifi/types";
|
|
3
|
-
|
|
4
3
|
//#region src/actions/getTools.d.ts
|
|
5
4
|
/**
|
|
6
|
-
* Get the available tools to bridge and swap tokens.
|
|
7
|
-
* @param client - The SDK client
|
|
8
|
-
* @param params - The configuration of the requested tools
|
|
9
|
-
* @param options - Request options
|
|
10
|
-
* @returns The tools that are available on the requested chains
|
|
11
|
-
*/
|
|
5
|
+
* Get the available tools to bridge and swap tokens.
|
|
6
|
+
* @param client - The SDK client
|
|
7
|
+
* @param params - The configuration of the requested tools
|
|
8
|
+
* @param options - Request options
|
|
9
|
+
* @returns The tools that are available on the requested chains
|
|
10
|
+
*/
|
|
12
11
|
declare const getTools: (client: SDKClient, params?: ToolsRequest, options?: RequestOptions) => Promise<ToolsResponse>;
|
|
13
12
|
//#endregion
|
|
14
13
|
export { getTools };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTools.d.ts","names":[],"sources":["../../../src/actions/getTools.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getTools.d.ts","names":[],"sources":["../../../src/actions/getTools.ts"],"mappings":";;;;;;;;;;cAWa,WACX,QAAQ,WACR,SAAS,cACT,UAAU,mBACT,QAAQ"}
|