diff --git a/src/lib/stores/exchangeRate.ts b/src/lib/stores/exchangeRate.ts index 686bc7e49..be563f659 100644 --- a/src/lib/stores/exchangeRate.ts +++ b/src/lib/stores/exchangeRate.ts @@ -10,7 +10,14 @@ export const defaultExchangeRate = { CDF: 96_755_481, XOF: 22_621_258, XAF: 22_621_258, - SAT: SATOSHIS_PER_BTC + SAT: SATOSHIS_PER_BTC, + KES: 4_200_000, + UGX: 110_000_000, + GHS: 350_000, + NGN: 27_000_000, + TZS: 75_000_000, + MAD: 320_000, + CZK: 700_000 }; export type ExchangeRate = typeof defaultExchangeRate; diff --git a/src/lib/types/Currency.ts b/src/lib/types/Currency.ts index a20755446..6b78d8d15 100644 --- a/src/lib/types/Currency.ts +++ b/src/lib/types/Currency.ts @@ -1,6 +1,23 @@ import { error } from '@sveltejs/kit'; -export const CURRENCIES = ['BTC', 'CHF', 'EUR', 'USD', 'ZAR', 'SAT', 'XOF', 'XAF', 'CDF'] as const; +export const CURRENCIES = [ + 'BTC', + 'CHF', + 'EUR', + 'USD', + 'ZAR', + 'SAT', + 'XOF', + 'XAF', + 'CDF', + 'KES', + 'UGX', + 'GHS', + 'NGN', + 'TZS', + 'MAD', + 'CZK' +] as const; export type Currency = (typeof CURRENCIES)[number]; export const SATOSHIS_PER_BTC = 100_000_000; @@ -14,7 +31,14 @@ export const FRACTION_DIGITS_PER_CURRENCY = Object.freeze({ XOF: 2, XAF: 2, CDF: 2, - SAT: 0 + SAT: 0, + KES: 2, + UGX: 2, + GHS: 2, + NGN: 2, + TZS: 2, + MAD: 2, + CZK: 2 }) satisfies Record; export const CURRENCY_UNIT = Object.freeze({ @@ -26,7 +50,14 @@ export const CURRENCY_UNIT = Object.freeze({ XOF: Math.pow(10, -FRACTION_DIGITS_PER_CURRENCY.XOF), XAF: Math.pow(10, -FRACTION_DIGITS_PER_CURRENCY.XAF), CDF: Math.pow(10, -FRACTION_DIGITS_PER_CURRENCY.CDF), - SAT: Math.pow(10, -FRACTION_DIGITS_PER_CURRENCY.SAT) + SAT: Math.pow(10, -FRACTION_DIGITS_PER_CURRENCY.SAT), + KES: Math.pow(10, -FRACTION_DIGITS_PER_CURRENCY.KES), + UGX: Math.pow(10, -FRACTION_DIGITS_PER_CURRENCY.UGX), + GHS: Math.pow(10, -FRACTION_DIGITS_PER_CURRENCY.GHS), + NGN: Math.pow(10, -FRACTION_DIGITS_PER_CURRENCY.NGN), + TZS: Math.pow(10, -FRACTION_DIGITS_PER_CURRENCY.TZS), + MAD: Math.pow(10, -FRACTION_DIGITS_PER_CURRENCY.MAD), + CZK: Math.pow(10, -FRACTION_DIGITS_PER_CURRENCY.CZK) }) satisfies Record; export function parsePriceAmount(amount: string, currency: Currency): number {