Skip to content
Open
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
4 changes: 4 additions & 0 deletions packages/bridge-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Add `AssetPickerOpened` unified swap bridge metrics event with an `asset_location` property to indicate `'source'` or `'destination'`. ([#7985](https://github.com/MetaMask/core/pull/7985))

## [67.0.0]

### Added
Expand Down
1 change: 1 addition & 0 deletions packages/bridge-controller/src/bridge-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -997,6 +997,7 @@ export class BridgeController extends StaticIntervalPollingController<BridgePoll
};
}
case UnifiedSwapBridgeEventName.AssetDetailTooltipClicked:
case UnifiedSwapBridgeEventName.AssetPickerOpened:
return baseProperties;
// These events may be published after the bridge-controller state is reset
// So the BridgeStatusController populates all the properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ 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`,
PollingStatusUpdated = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} Polling Status Updated`,
}

Expand Down
4 changes: 4 additions & 0 deletions packages/bridge-controller/src/utils/metrics/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ type RequiredEventContextFromClientBase = {
failures: string[];
refresh_count: number;
};
[UnifiedSwapBridgeEventName.AssetPickerOpened]: {
asset_location: 'source' | 'destination';
};
[UnifiedSwapBridgeEventName.PollingStatusUpdated]: TradeData &
Pick<QuoteFetchData, 'price_impact'> &
Omit<RequestMetadata, 'security_warnings'> &
Expand Down Expand Up @@ -298,6 +301,7 @@ export type EventPropertiesFromControllerState = {
refresh_count: number;
};
[UnifiedSwapBridgeEventName.StatusValidationFailed]: RequestParams;
[UnifiedSwapBridgeEventName.AssetPickerOpened]: null;
[UnifiedSwapBridgeEventName.PollingStatusUpdated]: null;
};

Expand Down
Loading