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
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 @@ -18,6 +18,8 @@ export enum UnifiedSwapBridgeEventName {
AllQuotesSorted = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} All Quotes Sorted`,
QuoteSelected = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} Quote Selected`,
AssetDetailTooltipClicked = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} Asset Detail Tooltip Clicked`,
AssetPickerOpened = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} Asset Picker Opened`,
AssetSelected = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} Asset Selected`,
QuotesValidationFailed = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} Quotes Failed Validation`,
StatusValidationFailed = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} Status Failed Validation`,
}
Expand Down
11 changes: 11 additions & 0 deletions packages/bridge-controller/src/utils/metrics/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
* These properties map to properties required by the segment-schema. For example: https://github.com/Consensys/segment-schema/blob/main/libraries/properties/cross-chain-swaps-action.yaml
*/
export type RequestParams = {
chain_id_source: CaipChainId;

Check failure on line 15 in packages/bridge-controller/src/utils/metrics/types.ts

View workflow job for this annotation

GitHub Actions / Lint, build, and test / Lint (22.x)

Type Property name `chain_id_source` must match one of the following formats: camelCase
chain_id_destination: CaipChainId | null;

Check failure on line 16 in packages/bridge-controller/src/utils/metrics/types.ts

View workflow job for this annotation

GitHub Actions / Lint, build, and test / Lint (22.x)

Type Property name `chain_id_destination` must match one of the following formats: camelCase
token_symbol_source: string;

Check failure on line 17 in packages/bridge-controller/src/utils/metrics/types.ts

View workflow job for this annotation

GitHub Actions / Lint, build, and test / Lint (22.x)

Type Property name `token_symbol_source` must match one of the following formats: camelCase
token_symbol_destination: string | null;

Check failure on line 18 in packages/bridge-controller/src/utils/metrics/types.ts

View workflow job for this annotation

GitHub Actions / Lint, build, and test / Lint (22.x)

Type Property name `token_symbol_destination` must match one of the following formats: camelCase
token_address_source: CaipAssetType;

Check failure on line 19 in packages/bridge-controller/src/utils/metrics/types.ts

View workflow job for this annotation

GitHub Actions / Lint, build, and test / Lint (22.x)

Type Property name `token_address_source` must match one of the following formats: camelCase
token_address_destination: CaipAssetType | null;

Check failure on line 20 in packages/bridge-controller/src/utils/metrics/types.ts

View workflow job for this annotation

GitHub Actions / Lint, build, and test / Lint (22.x)

Type Property name `token_address_destination` must match one of the following formats: camelCase
};

export type RequestMetadata = {
slippage_limit?: number; // undefined === auto

Check failure on line 24 in packages/bridge-controller/src/utils/metrics/types.ts

View workflow job for this annotation

GitHub Actions / Lint, build, and test / Lint (22.x)

Type Property name `slippage_limit` must match one of the following formats: camelCase
custom_slippage: boolean;

Check failure on line 25 in packages/bridge-controller/src/utils/metrics/types.ts

View workflow job for this annotation

GitHub Actions / Lint, build, and test / Lint (22.x)

Type Property name `custom_slippage` must match one of the following formats: camelCase
usd_amount_source: number; // Use quoteResponse when available

Check failure on line 26 in packages/bridge-controller/src/utils/metrics/types.ts

View workflow job for this annotation

GitHub Actions / Lint, build, and test / Lint (22.x)

Type Property name `usd_amount_source` must match one of the following formats: camelCase
stx_enabled: boolean;

Check failure on line 27 in packages/bridge-controller/src/utils/metrics/types.ts

View workflow job for this annotation

GitHub Actions / Lint, build, and test / Lint (22.x)

Type Property name `stx_enabled` must match one of the following formats: camelCase
is_hardware_wallet: boolean;
swap_type: MetricsSwapType;
security_warnings: string[];
Expand Down Expand Up @@ -204,6 +204,15 @@
chain_name: string;
chain_id: string;
};
[UnifiedSwapBridgeEventName.AssetPickerOpened]: {
location: 'source' | 'destination';
};
[UnifiedSwapBridgeEventName.AssetSelected]: {
token_symbol: string;
token_address: string;
chain_id: CaipChainId | null;
location: 'source' | 'destination';
};
[UnifiedSwapBridgeEventName.QuotesValidationFailed]: {
failures: string[];
};
Expand Down Expand Up @@ -260,6 +269,8 @@
QuoteFetchData &
TradeData;
[UnifiedSwapBridgeEventName.AssetDetailTooltipClicked]: null;
[UnifiedSwapBridgeEventName.AssetPickerOpened]: null;
[UnifiedSwapBridgeEventName.AssetSelected]: null;
[UnifiedSwapBridgeEventName.QuotesValidationFailed]: RequestParams & {
refresh_count: number;
};
Expand Down
Loading