Skip to content

Commit

Permalink
add isHardwareWallet to swap analytics event
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-schrammel committed Oct 26, 2024
1 parent 61c9d54 commit c7f5a3e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/__swaps__/screens/Swap/providers/swap-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -300,6 +301,7 @@ export const SwapProvider = ({ children }: SwapProviderProps) => {
degenMode: isDegenModeEnabled,
isSwappingToPopularAsset,
errorMessage,
isHardwareWallet: wallet instanceof LedgerSigner,
});

if (errorMessage !== 'handled') {
Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/analytics/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ type SwapEventParameters<T extends 'swap' | 'crosschainSwap'> = {
tradeAmountUSD: number;
degenMode: boolean;
isSwappingToPopularAsset: boolean;
isHardwareWallet: boolean;
};

type SwapsEventFailedParameters<T extends 'swap' | 'crosschainSwap'> = {
Expand Down

0 comments on commit c7f5a3e

Please sign in to comment.