Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/bridge-controller/src/bridge-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -949,6 +949,8 @@ export class BridgeController extends StaticIntervalPollingController<BridgePoll
};
}
case UnifiedSwapBridgeEventName.AssetDetailTooltipClicked:
case UnifiedSwapBridgeEventName.AssetPickerOpened:
case UnifiedSwapBridgeEventName.AssetSelected:
return baseProperties;
// These events may be published after the bridge-controller state is reset
// So the BridgeStatusController populates all the properties
Expand Down
2 changes: 2 additions & 0 deletions packages/bridge-controller/src/utils/metrics/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export enum UnifiedSwapBridgeEventName {
AssetDetailTooltipClicked = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} Asset Detail Tooltip Clicked`,
QuotesValidationFailed = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} Quotes Failed Validation`,
StatusValidationFailed = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} Status Failed Validation`,
AssetPickerOpened = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} Asset Picker Opened`,
AssetSelected = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} Asset Selected`,
}

export enum AbortReason {
Expand Down
12 changes: 12 additions & 0 deletions packages/bridge-controller/src/utils/metrics/types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/naming-convention */
import type { CaipAssetType, CaipChainId } from '@metamask/utils';

import type {
Expand Down Expand Up @@ -210,6 +211,15 @@ export type RequiredEventContextFromClient = {
[UnifiedSwapBridgeEventName.StatusValidationFailed]: {
failures: string[];
};
[UnifiedSwapBridgeEventName.AssetPickerOpened]: {
location: 'source' | 'destination';
};
[UnifiedSwapBridgeEventName.AssetSelected]: {
token_symbol: string;
token_address: string | null;
chain_id: CaipChainId | null;
location: 'source' | 'destination';
};
};

/**
Expand Down Expand Up @@ -266,6 +276,8 @@ export type EventPropertiesFromControllerState = {
[UnifiedSwapBridgeEventName.StatusValidationFailed]: RequestParams & {
refresh_count: number;
};
[UnifiedSwapBridgeEventName.AssetPickerOpened]: null;
[UnifiedSwapBridgeEventName.AssetSelected]: null;
};

/**
Expand Down
Loading