Skip to content

Commit

Permalink
feat: add swap+send metrics to tx payload
Browse files Browse the repository at this point in the history
  • Loading branch information
BZahory committed Aug 20, 2024
1 parent 52a94e0 commit f94bc23
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/scripts/lib/transaction/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ import {
getSwapsTokensReceivedFromTxMeta,
TRANSACTION_ENVELOPE_TYPE_NAMES,
} from '../../../../shared/lib/transactions-controller-utils';
import { getBlockaidMetricsProps } from '../../../../ui/helpers/utils/metrics';
import {
getBlockaidMetricsProps,
getSwapAndSendMetricsProps,
} from '../../../../ui/helpers/utils/metrics';
import { getSmartTransactionMetricsProperties } from '../../../../shared/modules/metametrics';
import {
getSnapAndHardwareInfoForMetrics,
Expand Down Expand Up @@ -1017,6 +1020,9 @@ async function buildEventFragmentProperties({
transactionMeta,
);

const swapAndSendMetricsProperties =
getSwapAndSendMetricsProps(transactionMeta);

/** The transaction status property is not considered sensitive and is now included in the non-anonymous event */
let properties = {
chain_id: chainId,
Expand All @@ -1043,6 +1049,7 @@ async function buildEventFragmentProperties({
ui_customizations: uiCustomizations.length > 0 ? uiCustomizations : null,
transaction_advanced_view: isAdvancedDetailsOpen,
...smartTransactionMetricsProperties,
...swapAndSendMetricsProperties,
// TODO: Replace `any` with type
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} as Record<string, any>;
Expand Down

0 comments on commit f94bc23

Please sign in to comment.