From c7f5a3eba01b21ab90b34a3c2d34d2fe4800cd06 Mon Sep 17 00:00:00 2001 From: gregs Date: Sat, 26 Oct 2024 01:57:32 -0300 Subject: [PATCH] add isHardwareWallet to swap analytics event --- src/__swaps__/screens/Swap/providers/swap-provider.tsx | 3 +++ src/analytics/event.ts | 1 + 2 files changed, 4 insertions(+) diff --git a/src/__swaps__/screens/Swap/providers/swap-provider.tsx b/src/__swaps__/screens/Swap/providers/swap-provider.tsx index 42333c2a566..3fa6516fd96 100644 --- a/src/__swaps__/screens/Swap/providers/swap-provider.tsx +++ b/src/__swaps__/screens/Swap/providers/swap-provider.tsx @@ -57,6 +57,7 @@ import { performanceTracking, Screens, TimeToSignOperation } from '@/state/perfo import { getRemoteConfig } from '@/model/remoteConfig'; import { useConnectedToHardhatStore } from '@/state/connectedToHardhat'; import { chainsNativeAsset, supportedFlashbotsChainIds } from '@/chains'; +import { LedgerSigner } from '@/handlers/LedgerSigner'; const swapping = i18n.t(i18n.l.swap.actions.swapping); const holdToSwap = i18n.t(i18n.l.swap.actions.hold_to_swap); @@ -300,6 +301,7 @@ export const SwapProvider = ({ children }: SwapProviderProps) => { degenMode: isDegenModeEnabled, isSwappingToPopularAsset, errorMessage, + isHardwareWallet: wallet instanceof LedgerSigner, }); if (errorMessage !== 'handled') { @@ -365,6 +367,7 @@ export const SwapProvider = ({ children }: SwapProviderProps) => { tradeAmountUSD: parameters.quote.tradeAmountUSD, degenMode: isDegenModeEnabled, isSwappingToPopularAsset, + isHardwareWallet: wallet instanceof LedgerSigner, }); } catch (error) { isSwapping.value = false; diff --git a/src/analytics/event.ts b/src/analytics/event.ts index 12b53862765..8beb36d4e45 100644 --- a/src/analytics/event.ts +++ b/src/analytics/event.ts @@ -178,6 +178,7 @@ type SwapEventParameters = { tradeAmountUSD: number; degenMode: boolean; isSwappingToPopularAsset: boolean; + isHardwareWallet: boolean; }; type SwapsEventFailedParameters = {