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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- changed: Refresh the buy, sell, sort, scan-QR and FIO names icons to the updated design.
- changed: Display "MoonPay" instead of "Moonpay" wherever the partner name appears in the app.
- changed: Use a custom chart icon for the side menu Markets row, so it matches the rest of the menu.
- changed: The buy/sell crypto amount field now shows as many decimals as the asset itself supports, up to nine, instead of a fixed six. MoonPay raises its buy-flow precision to eight decimals for BTC and nine for ETH and SOL on September 1, 2026, which the old limit would have truncated.
- changed: Use the UI4 warning card for the Reveal Raw Keys and Reveal Master Private Key password confirmation warnings.
- changed: Tron resource staking now describes its claim action as reclaiming your own TRX, instead of claiming a reward.
- changed: Deep links now wait only for the account state they actually use, so a link that just opens a scene, such as the buy/sell entry, follows immediately after login instead of waiting for every wallet to finish loading.
Expand Down
24 changes: 23 additions & 1 deletion src/components/scenes/RampCreateScene.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ import { EdgeText } from '../themed/EdgeText'
import { FilledTextInput } from '../themed/FilledTextInput'
import { RampRegionSelect } from './RampCreateScene/RampRegionSelect'

/**
* Upper bound on the decimals the crypto amount field renders, for assets whose
* own precision goes beyond what a ramp quote can express. See
* `cryptoMaxDecimals`.
*/
const MAX_CRYPTO_ENTRY_DECIMALS = 9

export interface RampCreateParams {
forcedWalletResult?: WalletListWalletResult
regionCode?: string
Expand Down Expand Up @@ -592,6 +599,21 @@ export const RampCreateScene: React.FC<Props> = (props: Props) => {
denomination
])

// How many decimals the crypto field renders. Providers quote each asset at
// its own precision and change it over time (Moonpay moves BTC 5 -> 8 and
// ETH/SOL to 9 decimals on the buy flow in September 2026), so this follows
// the asset instead of assuming a count. The 9-decimal ceiling keeps the
// field readable for high-precision assets such as ETH, whose 18 decimals
// would expose the rounding noise of the float exchange rate that
// `displayCryptoAmount` divides by while the user types a fiat amount.
const cryptoMaxDecimals = React.useMemo(() => {
if (denomination == null) return MAX_CRYPTO_ENTRY_DECIMALS
return Math.min(
mulToPrecision(denomination.multiplier),
MAX_CRYPTO_ENTRY_DECIMALS
)
}, [denomination])

// Log the quote event only when the scene is focused
useFocusEffect(() => {
dispatch(logEvent(direction === 'buy' ? 'Buy_Quote' : 'Sell_Quote'))
Expand Down Expand Up @@ -1091,7 +1113,7 @@ export const RampCreateScene: React.FC<Props> = (props: Props) => {
placeholder={cryptoAmountPlaceholder}
keyboardType="decimal-pad"
numeric
maxDecimals={6}
maxDecimals={cryptoMaxDecimals}
returnKeyType="done"
showSpinner={isFetchingQuotes && lastUsedInput === 'fiat'}
disabled={cryptoInputDisabled}
Expand Down
Loading