diff --git a/eslint.config.mjs b/eslint.config.mjs index dbf31d72619..9db0b0ce7c1 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -336,7 +336,7 @@ export default [ 'src/components/text/TitleText.tsx', 'src/components/themed/Alert.tsx', - 'src/components/themed/BuyCrypto.tsx', + 'src/components/themed/CreateWalletSelectCryptoRow.tsx', 'src/components/themed/DividerLine.tsx', 'src/components/themed/EdgeProviderComponent.tsx', @@ -395,7 +395,7 @@ export default [ 'src/components/tiles/LtvRatioTile.tsx', 'src/components/tiles/PercentageChangeArrowTile.tsx', 'src/components/tiles/TotalDebtCollateralTile.tsx', - 'src/constants/WalletAndCurrencyConstants.ts', + 'src/controllers/action-queue/ActionQueueStore.ts', 'src/controllers/action-queue/cleaners.ts', 'src/controllers/action-queue/push.ts', diff --git a/src/components/themed/BuyCrypto.tsx b/src/components/themed/BuyCrypto.tsx index ee94d925d79..87c78f2911a 100644 --- a/src/components/themed/BuyCrypto.tsx +++ b/src/components/themed/BuyCrypto.tsx @@ -55,6 +55,14 @@ export const BuyCrypto: React.FC = (props: Props) => { }) const { displayName, pluginId } = wallet.currencyInfo + const { highPrecisionSyncRatioDisplay = false } = + SPECIAL_CURRENCY_INFO[pluginId] + const syncRatioPrecisionOpts = highPrecisionSyncRatioDisplay + ? { + minPrecision: 5, + maxPrecision: 5 + } + : undefined return ( <> @@ -87,7 +95,7 @@ export const BuyCrypto: React.FC = (props: Props) => { {sprintf( lstrings.percent_complete_1s, - toPercentString(syncRatio) + toPercentString(syncRatio, syncRatioPrecisionOpts) )} diff --git a/src/constants/WalletAndCurrencyConstants.ts b/src/constants/WalletAndCurrencyConstants.ts index 3f4eb2d0497..da9ff2af33d 100644 --- a/src/constants/WalletAndCurrencyConstants.ts +++ b/src/constants/WalletAndCurrencyConstants.ts @@ -167,6 +167,7 @@ interface SpecialCurrencyInfo { noChangeMiningFee?: boolean noMaxSpend?: boolean keysOnlyMode?: boolean + highPrecisionSyncRatioDisplay?: boolean /** * This disables the transaction list for the wallet. * (Default: false) @@ -200,7 +201,7 @@ interface SpecialCurrencyInfo { export const getSpecialCurrencyInfo = ( pluginId: string ): SpecialCurrencyInfo => { - if (SPECIAL_CURRENCY_INFO[pluginId]) { + if (SPECIAL_CURRENCY_INFO[pluginId] !== undefined) { return SPECIAL_CURRENCY_INFO[pluginId] } else { return { @@ -832,6 +833,7 @@ export const SPECIAL_CURRENCY_INFO: Record = { noChangeMiningFee: true, isImportKeySupported: true, keysOnlyMode: Platform.OS === 'android' && Platform.constants.Version < 28, + highPrecisionSyncRatioDisplay: true, importKeyOptions: [ { optionName: 'birthdayHeight', @@ -973,7 +975,7 @@ export const USD_FIAT = 'iso:USD' /** * Get the fiat symbol from an iso:[fiat] OR fiat currency code */ -export const getFiatSymbol = (isoOrFiatCurrencyCode: string) => { +export const getFiatSymbol = (isoOrFiatCurrencyCode: string): string => { if (typeof isoOrFiatCurrencyCode !== 'string') return '' const codeWithoutIso = removeIsoPrefix(isoOrFiatCurrencyCode) const out = FIAT_CODES_SYMBOLS[codeWithoutIso.toUpperCase()]