@lifi/sdk 3.0.0-alpha.1 → 3.0.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/LiFi.js +222 -261
- package/dist/cjs/LiFi.js.map +1 -0
- package/dist/cjs/allowance/getAllowance.js +13 -16
- package/dist/cjs/allowance/getAllowance.js.map +1 -0
- package/dist/cjs/allowance/index.js +5 -17
- package/dist/cjs/allowance/index.js.map +1 -0
- package/dist/cjs/allowance/setAllowance.js +33 -18
- package/dist/cjs/allowance/setAllowance.js.map +1 -0
- package/dist/cjs/allowance/types.js +1 -0
- package/dist/cjs/allowance/types.js.map +1 -0
- package/dist/cjs/balance/getBalance.js +14 -14
- package/dist/cjs/balance/getBalance.js.map +1 -0
- package/dist/cjs/balance/getTokenBalance.js +3 -3
- package/dist/cjs/balance/getTokenBalance.js.map +1 -0
- package/dist/cjs/balance/index.js +4 -16
- package/dist/cjs/balance/index.js.map +1 -0
- package/dist/cjs/connectors.js +7 -35
- package/dist/cjs/connectors.js.map +1 -0
- package/dist/cjs/constants.js +2 -4
- package/dist/cjs/constants.js.map +1 -0
- package/dist/cjs/execution/BaseStepExecutor.js +54 -0
- package/dist/cjs/execution/BaseStepExecutor.js.map +1 -0
- package/dist/cjs/execution/EVMStepExecutor.js +271 -0
- package/dist/cjs/execution/EVMStepExecutor.js.map +1 -0
- package/dist/cjs/execution/RouteExecutionManager.js +196 -179
- package/dist/cjs/execution/RouteExecutionManager.js.map +1 -0
- package/dist/cjs/execution/StatusManager.js +142 -135
- package/dist/cjs/execution/StatusManager.js.map +1 -0
- package/dist/cjs/execution/StepExecutionManager.js +223 -229
- package/dist/cjs/execution/StepExecutionManager.js.map +1 -0
- package/dist/cjs/execution/checkAllowance.js +9 -10
- package/dist/cjs/execution/checkAllowance.js.map +1 -0
- package/dist/cjs/execution/checkBalance.js +5 -5
- package/dist/cjs/execution/checkBalance.js.map +1 -0
- package/dist/cjs/execution/index.js +4 -15
- package/dist/cjs/execution/index.js.map +1 -0
- package/dist/cjs/execution/multisig.js +6 -8
- package/dist/cjs/execution/multisig.js.map +1 -0
- package/dist/cjs/execution/prepareRestart.js +2 -44
- package/dist/cjs/execution/prepareRestart.js.map +1 -0
- package/dist/cjs/execution/stepComparison.js +5 -17
- package/dist/cjs/execution/stepComparison.js.map +1 -0
- package/dist/cjs/execution/switchChain.js +4 -21
- package/dist/cjs/execution/switchChain.js.map +1 -0
- package/dist/cjs/{types/internal.types.js → execution/types.js} +1 -0
- package/dist/cjs/execution/types.js.map +1 -0
- package/dist/cjs/execution/utils.js +1 -9
- package/dist/cjs/execution/utils.js.map +1 -0
- package/dist/cjs/execution/waitForReceivingTransaction.js +9 -11
- package/dist/cjs/execution/waitForReceivingTransaction.js.map +1 -0
- package/dist/cjs/helpers.js +11 -25
- package/dist/cjs/helpers.js.map +1 -0
- package/dist/cjs/index.js +16 -22
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/providers/EVM.js +35 -0
- package/dist/cjs/providers/EVM.js.map +1 -0
- package/dist/cjs/providers/Solana.js +38 -0
- package/dist/cjs/providers/Solana.js.map +1 -0
- package/dist/cjs/providers/index.js +5 -0
- package/dist/cjs/providers/index.js.map +1 -0
- package/dist/cjs/providers/types.js +9 -0
- package/dist/cjs/providers/types.js.map +1 -0
- package/dist/cjs/request.js +19 -16
- package/dist/cjs/request.js.map +1 -0
- package/dist/cjs/services/ApiService.js +72 -90
- package/dist/cjs/services/ApiService.js.map +1 -0
- package/dist/cjs/services/ChainsService.js +19 -9
- package/dist/cjs/services/ChainsService.js.map +1 -0
- package/dist/cjs/services/ConfigService.js +94 -65
- package/dist/cjs/services/ConfigService.js.map +1 -0
- package/dist/cjs/typeguards.js +1 -0
- package/dist/cjs/typeguards.js.map +1 -0
- package/dist/cjs/types/abi.js +1 -0
- package/dist/cjs/types/abi.js.map +1 -0
- package/dist/cjs/types/index.js +4 -20
- package/dist/cjs/types/index.js.map +1 -0
- package/dist/cjs/types/internal.js +3 -0
- package/dist/cjs/types/internal.js.map +1 -0
- package/dist/cjs/utils/errors.js +25 -3
- package/dist/cjs/utils/errors.js.map +1 -0
- package/dist/cjs/utils/getMaxPriorityFeePerGas.js +3 -2
- package/dist/cjs/utils/getMaxPriorityFeePerGas.js.map +1 -0
- package/dist/cjs/utils/index.js +7 -19
- package/dist/cjs/utils/index.js.map +1 -0
- package/dist/cjs/utils/median.js +1 -0
- package/dist/cjs/utils/median.js.map +1 -0
- package/dist/cjs/utils/parseError.js +39 -79
- package/dist/cjs/utils/parseError.js.map +1 -0
- package/dist/cjs/utils/utils.js +5 -11
- package/dist/cjs/utils/utils.js.map +1 -0
- package/dist/cjs/version.js +2 -1
- package/dist/cjs/version.js.map +1 -0
- package/dist/esm/LiFi.js +375 -0
- package/dist/esm/LiFi.js.map +1 -0
- package/dist/{allowance → esm/allowance}/getAllowance.js +5 -4
- package/dist/esm/allowance/getAllowance.js.map +1 -0
- package/dist/esm/allowance/index.js +4 -0
- package/dist/esm/allowance/index.js.map +1 -0
- package/dist/{allowance → esm/allowance}/setAllowance.js +28 -11
- package/dist/esm/allowance/setAllowance.js.map +1 -0
- package/dist/esm/allowance/types.js +2 -0
- package/dist/esm/allowance/types.js.map +1 -0
- package/dist/{balance → esm/balance}/getBalance.js +5 -5
- package/dist/esm/balance/getBalance.js.map +1 -0
- package/dist/{balance → esm/balance}/getTokenBalance.js +2 -1
- package/dist/esm/balance/getTokenBalance.js.map +1 -0
- package/dist/esm/balance/index.js +3 -0
- package/dist/esm/balance/index.js.map +1 -0
- package/dist/{connectors.js → esm/connectors.js} +3 -2
- package/dist/esm/connectors.js.map +1 -0
- package/dist/{constants.js → esm/constants.js} +1 -0
- package/dist/esm/constants.js.map +1 -0
- package/dist/esm/execution/BaseStepExecutor.js +51 -0
- package/dist/esm/execution/BaseStepExecutor.js.map +1 -0
- package/dist/esm/execution/EVMStepExecutor.js +299 -0
- package/dist/esm/execution/EVMStepExecutor.js.map +1 -0
- package/dist/esm/execution/RouteExecutionManager.js +268 -0
- package/dist/esm/execution/RouteExecutionManager.js.map +1 -0
- package/dist/esm/execution/StatusManager.js +216 -0
- package/dist/esm/execution/StatusManager.js.map +1 -0
- package/dist/esm/execution/StepExecutionManager.js +280 -0
- package/dist/esm/execution/StepExecutionManager.js.map +1 -0
- package/dist/{execution → esm/execution}/checkAllowance.js +5 -4
- package/dist/esm/execution/checkAllowance.js.map +1 -0
- package/dist/{execution → esm/execution}/checkBalance.js +3 -2
- package/dist/esm/execution/checkBalance.js.map +1 -0
- package/dist/esm/execution/index.js +3 -0
- package/dist/esm/execution/index.js.map +1 -0
- package/dist/{execution → esm/execution}/multisig.js +3 -2
- package/dist/esm/execution/multisig.js.map +1 -0
- package/dist/esm/execution/prepareRestart.js +64 -0
- package/dist/esm/execution/prepareRestart.js.map +1 -0
- package/dist/{execution → esm/execution}/stepComparison.js +4 -3
- package/dist/esm/execution/stepComparison.js.map +1 -0
- package/dist/{execution → esm/execution}/switchChain.js +3 -1
- package/dist/esm/execution/switchChain.js.map +1 -0
- package/dist/esm/execution/types.js +2 -0
- package/dist/esm/execution/types.js.map +1 -0
- package/dist/{execution → esm/execution}/utils.js +1 -0
- package/dist/esm/execution/utils.js.map +1 -0
- package/dist/{execution → esm/execution}/waitForReceivingTransaction.js +5 -4
- package/dist/esm/execution/waitForReceivingTransaction.js.map +1 -0
- package/dist/{helpers.js → esm/helpers.js} +4 -3
- package/dist/esm/helpers.js.map +1 -0
- package/dist/esm/index.js +10 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/package.json +1 -0
- package/dist/esm/providers/EVM.js +30 -0
- package/dist/esm/providers/EVM.js.map +1 -0
- package/dist/esm/providers/Solana.js +34 -0
- package/dist/esm/providers/Solana.js.map +1 -0
- package/dist/esm/providers/index.js +2 -0
- package/dist/esm/providers/index.js.map +1 -0
- package/dist/esm/providers/types.js +6 -0
- package/dist/esm/providers/types.js.map +1 -0
- package/dist/{request.js → esm/request.js} +16 -9
- package/dist/esm/request.js.map +1 -0
- package/dist/{services → esm/services}/ApiService.js +29 -28
- package/dist/esm/services/ApiService.js.map +1 -0
- package/dist/{services → esm/services}/ChainsService.js +16 -4
- package/dist/esm/services/ChainsService.js.map +1 -0
- package/dist/esm/services/ConfigService.js +143 -0
- package/dist/esm/services/ConfigService.js.map +1 -0
- package/dist/{typeguards.js → esm/typeguards.js} +1 -0
- package/dist/esm/typeguards.js.map +1 -0
- package/dist/{types → esm/types}/abi.js +1 -0
- package/dist/esm/types/abi.js.map +1 -0
- package/dist/esm/types/index.js +3 -0
- package/dist/esm/types/index.js.map +1 -0
- package/dist/esm/types/internal.js +2 -0
- package/dist/esm/types/internal.js.map +1 -0
- package/dist/{utils → esm/utils}/errors.js +25 -0
- package/dist/esm/utils/errors.js.map +1 -0
- package/dist/{utils → esm/utils}/getMaxPriorityFeePerGas.js +2 -1
- package/dist/esm/utils/getMaxPriorityFeePerGas.js.map +1 -0
- package/dist/esm/utils/index.js +6 -0
- package/dist/esm/utils/index.js.map +1 -0
- package/dist/{utils → esm/utils}/median.js +1 -0
- package/dist/esm/utils/median.js.map +1 -0
- package/dist/{utils → esm/utils}/parseError.js +4 -3
- package/dist/esm/utils/parseError.js.map +1 -0
- package/dist/{utils → esm/utils}/utils.js +2 -1
- package/dist/esm/utils/utils.js.map +1 -0
- package/dist/esm/version.js +3 -0
- package/dist/esm/version.js.map +1 -0
- package/dist/{LiFi.d.ts → types/LiFi.d.ts} +29 -21
- package/dist/types/LiFi.d.ts.map +1 -0
- package/dist/{cjs → types}/allowance/getAllowance.d.ts +2 -1
- package/dist/types/allowance/getAllowance.d.ts.map +1 -0
- package/dist/types/allowance/index.d.ts +4 -0
- package/dist/types/allowance/index.d.ts.map +1 -0
- package/dist/types/allowance/setAllowance.d.ts +7 -0
- package/dist/types/allowance/setAllowance.d.ts.map +1 -0
- package/dist/{allowance → types/allowance}/types.d.ts +1 -0
- package/dist/types/allowance/types.d.ts.map +1 -0
- package/dist/{balance → types/balance}/getBalance.d.ts +1 -0
- package/dist/types/balance/getBalance.d.ts.map +1 -0
- package/dist/{balance → types/balance}/getTokenBalance.d.ts +1 -0
- package/dist/types/balance/getTokenBalance.d.ts.map +1 -0
- package/dist/types/balance/index.d.ts +3 -0
- package/dist/types/balance/index.d.ts.map +1 -0
- package/dist/{cjs → types}/connectors.d.ts +2 -1
- package/dist/types/connectors.d.ts.map +1 -0
- package/dist/{cjs → types}/constants.d.ts +1 -0
- package/dist/types/constants.d.ts.map +1 -0
- package/dist/types/execution/BaseStepExecutor.d.ts +13 -0
- package/dist/types/execution/BaseStepExecutor.d.ts.map +1 -0
- package/dist/types/execution/EVMStepExecutor.d.ts +14 -0
- package/dist/types/execution/EVMStepExecutor.d.ts.map +1 -0
- package/dist/{cjs → types}/execution/RouteExecutionManager.d.ts +10 -8
- package/dist/types/execution/RouteExecutionManager.d.ts.map +1 -0
- package/dist/{execution → types/execution}/StatusManager.d.ts +9 -7
- package/dist/types/execution/StatusManager.d.ts.map +1 -0
- package/dist/{execution → types/execution}/StepExecutionManager.d.ts +4 -3
- package/dist/types/execution/StepExecutionManager.d.ts.map +1 -0
- package/dist/types/execution/checkAllowance.d.ts +6 -0
- package/dist/types/execution/checkAllowance.d.ts.map +1 -0
- package/dist/types/execution/checkBalance.d.ts +3 -0
- package/dist/types/execution/checkBalance.d.ts.map +1 -0
- package/dist/types/execution/index.d.ts +3 -0
- package/dist/types/execution/index.d.ts.map +1 -0
- package/dist/types/execution/multisig.d.ts +5 -0
- package/dist/types/execution/multisig.d.ts.map +1 -0
- package/dist/types/execution/prepareRestart.d.ts +3 -0
- package/dist/types/execution/prepareRestart.d.ts.map +1 -0
- package/dist/{cjs → types}/execution/stepComparison.d.ts +6 -4
- package/dist/types/execution/stepComparison.d.ts.map +1 -0
- package/dist/{cjs → types}/execution/switchChain.d.ts +6 -4
- package/dist/types/execution/switchChain.d.ts.map +1 -0
- package/dist/types/{internal.types.d.ts → execution/types.d.ts} +38 -98
- package/dist/types/execution/types.d.ts.map +1 -0
- package/dist/{execution → types/execution}/utils.d.ts +3 -2
- package/dist/types/execution/utils.d.ts.map +1 -0
- package/dist/types/execution/waitForReceivingTransaction.d.ts +4 -0
- package/dist/types/execution/waitForReceivingTransaction.d.ts.map +1 -0
- package/dist/{helpers.d.ts → types/helpers.d.ts} +4 -3
- package/dist/types/helpers.d.ts.map +1 -0
- package/dist/types/index.d.ts +9 -3
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/providers/EVM.d.ts +11 -0
- package/dist/types/providers/EVM.d.ts.map +1 -0
- package/dist/types/providers/Solana.d.ts +10 -0
- package/dist/types/providers/Solana.d.ts.map +1 -0
- package/dist/types/providers/index.d.ts +2 -0
- package/dist/types/providers/index.d.ts.map +1 -0
- package/dist/types/providers/types.d.ts +13 -0
- package/dist/types/providers/types.d.ts.map +1 -0
- package/dist/{request.d.ts → types/request.d.ts} +1 -0
- package/dist/types/request.d.ts.map +1 -0
- package/dist/{services → types/services}/ApiService.d.ts +5 -5
- package/dist/types/services/ApiService.d.ts.map +1 -0
- package/dist/{cjs → types}/services/ChainsService.d.ts +2 -1
- package/dist/types/services/ChainsService.d.ts.map +1 -0
- package/dist/{services → types/services}/ConfigService.d.ts +10 -6
- package/dist/types/services/ConfigService.d.ts.map +1 -0
- package/dist/{cjs → types}/typeguards.d.ts +3 -2
- package/dist/types/typeguards.d.ts.map +1 -0
- package/dist/{cjs → types}/types/abi.d.ts +1 -0
- package/dist/types/types/abi.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +3 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/dist/types/types/internal.d.ts +61 -0
- package/dist/types/types/internal.d.ts.map +1 -0
- package/dist/{cjs → types}/utils/errors.d.ts +1 -0
- package/dist/types/utils/errors.d.ts.map +1 -0
- package/dist/{cjs → types}/utils/getMaxPriorityFeePerGas.d.ts +1 -0
- package/dist/types/utils/getMaxPriorityFeePerGas.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +6 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/dist/{cjs → types}/utils/median.d.ts +1 -0
- package/dist/types/utils/median.d.ts.map +1 -0
- package/dist/{cjs → types}/utils/parseError.d.ts +6 -5
- package/dist/types/utils/parseError.d.ts.map +1 -0
- package/dist/{cjs → types}/utils/utils.d.ts +1 -0
- package/dist/types/utils/utils.d.ts.map +1 -0
- package/dist/types/version.d.ts +3 -0
- package/dist/types/version.d.ts.map +1 -0
- package/package.json +37 -96
- package/dist/LiFi.js +0 -246
- package/dist/allowance/getAllowance.d.ts +0 -6
- package/dist/allowance/index.d.ts +0 -3
- package/dist/allowance/index.js +0 -3
- package/dist/allowance/setAllowance.d.ts +0 -5
- package/dist/allowance/types.js +0 -1
- package/dist/balance/index.d.ts +0 -2
- package/dist/balance/index.js +0 -2
- package/dist/cjs/LiFi.d.ts +0 -171
- package/dist/cjs/allowance/index.d.ts +0 -3
- package/dist/cjs/allowance/setAllowance.d.ts +0 -5
- package/dist/cjs/allowance/types.d.ts +0 -27
- package/dist/cjs/balance/getBalance.d.ts +0 -2
- package/dist/cjs/balance/getTokenBalance.d.ts +0 -8
- package/dist/cjs/balance/index.d.ts +0 -2
- package/dist/cjs/execution/StatusManager.d.ts +0 -67
- package/dist/cjs/execution/StepExecutionManager.d.ts +0 -7
- package/dist/cjs/execution/StepExecutor.d.ts +0 -15
- package/dist/cjs/execution/StepExecutor.js +0 -62
- package/dist/cjs/execution/checkAllowance.d.ts +0 -4
- package/dist/cjs/execution/checkBalance.d.ts +0 -2
- package/dist/cjs/execution/index.d.ts +0 -1
- package/dist/cjs/execution/multisig.d.ts +0 -4
- package/dist/cjs/execution/prepareRestart.d.ts +0 -3
- package/dist/cjs/execution/utils.d.ts +0 -12
- package/dist/cjs/execution/waitForReceivingTransaction.d.ts +0 -3
- package/dist/cjs/helpers.d.ts +0 -18
- package/dist/cjs/index.d.ts +0 -5
- package/dist/cjs/request.d.ts +0 -9
- package/dist/cjs/services/ApiService.d.ts +0 -17
- package/dist/cjs/services/ConfigService.d.ts +0 -23
- package/dist/cjs/types/index.d.ts +0 -4
- package/dist/cjs/types/internal.types.d.ts +0 -143
- package/dist/cjs/utils/index.d.ts +0 -5
- package/dist/cjs/version.d.ts +0 -2
- package/dist/connectors.d.ts +0 -8
- package/dist/constants.d.ts +0 -6
- package/dist/execution/RouteExecutionManager.d.ts +0 -59
- package/dist/execution/RouteExecutionManager.js +0 -195
- package/dist/execution/StatusManager.js +0 -167
- package/dist/execution/StepExecutionManager.js +0 -260
- package/dist/execution/StepExecutor.d.ts +0 -15
- package/dist/execution/StepExecutor.js +0 -58
- package/dist/execution/checkAllowance.d.ts +0 -4
- package/dist/execution/checkBalance.d.ts +0 -2
- package/dist/execution/index.d.ts +0 -1
- package/dist/execution/index.js +0 -1
- package/dist/execution/multisig.d.ts +0 -4
- package/dist/execution/prepareRestart.d.ts +0 -3
- package/dist/execution/prepareRestart.js +0 -61
- package/dist/execution/stepComparison.d.ts +0 -14
- package/dist/execution/switchChain.d.ts +0 -21
- package/dist/execution/waitForReceivingTransaction.d.ts +0 -3
- package/dist/index.d.ts +0 -5
- package/dist/index.js +0 -6
- package/dist/services/ChainsService.d.ts +0 -11
- package/dist/services/ConfigService.js +0 -99
- package/dist/typeguards.d.ts +0 -4
- package/dist/types/abi.d.ts +0 -5
- package/dist/types/index.js +0 -4
- package/dist/types/internal.types.js +0 -1
- package/dist/utils/errors.d.ts +0 -107
- package/dist/utils/getMaxPriorityFeePerGas.d.ts +0 -2
- package/dist/utils/index.d.ts +0 -5
- package/dist/utils/index.js +0 -5
- package/dist/utils/median.d.ts +0 -1
- package/dist/utils/parseError.d.ts +0 -37
- package/dist/utils/utils.d.ts +0 -10
- package/dist/version.d.ts +0 -2
- package/dist/version.js +0 -2
package/dist/allowance/index.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { Hash, WalletClient } from 'viem';
|
|
2
|
-
import type { ApproveTokenRequest, RevokeApprovalRequest } from './types';
|
|
3
|
-
export declare const setAllowance: (walletClient: WalletClient, tokenAddress: string, contractAddress: string, amount: bigint, returnPopulatedTransaction?: boolean) => Promise<Hash>;
|
|
4
|
-
export declare const setTokenAllowance: ({ walletClient, token, spenderAddress, amount, infiniteApproval, }: ApproveTokenRequest) => Promise<Hash | undefined>;
|
|
5
|
-
export declare const revokeTokenApproval: ({ walletClient, token, spenderAddress, }: RevokeApprovalRequest) => Promise<Hash | undefined>;
|
package/dist/allowance/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/balance/index.d.ts
DELETED
package/dist/balance/index.js
DELETED
package/dist/cjs/LiFi.d.ts
DELETED
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
import type { ChainId, ChainKey, ConnectionsRequest, ConnectionsResponse, ContractCallQuoteRequest, ExtendedChain, GasRecommendationRequest, GasRecommendationResponse, GetStatusRequest, LifiStep, PossibilitiesRequest, PossibilitiesResponse, QuoteRequest, RequestOptions, RoutesRequest, RoutesResponse, StatusResponse, Token, TokenAmount, TokensRequest, TokensResponse, ToolsRequest, ToolsResponse } from '@lifi/types';
|
|
2
|
-
import type { Hash, PublicClient } from 'viem';
|
|
3
|
-
import type { ApproveTokenRequest, RevokeApprovalRequest, TokenAllowance, TokenSpender } from './allowance';
|
|
4
|
-
import { RouteExecutionManager } from './execution/RouteExecutionManager';
|
|
5
|
-
import type { Config, ConfigUpdate } from './types';
|
|
6
|
-
export declare class LiFi extends RouteExecutionManager {
|
|
7
|
-
private chainsService;
|
|
8
|
-
constructor(configUpdate: ConfigUpdate);
|
|
9
|
-
/**
|
|
10
|
-
* Get the current configuration of the SDK
|
|
11
|
-
* @returns - The config object
|
|
12
|
-
*/
|
|
13
|
-
getConfig: () => Config;
|
|
14
|
-
/**
|
|
15
|
-
* Get the SDK configuration after all setup calls are finished
|
|
16
|
-
* @returns - The config object
|
|
17
|
-
*/
|
|
18
|
-
getConfigAsync: () => Promise<Config>;
|
|
19
|
-
/**
|
|
20
|
-
* Get an instance of a provider for a specific chain
|
|
21
|
-
* @param chainId - Id of the chain the provider is for
|
|
22
|
-
* @returns The public client for the given chain
|
|
23
|
-
*/
|
|
24
|
-
getPublicClient: (chainId: number) => Promise<PublicClient>;
|
|
25
|
-
/**
|
|
26
|
-
* Set a new confuration for the SDK
|
|
27
|
-
* @param configUpdate - An object containing the configuration fields that should be updated.
|
|
28
|
-
* @returns The renewed config object
|
|
29
|
-
*/
|
|
30
|
-
setConfig: (configUpdate: Partial<ConfigUpdate>) => Config;
|
|
31
|
-
/**
|
|
32
|
-
* Get a set of current possibilities based on a request that specifies which chains, exchanges and bridges are preferred or unwanted.
|
|
33
|
-
* @param request - Object defining preferences regarding chain, exchanges and bridges
|
|
34
|
-
* @param options
|
|
35
|
-
* @returns Object listing current possibilities for any-to-any cross-chain-swaps based on the provided preferences.
|
|
36
|
-
* @throws {LiFiError} Throws a LiFiError if request fails.
|
|
37
|
-
* @deprecated We don't want to support this endpoint anymore in the future. /chains, /tools, /connections, and /tokens should be used instead
|
|
38
|
-
*/
|
|
39
|
-
getPossibilities: (request?: PossibilitiesRequest, options?: RequestOptions) => Promise<PossibilitiesResponse>;
|
|
40
|
-
/**
|
|
41
|
-
* Fetch information about a Token
|
|
42
|
-
* @param chain - Id or key of the chain that contains the token
|
|
43
|
-
* @param token - Address or symbol of the token on the requested chain
|
|
44
|
-
* @param options
|
|
45
|
-
* @throws {LiFiError} - Throws a LiFiError if request fails
|
|
46
|
-
*/
|
|
47
|
-
getToken: (chain: ChainKey | ChainId, token: string, options?: RequestOptions) => Promise<Token>;
|
|
48
|
-
/**
|
|
49
|
-
* Get a quote for a token transfer
|
|
50
|
-
* @param request - The configuration of the requested quote
|
|
51
|
-
* @param options
|
|
52
|
-
* @throws {LiFiError} - Throws a LiFiError if request fails
|
|
53
|
-
*/
|
|
54
|
-
getQuote: (request: QuoteRequest, options?: RequestOptions) => Promise<LifiStep>;
|
|
55
|
-
/**
|
|
56
|
-
* Get a quote for a destination contract call
|
|
57
|
-
* @param request - The configuration of the requested destination call
|
|
58
|
-
* @param options
|
|
59
|
-
* @throws {LiFiError} - Throws a LiFiError if request fails
|
|
60
|
-
* @returns - Returns step.
|
|
61
|
-
*/
|
|
62
|
-
getContractCallQuote: (request: ContractCallQuoteRequest, options?: RequestOptions) => Promise<LifiStep>;
|
|
63
|
-
/**
|
|
64
|
-
* Check the status of a transfer. For cross chain transfers, the "bridge" parameter is required.
|
|
65
|
-
* @param request - Configuration of the requested status
|
|
66
|
-
* @param options - Rrquest options.
|
|
67
|
-
* @throws {LiFiError} - Throws a LiFiError if request fails
|
|
68
|
-
* @returns Returns status response.
|
|
69
|
-
*/
|
|
70
|
-
getStatus: (request: GetStatusRequest, options?: RequestOptions) => Promise<StatusResponse>;
|
|
71
|
-
/**
|
|
72
|
-
* Get the available tools to bridge and swap tokens.
|
|
73
|
-
* @param request - The configuration of the requested tools
|
|
74
|
-
* @param options
|
|
75
|
-
* @returns The tools that are available on the requested chains
|
|
76
|
-
*/
|
|
77
|
-
getTools: (request?: ToolsRequest, options?: RequestOptions) => Promise<ToolsResponse>;
|
|
78
|
-
/**
|
|
79
|
-
* Get all known tokens.
|
|
80
|
-
* @param request - The configuration of the requested tokens
|
|
81
|
-
* @param options
|
|
82
|
-
* @returns The tokens that are available on the requested chains
|
|
83
|
-
*/
|
|
84
|
-
getTokens: (request?: TokensRequest, options?: RequestOptions) => Promise<TokensResponse>;
|
|
85
|
-
/**
|
|
86
|
-
* Get all available chains
|
|
87
|
-
* @returns A list of all available chains
|
|
88
|
-
* @throws {LiFiError} Throws a LiFiError if request fails.
|
|
89
|
-
*/
|
|
90
|
-
getChains: () => Promise<ExtendedChain[]>;
|
|
91
|
-
/**
|
|
92
|
-
* Get a set of routes for a request that describes a transfer of tokens.
|
|
93
|
-
* @param request - A description of the transfer.
|
|
94
|
-
* @param options
|
|
95
|
-
* @returns The resulting routes that can be used to realize the described transfer of tokens.
|
|
96
|
-
* @throws {LiFiError} Throws a LiFiError if request fails.
|
|
97
|
-
*/
|
|
98
|
-
getRoutes: (request: RoutesRequest, options?: RequestOptions) => Promise<RoutesResponse>;
|
|
99
|
-
/**
|
|
100
|
-
* Get the transaction data for a single step of a route
|
|
101
|
-
* @param step - The step object.
|
|
102
|
-
* @param options
|
|
103
|
-
* @returns The step populated with the transaction data.
|
|
104
|
-
* @throws {LiFiError} Throws a LiFiError if request fails.
|
|
105
|
-
*/
|
|
106
|
-
getStepTransaction: (step: LifiStep, options?: RequestOptions) => Promise<LifiStep>;
|
|
107
|
-
/**
|
|
108
|
-
* Get gas recommendation for a certain chain
|
|
109
|
-
* @param request - Configuration of the requested recommendation.
|
|
110
|
-
* @param options
|
|
111
|
-
* @throws {LiFiError} Throws a LiFiError if request fails.
|
|
112
|
-
*/
|
|
113
|
-
getGasRecommendation: (request: GasRecommendationRequest, options?: RequestOptions) => Promise<GasRecommendationResponse>;
|
|
114
|
-
/**
|
|
115
|
-
* Returns the balances of a specific token a wallet holds across all aggregated chains.
|
|
116
|
-
* @param walletAddress - A wallet address.
|
|
117
|
-
* @param token - A Token object.
|
|
118
|
-
* @returns An object containing the token and the amounts on different chains.
|
|
119
|
-
* @throws {ValidationError} Throws a ValidationError if parameters are invalid.
|
|
120
|
-
*/
|
|
121
|
-
getTokenBalance: (walletAddress: string, token: Token) => Promise<TokenAmount | null>;
|
|
122
|
-
/**
|
|
123
|
-
* Returns the balances for a list tokens a wallet holds across all aggregated chains.
|
|
124
|
-
* @param walletAddress - A wallet address.
|
|
125
|
-
* @param tokens - A list of Token objects.
|
|
126
|
-
* @returns A list of objects containing the tokens and the amounts on different chains.
|
|
127
|
-
* @throws {ValidationError} Throws a ValidationError if parameters are invalid.
|
|
128
|
-
*/
|
|
129
|
-
getTokenBalances: (walletAddress: string, tokens: Token[]) => Promise<TokenAmount[]>;
|
|
130
|
-
/**
|
|
131
|
-
* This method queries the balances of tokens for a specific list of chains for a given wallet.
|
|
132
|
-
* @param walletAddress - A walletaddress.
|
|
133
|
-
* @param tokensByChain - A list of Token objects organized by chain ids.
|
|
134
|
-
* @returns A list of objects containing the tokens and the amounts on different chains organized by the chosen chains.
|
|
135
|
-
* @throws {ValidationError} Throws a ValidationError if parameters are invalid.
|
|
136
|
-
*/
|
|
137
|
-
getTokenBalancesByChain: (walletAddress: string, tokensByChain: {
|
|
138
|
-
[chainId: number]: Token[];
|
|
139
|
-
}) => Promise<{
|
|
140
|
-
[chainId: number]: TokenAmount[];
|
|
141
|
-
}>;
|
|
142
|
-
/**
|
|
143
|
-
* Get the current allowance for a certain token.
|
|
144
|
-
* @param token - The token that should be checked
|
|
145
|
-
* @param ownerAddress - The owner of the token
|
|
146
|
-
* @param spenderAddress - The spender address that has to be approved
|
|
147
|
-
*/
|
|
148
|
-
getTokenAllowance: (token: Token, ownerAddress: string, spenderAddress: string) => Promise<bigint | undefined>;
|
|
149
|
-
/**
|
|
150
|
-
* Get the current allowance for a list of token / spender address pairs.
|
|
151
|
-
* @param ownerAddress - The owner of the tokens
|
|
152
|
-
* @param tokens - A list of token and spender address pairs
|
|
153
|
-
*/
|
|
154
|
-
getTokenAllowanceMulticall: (ownerAddress: string, tokens: TokenSpender[]) => Promise<TokenAllowance[]>;
|
|
155
|
-
/**
|
|
156
|
-
* Set approval for a certain token and amount.
|
|
157
|
-
* @param request - The approval request
|
|
158
|
-
*/
|
|
159
|
-
setTokenApproval: (request: ApproveTokenRequest) => Promise<Hash | void>;
|
|
160
|
-
/**
|
|
161
|
-
* Revoke approval for a certain token.
|
|
162
|
-
* @param request - The revoke request
|
|
163
|
-
*/
|
|
164
|
-
revokeTokenApproval: (request: RevokeApprovalRequest) => Promise<Hash | void>;
|
|
165
|
-
/**
|
|
166
|
-
* Get all the available connections for swap/bridging tokens
|
|
167
|
-
* @param connectionRequest ConnectionsRequest
|
|
168
|
-
* @returns ConnectionsResponse
|
|
169
|
-
*/
|
|
170
|
-
getConnections: (connectionRequest: ConnectionsRequest) => Promise<ConnectionsResponse>;
|
|
171
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { Hash, WalletClient } from 'viem';
|
|
2
|
-
import type { ApproveTokenRequest, RevokeApprovalRequest } from './types';
|
|
3
|
-
export declare const setAllowance: (walletClient: WalletClient, tokenAddress: string, contractAddress: string, amount: bigint, returnPopulatedTransaction?: boolean) => Promise<Hash>;
|
|
4
|
-
export declare const setTokenAllowance: ({ walletClient, token, spenderAddress, amount, infiniteApproval, }: ApproveTokenRequest) => Promise<Hash | undefined>;
|
|
5
|
-
export declare const revokeTokenApproval: ({ walletClient, token, spenderAddress, }: RevokeApprovalRequest) => Promise<Hash | undefined>;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { Token } from '@lifi/types';
|
|
2
|
-
import type { WalletClient } from 'viem';
|
|
3
|
-
export type TokenSpender = {
|
|
4
|
-
token: Token;
|
|
5
|
-
spenderAddress: string;
|
|
6
|
-
};
|
|
7
|
-
export type TokenAllowance = {
|
|
8
|
-
token: Token;
|
|
9
|
-
allowance?: bigint;
|
|
10
|
-
};
|
|
11
|
-
export type TokenSpenderAllowance = {
|
|
12
|
-
token: Token;
|
|
13
|
-
spenderAddress: string;
|
|
14
|
-
allowance?: bigint;
|
|
15
|
-
};
|
|
16
|
-
export interface ApproveTokenRequest {
|
|
17
|
-
walletClient: WalletClient;
|
|
18
|
-
token: Token;
|
|
19
|
-
spenderAddress: string;
|
|
20
|
-
amount: bigint;
|
|
21
|
-
infiniteApproval?: boolean;
|
|
22
|
-
}
|
|
23
|
-
export interface RevokeApprovalRequest {
|
|
24
|
-
walletClient: WalletClient;
|
|
25
|
-
token: Token;
|
|
26
|
-
spenderAddress: string;
|
|
27
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { Token, TokenAmount } from '@lifi/types';
|
|
2
|
-
export declare const getTokenBalance: (walletAddress: string, token: Token) => Promise<TokenAmount | null>;
|
|
3
|
-
export declare const getTokenBalances: (walletAddress: string, tokens: Token[]) => Promise<TokenAmount[]>;
|
|
4
|
-
export declare const getTokenBalancesByChain: (walletAddress: string, tokensByChain: {
|
|
5
|
-
[chainId: number]: Token[];
|
|
6
|
-
}) => Promise<{
|
|
7
|
-
[chainId: number]: TokenAmount[];
|
|
8
|
-
}>;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import type { Execution, InternalExecutionSettings, LifiStep, Process, ProcessType, Route, Status, Token } from '../types';
|
|
2
|
-
interface Receipt {
|
|
3
|
-
fromAmount?: string;
|
|
4
|
-
toAmount?: string;
|
|
5
|
-
toToken?: Token;
|
|
6
|
-
gasPrice?: string;
|
|
7
|
-
gasUsed?: string;
|
|
8
|
-
gasToken?: Token;
|
|
9
|
-
gasAmount?: string;
|
|
10
|
-
gasAmountUSD?: string;
|
|
11
|
-
}
|
|
12
|
-
type InternalUpdateRouteCallback = (route: Route) => void;
|
|
13
|
-
type OptionalParameters = Partial<Pick<Process, 'doneAt' | 'failedAt' | 'txHash' | 'txLink' | 'error' | 'substatus' | 'substatusMessage' | 'multisigTxHash'>>;
|
|
14
|
-
/**
|
|
15
|
-
* Manages status updates of a route and provides various functions for tracking processes
|
|
16
|
-
* @param {Route} route The route this StatusManger belongs to.
|
|
17
|
-
* @param {InternalExecutionSettings} settings The ExecutionSettings for this route.
|
|
18
|
-
* @param {InternalUpdateRouteCallback} internalUpdateRouteCallback Internal callback to propage route changes.
|
|
19
|
-
* @returns {StatusManager} An instance of StatusManager.
|
|
20
|
-
*/
|
|
21
|
-
export declare class StatusManager {
|
|
22
|
-
private readonly route;
|
|
23
|
-
private readonly settings;
|
|
24
|
-
private readonly internalUpdateRouteCallback;
|
|
25
|
-
private shouldUpdate;
|
|
26
|
-
constructor(route: Route, settings: InternalExecutionSettings, internalUpdateRouteCallback: InternalUpdateRouteCallback);
|
|
27
|
-
/**
|
|
28
|
-
* Initializes the execution object of a Step.
|
|
29
|
-
* @param step The current step in execution
|
|
30
|
-
* @returns The initialized execution object for this step and a function to update this step
|
|
31
|
-
*/
|
|
32
|
-
initExecutionObject: (step: LifiStep) => Execution;
|
|
33
|
-
/**
|
|
34
|
-
* Updates the execution object of a Step.
|
|
35
|
-
* @param step The current step in execution
|
|
36
|
-
* @param status The status for the execution
|
|
37
|
-
* @param receipt Optional. Information about received tokens
|
|
38
|
-
* @returns The step with the updated execution object
|
|
39
|
-
*/
|
|
40
|
-
updateExecution(step: LifiStep, status: Status, receipt?: Receipt): LifiStep;
|
|
41
|
-
/**
|
|
42
|
-
* Create and push a new process into the execution.
|
|
43
|
-
* @param step The step that should contain the new process.
|
|
44
|
-
* @param type Type of the process. Used to identify already existing processes.
|
|
45
|
-
* @param status By default created procces is set to the STARTED status. We can override new process with the needed status.
|
|
46
|
-
* @returns Returns process.
|
|
47
|
-
*/
|
|
48
|
-
findOrCreateProcess: (step: LifiStep, type: ProcessType, status?: Status) => Process;
|
|
49
|
-
/**
|
|
50
|
-
* Update a process object.
|
|
51
|
-
* @param step The step where the process should be updated
|
|
52
|
-
* @param type The process type to update
|
|
53
|
-
* @param status The status the process gets.
|
|
54
|
-
* @param [params] Additional parameters to append to the process.
|
|
55
|
-
* @returns The update process
|
|
56
|
-
*/
|
|
57
|
-
updateProcess: (step: LifiStep, type: ProcessType, status: Status, params?: OptionalParameters) => Process;
|
|
58
|
-
/**
|
|
59
|
-
* Remove a process from the execution
|
|
60
|
-
* @param step The step where the process should be removed from
|
|
61
|
-
* @param type The process type to remove
|
|
62
|
-
*/
|
|
63
|
-
removeProcess: (step: LifiStep, type: ProcessType) => void;
|
|
64
|
-
updateStepInRoute: (step: LifiStep) => LifiStep;
|
|
65
|
-
allowUpdates(value: boolean): void;
|
|
66
|
-
}
|
|
67
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Execution } from '@lifi/types';
|
|
2
|
-
import type { ExecutionParams } from '../types';
|
|
3
|
-
export declare class StepExecutionManager {
|
|
4
|
-
allowUserInteraction: boolean;
|
|
5
|
-
allowInteraction: (value: boolean) => void;
|
|
6
|
-
execute: ({ walletClient, step, statusManager, settings, }: ExecutionParams) => Promise<Execution>;
|
|
7
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { WalletClient } from 'viem';
|
|
2
|
-
import type { InteractionSettings, InternalExecutionSettings, LifiStep } from '../types';
|
|
3
|
-
import type { StatusManager } from './StatusManager';
|
|
4
|
-
import { StepExecutionManager } from './StepExecutionManager';
|
|
5
|
-
export declare class StepExecutor {
|
|
6
|
-
stepExecutionManager: StepExecutionManager;
|
|
7
|
-
statusManager: StatusManager;
|
|
8
|
-
settings: InternalExecutionSettings;
|
|
9
|
-
allowUserInteraction: boolean;
|
|
10
|
-
executionStopped: boolean;
|
|
11
|
-
constructor(statusManager: StatusManager, settings: InternalExecutionSettings);
|
|
12
|
-
setInteraction: (settings?: InteractionSettings) => void;
|
|
13
|
-
checkChain: () => never;
|
|
14
|
-
executeStep: (walletClient: WalletClient, step: LifiStep) => Promise<LifiStep>;
|
|
15
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StepExecutor = void 0;
|
|
4
|
-
const StepExecutionManager_1 = require("./StepExecutionManager");
|
|
5
|
-
const switchChain_1 = require("./switchChain");
|
|
6
|
-
// Please be careful when changing the defaults as it may break the behavior (e.g., background execution)
|
|
7
|
-
const defaultInteractionSettings = {
|
|
8
|
-
allowInteraction: true,
|
|
9
|
-
allowUpdates: true,
|
|
10
|
-
stopExecution: false,
|
|
11
|
-
};
|
|
12
|
-
class StepExecutor {
|
|
13
|
-
constructor(statusManager, settings) {
|
|
14
|
-
this.allowUserInteraction = true;
|
|
15
|
-
this.executionStopped = false;
|
|
16
|
-
this.setInteraction = (settings) => {
|
|
17
|
-
const interactionSettings = {
|
|
18
|
-
...defaultInteractionSettings,
|
|
19
|
-
...settings,
|
|
20
|
-
};
|
|
21
|
-
this.allowUserInteraction = interactionSettings.allowInteraction;
|
|
22
|
-
this.stepExecutionManager.allowInteraction(interactionSettings.allowInteraction);
|
|
23
|
-
this.statusManager.allowUpdates(interactionSettings.allowUpdates);
|
|
24
|
-
this.executionStopped = interactionSettings.stopExecution;
|
|
25
|
-
};
|
|
26
|
-
// TODO: add checkChain method and update wallet client inside executors
|
|
27
|
-
// This can come in handy when we execute multiple routes simultaneously and
|
|
28
|
-
// should be sure that we are on the right chain when waiting for transactions.
|
|
29
|
-
this.checkChain = () => {
|
|
30
|
-
throw new Error('checkChain is not implemented.');
|
|
31
|
-
};
|
|
32
|
-
this.executeStep = async (walletClient, step) => {
|
|
33
|
-
// Make sure that the chain is still correct
|
|
34
|
-
// Find if it's bridging and the step is waiting for a transaction on the receiving chain
|
|
35
|
-
const recievingChainProcess = step.execution?.process.find((process) => process.type === 'RECEIVING_CHAIN');
|
|
36
|
-
// If the step is waiting for a transaction on the receiving chain, we do not switch the chain
|
|
37
|
-
// All changes are already done from the source chain
|
|
38
|
-
// Return the step
|
|
39
|
-
if (recievingChainProcess?.substatus !== 'WAIT_DESTINATION_TRANSACTION' ||
|
|
40
|
-
!recievingChainProcess) {
|
|
41
|
-
const updatedWalletClient = await (0, switchChain_1.switchChain)(walletClient, this.statusManager, step, this.settings.switchChainHook, this.allowUserInteraction);
|
|
42
|
-
if (!updatedWalletClient) {
|
|
43
|
-
// Chain switch was not successful, stop execution here
|
|
44
|
-
return step;
|
|
45
|
-
}
|
|
46
|
-
walletClient = updatedWalletClient;
|
|
47
|
-
}
|
|
48
|
-
const parameters = {
|
|
49
|
-
walletClient,
|
|
50
|
-
step,
|
|
51
|
-
settings: this.settings,
|
|
52
|
-
statusManager: this.statusManager,
|
|
53
|
-
};
|
|
54
|
-
await this.stepExecutionManager.execute(parameters);
|
|
55
|
-
return step;
|
|
56
|
-
};
|
|
57
|
-
this.stepExecutionManager = new StepExecutionManager_1.StepExecutionManager();
|
|
58
|
-
this.statusManager = statusManager;
|
|
59
|
-
this.settings = settings;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
exports.StepExecutor = StepExecutor;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { Hash, WalletClient } from 'viem';
|
|
2
|
-
import type { StatusManager } from '../execution/StatusManager';
|
|
3
|
-
import type { Chain, InternalExecutionSettings, LifiStep } from '../types';
|
|
4
|
-
export declare const checkAllowance: (walletClient: WalletClient, step: LifiStep, statusManager: StatusManager, settings: InternalExecutionSettings, chain: Chain, allowUserInteraction?: boolean, shouldBatchTransactions?: boolean) => Promise<Hash | void>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './StatusManager';
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { ExtendedChain, LifiStep, ProcessType } from '@lifi/types';
|
|
2
|
-
import type { Hash } from 'viem';
|
|
3
|
-
import type { StatusManager } from '.';
|
|
4
|
-
export declare const updateMultisigRouteProcess: (internalTxHash: Hash, step: LifiStep, statusManager: StatusManager, processType: ProcessType, fromChain: ExtendedChain) => Promise<void>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { LifiStep, ProcessType, Status, StatusMessage, Substatus } from '@lifi/types';
|
|
2
|
-
export declare function getProcessMessage(type: ProcessType, status: Status): string | undefined;
|
|
3
|
-
export declare function getSubstatusMessage(status: StatusMessage, substatus?: Substatus): string | undefined;
|
|
4
|
-
/**
|
|
5
|
-
* Used to check if changed exchange rate is in the range of slippage threshold.
|
|
6
|
-
* We use a slippage value as a threshold to trigger the rate change hook.
|
|
7
|
-
* This can result in almost doubled slippage for the user and need to be revisited.
|
|
8
|
-
* @param oldStep
|
|
9
|
-
* @param newStep
|
|
10
|
-
* @returns Boolean
|
|
11
|
-
*/
|
|
12
|
-
export declare function checkStepSlippageThreshold(oldStep: LifiStep, newStep: LifiStep): boolean;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { LifiStep, ProcessType, StatusResponse } from '@lifi/types';
|
|
2
|
-
import type { StatusManager } from '..';
|
|
3
|
-
export declare function waitForReceivingTransaction(txHash: string, statusManager: StatusManager, processType: ProcessType, step: LifiStep): Promise<StatusResponse>;
|
package/dist/cjs/helpers.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { LifiStep, Route } from '@lifi/types';
|
|
2
|
-
import type { TenderlyResponse } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* Returns a random number between min (inclusive) and max (inclusive)
|
|
5
|
-
* @param min - minimum number.
|
|
6
|
-
* @param max - maximum number.
|
|
7
|
-
* @returns - random number.
|
|
8
|
-
*/
|
|
9
|
-
export declare const getRandomNumber: (min: number, max: number) => number;
|
|
10
|
-
export declare const checkPackageUpdates: (packageName?: string, packageVersion?: string, disableCheck?: boolean) => Promise<void>;
|
|
11
|
-
/**
|
|
12
|
-
* Converts a quote to Route
|
|
13
|
-
* @param step - Step returned from the quote endpoint.
|
|
14
|
-
* @returns - The route to be executed.
|
|
15
|
-
* @throws {ValidationError} Throws a ValidationError if the step has missing values.
|
|
16
|
-
*/
|
|
17
|
-
export declare const convertQuoteToRoute: (step: LifiStep) => Route;
|
|
18
|
-
export declare const fetchTxErrorDetails: (txHash: string, chainId: number) => Promise<TenderlyResponse>;
|
package/dist/cjs/index.d.ts
DELETED
package/dist/cjs/request.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const requestSettings: {
|
|
2
|
-
retries: number;
|
|
3
|
-
};
|
|
4
|
-
interface ExtendedRequestInit extends RequestInit {
|
|
5
|
-
retries?: number;
|
|
6
|
-
skipTrackingHeaders?: boolean;
|
|
7
|
-
}
|
|
8
|
-
export declare const request: <T = Response>(url: RequestInfo | URL, options?: ExtendedRequestInit) => Promise<T>;
|
|
9
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { ConnectionsRequest, ConnectionsResponse, ContractCallQuoteRequest, GasRecommendationRequest, GasRecommendationResponse, GetStatusRequest, LifiStep, QuoteRequest, RequestOptions, TokensRequest, TokensResponse } from '@lifi/types';
|
|
2
|
-
import type { ChainId, ChainKey, ExtendedChain, PossibilitiesRequest, PossibilitiesResponse, RoutesRequest, RoutesResponse, StatusResponse, Token, ToolsRequest, ToolsResponse } from '../types';
|
|
3
|
-
declare const _default: {
|
|
4
|
-
getChains: (options?: RequestOptions | undefined) => Promise<ExtendedChain[]>;
|
|
5
|
-
getContractCallQuote: (requestConfig: ContractCallQuoteRequest, options?: RequestOptions | undefined) => Promise<LifiStep>;
|
|
6
|
-
getGasRecommendation: ({ chainId, fromChain, fromToken }: GasRecommendationRequest, options?: RequestOptions | undefined) => Promise<GasRecommendationResponse>;
|
|
7
|
-
getPossibilities: (requestConfig?: PossibilitiesRequest | undefined, options?: RequestOptions | undefined) => Promise<PossibilitiesResponse>;
|
|
8
|
-
getQuote: (requestConfig: QuoteRequest, options?: RequestOptions | undefined) => Promise<LifiStep>;
|
|
9
|
-
getRoutes: (requestConfig: RoutesRequest, options?: RequestOptions | undefined) => Promise<RoutesResponse>;
|
|
10
|
-
getStatus: (requestConfig: GetStatusRequest, options?: RequestOptions | undefined) => Promise<StatusResponse>;
|
|
11
|
-
getStepTransaction: (step: LifiStep, options?: RequestOptions | undefined) => Promise<LifiStep>;
|
|
12
|
-
getToken: (chain: ChainId | ChainKey, token: string, options?: RequestOptions | undefined) => Promise<Token>;
|
|
13
|
-
getTokens: (requestConfig?: TokensRequest | undefined, options?: RequestOptions | undefined) => Promise<TokensResponse>;
|
|
14
|
-
getTools: (requestConfig?: ToolsRequest | undefined, options?: RequestOptions | undefined) => Promise<ToolsResponse>;
|
|
15
|
-
getAvailableConnections: (connectionRequest: ConnectionsRequest) => Promise<ConnectionsResponse>;
|
|
16
|
-
};
|
|
17
|
-
export default _default;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { Chain, Config, ConfigUpdate } from '../types';
|
|
2
|
-
export default class ConfigService {
|
|
3
|
-
private static instance;
|
|
4
|
-
private readonly config;
|
|
5
|
-
private readonly setupPromise;
|
|
6
|
-
private resolveSetupPromise;
|
|
7
|
-
constructor();
|
|
8
|
-
private static chainIdToObject;
|
|
9
|
-
private static getDefaultConfig;
|
|
10
|
-
static getInstance(): ConfigService;
|
|
11
|
-
/**
|
|
12
|
-
* This call immediately returns the current config. It does not make sure that all chain data is already loaded
|
|
13
|
-
* Use this if you need access to basic information like API urls or settings
|
|
14
|
-
*/
|
|
15
|
-
getConfig: () => Config;
|
|
16
|
-
/**
|
|
17
|
-
* This call waits for all setup promises to be done.
|
|
18
|
-
* Use this if you need access to chain data (RPCs or multicalls)
|
|
19
|
-
*/
|
|
20
|
-
getConfigAsync: () => Promise<Config>;
|
|
21
|
-
updateConfig: (configUpdate: Partial<ConfigUpdate>) => Config;
|
|
22
|
-
updateChains: (chains: Chain[]) => Config;
|
|
23
|
-
}
|