Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Currency conversion: add XAG + XAU #2123

Merged
merged 3 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 16 additions & 2 deletions stores/FiatStore.ts
shivamgupta2020 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,18 @@ export default class FiatStore {
space: true,
rtl: false,
separatorSwap: false
},
XAG: {
symbol: 'Ag oz',
space: true,
rtl: true,
separatorSwap: false
},
XAU: {
symbol: 'Au oz',
space: true,
rtl: true,
separatorSwap: false
}
};

Expand Down Expand Up @@ -593,9 +605,9 @@ export default class FiatStore {
return '$N/A';
};

// as of March 13, 2023
// as of April 17, 2024
// BTCPAY rates string:
// BTC_USD,BTC_AUD,BTC_BRL,BTC_CAD,BTC_CHF,BTC_CLP,BTC_CNY,BTC_CZK,BTC_DKK,BTC_EUR,BTC_GBP,BTC_HKD,BTC_HUF,BTC_INR,BTC_ISK,BTC_JPY,BTC_KRW,BTC_NZD,BTC_PLN,BTC_RON,BTC_RUB,BTC_SEK,BTC_SGD,BTC_THB,BTC_TRY,BTC_TWD,BTC_ILS,BTC_ARS,BTC_NGN,BTC_LBP,BTC_MYR,BTC_UAH,BTC_JMD,BTC_COP,BTC_MXN,BTC_VES,BTC_TZS,BTC_QAR,BTC_TND,BTC_NOK,BTC_AED,BTC_TTD,BTC_PHP,BTC_CDF,BTC_XAF,BTC_KES,BTC_UGX,BTC_ZAR,BTC_CUP,BTC_DOP,BTC_BZD,BTC_BOB,BTC_CRC,BTC_GTQ,BTC_NIO,BTC_PYG,BTC_UYU,BTC_MRU,BTC_ALL,BTC_ANG,BTC_AOA,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coingecko(BTC_USD);
Expand Down Expand Up @@ -688,6 +700,8 @@ export default class FiatStore {
// BTC_RWF = yadio(BTC_RWF);
// BTC_UGS = yadio(BTC_UGS);
// BTC_VND = yadio(BTC_VND);
// BTC_XAG = yadio(BTC_XAG);
// BTC_XAU = yadio(BTC_XAU);

@action
public getFiatRates = async () => {
Expand Down
10 changes: 10 additions & 0 deletions stores/SettingsStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,16 @@ export const CURRENCY_KEYS = [
key: '🇻🇳 Vietnamese Dong (VND)',
value: 'VND',
supportedSources: ['Zeus', 'Yadio']
},
{
key: 'Gold (XAU)',
value: 'XAU',
supportedSources: ['Zeus', 'Yadio']
},
{
key: 'Silver (XAG)',
value: 'XAG',
supportedSources: ['Zeus', 'Yadio']
}
];

Expand Down