Skip to content

Commit

Permalink
fix: roon
Browse files Browse the repository at this point in the history
  • Loading branch information
gomesalexandre committed Jan 14, 2025
1 parent feca3ba commit da01542
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/swapper/src/swappers/ThorchainSwapper/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -652,20 +652,21 @@ export const thorchainApi: SwapperApi = {

const buyTxHash = parseThorBuyTxHash(txHash, lastOutTx)

const hasOutboundTx = lastOutTx !== undefined && lastOutTx.chain !== 'THOR'
const hasOutboundL1Tx = lastOutTx !== undefined && lastOutTx.chain !== 'THOR'
const hasOutboundRuneTx = lastOutTx !== undefined && lastOutTx.chain === 'THOR'

// We consider the transaction confirmed as soon as we have a buyTxHash
// For UTXOs, this means that the swap will be confirmed as soon as Txs hit the mempool
// Which is actually correct, as we update UTXO balances optimistically
if (!('error' in txData) && buyTxHash && hasOutboundTx) {
if (!('error' in txData) && buyTxHash && (hasOutboundL1Tx || hasOutboundRuneTx)) {
return {
buyTxHash,
status: TxStatus.Confirmed,
message: undefined,
}
}

const message = getLatestThorTxStatusMessage(txStatusData, hasOutboundTx)
const message = getLatestThorTxStatusMessage(txStatusData, hasOutboundL1Tx)
return {
buyTxHash,
status: TxStatus.Pending,
Expand Down

0 comments on commit da01542

Please sign in to comment.