From 980172b77b8b4a3ca885be6d71fb842e71612421 Mon Sep 17 00:00:00 2001 From: Terence Ng Date: Thu, 3 Oct 2024 17:19:15 +0800 Subject: [PATCH] add new fiat currencies (#603) * add new currencies * add new flags and standardize to iso flag code * use latest core * use hook * rename useCoinRates * use latest core * use correct core --- .../confirmBtcTransaction/itemRow/amount.tsx | 4 +- .../sections/feeSection.tsx | 4 +- .../confirmStxTransactionComponent/index.tsx | 4 +- .../components/recipientComponent/index.tsx | 4 +- src/app/components/speedUpTransaction/btc.tsx | 4 +- src/app/components/speedUpTransaction/stx.tsx | 4 +- src/app/components/tokenTile/index.tsx | 4 +- .../transactionSetting/editBtcFee.tsx | 4 +- .../transactionSetting/editStxFee.tsx | 4 +- src/app/components/transferFeeView/index.tsx | 4 +- src/app/hooks/queries/useAccountBalance.ts | 4 +- ...eCoinRates.ts => useSupportedCoinRates.ts} | 31 +- src/app/screens/coinDashboard/coinHeader.tsx | 4 +- .../screens/confirmBrc20Transaction/index.tsx | 4 +- src/app/screens/createInscription/index.tsx | 4 +- src/app/screens/home/balanceCard/index.tsx | 4 +- src/app/screens/home/index.tsx | 4 +- src/app/screens/listRune/index.tsx | 4 +- src/app/screens/listRune/setRunePriceItem.tsx | 4 +- src/app/screens/sendBtc/amountSelector.tsx | 4 +- src/app/screens/sendRune/amountSelector.tsx | 4 +- .../sendStx/steps/Step2SelectAmount.tsx | 4 +- src/app/screens/sendStx/stxAmountSelector.tsx | 4 +- .../preferences/fiatCurrency/currencyRow.tsx | 2 +- .../speedUpTransaction/customFee/index.tsx | 4 +- .../tokenFromBottomSheet/useFromTokens.ts | 4 +- src/app/screens/swap/index.tsx | 4 +- src/app/screens/swap/quoteSummary/index.tsx | 4 +- src/app/screens/swap/quotesModal/index.tsx | 4 +- src/app/screens/swap/utxoSelection/index.tsx | 4 +- src/app/ui-components/btcAmountSelector.tsx | 4 +- src/app/utils/currency.ts | 83 +++- .../settings/currencies/{aud.svg => aus.svg} | 0 .../settings/currencies/{brl.svg => bra.svg} | 0 .../settings/currencies/{cad.svg => can.svg} | 0 src/assets/img/settings/currencies/che.svg | 12 + .../settings/currencies/{cny.svg => chn.svg} | 0 .../settings/currencies/{eur.svg => eu.svg} | 0 .../settings/currencies/{gbp.svg => gbr.svg} | 0 .../settings/currencies/{hkd.svg => hkg.svg} | 0 src/assets/img/settings/currencies/hun.svg | 12 + src/assets/img/settings/currencies/idn.svg | 11 + src/assets/img/settings/currencies/ind.svg | 17 + .../settings/currencies/{jpy.svg => jpn.svg} | 0 .../settings/currencies/{krw.svg => kor.svg} | 0 src/assets/img/settings/currencies/mex.svg | 467 ++++++++++++++++++ src/assets/img/settings/currencies/mys.svg | 14 + src/assets/img/settings/currencies/nga.svg | 11 + src/assets/img/settings/currencies/pak.svg | 13 + src/assets/img/settings/currencies/phl.svg | 13 + src/assets/img/settings/currencies/pol.svg | 11 + .../settings/currencies/{rub.svg => rus.svg} | 0 .../settings/currencies/{sgd.svg => sgp.svg} | 0 src/assets/img/settings/currencies/tha.svg | 12 + src/assets/img/settings/currencies/tur.svg | 13 + src/assets/img/settings/currencies/twn.svg | 34 ++ .../settings/currencies/{usd.svg => usa.svg} | 0 src/assets/img/settings/currencies/vnm.svg | 11 + src/assets/img/settings/currencies/zaf.svg | 15 + 59 files changed, 794 insertions(+), 104 deletions(-) rename src/app/hooks/queries/{useCoinRates.ts => useSupportedCoinRates.ts} (54%) rename src/assets/img/settings/currencies/{aud.svg => aus.svg} (100%) rename src/assets/img/settings/currencies/{brl.svg => bra.svg} (100%) rename src/assets/img/settings/currencies/{cad.svg => can.svg} (100%) create mode 100644 src/assets/img/settings/currencies/che.svg rename src/assets/img/settings/currencies/{cny.svg => chn.svg} (100%) rename src/assets/img/settings/currencies/{eur.svg => eu.svg} (100%) rename src/assets/img/settings/currencies/{gbp.svg => gbr.svg} (100%) rename src/assets/img/settings/currencies/{hkd.svg => hkg.svg} (100%) create mode 100644 src/assets/img/settings/currencies/hun.svg create mode 100644 src/assets/img/settings/currencies/idn.svg create mode 100644 src/assets/img/settings/currencies/ind.svg rename src/assets/img/settings/currencies/{jpy.svg => jpn.svg} (100%) rename src/assets/img/settings/currencies/{krw.svg => kor.svg} (100%) create mode 100644 src/assets/img/settings/currencies/mex.svg create mode 100644 src/assets/img/settings/currencies/mys.svg create mode 100644 src/assets/img/settings/currencies/nga.svg create mode 100644 src/assets/img/settings/currencies/pak.svg create mode 100644 src/assets/img/settings/currencies/phl.svg create mode 100644 src/assets/img/settings/currencies/pol.svg rename src/assets/img/settings/currencies/{rub.svg => rus.svg} (100%) rename src/assets/img/settings/currencies/{sgd.svg => sgp.svg} (100%) create mode 100644 src/assets/img/settings/currencies/tha.svg create mode 100644 src/assets/img/settings/currencies/tur.svg create mode 100644 src/assets/img/settings/currencies/twn.svg rename src/assets/img/settings/currencies/{usd.svg => usa.svg} (100%) create mode 100644 src/assets/img/settings/currencies/vnm.svg create mode 100644 src/assets/img/settings/currencies/zaf.svg diff --git a/src/app/components/confirmBtcTransaction/itemRow/amount.tsx b/src/app/components/confirmBtcTransaction/itemRow/amount.tsx index 932ab340c..6a50349d8 100644 --- a/src/app/components/confirmBtcTransaction/itemRow/amount.tsx +++ b/src/app/components/confirmBtcTransaction/itemRow/amount.tsx @@ -1,6 +1,6 @@ import FiatAmountText from '@components/fiatAmountText'; import TokenImage from '@components/tokenImage'; -import useCoinRates from '@hooks/queries/useCoinRates'; +import useSupportedCoinRates from '@hooks/queries/useSupportedCoinRates'; import useWalletSelector from '@hooks/useWalletSelector'; import { getBtcFiatEquivalent, satsToBtc } from '@secretkeylabs/xverse-core'; import { StyledP } from '@ui-library/common.styled'; @@ -50,7 +50,7 @@ type Props = { export default function Amount({ amount }: Props) { const { fiatCurrency } = useWalletSelector(); - const { btcFiatRate } = useCoinRates(); + const { btcFiatRate } = useSupportedCoinRates(); const { t } = useTranslation('translation'); if (!amount) return null; diff --git a/src/app/components/confirmBtcTransaction/sections/feeSection.tsx b/src/app/components/confirmBtcTransaction/sections/feeSection.tsx index a23b65251..d3f42110e 100644 --- a/src/app/components/confirmBtcTransaction/sections/feeSection.tsx +++ b/src/app/components/confirmBtcTransaction/sections/feeSection.tsx @@ -1,5 +1,5 @@ import TransferFeeView from '@components/transferFeeView'; -import useCoinRates from '@hooks/queries/useCoinRates'; +import useSupportedCoinRates from '@hooks/queries/useSupportedCoinRates'; import useBtcFeeRate from '@hooks/useBtcFeeRate'; import useWalletSelector from '@hooks/useWalletSelector'; import { @@ -55,7 +55,7 @@ function FeeSection({ const { t } = useTranslation('translation', { keyPrefix: 'CONFIRM_TRANSACTION' }); const { t: tUnits } = useTranslation('translation', { keyPrefix: 'UNITS' }); const { data: recommendedFees } = useBtcFeeRate(); - const { btcFiatRate } = useCoinRates(); + const { btcFiatRate } = useSupportedCoinRates(); const { extractedTxSummary } = useTxSummaryContext(); diff --git a/src/app/components/confirmStxTransactionComponent/index.tsx b/src/app/components/confirmStxTransactionComponent/index.tsx index 644484171..f69a1c299 100644 --- a/src/app/components/confirmStxTransactionComponent/index.tsx +++ b/src/app/components/confirmStxTransactionComponent/index.tsx @@ -5,8 +5,8 @@ import BottomModal from '@components/bottomModal'; import ActionButton from '@components/button'; import LedgerConnectionView from '@components/ledger/connectLedgerView'; import TransactionSettingAlert from '@components/transactionSetting'; -import useCoinRates from '@hooks/queries/useCoinRates'; import useStxWalletData from '@hooks/queries/useStxWalletData'; +import useSupportedCoinRates from '@hooks/queries/useSupportedCoinRates'; import useNetworkSelector from '@hooks/useNetwork'; import useSeedVault from '@hooks/useSeedVault'; import useSelectedAccount from '@hooks/useSelectedAccount'; @@ -96,7 +96,7 @@ function ConfirmStxTransactionComponent({ keyPrefix: 'TRANSACTION_SETTING', }); const selectedNetwork = useNetworkSelector(); - const { stxBtcRate, btcFiatRate } = useCoinRates(); + const { stxBtcRate, btcFiatRate } = useSupportedCoinRates(); const { data: stxData } = useStxWalletData(); const { getSeed } = useSeedVault(); const [showFeeSettings, setShowFeeSettings] = useState(false); diff --git a/src/app/components/recipientComponent/index.tsx b/src/app/components/recipientComponent/index.tsx index 65c101640..5a14ef5ed 100644 --- a/src/app/components/recipientComponent/index.tsx +++ b/src/app/components/recipientComponent/index.tsx @@ -3,7 +3,7 @@ import WalletIcon from '@assets/img/transactions/wallet.svg'; import { StyledFiatAmountText } from '@components/fiatAmountText'; import TokenImage from '@components/tokenImage'; import TransferDetailView from '@components/transferDetailView'; -import useCoinRates from '@hooks/queries/useCoinRates'; +import useSupportedCoinRates from '@hooks/queries/useSupportedCoinRates'; import useSelectedAccount from '@hooks/useSelectedAccount'; import useWalletSelector from '@hooks/useWalletSelector'; import { CubeTransparent } from '@phosphor-icons/react'; @@ -155,7 +155,7 @@ function RecipientComponent({ const [fiatAmount, setFiatAmount] = useState('0'); const { ordinalsAddress } = useSelectedAccount(); const { fiatCurrency } = useWalletSelector(); - const { btcFiatRate, stxBtcRate } = useCoinRates(); + const { btcFiatRate, stxBtcRate } = useSupportedCoinRates(); useEffect(() => { setFiatAmount( diff --git a/src/app/components/speedUpTransaction/btc.tsx b/src/app/components/speedUpTransaction/btc.tsx index f6d69a7ac..59d266a5b 100644 --- a/src/app/components/speedUpTransaction/btc.tsx +++ b/src/app/components/speedUpTransaction/btc.tsx @@ -1,5 +1,5 @@ import FiatAmountText from '@components/fiatAmountText'; -import useCoinRates from '@hooks/queries/useCoinRates'; +import useSupportedCoinRates from '@hooks/queries/useSupportedCoinRates'; import useWalletSelector from '@hooks/useWalletSelector'; import { getBtcFiatEquivalent } from '@secretkeylabs/xverse-core'; import { EMPTY_LABEL } from '@utils/constants'; @@ -74,7 +74,7 @@ function SpeedUpBtcTransaction({ const { t } = useTranslation('translation', { keyPrefix: 'SPEED_UP_TRANSACTION' }); const { t: tUnits } = useTranslation('translation', { keyPrefix: 'UNITS' }); const { fiatCurrency } = useWalletSelector(); - const { btcFiatRate } = useCoinRates(); + const { btcFiatRate } = useSupportedCoinRates(); const theme = useTheme(); diff --git a/src/app/components/speedUpTransaction/stx.tsx b/src/app/components/speedUpTransaction/stx.tsx index 69a6d44a8..23d070dff 100644 --- a/src/app/components/speedUpTransaction/stx.tsx +++ b/src/app/components/speedUpTransaction/stx.tsx @@ -1,5 +1,5 @@ import FiatAmountText from '@components/fiatAmountText'; -import useCoinRates from '@hooks/queries/useCoinRates'; +import useSupportedCoinRates from '@hooks/queries/useSupportedCoinRates'; import useWalletSelector from '@hooks/useWalletSelector'; import { getStxFiatEquivalent, stxToMicrostacks } from '@secretkeylabs/xverse-core'; import { EMPTY_LABEL } from '@utils/constants'; @@ -73,7 +73,7 @@ function SpeedUpStxTransaction({ }: Props) { const { t } = useTranslation('translation', { keyPrefix: 'SPEED_UP_TRANSACTION' }); const { fiatCurrency } = useWalletSelector(); - const { btcFiatRate, stxBtcRate } = useCoinRates(); + const { btcFiatRate, stxBtcRate } = useSupportedCoinRates(); const theme = useTheme(); return ( diff --git a/src/app/components/tokenTile/index.tsx b/src/app/components/tokenTile/index.tsx index 284152719..3e4b452e6 100644 --- a/src/app/components/tokenTile/index.tsx +++ b/src/app/components/tokenTile/index.tsx @@ -2,8 +2,8 @@ import { BetterBarLoader } from '@components/barLoader'; import { StyledFiatAmountText } from '@components/fiatAmountText'; import TokenImage from '@components/tokenImage'; import useBtcWalletData from '@hooks/queries/useBtcWalletData'; -import useCoinRates from '@hooks/queries/useCoinRates'; import useStxWalletData from '@hooks/queries/useStxWalletData'; +import useSupportedCoinRates from '@hooks/queries/useSupportedCoinRates'; import useWalletSelector from '@hooks/useWalletSelector'; import { getFiatEquivalent, type FungibleToken } from '@secretkeylabs/xverse-core'; import type { CurrencyTypes } from '@utils/constants'; @@ -119,7 +119,7 @@ function TokenTile({ hideBalance = false, }: Props) { const { fiatCurrency } = useWalletSelector(); - const { btcFiatRate, stxBtcRate } = useCoinRates(); + const { btcFiatRate, stxBtcRate } = useSupportedCoinRates(); const { data: stxData } = useStxWalletData(); const { data: btcBalance } = useBtcWalletData(); diff --git a/src/app/components/transactionSetting/editBtcFee.tsx b/src/app/components/transactionSetting/editBtcFee.tsx index eb012a6e1..f2e04dae2 100644 --- a/src/app/components/transactionSetting/editBtcFee.tsx +++ b/src/app/components/transactionSetting/editBtcFee.tsx @@ -1,6 +1,6 @@ import FiatAmountText from '@components/fiatAmountText'; import useBtcClient from '@hooks/apiClients/useBtcClient'; -import useCoinRates from '@hooks/queries/useCoinRates'; +import useSupportedCoinRates from '@hooks/queries/useSupportedCoinRates'; import useBtcFees from '@hooks/useBtcFees'; import useDebounce from '@hooks/useDebounce'; import useOrdinalsByAddress from '@hooks/useOrdinalsByAddress'; @@ -189,7 +189,7 @@ function EditBtcFee({ const selectedAccount = useSelectedAccount(); const { btcAddress, ordinalsAddress } = selectedAccount; const { network, fiatCurrency } = useWalletSelector(); - const { btcFiatRate } = useCoinRates(); + const { btcFiatRate } = useSupportedCoinRates(); const [totalFee, setTotalFee] = useState(fee); const [feeRateInput, setFeeRateInput] = useState(feeRate?.toString() ?? ''); const inputRef = useRef(null); diff --git a/src/app/components/transactionSetting/editStxFee.tsx b/src/app/components/transactionSetting/editStxFee.tsx index 117c68e9e..4cd551c8c 100644 --- a/src/app/components/transactionSetting/editStxFee.tsx +++ b/src/app/components/transactionSetting/editStxFee.tsx @@ -1,5 +1,5 @@ import FiatAmountText from '@components/fiatAmountText'; -import useCoinRates from '@hooks/queries/useCoinRates'; +import useSupportedCoinRates from '@hooks/queries/useSupportedCoinRates'; import useWalletSelector from '@hooks/useWalletSelector'; import { getStxFiatEquivalent, stxToMicrostacks } from '@secretkeylabs/xverse-core'; import BigNumber from 'bignumber.js'; @@ -129,7 +129,7 @@ function EditStxFee({ }: Props) { const { t } = useTranslation('translation'); const { fiatCurrency } = useWalletSelector(); - const { btcFiatRate, stxBtcRate } = useCoinRates(); + const { btcFiatRate, stxBtcRate } = useSupportedCoinRates(); const [totalFee, setTotalFee] = useState(fee); const [feeRateInput, setFeeRateInput] = useState(feeRate?.toString() ?? ''); const inputRef = useRef(null); diff --git a/src/app/components/transferFeeView/index.tsx b/src/app/components/transferFeeView/index.tsx index 2dffa4b04..0f0c04a00 100644 --- a/src/app/components/transferFeeView/index.tsx +++ b/src/app/components/transferFeeView/index.tsx @@ -1,6 +1,6 @@ import AmountWithInscriptionSatribute from '@components/confirmBtcTransaction/itemRow/amountWithInscriptionSatribute'; import FiatAmountText from '@components/fiatAmountText'; -import useCoinRates from '@hooks/queries/useCoinRates'; +import useSupportedCoinRates from '@hooks/queries/useSupportedCoinRates'; import useWalletSelector from '@hooks/useWalletSelector'; import { btcTransaction, @@ -71,7 +71,7 @@ function TransferFeeView({ const { t: tUnits } = useTranslation('translation', { keyPrefix: 'UNITS' }); const { fiatCurrency } = useWalletSelector(); - const { btcFiatRate, stxBtcRate } = useCoinRates(); + const { btcFiatRate, stxBtcRate } = useSupportedCoinRates(); return ( diff --git a/src/app/hooks/queries/useAccountBalance.ts b/src/app/hooks/queries/useAccountBalance.ts index 93231e953..9baa4b6ee 100644 --- a/src/app/hooks/queries/useAccountBalance.ts +++ b/src/app/hooks/queries/useAccountBalance.ts @@ -1,6 +1,6 @@ import useBtcClient from '@hooks/apiClients/useBtcClient'; import useRunesApi from '@hooks/apiClients/useRunesApi'; -import useCoinRates from '@hooks/queries/useCoinRates'; +import useSupportedCoinRates from '@hooks/queries/useSupportedCoinRates'; import useNetworkSelector from '@hooks/useNetwork'; import useWalletSelector from '@hooks/useWalletSelector'; import { @@ -31,7 +31,7 @@ const useAccountBalance = () => { sip10ManageTokens, runesManageTokens, } = useWalletSelector(); - const { btcFiatRate, stxBtcRate } = useCoinRates(); + const { btcFiatRate, stxBtcRate } = useSupportedCoinRates(); const runesApi = useRunesApi(); const dispatch = useDispatch(); const queue = useRef([]); diff --git a/src/app/hooks/queries/useCoinRates.ts b/src/app/hooks/queries/useSupportedCoinRates.ts similarity index 54% rename from src/app/hooks/queries/useCoinRates.ts rename to src/app/hooks/queries/useSupportedCoinRates.ts index c837035f6..20b43ba8a 100644 --- a/src/app/hooks/queries/useCoinRates.ts +++ b/src/app/hooks/queries/useSupportedCoinRates.ts @@ -1,27 +1,22 @@ +import useXverseApi from '@hooks/apiClients/useXverseApi'; import useWalletSelector from '@hooks/useWalletSelector'; -import { - fetchBtcToCurrencyRate, - fetchStxToBtcRate, - type NetworkType, - type SupportedCurrency, -} from '@secretkeylabs/xverse-core'; +import { type SupportedCurrency } from '@secretkeylabs/xverse-core'; import { useQuery } from '@tanstack/react-query'; -const useGetRates = (fiatCurrency: SupportedCurrency, networkType: NetworkType) => { +const useGetSupportedRates = (fiatCurrency: SupportedCurrency) => { + const xverseApi = useXverseApi(); const fetchCoinRates = async () => { try { - const btcFiatRate = await fetchBtcToCurrencyRate(networkType, { + const btcFiatRate = await xverseApi.fetchBtcToCurrencyRate({ fiatCurrency, }); - const btcUsdRate = fiatCurrency === 'USD' ? btcFiatRate - : await fetchBtcToCurrencyRate(networkType, { + : await xverseApi.fetchBtcToCurrencyRate({ fiatCurrency: 'USD' as SupportedCurrency, }); - - const stxBtcRate = await fetchStxToBtcRate(networkType); + const stxBtcRate = await xverseApi.fetchStxToBtcRate(); return { stxBtcRate, btcFiatRate, btcUsdRate }; } catch (e: any) { return Promise.reject(e); @@ -29,17 +24,15 @@ const useGetRates = (fiatCurrency: SupportedCurrency, networkType: NetworkType) }; return useQuery({ - queryKey: ['coin_rates', fiatCurrency, networkType], + queryKey: ['coin_rates', fiatCurrency], queryFn: fetchCoinRates, staleTime: 5 * 60 * 1000, // 5 min }); }; -const useCoinRates = () => { - const { fiatCurrency, network } = useWalletSelector(); - - const { data } = useGetRates(fiatCurrency, network.type); - +const useSupportedCoinRates = () => { + const { fiatCurrency } = useWalletSelector(); + const { data } = useGetSupportedRates(fiatCurrency); const stxBtcRate = data?.stxBtcRate.toString() || '0'; const btcFiatRate = data?.btcFiatRate.toString() || '0'; const btcUsdRate = data?.btcUsdRate?.toString() || '0'; @@ -47,4 +40,4 @@ const useCoinRates = () => { return { stxBtcRate, btcFiatRate, btcUsdRate }; }; -export default useCoinRates; +export default useSupportedCoinRates; diff --git a/src/app/screens/coinDashboard/coinHeader.tsx b/src/app/screens/coinDashboard/coinHeader.tsx index e74337d8b..416f46845 100644 --- a/src/app/screens/coinDashboard/coinHeader.tsx +++ b/src/app/screens/coinDashboard/coinHeader.tsx @@ -9,8 +9,8 @@ import ActionButton from '@components/button'; import SmallActionButton from '@components/smallActionButton'; import TokenImage from '@components/tokenImage'; import useBtcWalletData from '@hooks/queries/useBtcWalletData'; -import useCoinRates from '@hooks/queries/useCoinRates'; import useStxWalletData from '@hooks/queries/useStxWalletData'; +import useSupportedCoinRates from '@hooks/queries/useSupportedCoinRates'; import useHasFeature from '@hooks/useHasFeature'; import useSelectedAccount from '@hooks/useSelectedAccount'; import useWalletSelector from '@hooks/useWalletSelector'; @@ -61,7 +61,7 @@ export default function CoinHeader({ currency, fungibleToken }: Props) { const { fiatCurrency, network, selectedAccountType } = useWalletSelector(); const { data: btcBalance } = useBtcWalletData(); const { data: stxData } = useStxWalletData(); - const { btcFiatRate, stxBtcRate } = useCoinRates(); + const { btcFiatRate, stxBtcRate } = useSupportedCoinRates(); const navigate = useNavigate(); const { t } = useTranslation('translation', { keyPrefix: 'COIN_DASHBOARD_SCREEN' }); const [openReceiveModal, setOpenReceiveModal] = useState(false); diff --git a/src/app/screens/confirmBrc20Transaction/index.tsx b/src/app/screens/confirmBrc20Transaction/index.tsx index 1439d3ba5..3fe59c373 100644 --- a/src/app/screens/confirmBrc20Transaction/index.tsx +++ b/src/app/screens/confirmBrc20Transaction/index.tsx @@ -2,7 +2,7 @@ import InfoContainer from '@components/infoContainer'; import BottomBar from '@components/tabBar'; import TopRow from '@components/topRow'; import TransactionDetailComponent from '@components/transactionDetailComponent'; -import useCoinRates from '@hooks/queries/useCoinRates'; +import useSupportedCoinRates from '@hooks/queries/useSupportedCoinRates'; import useBtcFeeRate from '@hooks/useBtcFeeRate'; import useDebounce from '@hooks/useDebounce'; import { useResetUserFlow } from '@hooks/useResetUserFlow'; @@ -53,7 +53,7 @@ function ConfirmBrc20Transaction() { const { network, fiatCurrency, feeMultipliers } = useWalletSelector(); const selectedAccount = useSelectedAccount(); const { btcAddress, ordinalsAddress } = selectedAccount; - const { btcFiatRate } = useCoinRates(); + const { btcFiatRate } = useSupportedCoinRates(); const navigate = useNavigate(); const { recipientAddress, diff --git a/src/app/screens/createInscription/index.tsx b/src/app/screens/createInscription/index.tsx index f35fd0809..c6c3337cd 100644 --- a/src/app/screens/createInscription/index.tsx +++ b/src/app/screens/createInscription/index.tsx @@ -28,8 +28,8 @@ import useWalletSelector from '@hooks/useWalletSelector'; import { isLedgerAccount } from '@utils/helper'; import useBtcClient from '@hooks/apiClients/useBtcClient'; -import useCoinRates from '@hooks/queries/useCoinRates'; import useConfirmedBtcBalance from '@hooks/queries/useConfirmedBtcBalance'; +import useSupportedCoinRates from '@hooks/queries/useSupportedCoinRates'; import useSelectedAccount from '@hooks/useSelectedAccount'; import useTransactionContext from '@hooks/useTransactionContext'; import Button from '@ui-library/button'; @@ -108,7 +108,7 @@ function CreateInscription() { const selectedAccount = useSelectedAccount(); const { ordinalsAddress, btcAddress } = selectedAccount; const { network, fiatCurrency } = useWalletSelector(); - const { btcFiatRate } = useCoinRates(); + const { btcFiatRate } = useSupportedCoinRates(); const transactionContext = useTransactionContext(); diff --git a/src/app/screens/home/balanceCard/index.tsx b/src/app/screens/home/balanceCard/index.tsx index cf240a745..65f86d119 100644 --- a/src/app/screens/home/balanceCard/index.tsx +++ b/src/app/screens/home/balanceCard/index.tsx @@ -4,8 +4,8 @@ import { useVisibleRuneFungibleTokens } from '@hooks/queries/runes/useRuneFungib import { useVisibleSip10FungibleTokens } from '@hooks/queries/stx/useGetSip10FungibleTokens'; import useAccountBalance from '@hooks/queries/useAccountBalance'; import useBtcWalletData from '@hooks/queries/useBtcWalletData'; -import useCoinRates from '@hooks/queries/useCoinRates'; import useStxWalletData from '@hooks/queries/useStxWalletData'; +import useSupportedCoinRates from '@hooks/queries/useSupportedCoinRates'; import useSelectedAccount from '@hooks/useSelectedAccount'; import useWalletSelector from '@hooks/useWalletSelector'; import { currencySymbolMap } from '@secretkeylabs/xverse-core'; @@ -76,7 +76,7 @@ function BalanceCard(props: BalanceCardProps) { const { fiatCurrency, hideStx, accountBalances } = useWalletSelector(); const { data: btcBalance } = useBtcWalletData(); const { data: stxData } = useStxWalletData(); - const { btcFiatRate, stxBtcRate } = useCoinRates(); + const { btcFiatRate, stxBtcRate } = useSupportedCoinRates(); const { setAccountBalance } = useAccountBalance(); const { isLoading, isRefetching } = props; const oldTotalBalance = accountBalances[selectedAccount.btcAddress]; diff --git a/src/app/screens/home/index.tsx b/src/app/screens/home/index.tsx index 13048de76..788b12f33 100644 --- a/src/app/screens/home/index.tsx +++ b/src/app/screens/home/index.tsx @@ -15,10 +15,10 @@ import { useVisibleRuneFungibleTokens } from '@hooks/queries/runes/useRuneFungib import { useVisibleSip10FungibleTokens } from '@hooks/queries/stx/useGetSip10FungibleTokens'; import useAppConfig from '@hooks/queries/useAppConfig'; import useBtcWalletData from '@hooks/queries/useBtcWalletData'; -import useCoinRates from '@hooks/queries/useCoinRates'; import useFeeMultipliers from '@hooks/queries/useFeeMultipliers'; import useSpamTokens from '@hooks/queries/useSpamTokens'; import useStxWalletData from '@hooks/queries/useStxWalletData'; +import useSupportedCoinRates from '@hooks/queries/useSupportedCoinRates'; import useAvatarCleanup from '@hooks/useAvatarCleanup'; import useHasFeature from '@hooks/useHasFeature'; import useNotificationBanners from '@hooks/useNotificationBanners'; @@ -110,7 +110,7 @@ function Home() { useBtcWalletData(); const { isInitialLoading: loadingStxWalletData, isRefetching: refetchingStxWalletData } = useStxWalletData(); - const { btcFiatRate, stxBtcRate } = useCoinRates(); + const { btcFiatRate, stxBtcRate } = useSupportedCoinRates(); const { data: notificationBannersArr, isFetching: isFetchingNotificationBannersArr } = useNotificationBanners(); const { diff --git a/src/app/screens/listRune/index.tsx b/src/app/screens/listRune/index.tsx index 100c38e15..c5208e7d6 100644 --- a/src/app/screens/listRune/index.tsx +++ b/src/app/screens/listRune/index.tsx @@ -5,7 +5,7 @@ import useRuneFloorPricePerMarketplaceQuery from '@hooks/queries/runes/useRuneFl import { useVisibleRuneFungibleTokens } from '@hooks/queries/runes/useRuneFungibleTokensQuery'; import useRuneSellPsbtPerMarketplace from '@hooks/queries/runes/useRuneSellPsbtPerMarketplace'; import useRuneUtxosQueryPerMarketplace from '@hooks/queries/runes/useRuneUtxosQueryPerMarketplace'; -import useCoinRates from '@hooks/queries/useCoinRates'; +import useSupportedCoinRates from '@hooks/queries/useSupportedCoinRates'; import useHasFeature from '@hooks/useHasFeature'; import { useResetUserFlow } from '@hooks/useResetUserFlow'; import useTrackMixPanelPageViewed from '@hooks/useTrackMixPanelPageViewed'; @@ -74,7 +74,7 @@ export default function ListRuneScreen() { const { visible: runesCoinsList } = useVisibleRuneFungibleTokens(false); const selectedRune = runesCoinsList.find((ft) => ft.principal === runeId); const { fiatCurrency } = useWalletSelector(); - const { btcFiatRate } = useCoinRates(); + const { btcFiatRate } = useSupportedCoinRates(); const location = useLocation(); const params = new URLSearchParams(location.search); const locationFrom = params.get('from'); diff --git a/src/app/screens/listRune/setRunePriceItem.tsx b/src/app/screens/listRune/setRunePriceItem.tsx index ac47aaaca..67c301c1b 100644 --- a/src/app/screens/listRune/setRunePriceItem.tsx +++ b/src/app/screens/listRune/setRunePriceItem.tsx @@ -1,4 +1,4 @@ -import useCoinRates from '@hooks/queries/useCoinRates'; +import useSupportedCoinRates from '@hooks/queries/useSupportedCoinRates'; import useWalletSelector from '@hooks/useWalletSelector'; import { PencilSimple } from '@phosphor-icons/react'; import FloorComparisonLabel from '@screens/listRune/floorComparisonLabel'; @@ -84,7 +84,7 @@ function SetRunePriceItem({ handleShowCustomPriceModal, }: Props) { const { t } = useTranslation('translation'); - const { btcFiatRate } = useCoinRates(); + const { btcFiatRate } = useSupportedCoinRates(); const { fiatCurrency } = useWalletSelector(); return ( diff --git a/src/app/screens/sendBtc/amountSelector.tsx b/src/app/screens/sendBtc/amountSelector.tsx index bfaf5ef10..35474742b 100644 --- a/src/app/screens/sendBtc/amountSelector.tsx +++ b/src/app/screens/sendBtc/amountSelector.tsx @@ -1,5 +1,5 @@ import useBtcWalletData from '@hooks/queries/useBtcWalletData'; -import useCoinRates from '@hooks/queries/useCoinRates'; +import useSupportedCoinRates from '@hooks/queries/useSupportedCoinRates'; import useBtcFeeRate from '@hooks/useBtcFeeRate'; import useWalletSelector from '@hooks/useWalletSelector'; import { getBtcFiatEquivalent } from '@secretkeylabs/xverse-core'; @@ -66,7 +66,7 @@ function AmountSelector({ const { fiatCurrency } = useWalletSelector(); const { data: btcBalance, isLoading: btcBalanceLoading } = useBtcWalletData(); - const { btcFiatRate } = useCoinRates(); + const { btcFiatRate } = useSupportedCoinRates(); const { data: recommendedFees } = useBtcFeeRate(); diff --git a/src/app/screens/sendRune/amountSelector.tsx b/src/app/screens/sendRune/amountSelector.tsx index 877d2a9bf..854f7a57a 100644 --- a/src/app/screens/sendRune/amountSelector.tsx +++ b/src/app/screens/sendRune/amountSelector.tsx @@ -1,4 +1,4 @@ -import useCoinRates from '@hooks/queries/useCoinRates'; +import useSupportedCoinRates from '@hooks/queries/useSupportedCoinRates'; import useBtcFeeRate from '@hooks/useBtcFeeRate'; import useWalletSelector from '@hooks/useWalletSelector'; import RuneAmountSelector from '@screens/sendRune/runeAmountSelector'; @@ -69,7 +69,7 @@ function AmountSelector({ const { t } = useTranslation('translation', { keyPrefix: 'SEND' }); const { t: tUnits } = useTranslation('translation', { keyPrefix: 'UNITS' }); const { fiatCurrency } = useWalletSelector(); - const { btcFiatRate } = useCoinRates(); + const { btcFiatRate } = useSupportedCoinRates(); const { data: recommendedFees } = useBtcFeeRate(); const balance = getFtBalance(token); diff --git a/src/app/screens/sendStx/steps/Step2SelectAmount.tsx b/src/app/screens/sendStx/steps/Step2SelectAmount.tsx index 5660c05d9..eb8ad6e7e 100644 --- a/src/app/screens/sendStx/steps/Step2SelectAmount.tsx +++ b/src/app/screens/sendStx/steps/Step2SelectAmount.tsx @@ -1,6 +1,6 @@ -import useCoinRates from '@hooks/queries/useCoinRates'; import useStxPendingTxData from '@hooks/queries/useStxPendingTxData'; import useStxWalletData from '@hooks/queries/useStxWalletData'; +import useSupportedCoinRates from '@hooks/queries/useSupportedCoinRates'; import useNetworkSelector from '@hooks/useNetwork'; import useSelectedAccount from '@hooks/useSelectedAccount'; import useWalletSelector from '@hooks/useWalletSelector'; @@ -91,7 +91,7 @@ function Step2SelectAmount({ const { stxAddress, stxPublicKey } = useSelectedAccount(); const { fiatCurrency, feeMultipliers } = useWalletSelector(); const { data: stxData } = useStxWalletData(); - const { btcFiatRate, stxBtcRate } = useCoinRates(); + const { btcFiatRate, stxBtcRate } = useSupportedCoinRates(); const stxBalance = stxData?.availableBalance.toString() ?? '0'; const ftBalance = fungibleToken ? getFtBalance(fungibleToken) : '0'; diff --git a/src/app/screens/sendStx/stxAmountSelector.tsx b/src/app/screens/sendStx/stxAmountSelector.tsx index 830cd5288..21df7e4b2 100644 --- a/src/app/screens/sendStx/stxAmountSelector.tsx +++ b/src/app/screens/sendStx/stxAmountSelector.tsx @@ -1,7 +1,7 @@ import FiatAmountText from '@components/fiatAmountText'; import { microStxToStx } from '@components/postCondition/postConditionView/helper'; -import useCoinRates from '@hooks/queries/useCoinRates'; import useStxWalletData from '@hooks/queries/useStxWalletData'; +import useSupportedCoinRates from '@hooks/queries/useSupportedCoinRates'; import useWalletSelector from '@hooks/useWalletSelector'; import { ArrowsDownUp } from '@phosphor-icons/react'; import { @@ -70,7 +70,7 @@ function StxAmountSelector({ amount, setAmount, sendMax, setSendMax, disabled = const { t } = useTranslation('translation', { keyPrefix: 'SEND' }); const { fiatCurrency } = useWalletSelector(); const { data: stxData } = useStxWalletData(); - const { btcFiatRate, stxBtcRate } = useCoinRates(); + const { btcFiatRate, stxBtcRate } = useSupportedCoinRates(); const stxBalanceStr = stxData?.availableBalance.toString() ?? '0'; const [amountDisplay, setAmountDisplay] = useState( diff --git a/src/app/screens/settings/preferences/fiatCurrency/currencyRow.tsx b/src/app/screens/settings/preferences/fiatCurrency/currencyRow.tsx index 41b3cc968..8e7dcb5bb 100644 --- a/src/app/screens/settings/preferences/fiatCurrency/currencyRow.tsx +++ b/src/app/screens/settings/preferences/fiatCurrency/currencyRow.tsx @@ -54,7 +54,7 @@ function CurrencyRow({ currency, isSelected, onCurrencySelected, showDivider }: $variant={isSelected ? theme.typography.body_bold_l : theme.typography.body_medium_l} > - + {currency.name} {isSelected && tick} diff --git a/src/app/screens/speedUpTransaction/customFee/index.tsx b/src/app/screens/speedUpTransaction/customFee/index.tsx index 94d2b435b..4977ecbbd 100644 --- a/src/app/screens/speedUpTransaction/customFee/index.tsx +++ b/src/app/screens/speedUpTransaction/customFee/index.tsx @@ -1,5 +1,5 @@ import BottomModal from '@components/bottomModal'; -import useCoinRates from '@hooks/queries/useCoinRates'; +import useSupportedCoinRates from '@hooks/queries/useSupportedCoinRates'; import useWalletSelector from '@hooks/useWalletSelector'; import { getBtcFiatEquivalent, @@ -57,7 +57,7 @@ export default function CustomFee({ const { t: tUnits } = useTranslation('translation', { keyPrefix: 'UNITS' }); const { fiatCurrency } = useWalletSelector(); - const { btcFiatRate, stxBtcRate } = useCoinRates(); + const { btcFiatRate, stxBtcRate } = useSupportedCoinRates(); const [feeRateInput, setFeeRateInput] = useState(feeRate || minimumFeeRate); const [totalFee, setTotalFee] = useState(fee || initialTotalFee); diff --git a/src/app/screens/swap/components/tokenFromBottomSheet/useFromTokens.ts b/src/app/screens/swap/components/tokenFromBottomSheet/useFromTokens.ts index e5aca1f1e..e886fc431 100644 --- a/src/app/screens/swap/components/tokenFromBottomSheet/useFromTokens.ts +++ b/src/app/screens/swap/components/tokenFromBottomSheet/useFromTokens.ts @@ -1,4 +1,4 @@ -import useCoinRates from '@hooks/queries/useCoinRates'; +import useSupportedCoinRates from '@hooks/queries/useSupportedCoinRates'; import useMasterCoinsList from '@screens/swap/useMasterCoinsList'; import { mapSwapProtocolToFTProtocol } from '@screens/swap/utils'; import { type Token } from '@secretkeylabs/xverse-core'; @@ -6,7 +6,7 @@ import { sortFtByFiatBalance } from '@utils/tokens'; const useFromTokens = (toToken?: Token) => { const tokens = useMasterCoinsList(); - const { stxBtcRate, btcFiatRate } = useCoinRates(); + const { stxBtcRate, btcFiatRate } = useSupportedCoinRates(); // Sort tokens, keeping BTC as the first element, and STX (if enabled) as the second const sortedTokens = tokens.sort((a, b) => { diff --git a/src/app/screens/swap/index.tsx b/src/app/screens/swap/index.tsx index b255b0a25..120a01708 100644 --- a/src/app/screens/swap/index.tsx +++ b/src/app/screens/swap/index.tsx @@ -6,8 +6,8 @@ import useRuneFloorPriceQuery from '@hooks/queries/runes/useRuneFloorPriceQuery' import useGetSip10TokenInfo from '@hooks/queries/stx/useGetSip10TokenInfo'; import useGetQuotes from '@hooks/queries/swaps/useGetQuotes'; import useBtcWalletData from '@hooks/queries/useBtcWalletData'; -import useCoinRates from '@hooks/queries/useCoinRates'; import useStxWalletData from '@hooks/queries/useStxWalletData'; +import useSupportedCoinRates from '@hooks/queries/useSupportedCoinRates'; import useSelectedAccount from '@hooks/useSelectedAccount'; import useWalletSelector from '@hooks/useWalletSelector'; import type { DataStxSignTransaction } from '@screens/transactionRequest/useStxTransactionRequest'; @@ -130,7 +130,7 @@ export default function SwapScreen() { const { data: btcBalance } = useBtcWalletData(); const { data: stxData } = useStxWalletData(); - const { btcFiatRate, btcUsdRate, stxBtcRate } = useCoinRates(); + const { btcFiatRate, btcUsdRate, stxBtcRate } = useSupportedCoinRates(); const navigate = useNavigate(); const { t } = useTranslation('translation'); const location = useLocation(); diff --git a/src/app/screens/swap/quoteSummary/index.tsx b/src/app/screens/swap/quoteSummary/index.tsx index bf7087b3c..dfc457e52 100644 --- a/src/app/screens/swap/quoteSummary/index.tsx +++ b/src/app/screens/swap/quoteSummary/index.tsx @@ -2,7 +2,7 @@ import SlippageEditIcon from '@assets/img/swap/slippageEdit.svg'; import TopRow from '@components/topRow'; import useRuneFloorPriceQuery from '@hooks/queries/runes/useRuneFloorPriceQuery'; import useGetSip10TokenInfo from '@hooks/queries/stx/useGetSip10TokenInfo'; -import useCoinRates from '@hooks/queries/useCoinRates'; +import useSupportedCoinRates from '@hooks/queries/useSupportedCoinRates'; import useBtcFeeRate from '@hooks/useBtcFeeRate'; import useSearchParamsState from '@hooks/useSearchParamsState'; import useSelectedAccount from '@hooks/useSelectedAccount'; @@ -186,7 +186,7 @@ export default function QuoteSummary({ }); const theme = useTheme(); - const { btcFiatRate, btcUsdRate, stxBtcRate } = useCoinRates(); + const { btcFiatRate, btcUsdRate, stxBtcRate } = useSupportedCoinRates(); const { btcAddress, ordinalsAddress, btcPublicKey, ordinalsPublicKey, stxAddress, stxPublicKey } = useSelectedAccount(); diff --git a/src/app/screens/swap/quotesModal/index.tsx b/src/app/screens/swap/quotesModal/index.tsx index 313df379c..44bc51244 100644 --- a/src/app/screens/swap/quotesModal/index.tsx +++ b/src/app/screens/swap/quotesModal/index.tsx @@ -1,5 +1,5 @@ import useGetSip10TokenInfo from '@hooks/queries/stx/useGetSip10TokenInfo'; -import useCoinRates from '@hooks/queries/useCoinRates'; +import useSupportedCoinRates from '@hooks/queries/useSupportedCoinRates'; import { getBtcFiatEquivalent, getStxFiatEquivalent, @@ -65,7 +65,7 @@ function QuotesModal({ }: Props) { const { t } = useTranslation('translation', { keyPrefix: 'SWAP_SCREEN' }); - const { btcFiatRate, stxBtcRate } = useCoinRates(); + const { btcFiatRate, stxBtcRate } = useSupportedCoinRates(); const { tokenInfo: toTokenInfo } = useGetSip10TokenInfo({ principal: toToken?.ticker }); const sortQuotesByReceiveAmount = (quotes: T[]): T[] => diff --git a/src/app/screens/swap/utxoSelection/index.tsx b/src/app/screens/swap/utxoSelection/index.tsx index 351739215..b4f2a7de5 100644 --- a/src/app/screens/swap/utxoSelection/index.tsx +++ b/src/app/screens/swap/utxoSelection/index.tsx @@ -13,7 +13,7 @@ import { StyledP } from '@ui-library/common.styled'; import useGetUtxos from '@hooks/queries/swaps/useGetUtxos'; import useBtcWalletData from '@hooks/queries/useBtcWalletData'; -import useCoinRates from '@hooks/queries/useCoinRates'; +import useSupportedCoinRates from '@hooks/queries/useSupportedCoinRates'; import useWalletSelector from '@hooks/useWalletSelector'; import Button from '@ui-library/button'; import SnackBar from '@ui-library/snackBar'; @@ -136,7 +136,7 @@ export default function UtxoSelection({ const { t: commonT } = useTranslation('translation', { keyPrefix: 'COMMON' }); const { fiatCurrency } = useWalletSelector(); - const { btcFiatRate } = useCoinRates(); + const { btcFiatRate } = useSupportedCoinRates(); const { data: btcBalance } = useBtcWalletData(); const totalRunesPerBtc = new BigNumber(100000000).dividedBy( diff --git a/src/app/ui-components/btcAmountSelector.tsx b/src/app/ui-components/btcAmountSelector.tsx index 8165876d5..9c2438801 100644 --- a/src/app/ui-components/btcAmountSelector.tsx +++ b/src/app/ui-components/btcAmountSelector.tsx @@ -1,5 +1,5 @@ import useBtcWalletData from '@hooks/queries/useBtcWalletData'; -import useCoinRates from '@hooks/queries/useCoinRates'; +import useSupportedCoinRates from '@hooks/queries/useSupportedCoinRates'; import useWalletSelector from '@hooks/useWalletSelector'; import { ArrowsDownUp } from '@phosphor-icons/react'; import { @@ -57,7 +57,7 @@ function AmountSelector({ const { t } = useTranslation('translation', { keyPrefix: 'SEND' }); const { fiatCurrency } = useWalletSelector(); const { data: btcBalanceSats } = useBtcWalletData(); - const { btcFiatRate } = useCoinRates(); + const { btcFiatRate } = useSupportedCoinRates(); const [amountDisplay, setAmountDisplay] = useState( amountSats && satsToBtcString(new BigNumber(amountSats)), diff --git a/src/app/utils/currency.ts b/src/app/utils/currency.ts index 5d8e80e5b..5c898f6b8 100644 --- a/src/app/utils/currency.ts +++ b/src/app/utils/currency.ts @@ -1,35 +1,66 @@ +import CAN from '@assets/img/settings/currencies/can.svg'; +import CHN from '@assets/img/settings/currencies/chn.svg'; +import EU from '@assets/img/settings/currencies/eu.svg'; +import USA from '@assets/img/settings/currencies/usa.svg'; import ARG from '@assets/img/settings/currencies/ars.svg'; -import AUD from '@assets/img/settings/currencies/aud.svg'; -import BRL from '@assets/img/settings/currencies/brl.svg'; -import CAD from '@assets/img/settings/currencies/cad.svg'; -import CNY from '@assets/img/settings/currencies/cny.svg'; -import EUR from '@assets/img/settings/currencies/eur.svg'; -import GBP from '@assets/img/settings/currencies/gbp.svg'; -import HKD from '@assets/img/settings/currencies/hkd.svg'; -import JPY from '@assets/img/settings/currencies/jpy.svg'; -import KRW from '@assets/img/settings/currencies/krw.svg'; -import RUB from '@assets/img/settings/currencies/rub.svg'; -import SGD from '@assets/img/settings/currencies/sgd.svg'; -import USD from '@assets/img/settings/currencies/usd.svg'; +import KOR from '@assets/img/settings/currencies/kor.svg'; +import HKG from '@assets/img/settings/currencies/hkg.svg'; +import JPN from '@assets/img/settings/currencies/jpn.svg'; +import SGP from '@assets/img/settings/currencies/sgp.svg'; +import GBR from '@assets/img/settings/currencies/gbr.svg'; +import BRA from '@assets/img/settings/currencies/bra.svg'; +import RUS from '@assets/img/settings/currencies/rus.svg'; +import AUS from '@assets/img/settings/currencies/aus.svg'; +import NGA from '@assets/img/settings/currencies/nga.svg'; +import TUR from '@assets/img/settings/currencies/tur.svg'; +import IND from '@assets/img/settings/currencies/ind.svg'; +import CHE from '@assets/img/settings/currencies/che.svg'; +import VNM from '@assets/img/settings/currencies/vnm.svg'; +import POL from '@assets/img/settings/currencies/pol.svg'; +import MYS from '@assets/img/settings/currencies/mys.svg'; +import TWN from '@assets/img/settings/currencies/twn.svg'; +import IDN from '@assets/img/settings/currencies/idn.svg'; +import HUN from '@assets/img/settings/currencies/hun.svg'; +import THA from '@assets/img/settings/currencies/tha.svg'; +import PHL from '@assets/img/settings/currencies/phl.svg'; +import PAK from '@assets/img/settings/currencies/pak.svg'; +import ZAF from '@assets/img/settings/currencies/zaf.svg'; +import MEX from '@assets/img/settings/currencies/mex.svg'; + import type { SupportedCurrency } from '@secretkeylabs/xverse-core'; export interface Currency { name: SupportedCurrency; - flag: string; + isoFlag: string; } export const currencyList: Currency[] = [ - { name: 'CAD', flag: CAD }, - { name: 'CNY', flag: CNY }, - { name: 'EUR', flag: EUR }, - { name: 'USD', flag: USD }, - { name: 'ARS', flag: ARG }, - { name: 'KRW', flag: KRW }, - { name: 'HKD', flag: HKD }, - { name: 'JPY', flag: JPY }, - { name: 'SGD', flag: SGD }, - { name: 'GBP', flag: GBP }, - { name: 'BRL', flag: BRL }, - { name: 'RUB', flag: RUB }, - { name: 'AUD', flag: AUD }, + { name: 'CAD', isoFlag: CAN }, // Canada + { name: 'CNY', isoFlag: CHN }, // China + { name: 'EUR', isoFlag: EU }, // Eurozone + { name: 'USD', isoFlag: USA }, // United States + { name: 'ARS', isoFlag: ARG }, // Argentina + { name: 'KRW', isoFlag: KOR }, // South Korea + { name: 'HKD', isoFlag: HKG }, // Hong Kong + { name: 'JPY', isoFlag: JPN }, // Japan + { name: 'SGD', isoFlag: SGP }, // Singapore + { name: 'GBP', isoFlag: GBR }, // United Kingdom + { name: 'BRL', isoFlag: BRA }, // Brazil + { name: 'RUB', isoFlag: RUS }, // Russia + { name: 'AUD', isoFlag: AUS }, // Australia + { name: 'NGN', isoFlag: NGA }, // Nigeria + { name: 'TRY', isoFlag: TUR }, // Turkey + { name: 'INR', isoFlag: IND }, // India + { name: 'CHF', isoFlag: CHE }, // Switzerland + { name: 'VND', isoFlag: VNM }, // Vietnam + { name: 'PLN', isoFlag: POL }, // Poland + { name: 'MYR', isoFlag: MYS }, // Malaysia + { name: 'TWD', isoFlag: TWN }, // Taiwan + { name: 'IDR', isoFlag: IDN }, // Indonesia + { name: 'HUF', isoFlag: HUN }, // Hungary + { name: 'THB', isoFlag: THA }, // Thailand + { name: 'PHP', isoFlag: PHL }, // Philippines + { name: 'PKR', isoFlag: PAK }, // Pakistan + { name: 'ZAR', isoFlag: ZAF }, // South Africa + { name: 'MXN', isoFlag: MEX }, // Mexico ]; diff --git a/src/assets/img/settings/currencies/aud.svg b/src/assets/img/settings/currencies/aus.svg similarity index 100% rename from src/assets/img/settings/currencies/aud.svg rename to src/assets/img/settings/currencies/aus.svg diff --git a/src/assets/img/settings/currencies/brl.svg b/src/assets/img/settings/currencies/bra.svg similarity index 100% rename from src/assets/img/settings/currencies/brl.svg rename to src/assets/img/settings/currencies/bra.svg diff --git a/src/assets/img/settings/currencies/cad.svg b/src/assets/img/settings/currencies/can.svg similarity index 100% rename from src/assets/img/settings/currencies/cad.svg rename to src/assets/img/settings/currencies/can.svg diff --git a/src/assets/img/settings/currencies/che.svg b/src/assets/img/settings/currencies/che.svg new file mode 100644 index 000000000..c0b86ae11 --- /dev/null +++ b/src/assets/img/settings/currencies/che.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/assets/img/settings/currencies/cny.svg b/src/assets/img/settings/currencies/chn.svg similarity index 100% rename from src/assets/img/settings/currencies/cny.svg rename to src/assets/img/settings/currencies/chn.svg diff --git a/src/assets/img/settings/currencies/eur.svg b/src/assets/img/settings/currencies/eu.svg similarity index 100% rename from src/assets/img/settings/currencies/eur.svg rename to src/assets/img/settings/currencies/eu.svg diff --git a/src/assets/img/settings/currencies/gbp.svg b/src/assets/img/settings/currencies/gbr.svg similarity index 100% rename from src/assets/img/settings/currencies/gbp.svg rename to src/assets/img/settings/currencies/gbr.svg diff --git a/src/assets/img/settings/currencies/hkd.svg b/src/assets/img/settings/currencies/hkg.svg similarity index 100% rename from src/assets/img/settings/currencies/hkd.svg rename to src/assets/img/settings/currencies/hkg.svg diff --git a/src/assets/img/settings/currencies/hun.svg b/src/assets/img/settings/currencies/hun.svg new file mode 100644 index 000000000..f51c943e2 --- /dev/null +++ b/src/assets/img/settings/currencies/hun.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/assets/img/settings/currencies/idn.svg b/src/assets/img/settings/currencies/idn.svg new file mode 100644 index 000000000..bf9df2a92 --- /dev/null +++ b/src/assets/img/settings/currencies/idn.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/assets/img/settings/currencies/ind.svg b/src/assets/img/settings/currencies/ind.svg new file mode 100644 index 000000000..676e78817 --- /dev/null +++ b/src/assets/img/settings/currencies/ind.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/src/assets/img/settings/currencies/jpy.svg b/src/assets/img/settings/currencies/jpn.svg similarity index 100% rename from src/assets/img/settings/currencies/jpy.svg rename to src/assets/img/settings/currencies/jpn.svg diff --git a/src/assets/img/settings/currencies/krw.svg b/src/assets/img/settings/currencies/kor.svg similarity index 100% rename from src/assets/img/settings/currencies/krw.svg rename to src/assets/img/settings/currencies/kor.svg diff --git a/src/assets/img/settings/currencies/mex.svg b/src/assets/img/settings/currencies/mex.svg new file mode 100644 index 000000000..e68c31bc0 --- /dev/null +++ b/src/assets/img/settings/currencies/mex.svg @@ -0,0 +1,467 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/img/settings/currencies/mys.svg b/src/assets/img/settings/currencies/mys.svg new file mode 100644 index 000000000..b5a1d9d1d --- /dev/null +++ b/src/assets/img/settings/currencies/mys.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/assets/img/settings/currencies/nga.svg b/src/assets/img/settings/currencies/nga.svg new file mode 100644 index 000000000..0db8695d8 --- /dev/null +++ b/src/assets/img/settings/currencies/nga.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/assets/img/settings/currencies/pak.svg b/src/assets/img/settings/currencies/pak.svg new file mode 100644 index 000000000..37d707196 --- /dev/null +++ b/src/assets/img/settings/currencies/pak.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/assets/img/settings/currencies/phl.svg b/src/assets/img/settings/currencies/phl.svg new file mode 100644 index 000000000..bbca901e0 --- /dev/null +++ b/src/assets/img/settings/currencies/phl.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/assets/img/settings/currencies/pol.svg b/src/assets/img/settings/currencies/pol.svg new file mode 100644 index 000000000..2e707c067 --- /dev/null +++ b/src/assets/img/settings/currencies/pol.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/assets/img/settings/currencies/rub.svg b/src/assets/img/settings/currencies/rus.svg similarity index 100% rename from src/assets/img/settings/currencies/rub.svg rename to src/assets/img/settings/currencies/rus.svg diff --git a/src/assets/img/settings/currencies/sgd.svg b/src/assets/img/settings/currencies/sgp.svg similarity index 100% rename from src/assets/img/settings/currencies/sgd.svg rename to src/assets/img/settings/currencies/sgp.svg diff --git a/src/assets/img/settings/currencies/tha.svg b/src/assets/img/settings/currencies/tha.svg new file mode 100644 index 000000000..fbd5ba069 --- /dev/null +++ b/src/assets/img/settings/currencies/tha.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/assets/img/settings/currencies/tur.svg b/src/assets/img/settings/currencies/tur.svg new file mode 100644 index 000000000..34fac9b7c --- /dev/null +++ b/src/assets/img/settings/currencies/tur.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/assets/img/settings/currencies/twn.svg b/src/assets/img/settings/currencies/twn.svg new file mode 100644 index 000000000..2d13f22cf --- /dev/null +++ b/src/assets/img/settings/currencies/twn.svg @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/img/settings/currencies/usd.svg b/src/assets/img/settings/currencies/usa.svg similarity index 100% rename from src/assets/img/settings/currencies/usd.svg rename to src/assets/img/settings/currencies/usa.svg diff --git a/src/assets/img/settings/currencies/vnm.svg b/src/assets/img/settings/currencies/vnm.svg new file mode 100644 index 000000000..4561861df --- /dev/null +++ b/src/assets/img/settings/currencies/vnm.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/assets/img/settings/currencies/zaf.svg b/src/assets/img/settings/currencies/zaf.svg new file mode 100644 index 000000000..49ee153be --- /dev/null +++ b/src/assets/img/settings/currencies/zaf.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + +