@lifi/sdk 4.0.0-beta.0 → 4.0.0-beta.2
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/_virtual/_@oxc-project_runtime@0.115.0/helpers/defineProperty.js +12 -0
- package/dist/cjs/_virtual/_@oxc-project_runtime@0.115.0/helpers/toPrimitive.js +14 -0
- package/dist/cjs/_virtual/_@oxc-project_runtime@0.115.0/helpers/toPropertyKey.js +9 -0
- package/dist/cjs/_virtual/_@oxc-project_runtime@0.115.0/helpers/typeof.js +16 -0
- package/dist/cjs/actions/getChains.d.ts +17 -4
- package/dist/cjs/actions/getChains.js +22 -19
- package/dist/cjs/actions/getChains.js.map +1 -1
- package/dist/cjs/actions/getConnections.d.ts +15 -3
- package/dist/cjs/actions/getConnections.js +30 -35
- package/dist/cjs/actions/getConnections.js.map +1 -1
- package/dist/cjs/actions/getContractCallsQuote.d.ts +16 -3
- package/dist/cjs/actions/getContractCallsQuote.js +41 -42
- package/dist/cjs/actions/getContractCallsQuote.js.map +1 -1
- package/dist/cjs/actions/getGasRecommendation.d.ts +16 -3
- package/dist/cjs/actions/getGasRecommendation.js +20 -19
- package/dist/cjs/actions/getGasRecommendation.js.map +1 -1
- package/dist/cjs/actions/getNameServiceAddress.d.ts +15 -3
- package/dist/cjs/actions/getNameServiceAddress.js +25 -27
- package/dist/cjs/actions/getNameServiceAddress.js.map +1 -1
- package/dist/cjs/actions/getQuote.d.ts +18 -5
- package/dist/cjs/actions/getQuote.js +32 -46
- package/dist/cjs/actions/getQuote.js.map +1 -1
- package/dist/cjs/actions/getRelayedTransactionStatus.d.ts +16 -3
- package/dist/cjs/actions/getRelayedTransactionStatus.js +26 -26
- package/dist/cjs/actions/getRelayedTransactionStatus.js.map +1 -1
- package/dist/cjs/actions/getRelayerQuote.d.ts +17 -4
- package/dist/cjs/actions/getRelayerQuote.js +40 -45
- package/dist/cjs/actions/getRelayerQuote.js.map +1 -1
- package/dist/cjs/actions/getRoutes.d.ts +16 -3
- package/dist/cjs/actions/getRoutes.js +28 -23
- package/dist/cjs/actions/getRoutes.js.map +1 -1
- package/dist/cjs/actions/getStatus.d.ts +17 -4
- package/dist/cjs/actions/getStatus.js +18 -14
- package/dist/cjs/actions/getStatus.js.map +1 -1
- package/dist/cjs/actions/getStepTransaction.d.ts +16 -3
- package/dist/cjs/actions/getStepTransaction.js +32 -33
- package/dist/cjs/actions/getStepTransaction.js.map +1 -1
- package/dist/cjs/actions/getToken.d.ts +17 -3
- package/dist/cjs/actions/getToken.js +22 -18
- package/dist/cjs/actions/getToken.js.map +1 -1
- package/dist/cjs/actions/getTokenBalance.d.ts +17 -3
- package/dist/cjs/actions/getTokenBalance.js +16 -6
- package/dist/cjs/actions/getTokenBalance.js.map +1 -1
- package/dist/cjs/actions/getTokenBalances.d.ts +17 -3
- package/dist/cjs/actions/getTokenBalances.js +12 -13
- package/dist/cjs/actions/getTokenBalances.js.map +1 -1
- package/dist/cjs/actions/getTokenBalancesByChain.d.ts +19 -5
- package/dist/cjs/actions/getTokenBalancesByChain.js +22 -37
- package/dist/cjs/actions/getTokenBalancesByChain.js.map +1 -1
- package/dist/cjs/actions/getTokens.d.ts +18 -6
- package/dist/cjs/actions/getTokens.js +14 -18
- package/dist/cjs/actions/getTokens.js.map +1 -1
- package/dist/cjs/actions/getTools.d.ts +15 -3
- package/dist/cjs/actions/getTools.js +17 -14
- package/dist/cjs/actions/getTools.js.map +1 -1
- package/dist/cjs/actions/getTransactionHistory.d.ts +26 -3
- package/dist/cjs/actions/getTransactionHistory.js +27 -21
- package/dist/cjs/actions/getTransactionHistory.js.map +1 -1
- package/dist/cjs/actions/getWalletBalances.d.ts +16 -3
- package/dist/cjs/actions/getWalletBalances.js +16 -12
- package/dist/cjs/actions/getWalletBalances.js.map +1 -1
- package/dist/cjs/actions/index.d.ts +171 -39
- package/dist/cjs/actions/index.js +49 -47
- package/dist/cjs/actions/index.js.map +1 -1
- package/dist/cjs/actions/patchContractCalls.d.ts +14 -9
- package/dist/cjs/actions/patchContractCalls.js +11 -12
- package/dist/cjs/actions/patchContractCalls.js.map +1 -1
- package/dist/cjs/actions/relayTransaction.d.ts +16 -3
- package/dist/cjs/actions/relayTransaction.js +30 -34
- package/dist/cjs/actions/relayTransaction.js.map +1 -1
- package/dist/cjs/client/createClient.d.ts +7 -2
- package/dist/cjs/client/createClient.js +66 -75
- package/dist/cjs/client/createClient.js.map +1 -1
- package/dist/cjs/client/getClientStorage.d.ts +14 -8
- package/dist/cjs/client/getClientStorage.js +43 -47
- package/dist/cjs/client/getClientStorage.js.map +1 -1
- package/dist/cjs/core/BaseStepExecutionTask.d.ts +9 -4
- package/dist/cjs/core/BaseStepExecutionTask.js +9 -8
- package/dist/cjs/core/BaseStepExecutionTask.js.map +1 -1
- package/dist/cjs/core/BaseStepExecutor.d.ts +23 -18
- package/dist/cjs/core/BaseStepExecutor.js +68 -79
- package/dist/cjs/core/BaseStepExecutor.js.map +1 -1
- package/dist/cjs/core/StatusManager.d.ts +80 -21
- package/dist/cjs/core/StatusManager.js +175 -139
- package/dist/cjs/core/StatusManager.js.map +1 -1
- package/dist/cjs/core/TaskPipeline.d.ts +11 -6
- package/dist/cjs/core/TaskPipeline.js +20 -25
- package/dist/cjs/core/TaskPipeline.js.map +1 -1
- package/dist/cjs/core/actionMessages.d.ts +9 -4
- package/dist/cjs/core/actionMessages.js +72 -74
- package/dist/cjs/core/actionMessages.js.map +1 -1
- package/dist/cjs/core/execution.d.ts +48 -8
- package/dist/cjs/core/execution.js +131 -133
- package/dist/cjs/core/execution.js.map +1 -1
- package/dist/cjs/core/executionState.d.ts +17 -13
- package/dist/cjs/core/executionState.js +27 -27
- package/dist/cjs/core/executionState.js.map +1 -1
- package/dist/cjs/core/prepareRestart.d.ts +7 -2
- package/dist/cjs/core/prepareRestart.js +17 -19
- package/dist/cjs/core/prepareRestart.js.map +1 -1
- package/dist/cjs/core/storage.d.ts +18 -14
- package/dist/cjs/core/storage.js +35 -33
- package/dist/cjs/core/storage.js.map +1 -1
- package/dist/cjs/core/tasks/CheckBalanceTask.d.ts +9 -4
- package/dist/cjs/core/tasks/CheckBalanceTask.js +23 -24
- package/dist/cjs/core/tasks/CheckBalanceTask.js.map +1 -1
- package/dist/cjs/core/tasks/PrepareTransactionTask.d.ts +9 -4
- package/dist/cjs/core/tasks/PrepareTransactionTask.js +28 -34
- package/dist/cjs/core/tasks/PrepareTransactionTask.js.map +1 -1
- package/dist/cjs/core/tasks/WaitForTransactionStatusTask.d.ts +12 -7
- package/dist/cjs/core/tasks/WaitForTransactionStatusTask.js +62 -71
- package/dist/cjs/core/tasks/WaitForTransactionStatusTask.js.map +1 -1
- package/dist/cjs/core/tasks/helpers/checkBalance.d.ts +8 -3
- package/dist/cjs/core/tasks/helpers/checkBalance.js +24 -33
- package/dist/cjs/core/tasks/helpers/checkBalance.js.map +1 -1
- package/dist/cjs/core/tasks/helpers/getTransactionRequestData.d.ts +7 -2
- package/dist/cjs/core/tasks/helpers/getTransactionRequestData.js +21 -26
- package/dist/cjs/core/tasks/helpers/getTransactionRequestData.js.map +1 -1
- package/dist/cjs/core/tasks/helpers/stepComparison.d.ts +21 -4
- package/dist/cjs/core/tasks/helpers/stepComparison.js +28 -21
- package/dist/cjs/core/tasks/helpers/stepComparison.js.map +1 -1
- package/dist/cjs/core/tasks/helpers/waitForTransactionStatus.d.ts +9 -4
- package/dist/cjs/core/tasks/helpers/waitForTransactionStatus.js +45 -53
- package/dist/cjs/core/tasks/helpers/waitForTransactionStatus.js.map +1 -1
- package/dist/cjs/core/utils.d.ts +17 -91
- package/dist/cjs/core/utils.js +37 -38
- package/dist/cjs/core/utils.js.map +1 -1
- package/dist/cjs/errors/SDKError.d.ts +16 -11
- package/dist/cjs/errors/SDKError.js +23 -21
- package/dist/cjs/errors/SDKError.js.map +1 -1
- package/dist/cjs/errors/baseError.d.ts +10 -5
- package/dist/cjs/errors/baseError.js +18 -18
- package/dist/cjs/errors/baseError.js.map +1 -1
- package/dist/cjs/errors/constants.d.ts +52 -48
- package/dist/cjs/errors/constants.js +60 -56
- package/dist/cjs/errors/constants.js.map +1 -1
- package/dist/cjs/errors/errors.d.ts +38 -28
- package/dist/cjs/errors/errors.js +58 -51
- package/dist/cjs/errors/errors.js.map +1 -1
- package/dist/cjs/errors/httpError.d.ts +21 -17
- package/dist/cjs/errors/httpError.js +63 -65
- package/dist/cjs/errors/httpError.js.map +1 -1
- package/dist/cjs/errors/utils/baseErrorRootCause.d.ts +8 -3
- package/dist/cjs/errors/utils/baseErrorRootCause.js +12 -15
- package/dist/cjs/errors/utils/baseErrorRootCause.js.map +1 -1
- package/dist/cjs/errors/utils/rootCause.d.ts +5 -1
- package/dist/cjs/errors/utils/rootCause.js +7 -8
- package/dist/cjs/errors/utils/rootCause.js.map +1 -1
- package/dist/cjs/index.d.ts +54 -55
- package/dist/cjs/index.js +128 -138
- package/dist/cjs/types/actions.d.ts +12 -7
- package/dist/cjs/types/actions.js +0 -3
- package/dist/cjs/types/core.d.ts +184 -173
- package/dist/cjs/types/core.js +0 -3
- package/dist/cjs/types/execution.d.ts +25 -19
- package/dist/cjs/types/execution.js +0 -3
- package/dist/cjs/types/request.d.ts +6 -2
- package/dist/cjs/types/request.js +0 -3
- package/dist/cjs/utils/checkPackageUpdates.d.ts +5 -1
- package/dist/cjs/utils/checkPackageUpdates.js +11 -16
- package/dist/cjs/utils/checkPackageUpdates.js.map +1 -1
- package/dist/cjs/utils/convertQuoteToRoute.d.ts +20 -5
- package/dist/cjs/utils/convertQuoteToRoute.js +72 -85
- package/dist/cjs/utils/convertQuoteToRoute.js.map +1 -1
- package/dist/cjs/utils/decode.d.ts +5 -1
- package/dist/cjs/utils/decode.js +5 -10
- package/dist/cjs/utils/decode.js.map +1 -1
- package/dist/cjs/utils/fetchTxErrorDetails.d.ts +5 -1
- package/dist/cjs/utils/fetchTxErrorDetails.js +9 -9
- package/dist/cjs/utils/fetchTxErrorDetails.js.map +1 -1
- package/dist/cjs/utils/formatUnits.d.ts +8 -1
- package/dist/cjs/utils/formatUnits.js +15 -15
- package/dist/cjs/utils/formatUnits.js.map +1 -1
- package/dist/cjs/utils/getTransactionMessage.d.ts +8 -3
- package/dist/cjs/utils/getTransactionMessage.js +8 -10
- package/dist/cjs/utils/getTransactionMessage.js.map +1 -1
- package/dist/cjs/utils/isHex.d.ts +9 -3
- package/dist/cjs/utils/isHex.js +8 -10
- package/dist/cjs/utils/isHex.js.map +1 -1
- package/dist/cjs/utils/isRoutesRequest.d.ts +7 -2
- package/dist/cjs/utils/isRoutesRequest.js +7 -14
- package/dist/cjs/utils/isRoutesRequest.js.map +1 -1
- package/dist/cjs/utils/isStep.d.ts +7 -2
- package/dist/cjs/utils/isStep.js +15 -25
- package/dist/cjs/utils/isStep.js.map +1 -1
- package/dist/cjs/utils/isToken.d.ts +7 -2
- package/dist/cjs/utils/isToken.js +6 -7
- package/dist/cjs/utils/isToken.js.map +1 -1
- package/dist/cjs/utils/parseUnits.d.ts +8 -1
- package/dist/cjs/utils/parseUnits.js +32 -41
- package/dist/cjs/utils/parseUnits.js.map +1 -1
- package/dist/cjs/utils/request.d.ts +10 -5
- package/dist/cjs/utils/request.js +53 -69
- package/dist/cjs/utils/request.js.map +1 -1
- package/dist/cjs/utils/sleep.d.ts +5 -1
- package/dist/cjs/utils/sleep.js +8 -6
- package/dist/cjs/utils/sleep.js.map +1 -1
- package/dist/cjs/utils/waitForResult.d.ts +14 -1
- package/dist/cjs/utils/waitForResult.js +33 -30
- package/dist/cjs/utils/waitForResult.js.map +1 -1
- package/dist/cjs/utils/withDedupe.d.ts +20 -8
- package/dist/cjs/utils/withDedupe.js +32 -29
- package/dist/cjs/utils/withDedupe.js.map +1 -1
- package/dist/cjs/version.d.ts +6 -2
- package/dist/cjs/version.js +8 -5
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/_virtual/_@oxc-project_runtime@0.115.0/helpers/defineProperty.js +12 -0
- package/dist/esm/_virtual/_@oxc-project_runtime@0.115.0/helpers/toPrimitive.js +14 -0
- package/dist/esm/_virtual/_@oxc-project_runtime@0.115.0/helpers/toPropertyKey.js +9 -0
- package/dist/esm/_virtual/_@oxc-project_runtime@0.115.0/helpers/typeof.js +11 -0
- package/dist/esm/actions/getChains.d.ts +16 -11
- package/dist/esm/actions/getChains.d.ts.map +1 -0
- package/dist/esm/actions/getChains.js +22 -24
- package/dist/esm/actions/getChains.js.map +1 -1
- package/dist/esm/actions/getConnections.d.ts +14 -9
- package/dist/esm/actions/getConnections.d.ts.map +1 -0
- package/dist/esm/actions/getConnections.js +30 -39
- package/dist/esm/actions/getConnections.js.map +1 -1
- package/dist/esm/actions/getContractCallsQuote.d.ts +15 -10
- package/dist/esm/actions/getContractCallsQuote.d.ts.map +1 -0
- package/dist/esm/actions/getContractCallsQuote.js +41 -51
- package/dist/esm/actions/getContractCallsQuote.js.map +1 -1
- package/dist/esm/actions/getGasRecommendation.d.ts +15 -10
- package/dist/esm/actions/getGasRecommendation.d.ts.map +1 -0
- package/dist/esm/actions/getGasRecommendation.js +20 -24
- package/dist/esm/actions/getGasRecommendation.js.map +1 -1
- package/dist/esm/actions/getNameServiceAddress.d.ts +14 -9
- package/dist/esm/actions/getNameServiceAddress.d.ts.map +1 -0
- package/dist/esm/actions/getNameServiceAddress.js +25 -31
- package/dist/esm/actions/getNameServiceAddress.js.map +1 -1
- package/dist/esm/actions/getQuote.d.ts +17 -12
- package/dist/esm/actions/getQuote.d.ts.map +1 -0
- package/dist/esm/actions/getQuote.js +32 -45
- package/dist/esm/actions/getQuote.js.map +1 -1
- package/dist/esm/actions/getRelayedTransactionStatus.d.ts +15 -10
- package/dist/esm/actions/getRelayedTransactionStatus.d.ts.map +1 -0
- package/dist/esm/actions/getRelayedTransactionStatus.js +26 -32
- package/dist/esm/actions/getRelayedTransactionStatus.js.map +1 -1
- package/dist/esm/actions/getRelayerQuote.d.ts +16 -11
- package/dist/esm/actions/getRelayerQuote.d.ts.map +1 -0
- package/dist/esm/actions/getRelayerQuote.js +40 -51
- package/dist/esm/actions/getRelayerQuote.js.map +1 -1
- package/dist/esm/actions/getRoutes.d.ts +15 -10
- package/dist/esm/actions/getRoutes.d.ts.map +1 -0
- package/dist/esm/actions/getRoutes.js +28 -29
- package/dist/esm/actions/getRoutes.js.map +1 -1
- package/dist/esm/actions/getStatus.d.ts +16 -11
- package/dist/esm/actions/getStatus.d.ts.map +1 -0
- package/dist/esm/actions/getStatus.js +18 -19
- package/dist/esm/actions/getStatus.js.map +1 -1
- package/dist/esm/actions/getStepTransaction.d.ts +15 -10
- package/dist/esm/actions/getStepTransaction.d.ts.map +1 -0
- package/dist/esm/actions/getStepTransaction.js +32 -39
- package/dist/esm/actions/getStepTransaction.js.map +1 -1
- package/dist/esm/actions/getToken.d.ts +16 -11
- package/dist/esm/actions/getToken.d.ts.map +1 -0
- package/dist/esm/actions/getToken.js +22 -24
- package/dist/esm/actions/getToken.js.map +1 -1
- package/dist/esm/actions/getTokenBalance.d.ts +16 -11
- package/dist/esm/actions/getTokenBalance.d.ts.map +1 -0
- package/dist/esm/actions/getTokenBalance.js +16 -12
- package/dist/esm/actions/getTokenBalance.js.map +1 -1
- package/dist/esm/actions/getTokenBalances.d.ts +16 -11
- package/dist/esm/actions/getTokenBalances.d.ts.map +1 -0
- package/dist/esm/actions/getTokenBalances.js +12 -12
- package/dist/esm/actions/getTokenBalances.js.map +1 -1
- package/dist/esm/actions/getTokenBalancesByChain.d.ts +18 -13
- package/dist/esm/actions/getTokenBalancesByChain.d.ts.map +1 -0
- package/dist/esm/actions/getTokenBalancesByChain.js +22 -37
- package/dist/esm/actions/getTokenBalancesByChain.js.map +1 -1
- package/dist/esm/actions/getTokens.d.ts +17 -12
- package/dist/esm/actions/getTokens.d.ts.map +1 -0
- package/dist/esm/actions/getTokens.js +14 -16
- package/dist/esm/actions/getTokens.js.map +1 -1
- package/dist/esm/actions/getTools.d.ts +14 -9
- package/dist/esm/actions/getTools.d.ts.map +1 -0
- package/dist/esm/actions/getTools.js +17 -18
- package/dist/esm/actions/getTools.js.map +1 -1
- package/dist/esm/actions/getTransactionHistory.d.ts +25 -15
- package/dist/esm/actions/getTransactionHistory.d.ts.map +1 -0
- package/dist/esm/actions/getTransactionHistory.js +27 -31
- package/dist/esm/actions/getTransactionHistory.js.map +1 -1
- package/dist/esm/actions/getWalletBalances.d.ts +15 -10
- package/dist/esm/actions/getWalletBalances.d.ts.map +1 -0
- package/dist/esm/actions/getWalletBalances.js +16 -17
- package/dist/esm/actions/getWalletBalances.js.map +1 -1
- package/dist/esm/actions/index.d.ts +171 -166
- package/dist/esm/actions/index.d.ts.map +1 -0
- package/dist/esm/actions/index.js +49 -45
- package/dist/esm/actions/index.js.map +1 -1
- package/dist/esm/actions/patchContractCalls.d.ts +14 -9
- package/dist/esm/actions/patchContractCalls.d.ts.map +1 -0
- package/dist/esm/actions/patchContractCalls.js +12 -10
- package/dist/esm/actions/patchContractCalls.js.map +1 -1
- package/dist/esm/actions/relayTransaction.d.ts +15 -10
- package/dist/esm/actions/relayTransaction.d.ts.map +1 -0
- package/dist/esm/actions/relayTransaction.js +30 -41
- package/dist/esm/actions/relayTransaction.js.map +1 -1
- package/dist/esm/client/createClient.d.ts +7 -2
- package/dist/esm/client/createClient.d.ts.map +1 -0
- package/dist/esm/client/createClient.js +66 -74
- package/dist/esm/client/createClient.js.map +1 -1
- package/dist/esm/client/getClientStorage.d.ts +14 -8
- package/dist/esm/client/getClientStorage.d.ts.map +1 -0
- package/dist/esm/client/getClientStorage.js +44 -48
- package/dist/esm/client/getClientStorage.js.map +1 -1
- package/dist/esm/core/BaseStepExecutionTask.d.ts +9 -4
- package/dist/esm/core/BaseStepExecutionTask.d.ts.map +1 -0
- package/dist/esm/core/BaseStepExecutionTask.js +9 -5
- package/dist/esm/core/BaseStepExecutionTask.js.map +1 -1
- package/dist/esm/core/BaseStepExecutor.d.ts +23 -18
- package/dist/esm/core/BaseStepExecutor.d.ts.map +1 -0
- package/dist/esm/core/BaseStepExecutor.js +68 -77
- package/dist/esm/core/BaseStepExecutor.js.map +1 -1
- package/dist/esm/core/StatusManager.d.ts +79 -65
- package/dist/esm/core/StatusManager.d.ts.map +1 -0
- package/dist/esm/core/StatusManager.js +174 -183
- package/dist/esm/core/StatusManager.js.map +1 -1
- package/dist/esm/core/TaskPipeline.d.ts +11 -6
- package/dist/esm/core/TaskPipeline.d.ts.map +1 -0
- package/dist/esm/core/TaskPipeline.js +20 -22
- package/dist/esm/core/TaskPipeline.js.map +1 -1
- package/dist/esm/core/actionMessages.d.ts +9 -4
- package/dist/esm/core/actionMessages.d.ts.map +1 -0
- package/dist/esm/core/actionMessages.js +72 -72
- package/dist/esm/core/actionMessages.js.map +1 -1
- package/dist/esm/core/execution.d.ts +42 -37
- package/dist/esm/core/execution.d.ts.map +1 -0
- package/dist/esm/core/execution.js +126 -173
- package/dist/esm/core/execution.js.map +1 -1
- package/dist/esm/core/executionState.d.ts +17 -13
- package/dist/esm/core/executionState.d.ts.map +1 -0
- package/dist/esm/core/executionState.js +26 -24
- package/dist/esm/core/executionState.js.map +1 -1
- package/dist/esm/core/prepareRestart.d.ts +7 -2
- package/dist/esm/core/prepareRestart.d.ts.map +1 -0
- package/dist/esm/core/prepareRestart.js +18 -21
- package/dist/esm/core/prepareRestart.js.map +1 -1
- package/dist/esm/core/storage.d.ts +18 -14
- package/dist/esm/core/storage.d.ts.map +1 -0
- package/dist/esm/core/storage.js +33 -28
- package/dist/esm/core/storage.js.map +1 -1
- package/dist/esm/core/tasks/CheckBalanceTask.d.ts +9 -4
- package/dist/esm/core/tasks/CheckBalanceTask.d.ts.map +1 -0
- package/dist/esm/core/tasks/CheckBalanceTask.js +23 -21
- package/dist/esm/core/tasks/CheckBalanceTask.js.map +1 -1
- package/dist/esm/core/tasks/PrepareTransactionTask.d.ts +9 -4
- package/dist/esm/core/tasks/PrepareTransactionTask.d.ts.map +1 -0
- package/dist/esm/core/tasks/PrepareTransactionTask.js +28 -31
- package/dist/esm/core/tasks/PrepareTransactionTask.js.map +1 -1
- package/dist/esm/core/tasks/WaitForTransactionStatusTask.d.ts +12 -7
- package/dist/esm/core/tasks/WaitForTransactionStatusTask.d.ts.map +1 -0
- package/dist/esm/core/tasks/WaitForTransactionStatusTask.js +62 -73
- package/dist/esm/core/tasks/WaitForTransactionStatusTask.js.map +1 -1
- package/dist/esm/core/tasks/helpers/checkBalance.d.ts +8 -3
- package/dist/esm/core/tasks/helpers/checkBalance.d.ts.map +1 -0
- package/dist/esm/core/tasks/helpers/checkBalance.js +25 -32
- package/dist/esm/core/tasks/helpers/checkBalance.js.map +1 -1
- package/dist/esm/core/tasks/helpers/getTransactionRequestData.d.ts +7 -2
- package/dist/esm/core/tasks/helpers/getTransactionRequestData.d.ts.map +1 -0
- package/dist/esm/core/tasks/helpers/getTransactionRequestData.js +22 -24
- package/dist/esm/core/tasks/helpers/getTransactionRequestData.js.map +1 -1
- package/dist/esm/core/tasks/helpers/stepComparison.d.ts +20 -15
- package/dist/esm/core/tasks/helpers/stepComparison.d.ts.map +1 -0
- package/dist/esm/core/tasks/helpers/stepComparison.js +28 -32
- package/dist/esm/core/tasks/helpers/stepComparison.js.map +1 -1
- package/dist/esm/core/tasks/helpers/waitForTransactionStatus.d.ts +9 -4
- package/dist/esm/core/tasks/helpers/waitForTransactionStatus.d.ts.map +1 -0
- package/dist/esm/core/tasks/helpers/waitForTransactionStatus.js +44 -50
- package/dist/esm/core/tasks/helpers/waitForTransactionStatus.js.map +1 -1
- package/dist/esm/core/utils.d.ts +16 -98
- package/dist/esm/core/utils.d.ts.map +1 -0
- package/dist/esm/core/utils.js +36 -45
- package/dist/esm/core/utils.js.map +1 -1
- package/dist/esm/errors/SDKError.d.ts +16 -11
- package/dist/esm/errors/SDKError.d.ts.map +1 -0
- package/dist/esm/errors/SDKError.js +23 -20
- package/dist/esm/errors/SDKError.js.map +1 -1
- package/dist/esm/errors/baseError.d.ts +10 -5
- package/dist/esm/errors/baseError.d.ts.map +1 -0
- package/dist/esm/errors/baseError.js +18 -17
- package/dist/esm/errors/baseError.js.map +1 -1
- package/dist/esm/errors/constants.d.ts +52 -48
- package/dist/esm/errors/constants.d.ts.map +1 -0
- package/dist/esm/errors/constants.js +57 -53
- package/dist/esm/errors/constants.js.map +1 -1
- package/dist/esm/errors/errors.d.ts +30 -25
- package/dist/esm/errors/errors.d.ts.map +1 -0
- package/dist/esm/errors/errors.js +53 -48
- package/dist/esm/errors/errors.js.map +1 -1
- package/dist/esm/errors/httpError.d.ts +21 -17
- package/dist/esm/errors/httpError.d.ts.map +1 -0
- package/dist/esm/errors/httpError.js +63 -62
- package/dist/esm/errors/httpError.js.map +1 -1
- package/dist/esm/errors/utils/baseErrorRootCause.d.ts +8 -3
- package/dist/esm/errors/utils/baseErrorRootCause.d.ts.map +1 -0
- package/dist/esm/errors/utils/baseErrorRootCause.js +13 -13
- package/dist/esm/errors/utils/baseErrorRootCause.js.map +1 -1
- package/dist/esm/errors/utils/rootCause.d.ts +5 -1
- package/dist/esm/errors/utils/rootCause.d.ts.map +1 -0
- package/dist/esm/errors/utils/rootCause.js +8 -6
- package/dist/esm/errors/utils/rootCause.js.map +1 -1
- package/dist/esm/index.d.ts +54 -55
- package/dist/esm/index.js +52 -54
- package/dist/esm/package.json +1 -1
- package/dist/esm/types/actions.d.ts +12 -7
- package/dist/esm/types/actions.d.ts.map +1 -0
- package/dist/esm/types/actions.js +0 -1
- package/dist/esm/types/core.d.ts +182 -178
- package/dist/esm/types/core.d.ts.map +1 -0
- package/dist/esm/types/core.js +0 -1
- package/dist/esm/types/execution.d.ts +25 -20
- package/dist/esm/types/execution.d.ts.map +1 -0
- package/dist/esm/types/execution.js +0 -1
- package/dist/esm/types/request.d.ts +6 -2
- package/dist/esm/types/request.d.ts.map +1 -0
- package/dist/esm/types/request.js +0 -1
- package/dist/esm/utils/checkPackageUpdates.d.ts +5 -1
- package/dist/esm/utils/checkPackageUpdates.d.ts.map +1 -0
- package/dist/esm/utils/checkPackageUpdates.js +12 -15
- package/dist/esm/utils/checkPackageUpdates.js.map +1 -1
- package/dist/esm/utils/convertQuoteToRoute.d.ts +19 -15
- package/dist/esm/utils/convertQuoteToRoute.d.ts.map +1 -0
- package/dist/esm/utils/convertQuoteToRoute.js +72 -92
- package/dist/esm/utils/convertQuoteToRoute.js.map +1 -1
- package/dist/esm/utils/decode.d.ts +5 -1
- package/dist/esm/utils/decode.d.ts.map +1 -0
- package/dist/esm/utils/decode.js +6 -8
- package/dist/esm/utils/decode.js.map +1 -1
- package/dist/esm/utils/fetchTxErrorDetails.d.ts +5 -1
- package/dist/esm/utils/fetchTxErrorDetails.d.ts.map +1 -0
- package/dist/esm/utils/fetchTxErrorDetails.js +10 -7
- package/dist/esm/utils/fetchTxErrorDetails.js.map +1 -1
- package/dist/esm/utils/formatUnits.d.ts +7 -3
- package/dist/esm/utils/formatUnits.d.ts.map +1 -0
- package/dist/esm/utils/formatUnits.js +14 -15
- package/dist/esm/utils/formatUnits.js.map +1 -1
- package/dist/esm/utils/getTransactionMessage.d.ts +8 -3
- package/dist/esm/utils/getTransactionMessage.d.ts.map +1 -0
- package/dist/esm/utils/getTransactionMessage.js +9 -8
- package/dist/esm/utils/getTransactionMessage.js.map +1 -1
- package/dist/esm/utils/isHex.d.ts +9 -3
- package/dist/esm/utils/isHex.d.ts.map +1 -0
- package/dist/esm/utils/isHex.js +8 -8
- package/dist/esm/utils/isHex.js.map +1 -1
- package/dist/esm/utils/isRoutesRequest.d.ts +7 -2
- package/dist/esm/utils/isRoutesRequest.d.ts.map +1 -0
- package/dist/esm/utils/isRoutesRequest.js +8 -12
- package/dist/esm/utils/isRoutesRequest.js.map +1 -1
- package/dist/esm/utils/isStep.d.ts +7 -2
- package/dist/esm/utils/isStep.d.ts.map +1 -0
- package/dist/esm/utils/isStep.js +16 -23
- package/dist/esm/utils/isStep.js.map +1 -1
- package/dist/esm/utils/isToken.d.ts +7 -2
- package/dist/esm/utils/isToken.d.ts.map +1 -0
- package/dist/esm/utils/isToken.js +7 -5
- package/dist/esm/utils/isToken.js.map +1 -1
- package/dist/esm/utils/parseUnits.d.ts +7 -3
- package/dist/esm/utils/parseUnits.d.ts.map +1 -0
- package/dist/esm/utils/parseUnits.js +31 -43
- package/dist/esm/utils/parseUnits.js.map +1 -1
- package/dist/esm/utils/request.d.ts +10 -5
- package/dist/esm/utils/request.d.ts.map +1 -0
- package/dist/esm/utils/request.js +52 -67
- package/dist/esm/utils/request.js.map +1 -1
- package/dist/esm/utils/sleep.d.ts +5 -1
- package/dist/esm/utils/sleep.d.ts.map +1 -0
- package/dist/esm/utils/sleep.js +8 -4
- package/dist/esm/utils/sleep.js.map +1 -1
- package/dist/esm/utils/waitForResult.d.ts +13 -9
- package/dist/esm/utils/waitForResult.d.ts.map +1 -0
- package/dist/esm/utils/waitForResult.js +32 -35
- package/dist/esm/utils/waitForResult.js.map +1 -1
- package/dist/esm/utils/withDedupe.d.ts +18 -12
- package/dist/esm/utils/withDedupe.d.ts.map +1 -0
- package/dist/esm/utils/withDedupe.js +28 -29
- package/dist/esm/utils/withDedupe.js.map +1 -1
- package/dist/esm/version.d.ts +6 -2
- package/dist/esm/version.d.ts.map +1 -0
- package/dist/esm/version.js +6 -2
- package/dist/esm/version.js.map +1 -1
- package/package.json +5 -5
- package/src/actions/getChains.ts +2 -1
- package/src/actions/getTokens.ts +6 -3
- package/src/actions/getTools.ts +2 -1
- package/src/client/getClientStorage.ts +8 -1
- package/src/core/BaseStepExecutor.ts +2 -3
- package/src/core/StatusManager.ts +0 -4
- package/src/core/prepareRestart.ts +1 -3
- package/src/core/tasks/helpers/waitForTransactionStatus.ts +1 -0
- package/src/core/utils.ts +1 -1
- package/src/errors/httpError.ts +4 -6
- package/src/errors/utils/baseErrorRootCause.ts +2 -2
- package/src/errors/utils/rootCause.ts +1 -1
- package/src/types/core.ts +0 -1
- package/src/utils/checkPackageUpdates.ts +1 -1
- package/src/utils/convertQuoteToRoute.ts +1 -1
- package/src/utils/decode.ts +1 -1
- package/src/utils/fetchTxErrorDetails.ts +7 -2
- package/src/utils/formatUnits.ts +1 -1
- package/src/utils/parseUnits.ts +1 -1
- package/src/utils/withDedupe.ts +1 -1
- package/src/version.ts +1 -1
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/types/actions.js.map +0 -1
- package/dist/cjs/types/core.js.map +0 -1
- package/dist/cjs/types/execution.js.map +0 -1
- package/dist/cjs/types/request.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/types/actions.js.map +0 -1
- package/dist/esm/types/core.js.map +0 -1
- package/dist/esm/types/execution.js.map +0 -1
- package/dist/esm/types/request.js.map +0 -1
- package/dist/types/actions/getChains.d.ts +0 -13
- package/dist/types/actions/getChains.d.ts.map +0 -1
- package/dist/types/actions/getConnections.d.ts +0 -11
- package/dist/types/actions/getConnections.d.ts.map +0 -1
- package/dist/types/actions/getContractCallsQuote.d.ts +0 -12
- package/dist/types/actions/getContractCallsQuote.d.ts.map +0 -1
- package/dist/types/actions/getGasRecommendation.d.ts +0 -12
- package/dist/types/actions/getGasRecommendation.d.ts.map +0 -1
- package/dist/types/actions/getNameServiceAddress.d.ts +0 -11
- package/dist/types/actions/getNameServiceAddress.d.ts.map +0 -1
- package/dist/types/actions/getQuote.d.ts +0 -14
- package/dist/types/actions/getQuote.d.ts.map +0 -1
- package/dist/types/actions/getRelayedTransactionStatus.d.ts +0 -12
- package/dist/types/actions/getRelayedTransactionStatus.d.ts.map +0 -1
- package/dist/types/actions/getRelayerQuote.d.ts +0 -13
- package/dist/types/actions/getRelayerQuote.d.ts.map +0 -1
- package/dist/types/actions/getRoutes.d.ts +0 -12
- package/dist/types/actions/getRoutes.d.ts.map +0 -1
- package/dist/types/actions/getStatus.d.ts +0 -13
- package/dist/types/actions/getStatus.d.ts.map +0 -1
- package/dist/types/actions/getStepTransaction.d.ts +0 -12
- package/dist/types/actions/getStepTransaction.d.ts.map +0 -1
- package/dist/types/actions/getToken.d.ts +0 -13
- package/dist/types/actions/getToken.d.ts.map +0 -1
- package/dist/types/actions/getTokenBalance.d.ts +0 -13
- package/dist/types/actions/getTokenBalance.d.ts.map +0 -1
- package/dist/types/actions/getTokenBalances.d.ts +0 -13
- package/dist/types/actions/getTokenBalances.d.ts.map +0 -1
- package/dist/types/actions/getTokenBalancesByChain.d.ts +0 -17
- package/dist/types/actions/getTokenBalancesByChain.d.ts.map +0 -1
- package/dist/types/actions/getTokens.d.ts +0 -16
- package/dist/types/actions/getTokens.d.ts.map +0 -1
- package/dist/types/actions/getTools.d.ts +0 -11
- package/dist/types/actions/getTools.d.ts.map +0 -1
- package/dist/types/actions/getTransactionHistory.d.ts +0 -17
- package/dist/types/actions/getTransactionHistory.d.ts.map +0 -1
- package/dist/types/actions/getWalletBalances.d.ts +0 -12
- package/dist/types/actions/getWalletBalances.d.ts.map +0 -1
- package/dist/types/actions/index.d.ts +0 -168
- package/dist/types/actions/index.d.ts.map +0 -1
- package/dist/types/actions/patchContractCalls.d.ts +0 -11
- package/dist/types/actions/patchContractCalls.d.ts.map +0 -1
- package/dist/types/actions/relayTransaction.d.ts +0 -12
- package/dist/types/actions/relayTransaction.d.ts.map +0 -1
- package/dist/types/client/createClient.d.ts +0 -3
- package/dist/types/client/createClient.d.ts.map +0 -1
- package/dist/types/client/getClientStorage.d.ts +0 -9
- package/dist/types/client/getClientStorage.d.ts.map +0 -1
- package/dist/types/core/BaseStepExecutionTask.d.ts +0 -6
- package/dist/types/core/BaseStepExecutionTask.d.ts.map +0 -1
- package/dist/types/core/BaseStepExecutor.d.ts +0 -20
- package/dist/types/core/BaseStepExecutor.d.ts.map +0 -1
- package/dist/types/core/StatusManager.d.ts +0 -70
- package/dist/types/core/StatusManager.d.ts.map +0 -1
- package/dist/types/core/TaskPipeline.d.ts +0 -8
- package/dist/types/core/TaskPipeline.d.ts.map +0 -1
- package/dist/types/core/actionMessages.d.ts +0 -5
- package/dist/types/core/actionMessages.d.ts.map +0 -1
- package/dist/types/core/execution.d.ts +0 -44
- package/dist/types/core/execution.d.ts.map +0 -1
- package/dist/types/core/executionState.d.ts +0 -18
- package/dist/types/core/executionState.d.ts.map +0 -1
- package/dist/types/core/prepareRestart.d.ts +0 -3
- package/dist/types/core/prepareRestart.d.ts.map +0 -1
- package/dist/types/core/storage.d.ts +0 -18
- package/dist/types/core/storage.d.ts.map +0 -1
- package/dist/types/core/tasks/CheckBalanceTask.d.ts +0 -6
- package/dist/types/core/tasks/CheckBalanceTask.d.ts.map +0 -1
- package/dist/types/core/tasks/PrepareTransactionTask.d.ts +0 -6
- package/dist/types/core/tasks/PrepareTransactionTask.d.ts.map +0 -1
- package/dist/types/core/tasks/WaitForTransactionStatusTask.d.ts +0 -9
- package/dist/types/core/tasks/WaitForTransactionStatusTask.d.ts.map +0 -1
- package/dist/types/core/tasks/helpers/checkBalance.d.ts +0 -4
- package/dist/types/core/tasks/helpers/checkBalance.d.ts.map +0 -1
- package/dist/types/core/tasks/helpers/getTransactionRequestData.d.ts +0 -3
- package/dist/types/core/tasks/helpers/getTransactionRequestData.d.ts.map +0 -1
- package/dist/types/core/tasks/helpers/stepComparison.d.ts +0 -17
- package/dist/types/core/tasks/helpers/stepComparison.d.ts.map +0 -1
- package/dist/types/core/tasks/helpers/waitForTransactionStatus.d.ts +0 -5
- package/dist/types/core/tasks/helpers/waitForTransactionStatus.d.ts.map +0 -1
- package/dist/types/core/utils.d.ts +0 -100
- package/dist/types/core/utils.d.ts.map +0 -1
- package/dist/types/errors/SDKError.d.ts +0 -13
- package/dist/types/errors/SDKError.d.ts.map +0 -1
- package/dist/types/errors/baseError.d.ts +0 -7
- package/dist/types/errors/baseError.d.ts.map +0 -1
- package/dist/types/errors/constants.d.ts +0 -52
- package/dist/types/errors/constants.d.ts.map +0 -1
- package/dist/types/errors/errors.d.ts +0 -34
- package/dist/types/errors/errors.d.ts.map +0 -1
- package/dist/types/errors/httpError.d.ts +0 -21
- package/dist/types/errors/httpError.d.ts.map +0 -1
- package/dist/types/errors/utils/baseErrorRootCause.d.ts +0 -4
- package/dist/types/errors/utils/baseErrorRootCause.d.ts.map +0 -1
- package/dist/types/errors/utils/rootCause.d.ts +0 -2
- package/dist/types/errors/utils/rootCause.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -56
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/types/actions.d.ts +0 -10
- package/dist/types/types/actions.d.ts.map +0 -1
- package/dist/types/types/core.d.ts +0 -184
- package/dist/types/types/core.d.ts.map +0 -1
- package/dist/types/types/execution.d.ts +0 -24
- package/dist/types/types/execution.d.ts.map +0 -1
- package/dist/types/types/request.d.ts +0 -4
- package/dist/types/types/request.d.ts.map +0 -1
- package/dist/types/utils/checkPackageUpdates.d.ts +0 -2
- package/dist/types/utils/checkPackageUpdates.d.ts.map +0 -1
- package/dist/types/utils/convertQuoteToRoute.d.ts +0 -19
- package/dist/types/utils/convertQuoteToRoute.d.ts.map +0 -1
- package/dist/types/utils/decode.d.ts +0 -2
- package/dist/types/utils/decode.d.ts.map +0 -1
- package/dist/types/utils/fetchTxErrorDetails.d.ts +0 -2
- package/dist/types/utils/fetchTxErrorDetails.d.ts.map +0 -1
- package/dist/types/utils/formatUnits.d.ts +0 -5
- package/dist/types/utils/formatUnits.d.ts.map +0 -1
- package/dist/types/utils/getTransactionMessage.d.ts +0 -4
- package/dist/types/utils/getTransactionMessage.d.ts.map +0 -1
- package/dist/types/utils/isHex.d.ts +0 -5
- package/dist/types/utils/isHex.d.ts.map +0 -1
- package/dist/types/utils/isRoutesRequest.d.ts +0 -3
- package/dist/types/utils/isRoutesRequest.d.ts.map +0 -1
- package/dist/types/utils/isStep.d.ts +0 -3
- package/dist/types/utils/isStep.d.ts.map +0 -1
- package/dist/types/utils/isToken.d.ts +0 -3
- package/dist/types/utils/isToken.d.ts.map +0 -1
- package/dist/types/utils/parseUnits.d.ts +0 -5
- package/dist/types/utils/parseUnits.d.ts.map +0 -1
- package/dist/types/utils/request.d.ts +0 -7
- package/dist/types/utils/request.d.ts.map +0 -1
- package/dist/types/utils/sleep.d.ts +0 -2
- package/dist/types/utils/sleep.d.ts.map +0 -1
- package/dist/types/utils/waitForResult.d.ts +0 -11
- package/dist/types/utils/waitForResult.d.ts.map +0 -1
- package/dist/types/utils/withDedupe.d.ts +0 -18
- package/dist/types/utils/withDedupe.d.ts.map +0 -1
- package/dist/types/version.d.ts +0 -3
- package/dist/types/version.d.ts.map +0 -1
|
@@ -1,83 +1,72 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_defineProperty = require("../_virtual/_@oxc-project_runtime@0.115.0/helpers/defineProperty.js");
|
|
3
|
+
const require_errors_errors = require("../errors/errors.js");
|
|
4
|
+
const require_core_StatusManager = require("./StatusManager.js");
|
|
5
|
+
//#region src/core/BaseStepExecutor.ts
|
|
6
6
|
const defaultInteractionSettings = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
allowInteraction: true,
|
|
8
|
+
allowUpdates: true,
|
|
9
|
+
allowExecution: true
|
|
10
10
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
status: 'FAILED',
|
|
71
|
-
error: {
|
|
72
|
-
message: parsed.cause?.message,
|
|
73
|
-
code: parsed.code,
|
|
74
|
-
},
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
throw parsed;
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
}
|
|
11
|
+
var BaseStepExecutor = class {
|
|
12
|
+
constructor(options) {
|
|
13
|
+
require_defineProperty._defineProperty(this, "executionOptions", void 0);
|
|
14
|
+
require_defineProperty._defineProperty(this, "statusManager", void 0);
|
|
15
|
+
require_defineProperty._defineProperty(this, "allowUserInteraction", true);
|
|
16
|
+
require_defineProperty._defineProperty(this, "allowExecution", true);
|
|
17
|
+
require_defineProperty._defineProperty(this, "setInteraction", (settings) => {
|
|
18
|
+
const interactionSettings = {
|
|
19
|
+
...defaultInteractionSettings,
|
|
20
|
+
...settings
|
|
21
|
+
};
|
|
22
|
+
this.allowUserInteraction = interactionSettings.allowInteraction;
|
|
23
|
+
this.statusManager.allowUpdates(interactionSettings.allowUpdates);
|
|
24
|
+
this.allowExecution = interactionSettings.allowExecution;
|
|
25
|
+
});
|
|
26
|
+
require_defineProperty._defineProperty(this, "createBaseContext", async (client, step, retryParams) => {
|
|
27
|
+
const fromChain = await client.getChainById(step.action.fromChainId);
|
|
28
|
+
const toChain = await client.getChainById(step.action.toChainId);
|
|
29
|
+
return {
|
|
30
|
+
client,
|
|
31
|
+
step,
|
|
32
|
+
fromChain,
|
|
33
|
+
toChain,
|
|
34
|
+
isBridgeExecution: fromChain.id !== toChain.id,
|
|
35
|
+
retryParams,
|
|
36
|
+
statusManager: this.statusManager,
|
|
37
|
+
executionOptions: this.executionOptions,
|
|
38
|
+
allowUserInteraction: this.allowUserInteraction
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
require_defineProperty._defineProperty(this, "executeStep", async (client, step, retryParams) => {
|
|
42
|
+
try {
|
|
43
|
+
step.execution = this.statusManager.initializeExecution(step);
|
|
44
|
+
const baseContext = await this.createBaseContext(client, step, retryParams);
|
|
45
|
+
const context = await this.createContext(baseContext);
|
|
46
|
+
await this.createPipeline(context).run(context);
|
|
47
|
+
return step;
|
|
48
|
+
} catch (error) {
|
|
49
|
+
const action = step.execution?.actions?.at(-1);
|
|
50
|
+
const parsed = await this.parseErrors(error, step, action, retryParams);
|
|
51
|
+
if (!(parsed instanceof require_errors_errors.ExecuteStepRetryError)) if (action) this.statusManager.updateAction(step, action.type, "FAILED", { error: {
|
|
52
|
+
message: parsed.cause?.message,
|
|
53
|
+
code: parsed.code
|
|
54
|
+
} });
|
|
55
|
+
else this.statusManager.updateExecution(step, {
|
|
56
|
+
status: "FAILED",
|
|
57
|
+
error: {
|
|
58
|
+
message: parsed.cause?.message,
|
|
59
|
+
code: parsed.code
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
throw parsed;
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
this.statusManager = new require_core_StatusManager.StatusManager(options.routeId);
|
|
66
|
+
this.executionOptions = options.executionOptions;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
//#endregion
|
|
82
70
|
exports.BaseStepExecutor = BaseStepExecutor;
|
|
71
|
+
|
|
83
72
|
//# sourceMappingURL=BaseStepExecutor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseStepExecutor.js","
|
|
1
|
+
{"version":3,"file":"BaseStepExecutor.js","names":["ExecuteStepRetryError","StatusManager"],"sources":["../../../src/core/BaseStepExecutor.ts"],"sourcesContent":["import { ExecuteStepRetryError } from '../errors/errors.js'\nimport type { SDKError } from '../errors/SDKError.js'\nimport type {\n ExecuteStepRetryParams,\n ExecutionAction,\n ExecutionOptions,\n InteractionSettings,\n LiFiStepExtended,\n SDKClient,\n StepExecutor,\n StepExecutorOptions,\n} from '../types/core.js'\nimport type {\n StepExecutorBaseContext,\n StepExecutorContext,\n} from '../types/execution.js'\nimport { StatusManager } from './StatusManager.js'\nimport type { TaskPipeline } from './TaskPipeline.js'\n\n// Please be careful when changing the defaults as it may break the behavior (e.g., background execution)\nconst defaultInteractionSettings = {\n allowInteraction: true,\n allowUpdates: true,\n allowExecution: true,\n}\n\nexport abstract class BaseStepExecutor implements StepExecutor {\n protected executionOptions?: ExecutionOptions\n protected statusManager: StatusManager\n\n public allowUserInteraction = true\n public allowExecution = true\n\n constructor(options: StepExecutorOptions) {\n this.statusManager = new StatusManager(options.routeId)\n this.executionOptions = options.executionOptions\n }\n\n setInteraction = (settings?: InteractionSettings): void => {\n const interactionSettings = {\n ...defaultInteractionSettings,\n ...settings,\n }\n this.allowUserInteraction = interactionSettings.allowInteraction\n this.statusManager.allowUpdates(interactionSettings.allowUpdates)\n this.allowExecution = interactionSettings.allowExecution\n }\n\n private createBaseContext = async (\n client: SDKClient,\n step: LiFiStepExtended,\n retryParams?: ExecuteStepRetryParams\n ): Promise<StepExecutorBaseContext> => {\n const fromChain = await client.getChainById(step.action.fromChainId)\n const toChain = await client.getChainById(step.action.toChainId)\n\n const isBridgeExecution = fromChain.id !== toChain.id\n\n return {\n client,\n step,\n fromChain,\n toChain,\n isBridgeExecution,\n retryParams,\n statusManager: this.statusManager,\n executionOptions: this.executionOptions,\n allowUserInteraction: this.allowUserInteraction,\n }\n }\n\n abstract createContext(\n baseContext: StepExecutorBaseContext\n ): Promise<StepExecutorContext>\n\n abstract createPipeline(context: StepExecutorContext): TaskPipeline\n\n abstract parseErrors(\n error: Error,\n step?: LiFiStepExtended,\n action?: ExecutionAction,\n retryParams?: ExecuteStepRetryParams\n ): Promise<SDKError | ExecuteStepRetryError>\n\n executeStep = async (\n client: SDKClient,\n step: LiFiStepExtended,\n retryParams?: ExecuteStepRetryParams\n ): Promise<LiFiStepExtended> => {\n try {\n step.execution = this.statusManager.initializeExecution(step)\n\n const baseContext = await this.createBaseContext(\n client,\n step,\n retryParams\n )\n const context = await this.createContext(baseContext)\n const pipeline = this.createPipeline(context)\n\n await pipeline.run(context)\n\n return step\n } catch (error: any) {\n // Derive failing action from last in execution.actions\n const action = step.execution?.actions?.at(-1)\n const parsed = await this.parseErrors(error, step, action, retryParams)\n if (!(parsed instanceof ExecuteStepRetryError)) {\n if (action) {\n this.statusManager.updateAction(step, action.type, 'FAILED', {\n error: {\n message: parsed.cause?.message,\n code: parsed.code,\n },\n })\n } else {\n this.statusManager.updateExecution(step, {\n status: 'FAILED',\n error: {\n message: parsed.cause?.message,\n code: parsed.code,\n },\n })\n }\n }\n throw parsed\n }\n }\n}\n"],"mappings":";;;;;AAoBA,MAAM,6BAA6B;CACjC,kBAAkB;CAClB,cAAc;CACd,gBAAgB;CACjB;AAED,IAAsB,mBAAtB,MAA+D;CAO7D,YAAY,SAA8B;+CANhC,oBAAA,KAAA,EAAmC;+CACnC,iBAAA,KAAA,EAA4B;+CAE/B,wBAAuB,KAAI;+CAC3B,kBAAiB,KAAI;+CAO5B,mBAAkB,aAAyC;GACzD,MAAM,sBAAsB;IAC1B,GAAG;IACH,GAAG;IACJ;AACD,QAAK,uBAAuB,oBAAoB;AAChD,QAAK,cAAc,aAAa,oBAAoB,aAAa;AACjE,QAAK,iBAAiB,oBAAoB;IAC3C;+CAEO,qBAAoB,OAC1B,QACA,MACA,gBACqC;GACrC,MAAM,YAAY,MAAM,OAAO,aAAa,KAAK,OAAO,YAAY;GACpE,MAAM,UAAU,MAAM,OAAO,aAAa,KAAK,OAAO,UAAU;AAIhE,UAAO;IACL;IACA;IACA;IACA;IACA,mBAPwB,UAAU,OAAO,QAAQ;IAQjD;IACA,eAAe,KAAK;IACpB,kBAAkB,KAAK;IACvB,sBAAsB,KAAK;IAC5B;IACF;+CAeD,eAAc,OACZ,QACA,MACA,gBAC8B;AAC9B,OAAI;AACF,SAAK,YAAY,KAAK,cAAc,oBAAoB,KAAK;IAE7D,MAAM,cAAc,MAAM,KAAK,kBAC7B,QACA,MACA,YACD;IACD,MAAM,UAAU,MAAM,KAAK,cAAc,YAAY;AAGrD,UAFiB,KAAK,eAAe,QAAQ,CAE9B,IAAI,QAAQ;AAE3B,WAAO;YACA,OAAY;IAEnB,MAAM,SAAS,KAAK,WAAW,SAAS,GAAG,GAAG;IAC9C,MAAM,SAAS,MAAM,KAAK,YAAY,OAAO,MAAM,QAAQ,YAAY;AACvE,QAAI,EAAE,kBAAkBA,sBAAAA,uBACtB,KAAI,OACF,MAAK,cAAc,aAAa,MAAM,OAAO,MAAM,UAAU,EAC3D,OAAO;KACL,SAAS,OAAO,OAAO;KACvB,MAAM,OAAO;KACd,EACF,CAAC;QAEF,MAAK,cAAc,gBAAgB,MAAM;KACvC,QAAQ;KACR,OAAO;MACL,SAAS,OAAO,OAAO;MACvB,MAAM,OAAO;MACd;KACF,CAAC;AAGN,UAAM;;IAET;AA7FC,OAAK,gBAAgB,IAAIC,2BAAAA,cAAc,QAAQ,QAAQ;AACvD,OAAK,mBAAmB,QAAQ"}
|
|
@@ -1,24 +1,83 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { Execution, ExecutionAction, ExecutionActionStatus, ExecutionActionType, LiFiStepExtended } from "../types/core.js";
|
|
2
|
+
import { ChainId, LiFiStep } from "@lifi/types";
|
|
3
|
+
|
|
4
|
+
//#region src/core/StatusManager.d.ts
|
|
3
5
|
type ActionProps = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
step: LiFiStepExtended;
|
|
7
|
+
type: ExecutionActionType;
|
|
8
|
+
chainId: ChainId;
|
|
9
|
+
status: ExecutionActionStatus;
|
|
8
10
|
};
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Manages status updates of a route and provides various functions for tracking actions.
|
|
13
|
+
*/
|
|
14
|
+
declare class StatusManager {
|
|
15
|
+
private readonly routeId;
|
|
16
|
+
private shouldUpdate;
|
|
17
|
+
constructor(routeId: string);
|
|
18
|
+
/**
|
|
19
|
+
* Initializes the execution object of a Step.
|
|
20
|
+
* @param step The current step in execution
|
|
21
|
+
* @returns The initialized execution object for this step
|
|
22
|
+
*/
|
|
23
|
+
initializeExecution: (step: LiFiStepExtended) => Execution;
|
|
24
|
+
/**
|
|
25
|
+
* Updates the execution object of a Step.
|
|
26
|
+
* @param step The current step in execution
|
|
27
|
+
* @param execution Partial execution data to merge
|
|
28
|
+
* @returns The step with the updated execution object
|
|
29
|
+
*/
|
|
30
|
+
updateExecution(step: LiFiStepExtended, execution: Partial<Execution>): LiFiStep;
|
|
31
|
+
/**
|
|
32
|
+
* Finds an action of the specified type in the step's execution
|
|
33
|
+
* @param step The step to search in
|
|
34
|
+
* @param type The action type to find
|
|
35
|
+
* @returns The found action or undefined if not found
|
|
36
|
+
*/
|
|
37
|
+
findAction(step: LiFiStepExtended, type: ExecutionActionType): ExecutionAction | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Create and push a new action into the execution.
|
|
40
|
+
* Caller is responsible for ensuring an action of this type does not already exist.
|
|
41
|
+
* @param step The step that should contain the new action.
|
|
42
|
+
* @param type Type of the action.
|
|
43
|
+
* @param chainId Chain Id of the action.
|
|
44
|
+
* @param status The initial status for the new action.
|
|
45
|
+
* @returns The created action.
|
|
46
|
+
*/
|
|
47
|
+
createAction: ({
|
|
48
|
+
step,
|
|
49
|
+
type,
|
|
50
|
+
chainId,
|
|
51
|
+
status
|
|
52
|
+
}: ActionProps) => ExecutionAction;
|
|
53
|
+
/**
|
|
54
|
+
* Find an existing action by type and update it, or create a new one if none exists.
|
|
55
|
+
* @param step The step that should contain the action.
|
|
56
|
+
* @param type Type of the action. Used to identify already existing actions.
|
|
57
|
+
* @param chainId Chain Id of the action (used when creating).
|
|
58
|
+
* @param status The status to set on the found or newly created action.
|
|
59
|
+
* @returns The updated or newly created action.
|
|
60
|
+
*/
|
|
61
|
+
initializeAction: ({
|
|
62
|
+
step,
|
|
63
|
+
type,
|
|
64
|
+
chainId,
|
|
65
|
+
status
|
|
66
|
+
}: ActionProps) => ExecutionAction;
|
|
67
|
+
/**
|
|
68
|
+
* Update an action object.
|
|
69
|
+
* @param step The step where the action should be updated
|
|
70
|
+
* @param type The action type to update
|
|
71
|
+
* @param status The status the action gets.
|
|
72
|
+
* @param [params] Additional parameters to append to the action.
|
|
73
|
+
* @returns The updated action
|
|
74
|
+
*/
|
|
75
|
+
updateAction: (step: LiFiStepExtended, type: ExecutionActionType, status: ExecutionActionStatus, params?: Partial<ExecutionAction & {
|
|
76
|
+
signedAt?: number;
|
|
77
|
+
}>) => ExecutionAction;
|
|
78
|
+
updateStepInRoute: (step: LiFiStep) => LiFiStep;
|
|
79
|
+
allowUpdates(value: boolean): void;
|
|
23
80
|
}
|
|
24
|
-
|
|
81
|
+
//#endregion
|
|
82
|
+
export { StatusManager };
|
|
83
|
+
//# sourceMappingURL=StatusManager.d.ts.map
|
|
@@ -1,141 +1,177 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_defineProperty = require("../_virtual/_@oxc-project_runtime@0.115.0/helpers/defineProperty.js");
|
|
3
|
+
const require_core_actionMessages = require("./actionMessages.js");
|
|
4
|
+
const require_core_executionState = require("./executionState.js");
|
|
5
|
+
//#region src/core/StatusManager.ts
|
|
6
|
+
/**
|
|
7
|
+
* Manages status updates of a route and provides various functions for tracking actions.
|
|
8
|
+
*/
|
|
9
|
+
var StatusManager = class {
|
|
10
|
+
constructor(routeId) {
|
|
11
|
+
require_defineProperty._defineProperty(this, "routeId", void 0);
|
|
12
|
+
require_defineProperty._defineProperty(this, "shouldUpdate", true);
|
|
13
|
+
require_defineProperty._defineProperty(
|
|
14
|
+
this,
|
|
15
|
+
/**
|
|
16
|
+
* Initializes the execution object of a Step.
|
|
17
|
+
* @param step The current step in execution
|
|
18
|
+
* @returns The initialized execution object for this step
|
|
19
|
+
*/
|
|
20
|
+
"initializeExecution",
|
|
21
|
+
(step) => {
|
|
22
|
+
if (!step.execution) {
|
|
23
|
+
step.execution = {
|
|
24
|
+
startedAt: Date.now(),
|
|
25
|
+
status: "PENDING",
|
|
26
|
+
actions: []
|
|
27
|
+
};
|
|
28
|
+
this.updateStepInRoute(step);
|
|
29
|
+
}
|
|
30
|
+
if (step.execution.status === "FAILED") {
|
|
31
|
+
step.execution.startedAt = Date.now();
|
|
32
|
+
step.execution.status = "PENDING";
|
|
33
|
+
step.execution.signedAt = void 0;
|
|
34
|
+
step.execution.error = void 0;
|
|
35
|
+
this.updateStepInRoute(step);
|
|
36
|
+
}
|
|
37
|
+
return step.execution;
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
require_defineProperty._defineProperty(
|
|
41
|
+
this,
|
|
42
|
+
/**
|
|
43
|
+
* Create and push a new action into the execution.
|
|
44
|
+
* Caller is responsible for ensuring an action of this type does not already exist.
|
|
45
|
+
* @param step The step that should contain the new action.
|
|
46
|
+
* @param type Type of the action.
|
|
47
|
+
* @param chainId Chain Id of the action.
|
|
48
|
+
* @param status The initial status for the new action.
|
|
49
|
+
* @returns The created action.
|
|
50
|
+
*/
|
|
51
|
+
"createAction",
|
|
52
|
+
({ step, type, chainId, status }) => {
|
|
53
|
+
if (!step.execution) throw new Error("Execution hasn't been initialized.");
|
|
54
|
+
const newAction = {
|
|
55
|
+
type,
|
|
56
|
+
message: require_core_actionMessages.getActionMessage(type, status),
|
|
57
|
+
status,
|
|
58
|
+
chainId
|
|
59
|
+
};
|
|
60
|
+
step.execution.actions.push(newAction);
|
|
61
|
+
this.updateStepInRoute(step);
|
|
62
|
+
return newAction;
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
require_defineProperty._defineProperty(
|
|
66
|
+
this,
|
|
67
|
+
/**
|
|
68
|
+
* Find an existing action by type and update it, or create a new one if none exists.
|
|
69
|
+
* @param step The step that should contain the action.
|
|
70
|
+
* @param type Type of the action. Used to identify already existing actions.
|
|
71
|
+
* @param chainId Chain Id of the action (used when creating).
|
|
72
|
+
* @param status The status to set on the found or newly created action.
|
|
73
|
+
* @returns The updated or newly created action.
|
|
74
|
+
*/
|
|
75
|
+
"initializeAction",
|
|
76
|
+
({ step, type, chainId, status }) => {
|
|
77
|
+
if (this.findAction(step, type)) return this.updateAction(step, type, status, { error: void 0 });
|
|
78
|
+
return this.createAction({
|
|
79
|
+
step,
|
|
80
|
+
type,
|
|
81
|
+
chainId,
|
|
82
|
+
status
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
require_defineProperty._defineProperty(
|
|
87
|
+
this,
|
|
88
|
+
/**
|
|
89
|
+
* Update an action object.
|
|
90
|
+
* @param step The step where the action should be updated
|
|
91
|
+
* @param type The action type to update
|
|
92
|
+
* @param status The status the action gets.
|
|
93
|
+
* @param [params] Additional parameters to append to the action.
|
|
94
|
+
* @returns The updated action
|
|
95
|
+
*/
|
|
96
|
+
"updateAction",
|
|
97
|
+
(step, type, status, params) => {
|
|
98
|
+
if (!step.execution) throw new Error("Can't update an empty step execution.");
|
|
99
|
+
const currentAction = this.findAction(step, type);
|
|
100
|
+
if (!currentAction) throw new Error("Can't find an action for the given type.");
|
|
101
|
+
switch (status) {
|
|
102
|
+
case "CANCELLED": break;
|
|
103
|
+
case "FAILED":
|
|
104
|
+
step.execution.status = "FAILED";
|
|
105
|
+
if (params?.error) step.execution.error = params.error;
|
|
106
|
+
break;
|
|
107
|
+
case "DONE": break;
|
|
108
|
+
case "PENDING":
|
|
109
|
+
step.execution.status = "PENDING";
|
|
110
|
+
if (params?.signedAt) step.execution.signedAt = params.signedAt;
|
|
111
|
+
break;
|
|
112
|
+
case "RESET_REQUIRED":
|
|
113
|
+
case "MESSAGE_REQUIRED":
|
|
114
|
+
case "ACTION_REQUIRED":
|
|
115
|
+
step.execution.status = "ACTION_REQUIRED";
|
|
116
|
+
break;
|
|
117
|
+
default: break;
|
|
118
|
+
}
|
|
119
|
+
currentAction.status = status;
|
|
120
|
+
currentAction.message = require_core_actionMessages.getActionMessage(type, status);
|
|
121
|
+
if (params) {
|
|
122
|
+
const { signedAt: _signedAt, ...rest } = params;
|
|
123
|
+
Object.assign(currentAction, rest);
|
|
124
|
+
}
|
|
125
|
+
step.execution.actions = [...step.execution.actions.filter((action) => action.status === "DONE"), ...step.execution.actions.filter((action) => action.status !== "DONE")];
|
|
126
|
+
this.updateStepInRoute(step);
|
|
127
|
+
return currentAction;
|
|
128
|
+
}
|
|
129
|
+
);
|
|
130
|
+
require_defineProperty._defineProperty(this, "updateStepInRoute", (step) => {
|
|
131
|
+
if (!this.shouldUpdate) return step;
|
|
132
|
+
const data = require_core_executionState.executionState.get(this.routeId);
|
|
133
|
+
if (!data) throw new Error("Execution data not found.");
|
|
134
|
+
const stepIndex = data.route.steps.findIndex((routeStep) => routeStep.id === step.id);
|
|
135
|
+
if (stepIndex === -1) throw new Error("Couldn't find a step to update.");
|
|
136
|
+
data.route.steps[stepIndex] = {
|
|
137
|
+
...data.route.steps[stepIndex],
|
|
138
|
+
...step
|
|
139
|
+
};
|
|
140
|
+
data.executionOptions?.updateRouteHook?.(data.route);
|
|
141
|
+
return data.route.steps[stepIndex];
|
|
142
|
+
});
|
|
143
|
+
this.routeId = routeId;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Updates the execution object of a Step.
|
|
147
|
+
* @param step The current step in execution
|
|
148
|
+
* @param execution Partial execution data to merge
|
|
149
|
+
* @returns The step with the updated execution object
|
|
150
|
+
*/
|
|
151
|
+
updateExecution(step, execution) {
|
|
152
|
+
if (!step.execution) throw Error("Can't update empty execution.");
|
|
153
|
+
step.execution = {
|
|
154
|
+
...step.execution,
|
|
155
|
+
...execution
|
|
156
|
+
};
|
|
157
|
+
this.updateStepInRoute(step);
|
|
158
|
+
return step;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Finds an action of the specified type in the step's execution
|
|
162
|
+
* @param step The step to search in
|
|
163
|
+
* @param type The action type to find
|
|
164
|
+
* @returns The found action or undefined if not found
|
|
165
|
+
*/
|
|
166
|
+
findAction(step, type) {
|
|
167
|
+
if (!step.execution?.actions) throw new Error("Execution hasn't been initialized.");
|
|
168
|
+
return step.execution.actions.find((p) => p.type === type);
|
|
169
|
+
}
|
|
170
|
+
allowUpdates(value) {
|
|
171
|
+
this.shouldUpdate = value;
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
//#endregion
|
|
140
175
|
exports.StatusManager = StatusManager;
|
|
176
|
+
|
|
141
177
|
//# sourceMappingURL=StatusManager.js.map
|