Skip to content

Commit

Permalink
feat: lifi swapper simplify status detection (#8569)
Browse files Browse the repository at this point in the history
  • Loading branch information
gomesalexandre authored Jan 15, 2025
1 parent 96f4df0 commit 6a3a601
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/swapper/src/swappers/LifiSwapper/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,8 @@ export const lifiApi: SwapperApi = {

const statusResponse = await response.json()

const receiving: ExtendedTransactionInfo | undefined = statusResponse.receiving

const status = (() => {
switch (statusResponse.status) {
case 'DONE':
Expand All @@ -301,8 +303,9 @@ export const lifiApi: SwapperApi = {
})()

return {
status,
buyTxHash: (statusResponse.receiving as ExtendedTransactionInfo)?.txHash,
// We have an out Tx hash (either same or cross-chain) for this step, so we consider the Tx (effectively, the step) confirmed
status: receiving?.txHash ? TxStatus.Confirmed : status,
buyTxHash: receiving?.txHash,
message: statusResponse.substatusMessage,
}
},
Expand Down

0 comments on commit 6a3a601

Please sign in to comment.