Skip to content

Commit 6aacce5

Browse files
committed
Use a $50 USD default fiat purchase for light accounts
1 parent 1e9c10a commit 6aacce5

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- added: Ethereum (Holesky) staking via Kiln
1212
- added: dRPC api key option for EVM chains
1313
- added: Handle KYC error responses from Bity
14+
- changed: Use a $50 USD default fiat purchase amount for light accounts
1415
- changed: Enable Bitpay payments for FIO names and domains
1516
- changed: Disable Home scene swap and FIO cards if configured
1617
- changed: Allow some chains to be disabled in env.json

src/plugins/gui/amountQuotePlugin.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ type InternalFiatPluginEnterAmountParams = FiatPluginEnterAmountParams & {
5050
const providerFactories = [banxaProvider, bityProvider, kadoProvider, moonpayProvider, mtpelerinProvider, paybisProvider, simplexProvider]
5151

5252
const DEFAULT_FIAT_AMOUNT = '500'
53+
const DEFAULT_FIAT_AMOUNT_LIGHT_ACCOUNT = '50'
5354

5455
/**
5556
* Amount that we will attempt to get a quote for if the user presses the MAX button
@@ -234,21 +235,23 @@ export const amountQuoteFiatPlugin: FiatPluginFactory = async (params: FiatPlugi
234235

235236
logEvent(isBuy ? 'Buy_Quote' : 'Sell_Quote')
236237

237-
// Pick a default fiat amount that is roughly equal to DEFAULT_FIAT_AMOUNT
238+
// Pick a default fiat amount in the foreign fiat amount that is roughly
239+
// equal to the default USD fiat amount
238240
let initialValue1: string | undefined
241+
const startingFiatAmount = isLightAccount ? DEFAULT_FIAT_AMOUNT_LIGHT_ACCOUNT : defaultFiatAmount ?? DEFAULT_FIAT_AMOUNT
239242
if (displayFiatCurrencyCode !== 'USD' && defaultFiatAmount == null) {
240243
const isoFiatCurrencyCode = `iso:${displayFiatCurrencyCode}`
241244
const isoNow = new Date().toISOString()
242245
const ratePair = `${isoFiatCurrencyCode}_iso:USD`
243246
const rate = await getHistoricalRate(ratePair, isoNow)
244-
initialValue1 = div(DEFAULT_FIAT_AMOUNT, String(rate), DECIMAL_PRECISION)
247+
initialValue1 = div(startingFiatAmount, String(rate), DECIMAL_PRECISION)
245248
// Round out a decimals
246249
initialValue1 = round(initialValue1, 0)
247250

248251
// Only leave the first decimal
249252
initialValue1 = round(initialValue1, initialValue1.length - 1)
250253
} else {
251-
initialValue1 = requireCrypto ? undefined : defaultFiatAmount ?? DEFAULT_FIAT_AMOUNT
254+
initialValue1 = requireCrypto ? undefined : startingFiatAmount
252255
}
253256

254257
// Navigate to scene to have user enter amount

0 commit comments

Comments
 (0)