@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
|
@@ -1,313 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"inputs": [
|
|
4
|
-
{
|
|
5
|
-
"components": [
|
|
6
|
-
{
|
|
7
|
-
"internalType": "address",
|
|
8
|
-
"name": "target",
|
|
9
|
-
"type": "address"
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
"internalType": "bytes",
|
|
13
|
-
"name": "callData",
|
|
14
|
-
"type": "bytes"
|
|
15
|
-
}
|
|
16
|
-
],
|
|
17
|
-
"internalType": "struct Multicall2.Call[]",
|
|
18
|
-
"name": "calls",
|
|
19
|
-
"type": "tuple[]"
|
|
20
|
-
}
|
|
21
|
-
],
|
|
22
|
-
"name": "aggregate",
|
|
23
|
-
"outputs": [
|
|
24
|
-
{
|
|
25
|
-
"internalType": "uint256",
|
|
26
|
-
"name": "blockNumber",
|
|
27
|
-
"type": "uint256"
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"internalType": "bytes[]",
|
|
31
|
-
"name": "returnData",
|
|
32
|
-
"type": "bytes[]"
|
|
33
|
-
}
|
|
34
|
-
],
|
|
35
|
-
"stateMutability": "view",
|
|
36
|
-
"type": "function"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
"inputs": [
|
|
40
|
-
{
|
|
41
|
-
"components": [
|
|
42
|
-
{
|
|
43
|
-
"internalType": "address",
|
|
44
|
-
"name": "target",
|
|
45
|
-
"type": "address"
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
"internalType": "bytes",
|
|
49
|
-
"name": "callData",
|
|
50
|
-
"type": "bytes"
|
|
51
|
-
}
|
|
52
|
-
],
|
|
53
|
-
"internalType": "struct Multicall2.Call[]",
|
|
54
|
-
"name": "calls",
|
|
55
|
-
"type": "tuple[]"
|
|
56
|
-
}
|
|
57
|
-
],
|
|
58
|
-
"name": "blockAndAggregate",
|
|
59
|
-
"outputs": [
|
|
60
|
-
{
|
|
61
|
-
"internalType": "uint256",
|
|
62
|
-
"name": "blockNumber",
|
|
63
|
-
"type": "uint256"
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
"internalType": "bytes32",
|
|
67
|
-
"name": "blockHash",
|
|
68
|
-
"type": "bytes32"
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
"components": [
|
|
72
|
-
{
|
|
73
|
-
"internalType": "bool",
|
|
74
|
-
"name": "success",
|
|
75
|
-
"type": "bool"
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
"internalType": "bytes",
|
|
79
|
-
"name": "returnData",
|
|
80
|
-
"type": "bytes"
|
|
81
|
-
}
|
|
82
|
-
],
|
|
83
|
-
"internalType": "struct Multicall2.Result[]",
|
|
84
|
-
"name": "returnData",
|
|
85
|
-
"type": "tuple[]"
|
|
86
|
-
}
|
|
87
|
-
],
|
|
88
|
-
"stateMutability": "nonpayable",
|
|
89
|
-
"type": "function"
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
"inputs": [
|
|
93
|
-
{
|
|
94
|
-
"internalType": "uint256",
|
|
95
|
-
"name": "blockNumber",
|
|
96
|
-
"type": "uint256"
|
|
97
|
-
}
|
|
98
|
-
],
|
|
99
|
-
"name": "getBlockHash",
|
|
100
|
-
"outputs": [
|
|
101
|
-
{
|
|
102
|
-
"internalType": "bytes32",
|
|
103
|
-
"name": "blockHash",
|
|
104
|
-
"type": "bytes32"
|
|
105
|
-
}
|
|
106
|
-
],
|
|
107
|
-
"stateMutability": "view",
|
|
108
|
-
"type": "function"
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
"inputs": [],
|
|
112
|
-
"name": "getBlockNumber",
|
|
113
|
-
"outputs": [
|
|
114
|
-
{
|
|
115
|
-
"internalType": "uint256",
|
|
116
|
-
"name": "blockNumber",
|
|
117
|
-
"type": "uint256"
|
|
118
|
-
}
|
|
119
|
-
],
|
|
120
|
-
"stateMutability": "view",
|
|
121
|
-
"type": "function"
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
"inputs": [],
|
|
125
|
-
"name": "getCurrentBlockCoinbase",
|
|
126
|
-
"outputs": [
|
|
127
|
-
{
|
|
128
|
-
"internalType": "address",
|
|
129
|
-
"name": "coinbase",
|
|
130
|
-
"type": "address"
|
|
131
|
-
}
|
|
132
|
-
],
|
|
133
|
-
"stateMutability": "view",
|
|
134
|
-
"type": "function"
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
"inputs": [],
|
|
138
|
-
"name": "getCurrentBlockDifficulty",
|
|
139
|
-
"outputs": [
|
|
140
|
-
{
|
|
141
|
-
"internalType": "uint256",
|
|
142
|
-
"name": "difficulty",
|
|
143
|
-
"type": "uint256"
|
|
144
|
-
}
|
|
145
|
-
],
|
|
146
|
-
"stateMutability": "view",
|
|
147
|
-
"type": "function"
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
"inputs": [],
|
|
151
|
-
"name": "getCurrentBlockGasLimit",
|
|
152
|
-
"outputs": [
|
|
153
|
-
{
|
|
154
|
-
"internalType": "uint256",
|
|
155
|
-
"name": "gaslimit",
|
|
156
|
-
"type": "uint256"
|
|
157
|
-
}
|
|
158
|
-
],
|
|
159
|
-
"stateMutability": "view",
|
|
160
|
-
"type": "function"
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
"inputs": [],
|
|
164
|
-
"name": "getCurrentBlockTimestamp",
|
|
165
|
-
"outputs": [
|
|
166
|
-
{
|
|
167
|
-
"internalType": "uint256",
|
|
168
|
-
"name": "timestamp",
|
|
169
|
-
"type": "uint256"
|
|
170
|
-
}
|
|
171
|
-
],
|
|
172
|
-
"stateMutability": "view",
|
|
173
|
-
"type": "function"
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
"inputs": [
|
|
177
|
-
{
|
|
178
|
-
"internalType": "address",
|
|
179
|
-
"name": "addr",
|
|
180
|
-
"type": "address"
|
|
181
|
-
}
|
|
182
|
-
],
|
|
183
|
-
"name": "getEthBalance",
|
|
184
|
-
"outputs": [
|
|
185
|
-
{
|
|
186
|
-
"internalType": "uint256",
|
|
187
|
-
"name": "balance",
|
|
188
|
-
"type": "uint256"
|
|
189
|
-
}
|
|
190
|
-
],
|
|
191
|
-
"stateMutability": "view",
|
|
192
|
-
"type": "function"
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
"inputs": [],
|
|
196
|
-
"name": "getLastBlockHash",
|
|
197
|
-
"outputs": [
|
|
198
|
-
{
|
|
199
|
-
"internalType": "bytes32",
|
|
200
|
-
"name": "blockHash",
|
|
201
|
-
"type": "bytes32"
|
|
202
|
-
}
|
|
203
|
-
],
|
|
204
|
-
"stateMutability": "view",
|
|
205
|
-
"type": "function"
|
|
206
|
-
},
|
|
207
|
-
{
|
|
208
|
-
"inputs": [
|
|
209
|
-
{
|
|
210
|
-
"internalType": "bool",
|
|
211
|
-
"name": "requireSuccess",
|
|
212
|
-
"type": "bool"
|
|
213
|
-
},
|
|
214
|
-
{
|
|
215
|
-
"components": [
|
|
216
|
-
{
|
|
217
|
-
"internalType": "address",
|
|
218
|
-
"name": "target",
|
|
219
|
-
"type": "address"
|
|
220
|
-
},
|
|
221
|
-
{
|
|
222
|
-
"internalType": "bytes",
|
|
223
|
-
"name": "callData",
|
|
224
|
-
"type": "bytes"
|
|
225
|
-
}
|
|
226
|
-
],
|
|
227
|
-
"internalType": "struct Multicall2.Call[]",
|
|
228
|
-
"name": "calls",
|
|
229
|
-
"type": "tuple[]"
|
|
230
|
-
}
|
|
231
|
-
],
|
|
232
|
-
"name": "tryAggregate",
|
|
233
|
-
"outputs": [
|
|
234
|
-
{
|
|
235
|
-
"components": [
|
|
236
|
-
{
|
|
237
|
-
"internalType": "bool",
|
|
238
|
-
"name": "success",
|
|
239
|
-
"type": "bool"
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
"internalType": "bytes",
|
|
243
|
-
"name": "returnData",
|
|
244
|
-
"type": "bytes"
|
|
245
|
-
}
|
|
246
|
-
],
|
|
247
|
-
"internalType": "struct Multicall2.Result[]",
|
|
248
|
-
"name": "returnData",
|
|
249
|
-
"type": "tuple[]"
|
|
250
|
-
}
|
|
251
|
-
],
|
|
252
|
-
"stateMutability": "view",
|
|
253
|
-
"type": "function"
|
|
254
|
-
},
|
|
255
|
-
{
|
|
256
|
-
"inputs": [
|
|
257
|
-
{
|
|
258
|
-
"internalType": "bool",
|
|
259
|
-
"name": "requireSuccess",
|
|
260
|
-
"type": "bool"
|
|
261
|
-
},
|
|
262
|
-
{
|
|
263
|
-
"components": [
|
|
264
|
-
{
|
|
265
|
-
"internalType": "address",
|
|
266
|
-
"name": "target",
|
|
267
|
-
"type": "address"
|
|
268
|
-
},
|
|
269
|
-
{
|
|
270
|
-
"internalType": "bytes",
|
|
271
|
-
"name": "callData",
|
|
272
|
-
"type": "bytes"
|
|
273
|
-
}
|
|
274
|
-
],
|
|
275
|
-
"internalType": "struct Multicall2.Call[]",
|
|
276
|
-
"name": "calls",
|
|
277
|
-
"type": "tuple[]"
|
|
278
|
-
}
|
|
279
|
-
],
|
|
280
|
-
"name": "tryBlockAndAggregate",
|
|
281
|
-
"outputs": [
|
|
282
|
-
{
|
|
283
|
-
"internalType": "uint256",
|
|
284
|
-
"name": "blockNumber",
|
|
285
|
-
"type": "uint256"
|
|
286
|
-
},
|
|
287
|
-
{
|
|
288
|
-
"internalType": "bytes32",
|
|
289
|
-
"name": "blockHash",
|
|
290
|
-
"type": "bytes32"
|
|
291
|
-
},
|
|
292
|
-
{
|
|
293
|
-
"components": [
|
|
294
|
-
{
|
|
295
|
-
"internalType": "bool",
|
|
296
|
-
"name": "success",
|
|
297
|
-
"type": "bool"
|
|
298
|
-
},
|
|
299
|
-
{
|
|
300
|
-
"internalType": "bytes",
|
|
301
|
-
"name": "returnData",
|
|
302
|
-
"type": "bytes"
|
|
303
|
-
}
|
|
304
|
-
],
|
|
305
|
-
"internalType": "struct Multicall2.Result[]",
|
|
306
|
-
"name": "returnData",
|
|
307
|
-
"type": "tuple[]"
|
|
308
|
-
}
|
|
309
|
-
],
|
|
310
|
-
"stateMutability": "view",
|
|
311
|
-
"type": "function"
|
|
312
|
-
}
|
|
313
|
-
]
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { LifiStep, Process } from '@lifi/types';
|
|
2
|
-
import { LifiError } from './errors';
|
|
3
|
-
/**
|
|
4
|
-
* Available MetaMask error codes:
|
|
5
|
-
*
|
|
6
|
-
* export const errorCodes: ErrorCodes = {
|
|
7
|
-
rpc: {
|
|
8
|
-
invalidInput: -32000,
|
|
9
|
-
resourceNotFound: -32001,
|
|
10
|
-
resourceUnavailable: -32002,
|
|
11
|
-
transactionRejected: -32003,
|
|
12
|
-
methodNotSupported: -32004,
|
|
13
|
-
limitExceeded: -32005,
|
|
14
|
-
parse: -32700,
|
|
15
|
-
invalidRequest: -32600,
|
|
16
|
-
methodNotFound: -32601,
|
|
17
|
-
invalidParams: -32602,
|
|
18
|
-
internal: -32603,
|
|
19
|
-
},
|
|
20
|
-
provider: {
|
|
21
|
-
userRejectedRequest: 4001,
|
|
22
|
-
unauthorized: 4100,
|
|
23
|
-
unsupportedMethod: 4200,
|
|
24
|
-
disconnected: 4900,
|
|
25
|
-
chainDisconnected: 4901,
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
*
|
|
29
|
-
* For more information about error codes supported by metamask check
|
|
30
|
-
* https://github.com/MetaMask/eth-rpc-errors
|
|
31
|
-
* https://eips.ethereum.org/EIPS/eip-1474#error-codes
|
|
32
|
-
* https://eips.ethereum.org/EIPS/eip-1193#provider-errors
|
|
33
|
-
*/
|
|
34
|
-
export declare const getTransactionNotSentMessage: (step?: LifiStep, process?: Process) => Promise<string>;
|
|
35
|
-
export declare const getTransactionFailedMessage: (step: LifiStep, txLink?: string) => Promise<string>;
|
|
36
|
-
export declare const parseError: (e: any, step?: LifiStep, process?: Process) => Promise<LifiError>;
|
|
37
|
-
export declare const parseBackendError: (e: any) => Promise<LifiError>;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.handlePreRestart = void 0;
|
|
4
|
-
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
5
|
-
const ethers_1 = require("ethers");
|
|
6
|
-
const errors_1 = require("./errors");
|
|
7
|
-
const handlePreRestart = async (route, signer) => {
|
|
8
|
-
for (let index = 0; index < route.steps.length; index++) {
|
|
9
|
-
const stepHasFailed = route.steps[index].execution?.status === 'FAILED';
|
|
10
|
-
if (stepHasFailed) {
|
|
11
|
-
await handleErrorType(route, index, signer);
|
|
12
|
-
deleteFailedProcesses(route, index);
|
|
13
|
-
deleteTransactionData(route, index);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
exports.handlePreRestart = handlePreRestart;
|
|
18
|
-
const handleErrorType = async (route, index, signer) => {
|
|
19
|
-
const isGasLimitError = route.steps[index].execution?.process.some((p) => p.error?.code === errors_1.LifiErrorCode.GasLimitError);
|
|
20
|
-
const isGasPriceError = route.steps[index].execution?.process.some((p) => p.error?.code === errors_1.LifiErrorCode.TransactionUnderpriced);
|
|
21
|
-
const { transactionRequest } = route.steps[index];
|
|
22
|
-
if (isGasLimitError) {
|
|
23
|
-
if (transactionRequest) {
|
|
24
|
-
let gasLimit = transactionRequest.gasLimit;
|
|
25
|
-
try {
|
|
26
|
-
gasLimit = await signer.estimateGas(transactionRequest);
|
|
27
|
-
}
|
|
28
|
-
catch (error) { }
|
|
29
|
-
if (gasLimit) {
|
|
30
|
-
transactionRequest.gasLimit = ethers_1.BigNumber.from(`${(BigInt(gasLimit.toString()) * 125n) / 100n}`);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
route.steps[index].estimate.gasCosts?.forEach((gasCost) => (gasCost.limit = `${Math.round(Number(gasCost.limit) * 1.25)}`));
|
|
34
|
-
}
|
|
35
|
-
if (isGasPriceError) {
|
|
36
|
-
if (transactionRequest) {
|
|
37
|
-
let gasPrice = transactionRequest.gasPrice;
|
|
38
|
-
try {
|
|
39
|
-
gasPrice = await signer.getGasPrice();
|
|
40
|
-
}
|
|
41
|
-
catch (error) { }
|
|
42
|
-
if (gasPrice) {
|
|
43
|
-
transactionRequest.gasPrice = ethers_1.BigNumber.from(`${(BigInt(gasPrice.toString()) * 125n) / 100n}`);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
route.steps[index].estimate.gasCosts?.forEach((gasCost) => (gasCost.price = `${Math.round(Number(gasCost.price) * 1.25)}`));
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
const deleteFailedProcesses = (route, index) => {
|
|
50
|
-
if (route.steps[index].execution) {
|
|
51
|
-
route.steps[index].execution.process = route.steps[index].execution.process.filter((process) => process.status === 'DONE');
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
const deleteTransactionData = (route, index) => {
|
|
55
|
-
route.steps[index].transactionRequest = undefined;
|
|
56
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { TransactionReceipt } from '@ethersproject/providers';
|
|
2
|
-
import { LifiStep, Token } from '@lifi/types';
|
|
3
|
-
import BigNumber from 'bignumber.js';
|
|
4
|
-
import { Signer } from 'ethers';
|
|
5
|
-
import { ChainId } from '../types';
|
|
6
|
-
export declare const sleep: (mills: number) => Promise<undefined>;
|
|
7
|
-
export declare const personalizeStep: (signer: Signer, step: LifiStep) => Promise<LifiStep>;
|
|
8
|
-
export declare const splitListIntoChunks: <T>(list: T[], chunkSize: number) => T[][];
|
|
9
|
-
export declare const formatTokenAmountOnly: (token: Token, amount: string | BigNumber | undefined) => string;
|
|
10
|
-
/**
|
|
11
|
-
* Repeatedly calls a given asynchronous function until it resolves with a value
|
|
12
|
-
* @param toRepeat The function that should be repeated
|
|
13
|
-
* @param timeout The timeout in milliseconds between retries, defaults to 5000
|
|
14
|
-
* @returns The result of the toRepeat function
|
|
15
|
-
*/
|
|
16
|
-
export declare const repeatUntilDone: <T>(toRepeat: () => Promise<T | undefined>, timeout?: number) => Promise<T>;
|
|
17
|
-
/**
|
|
18
|
-
* Loads a transaction receipt using the rpc for the given chain id
|
|
19
|
-
* @param chainId The chain id where the transaction should be loaded from
|
|
20
|
-
* @param txHash The hash of the transaction
|
|
21
|
-
* @returns TransactionReceipt
|
|
22
|
-
*/
|
|
23
|
-
export declare const loadTransactionReceipt: (chainId: ChainId, txHash: string) => Promise<TransactionReceipt>;
|
|
24
|
-
export declare const isZeroAddress: (address: string) => boolean;
|
|
25
|
-
export declare const isNativeTokenAddress: (address: string) => boolean;
|
package/dist/cjs/version.d.ts
DELETED
package/dist/connectors.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { FallbackProvider } from '@ethersproject/providers';
|
|
2
|
-
import { ChainId } from './types';
|
|
3
|
-
export declare const getRpcUrl: (chainId: ChainId, archive?: boolean) => Promise<string>;
|
|
4
|
-
export declare const getRpcUrls: (chainId: ChainId, archive?: boolean) => Promise<string[]>;
|
|
5
|
-
export declare const getRpcProvider: (chainId: number, archive?: boolean) => Promise<FallbackProvider>;
|
|
6
|
-
export declare const getMulticallAddress: (chainId: ChainId) => Promise<string | undefined>;
|
package/dist/connectors.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { FallbackProvider, StaticJsonRpcProvider, } from '@ethersproject/providers';
|
|
2
|
-
import { getRandomNumber } from './helpers';
|
|
3
|
-
import ConfigService from './services/ConfigService';
|
|
4
|
-
import { ChainId } from './types';
|
|
5
|
-
import { ServerError } from './utils/errors';
|
|
6
|
-
// cached providers
|
|
7
|
-
const chainProviders = {};
|
|
8
|
-
// Archive RPC Provider
|
|
9
|
-
const archiveRpcs = {
|
|
10
|
-
[ChainId.ETH]: 'https://speedy-nodes-nyc.moralis.io/5ed6053dc39eba789ff466c9/eth/mainnet/archive',
|
|
11
|
-
[ChainId.BSC]: 'https://speedy-nodes-nyc.moralis.io/5ed6053dc39eba789ff466c9/bsc/mainnet/archive',
|
|
12
|
-
[ChainId.POL]: 'https://speedy-nodes-nyc.moralis.io/5ed6053dc39eba789ff466c9/polygon/mainnet/archive',
|
|
13
|
-
[ChainId.FTM]: 'https://speedy-nodes-nyc.moralis.io/5ed6053dc39eba789ff466c9/fantom/mainnet',
|
|
14
|
-
};
|
|
15
|
-
// RPC Urls
|
|
16
|
-
export const getRpcUrl = async (chainId, archive = false) => {
|
|
17
|
-
const rpcUrls = await getRpcUrls(chainId, archive);
|
|
18
|
-
return rpcUrls[0];
|
|
19
|
-
};
|
|
20
|
-
export const getRpcUrls = async (chainId, archive = false) => {
|
|
21
|
-
if (archive && archiveRpcs[chainId]) {
|
|
22
|
-
return [archiveRpcs[chainId]];
|
|
23
|
-
}
|
|
24
|
-
const configService = ConfigService.getInstance();
|
|
25
|
-
const config = await configService.getConfigAsync();
|
|
26
|
-
return config.rpcs[chainId];
|
|
27
|
-
};
|
|
28
|
-
const getRandomProvider = (providerList) => {
|
|
29
|
-
const index = getRandomNumber(0, providerList.length - 1);
|
|
30
|
-
return providerList[index];
|
|
31
|
-
};
|
|
32
|
-
// Provider
|
|
33
|
-
export const getRpcProvider = async (chainId, archive = false) => {
|
|
34
|
-
if (archive && archiveRpcs[chainId]) {
|
|
35
|
-
// return archive PRC, but don't cache it
|
|
36
|
-
return new FallbackProvider([
|
|
37
|
-
new StaticJsonRpcProvider(await getRpcUrl(chainId, archive), chainId),
|
|
38
|
-
]);
|
|
39
|
-
}
|
|
40
|
-
if (!chainProviders[chainId]?.length) {
|
|
41
|
-
chainProviders[chainId] = [];
|
|
42
|
-
const urls = await getRpcUrls(chainId, archive);
|
|
43
|
-
urls.forEach((url) => {
|
|
44
|
-
chainProviders[chainId].push(new FallbackProvider([new StaticJsonRpcProvider(url, chainId)]));
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
if (!chainProviders[chainId].length) {
|
|
48
|
-
throw new ServerError(`Unable to configure provider for chain ${chainId}`);
|
|
49
|
-
}
|
|
50
|
-
return getRandomProvider(chainProviders[chainId]);
|
|
51
|
-
};
|
|
52
|
-
// Multicall
|
|
53
|
-
export const getMulticallAddress = async (chainId) => {
|
|
54
|
-
const configService = ConfigService.getInstance();
|
|
55
|
-
const config = await configService.getConfigAsync();
|
|
56
|
-
return config.multicallAddresses[chainId];
|
|
57
|
-
};
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { Route } from '@lifi/types';
|
|
2
|
-
import { Signer } from 'ethers';
|
|
3
|
-
import ConfigService from '../services/ConfigService';
|
|
4
|
-
import { ConfigUpdate, ExecutionSettings } from '../types';
|
|
5
|
-
export declare class RouteExecutionManager {
|
|
6
|
-
private executionDictionary;
|
|
7
|
-
private executionPromiseDictionary;
|
|
8
|
-
protected configService: ConfigService;
|
|
9
|
-
constructor(configUpdate: ConfigUpdate);
|
|
10
|
-
/**
|
|
11
|
-
* Execute a route.
|
|
12
|
-
* @param {Signer} signer - The signer required to send the transactions.
|
|
13
|
-
* @param {Route} route - The route that should be executed. Cannot be an active route.
|
|
14
|
-
* @param {ExecutionSettings} settings - An object containing settings and callbacks.
|
|
15
|
-
* @return {Promise<Route>} The executed route.
|
|
16
|
-
* @throws {LifiError} Throws a LifiError if the execution fails.
|
|
17
|
-
*/
|
|
18
|
-
executeRoute: (signer: Signer, route: Route, settings?: ExecutionSettings) => Promise<Route>;
|
|
19
|
-
/**
|
|
20
|
-
* Resume the execution of a route that has been stopped or had an error while executing.
|
|
21
|
-
* @param {Signer} signer - The signer required to send the transactions.
|
|
22
|
-
* @param {Route} route - The route that is to be executed. Cannot be an active route.
|
|
23
|
-
* @param {ExecutionSettings} settings - An object containing settings and callbacks.
|
|
24
|
-
* @return {Promise<Route>} The executed route.
|
|
25
|
-
* @throws {LifiError} Throws a LifiError if the execution fails.
|
|
26
|
-
*/
|
|
27
|
-
resumeRoute: (signer: Signer, route: Route, settings?: ExecutionSettings) => Promise<Route>;
|
|
28
|
-
private executeSteps;
|
|
29
|
-
/**
|
|
30
|
-
* Updates route execution to background or foreground state.
|
|
31
|
-
* @param {Route} route - A route that is currently in execution.
|
|
32
|
-
* @param {boolean} 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 {ExecutionSettings} settings - An object with execution settings.
|
|
38
|
-
* @param {Route} 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
|
-
* Executes a route until a user interaction is necessary (signing transactions, etc.) and then halts until the route is resumed.
|
|
44
|
-
* @param {Route} route - A route that is currently in execution.
|
|
45
|
-
* @deprecated use updateRouteExecution instead.
|
|
46
|
-
*/
|
|
47
|
-
moveExecutionToBackground: (route: Route) => void;
|
|
48
|
-
/**
|
|
49
|
-
* Stops the execution of an active route.
|
|
50
|
-
* @param {Route} route - A route that is currently in execution.
|
|
51
|
-
* @return {Route} The stopped route.
|
|
52
|
-
*/
|
|
53
|
-
stopExecution: (route: Route) => Route;
|
|
54
|
-
/**
|
|
55
|
-
* Get the list of active routes.
|
|
56
|
-
* @return {Route[]} A list of routes.
|
|
57
|
-
*/
|
|
58
|
-
getActiveRoutes: () => Route[];
|
|
59
|
-
/**
|
|
60
|
-
* Return the current route information for given route. The route has to be active.
|
|
61
|
-
* @param {Route} route - A route object.
|
|
62
|
-
* @return {Route} The updated route.
|
|
63
|
-
*/
|
|
64
|
-
getActiveRoute: (route: Route) => Route | undefined;
|
|
65
|
-
}
|