@lifi/sdk 2.3.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 -250
- package/dist/cjs/LiFi.js.map +1 -0
- package/dist/cjs/allowance/getAllowance.js +82 -0
- package/dist/cjs/allowance/getAllowance.js.map +1 -0
- package/dist/cjs/allowance/index.js +5 -16
- package/dist/cjs/allowance/index.js.map +1 -0
- package/dist/cjs/allowance/setAllowance.js +71 -0
- package/dist/cjs/allowance/setAllowance.js.map +1 -0
- package/dist/cjs/{types/internal.types.js → allowance/types.js} +1 -0
- package/dist/cjs/allowance/types.js.map +1 -0
- package/dist/cjs/balance/getBalance.js +97 -0
- package/dist/cjs/balance/getBalance.js.map +1 -0
- package/dist/cjs/balance/getTokenBalance.js +7 -10
- package/dist/cjs/balance/getTokenBalance.js.map +1 -0
- package/dist/cjs/balance/index.js +4 -24
- package/dist/cjs/balance/index.js.map +1 -0
- package/dist/cjs/connectors.js +28 -48
- package/dist/cjs/connectors.js.map +1 -0
- package/dist/cjs/constants.js +7 -0
- 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 -197
- package/dist/cjs/execution/RouteExecutionManager.js.map +1 -0
- package/dist/cjs/execution/StatusManager.js +142 -136
- package/dist/cjs/execution/StatusManager.js.map +1 -0
- package/dist/cjs/execution/StepExecutionManager.js +220 -233
- package/dist/cjs/execution/StepExecutionManager.js.map +1 -0
- package/dist/cjs/execution/checkAllowance.js +76 -0
- package/dist/cjs/execution/checkAllowance.js.map +1 -0
- package/dist/cjs/execution/checkBalance.js +42 -0
- 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 +13 -17
- package/dist/cjs/execution/multisig.js.map +1 -0
- package/dist/cjs/execution/prepareRestart.js +23 -0
- 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 +10 -22
- package/dist/cjs/execution/switchChain.js.map +1 -0
- package/dist/cjs/execution/types.js +3 -0
- package/dist/cjs/execution/types.js.map +1 -0
- package/dist/cjs/execution/utils.js +12 -67
- package/dist/cjs/execution/utils.js.map +1 -0
- package/dist/cjs/execution/waitForReceivingTransaction.js +56 -0
- package/dist/cjs/execution/waitForReceivingTransaction.js.map +1 -0
- package/dist/cjs/helpers.js +12 -58
- 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 +10 -13
- package/dist/cjs/request.js.map +1 -0
- package/dist/cjs/services/ApiService.js +70 -86
- 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 -67
- 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 +46 -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 +63 -40
- package/dist/cjs/utils/errors.js.map +1 -0
- package/dist/cjs/utils/getMaxPriorityFeePerGas.js +23 -0
- package/dist/cjs/utils/getMaxPriorityFeePerGas.js.map +1 -0
- package/dist/cjs/utils/index.js +9 -0
- package/dist/cjs/utils/index.js.map +1 -0
- package/dist/cjs/utils/median.js +16 -0
- package/dist/cjs/utils/median.js.map +1 -0
- package/dist/cjs/utils/parseError.js +55 -92
- package/dist/cjs/utils/parseError.js.map +1 -0
- package/dist/cjs/utils/utils.js +10 -85
- 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/esm/allowance/getAllowance.js +79 -0
- 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/esm/allowance/setAllowance.js +67 -0
- 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/esm/balance/getBalance.js +93 -0
- package/dist/esm/balance/getBalance.js.map +1 -0
- package/dist/{balance → esm/balance}/getTokenBalance.js +5 -4
- 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/esm/connectors.js +42 -0
- package/dist/esm/connectors.js.map +1 -0
- package/dist/esm/constants.js +7 -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/esm/execution/checkAllowance.js +74 -0
- package/dist/esm/execution/checkAllowance.js.map +1 -0
- package/dist/esm/execution/checkBalance.js +39 -0
- 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/esm/execution/multisig.js +26 -0
- 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 +5 -4
- package/dist/esm/execution/stepComparison.js.map +1 -0
- package/dist/{execution → esm/execution}/switchChain.js +19 -12
- 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/esm/execution/utils.js +80 -0
- package/dist/esm/execution/utils.js.map +1 -0
- package/dist/esm/execution/waitForReceivingTransaction.js +52 -0
- package/dist/esm/execution/waitForReceivingTransaction.js.map +1 -0
- package/dist/{helpers.js → esm/helpers.js} +9 -37
- 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} +6 -5
- package/dist/esm/request.js.map +1 -0
- package/dist/{services → esm/services}/ApiService.js +29 -26
- 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/esm/types/abi.js +43 -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 +61 -35
- package/dist/esm/utils/errors.js.map +1 -0
- package/dist/esm/utils/getMaxPriorityFeePerGas.js +19 -0
- 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/esm/utils/median.js +12 -0
- package/dist/esm/utils/median.js.map +1 -0
- package/dist/{utils → esm/utils}/parseError.js +45 -41
- package/dist/esm/utils/parseError.js.map +1 -0
- package/dist/esm/utils/utils.js +38 -0
- 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/types/LiFi.d.ts +179 -0
- package/dist/types/LiFi.d.ts.map +1 -0
- package/dist/types/allowance/getAllowance.d.ts +7 -0
- 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/types/allowance/types.d.ts +28 -0
- package/dist/types/allowance/types.d.ts.map +1 -0
- package/dist/types/balance/getBalance.d.ts +3 -0
- package/dist/types/balance/getBalance.d.ts.map +1 -0
- package/dist/{balance → types/balance}/getTokenBalance.d.ts +3 -2
- 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/types/connectors.d.ts +9 -0
- package/dist/types/connectors.d.ts.map +1 -0
- package/dist/types/constants.d.ts +7 -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/types/execution/RouteExecutionManager.d.ts +61 -0
- package/dist/types/execution/RouteExecutionManager.d.ts.map +1 -0
- package/dist/types/execution/StatusManager.d.ts +69 -0
- package/dist/types/execution/StatusManager.d.ts.map +1 -0
- package/dist/types/execution/StepExecutionManager.d.ts +8 -0
- 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/{execution → types/execution}/stepComparison.d.ts +6 -4
- package/dist/types/execution/stepComparison.d.ts.map +1 -0
- package/dist/types/execution/switchChain.d.ts +23 -0
- package/dist/types/execution/switchChain.d.ts.map +1 -0
- package/dist/types/execution/types.d.ts +83 -0
- package/dist/types/execution/types.d.ts.map +1 -0
- package/dist/types/execution/utils.d.ts +13 -0
- 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/types/helpers.d.ts +19 -0
- 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/{cjs → types}/services/ApiService.d.ts +5 -5
- package/dist/types/services/ApiService.d.ts.map +1 -0
- package/dist/{services → types/services}/ChainsService.d.ts +3 -2
- 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/types/types/abi.d.ts +6 -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 +16 -14
- package/dist/types/utils/errors.d.ts.map +1 -0
- package/dist/types/utils/getMaxPriorityFeePerGas.d.ts +3 -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/types/utils/median.d.ts +2 -0
- package/dist/types/utils/median.d.ts.map +1 -0
- package/dist/{utils → types/utils}/parseError.d.ts +7 -6
- package/dist/types/utils/parseError.d.ts.map +1 -0
- package/dist/types/utils/utils.d.ts +11 -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 -95
- package/dist/LiFi.d.ts +0 -164
- package/dist/LiFi.js +0 -235
- package/dist/allowance/checkAllowance.d.ts +0 -4
- package/dist/allowance/checkAllowance.js +0 -96
- package/dist/allowance/index.d.ts +0 -2
- package/dist/allowance/index.js +0 -2
- package/dist/allowance/tokenApproval.d.ts +0 -22
- package/dist/allowance/tokenApproval.js +0 -59
- package/dist/allowance/utils.d.ts +0 -14
- package/dist/allowance/utils.js +0 -72
- package/dist/balance/checkBalance.d.ts +0 -3
- package/dist/balance/checkBalance.js +0 -38
- package/dist/balance/index.d.ts +0 -13
- package/dist/balance/index.js +0 -10
- package/dist/balance/utils.d.ts +0 -6
- package/dist/balance/utils.js +0 -143
- package/dist/cjs/LiFi.d.ts +0 -164
- package/dist/cjs/allowance/checkAllowance.d.ts +0 -4
- package/dist/cjs/allowance/checkAllowance.js +0 -103
- package/dist/cjs/allowance/index.d.ts +0 -2
- package/dist/cjs/allowance/tokenApproval.d.ts +0 -22
- package/dist/cjs/allowance/tokenApproval.js +0 -69
- package/dist/cjs/allowance/utils.d.ts +0 -14
- package/dist/cjs/allowance/utils.js +0 -82
- package/dist/cjs/balance/checkBalance.d.ts +0 -3
- package/dist/cjs/balance/checkBalance.js +0 -45
- package/dist/cjs/balance/getTokenBalance.d.ts +0 -8
- package/dist/cjs/balance/index.d.ts +0 -13
- package/dist/cjs/balance/utils.d.ts +0 -6
- package/dist/cjs/balance/utils.js +0 -150
- package/dist/cjs/connectors.d.ts +0 -6
- package/dist/cjs/execution/RouteExecutionManager.d.ts +0 -65
- package/dist/cjs/execution/StatusManager.d.ts +0 -68
- 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/index.d.ts +0 -1
- package/dist/cjs/execution/multisig.d.ts +0 -3
- package/dist/cjs/execution/stepComparison.d.ts +0 -14
- package/dist/cjs/execution/switchChain.d.ts +0 -16
- package/dist/cjs/execution/utils.d.ts +0 -6
- package/dist/cjs/helpers.d.ts +0 -28
- package/dist/cjs/index.d.ts +0 -5
- package/dist/cjs/request.d.ts +0 -9
- package/dist/cjs/services/ChainsService.d.ts +0 -11
- package/dist/cjs/services/ConfigService.d.ts +0 -23
- package/dist/cjs/types/ERC20.d.ts +0 -22
- package/dist/cjs/types/ERC20.js +0 -53
- package/dist/cjs/types/index.d.ts +0 -4
- package/dist/cjs/types/internal.types.d.ts +0 -151
- package/dist/cjs/utils/getProvider.d.ts +0 -3
- package/dist/cjs/utils/getProvider.js +0 -11
- package/dist/cjs/utils/multicall.d.ts +0 -10
- package/dist/cjs/utils/multicall.js +0 -68
- package/dist/cjs/utils/multicallAbi.json +0 -313
- package/dist/cjs/utils/parseError.d.ts +0 -37
- package/dist/cjs/utils/preRestart.d.ts +0 -3
- package/dist/cjs/utils/preRestart.js +0 -56
- package/dist/cjs/utils/utils.d.ts +0 -25
- package/dist/cjs/version.d.ts +0 -2
- package/dist/connectors.d.ts +0 -6
- package/dist/connectors.js +0 -57
- package/dist/execution/RouteExecutionManager.d.ts +0 -65
- package/dist/execution/RouteExecutionManager.js +0 -213
- package/dist/execution/StatusManager.d.ts +0 -68
- package/dist/execution/StatusManager.js +0 -168
- package/dist/execution/StepExecutionManager.d.ts +0 -7
- package/dist/execution/StepExecutionManager.js +0 -267
- package/dist/execution/StepExecutor.d.ts +0 -15
- package/dist/execution/StepExecutor.js +0 -58
- package/dist/execution/index.d.ts +0 -1
- package/dist/execution/index.js +0 -1
- package/dist/execution/multisig.d.ts +0 -3
- package/dist/execution/multisig.js +0 -27
- package/dist/execution/switchChain.d.ts +0 -16
- package/dist/execution/utils.d.ts +0 -6
- package/dist/execution/utils.js +0 -122
- package/dist/helpers.d.ts +0 -28
- package/dist/index.d.ts +0 -5
- package/dist/index.js +0 -6
- package/dist/services/ApiService.d.ts +0 -17
- package/dist/services/ConfigService.js +0 -101
- package/dist/typeguards.d.ts +0 -4
- package/dist/types/ERC20.d.ts +0 -22
- package/dist/types/ERC20.js +0 -50
- package/dist/types/index.js +0 -4
- package/dist/types/internal.types.d.ts +0 -151
- package/dist/types/internal.types.js +0 -1
- package/dist/utils/errors.d.ts +0 -106
- package/dist/utils/getProvider.d.ts +0 -3
- package/dist/utils/getProvider.js +0 -7
- package/dist/utils/multicall.d.ts +0 -10
- package/dist/utils/multicall.js +0 -61
- package/dist/utils/multicallAbi.json +0 -313
- package/dist/utils/preRestart.d.ts +0 -3
- package/dist/utils/preRestart.js +0 -52
- package/dist/utils/utils.d.ts +0 -25
- package/dist/utils/utils.js +0 -99
- package/dist/version.d.ts +0 -2
- package/dist/version.js +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/utils/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AAErE,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,EAAU,EAAsB,EAAE;IACrD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA;IACzB,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,EAClC,QAAsC,EACtC,OAAO,GAAG,IAAI,EACF,EAAE;IACd,IAAI,MAAqB,CAAA;IAEzB,OAAO,CAAC,MAAM,EAAE;QACd,MAAM,GAAG,MAAM,QAAQ,EAAE,CAAA;QACzB,IAAI,CAAC,MAAM,EAAE;YACX,MAAM,IAAI,CAAC,OAAO,CAAC,CAAA;SACpB;KACF;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,OAAe,EAAW,EAAE;IACxD,IAAI,OAAO,KAAK,WAAW,IAAI,OAAO,KAAK,sBAAsB,EAAE;QACjE,OAAO,IAAI,CAAA;KACZ;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,OAAe,EAAW,EAAE;IAC/D,IACE,OAAO,KAAK,WAAW;QACvB,OAAO,KAAK,sBAAsB;QAClC,oBAAoB;QACpB,OAAO,KAAK,4CAA4C,EACxD;QACA,OAAO,IAAI,CAAA;KACZ;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,IAAI,GAAG,WAAW,CAAA;AAC/B,MAAM,CAAC,MAAM,OAAO,GAAG,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,179 @@
|
|
|
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/index.js';
|
|
4
|
+
import { RouteExecutionManager } from './execution/RouteExecutionManager.js';
|
|
5
|
+
import type { SDKConfig, SDKOptions } from './types/index.js';
|
|
6
|
+
export declare class LiFi extends RouteExecutionManager {
|
|
7
|
+
private chainsService;
|
|
8
|
+
constructor(options: SDKOptions);
|
|
9
|
+
/**
|
|
10
|
+
* Get the current configuration of the SDK
|
|
11
|
+
* @returns - The config object
|
|
12
|
+
*/
|
|
13
|
+
getConfig: () => SDKConfig;
|
|
14
|
+
/**
|
|
15
|
+
* Get the SDK configuration after all setup calls are finished
|
|
16
|
+
* @returns - The config object
|
|
17
|
+
*/
|
|
18
|
+
getConfigAsync: () => Promise<SDKConfig>;
|
|
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<SDKOptions>) => SDKConfig;
|
|
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 - Request 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 - Request options
|
|
45
|
+
* @throws {LiFiError} - Throws a LiFiError if request fails
|
|
46
|
+
* @returns Token information
|
|
47
|
+
*/
|
|
48
|
+
getToken: (chain: ChainKey | ChainId, token: string, options?: RequestOptions) => Promise<Token>;
|
|
49
|
+
/**
|
|
50
|
+
* Get a quote for a token transfer
|
|
51
|
+
* @param request - The configuration of the requested quote
|
|
52
|
+
* @param options - Request options
|
|
53
|
+
* @throws {LiFiError} - Throws a LiFiError if request fails
|
|
54
|
+
* @returns Quote for a token transfer
|
|
55
|
+
*/
|
|
56
|
+
getQuote: (request: QuoteRequest, options?: RequestOptions) => Promise<LiFiStep>;
|
|
57
|
+
/**
|
|
58
|
+
* Get a quote for a destination contract call
|
|
59
|
+
* @param request - The configuration of the requested destination call
|
|
60
|
+
* @param options - Request options
|
|
61
|
+
* @throws {LiFiError} - Throws a LiFiError if request fails
|
|
62
|
+
* @returns - Returns step.
|
|
63
|
+
*/
|
|
64
|
+
getContractCallQuote: (request: ContractCallQuoteRequest, options?: RequestOptions) => Promise<LiFiStep>;
|
|
65
|
+
/**
|
|
66
|
+
* Check the status of a transfer. For cross chain transfers, the "bridge" parameter is required.
|
|
67
|
+
* @param request - Configuration of the requested status
|
|
68
|
+
* @param options - Rrquest options.
|
|
69
|
+
* @throws {LiFiError} - Throws a LiFiError if request fails
|
|
70
|
+
* @returns Returns status response.
|
|
71
|
+
*/
|
|
72
|
+
getStatus: (request: GetStatusRequest, options?: RequestOptions) => Promise<StatusResponse>;
|
|
73
|
+
/**
|
|
74
|
+
* Get the available tools to bridge and swap tokens.
|
|
75
|
+
* @param request - The configuration of the requested tools
|
|
76
|
+
* @param options - Request options
|
|
77
|
+
* @returns The tools that are available on the requested chains
|
|
78
|
+
*/
|
|
79
|
+
getTools: (request?: ToolsRequest, options?: RequestOptions) => Promise<ToolsResponse>;
|
|
80
|
+
/**
|
|
81
|
+
* Get all known tokens.
|
|
82
|
+
* @param request - The configuration of the requested tokens
|
|
83
|
+
* @param options - Request options
|
|
84
|
+
* @returns The tokens that are available on the requested chains
|
|
85
|
+
*/
|
|
86
|
+
getTokens: (request?: TokensRequest, options?: RequestOptions) => Promise<TokensResponse>;
|
|
87
|
+
/**
|
|
88
|
+
* Get all available chains
|
|
89
|
+
* @returns A list of all available chains
|
|
90
|
+
* @throws {LiFiError} Throws a LiFiError if request fails.
|
|
91
|
+
*/
|
|
92
|
+
getChains: () => Promise<ExtendedChain[]>;
|
|
93
|
+
/**
|
|
94
|
+
* Get a set of routes for a request that describes a transfer of tokens.
|
|
95
|
+
* @param request - A description of the transfer.
|
|
96
|
+
* @param options - Request options
|
|
97
|
+
* @returns The resulting routes that can be used to realize the described transfer of tokens.
|
|
98
|
+
* @throws {LiFiError} Throws a LiFiError if request fails.
|
|
99
|
+
*/
|
|
100
|
+
getRoutes: (request: RoutesRequest, options?: RequestOptions) => Promise<RoutesResponse>;
|
|
101
|
+
/**
|
|
102
|
+
* Get the transaction data for a single step of a route
|
|
103
|
+
* @param step - The step object.
|
|
104
|
+
* @param options - Request options
|
|
105
|
+
* @returns The step populated with the transaction data.
|
|
106
|
+
* @throws {LiFiError} Throws a LiFiError if request fails.
|
|
107
|
+
*/
|
|
108
|
+
getStepTransaction: (step: LiFiStep, options?: RequestOptions) => Promise<LiFiStep>;
|
|
109
|
+
/**
|
|
110
|
+
* Get gas recommendation for a certain chain
|
|
111
|
+
* @param request - Configuration of the requested recommendation.
|
|
112
|
+
* @param options - Request options
|
|
113
|
+
* @throws {LiFiError} Throws a LiFiError if request fails.
|
|
114
|
+
* @returns Gas recommendation response.
|
|
115
|
+
*/
|
|
116
|
+
getGasRecommendation: (request: GasRecommendationRequest, options?: RequestOptions) => Promise<GasRecommendationResponse>;
|
|
117
|
+
/**
|
|
118
|
+
* Returns the balances of a specific token a wallet holds across all aggregated chains.
|
|
119
|
+
* @param walletAddress - A wallet address.
|
|
120
|
+
* @param token - A Token object.
|
|
121
|
+
* @returns An object containing the token and the amounts on different chains.
|
|
122
|
+
* @throws {ValidationError} Throws a ValidationError if parameters are invalid.
|
|
123
|
+
*/
|
|
124
|
+
getTokenBalance: (walletAddress: string, token: Token) => Promise<TokenAmount | null>;
|
|
125
|
+
/**
|
|
126
|
+
* Returns the balances for a list tokens a wallet holds across all aggregated chains.
|
|
127
|
+
* @param walletAddress - A wallet address.
|
|
128
|
+
* @param tokens - A list of Token objects.
|
|
129
|
+
* @returns A list of objects containing the tokens and the amounts on different chains.
|
|
130
|
+
* @throws {ValidationError} Throws a ValidationError if parameters are invalid.
|
|
131
|
+
*/
|
|
132
|
+
getTokenBalances: (walletAddress: string, tokens: Token[]) => Promise<TokenAmount[]>;
|
|
133
|
+
/**
|
|
134
|
+
* This method queries the balances of tokens for a specific list of chains for a given wallet.
|
|
135
|
+
* @param walletAddress - A walletaddress.
|
|
136
|
+
* @param tokensByChain - A list of Token objects organized by chain ids.
|
|
137
|
+
* @returns A list of objects containing the tokens and the amounts on different chains organized by the chosen chains.
|
|
138
|
+
* @throws {ValidationError} Throws a ValidationError if parameters are invalid.
|
|
139
|
+
*/
|
|
140
|
+
getTokenBalancesByChain: (walletAddress: string, tokensByChain: {
|
|
141
|
+
[chainId: number]: Token[];
|
|
142
|
+
}) => Promise<{
|
|
143
|
+
[chainId: number]: TokenAmount[];
|
|
144
|
+
}>;
|
|
145
|
+
/**
|
|
146
|
+
* Get the current allowance for a certain token.
|
|
147
|
+
* @param token - The token that should be checked
|
|
148
|
+
* @param ownerAddress - The owner of the token
|
|
149
|
+
* @param spenderAddress - The spender address that has to be approved
|
|
150
|
+
* @returns Returns allowance
|
|
151
|
+
*/
|
|
152
|
+
getTokenAllowance: (token: Token, ownerAddress: string, spenderAddress: string) => Promise<bigint | undefined>;
|
|
153
|
+
/**
|
|
154
|
+
* Get the current allowance for a list of token/spender address pairs.
|
|
155
|
+
* @param ownerAddress - The owner of the tokens
|
|
156
|
+
* @param tokens - A list of token and spender address pairs
|
|
157
|
+
* @returns Returns array of tokens and their allowance
|
|
158
|
+
*/
|
|
159
|
+
getTokenAllowanceMulticall: (ownerAddress: string, tokens: TokenSpender[]) => Promise<TokenAllowance[]>;
|
|
160
|
+
/**
|
|
161
|
+
* Set approval for a certain token and amount.
|
|
162
|
+
* @param request - The approval request
|
|
163
|
+
* @returns Returns Hash or nothing
|
|
164
|
+
*/
|
|
165
|
+
setTokenApproval: (request: ApproveTokenRequest) => Promise<Hash | void>;
|
|
166
|
+
/**
|
|
167
|
+
* Revoke approval for a certain token.
|
|
168
|
+
* @param request - The revoke request
|
|
169
|
+
* @returns Returns Hash or nothing
|
|
170
|
+
*/
|
|
171
|
+
revokeTokenApproval: (request: RevokeApprovalRequest) => Promise<Hash | void>;
|
|
172
|
+
/**
|
|
173
|
+
* Get all the available connections for swap/bridging tokens
|
|
174
|
+
* @param connectionRequest ConnectionsRequest
|
|
175
|
+
* @returns ConnectionsResponse
|
|
176
|
+
*/
|
|
177
|
+
getConnections: (connectionRequest: ConnectionsRequest) => Promise<ConnectionsResponse>;
|
|
178
|
+
}
|
|
179
|
+
//# sourceMappingURL=LiFi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LiFi.d.ts","sourceRoot":"","sources":["../../src/LiFi.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,OAAO,EACP,QAAQ,EACR,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACxB,aAAa,EACb,wBAAwB,EACxB,yBAAyB,EACzB,gBAAgB,EAChB,QAAQ,EACR,oBAAoB,EACpB,qBAAqB,EACrB,YAAY,EACZ,cAAc,EACd,aAAa,EACb,cAAc,EAEd,cAAc,EACd,KAAK,EACL,WAAW,EACX,aAAa,EACb,cAAc,EACd,YAAY,EACZ,aAAa,EACd,MAAM,aAAa,CAAA;AACpB,OAAO,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAC9C,OAAO,KAAK,EACV,mBAAmB,EACnB,qBAAqB,EACrB,cAAc,EACd,YAAY,EACb,MAAM,sBAAsB,CAAA;AAS7B,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAA;AAK5E,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAI7D,qBAAa,IAAK,SAAQ,qBAAqB;IAC7C,OAAO,CAAC,aAAa,CAAe;gBAExB,OAAO,EAAE,UAAU;IAY/B;;;OAGG;IACH,SAAS,QAAO,SAAS,CAExB;IAED;;;OAGG;IACH,cAAc,QAAO,QAAQ,SAAS,CAAC,CAEtC;IAED;;;;OAIG;IACH,eAAe,YAAa,MAAM,KAAG,QAAQ,YAAY,CAAC,CAEzD;IAED;;;;OAIG;IACH,SAAS,iBAAkB,QAAQ,UAAU,CAAC,KAAG,SAAS,CAEzD;IAED;;;;;;;OAOG;IACH,gBAAgB,aACJ,oBAAoB,YACpB,cAAc,KACvB,QAAQ,qBAAqB,CAAC,CAEhC;IAED;;;;;;;OAOG;IACH,QAAQ,UACC,QAAQ,GAAG,OAAO,SAClB,MAAM,YACH,cAAc,KACvB,QAAQ,KAAK,CAAC,CAEhB;IAED;;;;;;OAMG;IACH,QAAQ,YACG,YAAY,YACX,cAAc,KACvB,QAAQ,QAAQ,CAAC,CAEnB;IAED;;;;;;OAMG;IACH,oBAAoB,YACT,wBAAwB,YACvB,cAAc,KACvB,QAAQ,QAAQ,CAAC,CAEnB;IAED;;;;;;OAMG;IACH,SAAS,YACE,gBAAgB,YACf,cAAc,KACvB,QAAQ,cAAc,CAAC,CAEzB;IAED;;;;;OAKG;IACH,QAAQ,aACI,YAAY,YACZ,cAAc,KACvB,QAAQ,aAAa,CAAC,CAExB;IAED;;;;;OAKG;IACH,SAAS,aACG,aAAa,YACb,cAAc,KACvB,QAAQ,cAAc,CAAC,CAEzB;IAED;;;;OAIG;IACH,SAAS,QAAa,QAAQ,aAAa,EAAE,CAAC,CAE7C;IAED;;;;;;OAMG;IACH,SAAS,YACE,aAAa,YACZ,cAAc,KACvB,QAAQ,cAAc,CAAC,CAEzB;IAED;;;;;;OAMG;IACH,kBAAkB,SACV,QAAQ,YACJ,cAAc,KACvB,QAAQ,QAAQ,CAAC,CAEnB;IAED;;;;;;OAMG;IACH,oBAAoB,YACT,wBAAwB,YACvB,cAAc,KACvB,QAAQ,yBAAyB,CAAC,CAEpC;IAED;;;;;;OAMG;IACH,eAAe,kBACE,MAAM,SACd,KAAK,KACX,QAAQ,WAAW,GAAG,IAAI,CAAC,CAc7B;IAED;;;;;;OAMG;IACH,gBAAgB,kBACC,MAAM,UACb,KAAK,EAAE,KACd,QAAQ,WAAW,EAAE,CAAC,CAaxB;IAED;;;;;;OAMG;IACH,uBAAuB,kBACN,MAAM;;;;OAgBtB;IAED;;;;;;OAMG;IACH,iBAAiB,UACR,KAAK,gBACE,MAAM,kBACJ,MAAM,KACrB,QAAQ,MAAM,GAAG,SAAS,CAAC,CAE7B;IAED;;;;;OAKG;IACH,0BAA0B,iBACV,MAAM,UACZ,YAAY,EAAE,KACrB,QAAQ,cAAc,EAAE,CAAC,CAE3B;IAED;;;;OAIG;IACH,gBAAgB,YAAa,mBAAmB,KAAG,QAAQ,IAAI,GAAG,IAAI,CAAC,CAEtE;IAED;;;;OAIG;IACH,mBAAmB,YACR,qBAAqB,KAC7B,QAAQ,IAAI,GAAG,IAAI,CAAC,CAEtB;IAED;;;;OAIG;IACH,cAAc,sBACO,kBAAkB,KACpC,QAAQ,mBAAmB,CAAC,CAK9B;CACF"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ChainId, Token } from '@lifi/types';
|
|
2
|
+
import type { TokenAllowance, TokenSpender, TokenSpenderAllowance } from './types.js';
|
|
3
|
+
export declare const getAllowance: (chainId: ChainId, tokenAddress: string, ownerAddress: string, spenderAddress: string) => Promise<bigint>;
|
|
4
|
+
export declare const getAllowanceMulticall: (chainId: ChainId, tokens: TokenSpender[], ownerAddress: string) => Promise<TokenSpenderAllowance[]>;
|
|
5
|
+
export declare const getTokenAllowance: (token: Token, ownerAddress: string, spenderAddress: string) => Promise<bigint | undefined>;
|
|
6
|
+
export declare const getTokenAllowanceMulticall: (ownerAddress: string, tokens: TokenSpender[]) => Promise<TokenAllowance[]>;
|
|
7
|
+
//# sourceMappingURL=getAllowance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getAllowance.d.ts","sourceRoot":"","sources":["../../../src/allowance/getAllowance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAOjD,OAAO,KAAK,EACV,cAAc,EACd,YAAY,EACZ,qBAAqB,EACtB,MAAM,YAAY,CAAA;AAEnB,eAAO,MAAM,YAAY,YACd,OAAO,gBACF,MAAM,gBACN,MAAM,kBACJ,MAAM,KACrB,QAAQ,MAAM,CAiBhB,CAAA;AAED,eAAO,MAAM,qBAAqB,YACvB,OAAO,UACR,YAAY,EAAE,gBACR,MAAM,KACnB,QAAQ,qBAAqB,EAAE,CAmCjC,CAAA;AAED,eAAO,MAAM,iBAAiB,UACrB,KAAK,gBACE,MAAM,kBACJ,MAAM,KACrB,QAAQ,MAAM,GAAG,SAAS,CAa5B,CAAA;AAED,eAAO,MAAM,0BAA0B,iBACvB,MAAM,UACZ,YAAY,EAAE,KACrB,QAAQ,cAAc,EAAE,CA+B1B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/allowance/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA;AACjC,cAAc,YAAY,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Hash, WalletClient } from 'viem';
|
|
2
|
+
import type { InternalExecutionSettings } from '../execution/types.js';
|
|
3
|
+
import type { ApproveTokenRequest, RevokeApprovalRequest } from './types.js';
|
|
4
|
+
export declare const setAllowance: (walletClient: WalletClient, tokenAddress: string, contractAddress: string, amount: bigint, settings?: InternalExecutionSettings, returnPopulatedTransaction?: boolean) => Promise<Hash>;
|
|
5
|
+
export declare const setTokenAllowance: ({ walletClient, token, spenderAddress, amount, infiniteApproval, }: ApproveTokenRequest) => Promise<Hash | void>;
|
|
6
|
+
export declare const revokeTokenApproval: ({ walletClient, token, spenderAddress, }: RevokeApprovalRequest) => Promise<Hash | void>;
|
|
7
|
+
//# sourceMappingURL=setAllowance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setAllowance.d.ts","sourceRoot":"","sources":["../../../src/allowance/setAllowance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,IAAI,EAGJ,YAAY,EACb,MAAM,MAAM,CAAA;AAEb,OAAO,KAAK,EACV,yBAAyB,EAE1B,MAAM,uBAAuB,CAAA;AAK9B,OAAO,KAAK,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAE5E,eAAO,MAAM,YAAY,iBACT,YAAY,gBACZ,MAAM,mBACH,MAAM,UACf,MAAM,aACH,yBAAyB,+BACP,OAAO,KACnC,QAAQ,IAAI,CA4Cd,CAAA;AAED,eAAO,MAAM,iBAAiB,uEAM3B,mBAAmB,KAAG,QAAQ,IAAI,GAAG,IAAI,CAwB3C,CAAA;AAED,eAAO,MAAM,mBAAmB,6CAI7B,qBAAqB,KAAG,QAAQ,IAAI,GAAG,IAAI,CAqB7C,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
}
|
|
28
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/allowance/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAExC,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,KAAK,CAAA;IACZ,cAAc,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,KAAK,CAAA;IACZ,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,EAAE,KAAK,CAAA;IACZ,cAAc,EAAE,MAAM,CAAA;IACtB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,YAAY,CAAA;IAC1B,KAAK,EAAE,KAAK,CAAA;IACZ,cAAc,EAAE,MAAM,CAAA;IACtB,MAAM,EAAE,MAAM,CAAA;IACd,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B;AAED,MAAM,WAAW,qBAAqB;IACpC,YAAY,EAAE,YAAY,CAAA;IAC1B,KAAK,EAAE,KAAK,CAAA;IACZ,cAAc,EAAE,MAAM,CAAA;CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getBalance.d.ts","sourceRoot":"","sources":["../../../src/balance/getBalance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAO9D,eAAO,MAAM,UAAU,kBACN,MAAM,UACb,KAAK,EAAE,KACd,QAAQ,WAAW,EAAE,CAkBvB,CAAA"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { Token, TokenAmount } from '@lifi/types';
|
|
1
|
+
import type { Token, TokenAmount } from '@lifi/types';
|
|
2
2
|
export declare const getTokenBalance: (walletAddress: string, token: Token) => Promise<TokenAmount | null>;
|
|
3
3
|
export declare const getTokenBalances: (walletAddress: string, tokens: Token[]) => Promise<TokenAmount[]>;
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const getTokenBalancesByChain: (walletAddress: string, tokensByChain: {
|
|
5
5
|
[chainId: number]: Token[];
|
|
6
6
|
}) => Promise<{
|
|
7
7
|
[chainId: number]: TokenAmount[];
|
|
8
8
|
}>;
|
|
9
|
+
//# sourceMappingURL=getTokenBalance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTokenBalance.d.ts","sourceRoot":"","sources":["../../../src/balance/getTokenBalance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAGrD,eAAO,MAAM,eAAe,kBACX,MAAM,SACd,KAAK,KACX,QAAQ,WAAW,GAAG,IAAI,CAG5B,CAAA;AAED,eAAO,MAAM,gBAAgB,kBACZ,MAAM,UACb,KAAK,EAAE,KACd,QAAQ,WAAW,EAAE,CAevB,CAAA;AAED,eAAO,MAAM,uBAAuB,kBACnB,MAAM;;;;EAYtB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/balance/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,sBAAsB,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ChainId } from '@lifi/types';
|
|
2
|
+
import type { PublicClient } from 'viem';
|
|
3
|
+
import type { Chain } from 'viem/chains';
|
|
4
|
+
export declare const getChainById: (chainId: ChainId) => Chain | undefined;
|
|
5
|
+
export declare const getRpcUrl: (chainId: ChainId) => Promise<string>;
|
|
6
|
+
export declare const getRpcUrls: (chainId: ChainId) => Promise<string[]>;
|
|
7
|
+
export declare const getPublicClient: (chainId: number) => Promise<PublicClient>;
|
|
8
|
+
export declare const getMulticallAddress: (chainId: ChainId) => Promise<string | undefined>;
|
|
9
|
+
//# sourceMappingURL=connectors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connectors.d.ts","sourceRoot":"","sources":["../../src/connectors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAExC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAQxC,eAAO,MAAM,YAAY,YAAa,OAAO,KAAG,KAAK,GAAG,SAEvD,CAAA;AAGD,eAAO,MAAM,SAAS,YAAmB,OAAO,KAAG,QAAQ,MAAM,CAGhE,CAAA;AAED,eAAO,MAAM,UAAU,YAAmB,OAAO,KAAG,QAAQ,MAAM,EAAE,CAInE,CAAA;AAED,eAAO,MAAM,eAAe,YACjB,MAAM,KACd,QAAQ,YAAY,CAoBtB,CAAA;AAGD,eAAO,MAAM,mBAAmB,YACrB,OAAO,KACf,QAAQ,MAAM,GAAG,SAAS,CAI5B,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const AddressZero = "0x0000000000000000000000000000000000000000";
|
|
2
|
+
export declare const AlternativeAddressZero = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
|
|
3
|
+
/**
|
|
4
|
+
* Cronos require bigger multicall chunks than default 1024 (1 KB)
|
|
5
|
+
*/
|
|
6
|
+
export declare const MulticallBatchSize = 16384;
|
|
7
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,+CAA+C,CAAA;AACvE,eAAO,MAAM,sBAAsB,+CACW,CAAA;AAC9C;;GAEG;AACH,eAAO,MAAM,kBAAkB,QAAS,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { LiFiStep } from '@lifi/types';
|
|
2
|
+
import type { StatusManager } from './StatusManager.js';
|
|
3
|
+
import type { InteractionSettings, InternalExecutionSettings, StepExecutorOptions } from './types.js';
|
|
4
|
+
export declare abstract class BaseStepExecutor {
|
|
5
|
+
settings: InternalExecutionSettings;
|
|
6
|
+
statusManager: StatusManager;
|
|
7
|
+
allowUserInteraction: boolean;
|
|
8
|
+
allowExecution: boolean;
|
|
9
|
+
constructor(options: StepExecutorOptions);
|
|
10
|
+
setInteraction: (settings?: InteractionSettings) => void;
|
|
11
|
+
abstract executeStep(step: LiFiStep): Promise<LiFiStep>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=BaseStepExecutor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseStepExecutor.d.ts","sourceRoot":"","sources":["../../../src/execution/BaseStepExecutor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,KAAK,EACV,mBAAmB,EACnB,yBAAyB,EACzB,mBAAmB,EACpB,MAAM,YAAY,CAAA;AASnB,8BAAsB,gBAAgB;IACpC,QAAQ,EAAE,yBAAyB,CAAA;IACnC,aAAa,EAAE,aAAa,CAAA;IAE5B,oBAAoB,UAAO;IAC3B,cAAc,UAAO;gBAET,OAAO,EAAE,mBAAmB;IAKxC,cAAc,cAAe,mBAAmB,KAAG,IAAI,CAQtD;IAED,QAAQ,CAAC,WAAW,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;CACxD"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { LiFiStep } from '@lifi/types';
|
|
2
|
+
import type { WalletClient } from 'viem';
|
|
3
|
+
import { BaseStepExecutor } from './BaseStepExecutor.js';
|
|
4
|
+
import type { StepExecutorOptions } from './types.js';
|
|
5
|
+
export interface EVMStepExecutorOptions extends StepExecutorOptions {
|
|
6
|
+
walletClient: WalletClient;
|
|
7
|
+
}
|
|
8
|
+
export declare class EVMStepExecutor extends BaseStepExecutor {
|
|
9
|
+
walletClient: WalletClient;
|
|
10
|
+
constructor(options: EVMStepExecutorOptions);
|
|
11
|
+
checkChain: () => never;
|
|
12
|
+
executeStep: (step: LiFiStep) => Promise<LiFiStep>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=EVMStepExecutor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EVMStepExecutor.d.ts","sourceRoot":"","sources":["../../../src/execution/EVMStepExecutor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,QAAQ,EACT,MAAM,aAAa,CAAA;AACpB,OAAO,KAAK,EAMV,YAAY,EACb,MAAM,MAAM,CAAA;AAcb,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAMxD,OAAO,KAAK,EAEV,mBAAmB,EAEpB,MAAM,YAAY,CAAA;AAInB,MAAM,WAAW,sBAAuB,SAAQ,mBAAmB;IACjE,YAAY,EAAE,YAAY,CAAA;CAC3B;AAED,qBAAa,eAAgB,SAAQ,gBAAgB;IACnD,YAAY,EAAE,YAAY,CAAA;gBAEd,OAAO,EAAE,sBAAsB;IAQ3C,UAAU,cAET;IAED,WAAW,SAAgB,QAAQ,KAAG,QAAQ,QAAQ,CAAC,CA8ZtD;CACF"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { Route } from '@lifi/types';
|
|
2
|
+
import type { ProviderType, SDKProvider } from '../providers/types.js';
|
|
3
|
+
import { ConfigService } from '../services/ConfigService.js';
|
|
4
|
+
import type { SDKOptions } from '../types/index.js';
|
|
5
|
+
import type { ExecutionSettings } from './types.js';
|
|
6
|
+
export declare class RouteExecutionManager {
|
|
7
|
+
private executionDictionary;
|
|
8
|
+
private executionPromiseDictionary;
|
|
9
|
+
protected configService: ConfigService;
|
|
10
|
+
private providers?;
|
|
11
|
+
constructor(options: SDKOptions);
|
|
12
|
+
/**
|
|
13
|
+
* Execute a route.
|
|
14
|
+
* @param route - The route that should be executed. Cannot be an active route.
|
|
15
|
+
* @param settings - An object containing settings and callbacks.
|
|
16
|
+
* @returns The executed route.
|
|
17
|
+
* @throws {LiFiError} Throws a LiFiError if the execution fails.
|
|
18
|
+
*/
|
|
19
|
+
executeRoute: (route: Route, settings?: ExecutionSettings) => Promise<Route>;
|
|
20
|
+
/**
|
|
21
|
+
* Resume the execution of a route that has been stopped or had an error while executing.
|
|
22
|
+
* @param route - The route that is to be executed. Cannot be an active route.
|
|
23
|
+
* @param settings - An object containing settings and callbacks.
|
|
24
|
+
* @returns The executed route.
|
|
25
|
+
* @throws {LiFiError} Throws a LiFiError if the execution fails.
|
|
26
|
+
*/
|
|
27
|
+
resumeRoute: (route: Route, settings?: ExecutionSettings) => Promise<Route>;
|
|
28
|
+
private executeSteps;
|
|
29
|
+
/**
|
|
30
|
+
* Updates route execution to background or foreground state.
|
|
31
|
+
* @param route - A route that is currently in execution.
|
|
32
|
+
* @param settings - An object with execution settings.
|
|
33
|
+
*/
|
|
34
|
+
updateRouteExecution: (route: Route, settings: Pick<ExecutionSettings, 'executeInBackground'>) => void;
|
|
35
|
+
/**
|
|
36
|
+
* Update the ExecutionSettings for an active route.
|
|
37
|
+
* @param settings - An object with execution settings.
|
|
38
|
+
* @param route - The active route that gets the new execution settings.
|
|
39
|
+
* @throws {ValidationError} Throws a ValidationError if parameters are invalid.
|
|
40
|
+
*/
|
|
41
|
+
updateExecutionSettings: (settings: ExecutionSettings, route: Route) => void;
|
|
42
|
+
/**
|
|
43
|
+
* Stops the execution of an active route.
|
|
44
|
+
* @param route - A route that is currently in execution.
|
|
45
|
+
* @returns The stopped route.
|
|
46
|
+
*/
|
|
47
|
+
stopExecution: (route: Route) => Route;
|
|
48
|
+
/**
|
|
49
|
+
* Get the list of active routes.
|
|
50
|
+
* @returns A list of routes.
|
|
51
|
+
*/
|
|
52
|
+
getActiveRoutes: () => Route[];
|
|
53
|
+
/**
|
|
54
|
+
* Return the current route information for given route. The route has to be active.
|
|
55
|
+
* @param route - A route object.
|
|
56
|
+
* @returns The updated route.
|
|
57
|
+
*/
|
|
58
|
+
getActiveRoute: (route: Route) => Route | undefined;
|
|
59
|
+
getProvider: (type: ProviderType) => SDKProvider | undefined;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=RouteExecutionManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RouteExecutionManager.d.ts","sourceRoot":"","sources":["../../../src/execution/RouteExecutionManager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAInD,OAAO,KAAK,EACV,iBAAiB,EAIlB,MAAM,YAAY,CAAA;AAEnB,qBAAa,qBAAqB;IAChC,OAAO,CAAC,mBAAmB,CAA+B;IAC1D,OAAO,CAAC,0BAA0B,CAAsC;IACxE,SAAS,CAAC,aAAa,EAAE,aAAa,CAAA;IACtC,OAAO,CAAC,SAAS,CAAC,CAAe;gBAErB,OAAO,EAAE,UAAU;IAM/B;;;;;;OAMG;IACH,YAAY,UACH,KAAK,aACD,iBAAiB,KAC3B,QAAQ,KAAK,CAAC,CAehB;IAED;;;;;;OAMG;IACH,WAAW,UACF,KAAK,aACD,iBAAiB,KAC3B,QAAQ,KAAK,CAAC,CA2BhB;IAED,OAAO,CAAC,YAAY,CAmFnB;IAED;;;;OAIG;IACH,oBAAoB,UACX,KAAK,YACF,KAAK,iBAAiB,EAAE,qBAAqB,CAAC,KACvD,IAAI,CAiBN;IAED;;;;;OAKG;IACH,uBAAuB,aACX,iBAAiB,SACpB,KAAK,KACX,IAAI,CAcN;IAED;;;;OAIG;IACH,aAAa,UAAW,KAAK,KAAG,KAAK,CAepC;IAED;;;OAGG;IACH,eAAe,QAAO,KAAK,EAAE,CAI5B;IAED;;;;OAIG;IACH,cAAc,UAAW,KAAK,KAAG,KAAK,GAAG,SAAS,CAEjD;IAED,WAAW,SAAU,YAAY,KAAG,WAAW,GAAG,SAAS,CAE1D;CACF"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { Execution, LiFiStep, Process, ProcessType, Route, Status, Token } from '@lifi/types';
|
|
2
|
+
import type { InternalExecutionSettings } from './types.js';
|
|
3
|
+
interface Receipt {
|
|
4
|
+
fromAmount?: string;
|
|
5
|
+
toAmount?: string;
|
|
6
|
+
toToken?: Token;
|
|
7
|
+
gasPrice?: string;
|
|
8
|
+
gasUsed?: string;
|
|
9
|
+
gasToken?: Token;
|
|
10
|
+
gasAmount?: string;
|
|
11
|
+
gasAmountUSD?: string;
|
|
12
|
+
}
|
|
13
|
+
type InternalUpdateRouteCallback = (route: Route) => void;
|
|
14
|
+
type OptionalParameters = Partial<Pick<Process, 'doneAt' | 'failedAt' | 'txHash' | 'txLink' | 'error' | 'substatus' | 'substatusMessage' | 'multisigTxHash'>>;
|
|
15
|
+
/**
|
|
16
|
+
* Manages status updates of a route and provides various functions for tracking processes
|
|
17
|
+
* @param {Route} route The route this StatusManger belongs to.
|
|
18
|
+
* @param {InternalExecutionSettings} settings The ExecutionSettings for this route.
|
|
19
|
+
* @param {InternalUpdateRouteCallback} internalUpdateRouteCallback Internal callback to propage route changes.
|
|
20
|
+
* @returns {StatusManager} An instance of StatusManager.
|
|
21
|
+
*/
|
|
22
|
+
export declare class StatusManager {
|
|
23
|
+
private readonly route;
|
|
24
|
+
private readonly settings;
|
|
25
|
+
private readonly internalUpdateRouteCallback;
|
|
26
|
+
private shouldUpdate;
|
|
27
|
+
constructor(route: Route, settings: InternalExecutionSettings, internalUpdateRouteCallback: InternalUpdateRouteCallback);
|
|
28
|
+
/**
|
|
29
|
+
* Initializes the execution object of a Step.
|
|
30
|
+
* @param step The current step in execution
|
|
31
|
+
* @returns The initialized execution object for this step and a function to update this step
|
|
32
|
+
*/
|
|
33
|
+
initExecutionObject: (step: LiFiStep) => Execution;
|
|
34
|
+
/**
|
|
35
|
+
* Updates the execution object of a Step.
|
|
36
|
+
* @param step The current step in execution
|
|
37
|
+
* @param status The status for the execution
|
|
38
|
+
* @param receipt Optional. Information about received tokens
|
|
39
|
+
* @returns The step with the updated execution object
|
|
40
|
+
*/
|
|
41
|
+
updateExecution(step: LiFiStep, status: Status, receipt?: Receipt): LiFiStep;
|
|
42
|
+
/**
|
|
43
|
+
* Create and push a new process into the execution.
|
|
44
|
+
* @param step The step that should contain the new process.
|
|
45
|
+
* @param type Type of the process. Used to identify already existing processes.
|
|
46
|
+
* @param status By default created procces is set to the STARTED status. We can override new process with the needed status.
|
|
47
|
+
* @returns Returns process.
|
|
48
|
+
*/
|
|
49
|
+
findOrCreateProcess: (step: LiFiStep, type: ProcessType, status?: Status) => Process;
|
|
50
|
+
/**
|
|
51
|
+
* Update a process object.
|
|
52
|
+
* @param step The step where the process should be updated
|
|
53
|
+
* @param type The process type to update
|
|
54
|
+
* @param status The status the process gets.
|
|
55
|
+
* @param [params] Additional parameters to append to the process.
|
|
56
|
+
* @returns The update process
|
|
57
|
+
*/
|
|
58
|
+
updateProcess: (step: LiFiStep, type: ProcessType, status: Status, params?: OptionalParameters) => Process;
|
|
59
|
+
/**
|
|
60
|
+
* Remove a process from the execution
|
|
61
|
+
* @param step The step where the process should be removed from
|
|
62
|
+
* @param type The process type to remove
|
|
63
|
+
*/
|
|
64
|
+
removeProcess: (step: LiFiStep, type: ProcessType) => void;
|
|
65
|
+
updateStepInRoute: (step: LiFiStep) => LiFiStep;
|
|
66
|
+
allowUpdates(value: boolean): void;
|
|
67
|
+
}
|
|
68
|
+
export {};
|
|
69
|
+
//# sourceMappingURL=StatusManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatusManager.d.ts","sourceRoot":"","sources":["../../../src/execution/StatusManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,QAAQ,EACR,OAAO,EACP,WAAW,EACX,KAAK,EACL,MAAM,EACN,KAAK,EACN,MAAM,aAAa,CAAA;AAEpB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAA;AAG3D,UAAU,OAAO;IACf,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,KAAK,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,KAAK,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,KAAK,2BAA2B,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAA;AAEzD,KAAK,kBAAkB,GAAG,OAAO,CAC/B,IAAI,CACF,OAAO,EACL,QAAQ,GACR,UAAU,GACV,QAAQ,GACR,QAAQ,GACR,OAAO,GACP,WAAW,GACX,kBAAkB,GAClB,gBAAgB,CACnB,CACF,CAAA;AAED;;;;;;GAMG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAO;IAC7B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA2B;IACpD,OAAO,CAAC,QAAQ,CAAC,2BAA2B,CAA6B;IACzE,OAAO,CAAC,YAAY,CAAO;gBAGzB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,yBAAyB,EACnC,2BAA2B,EAAE,2BAA2B;IAO1D;;;;OAIG;IACH,mBAAmB,SAAU,QAAQ,KAAG,SAAS,CAiBhD;IAED;;;;;;OAMG;IACH,eAAe,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ;IAe5E;;;;;;OAMG;IACH,mBAAmB,SACX,QAAQ,QACR,WAAW,WACR,MAAM,KACd,OAAO,CAyBT;IAED;;;;;;;OAOG;IACH,aAAa,SACL,QAAQ,QACR,WAAW,UACT,MAAM,WACL,kBAAkB,KAC1B,OAAO,CAkDT;IAED;;;;OAIG;IACH,aAAa,SAAU,QAAQ,QAAQ,WAAW,KAAG,IAAI,CAOxD;IAED,iBAAiB,SAAU,QAAQ,KAAG,QAAQ,CAqB7C;IAED,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;CAGnC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { LiFiStep } from '@lifi/types';
|
|
2
|
+
import type { ExecutionParams } from './types.js';
|
|
3
|
+
export declare class StepExecutionManager {
|
|
4
|
+
allowUserInteraction: boolean;
|
|
5
|
+
allowInteraction: (value: boolean) => void;
|
|
6
|
+
execute: ({ walletClient, step, statusManager, settings, }: ExecutionParams) => Promise<LiFiStep>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=StepExecutionManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StepExecutionManager.d.ts","sourceRoot":"","sources":["../../../src/execution/StepExecutionManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,QAAQ,EACT,MAAM,aAAa,CAAA;AAyBpB,OAAO,KAAK,EAEV,eAAe,EAEhB,MAAM,YAAY,CAAA;AAInB,qBAAa,oBAAoB;IAC/B,oBAAoB,UAAO;IAE3B,gBAAgB,UAAW,OAAO,KAAG,IAAI,CAExC;IAED,OAAO,qDAKJ,eAAe,KAAG,QAAQ,QAAQ,CAAC,CA+WrC;CACF"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Chain, LiFiStep } from '@lifi/types';
|
|
2
|
+
import type { Hash, WalletClient } from 'viem';
|
|
3
|
+
import type { StatusManager } from '../execution/StatusManager.js';
|
|
4
|
+
import type { InternalExecutionSettings } from './types.js';
|
|
5
|
+
export declare const checkAllowance: (walletClient: WalletClient, step: LiFiStep, statusManager: StatusManager, settings: InternalExecutionSettings, chain: Chain, allowUserInteraction?: boolean, shouldBatchTransactions?: boolean) => Promise<Hash | void>;
|
|
6
|
+
//# sourceMappingURL=checkAllowance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkAllowance.d.ts","sourceRoot":"","sources":["../../../src/execution/checkAllowance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAwB,MAAM,aAAa,CAAA;AACxE,OAAO,KAAK,EAAW,IAAI,EAAqB,YAAY,EAAE,MAAM,MAAM,CAAA;AAG1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAGlE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAA;AAE3D,eAAO,MAAM,cAAc,iBACX,YAAY,QACpB,QAAQ,iBACC,aAAa,YAClB,yBAAyB,SAC5B,KAAK,wEAGX,QAAQ,IAAI,GAAG,IAAI,CA8FrB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkBalance.d.ts","sourceRoot":"","sources":["../../../src/execution/checkBalance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAK3C,eAAO,MAAM,YAAY,kBACR,MAAM,QACf,QAAQ,qBAEb,QAAQ,IAAI,CAsCd,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/execution/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,YAAY,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ExtendedChain, LiFiStep, ProcessType } from '@lifi/types';
|
|
2
|
+
import type { Hash } from 'viem';
|
|
3
|
+
import type { StatusManager } from './StatusManager.js';
|
|
4
|
+
export declare const updateMultisigRouteProcess: (internalTxHash: Hash, step: LiFiStep, statusManager: StatusManager, processType: ProcessType, fromChain: ExtendedChain) => Promise<void>;
|
|
5
|
+
//# sourceMappingURL=multisig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multisig.d.ts","sourceRoot":"","sources":["../../../src/execution/multisig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACvE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAGhC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAGvD,eAAO,MAAM,0BAA0B,mBACrB,IAAI,QACd,QAAQ,iBACC,aAAa,eACf,WAAW,aACb,aAAa,kBA0CzB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prepareRestart.d.ts","sourceRoot":"","sources":["../../../src/execution/prepareRestart.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAY,KAAK,EAAE,MAAM,aAAa,CAAA;AAElD,eAAO,MAAM,cAAc,UAAiB,KAAK,kBAWhD,CAAA"}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { LiFiStep } from '@lifi/types';
|
|
2
|
+
import type { StatusManager } from './StatusManager.js';
|
|
3
|
+
import type { InternalExecutionSettings } from './types.js';
|
|
3
4
|
/**
|
|
4
5
|
* This method checks whether the new and updated Step meets the required exchange rate conditions.
|
|
5
6
|
* If yes it returns the updated Step.
|
|
6
7
|
* If no and if user interaction is allowed it triggers the acceptExchangeRateUpdateHook. If no user interaction is allowed it aborts.
|
|
7
|
-
*
|
|
8
8
|
* @param statusManager
|
|
9
9
|
* @param oldStep
|
|
10
10
|
* @param newStep
|
|
11
11
|
* @param settings
|
|
12
12
|
* @param allowUserInteraction
|
|
13
|
+
* @returns Return LiFiStep
|
|
13
14
|
*/
|
|
14
|
-
export declare const stepComparison: (statusManager: StatusManager, oldStep:
|
|
15
|
+
export declare const stepComparison: (statusManager: StatusManager, oldStep: LiFiStep, newStep: LiFiStep, settings: InternalExecutionSettings, allowUserInteraction: boolean) => Promise<LiFiStep>;
|
|
16
|
+
//# sourceMappingURL=stepComparison.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stepComparison.d.ts","sourceRoot":"","sources":["../../../src/execution/stepComparison.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAA;AAG3D;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,kBACV,aAAa,WACnB,QAAQ,WACR,QAAQ,YACP,yBAAyB,wBACb,OAAO,KAC5B,QAAQ,QAAQ,CA0BlB,CAAA"}
|