Skip to content

Commit c60cf6d

Browse files
chore(runway): cherry-pick feat: MUSD-454 add quick convert event tracking cp-7.70.0 (#27455)
- feat: MUSD-454 add quick convert event tracking (#27305) <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** ### Changes: - Adds Segment event tracking for the mUSD Quick Convert flow - Enriches generic `Transaction*` events for `musdConversion` transactions - Adds `confirmation_source` to differentiate between the "Max" convert bottom sheet and custom amount confirmations - Adds `is_max` which is `true` when "Max" conversion flow is used or when custom amount is used and user clicks "Max" button in percentage button row - Adds mUSD quote tracking data ### Events | Event | Type | Location | Description | |---|---|---|---| | `mUSD Quick Convert Screen Viewed` | New standalone event | `MusdQuickConvertView` (on mount) | Fires when the quick convert token list screen is viewed | | `mUSD Bonus Terms of Use Pressed` | New standalone event | `MusdQuickConvertView` (`quick_convert_home_screen`), `EarnMusdConversionEducationView` (`conversion_education_screen`), `useMusdConversionNavbar` (`custom_amount_navbar`), `PercentageRow` (`percentage_row`) | Fires when user presses the bonus terms of use link; `location` property differentiates the source | | `mUSD Quick Convert Token Row Button Clicked` | New standalone event | `MusdQuickConvertView` | Fires on "Max" or "Edit" button tap; includes `button_action`, `redirects_to`, asset details | | `confirmation_source` | New property on `Transaction*` events | `useMusdConversionConfirmationMetrics` | `'quick_convert_max_bottom_sheet_confirmation_screen'` or `'custom_amount_screen'` — only attached to `musdConversion` transactions | | `is_max` | New property on `Transaction*` events | `useMusdConversionConfirmationMetrics` | Derived from `TransactionPayController.isMaxAmount` — only attached to `musdConversion` transactions | | Quote tracking data | New properties on `Transaction*` events | `useMusdConversionConfirmationMetrics` | Standardized quote/pay data via `getMusdConversionQuoteTrackingData` — only attached to `musdConversion` transactions | <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: Added Segment event tracking for mUSD Quick Convert flow and enrich generic Transaction* events for mUSD conversion transactions ## **Related issues** Fixes: [MUSD-454: Add segment events for Quick Convert flow](https://consensyssoftware.atlassian.net/browse/MUSD-454) ## **Manual testing steps** ```gherkin Feature: mUSD Quick Convert Segment event tracking Scenario: user views the quick convert screen Given user navigates to the mUSD Quick Convert screen When the screen mounts Then "mUSD Quick Convert Screen Viewed" event fires with location "quick_convert_home_screen" Scenario: user taps Max on a token row Given user is on the mUSD Quick Convert screen with convertible tokens When user taps "Max" on a token row Then "mUSD Quick Convert Token Row Button Clicked" event fires with button_action "max" and redirects_to "quick_convert_max_bottom_sheet_confirmation_screen" Scenario: user taps Edit on a token row Given user is on the mUSD Quick Convert screen with convertible tokens When user taps the edit icon on a token row Then "mUSD Quick Convert Token Row Button Clicked" event fires with button_action "custom" and redirects_to "custom_amount_screen" Scenario: user taps "Terms apply" link on the quick convert screen Given user is on a screen displaying the mUSD bonus "Terms apply" link When user taps "Terms apply" Then "mUSD Bonus Terms of Use Pressed" event fires with the location of the current screen Scenario: user confirms a max mUSD conversion Given user is on the max convert bottom sheet confirmation When user taps "Convert" Then "Transaction Approved" event includes confirmation_source "quick_convert_max_bottom_sheet_confirmation_screen", "is_max: true", and quote tracking data Scenario: user confirms a custom amount mUSD conversion Given user is on the custom amount conversion screen When user taps "Convert" Then "Transaction Approved" event includes confirmation_source "custom_amount_screen", "is_max: false" ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Adds new MetaMetrics events and confirmation-metric dispatches across mUSD conversion/confirmation screens; while behavior is mostly observational, it touches confirmations flow and transaction status tracking and could affect analytics payloads or introduce unintended side effects if hooks fire unexpectedly. > > **Overview** > Adds **MetaMetrics tracking for the mUSD Quick Convert flow**, including `MUSD_QUICK_CONVERT_SCREEN_VIEWED`, `MUSD_QUICK_CONVERT_TOKEN_ROW_BUTTON_CLICKED` (Max/Edit), and `MUSD_BONUS_TERMS_OF_USE_PRESSED` with location/context properties. > > Introduces a shared analytics utility (`getMusdConversionQuoteTrackingData` + `deepSnakeCaseKeys`) and refactors `useMusdConversionStatus` to use it when emitting `MUSD_CONVERSION_STATUS_UPDATED`, standardizing quote-derived properties. > > Enriches **confirmation metrics for `musdConversion`** by adding a new `useMusdConversionConfirmationMetrics` hook (wired into `MusdConversionInfoRoot`) that dispatches `confirmation_source`, `is_max`, and select quote fields into `confirmationMetrics`. Tests are updated/added accordingly, and `EVENT_LOCATIONS`/`MetaMetricsEvents` are extended to support the new instrumentation. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 6e2e686. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> [15edc39](15edc39) Co-authored-by: Matthew Grainger <46547583+Matt561@users.noreply.github.com>
1 parent 601822d commit c60cf6d

File tree

20 files changed

+1150
-158
lines changed

20 files changed

+1150
-158
lines changed

app/components/UI/Earn/Views/EarnMusdConversionEducationView/index.test.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,10 +659,25 @@ describe('EarnMusdConversionEducationView', () => {
659659
{ state: {} },
660660
);
661661

662+
mockTrackEvent.mockClear();
663+
mockCreateEventBuilder.mockClear();
664+
mockAddProperties.mockClear();
665+
mockBuild.mockClear();
666+
662667
fireEvent.press(
663668
getByText(strings('earn.musd_conversion.education.terms_apply')),
664669
);
665670

671+
expect(mockCreateEventBuilder).toHaveBeenCalledWith(
672+
MetaMetricsEvents.MUSD_BONUS_TERMS_OF_USE_PRESSED,
673+
);
674+
expect(mockAddProperties).toHaveBeenCalledWith({
675+
location:
676+
MUSD_EVENTS_CONSTANTS.EVENT_LOCATIONS.CONVERSION_EDUCATION_SCREEN,
677+
url: AppConstants.URLS.MUSD_CONVERSION_BONUS_TERMS_OF_USE,
678+
});
679+
expect(mockTrackEvent).toHaveBeenCalledWith({ name: 'mock-built-event' });
680+
666681
expect(openUrlSpy).toHaveBeenCalledTimes(1);
667682
expect(openUrlSpy).toHaveBeenCalledWith(
668683
AppConstants.URLS.MUSD_CONVERSION_BONUS_TERMS_OF_USE,

app/components/UI/Earn/Views/EarnMusdConversionEducationView/index.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,15 @@ const EarnMusdConversionEducationView = () => {
316316
};
317317

318318
const handleTermsOfUsePressed = () => {
319+
trackEvent(
320+
createEventBuilder(MetaMetricsEvents.MUSD_BONUS_TERMS_OF_USE_PRESSED)
321+
.addProperties({
322+
location: EVENT_LOCATIONS.CONVERSION_EDUCATION_SCREEN,
323+
url: AppConstants.URLS.MUSD_CONVERSION_BONUS_TERMS_OF_USE,
324+
})
325+
.build(),
326+
);
327+
319328
Linking.openURL(AppConstants.URLS.MUSD_CONVERSION_BONUS_TERMS_OF_USE);
320329
};
321330

app/components/UI/Earn/Views/MusdQuickConvertView/MusdQuickConvertView.test.tsx

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,25 @@ import { MUSD_CONVERSION_APY } from '../../constants/musd';
1919
import AppConstants from '../../../../../core/AppConstants';
2020
import { Linking } from 'react-native';
2121
import { useNavigation, useFocusEffect } from '@react-navigation/native';
22+
import { MetaMetricsEvents } from '../../../../../core/Analytics';
23+
import { MUSD_EVENTS_CONSTANTS } from '../../constants/events';
2224
import { strings } from '../../../../../../locales/i18n';
2325
import { MUSD_CONVERSION_NAVIGATION_OVERRIDE } from '../../types/musd.types';
2426
import { ConvertTokenRowTestIds } from '../../components/Musd/ConvertTokenRow';
2527
import { useMusdBalance } from '../../hooks/useMusdBalance';
28+
import { IconName } from '@metamask/design-system-react-native';
29+
30+
const mockTrackEvent = jest.fn();
31+
const mockCreateEventBuilder = jest.fn();
32+
const mockAddProperties = jest.fn();
33+
const mockBuild = jest.fn();
34+
35+
jest.mock('../../../../hooks/useAnalytics/useAnalytics', () => ({
36+
useAnalytics: () => ({
37+
trackEvent: mockTrackEvent,
38+
createEventBuilder: mockCreateEventBuilder,
39+
}),
40+
}));
2641

2742
jest.mock('@react-navigation/native', () => {
2843
const actual = jest.requireActual('@react-navigation/native');
@@ -70,6 +85,9 @@ jest.mock('../../../../hooks/useStyles', () => ({
7085
theme: { colors: {} },
7186
})),
7287
}));
88+
jest.mock('../../utils/network', () => ({
89+
getNetworkName: jest.fn(() => 'Ethereum'),
90+
}));
7391
jest.mock('react-native/Libraries/Linking/Linking', () => ({
7492
addEventListener: jest.fn(),
7593
removeEventListener: jest.fn(),
@@ -133,6 +151,14 @@ describe('MusdQuickConvertView', () => {
133151

134152
beforeEach(() => {
135153
jest.clearAllMocks();
154+
155+
mockBuild.mockReturnValue({ name: 'mock-built-event' });
156+
mockAddProperties.mockImplementation(() => ({ build: mockBuild }));
157+
mockCreateEventBuilder.mockImplementation(() => ({
158+
addProperties: mockAddProperties,
159+
build: mockBuild,
160+
}));
161+
136162
mockUseNavigation.mockReturnValue({
137163
navigate: jest.fn(),
138164
goBack: jest.fn(),
@@ -518,4 +544,149 @@ describe('MusdQuickConvertView', () => {
518544
);
519545
});
520546
});
547+
548+
describe('MetaMetrics', () => {
549+
it('tracks MUSD_BONUS_TERMS_OF_USE_PRESSED event when terms apply text is pressed', () => {
550+
const { getByText } = renderWithProvider(<MusdQuickConvertView />, {
551+
state: initialRootState,
552+
});
553+
554+
mockTrackEvent.mockClear();
555+
mockCreateEventBuilder.mockClear();
556+
mockAddProperties.mockClear();
557+
mockBuild.mockClear();
558+
559+
const termsApplyText = getByText(
560+
strings('earn.musd_conversion.education.terms_apply'),
561+
);
562+
563+
act(() => {
564+
fireEvent.press(termsApplyText);
565+
});
566+
567+
expect(mockCreateEventBuilder).toHaveBeenCalledWith(
568+
MetaMetricsEvents.MUSD_BONUS_TERMS_OF_USE_PRESSED,
569+
);
570+
expect(mockAddProperties).toHaveBeenCalledWith({
571+
location:
572+
MUSD_EVENTS_CONSTANTS.EVENT_LOCATIONS.QUICK_CONVERT_HOME_SCREEN,
573+
url: AppConstants.URLS.MUSD_CONVERSION_BONUS_TERMS_OF_USE,
574+
});
575+
expect(mockTrackEvent).toHaveBeenCalledWith({ name: 'mock-built-event' });
576+
});
577+
578+
it('tracks MUSD_QUICK_CONVERT_SCREEN_VIEWED event on mount', () => {
579+
renderWithProvider(<MusdQuickConvertView />, {
580+
state: initialRootState,
581+
});
582+
583+
expect(mockCreateEventBuilder).toHaveBeenCalledWith(
584+
MetaMetricsEvents.MUSD_QUICK_CONVERT_SCREEN_VIEWED,
585+
);
586+
expect(mockTrackEvent).toHaveBeenCalledWith({ name: 'mock-built-event' });
587+
});
588+
589+
it('does not track MUSD_QUICK_CONVERT_SCREEN_VIEWED when feature flag is disabled', () => {
590+
mockSelectMusdQuickConvertEnabledFlag.mockReturnValue(false);
591+
592+
renderWithProvider(<MusdQuickConvertView />, {
593+
state: initialRootState,
594+
});
595+
596+
expect(mockCreateEventBuilder).not.toHaveBeenCalledWith(
597+
MetaMetricsEvents.MUSD_QUICK_CONVERT_SCREEN_VIEWED,
598+
);
599+
});
600+
601+
it('tracks MUSD_QUICK_CONVERT_TOKEN_ROW_BUTTON_CLICKED event when Max button is pressed', async () => {
602+
const token = createMockToken();
603+
mockUseMusdConversionTokens.mockReturnValue({
604+
tokens: [token],
605+
filterAllowedTokens: jest.fn(),
606+
isConversionToken: jest.fn(),
607+
isMusdSupportedOnChain: jest.fn(),
608+
hasConvertibleTokensByChainId: jest.fn(),
609+
});
610+
mockInitiateMaxConversion.mockResolvedValue({
611+
transactionId: 'tx-max-123',
612+
});
613+
614+
const { getAllByTestId } = renderWithProvider(<MusdQuickConvertView />, {
615+
state: initialRootState,
616+
});
617+
618+
mockTrackEvent.mockClear();
619+
mockCreateEventBuilder.mockClear();
620+
mockAddProperties.mockClear();
621+
mockBuild.mockClear();
622+
623+
const maxButton = getAllByTestId(ConvertTokenRowTestIds.MAX_BUTTON)[0];
624+
625+
await act(async () => {
626+
fireEvent.press(maxButton);
627+
});
628+
629+
expect(mockCreateEventBuilder).toHaveBeenCalledWith(
630+
MetaMetricsEvents.MUSD_QUICK_CONVERT_TOKEN_ROW_BUTTON_CLICKED,
631+
);
632+
expect(mockAddProperties).toHaveBeenCalledWith({
633+
location:
634+
MUSD_EVENTS_CONSTANTS.EVENT_LOCATIONS.QUICK_CONVERT_HOME_SCREEN,
635+
button_type: 'text_button',
636+
button_action: 'max',
637+
button_text: strings('earn.musd_conversion.max'),
638+
redirects_to:
639+
MUSD_EVENTS_CONSTANTS.EVENT_LOCATIONS
640+
.QUICK_CONVERT_MAX_BOTTOM_SHEET_CONFIRMATION_SCREEN,
641+
asset_symbol: token.symbol,
642+
network_chain_id: token.chainId,
643+
network_name: 'Ethereum',
644+
});
645+
expect(mockTrackEvent).toHaveBeenCalledWith({ name: 'mock-built-event' });
646+
});
647+
648+
it('tracks MUSD_QUICK_CONVERT_TOKEN_ROW_BUTTON_CLICKED event when Edit button is pressed', async () => {
649+
const token = createMockToken();
650+
mockUseMusdConversionTokens.mockReturnValue({
651+
tokens: [token],
652+
filterAllowedTokens: jest.fn(),
653+
isConversionToken: jest.fn(),
654+
isMusdSupportedOnChain: jest.fn(),
655+
hasConvertibleTokensByChainId: jest.fn(),
656+
});
657+
mockInitiateCustomConversion.mockResolvedValue('tx-edit-789');
658+
659+
const { getAllByTestId } = renderWithProvider(<MusdQuickConvertView />, {
660+
state: initialRootState,
661+
});
662+
663+
mockTrackEvent.mockClear();
664+
mockCreateEventBuilder.mockClear();
665+
mockAddProperties.mockClear();
666+
mockBuild.mockClear();
667+
668+
const editButton = getAllByTestId(ConvertTokenRowTestIds.EDIT_BUTTON)[0];
669+
670+
await act(async () => {
671+
fireEvent.press(editButton);
672+
});
673+
674+
expect(mockCreateEventBuilder).toHaveBeenCalledWith(
675+
MetaMetricsEvents.MUSD_QUICK_CONVERT_TOKEN_ROW_BUTTON_CLICKED,
676+
);
677+
expect(mockAddProperties).toHaveBeenCalledWith({
678+
location:
679+
MUSD_EVENTS_CONSTANTS.EVENT_LOCATIONS.QUICK_CONVERT_HOME_SCREEN,
680+
button_type: 'icon_button',
681+
icon: IconName.Edit,
682+
button_action: 'custom',
683+
redirects_to:
684+
MUSD_EVENTS_CONSTANTS.EVENT_LOCATIONS.CUSTOM_AMOUNT_SCREEN,
685+
asset_symbol: token.symbol,
686+
network_chain_id: token.chainId,
687+
network_name: 'Ethereum',
688+
});
689+
expect(mockTrackEvent).toHaveBeenCalledWith({ name: 'mock-built-event' });
690+
});
691+
});
521692
});

app/components/UI/Earn/Views/MusdQuickConvertView/index.tsx

Lines changed: 69 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useCallback, useMemo } from 'react';
1+
import React, { useCallback, useEffect, useMemo } from 'react';
22
import { View, SectionList, Linking } from 'react-native';
33
import { useSelector } from 'react-redux';
44
import { useNavigation, useFocusEffect } from '@react-navigation/native';
@@ -31,6 +31,13 @@ import MusdBalanceCard from './components/MusdBalanceCard';
3131
import { MUSD_CONVERSION_NAVIGATION_OVERRIDE } from '../../types/musd.types';
3232
import Logger from '../../../../../util/Logger';
3333
import { useMusdBalance } from '../../hooks/useMusdBalance';
34+
import { useAnalytics } from '../../../../hooks/useAnalytics/useAnalytics';
35+
import { MetaMetricsEvents } from '../../../../../core/Analytics';
36+
import { MUSD_EVENTS_CONSTANTS } from '../../constants/events';
37+
import { getNetworkName } from '../../utils/network';
38+
import { IconName } from '@metamask/design-system-react-native';
39+
40+
const { EVENT_LOCATIONS } = MUSD_EVENTS_CONSTANTS;
3441

3542
export const MusdQuickConvertViewTestIds = {
3643
CONTAINER: 'musd-quick-convert-view-container',
@@ -76,6 +83,8 @@ const MusdQuickConvertView = () => {
7683
const { initiateCustomConversion, initiateMaxConversion } =
7784
useMusdConversion();
7885

86+
const { trackEvent, createEventBuilder } = useAnalytics();
87+
7988
// Feature flags
8089
const isQuickConvertEnabled = useSelector(selectMusdQuickConvertEnabledFlag);
8190

@@ -104,13 +113,38 @@ const MusdQuickConvertView = () => {
104113
}, [navigation, colors]),
105114
);
106115

116+
useEffect(() => {
117+
if (!isQuickConvertEnabled) return;
118+
119+
trackEvent(
120+
createEventBuilder(
121+
MetaMetricsEvents.MUSD_QUICK_CONVERT_SCREEN_VIEWED,
122+
).build(),
123+
);
124+
}, [createEventBuilder, isQuickConvertEnabled, trackEvent]);
125+
107126
// navigate to max conversion bottom sheet
108127
const handleMaxPress = useCallback(
109128
async (token: AssetType) => {
110-
if (!token.rawBalance) {
111-
// TODO: Handle error instead of returning silently.
112-
return;
113-
}
129+
trackEvent(
130+
createEventBuilder(
131+
MetaMetricsEvents.MUSD_QUICK_CONVERT_TOKEN_ROW_BUTTON_CLICKED,
132+
)
133+
.addProperties({
134+
location: EVENT_LOCATIONS.QUICK_CONVERT_HOME_SCREEN,
135+
button_type: 'text_button',
136+
button_action: 'max',
137+
button_text: strings('earn.musd_conversion.max'),
138+
redirects_to:
139+
EVENT_LOCATIONS.QUICK_CONVERT_MAX_BOTTOM_SHEET_CONFIRMATION_SCREEN,
140+
asset_symbol: token.symbol,
141+
network_chain_id: token.chainId,
142+
network_name: token.chainId
143+
? getNetworkName(token.chainId as Hex)
144+
: 'unknown',
145+
})
146+
.build(),
147+
);
114148

115149
try {
116150
await initiateMaxConversion(token);
@@ -129,12 +163,31 @@ const MusdQuickConvertView = () => {
129163
});
130164
}
131165
},
132-
[initiateMaxConversion],
166+
[createEventBuilder, initiateMaxConversion, trackEvent],
133167
);
134168

135169
// navigate to existing confirmation screen
136170
const handleEditPress = useCallback(
137171
async (token: AssetType) => {
172+
trackEvent(
173+
createEventBuilder(
174+
MetaMetricsEvents.MUSD_QUICK_CONVERT_TOKEN_ROW_BUTTON_CLICKED,
175+
)
176+
.addProperties({
177+
location: EVENT_LOCATIONS.QUICK_CONVERT_HOME_SCREEN,
178+
button_type: 'icon_button',
179+
icon: IconName.Edit,
180+
button_action: 'custom',
181+
redirects_to: EVENT_LOCATIONS.CUSTOM_AMOUNT_SCREEN,
182+
asset_symbol: token.symbol,
183+
network_chain_id: token.chainId,
184+
network_name: token.chainId
185+
? getNetworkName(token.chainId as Hex)
186+
: 'unknown',
187+
})
188+
.build(),
189+
);
190+
138191
try {
139192
await initiateCustomConversion({
140193
preferredPaymentToken: {
@@ -158,7 +211,7 @@ const MusdQuickConvertView = () => {
158211
});
159212
}
160213
},
161-
[initiateCustomConversion],
214+
[createEventBuilder, initiateCustomConversion, trackEvent],
162215
);
163216

164217
const tokensWithBalance = useMemo(
@@ -246,8 +299,16 @@ const MusdQuickConvertView = () => {
246299
);
247300

248301
const handleTermsOfUsePressed = useCallback(() => {
302+
trackEvent(
303+
createEventBuilder(MetaMetricsEvents.MUSD_BONUS_TERMS_OF_USE_PRESSED)
304+
.addProperties({
305+
location: EVENT_LOCATIONS.QUICK_CONVERT_HOME_SCREEN,
306+
url: AppConstants.URLS.MUSD_CONVERSION_BONUS_TERMS_OF_USE,
307+
})
308+
.build(),
309+
);
249310
Linking.openURL(AppConstants.URLS.MUSD_CONVERSION_BONUS_TERMS_OF_USE);
250-
}, []);
311+
}, [createEventBuilder, trackEvent]);
251312

252313
// If feature flags are not enabled, don't render
253314
if (!isQuickConvertEnabled) {

app/components/UI/Earn/constants/events/musdEvents.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ const EVENT_LOCATIONS = {
1212
CUSTOM_AMOUNT_SCREEN: 'custom_amount_screen', // Single convert screen.
1313
BUY_SCREEN: 'buy_screen', // Buy mUSD screen.
1414
QUICK_CONVERT_HOME_SCREEN: 'quick_convert_home_screen',
15+
QUICK_CONVERT_MAX_BOTTOM_SHEET_CONFIRMATION_SCREEN:
16+
'quick_convert_max_bottom_sheet_confirmation_screen',
17+
CUSTOM_AMOUNT_NAVBAR: 'custom_amount_navbar',
18+
PERCENTAGE_ROW: 'percentage_row',
1519
};
1620

1721
const MUSD_CTA_TYPES = {

app/components/UI/Earn/hooks/useMusdConversion.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -280,12 +280,6 @@ export const useMusdConversion = () => {
280280
} = Engine.context;
281281

282282
try {
283-
Logger.log('[mUSD Max Conversion] Setting payment token:', {
284-
transactionId,
285-
tokenAddress,
286-
chainId: tokenChainId,
287-
});
288-
289283
// Must be called BEFORE updatePaymentToken.
290284
TransactionPayController.setTransactionConfig(
291285
transactionId,

0 commit comments

Comments
 (0)