@lifi/sdk 4.0.0-alpha.14 → 4.0.0-alpha.16
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/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 +7 -3
- package/dist/cjs/core/BaseStepExecutor.js +24 -0
- package/dist/cjs/core/BaseStepExecutor.js.map +1 -1
- package/dist/cjs/core/StatusManager.d.ts +6 -3
- package/dist/cjs/core/StatusManager.js +21 -17
- package/dist/cjs/core/StatusManager.js.map +1 -1
- package/dist/cjs/core/TaskPipeline.d.ts +7 -0
- package/dist/cjs/core/TaskPipeline.js +46 -0
- package/dist/cjs/core/TaskPipeline.js.map +1 -0
- package/dist/cjs/core/actionMessages.js +19 -3
- package/dist/cjs/core/actionMessages.js.map +1 -1
- package/dist/cjs/core/execution.js +13 -1
- package/dist/cjs/core/execution.js.map +1 -1
- package/dist/cjs/core/prepareRestart.js +3 -3
- package/dist/cjs/core/prepareRestart.js.map +1 -1
- package/dist/cjs/core/tasks/CheckBalanceTask.d.ts +5 -0
- package/dist/cjs/core/tasks/CheckBalanceTask.js +25 -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/{waitForTransactionStatus.d.ts → tasks/helpers/waitForTransactionStatus.d.ts} +2 -2
- package/dist/cjs/core/{waitForTransactionStatus.js → tasks/helpers/waitForTransactionStatus.js} +8 -6
- package/dist/cjs/core/tasks/helpers/waitForTransactionStatus.js.map +1 -0
- 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 +12 -5
- package/dist/cjs/index.js +21 -7
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/core.d.ts +12 -10
- package/dist/cjs/types/execution.d.ts +25 -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 +2 -6
- package/dist/cjs/utils/waitForResult.js.map +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +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 +7 -3
- package/dist/esm/core/BaseStepExecutor.js +24 -0
- package/dist/esm/core/BaseStepExecutor.js.map +1 -1
- package/dist/esm/core/StatusManager.d.ts +17 -6
- package/dist/esm/core/StatusManager.js +32 -20
- package/dist/esm/core/StatusManager.js.map +1 -1
- package/dist/esm/core/TaskPipeline.d.ts +7 -0
- package/dist/esm/core/TaskPipeline.js +42 -0
- package/dist/esm/core/TaskPipeline.js.map +1 -0
- package/dist/esm/core/actionMessages.js +19 -3
- package/dist/esm/core/actionMessages.js.map +1 -1
- package/dist/esm/core/execution.js +14 -3
- package/dist/esm/core/execution.js.map +1 -1
- package/dist/esm/core/prepareRestart.js +4 -3
- package/dist/esm/core/prepareRestart.js.map +1 -1
- package/dist/esm/core/tasks/CheckBalanceTask.d.ts +5 -0
- package/dist/esm/core/tasks/CheckBalanceTask.js +21 -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/{waitForTransactionStatus.d.ts → tasks/helpers/waitForTransactionStatus.d.ts} +2 -2
- package/dist/esm/core/{waitForTransactionStatus.js → tasks/helpers/waitForTransactionStatus.js} +8 -6
- package/dist/esm/core/tasks/helpers/waitForTransactionStatus.js.map +1 -0
- 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 +12 -5
- package/dist/esm/index.js +10 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/core.d.ts +16 -10
- package/dist/esm/types/execution.d.ts +26 -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 +3 -7
- package/dist/esm/utils/waitForResult.js.map +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +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 +7 -3
- package/dist/types/core/BaseStepExecutor.d.ts.map +1 -1
- package/dist/types/core/StatusManager.d.ts +17 -6
- 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.map +1 -1
- package/dist/types/core/execution.d.ts.map +1 -1
- package/dist/types/core/prepareRestart.d.ts.map +1 -1
- 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/{waitForTransactionStatus.d.ts → tasks/helpers/waitForTransactionStatus.d.ts} +2 -2
- package/dist/types/core/tasks/helpers/waitForTransactionStatus.d.ts.map +1 -0
- 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 +12 -5
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types/core.d.ts +16 -10
- package/dist/types/types/core.d.ts.map +1 -1
- package/dist/types/types/execution.d.ts +27 -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/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/core/BaseStepExecutionTask.ts +9 -0
- package/src/core/BaseStepExecutor.ts +52 -2
- package/src/core/StatusManager.ts +40 -24
- package/src/core/TaskPipeline.ts +47 -0
- package/src/core/actionMessages.ts +20 -3
- package/src/core/execution.ts +17 -3
- package/src/core/prepareRestart.ts +4 -3
- package/src/core/tasks/CheckBalanceTask.ts +28 -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} +10 -8
- package/src/errors/constants.ts +1 -0
- package/src/errors/errors.ts +24 -0
- package/src/index.ts +17 -3
- package/src/types/core.ts +19 -18
- package/src/types/execution.ts +40 -0
- package/src/utils/waitForResult.ts +4 -9
- package/src/version.ts +1 -1
- package/dist/cjs/core/checkBalance.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 -68
- package/dist/cjs/core/waitForDestinationChainTransaction.js.map +0 -1
- package/dist/cjs/core/waitForTransactionStatus.js.map +0 -1
- package/dist/esm/core/checkBalance.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 -70
- package/dist/esm/core/waitForDestinationChainTransaction.js.map +0 -1
- package/dist/esm/core/waitForTransactionStatus.js.map +0 -1
- package/dist/types/core/checkBalance.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.map +0 -1
- package/src/core/waitForDestinationChainTransaction.ts +0 -108
|
@@ -0,0 +1,28 @@
|
|
|
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.findOrCreateAction({
|
|
12
|
+
step,
|
|
13
|
+
type: isBridgeExecution ? 'CROSS_CHAIN' : 'SWAP',
|
|
14
|
+
chainId: step.action.fromChainId,
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
const walletAddress = step.action.fromAddress
|
|
18
|
+
if (!walletAddress) {
|
|
19
|
+
throw new TransactionError(
|
|
20
|
+
LiFiErrorCode.InternalError,
|
|
21
|
+
'The wallet address is undefined.'
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
await checkBalance(client, walletAddress, step)
|
|
26
|
+
return { status: 'COMPLETED' }
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { ExtendedTransactionInfo, FullStatusData } from '@lifi/types'
|
|
2
|
+
import { LiFiErrorCode } from '../../errors/constants.js'
|
|
3
|
+
import { TransactionError } from '../../errors/errors.js'
|
|
4
|
+
import type { ExecutionActionType } from '../../types/core.js'
|
|
5
|
+
import type { StepExecutorContext, TaskResult } from '../../types/execution.js'
|
|
6
|
+
import { getTransactionFailedMessage } from '../../utils/getTransactionMessage.js'
|
|
7
|
+
import { BaseStepExecutionTask } from '../BaseStepExecutionTask.js'
|
|
8
|
+
import { waitForTransactionStatus } from './helpers/waitForTransactionStatus.js'
|
|
9
|
+
|
|
10
|
+
export class WaitForTransactionStatusTask extends BaseStepExecutionTask {
|
|
11
|
+
readonly actionType: ExecutionActionType
|
|
12
|
+
|
|
13
|
+
constructor(actionType: ExecutionActionType) {
|
|
14
|
+
super()
|
|
15
|
+
this.actionType = actionType
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async run(context: StepExecutorContext): Promise<TaskResult> {
|
|
19
|
+
const {
|
|
20
|
+
client,
|
|
21
|
+
step,
|
|
22
|
+
statusManager,
|
|
23
|
+
pollingIntervalMs,
|
|
24
|
+
toChain,
|
|
25
|
+
isBridgeExecution,
|
|
26
|
+
} = context
|
|
27
|
+
|
|
28
|
+
// At this point, we should have a txHash or taskId
|
|
29
|
+
// taskId is used for custom integrations that don't use the standard transaction hash
|
|
30
|
+
let transactionHash: string | undefined
|
|
31
|
+
try {
|
|
32
|
+
const swapOrBridgeAction = statusManager.findAction(
|
|
33
|
+
step,
|
|
34
|
+
isBridgeExecution ? 'CROSS_CHAIN' : 'SWAP'
|
|
35
|
+
)
|
|
36
|
+
transactionHash = swapOrBridgeAction?.txHash || swapOrBridgeAction?.taskId
|
|
37
|
+
|
|
38
|
+
// Wait for the transaction status on the destination chain
|
|
39
|
+
if (!transactionHash) {
|
|
40
|
+
throw new Error('Transaction hash is undefined.')
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const action = statusManager.findOrCreateAction({
|
|
44
|
+
step,
|
|
45
|
+
type: this.actionType,
|
|
46
|
+
chainId:
|
|
47
|
+
this.actionType === 'RECEIVING_CHAIN'
|
|
48
|
+
? step.action.toChainId
|
|
49
|
+
: step.action.fromChainId,
|
|
50
|
+
status: 'PENDING',
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
const statusResponse = (await waitForTransactionStatus(
|
|
54
|
+
client,
|
|
55
|
+
statusManager,
|
|
56
|
+
transactionHash,
|
|
57
|
+
step,
|
|
58
|
+
action.type,
|
|
59
|
+
pollingIntervalMs
|
|
60
|
+
)) as FullStatusData
|
|
61
|
+
|
|
62
|
+
const statusReceiving =
|
|
63
|
+
statusResponse.receiving as ExtendedTransactionInfo
|
|
64
|
+
|
|
65
|
+
// Update action status
|
|
66
|
+
statusManager.updateAction(step, action.type, 'DONE', {
|
|
67
|
+
chainId: statusReceiving?.chainId || toChain.id,
|
|
68
|
+
substatus: statusResponse.substatus,
|
|
69
|
+
substatusMessage: statusResponse.substatusMessage,
|
|
70
|
+
txHash: statusReceiving?.txHash,
|
|
71
|
+
txLink:
|
|
72
|
+
statusReceiving?.txLink ||
|
|
73
|
+
`${toChain.metamask.blockExplorerUrls[0]}tx/${statusReceiving?.txHash}`,
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
// Update execution status
|
|
77
|
+
statusManager.updateExecution(step, {
|
|
78
|
+
status: 'DONE',
|
|
79
|
+
...(statusResponse.sending.amount && {
|
|
80
|
+
fromAmount: statusResponse.sending.amount,
|
|
81
|
+
}),
|
|
82
|
+
...(statusReceiving?.amount && { toAmount: statusReceiving.amount }),
|
|
83
|
+
...(statusReceiving?.token && { toToken: statusReceiving.token }),
|
|
84
|
+
internalTxLink: statusResponse?.lifiExplorerLink,
|
|
85
|
+
externalTxLink: statusResponse?.bridgeExplorerLink,
|
|
86
|
+
gasCosts: [
|
|
87
|
+
{
|
|
88
|
+
amount: statusResponse.sending.gasAmount,
|
|
89
|
+
amountUSD: statusResponse.sending.gasAmountUSD,
|
|
90
|
+
token: statusResponse.sending.gasToken,
|
|
91
|
+
estimate: statusResponse.sending.gasUsed,
|
|
92
|
+
limit: statusResponse.sending.gasUsed,
|
|
93
|
+
price: statusResponse.sending.gasPrice,
|
|
94
|
+
type: 'SEND',
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
})
|
|
98
|
+
|
|
99
|
+
return { status: 'COMPLETED' }
|
|
100
|
+
} catch (e: any) {
|
|
101
|
+
const htmlMessage = await getTransactionFailedMessage(
|
|
102
|
+
client,
|
|
103
|
+
step,
|
|
104
|
+
`${toChain.metamask.blockExplorerUrls[0]}tx/${transactionHash}`
|
|
105
|
+
)
|
|
106
|
+
throw new TransactionError(
|
|
107
|
+
LiFiErrorCode.TransactionFailed,
|
|
108
|
+
htmlMessage ??
|
|
109
|
+
'Failed while waiting for status of destination chain transaction.',
|
|
110
|
+
e
|
|
111
|
+
)
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { LiFiStep } from '@lifi/types'
|
|
2
|
-
import { getTokenBalance } from '
|
|
3
|
-
import { BalanceError } from '
|
|
4
|
-
import type { SDKClient } from '
|
|
5
|
-
import { formatUnits } from '
|
|
6
|
-
import { sleep } from '
|
|
2
|
+
import { getTokenBalance } from '../../../actions/getTokenBalance.js'
|
|
3
|
+
import { BalanceError } from '../../../errors/errors.js'
|
|
4
|
+
import type { SDKClient } from '../../../types/core.js'
|
|
5
|
+
import { formatUnits } from '../../../utils/formatUnits.js'
|
|
6
|
+
import { sleep } from '../../../utils/sleep.js'
|
|
7
7
|
|
|
8
8
|
export const checkBalance = async (
|
|
9
9
|
client: SDKClient,
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { LiFiErrorCode } from '../../../errors/constants.js'
|
|
2
|
+
import { TransactionError } from '../../../errors/errors.js'
|
|
3
|
+
import type {
|
|
4
|
+
ExecutionOptions,
|
|
5
|
+
LiFiStepExtended,
|
|
6
|
+
TransactionParameters,
|
|
7
|
+
} from '../../../types/core.js'
|
|
8
|
+
|
|
9
|
+
export const getTransactionRequestData = async (
|
|
10
|
+
step: LiFiStepExtended,
|
|
11
|
+
executionOptions?: ExecutionOptions
|
|
12
|
+
): Promise<string> => {
|
|
13
|
+
if (!step.transactionRequest?.data) {
|
|
14
|
+
throw new TransactionError(
|
|
15
|
+
LiFiErrorCode.TransactionUnprepared,
|
|
16
|
+
'Unable to prepare transaction. Transaction request data is not found.'
|
|
17
|
+
)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
let transactionRequest: TransactionParameters = {
|
|
21
|
+
data: step.transactionRequest.data,
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (executionOptions?.updateTransactionRequestHook) {
|
|
25
|
+
const customizedTransactionRequest: TransactionParameters =
|
|
26
|
+
await executionOptions.updateTransactionRequestHook({
|
|
27
|
+
requestType: 'transaction',
|
|
28
|
+
...transactionRequest,
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
transactionRequest = {
|
|
32
|
+
...transactionRequest,
|
|
33
|
+
...customizedTransactionRequest,
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const transactionRequestData = transactionRequest.data
|
|
38
|
+
|
|
39
|
+
if (!transactionRequestData) {
|
|
40
|
+
throw new TransactionError(
|
|
41
|
+
LiFiErrorCode.TransactionUnprepared,
|
|
42
|
+
'Unable to prepare transaction. Transaction request data is not found.'
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return transactionRequestData
|
|
47
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { LiFiStep } from '@lifi/types'
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
2
|
+
import type { StatusManager } from '../../../core/StatusManager.js'
|
|
3
|
+
import { checkStepSlippageThreshold } from '../../../core/utils.js'
|
|
4
|
+
import { LiFiErrorCode } from '../../../errors/constants.js'
|
|
5
|
+
import { TransactionError } from '../../../errors/errors.js'
|
|
6
|
+
import type { ExecutionOptions } from '../../../types/core.js'
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* This method checks whether the new and updated Step meets the required exchange rate conditions.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { FullStatusData, LiFiStep, StatusResponse } from '@lifi/types'
|
|
2
|
-
import { getStatus } from '
|
|
3
|
-
import { ServerError } from '
|
|
4
|
-
import type { ExecutionActionType, SDKClient } from '
|
|
5
|
-
import { waitForResult } from '
|
|
6
|
-
import { getSubstatusMessage } from '
|
|
7
|
-
import type { StatusManager } from '
|
|
2
|
+
import { getStatus } from '../../../actions/getStatus.js'
|
|
3
|
+
import { ServerError } from '../../../errors/errors.js'
|
|
4
|
+
import type { ExecutionActionType, SDKClient } from '../../../types/core.js'
|
|
5
|
+
import { waitForResult } from '../../../utils/waitForResult.js'
|
|
6
|
+
import { getSubstatusMessage } from '../../actionMessages.js'
|
|
7
|
+
import type { StatusManager } from '../../StatusManager.js'
|
|
8
8
|
|
|
9
9
|
const TRANSACTION_HASH_OBSERVERS: Record<string, Promise<StatusResponse>> = {}
|
|
10
10
|
|
|
@@ -54,11 +54,13 @@ export async function waitForTransactionStatus(
|
|
|
54
54
|
})
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
let status = TRANSACTION_HASH_OBSERVERS[txHash]
|
|
57
|
+
let status = TRANSACTION_HASH_OBSERVERS?.[txHash]
|
|
58
58
|
|
|
59
59
|
if (!status) {
|
|
60
60
|
status = waitForResult(_getStatus, interval)
|
|
61
|
-
TRANSACTION_HASH_OBSERVERS
|
|
61
|
+
if (TRANSACTION_HASH_OBSERVERS) {
|
|
62
|
+
TRANSACTION_HASH_OBSERVERS[txHash] = status
|
|
63
|
+
}
|
|
62
64
|
}
|
|
63
65
|
|
|
64
66
|
const resolvedStatus = await status
|
package/src/errors/constants.ts
CHANGED
package/src/errors/errors.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ExecuteStepRetryParams } from '../types/core.js'
|
|
1
2
|
import { BaseError } from './baseError.js'
|
|
2
3
|
import { ErrorName, LiFiErrorCode } from './constants.js'
|
|
3
4
|
|
|
@@ -42,3 +43,26 @@ export class ValidationError extends BaseError {
|
|
|
42
43
|
super(ErrorName.ValidationError, LiFiErrorCode.ValidationError, message)
|
|
43
44
|
}
|
|
44
45
|
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Thrown by a step executor when executeStep should be retried with the given params
|
|
49
|
+
* (e.g. wallet rejected 7702 upgrade → retry with atomicityNotReady).
|
|
50
|
+
* The execution layer catches this and retries executeStep(client, step, retryParams).
|
|
51
|
+
*/
|
|
52
|
+
export class ExecuteStepRetryError extends BaseError {
|
|
53
|
+
readonly retryParams: ExecuteStepRetryParams
|
|
54
|
+
|
|
55
|
+
constructor(
|
|
56
|
+
message: string,
|
|
57
|
+
retryParams: ExecuteStepRetryParams,
|
|
58
|
+
cause?: Error
|
|
59
|
+
) {
|
|
60
|
+
super(
|
|
61
|
+
ErrorName.ExecuteStepRetryError,
|
|
62
|
+
LiFiErrorCode.InternalError,
|
|
63
|
+
message,
|
|
64
|
+
cause
|
|
65
|
+
)
|
|
66
|
+
this.retryParams = retryParams
|
|
67
|
+
}
|
|
68
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -24,8 +24,9 @@ export { actions } from './actions/index.js'
|
|
|
24
24
|
export { patchContractCalls } from './actions/patchContractCalls.js'
|
|
25
25
|
export { relayTransaction } from './actions/relayTransaction.js'
|
|
26
26
|
export { createClient } from './client/createClient.js'
|
|
27
|
+
export { getActionMessage, getSubstatusMessage } from './core/actionMessages.js'
|
|
28
|
+
export { BaseStepExecutionTask } from './core/BaseStepExecutionTask.js'
|
|
27
29
|
export { BaseStepExecutor } from './core/BaseStepExecutor.js'
|
|
28
|
-
export { checkBalance } from './core/checkBalance.js'
|
|
29
30
|
export {
|
|
30
31
|
executeRoute,
|
|
31
32
|
getActiveRoute,
|
|
@@ -35,13 +36,19 @@ export {
|
|
|
35
36
|
updateRouteExecution,
|
|
36
37
|
} from './core/execution.js'
|
|
37
38
|
export { StatusManager } from './core/StatusManager.js'
|
|
38
|
-
export {
|
|
39
|
-
export {
|
|
39
|
+
export { TaskPipeline } from './core/TaskPipeline.js'
|
|
40
|
+
export { CheckBalanceTask } from './core/tasks/CheckBalanceTask.js'
|
|
41
|
+
export { checkBalance } from './core/tasks/helpers/checkBalance.js'
|
|
42
|
+
export { getTransactionRequestData } from './core/tasks/helpers/getTransactionRequestData.js'
|
|
43
|
+
export { stepComparison } from './core/tasks/helpers/stepComparison.js'
|
|
44
|
+
export { PrepareTransactionTask } from './core/tasks/PrepareTransactionTask.js'
|
|
45
|
+
export { WaitForTransactionStatusTask } from './core/tasks/WaitForTransactionStatusTask.js'
|
|
40
46
|
export { BaseError } from './errors/baseError.js'
|
|
41
47
|
export type { ErrorCode } from './errors/constants.js'
|
|
42
48
|
export { ErrorMessage, ErrorName, LiFiErrorCode } from './errors/constants.js'
|
|
43
49
|
export {
|
|
44
50
|
BalanceError,
|
|
51
|
+
ExecuteStepRetryError,
|
|
45
52
|
ProviderError,
|
|
46
53
|
RPCError,
|
|
47
54
|
ServerError,
|
|
@@ -58,6 +65,7 @@ export type {
|
|
|
58
65
|
ContractCallParams,
|
|
59
66
|
ContractTool,
|
|
60
67
|
ExchangeRateUpdateParams,
|
|
68
|
+
ExecuteStepRetryParams,
|
|
61
69
|
Execution,
|
|
62
70
|
ExecutionAction,
|
|
63
71
|
ExecutionActionStatus,
|
|
@@ -87,6 +95,12 @@ export type {
|
|
|
87
95
|
TransactionRequestUpdateHook,
|
|
88
96
|
UpdateRouteHook,
|
|
89
97
|
} from './types/core.js'
|
|
98
|
+
export type {
|
|
99
|
+
StepExecutorBaseContext,
|
|
100
|
+
StepExecutorContext,
|
|
101
|
+
TaskResult,
|
|
102
|
+
TaskStatus,
|
|
103
|
+
} from './types/execution.js'
|
|
90
104
|
export { checkPackageUpdates } from './utils/checkPackageUpdates.js'
|
|
91
105
|
export { convertQuoteToRoute } from './utils/convertQuoteToRoute.js'
|
|
92
106
|
export { fetchTxErrorDetails } from './utils/fetchTxErrorDetails.js'
|
package/src/types/core.ts
CHANGED
|
@@ -34,7 +34,6 @@ export interface SDKBaseConfig {
|
|
|
34
34
|
preloadChains?: boolean
|
|
35
35
|
chainsRefetchInterval?: number
|
|
36
36
|
requestInterceptor?: RequestInterceptor
|
|
37
|
-
safeApiKey?: string
|
|
38
37
|
}
|
|
39
38
|
|
|
40
39
|
export interface SDKConfig extends Partial<Omit<SDKBaseConfig, 'integrator'>> {
|
|
@@ -83,13 +82,20 @@ export interface InteractionSettings {
|
|
|
83
82
|
allowExecution?: boolean
|
|
84
83
|
}
|
|
85
84
|
|
|
85
|
+
/**
|
|
86
|
+
* Params passed when retrying executeStep after an ExecuteStepRetryError.
|
|
87
|
+
* Providers can use this to pass strategy-specific retry options (e.g. atomicityNotReady for Ethereum 7702).
|
|
88
|
+
*/
|
|
89
|
+
export type ExecuteStepRetryParams = Record<string, unknown>
|
|
90
|
+
|
|
86
91
|
export interface StepExecutor {
|
|
87
92
|
allowUserInteraction: boolean
|
|
88
93
|
allowExecution: boolean
|
|
89
94
|
setInteraction(settings?: InteractionSettings): void
|
|
90
95
|
executeStep(
|
|
91
96
|
client: SDKClient,
|
|
92
|
-
step: LiFiStepExtended
|
|
97
|
+
step: LiFiStepExtended,
|
|
98
|
+
retryParams?: ExecuteStepRetryParams
|
|
93
99
|
): Promise<LiFiStepExtended>
|
|
94
100
|
}
|
|
95
101
|
|
|
@@ -216,8 +222,11 @@ export type ExecutionActionStatus =
|
|
|
216
222
|
| 'CANCELLED'
|
|
217
223
|
|
|
218
224
|
export type ExecutionActionType =
|
|
219
|
-
| 'TOKEN_ALLOWANCE'
|
|
220
225
|
| 'PERMIT'
|
|
226
|
+
| 'CHECK_ALLOWANCE'
|
|
227
|
+
| 'NATIVE_PERMIT'
|
|
228
|
+
| 'RESET_ALLOWANCE'
|
|
229
|
+
| 'SET_ALLOWANCE'
|
|
221
230
|
| 'SWAP'
|
|
222
231
|
| 'CROSS_CHAIN'
|
|
223
232
|
| 'RECEIVING_CHAIN'
|
|
@@ -225,21 +234,16 @@ export type ExecutionActionType =
|
|
|
225
234
|
export type ExecutionAction = {
|
|
226
235
|
type: ExecutionActionType
|
|
227
236
|
status: ExecutionActionStatus
|
|
237
|
+
message?: string
|
|
228
238
|
substatus?: Substatus
|
|
239
|
+
substatusMessage?: string
|
|
229
240
|
chainId?: number
|
|
241
|
+
error?: { code: string | number; message: string; htmlMessage?: string }
|
|
230
242
|
txHash?: string
|
|
231
|
-
taskId?: string
|
|
232
243
|
txLink?: string
|
|
244
|
+
taskId?: string
|
|
233
245
|
txType?: TransactionMethodType
|
|
234
|
-
|
|
235
|
-
error?: {
|
|
236
|
-
code: string | number
|
|
237
|
-
message: string
|
|
238
|
-
htmlMessage?: string
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
// additional information
|
|
242
|
-
[key: string]: any
|
|
246
|
+
txHex?: string
|
|
243
247
|
}
|
|
244
248
|
|
|
245
249
|
export interface Execution {
|
|
@@ -247,6 +251,7 @@ export interface Execution {
|
|
|
247
251
|
signedAt?: number
|
|
248
252
|
status: ExecutionStatus
|
|
249
253
|
actions: Array<ExecutionAction>
|
|
254
|
+
lastActionType?: ExecutionActionType
|
|
250
255
|
fromAmount?: string
|
|
251
256
|
toAmount?: string
|
|
252
257
|
toToken?: Token
|
|
@@ -256,8 +261,4 @@ export interface Execution {
|
|
|
256
261
|
externalTxLink?: string
|
|
257
262
|
}
|
|
258
263
|
|
|
259
|
-
export type TransactionMethodType =
|
|
260
|
-
| 'standard'
|
|
261
|
-
| 'relayed'
|
|
262
|
-
| 'batched'
|
|
263
|
-
| 'safe-queued'
|
|
264
|
+
export type TransactionMethodType = 'standard' | 'relayed' | 'batched'
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ExtendedChain } from '@lifi/types'
|
|
2
|
+
import type { StatusManager } from '../core/StatusManager.js'
|
|
3
|
+
import type { ExecuteStepRetryError } from '../errors/errors.js'
|
|
4
|
+
import type { SDKError } from '../errors/SDKError.js'
|
|
5
|
+
import type {
|
|
6
|
+
ExecuteStepRetryParams,
|
|
7
|
+
ExecutionAction,
|
|
8
|
+
ExecutionOptions,
|
|
9
|
+
LiFiStepExtended,
|
|
10
|
+
SDKClient,
|
|
11
|
+
} from './core.js'
|
|
12
|
+
|
|
13
|
+
export interface StepExecutorBaseContext {
|
|
14
|
+
statusManager: StatusManager
|
|
15
|
+
executionOptions?: ExecutionOptions
|
|
16
|
+
fromChain: ExtendedChain
|
|
17
|
+
toChain: ExtendedChain
|
|
18
|
+
isBridgeExecution: boolean
|
|
19
|
+
client: SDKClient
|
|
20
|
+
step: LiFiStepExtended
|
|
21
|
+
allowUserInteraction: boolean
|
|
22
|
+
retryParams?: ExecuteStepRetryParams
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface StepExecutorContext extends StepExecutorBaseContext {
|
|
26
|
+
pollingIntervalMs?: number
|
|
27
|
+
parseErrors: (
|
|
28
|
+
error: Error,
|
|
29
|
+
step?: LiFiStepExtended,
|
|
30
|
+
action?: ExecutionAction
|
|
31
|
+
) => Promise<SDKError | ExecuteStepRetryError>
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface TaskResult<TContext = Record<string, unknown>> {
|
|
35
|
+
status: TaskStatus
|
|
36
|
+
/** Optional: data produced for downstream tasks. Pipeline merges into the executor context. */
|
|
37
|
+
context?: TContext
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export type TaskStatus = 'COMPLETED' | 'PAUSED'
|
|
@@ -3,7 +3,7 @@ import { sleep } from './sleep.js'
|
|
|
3
3
|
/**
|
|
4
4
|
* Repeatedly calls a given asynchronous function until it resolves with a value
|
|
5
5
|
* @param fn The function that should be repeated
|
|
6
|
-
* @param interval The timeout in milliseconds between retries,
|
|
6
|
+
* @param interval The timeout in milliseconds between retries, defaults to 5000
|
|
7
7
|
* @param maxRetries Maximum number of retries before throwing an error, defaults to 3
|
|
8
8
|
* @param shouldRetry Optional predicate to determine if an error should trigger a retry
|
|
9
9
|
* @returns The result of the fn function
|
|
@@ -11,22 +11,18 @@ import { sleep } from './sleep.js'
|
|
|
11
11
|
*/
|
|
12
12
|
export const waitForResult = async <T>(
|
|
13
13
|
fn: () => Promise<T | undefined>,
|
|
14
|
-
interval
|
|
14
|
+
interval = 5000,
|
|
15
15
|
maxRetries = 3,
|
|
16
16
|
shouldRetry: (count: number, error: unknown) => boolean = () => true
|
|
17
17
|
): Promise<T> => {
|
|
18
18
|
let result: T | undefined
|
|
19
19
|
let attempts = 0
|
|
20
|
-
let polls = 0
|
|
21
|
-
|
|
22
|
-
const getInterval = typeof interval === 'function' ? interval : () => interval
|
|
23
20
|
|
|
24
21
|
while (!result) {
|
|
25
22
|
try {
|
|
26
23
|
result = await fn()
|
|
27
24
|
if (!result) {
|
|
28
|
-
await sleep(
|
|
29
|
-
polls++
|
|
25
|
+
await sleep(interval)
|
|
30
26
|
}
|
|
31
27
|
} catch (error) {
|
|
32
28
|
if (!shouldRetry(attempts, error)) {
|
|
@@ -36,8 +32,7 @@ export const waitForResult = async <T>(
|
|
|
36
32
|
if (attempts === maxRetries) {
|
|
37
33
|
throw error
|
|
38
34
|
}
|
|
39
|
-
await sleep(
|
|
40
|
-
polls++
|
|
35
|
+
await sleep(interval)
|
|
41
36
|
}
|
|
42
37
|
}
|
|
43
38
|
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = '@lifi/sdk'
|
|
2
|
-
export const version = '4.0.0-alpha.
|
|
2
|
+
export const version = '4.0.0-alpha.16'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"checkBalance.js","sourceRoot":"","sources":["../../../src/core/checkBalance.ts"],"names":[],"mappings":";;;AACA,sEAA+D;AAC/D,mDAAkD;AAElD,4DAAqD;AACrD,gDAAyC;AAElC,MAAM,YAAY,GAAG,KAAK,EAC/B,MAAiB,EACjB,aAAqB,EACrB,IAAc,EACd,KAAK,GAAG,CAAC,EACM,EAAE;IACjB,MAAM,KAAK,GAAG,MAAM,IAAA,oCAAe,EACjC,MAAM,EACN,aAAa,EACb,IAAI,CAAC,MAAM,CAAC,SAAS,CACtB,CAAA;IACD,IAAI,KAAK,EAAE,CAAC;QACV,MAAM,cAAc,GAAG,KAAK,CAAC,MAAM,IAAI,EAAE,CAAA;QACzC,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;QAEpD,IAAI,cAAc,GAAG,aAAa,EAAE,CAAC;YACnC,IAAI,KAAK,IAAI,CAAC,EAAE,CAAC;gBACf,MAAM,IAAA,gBAAK,EAAC,GAAG,CAAC,CAAA;gBAChB,MAAM,IAAA,oBAAY,EAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,KAAK,GAAG,CAAC,CAAC,CAAA;YAC5D,CAAC;iBAAM,IACL,CAAC,aAAa;gBACZ,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC;gBAC1D,WAAc;gBAChB,cAAc,EACd,CAAC;gBAED,IAAI,CAAC,MAAM,CAAC,UAAU,GAAG,cAAc,CAAC,QAAQ,EAAE,CAAA;YACpD,CAAC;iBAAM,CAAC;gBACN,MAAM,MAAM,GAAG,IAAA,4BAAW,EAAC,aAAa,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAA;gBACzD,MAAM,OAAO,GAAG,IAAA,4BAAW,EAAC,cAAc,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAA;gBAC3D,IAAI,YAAY,GAAG,QAAQ,KAAK,CAAC,MAAM,4CAA4C,MAAM,IAAI,KAAK,CAAC,MAAM,gCAAgC,OAAO,IAAI,KAAK,CAAC,MAAM,4BAA4B,CAAA;gBAE5L,IAAI,cAAc,KAAK,EAAE,EAAE,CAAC;oBAC1B,YAAY,IAAI,8FAA8F,OAAO,IAAI,KAAK,CAAC,MAAM,GAAG,CAAA;gBAC1I,CAAC;gBAED,MAAM,IAAI,wBAAY,CACpB,yBAAyB,EACzB,IAAI,KAAK,CAAC,YAAY,CAAC,CACxB,CAAA;YACH,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC,CAAA;AA3CY,QAAA,YAAY,gBA2CxB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stepComparison.js","sourceRoot":"","sources":["../../../src/core/stepComparison.ts"],"names":[],"mappings":";;;AACA,yDAAsD;AACtD,mDAAsD;AAGtD,yCAAuD;AAchD,MAAM,cAAc,GAAG,KAAK,EACjC,aAA4B,EAC5B,OAAiB,EACjB,OAAiB,EACjB,oBAA6B,EAC7B,gBAAmC,EAChB,EAAE;IAErB,IAAI,IAAA,qCAA0B,EAAC,OAAO,EAAE,OAAO,CAAC,EAAE,CAAC;QACjD,OAAO,aAAa,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAA;IACjD,CAAC;IAED,IAAI,eAAoC,CAAA;IACxC,IAAI,oBAAoB,EAAE,CAAC;QACzB,eAAe,GAAG,MAAM,gBAAgB,EAAE,4BAA4B,EAAE,CAAC;YACvE,WAAW,EAAE,OAAO,CAAC,QAAQ,CAAC,QAAQ;YACtC,WAAW,EAAE,OAAO,CAAC,QAAQ,CAAC,QAAQ;YACtC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO;SAChC,CAAC,CAAA;IACJ,CAAC;IAED,IAAI,CAAC,eAAe,EAAE,CAAC;QAErB,MAAM,IAAI,4BAAgB,CACxB,4BAAa,CAAC,0BAA0B,EACxC,+LAA+L,CAChM,CAAA;IACH,CAAC;IAED,OAAO,aAAa,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAA;AACjD,CAAC,CAAA;AA9BY,QAAA,cAAc,kBA8B1B"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { ExtendedChain } from '@lifi/types';
|
|
2
|
-
import type { ExecutionAction, LiFiStepExtended, SDKClient } from '../types/core.js';
|
|
3
|
-
import type { StatusManager } from './StatusManager.js';
|
|
4
|
-
export declare function waitForDestinationChainTransaction(client: SDKClient, step: LiFiStepExtended, action: ExecutionAction, fromChain: ExtendedChain, toChain: ExtendedChain, statusManager: StatusManager, pollingInterval?: number): Promise<LiFiStepExtended>;
|