@lifi/sdk 4.0.0-alpha.8 → 4.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/actions/getQuote.js +2 -1
- package/dist/cjs/actions/getQuote.js.map +1 -1
- package/dist/cjs/actions/getRelayedTransactionStatus.js +1 -1
- package/dist/cjs/actions/getRelayedTransactionStatus.js.map +1 -1
- package/dist/cjs/actions/getRelayerQuote.js +2 -1
- package/dist/cjs/actions/getRelayerQuote.js.map +1 -1
- package/dist/cjs/actions/getStepTransaction.js +18 -1
- package/dist/cjs/actions/getStepTransaction.js.map +1 -1
- package/dist/cjs/core/BaseStepExecutionTask.d.ts +5 -0
- package/dist/cjs/core/BaseStepExecutionTask.js +10 -0
- package/dist/cjs/core/BaseStepExecutionTask.js.map +1 -0
- package/dist/cjs/core/BaseStepExecutor.d.ts +10 -3
- package/dist/cjs/core/BaseStepExecutor.js +53 -0
- package/dist/cjs/core/BaseStepExecutor.js.map +1 -1
- package/dist/cjs/core/StatusManager.d.ts +13 -12
- package/dist/cjs/core/StatusManager.js +55 -61
- package/dist/cjs/core/StatusManager.js.map +1 -1
- package/dist/cjs/core/TaskPipeline.d.ts +7 -0
- package/dist/cjs/core/TaskPipeline.js +27 -0
- package/dist/cjs/core/TaskPipeline.js.map +1 -0
- package/dist/cjs/core/actionMessages.d.ts +4 -0
- package/dist/cjs/core/{processMessages.js → actionMessages.js} +25 -9
- package/dist/cjs/core/actionMessages.js.map +1 -0
- package/dist/cjs/core/execution.js +13 -1
- package/dist/cjs/core/execution.js.map +1 -1
- package/dist/cjs/core/prepareRestart.js +6 -6
- package/dist/cjs/core/prepareRestart.js.map +1 -1
- package/dist/cjs/core/storage.d.ts +17 -0
- package/dist/cjs/core/storage.js +36 -0
- package/dist/cjs/core/storage.js.map +1 -0
- package/dist/cjs/core/tasks/CheckBalanceTask.d.ts +5 -0
- package/dist/cjs/core/tasks/CheckBalanceTask.js +26 -0
- package/dist/cjs/core/tasks/CheckBalanceTask.js.map +1 -0
- package/dist/cjs/core/tasks/PrepareTransactionTask.d.ts +5 -0
- package/dist/cjs/core/tasks/PrepareTransactionTask.js +36 -0
- package/dist/cjs/core/tasks/PrepareTransactionTask.js.map +1 -0
- package/dist/cjs/core/tasks/WaitForTransactionStatusTask.d.ts +8 -0
- package/dist/cjs/core/tasks/WaitForTransactionStatusTask.js +73 -0
- package/dist/cjs/core/tasks/WaitForTransactionStatusTask.js.map +1 -0
- package/dist/cjs/core/{checkBalance.d.ts → tasks/helpers/checkBalance.d.ts} +1 -1
- package/dist/cjs/core/{checkBalance.js → tasks/helpers/checkBalance.js} +4 -4
- package/dist/cjs/core/tasks/helpers/checkBalance.js.map +1 -0
- package/dist/cjs/core/tasks/helpers/getTransactionRequestData.d.ts +2 -0
- package/dist/cjs/core/tasks/helpers/getTransactionRequestData.js +30 -0
- package/dist/cjs/core/tasks/helpers/getTransactionRequestData.js.map +1 -0
- package/dist/cjs/core/{stepComparison.d.ts → tasks/helpers/stepComparison.d.ts} +2 -2
- package/dist/cjs/core/{stepComparison.js → tasks/helpers/stepComparison.js} +3 -3
- package/dist/cjs/core/tasks/helpers/stepComparison.js.map +1 -0
- package/dist/cjs/core/tasks/helpers/waitForTransactionStatus.d.ts +4 -0
- package/dist/cjs/core/{waitForTransactionStatus.js → tasks/helpers/waitForTransactionStatus.js} +10 -8
- package/dist/cjs/core/tasks/helpers/waitForTransactionStatus.js.map +1 -0
- package/dist/cjs/core/utils.d.ts +6 -1
- package/dist/cjs/errors/SDKError.d.ts +3 -3
- package/dist/cjs/errors/SDKError.js +3 -3
- package/dist/cjs/errors/SDKError.js.map +1 -1
- package/dist/cjs/errors/constants.d.ts +2 -1
- package/dist/cjs/errors/constants.js +1 -0
- package/dist/cjs/errors/constants.js.map +1 -1
- package/dist/cjs/errors/errors.d.ts +5 -0
- package/dist/cjs/errors/errors.js +9 -1
- package/dist/cjs/errors/errors.js.map +1 -1
- package/dist/cjs/index.d.ts +15 -6
- package/dist/cjs/index.js +26 -7
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/core.d.ts +21 -17
- package/dist/cjs/types/execution.d.ts +22 -0
- package/dist/cjs/types/execution.js +3 -0
- package/dist/cjs/types/execution.js.map +1 -0
- package/dist/cjs/utils/waitForResult.d.ts +1 -1
- package/dist/cjs/utils/waitForResult.js +6 -2
- package/dist/cjs/utils/waitForResult.js.map +1 -1
- package/dist/cjs/utils/withDedupe.d.ts +5 -0
- package/dist/cjs/utils/withDedupe.js +2 -0
- package/dist/cjs/utils/withDedupe.js.map +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/actions/getQuote.js +2 -1
- package/dist/esm/actions/getQuote.js.map +1 -1
- package/dist/esm/actions/getRelayedTransactionStatus.js +1 -1
- package/dist/esm/actions/getRelayedTransactionStatus.js.map +1 -1
- package/dist/esm/actions/getRelayerQuote.js +2 -1
- package/dist/esm/actions/getRelayerQuote.js.map +1 -1
- package/dist/esm/actions/getStepTransaction.js +18 -1
- package/dist/esm/actions/getStepTransaction.js.map +1 -1
- package/dist/esm/core/BaseStepExecutionTask.d.ts +5 -0
- package/dist/esm/core/BaseStepExecutionTask.js +6 -0
- package/dist/esm/core/BaseStepExecutionTask.js.map +1 -0
- package/dist/esm/core/BaseStepExecutor.d.ts +10 -3
- package/dist/esm/core/BaseStepExecutor.js +53 -0
- package/dist/esm/core/BaseStepExecutor.js.map +1 -1
- package/dist/esm/core/StatusManager.d.ts +40 -39
- package/dist/esm/core/StatusManager.js +86 -92
- package/dist/esm/core/StatusManager.js.map +1 -1
- package/dist/esm/core/TaskPipeline.d.ts +7 -0
- package/dist/esm/core/TaskPipeline.js +23 -0
- package/dist/esm/core/TaskPipeline.js.map +1 -0
- package/dist/esm/core/actionMessages.d.ts +4 -0
- package/dist/esm/core/{processMessages.js → actionMessages.js} +24 -8
- package/dist/esm/core/actionMessages.js.map +1 -0
- package/dist/esm/core/execution.js +14 -3
- package/dist/esm/core/execution.js.map +1 -1
- package/dist/esm/core/prepareRestart.js +10 -9
- package/dist/esm/core/prepareRestart.js.map +1 -1
- package/dist/esm/core/storage.d.ts +17 -0
- package/dist/esm/core/storage.js +30 -0
- package/dist/esm/core/storage.js.map +1 -0
- package/dist/esm/core/tasks/CheckBalanceTask.d.ts +5 -0
- package/dist/esm/core/tasks/CheckBalanceTask.js +22 -0
- package/dist/esm/core/tasks/CheckBalanceTask.js.map +1 -0
- package/dist/esm/core/tasks/PrepareTransactionTask.d.ts +5 -0
- package/dist/esm/core/tasks/PrepareTransactionTask.js +32 -0
- package/dist/esm/core/tasks/PrepareTransactionTask.js.map +1 -0
- package/dist/esm/core/tasks/WaitForTransactionStatusTask.d.ts +8 -0
- package/dist/esm/core/tasks/WaitForTransactionStatusTask.js +74 -0
- package/dist/esm/core/tasks/WaitForTransactionStatusTask.js.map +1 -0
- package/dist/esm/core/{checkBalance.d.ts → tasks/helpers/checkBalance.d.ts} +1 -1
- package/dist/esm/core/{checkBalance.js → tasks/helpers/checkBalance.js} +4 -4
- package/dist/esm/core/tasks/helpers/checkBalance.js.map +1 -0
- package/dist/esm/core/tasks/helpers/getTransactionRequestData.d.ts +2 -0
- package/dist/esm/core/tasks/helpers/getTransactionRequestData.js +26 -0
- package/dist/esm/core/tasks/helpers/getTransactionRequestData.js.map +1 -0
- package/dist/esm/core/{stepComparison.d.ts → tasks/helpers/stepComparison.d.ts} +2 -2
- package/dist/esm/core/{stepComparison.js → tasks/helpers/stepComparison.js} +3 -3
- package/dist/esm/core/tasks/helpers/stepComparison.js.map +1 -0
- package/dist/esm/core/tasks/helpers/waitForTransactionStatus.d.ts +4 -0
- package/dist/esm/core/{waitForTransactionStatus.js → tasks/helpers/waitForTransactionStatus.js} +9 -7
- package/dist/esm/core/tasks/helpers/waitForTransactionStatus.js.map +1 -0
- package/dist/esm/core/utils.d.ts +6 -1
- package/dist/esm/errors/SDKError.d.ts +3 -3
- package/dist/esm/errors/SDKError.js +4 -4
- package/dist/esm/errors/SDKError.js.map +1 -1
- package/dist/esm/errors/constants.d.ts +2 -1
- package/dist/esm/errors/constants.js +1 -0
- package/dist/esm/errors/constants.js.map +1 -1
- package/dist/esm/errors/errors.d.ts +10 -0
- package/dist/esm/errors/errors.js +12 -0
- package/dist/esm/errors/errors.js.map +1 -1
- package/dist/esm/index.d.ts +15 -6
- package/dist/esm/index.js +12 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/core.d.ts +25 -17
- package/dist/esm/types/execution.d.ts +23 -0
- package/dist/esm/types/execution.js +2 -0
- package/dist/esm/types/execution.js.map +1 -0
- package/dist/esm/utils/waitForResult.d.ts +2 -2
- package/dist/esm/utils/waitForResult.js +7 -3
- package/dist/esm/utils/waitForResult.js.map +1 -1
- package/dist/esm/utils/withDedupe.d.ts +10 -0
- package/dist/esm/utils/withDedupe.js +1 -1
- package/dist/esm/utils/withDedupe.js.map +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/types/actions/getRelayerQuote.d.ts.map +1 -1
- package/dist/types/actions/getStepTransaction.d.ts.map +1 -1
- package/dist/types/core/BaseStepExecutionTask.d.ts +6 -0
- package/dist/types/core/BaseStepExecutionTask.d.ts.map +1 -0
- package/dist/types/core/BaseStepExecutor.d.ts +10 -3
- package/dist/types/core/BaseStepExecutor.d.ts.map +1 -1
- package/dist/types/core/StatusManager.d.ts +40 -39
- package/dist/types/core/StatusManager.d.ts.map +1 -1
- package/dist/types/core/TaskPipeline.d.ts +8 -0
- package/dist/types/core/TaskPipeline.d.ts.map +1 -0
- package/dist/types/core/actionMessages.d.ts +5 -0
- package/dist/types/core/actionMessages.d.ts.map +1 -0
- package/dist/types/core/execution.d.ts.map +1 -1
- package/dist/types/core/prepareRestart.d.ts.map +1 -1
- package/dist/types/core/storage.d.ts +18 -0
- package/dist/types/core/storage.d.ts.map +1 -0
- package/dist/types/core/tasks/CheckBalanceTask.d.ts +6 -0
- package/dist/types/core/tasks/CheckBalanceTask.d.ts.map +1 -0
- package/dist/types/core/tasks/PrepareTransactionTask.d.ts +6 -0
- package/dist/types/core/tasks/PrepareTransactionTask.d.ts.map +1 -0
- package/dist/types/core/tasks/WaitForTransactionStatusTask.d.ts +9 -0
- package/dist/types/core/tasks/WaitForTransactionStatusTask.d.ts.map +1 -0
- package/dist/types/core/{checkBalance.d.ts → tasks/helpers/checkBalance.d.ts} +1 -1
- package/dist/types/core/tasks/helpers/checkBalance.d.ts.map +1 -0
- package/dist/types/core/tasks/helpers/getTransactionRequestData.d.ts +3 -0
- package/dist/types/core/tasks/helpers/getTransactionRequestData.d.ts.map +1 -0
- package/dist/types/core/{stepComparison.d.ts → tasks/helpers/stepComparison.d.ts} +2 -2
- package/dist/types/core/tasks/helpers/stepComparison.d.ts.map +1 -0
- package/dist/types/core/tasks/helpers/waitForTransactionStatus.d.ts +5 -0
- package/dist/types/core/tasks/helpers/waitForTransactionStatus.d.ts.map +1 -0
- package/dist/types/core/utils.d.ts +6 -1
- package/dist/types/core/utils.d.ts.map +1 -1
- package/dist/types/errors/SDKError.d.ts +3 -3
- package/dist/types/errors/SDKError.d.ts.map +1 -1
- package/dist/types/errors/constants.d.ts +2 -1
- package/dist/types/errors/constants.d.ts.map +1 -1
- package/dist/types/errors/errors.d.ts +10 -0
- package/dist/types/errors/errors.d.ts.map +1 -1
- package/dist/types/index.d.ts +15 -6
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types/core.d.ts +25 -17
- package/dist/types/types/core.d.ts.map +1 -1
- package/dist/types/types/execution.d.ts +24 -0
- package/dist/types/types/execution.d.ts.map +1 -0
- package/dist/types/utils/waitForResult.d.ts +2 -2
- package/dist/types/utils/waitForResult.d.ts.map +1 -1
- package/dist/types/utils/withDedupe.d.ts +10 -0
- package/dist/types/utils/withDedupe.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/version.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/actions/getQuote.ts +4 -1
- package/src/actions/getRelayedTransactionStatus.ts +1 -1
- package/src/actions/getRelayerQuote.ts +4 -1
- package/src/actions/getStepTransaction.ts +27 -11
- package/src/core/BaseStepExecutionTask.ts +9 -0
- package/src/core/BaseStepExecutor.ts +91 -2
- package/src/core/StatusManager.ts +108 -113
- package/src/core/TaskPipeline.ts +28 -0
- package/src/core/{processMessages.ts → actionMessages.ts} +32 -12
- package/src/core/execution.ts +17 -3
- package/src/core/prepareRestart.ts +12 -11
- package/src/core/storage.ts +42 -0
- package/src/core/tasks/CheckBalanceTask.ts +29 -0
- package/src/core/tasks/PrepareTransactionTask.ts +62 -0
- package/src/core/tasks/WaitForTransactionStatusTask.ts +114 -0
- package/src/core/{checkBalance.ts → tasks/helpers/checkBalance.ts} +5 -5
- package/src/core/tasks/helpers/getTransactionRequestData.ts +47 -0
- package/src/core/{stepComparison.ts → tasks/helpers/stepComparison.ts} +5 -5
- package/src/core/{waitForTransactionStatus.ts → tasks/helpers/waitForTransactionStatus.ts} +11 -9
- package/src/errors/SDKError.ts +5 -5
- package/src/errors/constants.ts +1 -0
- package/src/errors/errors.ts +24 -0
- package/src/index.ts +27 -7
- package/src/types/core.ts +30 -25
- package/src/types/execution.ts +32 -0
- package/src/utils/waitForResult.ts +9 -4
- package/src/utils/withDedupe.ts +1 -1
- package/src/version.ts +1 -1
- package/dist/cjs/core/checkBalance.js.map +0 -1
- package/dist/cjs/core/processMessages.d.ts +0 -4
- package/dist/cjs/core/processMessages.js.map +0 -1
- package/dist/cjs/core/stepComparison.js.map +0 -1
- package/dist/cjs/core/waitForDestinationChainTransaction.d.ts +0 -4
- package/dist/cjs/core/waitForDestinationChainTransaction.js +0 -69
- package/dist/cjs/core/waitForDestinationChainTransaction.js.map +0 -1
- package/dist/cjs/core/waitForTransactionStatus.d.ts +0 -4
- package/dist/cjs/core/waitForTransactionStatus.js.map +0 -1
- package/dist/esm/core/checkBalance.js.map +0 -1
- package/dist/esm/core/processMessages.d.ts +0 -4
- package/dist/esm/core/processMessages.js.map +0 -1
- package/dist/esm/core/stepComparison.js.map +0 -1
- package/dist/esm/core/waitForDestinationChainTransaction.d.ts +0 -4
- package/dist/esm/core/waitForDestinationChainTransaction.js +0 -71
- package/dist/esm/core/waitForDestinationChainTransaction.js.map +0 -1
- package/dist/esm/core/waitForTransactionStatus.d.ts +0 -4
- package/dist/esm/core/waitForTransactionStatus.js.map +0 -1
- package/dist/types/core/checkBalance.d.ts.map +0 -1
- package/dist/types/core/processMessages.d.ts +0 -5
- package/dist/types/core/processMessages.d.ts.map +0 -1
- package/dist/types/core/stepComparison.d.ts.map +0 -1
- package/dist/types/core/waitForDestinationChainTransaction.d.ts +0 -5
- package/dist/types/core/waitForDestinationChainTransaction.d.ts.map +0 -1
- package/dist/types/core/waitForTransactionStatus.d.ts +0 -5
- package/dist/types/core/waitForTransactionStatus.d.ts.map +0 -1
- package/src/core/waitForDestinationChainTransaction.ts +0 -106
|
@@ -1,27 +1,23 @@
|
|
|
1
1
|
import type { ChainId, LiFiStep } from '@lifi/types'
|
|
2
2
|
import type {
|
|
3
3
|
Execution,
|
|
4
|
-
|
|
4
|
+
ExecutionAction,
|
|
5
|
+
ExecutionActionStatus,
|
|
6
|
+
ExecutionActionType,
|
|
5
7
|
LiFiStepExtended,
|
|
6
|
-
Process,
|
|
7
|
-
ProcessStatus,
|
|
8
|
-
ProcessType,
|
|
9
8
|
} from '../types/core.js'
|
|
9
|
+
import { getActionMessage } from './actionMessages.js'
|
|
10
10
|
import { executionState } from './executionState.js'
|
|
11
|
-
import { getProcessMessage } from './processMessages.js'
|
|
12
11
|
|
|
13
|
-
type
|
|
12
|
+
type ActionProps = {
|
|
14
13
|
step: LiFiStepExtended
|
|
15
|
-
type:
|
|
16
|
-
chainId
|
|
17
|
-
status
|
|
18
|
-
startedAt?: number
|
|
14
|
+
type: ExecutionActionType
|
|
15
|
+
chainId: ChainId
|
|
16
|
+
status: ExecutionActionStatus
|
|
19
17
|
}
|
|
20
18
|
|
|
21
19
|
/**
|
|
22
|
-
* Manages status updates of a route and provides various functions for tracking
|
|
23
|
-
* @param {string} routeId The route dd this StatusManger belongs to.
|
|
24
|
-
* @returns {StatusManager} An instance of StatusManager.
|
|
20
|
+
* Manages status updates of a route and provides various functions for tracking actions.
|
|
25
21
|
*/
|
|
26
22
|
export class StatusManager {
|
|
27
23
|
private readonly routeId: string
|
|
@@ -33,15 +29,15 @@ export class StatusManager {
|
|
|
33
29
|
|
|
34
30
|
/**
|
|
35
31
|
* Initializes the execution object of a Step.
|
|
36
|
-
* @param step
|
|
37
|
-
* @returns The initialized execution object for this step
|
|
32
|
+
* @param step The current step in execution
|
|
33
|
+
* @returns The initialized execution object for this step
|
|
38
34
|
*/
|
|
39
|
-
|
|
35
|
+
initializeExecution = (step: LiFiStepExtended): Execution => {
|
|
40
36
|
if (!step.execution) {
|
|
41
37
|
step.execution = {
|
|
42
|
-
status: 'PENDING',
|
|
43
|
-
process: [],
|
|
44
38
|
startedAt: Date.now(),
|
|
39
|
+
status: 'PENDING',
|
|
40
|
+
actions: [],
|
|
45
41
|
}
|
|
46
42
|
this.updateStepInRoute(step)
|
|
47
43
|
}
|
|
@@ -50,6 +46,9 @@ export class StatusManager {
|
|
|
50
46
|
if (step.execution.status === 'FAILED') {
|
|
51
47
|
step.execution.startedAt = Date.now()
|
|
52
48
|
step.execution.status = 'PENDING'
|
|
49
|
+
step.execution.signedAt = undefined
|
|
50
|
+
step.execution.lastActionType = undefined
|
|
51
|
+
step.execution.error = undefined
|
|
53
52
|
this.updateStepInRoute(step)
|
|
54
53
|
}
|
|
55
54
|
|
|
@@ -58,170 +57,166 @@ export class StatusManager {
|
|
|
58
57
|
|
|
59
58
|
/**
|
|
60
59
|
* Updates the execution object of a Step.
|
|
61
|
-
* @param step
|
|
62
|
-
* @param
|
|
63
|
-
* @param execution Optional. Information about received tokens
|
|
60
|
+
* @param step The current step in execution
|
|
61
|
+
* @param execution Partial execution data to merge
|
|
64
62
|
* @returns The step with the updated execution object
|
|
65
63
|
*/
|
|
66
64
|
updateExecution(
|
|
67
65
|
step: LiFiStepExtended,
|
|
68
|
-
|
|
69
|
-
execution?: Partial<Execution>
|
|
66
|
+
execution: Partial<Execution>
|
|
70
67
|
): LiFiStep {
|
|
71
68
|
if (!step.execution) {
|
|
72
69
|
throw Error("Can't update empty execution.")
|
|
73
70
|
}
|
|
74
|
-
step.execution
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
if (execution) {
|
|
79
|
-
step.execution = {
|
|
80
|
-
...step.execution,
|
|
81
|
-
...execution,
|
|
82
|
-
}
|
|
71
|
+
step.execution = {
|
|
72
|
+
...step.execution,
|
|
73
|
+
...execution,
|
|
83
74
|
}
|
|
84
75
|
this.updateStepInRoute(step)
|
|
85
76
|
return step
|
|
86
77
|
}
|
|
87
78
|
|
|
88
79
|
/**
|
|
89
|
-
* Finds
|
|
80
|
+
* Finds an action of the specified type in the step's execution
|
|
90
81
|
* @param step The step to search in
|
|
91
|
-
* @param type The
|
|
92
|
-
* @
|
|
93
|
-
* @returns The found process or undefined if not found
|
|
82
|
+
* @param type The action type to find
|
|
83
|
+
* @returns The found action or undefined if not found
|
|
94
84
|
*/
|
|
95
|
-
|
|
85
|
+
findAction(
|
|
96
86
|
step: LiFiStepExtended,
|
|
97
|
-
type:
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
if (!step.execution?.process) {
|
|
87
|
+
type: ExecutionActionType
|
|
88
|
+
): ExecutionAction | undefined {
|
|
89
|
+
if (!step.execution?.actions) {
|
|
101
90
|
throw new Error("Execution hasn't been initialized.")
|
|
102
91
|
}
|
|
103
92
|
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
if (process && status && process.status !== status) {
|
|
107
|
-
process.status = status
|
|
108
|
-
this.updateStepInRoute(step)
|
|
109
|
-
}
|
|
93
|
+
const action = step.execution.actions.find((p) => p.type === type)
|
|
110
94
|
|
|
111
|
-
return
|
|
95
|
+
return action
|
|
112
96
|
}
|
|
113
97
|
|
|
114
98
|
/**
|
|
115
|
-
* Create and push a new
|
|
116
|
-
*
|
|
117
|
-
* @param
|
|
118
|
-
* @param
|
|
119
|
-
* @param
|
|
120
|
-
* @
|
|
99
|
+
* Create and push a new action into the execution.
|
|
100
|
+
* Caller is responsible for ensuring an action of this type does not already exist.
|
|
101
|
+
* @param step The step that should contain the new action.
|
|
102
|
+
* @param type Type of the action.
|
|
103
|
+
* @param chainId Chain Id of the action.
|
|
104
|
+
* @param status The initial status for the new action.
|
|
105
|
+
* @returns The created action.
|
|
121
106
|
*/
|
|
122
|
-
|
|
107
|
+
createAction = ({
|
|
123
108
|
step,
|
|
124
109
|
type,
|
|
125
110
|
chainId,
|
|
126
111
|
status,
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
if (process) {
|
|
132
|
-
return process
|
|
112
|
+
}: ActionProps): ExecutionAction => {
|
|
113
|
+
if (!step.execution) {
|
|
114
|
+
throw new Error("Execution hasn't been initialized.")
|
|
133
115
|
}
|
|
134
116
|
|
|
135
|
-
const
|
|
136
|
-
type
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
chainId: chainId,
|
|
117
|
+
const newAction: ExecutionAction = {
|
|
118
|
+
type,
|
|
119
|
+
message: getActionMessage(type, status),
|
|
120
|
+
status,
|
|
121
|
+
chainId,
|
|
141
122
|
}
|
|
142
123
|
|
|
143
|
-
step.execution
|
|
124
|
+
step.execution.actions.push(newAction)
|
|
125
|
+
step.execution.lastActionType = type
|
|
144
126
|
this.updateStepInRoute(step)
|
|
145
|
-
return
|
|
127
|
+
return newAction
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Find an existing action by type and update it, or create a new one if none exists.
|
|
132
|
+
* @param step The step that should contain the action.
|
|
133
|
+
* @param type Type of the action. Used to identify already existing actions.
|
|
134
|
+
* @param chainId Chain Id of the action (used when creating).
|
|
135
|
+
* @param status The status to set on the found or newly created action.
|
|
136
|
+
* @returns The updated or newly created action.
|
|
137
|
+
*/
|
|
138
|
+
initializeAction = ({
|
|
139
|
+
step,
|
|
140
|
+
type,
|
|
141
|
+
chainId,
|
|
142
|
+
status,
|
|
143
|
+
}: ActionProps): ExecutionAction => {
|
|
144
|
+
const action = this.findAction(step, type)
|
|
145
|
+
|
|
146
|
+
if (action) {
|
|
147
|
+
return this.updateAction(step, type, status, {
|
|
148
|
+
error: undefined,
|
|
149
|
+
})
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
return this.createAction({ step, type, chainId, status })
|
|
146
153
|
}
|
|
147
154
|
|
|
148
155
|
/**
|
|
149
|
-
* Update
|
|
150
|
-
* @param step The step where the
|
|
151
|
-
* @param type The
|
|
152
|
-
* @param status The status the
|
|
153
|
-
* @param [params] Additional parameters to append to the
|
|
154
|
-
* @returns The
|
|
156
|
+
* Update an action object.
|
|
157
|
+
* @param step The step where the action should be updated
|
|
158
|
+
* @param type The action type to update
|
|
159
|
+
* @param status The status the action gets.
|
|
160
|
+
* @param [params] Additional parameters to append to the action.
|
|
161
|
+
* @returns The updated action
|
|
155
162
|
*/
|
|
156
|
-
|
|
163
|
+
updateAction = (
|
|
157
164
|
step: LiFiStepExtended,
|
|
158
|
-
type:
|
|
159
|
-
status:
|
|
160
|
-
params?: Partial<
|
|
161
|
-
):
|
|
165
|
+
type: ExecutionActionType,
|
|
166
|
+
status: ExecutionActionStatus,
|
|
167
|
+
params?: Partial<ExecutionAction & { signedAt?: number }>
|
|
168
|
+
): ExecutionAction => {
|
|
162
169
|
if (!step.execution) {
|
|
163
170
|
throw new Error("Can't update an empty step execution.")
|
|
164
171
|
}
|
|
165
|
-
const
|
|
172
|
+
const currentAction = this.findAction(step, type)
|
|
166
173
|
|
|
167
|
-
if (!
|
|
168
|
-
throw new Error("Can't find
|
|
174
|
+
if (!currentAction) {
|
|
175
|
+
throw new Error("Can't find an action for the given type.")
|
|
169
176
|
}
|
|
170
177
|
|
|
171
178
|
switch (status) {
|
|
172
179
|
case 'CANCELLED':
|
|
173
|
-
currentProcess.doneAt = Date.now()
|
|
174
180
|
break
|
|
175
181
|
case 'FAILED':
|
|
176
|
-
currentProcess.doneAt = Date.now()
|
|
177
182
|
step.execution.status = 'FAILED'
|
|
183
|
+
if (params?.error) {
|
|
184
|
+
step.execution.error = params.error
|
|
185
|
+
}
|
|
178
186
|
break
|
|
179
187
|
case 'DONE':
|
|
180
|
-
currentProcess.doneAt = Date.now()
|
|
181
188
|
break
|
|
182
189
|
case 'PENDING':
|
|
183
190
|
step.execution.status = 'PENDING'
|
|
184
|
-
|
|
191
|
+
if (params?.signedAt) {
|
|
192
|
+
step.execution.signedAt = params.signedAt
|
|
193
|
+
}
|
|
185
194
|
break
|
|
186
195
|
case 'RESET_REQUIRED':
|
|
187
196
|
case 'MESSAGE_REQUIRED':
|
|
188
197
|
case 'ACTION_REQUIRED':
|
|
189
198
|
step.execution.status = 'ACTION_REQUIRED'
|
|
190
|
-
currentProcess.actionRequiredAt = Date.now()
|
|
191
199
|
break
|
|
192
200
|
default:
|
|
193
201
|
break
|
|
194
202
|
}
|
|
195
203
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
204
|
+
step.execution.lastActionType = type
|
|
205
|
+
|
|
206
|
+
currentAction.status = status
|
|
207
|
+
currentAction.message = getActionMessage(type, status)
|
|
208
|
+
// set extra parameters or overwrite the standard params set in the switch statement
|
|
199
209
|
if (params) {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
}
|
|
210
|
+
const { signedAt: _signedAt, ...rest } = params
|
|
211
|
+
Object.assign(currentAction, rest)
|
|
203
212
|
}
|
|
204
|
-
// Sort
|
|
205
|
-
step.execution.
|
|
206
|
-
...step.execution.
|
|
207
|
-
...step.execution.
|
|
213
|
+
// Sort actions, the ones with DONE status go first
|
|
214
|
+
step.execution.actions = [
|
|
215
|
+
...step.execution.actions.filter((action) => action.status === 'DONE'),
|
|
216
|
+
...step.execution.actions.filter((action) => action.status !== 'DONE'),
|
|
208
217
|
]
|
|
209
218
|
this.updateStepInRoute(step) // updates the step in the route
|
|
210
|
-
return
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
/**
|
|
214
|
-
* Remove a process from the execution
|
|
215
|
-
* @param step The step where the process should be removed from
|
|
216
|
-
* @param type The process type to remove
|
|
217
|
-
*/
|
|
218
|
-
removeProcess = (step: LiFiStepExtended, type: ProcessType): void => {
|
|
219
|
-
if (!step.execution) {
|
|
220
|
-
throw new Error("Execution hasn't been initialized.")
|
|
221
|
-
}
|
|
222
|
-
const index = step.execution.process.findIndex((p) => p.type === type)
|
|
223
|
-
step.execution.process.splice(index, 1)
|
|
224
|
-
this.updateStepInRoute(step)
|
|
219
|
+
return currentAction
|
|
225
220
|
}
|
|
226
221
|
|
|
227
222
|
updateStepInRoute = (step: LiFiStep): LiFiStep => {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { StepExecutorContext, TaskResult } from '../types/execution.js'
|
|
2
|
+
import type { BaseStepExecutionTask } from './BaseStepExecutionTask.js'
|
|
3
|
+
|
|
4
|
+
export class TaskPipeline {
|
|
5
|
+
private readonly tasks: BaseStepExecutionTask[]
|
|
6
|
+
|
|
7
|
+
constructor(tasks: BaseStepExecutionTask[]) {
|
|
8
|
+
this.tasks = tasks
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
async run(context: StepExecutorContext): Promise<TaskResult> {
|
|
12
|
+
for (const task of this.tasks) {
|
|
13
|
+
const shouldRun = await task.shouldRun(context)
|
|
14
|
+
if (!shouldRun) {
|
|
15
|
+
continue
|
|
16
|
+
}
|
|
17
|
+
const result = await task.run(context)
|
|
18
|
+
if (result.status === 'PAUSED') {
|
|
19
|
+
return { status: 'PAUSED' }
|
|
20
|
+
}
|
|
21
|
+
if (result.context && typeof result.context === 'object') {
|
|
22
|
+
Object.assign(context, result.context)
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return { status: 'COMPLETED' }
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
import type { StatusMessage, Substatus } from '@lifi/types'
|
|
2
|
-
import type {
|
|
2
|
+
import type {
|
|
3
|
+
ExecutionActionStatus,
|
|
4
|
+
ExecutionActionType,
|
|
5
|
+
} from '../types/core.js'
|
|
3
6
|
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
Partial<Record<
|
|
7
|
+
const actionMessages: Record<
|
|
8
|
+
ExecutionActionType,
|
|
9
|
+
Partial<Record<ExecutionActionStatus, string>>
|
|
7
10
|
> = {
|
|
8
|
-
|
|
11
|
+
CHECK_ALLOWANCE: {
|
|
12
|
+
STARTED: 'Checking token allowance',
|
|
13
|
+
PENDING: 'Waiting for token allowance check',
|
|
14
|
+
DONE: 'Token allowance checked',
|
|
15
|
+
},
|
|
16
|
+
RESET_ALLOWANCE: {
|
|
17
|
+
STARTED: 'Resetting token allowance',
|
|
18
|
+
RESET_REQUIRED: 'Resetting token allowance',
|
|
19
|
+
PENDING: 'Waiting for token allowance reset',
|
|
20
|
+
DONE: 'Token allowance reset',
|
|
21
|
+
},
|
|
22
|
+
SET_ALLOWANCE: {
|
|
9
23
|
STARTED: 'Setting token allowance',
|
|
10
24
|
ACTION_REQUIRED: 'Set token allowance',
|
|
11
|
-
RESET_REQUIRED: 'Resetting token allowance',
|
|
12
|
-
MESSAGE_REQUIRED: 'Sign token allowance message',
|
|
13
25
|
PENDING: 'Waiting for token allowance',
|
|
14
26
|
DONE: 'Token allowance set',
|
|
15
27
|
},
|
|
@@ -28,6 +40,7 @@ const processMessages: Record<
|
|
|
28
40
|
DONE: 'Bridge transaction confirmed',
|
|
29
41
|
},
|
|
30
42
|
RECEIVING_CHAIN: {
|
|
43
|
+
STARTED: 'Waiting for destination chain',
|
|
31
44
|
PENDING: 'Waiting for destination chain',
|
|
32
45
|
DONE: 'Bridge completed',
|
|
33
46
|
},
|
|
@@ -37,7 +50,14 @@ const processMessages: Record<
|
|
|
37
50
|
PENDING: 'Waiting for permit message',
|
|
38
51
|
DONE: 'Permit message signed',
|
|
39
52
|
},
|
|
53
|
+
NATIVE_PERMIT: {
|
|
54
|
+
STARTED: 'Preparing transaction',
|
|
55
|
+
ACTION_REQUIRED: 'Sign permit message',
|
|
56
|
+
PENDING: 'Waiting for permit message',
|
|
57
|
+
DONE: 'Permit message signed',
|
|
58
|
+
},
|
|
40
59
|
}
|
|
60
|
+
|
|
41
61
|
const substatusMessages: Record<
|
|
42
62
|
StatusMessage,
|
|
43
63
|
Partial<Record<Substatus, string>>
|
|
@@ -63,12 +83,12 @@ const substatusMessages: Record<
|
|
|
63
83
|
NOT_FOUND: {},
|
|
64
84
|
}
|
|
65
85
|
|
|
66
|
-
export function
|
|
67
|
-
type:
|
|
68
|
-
status:
|
|
86
|
+
export function getActionMessage(
|
|
87
|
+
type: ExecutionActionType,
|
|
88
|
+
status: ExecutionActionStatus
|
|
69
89
|
): string | undefined {
|
|
70
|
-
const
|
|
71
|
-
return
|
|
90
|
+
const actionMessage = actionMessages[type][status]
|
|
91
|
+
return actionMessage
|
|
72
92
|
}
|
|
73
93
|
|
|
74
94
|
export function getSubstatusMessage(
|
package/src/core/execution.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { Route } from '@lifi/types'
|
|
2
2
|
import { LiFiErrorCode } from '../errors/constants.js'
|
|
3
|
-
import { ProviderError } from '../errors/errors.js'
|
|
3
|
+
import { ExecuteStepRetryError, ProviderError } from '../errors/errors.js'
|
|
4
4
|
import type {
|
|
5
5
|
ExecutionOptions,
|
|
6
|
+
LiFiStepExtended,
|
|
6
7
|
RouteExtended,
|
|
7
8
|
SDKClient,
|
|
8
9
|
SDKProvider,
|
|
@@ -94,7 +95,6 @@ const executeSteps = async (
|
|
|
94
95
|
const step = route.steps[index]
|
|
95
96
|
const previousStep = route.steps[index - 1]
|
|
96
97
|
// Check if the step is already done
|
|
97
|
-
//
|
|
98
98
|
if (step.execution?.status === 'DONE') {
|
|
99
99
|
continue
|
|
100
100
|
}
|
|
@@ -136,7 +136,21 @@ const executeSteps = async (
|
|
|
136
136
|
updateRouteExecution(route, execution.executionOptions)
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
|
|
139
|
+
let executedStep: LiFiStepExtended
|
|
140
|
+
try {
|
|
141
|
+
executedStep = await stepExecutor.executeStep(client, step)
|
|
142
|
+
} catch (e) {
|
|
143
|
+
if (e instanceof ExecuteStepRetryError) {
|
|
144
|
+
step.execution = undefined
|
|
145
|
+
executedStep = await stepExecutor.executeStep(
|
|
146
|
+
client,
|
|
147
|
+
step,
|
|
148
|
+
e.retryParams
|
|
149
|
+
)
|
|
150
|
+
} else {
|
|
151
|
+
throw e
|
|
152
|
+
}
|
|
153
|
+
}
|
|
140
154
|
|
|
141
155
|
// We may reach this point if user interaction isn't allowed. We want to stop execution until we resume it
|
|
142
156
|
if (executedStep.execution?.status !== 'DONE') {
|
|
@@ -4,25 +4,26 @@ export const prepareRestart = (route: RouteExtended) => {
|
|
|
4
4
|
for (let index = 0; index < route.steps.length; index++) {
|
|
5
5
|
const step = route.steps[index]
|
|
6
6
|
if (step.execution) {
|
|
7
|
-
// Find the index of the last
|
|
8
|
-
const lastValidIndex = step.execution.
|
|
9
|
-
(
|
|
10
|
-
(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
process.status !== 'FAILED'
|
|
7
|
+
// Find the index of the last action that has tx hash, taskId, or signed messages
|
|
8
|
+
const lastValidIndex = step.execution.actions.findLastIndex(
|
|
9
|
+
(action) =>
|
|
10
|
+
['SWAP', 'CROSS_CHAIN', 'RECEIVING_CHAIN'].includes(action.type) &&
|
|
11
|
+
(!!action.txHash || !!action.taskId) &&
|
|
12
|
+
action.status !== 'FAILED'
|
|
14
13
|
)
|
|
15
14
|
|
|
16
|
-
// Keep all
|
|
15
|
+
// Keep all actions up to the one with tx hash
|
|
17
16
|
if (lastValidIndex >= 0) {
|
|
18
|
-
step.execution.
|
|
17
|
+
step.execution.actions = step.execution.actions.slice(
|
|
19
18
|
0,
|
|
20
19
|
lastValidIndex + 1
|
|
21
20
|
)
|
|
22
21
|
} else {
|
|
23
|
-
// If no tx hash exists, reset the
|
|
24
|
-
step.execution.
|
|
22
|
+
// If no tx hash exists, reset the actions array
|
|
23
|
+
step.execution.actions = []
|
|
25
24
|
}
|
|
25
|
+
// Reset the last action type
|
|
26
|
+
step.execution.lastActionType = undefined
|
|
26
27
|
}
|
|
27
28
|
step.transactionRequest = undefined
|
|
28
29
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export interface SDKStorage {
|
|
2
|
+
get(key: string): string | null | Promise<string | null>
|
|
3
|
+
set(key: string, value: string): void | Promise<void>
|
|
4
|
+
remove(key: string): void | Promise<void>
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export class LocalStorageAdapter implements SDKStorage {
|
|
8
|
+
get(key: string): string | null {
|
|
9
|
+
return window.localStorage.getItem(key)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
set(key: string, value: string): void {
|
|
13
|
+
window.localStorage.setItem(key, value)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
remove(key: string): void {
|
|
17
|
+
window.localStorage.removeItem(key)
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export class InMemoryStorage implements SDKStorage {
|
|
22
|
+
private store = new Map<string, string>()
|
|
23
|
+
|
|
24
|
+
get(key: string): string | null {
|
|
25
|
+
return this.store.get(key) ?? null
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
set(key: string, value: string): void {
|
|
29
|
+
this.store.set(key, value)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
remove(key: string): void {
|
|
33
|
+
this.store.delete(key)
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function createDefaultStorage(): SDKStorage {
|
|
38
|
+
if (typeof window !== 'undefined' && window.localStorage) {
|
|
39
|
+
return new LocalStorageAdapter()
|
|
40
|
+
}
|
|
41
|
+
return new InMemoryStorage()
|
|
42
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { LiFiErrorCode } from '../../errors/constants.js'
|
|
2
|
+
import { TransactionError } from '../../errors/errors.js'
|
|
3
|
+
import type { StepExecutorContext, TaskResult } from '../../types/execution.js'
|
|
4
|
+
import { BaseStepExecutionTask } from '../BaseStepExecutionTask.js'
|
|
5
|
+
import { checkBalance } from './helpers/checkBalance.js'
|
|
6
|
+
|
|
7
|
+
export class CheckBalanceTask extends BaseStepExecutionTask {
|
|
8
|
+
async run(context: StepExecutorContext): Promise<TaskResult> {
|
|
9
|
+
const { client, step, statusManager, isBridgeExecution } = context
|
|
10
|
+
|
|
11
|
+
statusManager.initializeAction({
|
|
12
|
+
step,
|
|
13
|
+
type: isBridgeExecution ? 'CROSS_CHAIN' : 'SWAP',
|
|
14
|
+
chainId: step.action.fromChainId,
|
|
15
|
+
status: 'STARTED',
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
const walletAddress = step.action.fromAddress
|
|
19
|
+
if (!walletAddress) {
|
|
20
|
+
throw new TransactionError(
|
|
21
|
+
LiFiErrorCode.InternalError,
|
|
22
|
+
'The wallet address is undefined.'
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
await checkBalance(client, walletAddress, step)
|
|
27
|
+
return { status: 'COMPLETED' }
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { getStepTransaction } from '../../actions/getStepTransaction.js'
|
|
2
|
+
import { LiFiErrorCode } from '../../errors/constants.js'
|
|
3
|
+
import { TransactionError } from '../../errors/errors.js'
|
|
4
|
+
import type { StepExecutorContext, TaskResult } from '../../types/execution.js'
|
|
5
|
+
import { BaseStepExecutionTask } from '../BaseStepExecutionTask.js'
|
|
6
|
+
import { stepComparison } from './helpers/stepComparison.js'
|
|
7
|
+
|
|
8
|
+
export class PrepareTransactionTask extends BaseStepExecutionTask {
|
|
9
|
+
async run(context: StepExecutorContext): Promise<TaskResult> {
|
|
10
|
+
const {
|
|
11
|
+
client,
|
|
12
|
+
step,
|
|
13
|
+
statusManager,
|
|
14
|
+
allowUserInteraction,
|
|
15
|
+
executionOptions,
|
|
16
|
+
isBridgeExecution,
|
|
17
|
+
} = context
|
|
18
|
+
|
|
19
|
+
const action = statusManager.findAction(
|
|
20
|
+
step,
|
|
21
|
+
isBridgeExecution ? 'CROSS_CHAIN' : 'SWAP'
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
if (!action) {
|
|
25
|
+
throw new TransactionError(
|
|
26
|
+
LiFiErrorCode.TransactionUnprepared,
|
|
27
|
+
'Unable to prepare transaction. Action not found.'
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (!step.transactionRequest) {
|
|
32
|
+
const { execution, ...stepBase } = step
|
|
33
|
+
const updatedStep = await getStepTransaction(client, stepBase)
|
|
34
|
+
const comparedStep = await stepComparison(
|
|
35
|
+
statusManager,
|
|
36
|
+
step,
|
|
37
|
+
updatedStep,
|
|
38
|
+
allowUserInteraction,
|
|
39
|
+
executionOptions
|
|
40
|
+
)
|
|
41
|
+
Object.assign(step, {
|
|
42
|
+
...comparedStep,
|
|
43
|
+
execution: step.execution,
|
|
44
|
+
})
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (!step.transactionRequest?.data) {
|
|
48
|
+
throw new TransactionError(
|
|
49
|
+
LiFiErrorCode.TransactionUnprepared,
|
|
50
|
+
'Unable to prepare transaction. Transaction request data is not found.'
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
statusManager.updateAction(step, action.type, 'ACTION_REQUIRED')
|
|
55
|
+
|
|
56
|
+
if (!allowUserInteraction) {
|
|
57
|
+
return { status: 'PAUSED' }
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return { status: 'COMPLETED' }
|
|
61
|
+
}
|
|
62
|
+
}
|