@lifi/sdk 4.0.1 → 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 +20 -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/getQuote.js +2 -1
- package/dist/cjs/actions/getQuote.js.map +1 -1
- 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 +10 -10
- package/dist/cjs/actions/getRoutes.js.map +1 -1
- package/dist/cjs/actions/getStatus.d.ts +7 -8
- package/dist/cjs/actions/getStepTransaction.d.ts +10 -10
- 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 +115 -113
- 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/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/httpError.js +1 -1
- package/dist/cjs/errors/httpError.js.map +1 -1
- package/dist/cjs/errors/utils/baseErrorRootCause.d.ts +0 -1
- package/dist/cjs/index.d.ts +2 -1
- package/dist/cjs/types/actions.d.ts +23 -3
- 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/isStep.js +2 -1
- package/dist/cjs/utils/isStep.js.map +1 -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/toQueryString.d.ts +5 -0
- package/dist/cjs/utils/toQueryString.js +17 -0
- package/dist/cjs/utils/toQueryString.js.map +1 -0
- 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/getQuote.js +2 -1
- package/dist/esm/actions/getQuote.js.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 +10 -10
- package/dist/esm/actions/getRoutes.d.ts.map +1 -1
- package/dist/esm/actions/getRoutes.js.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 +10 -10
- 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 +115 -113
- package/dist/esm/actions/index.d.ts.map +1 -1
- 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/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/httpError.js +1 -1
- package/dist/esm/errors/httpError.js.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 +2 -1
- package/dist/esm/types/actions.d.ts +23 -3
- 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/isStep.js +2 -1
- package/dist/esm/utils/isStep.js.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 +5 -0
- package/dist/esm/utils/toQueryString.d.ts.map +1 -0
- package/dist/esm/utils/toQueryString.js +16 -0
- package/dist/esm/utils/toQueryString.js.map +1 -0
- 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/getQuote.ts +3 -2
- package/src/actions/getRoutes.ts +2 -1
- package/src/actions/getStepTransaction.ts +7 -2
- package/src/actions/index.ts +8 -5
- package/src/index.ts +7 -0
- package/src/types/actions.ts +29 -0
- package/src/utils/isStep.ts +4 -1
- package/src/utils/toQueryString.ts +35 -0
- package/src/version.ts +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
//#region src/utils/waitForResult.d.ts
|
|
2
2
|
/**
|
|
3
|
-
* Repeatedly calls a given asynchronous function until it resolves with a value
|
|
4
|
-
* @param fn The function that should be repeated
|
|
5
|
-
* @param interval The timeout in milliseconds between retries, or a function that receives the current poll count and returns the interval. Defaults to 5000
|
|
6
|
-
* @param maxRetries Maximum number of retries before throwing an error, defaults to 3
|
|
7
|
-
* @param shouldRetry Optional predicate to determine if an error should trigger a retry
|
|
8
|
-
* @returns The result of the fn function
|
|
9
|
-
* @throws Error if maximum retries is reached, if function keeps returning undefined, or if shouldRetry returns false
|
|
10
|
-
*/
|
|
3
|
+
* Repeatedly calls a given asynchronous function until it resolves with a value
|
|
4
|
+
* @param fn The function that should be repeated
|
|
5
|
+
* @param interval The timeout in milliseconds between retries, or a function that receives the current poll count and returns the interval. Defaults to 5000
|
|
6
|
+
* @param maxRetries Maximum number of retries before throwing an error, defaults to 3
|
|
7
|
+
* @param shouldRetry Optional predicate to determine if an error should trigger a retry
|
|
8
|
+
* @returns The result of the fn function
|
|
9
|
+
* @throws Error if maximum retries is reached, if function keeps returning undefined, or if shouldRetry returns false
|
|
10
|
+
*/
|
|
11
11
|
declare const waitForResult: <T>(fn: () => Promise<T | undefined>, interval?: number | ((poll: number) => number), maxRetries?: number, shouldRetry?: (count: number, error: unknown) => boolean) => Promise<T>;
|
|
12
12
|
//#endregion
|
|
13
13
|
export { waitForResult };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
//#region src/utils/withDedupe.d.ts
|
|
2
2
|
/**
|
|
3
|
-
* Map with a LRU (Least recently used) policy.
|
|
4
|
-
*
|
|
5
|
-
* https://en.wikipedia.org/wiki/Cache_replacement_policies#LRU
|
|
6
|
-
*/
|
|
3
|
+
* Map with a LRU (Least recently used) policy.
|
|
4
|
+
*
|
|
5
|
+
* https://en.wikipedia.org/wiki/Cache_replacement_policies#LRU
|
|
6
|
+
*/
|
|
7
7
|
declare class LruMap<value = unknown> extends Map<string, value> {
|
|
8
8
|
maxSize: number;
|
|
9
9
|
constructor(size: number);
|
|
@@ -14,10 +14,7 @@ type WithDedupeOptions = {
|
|
|
14
14
|
id?: string | undefined;
|
|
15
15
|
};
|
|
16
16
|
/** Deduplicates in-flight promises. */
|
|
17
|
-
declare function withDedupe<T>(fn: () => Promise<T>, {
|
|
18
|
-
enabled,
|
|
19
|
-
id
|
|
20
|
-
}: WithDedupeOptions): Promise<T>;
|
|
17
|
+
declare function withDedupe<T>(fn: () => Promise<T>, { enabled, id }: WithDedupeOptions): Promise<T>;
|
|
21
18
|
//#endregion
|
|
22
19
|
export { LruMap, withDedupe };
|
|
23
20
|
//# sourceMappingURL=withDedupe.d.ts.map
|
|
@@ -1,22 +1,16 @@
|
|
|
1
1
|
//#region src/utils/withTimeout.d.ts
|
|
2
2
|
/**
|
|
3
|
-
* Wraps a function in a timeout.
|
|
4
|
-
* Based on viem's withTimeout implementation.
|
|
5
|
-
* @param fn - The function to wrap.
|
|
6
|
-
* @param timeout - The timeout in milliseconds.
|
|
7
|
-
* @param errorInstance - The error instance to throw when the timeout is reached.
|
|
8
|
-
* @param signal - Whether or not the timeout should use an abort signal.
|
|
9
|
-
* @returns The result of the function.
|
|
10
|
-
*/
|
|
11
|
-
declare function withTimeout<T>(fn: ({
|
|
12
|
-
signal
|
|
13
|
-
}: {
|
|
3
|
+
* Wraps a function in a timeout.
|
|
4
|
+
* Based on viem's withTimeout implementation.
|
|
5
|
+
* @param fn - The function to wrap.
|
|
6
|
+
* @param timeout - The timeout in milliseconds.
|
|
7
|
+
* @param errorInstance - The error instance to throw when the timeout is reached.
|
|
8
|
+
* @param signal - Whether or not the timeout should use an abort signal.
|
|
9
|
+
* @returns The result of the function.
|
|
10
|
+
*/
|
|
11
|
+
declare function withTimeout<T>(fn: ({ signal }: {
|
|
14
12
|
signal: AbortController["signal"] | null;
|
|
15
|
-
}) => Promise<T>, {
|
|
16
|
-
errorInstance,
|
|
17
|
-
timeout,
|
|
18
|
-
signal
|
|
19
|
-
}: {
|
|
13
|
+
}) => Promise<T>, { errorInstance, timeout, signal }: {
|
|
20
14
|
errorInstance?: Error | undefined;
|
|
21
15
|
timeout: number;
|
|
22
16
|
signal?: boolean | undefined;
|
package/dist/cjs/version.d.ts
CHANGED
package/dist/cjs/version.js
CHANGED
package/dist/cjs/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","names":[],"sources":["../../src/version.ts"],"sourcesContent":["export const name = '@lifi/sdk'\nexport const version = '4.0
|
|
1
|
+
{"version":3,"file":"version.js","names":[],"sources":["../../src/version.ts"],"sourcesContent":["export const name = '@lifi/sdk'\nexport const version = '4.2.0'\n"],"mappings":";;AAAA,MAAa,OAAO;AACpB,MAAa,UAAU"}
|
|
@@ -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,6 +1,7 @@
|
|
|
1
1
|
import { ValidationError } from "../errors/errors.js";
|
|
2
2
|
import { SDKError } from "../errors/SDKError.js";
|
|
3
3
|
import { request } from "../utils/request.js";
|
|
4
|
+
import { toQueryString } from "../utils/toQueryString.js";
|
|
4
5
|
//#region src/actions/getQuote.ts
|
|
5
6
|
async function getQuote(client, params, options) {
|
|
6
7
|
for (const requiredParameter of [
|
|
@@ -26,7 +27,7 @@ async function getQuote(client, params, options) {
|
|
|
26
27
|
params.denyExchanges ??= client.config.routeOptions?.exchanges?.deny;
|
|
27
28
|
params.preferExchanges ??= client.config.routeOptions?.exchanges?.prefer;
|
|
28
29
|
for (const key of Object.keys(params)) if (params[key] === void 0 || params[key] === null) delete params[key];
|
|
29
|
-
return await request(client.config, `${client.config.apiUrl}/${isFromAmountRequest ? "quote" : "quote/toAmount"}?${
|
|
30
|
+
return await request(client.config, `${client.config.apiUrl}/${isFromAmountRequest ? "quote" : "quote/toAmount"}?${toQueryString(params)}`, { signal: options?.signal });
|
|
30
31
|
}
|
|
31
32
|
//#endregion
|
|
32
33
|
export { getQuote };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getQuote.js","names":[],"sources":["../../../src/actions/getQuote.ts"],"sourcesContent":["import type { LiFiStep, RequestOptions } from '@lifi/types'\nimport { ValidationError } from '../errors/errors.js'\nimport { SDKError } from '../errors/SDKError.js'\nimport type {\n QuoteRequest,\n QuoteRequestFromAmount,\n QuoteRequestToAmount,\n} from '../types/actions.js'\nimport type { SDKClient } from '../types/core.js'\nimport { request } from '../utils/request.js'\n\n/**\n * Get a quote for a token transfer\n * @param client - The SDK client\n * @param params - The configuration of the requested quote\n * @param options - Request options\n * @throws {LiFiError} - Throws a LiFiError if request fails\n * @returns Quote for a token transfer\n */\nexport async function getQuote(\n client: SDKClient,\n params: QuoteRequestFromAmount,\n options?: RequestOptions\n): Promise<LiFiStep>\nexport async function getQuote(\n client: SDKClient,\n params: QuoteRequestToAmount,\n options?: RequestOptions\n): Promise<LiFiStep>\nexport async function getQuote(\n client: SDKClient,\n params: QuoteRequest,\n options?: RequestOptions\n): Promise<LiFiStep> {\n const requiredParameters: Array<keyof QuoteRequest> = [\n 'fromChain',\n 'fromToken',\n 'fromAddress',\n 'toChain',\n 'toToken',\n ]\n\n for (const requiredParameter of requiredParameters) {\n if (!params[requiredParameter]) {\n throw new SDKError(\n new ValidationError(\n `Required parameter \"${requiredParameter}\" is missing.`\n )\n )\n }\n }\n\n const isFromAmountRequest =\n 'fromAmount' in params && params.fromAmount !== undefined\n const isToAmountRequest =\n 'toAmount' in params && params.toAmount !== undefined\n\n if (!isFromAmountRequest && !isToAmountRequest) {\n throw new SDKError(\n new ValidationError(\n 'Required parameter \"fromAmount\" or \"toAmount\" is missing.'\n )\n )\n }\n\n if (isFromAmountRequest && isToAmountRequest) {\n throw new SDKError(\n new ValidationError(\n 'Cannot provide both \"fromAmount\" and \"toAmount\" parameters.'\n )\n )\n }\n\n // apply defaults\n params.integrator ??= client.config.integrator\n params.order ??= client.config.routeOptions?.order\n params.slippage ??= client.config.routeOptions?.slippage\n params.referrer ??= client.config.routeOptions?.referrer\n params.fee ??= client.config.routeOptions?.fee\n params.allowBridges ??= client.config.routeOptions?.bridges?.allow\n params.denyBridges ??= client.config.routeOptions?.bridges?.deny\n params.preferBridges ??= client.config.routeOptions?.bridges?.prefer\n params.allowExchanges ??= client.config.routeOptions?.exchanges?.allow\n params.denyExchanges ??= client.config.routeOptions?.exchanges?.deny\n params.preferExchanges ??= client.config.routeOptions?.exchanges?.prefer\n\n for (const key of Object.keys(params)) {\n if (\n params[key as keyof QuoteRequest] === undefined ||\n params[key as keyof QuoteRequest] === null\n ) {\n delete params[key as keyof QuoteRequest]\n }\n }\n\n return await request<LiFiStep>(\n client.config,\n `${client.config.apiUrl}/${isFromAmountRequest ? 'quote' : 'quote/toAmount'}?${
|
|
1
|
+
{"version":3,"file":"getQuote.js","names":[],"sources":["../../../src/actions/getQuote.ts"],"sourcesContent":["import type { LiFiStep, RequestOptions } from '@lifi/types'\nimport { ValidationError } from '../errors/errors.js'\nimport { SDKError } from '../errors/SDKError.js'\nimport type {\n QuoteRequest,\n QuoteRequestFromAmount,\n QuoteRequestToAmount,\n} from '../types/actions.js'\nimport type { SDKClient } from '../types/core.js'\nimport { request } from '../utils/request.js'\nimport { toQueryString } from '../utils/toQueryString.js'\n\n/**\n * Get a quote for a token transfer\n * @param client - The SDK client\n * @param params - The configuration of the requested quote\n * @param options - Request options\n * @throws {LiFiError} - Throws a LiFiError if request fails\n * @returns Quote for a token transfer\n */\nexport async function getQuote(\n client: SDKClient,\n params: QuoteRequestFromAmount,\n options?: RequestOptions\n): Promise<LiFiStep>\nexport async function getQuote(\n client: SDKClient,\n params: QuoteRequestToAmount,\n options?: RequestOptions\n): Promise<LiFiStep>\nexport async function getQuote(\n client: SDKClient,\n params: QuoteRequest,\n options?: RequestOptions\n): Promise<LiFiStep> {\n const requiredParameters: Array<keyof QuoteRequest> = [\n 'fromChain',\n 'fromToken',\n 'fromAddress',\n 'toChain',\n 'toToken',\n ]\n\n for (const requiredParameter of requiredParameters) {\n if (!params[requiredParameter]) {\n throw new SDKError(\n new ValidationError(\n `Required parameter \"${requiredParameter}\" is missing.`\n )\n )\n }\n }\n\n const isFromAmountRequest =\n 'fromAmount' in params && params.fromAmount !== undefined\n const isToAmountRequest =\n 'toAmount' in params && params.toAmount !== undefined\n\n if (!isFromAmountRequest && !isToAmountRequest) {\n throw new SDKError(\n new ValidationError(\n 'Required parameter \"fromAmount\" or \"toAmount\" is missing.'\n )\n )\n }\n\n if (isFromAmountRequest && isToAmountRequest) {\n throw new SDKError(\n new ValidationError(\n 'Cannot provide both \"fromAmount\" and \"toAmount\" parameters.'\n )\n )\n }\n\n // apply defaults\n params.integrator ??= client.config.integrator\n params.order ??= client.config.routeOptions?.order\n params.slippage ??= client.config.routeOptions?.slippage\n params.referrer ??= client.config.routeOptions?.referrer\n params.fee ??= client.config.routeOptions?.fee\n params.allowBridges ??= client.config.routeOptions?.bridges?.allow\n params.denyBridges ??= client.config.routeOptions?.bridges?.deny\n params.preferBridges ??= client.config.routeOptions?.bridges?.prefer\n params.allowExchanges ??= client.config.routeOptions?.exchanges?.allow\n params.denyExchanges ??= client.config.routeOptions?.exchanges?.deny\n params.preferExchanges ??= client.config.routeOptions?.exchanges?.prefer\n\n for (const key of Object.keys(params)) {\n if (\n params[key as keyof QuoteRequest] === undefined ||\n params[key as keyof QuoteRequest] === null\n ) {\n delete params[key as keyof QuoteRequest]\n }\n }\n\n return await request<LiFiStep>(\n client.config,\n `${client.config.apiUrl}/${isFromAmountRequest ? 'quote' : 'quote/toAmount'}?${toQueryString(\n params as Record<string, unknown>\n )}`,\n {\n signal: options?.signal,\n }\n )\n}\n"],"mappings":";;;;;AA8BA,eAAsB,SACpB,QACA,QACA,SACmB;CASnB,KAAK,MAAM,qBAAqB;EAP9B;EACA;EACA;EACA;EACA;CAG+C,GAC/C,IAAI,CAAC,OAAO,oBACV,MAAM,IAAI,SACR,IAAI,gBACF,uBAAuB,kBAAkB,cAC3C,CACF;CAIJ,MAAM,sBACJ,gBAAgB,UAAU,OAAO,eAAe,KAAA;CAClD,MAAM,oBACJ,cAAc,UAAU,OAAO,aAAa,KAAA;CAE9C,IAAI,CAAC,uBAAuB,CAAC,mBAC3B,MAAM,IAAI,SACR,IAAI,gBACF,+DACF,CACF;CAGF,IAAI,uBAAuB,mBACzB,MAAM,IAAI,SACR,IAAI,gBACF,iEACF,CACF;CAIF,OAAO,eAAe,OAAO,OAAO;CACpC,OAAO,UAAU,OAAO,OAAO,cAAc;CAC7C,OAAO,aAAa,OAAO,OAAO,cAAc;CAChD,OAAO,aAAa,OAAO,OAAO,cAAc;CAChD,OAAO,QAAQ,OAAO,OAAO,cAAc;CAC3C,OAAO,iBAAiB,OAAO,OAAO,cAAc,SAAS;CAC7D,OAAO,gBAAgB,OAAO,OAAO,cAAc,SAAS;CAC5D,OAAO,kBAAkB,OAAO,OAAO,cAAc,SAAS;CAC9D,OAAO,mBAAmB,OAAO,OAAO,cAAc,WAAW;CACjE,OAAO,kBAAkB,OAAO,OAAO,cAAc,WAAW;CAChE,OAAO,oBAAoB,OAAO,OAAO,cAAc,WAAW;CAElE,KAAK,MAAM,OAAO,OAAO,KAAK,MAAM,GAClC,IACE,OAAO,SAA+B,KAAA,KACtC,OAAO,SAA+B,MAEtC,OAAO,OAAO;CAIlB,OAAO,MAAM,QACX,OAAO,QACP,GAAG,OAAO,OAAO,OAAO,GAAG,sBAAsB,UAAU,iBAAiB,GAAG,cAC7E,MACF,KACA,EACE,QAAQ,SAAS,OACnB,CACF;AACF"}
|
|
@@ -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,16 @@
|
|
|
1
1
|
import { SDKClient } from "../types/core.js";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { RoutesRequest as RoutesRequest$1 } from "../types/actions.js";
|
|
3
|
+
import { RequestOptions, RoutesResponse } from "@lifi/types";
|
|
4
4
|
//#region src/actions/getRoutes.d.ts
|
|
5
5
|
/**
|
|
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
|
-
*/
|
|
13
|
-
declare const getRoutes: (client: SDKClient, params: RoutesRequest, options?: RequestOptions) => Promise<RoutesResponse>;
|
|
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
|
+
*/
|
|
13
|
+
declare const getRoutes: (client: SDKClient, params: RoutesRequest$1, options?: RequestOptions) => Promise<RoutesResponse>;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { getRoutes };
|
|
16
16
|
//# sourceMappingURL=getRoutes.d.ts.map
|
|
@@ -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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRoutes.js","names":[],"sources":["../../../src/actions/getRoutes.ts"],"sourcesContent":["import type { RequestOptions,
|
|
1
|
+
{"version":3,"file":"getRoutes.js","names":[],"sources":["../../../src/actions/getRoutes.ts"],"sourcesContent":["import type { RequestOptions, RoutesResponse } from '@lifi/types'\nimport { ValidationError } from '../errors/errors.js'\nimport { SDKError } from '../errors/SDKError.js'\nimport type { RoutesRequest } from '../types/actions.js'\nimport type { SDKClient } from '../types/core.js'\nimport { isRoutesRequest } from '../utils/isRoutesRequest.js'\nimport { request } from '../utils/request.js'\n\n/**\n * Get a set of routes for a request that describes a transfer of tokens.\n * @param client - The SDK client.\n * @param params - A description of the transfer.\n * @param options - Request options\n * @returns The resulting routes that can be used to realize the described transfer of tokens.\n * @throws {LiFiError} Throws a LiFiError if request fails.\n */\nexport const getRoutes = async (\n client: SDKClient,\n params: RoutesRequest,\n options?: RequestOptions\n): Promise<RoutesResponse> => {\n if (!isRoutesRequest(params)) {\n throw new SDKError(new ValidationError('Invalid routes request.'))\n }\n // apply defaults\n params.options = {\n integrator: client.config.integrator,\n ...client.config.routeOptions,\n ...params.options,\n }\n\n return await request<RoutesResponse>(\n client.config,\n `${client.config.apiUrl}/advanced/routes`,\n {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(params),\n signal: options?.signal,\n }\n )\n}\n"],"mappings":";;;;;;;;;;;;;AAgBA,MAAa,YAAY,OACvB,QACA,QACA,YAC4B;CAC5B,IAAI,CAAC,gBAAgB,MAAM,GACzB,MAAM,IAAI,SAAS,IAAI,gBAAgB,yBAAyB,CAAC;CAGnE,OAAO,UAAU;EACf,YAAY,OAAO,OAAO;EAC1B,GAAG,OAAO,OAAO;EACjB,GAAG,OAAO;CACZ;CAEA,OAAO,MAAM,QACX,OAAO,QACP,GAAG,OAAO,OAAO,OAAO,mBACxB;EACE,QAAQ;EACR,SAAS,EACP,gBAAgB,mBAClB;EACA,MAAM,KAAK,UAAU,MAAM;EAC3B,QAAQ,SAAS;CACnB,CACF;AACF"}
|
|
@@ -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,16 @@
|
|
|
1
1
|
import { SDKClient } from "../types/core.js";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { LiFiStepRequest } from "../types/actions.js";
|
|
3
|
+
import { LiFiStep, RequestOptions } from "@lifi/types";
|
|
4
4
|
//#region src/actions/getStepTransaction.d.ts
|
|
5
5
|
/**
|
|
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
|
-
*/
|
|
13
|
-
declare const getStepTransaction: (client: SDKClient, step:
|
|
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
|
+
*/
|
|
13
|
+
declare const getStepTransaction: (client: SDKClient, step: LiFiStepRequest, options?: RequestOptions) => Promise<LiFiStep>;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { getStepTransaction };
|
|
16
16
|
//# sourceMappingURL=getStepTransaction.d.ts.map
|
|
@@ -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
|
|
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"}
|