Skip to content

Commit 0c85998

Browse files
authored
refactor(perps): rename interface to match core repo (#25245)
## **Description** This PR prepares the Perps codebase for a future Core monorepo migration by aligning naming conventions with Core standards. **Motivation:** A planned migration to the Core monorepo will be cleaner if naming conventions match Core standards ahead of time. This PR applies all renames in Mobile first, enabling near-identical code during migration. **Changes:** 1. **Interface Renames** - Removed `I` prefix from all interfaces in `controllers/types/index.ts` (e.g., `IPerpsProvider` → `PerpsProvider`, `IPerpsPlatformDependencies` → `PerpsPlatformDependencies`) to match Core conventions 2. **Constant Property Renames** - Changed constant object properties from SCREAMING_SNAKE to PascalCase (e.g., `PERPS_CONSTANTS.WEBSOCKET_TIMEOUT` → `PERPS_CONSTANTS.WebsocketTimeout`) while keeping top-level constant names unchanged 3. **Minor Type Safety** - Added `isVersionGatedFeatureFlag` type guard for proper type narrowing ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: N/A (refactoring/preparation work) ## **Manual testing steps** ```gherkin Feature: Perps functionality unchanged after refactor Scenario: User can view perps markets Given user has perps feature enabled When user navigates to the Perps tab Then markets list loads correctly Scenario: User can place a trade Given user is on a market detail page with sufficient balance When user places a market order Then order is submitted successfully ``` ## **Screenshots/Recordings** Not applicable - this is a refactoring PR with no UI changes. ### **Before** N/A ### **After** N/A ## **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] > Aligns Perps code with Core naming standards; no functional changes intended. > > - Renames `I*` interfaces to non-prefixed types across controllers, providers, services, aggregation, selectors, adapters, and tests (e.g., `IPerpsProvider` → `PerpsProvider`, `IPerpsPlatformDependencies` → `PerpsPlatformDependencies`) > - Converts many constant object properties from SCREAMING_SNAKE to PascalCase and updates all UI usages (e.g., `PERPS_CONSTANTS.FALLBACK_PRICE_DISPLAY` → `PERPS_CONSTANTS.FallbackPriceDisplay`, slippage/limits/sorting configs, etc.) > - Mobile infrastructure/mocks extended: add `authentication.getBearerToken`, `network.getSelectedNetworkClientId`, `streamManager.clearAllChannels`; adjust rewards accessors; update builder/referral/HIP-3/testnet config keys > - Updates logging tags to use `PERPS_CONSTANTS.FeatureName`; refreshes tests to new names > - No UI/feature changes; behavior should remain the same > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit c6452b4. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 732c3e5 commit 0c85998

File tree

129 files changed

+1028
-1042
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+1028
-1042
lines changed

app/components/UI/Perps/Views/PerpsAdjustMarginView/PerpsAdjustMarginView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ const PerpsAdjustMarginView: React.FC = () => {
157157
const formatLiquidationDistance = useCallback(
158158
(distance: number, liquidationPrice: number): string => {
159159
if (liquidationPrice === 0) {
160-
return PERPS_CONSTANTS.FALLBACK_DATA_DISPLAY;
160+
return PERPS_CONSTANTS.FallbackDataDisplay;
161161
}
162162
return `${distance.toFixed(0)}%`;
163163
},

app/components/UI/Perps/Views/PerpsClosePositionView/PerpsClosePositionView.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ const PerpsClosePositionView: React.FC = () => {
175175
// Defensive fallback if market data fails to load - prevents crashes
176176
// Real szDecimals should come from market data (varies by asset)
177177
const szDecimals =
178-
marketData?.szDecimals ?? DECIMAL_PRECISION_CONFIG.FALLBACK_SIZE_DECIMALS;
178+
marketData?.szDecimals ?? DECIMAL_PRECISION_CONFIG.FallbackSizeDecimals;
179179

180180
const { tokenAmount, usdValue } = calculateCloseAmountFromPercentage({
181181
percentage: closePercentage,
@@ -402,8 +402,8 @@ const PerpsClosePositionView: React.FC = () => {
402402
priceAtCalculation: effectivePrice,
403403
maxSlippageBps:
404404
orderType === 'limit'
405-
? ORDER_SLIPPAGE_CONFIG.DEFAULT_LIMIT_SLIPPAGE_BPS // 1% for limit orders
406-
: ORDER_SLIPPAGE_CONFIG.DEFAULT_MARKET_SLIPPAGE_BPS, // 3% for market orders
405+
? ORDER_SLIPPAGE_CONFIG.DefaultLimitSlippageBps // 1% for limit orders
406+
: ORDER_SLIPPAGE_CONFIG.DefaultMarketSlippageBps, // 3% for market orders
407407
},
408408
});
409409
};

app/components/UI/Perps/Views/PerpsHomeView/PerpsHomeView.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,8 @@ const PerpsHomeView = () => {
260260
navigation.navigate(Routes.WEBVIEW.MAIN, {
261261
screen: Routes.WEBVIEW.SIMPLE,
262262
params: {
263-
url: SUPPORT_CONFIG.URL,
264-
title: strings(SUPPORT_CONFIG.TITLE_KEY),
263+
url: SUPPORT_CONFIG.Url,
264+
title: strings(SUPPORT_CONFIG.TitleKey),
265265
},
266266
});
267267
// Track contact support interaction for Perps analytics
@@ -296,9 +296,9 @@ const PerpsHomeView = () => {
296296
.build(),
297297
);
298298
// Open survey in external browser
299-
Linking.openURL(FEEDBACK_CONFIG.URL).catch((error: unknown) => {
299+
Linking.openURL(FEEDBACK_CONFIG.Url).catch((error: unknown) => {
300300
Logger.error(ensureError(error), {
301-
feature: PERPS_CONSTANTS.FEATURE_NAME,
301+
feature: PERPS_CONSTANTS.FeatureName,
302302
message: 'Failed to open feedback survey URL',
303303
});
304304
});
@@ -307,7 +307,7 @@ const PerpsHomeView = () => {
307307
const navigationItems: NavigationItem[] = useMemo(() => {
308308
const items: NavigationItem[] = [
309309
{
310-
label: strings(SUPPORT_CONFIG.TITLE_KEY),
310+
label: strings(SUPPORT_CONFIG.TitleKey),
311311
onPress: () => navigateToContactSupport(),
312312
testID: PerpsHomeViewSelectorsIDs.SUPPORT_BUTTON,
313313
},
@@ -316,7 +316,7 @@ const PerpsHomeView = () => {
316316
// Add feedback button when feature flag is enabled
317317
if (isFeedbackEnabled) {
318318
items.push({
319-
label: strings(FEEDBACK_CONFIG.TITLE_KEY),
319+
label: strings(FEEDBACK_CONFIG.TitleKey),
320320
onPress: handleGiveFeedback,
321321
testID: PerpsHomeViewSelectorsIDs.FEEDBACK_BUTTON,
322322
});
@@ -325,7 +325,7 @@ const PerpsHomeView = () => {
325325
// Avoid duplicate "Learn more" button (shown in empty state card)
326326
if (!isBalanceEmpty) {
327327
items.push({
328-
label: strings(LEARN_MORE_CONFIG.TITLE_KEY),
328+
label: strings(LEARN_MORE_CONFIG.TitleKey),
329329
onPress: () => navigtateToTutorial(),
330330
testID: PerpsHomeViewSelectorsIDs.LEARN_MORE_BUTTON,
331331
});
@@ -412,7 +412,7 @@ const PerpsHomeView = () => {
412412
>
413413
{/* Balance Actions Component */}
414414
<PerpsMarketBalanceActions
415-
showActionButtons={HOME_SCREEN_CONFIG.SHOW_HEADER_ACTION_BUTTONS}
415+
showActionButtons={HOME_SCREEN_CONFIG.ShowHeaderActionButtons}
416416
/>
417417

418418
{/* Positions Section */}
@@ -533,7 +533,7 @@ const PerpsHomeView = () => {
533533
{!isBalanceEmpty &&
534534
!showCloseAllSheet &&
535535
!showCancelAllSheet &&
536-
!HOME_SCREEN_CONFIG.SHOW_HEADER_ACTION_BUTTONS && (
536+
!HOME_SCREEN_CONFIG.ShowHeaderActionButtons && (
537537
<View style={fixedFooterStyle}>
538538
<View style={styles.footerButtonsContainer}>
539539
<View style={styles.footerButton}>

app/components/UI/Perps/Views/PerpsMarketDetailsView/PerpsMarketDetailsView.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ const PerpsMarketDetailsView: React.FC<PerpsMarketDetailsViewProps> = () => {
536536
// Just reset the UI state and the chart will update automatically
537537
} catch (error) {
538538
Logger.error(ensureError(error), {
539-
feature: PERPS_CONSTANTS.FEATURE_NAME,
539+
feature: PERPS_CONSTANTS.FeatureName,
540540
message: 'Failed to refresh chart state',
541541
});
542542
} finally {
@@ -689,13 +689,13 @@ const PerpsMarketDetailsView: React.FC<PerpsMarketDetailsViewProps> = () => {
689689
// Initialize deposit in the background without blocking
690690
depositWithConfirmation().catch((error) => {
691691
Logger.error(ensureError(error), {
692-
feature: PERPS_CONSTANTS.FEATURE_NAME,
692+
feature: PERPS_CONSTANTS.FeatureName,
693693
message: 'Failed to initialize deposit',
694694
});
695695
});
696696
} catch (error) {
697697
Logger.error(ensureError(error), {
698-
feature: PERPS_CONSTANTS.FEATURE_NAME,
698+
feature: PERPS_CONSTANTS.FeatureName,
699699
message: 'Failed to navigate to deposit',
700700
});
701701
}
@@ -704,7 +704,7 @@ const PerpsMarketDetailsView: React.FC<PerpsMarketDetailsViewProps> = () => {
704704
const handleTradingViewPress = useCallback(() => {
705705
Linking.openURL('https://www.tradingview.com/').catch((error: unknown) => {
706706
Logger.error(ensureError(error), {
707-
feature: PERPS_CONSTANTS.FEATURE_NAME,
707+
feature: PERPS_CONSTANTS.FeatureName,
708708
message: 'Failed to open Trading View URL',
709709
});
710710
});
@@ -849,7 +849,7 @@ const PerpsMarketDetailsView: React.FC<PerpsMarketDetailsViewProps> = () => {
849849
});
850850
} catch (error) {
851851
Logger.error(ensureError(error), {
852-
feature: PERPS_CONSTANTS.FEATURE_NAME,
852+
feature: PERPS_CONSTANTS.FeatureName,
853853
message: 'Failed to set stop loss from prompt banner',
854854
});
855855
} finally {
@@ -893,7 +893,7 @@ const PerpsMarketDetailsView: React.FC<PerpsMarketDetailsViewProps> = () => {
893893
const handleChartError = useCallback(() => {
894894
// Log the error but don't block the UI
895895
Logger.error(new Error('Chart rendering error in market details view'), {
896-
feature: PERPS_CONSTANTS.FEATURE_NAME,
896+
feature: PERPS_CONSTANTS.FeatureName,
897897
});
898898
}, []);
899899

app/components/UI/Perps/Views/PerpsOrderView/PerpsOrderView.tsx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ const PerpsOrderViewContentBase: React.FC<PerpsOrderViewContentProps> = ({
407407
const positionSize = useMemo(() => {
408408
// During loading, show '--' placeholder (consistent with other unavailable data displays)
409409
if (isLoadingMarketData) {
410-
return PERPS_CONSTANTS.FALLBACK_DATA_DISPLAY;
410+
return PERPS_CONSTANTS.FallbackDataDisplay;
411411
}
412412

413413
return calculatePositionSize({
@@ -416,8 +416,7 @@ const PerpsOrderViewContentBase: React.FC<PerpsOrderViewContentProps> = ({
416416
// Defensive fallback if market data fails to load - prevents crashes
417417
// Real szDecimals should come from market data (varies by asset)
418418
szDecimals:
419-
marketData?.szDecimals ??
420-
DECIMAL_PRECISION_CONFIG.FALLBACK_SIZE_DECIMALS,
419+
marketData?.szDecimals ?? DECIMAL_PRECISION_CONFIG.FallbackSizeDecimals,
421420
});
422421
}, [
423422
orderForm.amount,
@@ -830,8 +829,8 @@ const PerpsOrderViewContentBase: React.FC<PerpsOrderViewContentProps> = ({
830829
priceAtCalculation: assetData.price, // Price snapshot when size was calculated (for slippage validation)
831830
maxSlippageBps:
832831
orderForm.type === 'limit'
833-
? ORDER_SLIPPAGE_CONFIG.DEFAULT_LIMIT_SLIPPAGE_BPS // 1% for limit orders
834-
: ORDER_SLIPPAGE_CONFIG.DEFAULT_MARKET_SLIPPAGE_BPS, // 3% for market orders
832+
? ORDER_SLIPPAGE_CONFIG.DefaultLimitSlippageBps // 1% for limit orders
833+
: ORDER_SLIPPAGE_CONFIG.DefaultMarketSlippageBps, // 3% for market orders
835834
// Only add TP/SL/Limit if they are truthy and/or not empty strings
836835
...(orderForm.type === 'limit' && orderForm.limitPrice
837836
? { price: orderForm.limitPrice }
@@ -1182,7 +1181,7 @@ const PerpsOrderViewContentBase: React.FC<PerpsOrderViewContentProps> = ({
11821181
? formatPerpsFiat(marginRequired, {
11831182
ranges: PRICE_RANGES_MINIMAL_VIEW,
11841183
})
1185-
: PERPS_CONSTANTS.FALLBACK_DATA_DISPLAY}
1184+
: PERPS_CONSTANTS.FallbackDataDisplay}
11861185
</Text>
11871186
</View>
11881187

@@ -1210,7 +1209,7 @@ const PerpsOrderViewContentBase: React.FC<PerpsOrderViewContentProps> = ({
12101209
? formatPerpsFiat(liquidationPrice, {
12111210
ranges: PRICE_RANGES_UNIVERSAL,
12121211
})
1213-
: PERPS_CONSTANTS.FALLBACK_DATA_DISPLAY}
1212+
: PERPS_CONSTANTS.FallbackDataDisplay}
12141213
</Text>
12151214
</View>
12161215
<View style={styles.infoRow}>
@@ -1234,7 +1233,7 @@ const PerpsOrderViewContentBase: React.FC<PerpsOrderViewContentProps> = ({
12341233
feeDiscountPercentage={rewardsState.feeDiscountPercentage}
12351234
formatFeeText={
12361235
!hasValidAmount || feeResults.isLoadingMetamaskFee
1237-
? PERPS_CONSTANTS.FALLBACK_DATA_DISPLAY
1236+
? PERPS_CONSTANTS.FallbackDataDisplay
12381237
: formatPerpsFiat(estimatedFees, {
12391238
ranges: PRICE_RANGES_MINIMAL_VIEW,
12401239
})
@@ -1448,7 +1447,7 @@ const PerpsOrderViewContentBase: React.FC<PerpsOrderViewContentProps> = ({
14481447
leverage={orderForm.leverage}
14491448
minLeverage={1}
14501449
maxLeverage={
1451-
marketData?.maxLeverage || PERPS_CONSTANTS.DEFAULT_MAX_LEVERAGE
1450+
marketData?.maxLeverage || PERPS_CONSTANTS.DefaultMaxLeverage
14521451
}
14531452
currentPrice={assetData.price}
14541453
direction={orderForm.direction}

app/components/UI/Perps/Views/PerpsPositionsView/PerpsPositionsView.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ const PerpsPositionsView: React.FC = () => {
164164
? formatPerpsFiat(account.totalBalance, {
165165
ranges: PRICE_RANGES_MINIMAL_VIEW,
166166
})
167-
: PERPS_CONSTANTS.FALLBACK_DATA_DISPLAY}
167+
: PERPS_CONSTANTS.FallbackDataDisplay}
168168
</Text>
169169
</View>
170170

@@ -178,7 +178,7 @@ const PerpsPositionsView: React.FC = () => {
178178
? formatPerpsFiat(account.availableBalance, {
179179
ranges: PRICE_RANGES_MINIMAL_VIEW,
180180
})
181-
: PERPS_CONSTANTS.FALLBACK_DATA_DISPLAY}
181+
: PERPS_CONSTANTS.FallbackDataDisplay}
182182
</Text>
183183
</View>
184184

@@ -191,7 +191,7 @@ const PerpsPositionsView: React.FC = () => {
191191
? formatPerpsFiat(account.marginUsed, {
192192
ranges: PRICE_RANGES_MINIMAL_VIEW,
193193
})
194-
: PERPS_CONSTANTS.FALLBACK_DATA_DISPLAY}
194+
: PERPS_CONSTANTS.FallbackDataDisplay}
195195
</Text>
196196
</View>
197197

app/components/UI/Perps/Views/PerpsRedirect.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const PerpsRedirect: React.FC = () => {
2525
initialTab: 'perps',
2626
shouldSelectPerpsTab: true,
2727
});
28-
}, PERFORMANCE_CONFIG.NAVIGATION_PARAMS_DELAY_MS);
28+
}, PERFORMANCE_CONFIG.NavigationParamsDelayMs);
2929
}
3030
}, [isConnected, isInitialized]);
3131

app/components/UI/Perps/Views/PerpsTPSLView/PerpsTPSLView.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ const PerpsTPSLView: React.FC = () => {
9191
// Use throttle for TP/SL screen to reduce re-renders
9292
const priceData = usePerpsLivePrices({
9393
symbols: asset ? [asset] : [],
94-
throttleMs: TP_SL_VIEW_CONFIG.PRICE_THROTTLE_MS,
94+
throttleMs: TP_SL_VIEW_CONFIG.PriceThrottleMs,
9595
});
9696
const livePrice = priceData[asset]?.price
9797
? parseFloat(priceData[asset].price)
@@ -471,7 +471,7 @@ const PerpsTPSLView: React.FC = () => {
471471
? formatPerpsFiat(position.entryPrice, {
472472
ranges: PRICE_RANGES_UNIVERSAL,
473473
})
474-
: PERPS_CONSTANTS.FALLBACK_PRICE_DISPLAY}
474+
: PERPS_CONSTANTS.FallbackPriceDisplay}
475475
</Text>
476476
</View>
477477
)}
@@ -488,7 +488,7 @@ const PerpsTPSLView: React.FC = () => {
488488
? formatPerpsFiat(currentPrice, {
489489
ranges: PRICE_RANGES_UNIVERSAL,
490490
})
491-
: PERPS_CONSTANTS.FALLBACK_PRICE_DISPLAY}
491+
: PERPS_CONSTANTS.FallbackPriceDisplay}
492492
</Text>
493493
</View>
494494
<View style={styles.priceInfoRow}>
@@ -503,7 +503,7 @@ const PerpsTPSLView: React.FC = () => {
503503
? formatPerpsFiat(displayLiquidationPrice, {
504504
ranges: PRICE_RANGES_UNIVERSAL,
505505
})
506-
: PERPS_CONSTANTS.FALLBACK_PRICE_DISPLAY}
506+
: PERPS_CONSTANTS.FallbackPriceDisplay}
507507
</Text>
508508
</View>
509509
</View>
@@ -531,7 +531,7 @@ const PerpsTPSLView: React.FC = () => {
531531

532532
{/* Percentage buttons */}
533533
<View style={styles.percentageButtonsContainer}>
534-
{TP_SL_VIEW_CONFIG.TAKE_PROFIT_ROE_PRESETS.map((percentage) => (
534+
{TP_SL_VIEW_CONFIG.TakeProfitRoePresets.map((percentage) => (
535535
<TouchableOpacity
536536
key={percentage}
537537
style={styles.percentageButton}
@@ -574,7 +574,7 @@ const PerpsTPSLView: React.FC = () => {
574574
value={takeProfitPrice}
575575
onChangeText={(text) => {
576576
const digitCount = (text.match(/\d/g) || []).length;
577-
if (digitCount > TP_SL_VIEW_CONFIG.MAX_INPUT_DIGITS) return;
577+
if (digitCount > TP_SL_VIEW_CONFIG.MaxInputDigits) return;
578578
handleTakeProfitPriceChange(text);
579579
}}
580580
placeholder={strings('perps.tpsl.trigger_price_placeholder')}
@@ -606,7 +606,7 @@ const PerpsTPSLView: React.FC = () => {
606606
value={formattedTakeProfitPercentage}
607607
onChangeText={(text) => {
608608
const digitCount = (text.match(/\d/g) || []).length;
609-
if (digitCount > TP_SL_VIEW_CONFIG.MAX_INPUT_DIGITS) return;
609+
if (digitCount > TP_SL_VIEW_CONFIG.MaxInputDigits) return;
610610
handleTakeProfitPercentageChange(text);
611611
}}
612612
placeholder={strings('perps.tpsl.profit_roe_placeholder')}
@@ -666,7 +666,7 @@ const PerpsTPSLView: React.FC = () => {
666666
color={TextColor.Alternative}
667667
style={styles.expectedPnLText}
668668
>
669-
{PERPS_CONSTANTS.FALLBACK_DATA_DISPLAY}
669+
{PERPS_CONSTANTS.FallbackDataDisplay}
670670
</Text>
671671
)}
672672

@@ -701,7 +701,7 @@ const PerpsTPSLView: React.FC = () => {
701701

702702
{/* Percentage buttons */}
703703
<View style={styles.percentageButtonsContainer}>
704-
{TP_SL_VIEW_CONFIG.STOP_LOSS_ROE_PRESETS.map((percentage) => (
704+
{TP_SL_VIEW_CONFIG.StopLossRoePresets.map((percentage) => (
705705
<TouchableOpacity
706706
key={percentage}
707707
style={styles.percentageButton}
@@ -744,7 +744,7 @@ const PerpsTPSLView: React.FC = () => {
744744
value={stopLossPrice}
745745
onChangeText={(text) => {
746746
const digitCount = (text.match(/\d/g) || []).length;
747-
if (digitCount > TP_SL_VIEW_CONFIG.MAX_INPUT_DIGITS) return;
747+
if (digitCount > TP_SL_VIEW_CONFIG.MaxInputDigits) return;
748748
handleStopLossPriceChange(text);
749749
}}
750750
placeholder={strings('perps.tpsl.trigger_price_placeholder')}
@@ -776,7 +776,7 @@ const PerpsTPSLView: React.FC = () => {
776776
value={formattedStopLossPercentage}
777777
onChangeText={(text) => {
778778
const digitCount = (text.match(/\d/g) || []).length;
779-
if (digitCount > TP_SL_VIEW_CONFIG.MAX_INPUT_DIGITS) return;
779+
if (digitCount > TP_SL_VIEW_CONFIG.MaxInputDigits) return;
780780
handleStopLossPercentageChange(text);
781781
}}
782782
placeholder={strings('perps.tpsl.loss_roe_placeholder')}
@@ -828,7 +828,7 @@ const PerpsTPSLView: React.FC = () => {
828828
color={TextColor.Alternative}
829829
style={styles.expectedPnLText}
830830
>
831-
{PERPS_CONSTANTS.FALLBACK_DATA_DISPLAY}
831+
{PERPS_CONSTANTS.FallbackDataDisplay}
832832
</Text>
833833
)}
834834

@@ -864,8 +864,8 @@ const PerpsTPSLView: React.FC = () => {
864864
return formattedStopLossPercentage;
865865
})()}
866866
onChange={handleKeypadChange}
867-
currency={TP_SL_VIEW_CONFIG.KEYPAD_CURRENCY_CODE}
868-
decimals={TP_SL_VIEW_CONFIG.KEYPAD_DECIMALS}
867+
currency={TP_SL_VIEW_CONFIG.KeypadCurrencyCode}
868+
decimals={TP_SL_VIEW_CONFIG.KeypadDecimals}
869869
/>
870870
</View>
871871
</>

0 commit comments

Comments
 (0)