Skip to content

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
lufaque committed Dec 20, 2023
2 parents 3dc1cbe + 92661b9 commit 33d8f6b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { Dispatch } from 'react'
import { SwapAction, SwapCardStage } from '../swapReducer/types'
import { StandardRoute } from '../../../../types/StandardRoute'
import { logTxToDB } from '../../../../utils/logTxToDB'
import { trackEvent } from '../../../../hooks/useTracking'
import { action, category } from '../../../../constants/tracking'

export const handleTransactionError = (e: Error, swapDispatch: Dispatch<SwapAction>, selectedRoute: StandardRoute) => {
swapDispatch({ type: 'UPDATE_LAST_SWAP_STEP' })
Expand All @@ -24,4 +26,5 @@ export const handleTransactionError = (e: Error, swapDispatch: Dispatch<SwapActi

swapDispatch({ type: 'SET_SWAP_STAGE', payload: SwapCardStage.failed })
logTxToDB({ tx_id: selectedRoute.id, status: 'failure', provider: selectedRoute.provider, tx_data: selectedRoute })
trackEvent({ category: category.SwapCard, action: action.SwapFailed, label: 'swap_failed', data: { provider: selectedRoute.provider, selectedRoute } })
}
1 change: 1 addition & 0 deletions src/types/StandardRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export interface StandardRoute {
slippage_percent: number | null
transaction_time_seconds: number | null
insurance: Insurance | null
provider: 'rango' | 'lifi'
}

export type Direction = {
Expand Down

0 comments on commit 33d8f6b

Please sign in to comment.