country-currencies
Version:
This is a npm package that provides information about country ISO codes, currencies, and decimal precision, for majority of countries. It offers utility functions to look up the currency and decimal places for any given country or currency ISO code.
1,319 lines (1,317 loc) • 20.9 kB
JavaScript
// countryCurrencyInfo.ts
var currencies = [
{
CountryIsoCode: "AD",
Currencies: ["EUR"],
Decimals: 2
},
{
CountryIsoCode: "AE",
Currencies: ["AED"],
Decimals: 2
},
{
CountryIsoCode: "AF",
Currencies: ["AFN"],
Decimals: 2
},
{
CountryIsoCode: "AG",
Currencies: ["XCD"],
Decimals: 2
},
{
CountryIsoCode: "AI",
Currencies: ["XCD"],
Decimals: 2
},
{
CountryIsoCode: "AL",
Currencies: ["ALL"],
Decimals: 2
},
{
CountryIsoCode: "AM",
Currencies: ["AMD"],
Decimals: 2
},
{
CountryIsoCode: "AO",
Currencies: ["AOA"],
Decimals: 2
},
{
CountryIsoCode: "AR",
Currencies: ["ARS"],
Decimals: 2
},
{
CountryIsoCode: "AS",
Currencies: ["USD"],
Decimals: 2
},
{
CountryIsoCode: "AT",
Currencies: ["EUR"],
Decimals: 2
},
{
CountryIsoCode: "AU",
Currencies: ["AUD"],
Decimals: 2
},
{
CountryIsoCode: "AW",
Currencies: ["AWG"],
Decimals: 2
},
{
CountryIsoCode: "AX",
Currencies: ["EUR"],
Decimals: 2
},
{
CountryIsoCode: "AZ",
Currencies: ["AZN"],
Decimals: 2
},
{
CountryIsoCode: "BA",
Currencies: ["BAM"],
Decimals: 2
},
{
CountryIsoCode: "BB",
Currencies: ["BBD"],
Decimals: 2
},
{
CountryIsoCode: "BD",
Currencies: ["BDT"],
Decimals: 2
},
{
CountryIsoCode: "BE",
Currencies: ["EUR"],
Decimals: 2
},
{
CountryIsoCode: "BF",
Currencies: ["XOF"],
Decimals: 0
},
{
CountryIsoCode: "BG",
Currencies: ["BGN"],
Decimals: 2
},
{
CountryIsoCode: "BH",
Currencies: ["BHD"],
Decimals: 3
},
{
CountryIsoCode: "BI",
Currencies: ["BIF"],
Decimals: 0
},
{
CountryIsoCode: "BJ",
Currencies: ["XOF"],
Decimals: 0
},
{
CountryIsoCode: "BL",
Currencies: ["EUR"],
Decimals: 2
},
{
CountryIsoCode: "BM",
Currencies: ["BMD"],
Decimals: 2
},
{
CountryIsoCode: "BN",
Currencies: ["BND"],
Decimals: 2
},
{
CountryIsoCode: "BO",
Currencies: ["BOB", "BOV"],
Decimals: 2
},
{
CountryIsoCode: "BQ",
Currencies: ["USD"],
Decimals: 2
},
{
CountryIsoCode: "BR",
Currencies: ["BRL"],
Decimals: 2
},
{
CountryIsoCode: "BS",
Currencies: ["BSD"],
Decimals: 2
},
{
CountryIsoCode: "BT",
Currencies: ["INR", "BTN"],
Decimals: 2
},
{
CountryIsoCode: "BV",
Currencies: ["NOK"],
Decimals: 2
},
{
CountryIsoCode: "BW",
Currencies: ["BWP"],
Decimals: 2
},
{
CountryIsoCode: "BY",
Currencies: ["BYN"],
Decimals: 0
},
{
CountryIsoCode: "BZ",
Currencies: ["BZD"],
Decimals: 2
},
{
CountryIsoCode: "CA",
Currencies: ["CAD"],
Decimals: 2
},
{
CountryIsoCode: "CC",
Currencies: ["AUD"],
Decimals: 2
},
{
CountryIsoCode: "CD",
Currencies: ["CDF"],
Decimals: 2
},
{
CountryIsoCode: "CF",
Currencies: ["XOF"],
Decimals: 0
},
{
CountryIsoCode: "CG",
Currencies: ["XOF"],
Decimals: 0
},
{
CountryIsoCode: "CH",
Currencies: ["CHF", "CHE", "CHW"],
Decimals: 2
},
{
CountryIsoCode: "CI",
Currencies: ["XOF"],
Decimals: 0
},
{
CountryIsoCode: "CK",
Currencies: ["NZD"],
Decimals: 2
},
{
CountryIsoCode: "CL",
Currencies: ["CLP", "CLF"],
Decimals: 0
},
{
CountryIsoCode: "CM",
Currencies: ["XOF"],
Decimals: 0
},
{
CountryIsoCode: "CN",
Currencies: ["CNY"],
Decimals: 2
},
{
CountryIsoCode: "CO",
Currencies: ["COP", "COU"],
Decimals: 2
},
{
CountryIsoCode: "CP",
Currencies: ["EUR"],
Decimals: 2
},
{
CountryIsoCode: "CR",
Currencies: ["CRC"],
Decimals: 2
},
{
CountryIsoCode: "CU",
Currencies: ["CUP", "CUC"],
Decimals: 2
},
{
CountryIsoCode: "CV",
Currencies: ["CVE"],
Decimals: 0
},
{
CountryIsoCode: "CW",
Currencies: ["ANG"],
Decimals: 2
},
{
CountryIsoCode: "CX",
Currencies: ["AUD"],
Decimals: 2
},
{
CountryIsoCode: "CY",
Currencies: ["EUR"],
Decimals: 2
},
{
CountryIsoCode: "CZ",
Currencies: ["CZK"],
Decimals: 2
},
{
CountryIsoCode: "DE",
Currencies: ["EUR"],
Decimals: 2
},
{
CountryIsoCode: "DG",
Currencies: ["USD"],
Decimals: 2
},
{
CountryIsoCode: "DJ",
Currencies: ["DJF"],
Decimals: 0
},
{
CountryIsoCode: "DK",
Currencies: ["DKK"],
Decimals: 2
},
{
CountryIsoCode: "DM",
Currencies: ["XCD"],
Decimals: 2
},
{
CountryIsoCode: "DO",
Currencies: ["DOP"],
Decimals: 2
},
{
CountryIsoCode: "DZ",
Currencies: ["DZD"],
Decimals: 2
},
{
CountryIsoCode: "EA",
Currencies: ["EUR"],
Decimals: 2
},
{
CountryIsoCode: "EC",
Currencies: ["USD"],
Decimals: 2
},
{
CountryIsoCode: "EE",
Currencies: ["EUR"],
Decimals: 2
},
{
CountryIsoCode: "EG",
Currencies: ["EGP"],
Decimals: 2
},
{
CountryIsoCode: "EH",
Currencies: ["MAD"],
Decimals: 2
},
{
CountryIsoCode: "ER",
Currencies: ["ERN"],
Decimals: 2
},
{
CountryIsoCode: "ES",
Currencies: ["EUR"],
Decimals: 2
},
{
CountryIsoCode: "ET",
Currencies: ["ETB"],
Decimals: 2
},
{
CountryIsoCode: "EU",
Currencies: ["EUR"],
Decimals: 2
},
{
CountryIsoCode: "FI",
Currencies: ["EUR"],
Decimals: 2
},
{
CountryIsoCode: "FJ",
Currencies: ["FJD"],
Decimals: 2
},
{
CountryIsoCode: "FK",
Currencies: ["FKP"],
Decimals: 2
},
{
CountryIsoCode: "FM",
Currencies: ["USD"],
Decimals: 2
},
{
CountryIsoCode: "FO",
Currencies: ["DKK"],
Decimals: 2
},
{
CountryIsoCode: "FR",
Currencies: ["EUR"],
Decimals: 2
},
{
CountryIsoCode: "FX",
Currencies: ["EUR"],
Decimals: 2
},
{
CountryIsoCode: "GA",
Currencies: ["XOF"],
Decimals: 0
},
{
CountryIsoCode: "GB",
Currencies: ["GBP"],
Decimals: 2
},
{
CountryIsoCode: "GD",
Currencies: ["XCD"],
Decimals: 2
},
{
CountryIsoCode: "GE",
Currencies: ["GEL"],
Decimals: 2
},
{
CountryIsoCode: "GF",
Currencies: ["EUR"],
Decimals: 2
},
{
CountryIsoCode: "GG",
Currencies: ["GBP"],
Decimals: 2
},
{
CountryIsoCode: "GH",
Currencies: ["GHS"],
Decimals: 2
},
{
CountryIsoCode: "GI",
Currencies: ["GIP"],
Decimals: 2
},
{
CountryIsoCode: "GL",
Currencies: ["DKK"],
Decimals: 2
},
{
CountryIsoCode: "GM",
Currencies: ["GMD"],
Decimals: 2
},
{
CountryIsoCode: "GN",
Currencies: ["GNF"],
Decimals: 2
},
{
CountryIsoCode: "GP",
Currencies: ["EUR"],
Decimals: 2
},
{
CountryIsoCode: "GQ",
Currencies: ["XOF"],
Decimals: 0
},
{
CountryIsoCode: "GR",
Currencies: ["EUR"],
Decimals: 2
},
{
CountryIsoCode: "GS",
Currencies: ["GBP"],
Decimals: 2
},
{
CountryIsoCode: "GT",
Currencies: ["GTQ"],
Decimals: 2
},
{
CountryIsoCode: "GU",
Currencies: ["USD"],
Decimals: 2
},
{
CountryIsoCode: "GW",
Currencies: ["XOF"],
Decimals: 0
},
{
CountryIsoCode: "GY",
Currencies: ["GYD"],
Decimals: 2
},
{
CountryIsoCode: "HK",
Currencies: ["HKD"],
Decimals: 2
},
{
CountryIsoCode: "HM",
Currencies: ["AUD"],
Decimals: 2
},
{
CountryIsoCode: "HN",
Currencies: ["HNL"],
Decimals: 2
},
{
CountryIsoCode: "HR",
Currencies: ["EUR"],
Decimals: 2
},
{
CountryIsoCode: "HT",
Currencies: ["HTG", "USD"],
Decimals: 2
},
{
CountryIsoCode: "HU",
Currencies: ["HUF"],
Decimals: 2
},
{
CountryIsoCode: "IC",
Currencies: ["EUR"],
Decimals: 2
},
{
CountryIsoCode: "ID",
Currencies: ["IDR"],
Decimals: 2
},
{
CountryIsoCode: "IE",
Currencies: ["EUR"],
Decimals: 2
},
{
CountryIsoCode: "IL",
Currencies: ["ILS"],
Decimals: 2
},
{
CountryIsoCode: "IM",
Currencies: ["GBP"],
Decimals: 2
},
{
CountryIsoCode: "IN",
Currencies: ["INR"],
Decimals: 2
},
{
CountryIsoCode: "IO",
Currencies: ["USD"],
Decimals: 2
},
{
CountryIsoCode: "IQ",
Currencies: ["IQD"],
Decimals: 3
},
{
CountryIsoCode: "IR",
Currencies: ["IRR"],
Decimals: 0
},
{
CountryIsoCode: "IS",
Currencies: ["ISK"],
Decimals: 0
},
{
CountryIsoCode: "IT",
Currencies: ["EUR"],
Decimals: 2
},
{
CountryIsoCode: "JE",
Currencies: ["GBP"],
Decimals: 2
},
{
CountryIsoCode: "JM",
Currencies: ["JMD"],
Decimals: 2
},
{
CountryIsoCode: "JO",
Currencies: ["JOD"],
Decimals: 3
},
{
CountryIsoCode: "JP",
Currencies: ["JPY"],
Decimals: 0
},
{
CountryIsoCode: "KE",
Currencies: ["KES"],
Decimals: 2
},
{
CountryIsoCode: "KG",
Currencies: ["KGS"],
Decimals: 2
},
{
CountryIsoCode: "KH",
Currencies: ["KHR"],
Decimals: 2
},
{
CountryIsoCode: "KI",
Currencies: ["AUD"],
Decimals: 2
},
{
CountryIsoCode: "KM",
Currencies: ["KMF"],
Decimals: 0
},
{
CountryIsoCode: "KN",
Currencies: ["XCD"],
Decimals: 2
},
{
CountryIsoCode: "KP",
Currencies: ["KPW"],
Decimals: 0
},
{
CountryIsoCode: "KR",
Currencies: ["KRW"],
Decimals: 0
},
{
CountryIsoCode: "KW",
Currencies: ["KWD"],
Decimals: 3
},
{
CountryIsoCode: "KY",
Currencies: ["KYD"],
Decimals: 2
},
{
CountryIsoCode: "KZ",
Currencies: ["KZT"],
Decimals: 2
},
{
CountryIsoCode: "LA",
Currencies: ["LAK"],
Decimals: 0
},
{
CountryIsoCode: "LB",
Currencies: ["LBP"],
Decimals: 0
},
{
CountryIsoCode: "LC",
Currencies: ["XCD"],
Decimals: 2
},
{
CountryIsoCode: "LI",
Currencies: ["CHF"],
Decimals: 2
},
{
CountryIsoCode: "LK",
Currencies: ["LKR"],
Decimals: 2
},
{
CountryIsoCode: "LR",
Currencies: ["LRD"],
Decimals: 2
},
{
CountryIsoCode: "LS",
Currencies: ["LSL", "ZAR"],
Decimals: 2
},
{
CountryIsoCode: "LT",
Currencies: ["EUR"],
Decimals: 2
},
{
CountryIsoCode: "LU",
Currencies: ["EUR"],
Decimals: 2
},
{
CountryIsoCode: "LV",
Currencies: ["EUR"],
Decimals: 2
},
{
CountryIsoCode: "LY",
Currencies: ["LYD"],
Decimals: 3
},
{
CountryIsoCode: "MA",
Currencies: ["MAD"],
Decimals: 2
},
{
CountryIsoCode: "MC",
Currencies: ["EUR"],
Decimals: 2
},
{
CountryIsoCode: "MD",
Currencies: ["MDL"],
Decimals: 2
},
{
CountryIsoCode: "ME",
Currencies: ["EUR"],
Decimals: 2
},
{
CountryIsoCode: "MF",
Currencies: ["EUR"],
Decimals: 2
},
{
CountryIsoCode: "MG",
Currencies: ["MGA"],
Decimals: 0
},
{
CountryIsoCode: "MH",
Currencies: ["USD"],
Decimals: 2
},
{
CountryIsoCode: "MK",
Currencies: ["MKD"],
Decimals: 0
},
{
CountryIsoCode: "ML",
Currencies: ["XOF"],
Decimals: 0
},
{
CountryIsoCode: "MM",
Currencies: ["MMK"],
Decimals: 0
},
{
CountryIsoCode: "MN",
Currencies: ["MNT"],
Decimals: 2
},
{
CountryIsoCode: "MO",
Currencies: ["MOP"],
Decimals: 2
},
{
CountryIsoCode: "MP",
Currencies: ["USD"],
Decimals: 2
},
{
CountryIsoCode: "MQ",
Currencies: ["EUR"],
Decimals: 2
},
{
CountryIsoCode: "MR",
Currencies: ["MRO"],
Decimals: 0
},
{
CountryIsoCode: "MS",
Currencies: ["XCD"],
Decimals: 2
},
{
CountryIsoCode: "MT",
Currencies: ["EUR"],
Decimals: 2
},
{
CountryIsoCode: "MU",
Currencies: ["MUR"],
Decimals: 2
},
{
CountryIsoCode: "MV",
Currencies: ["MVR"],
Decimals: 2
},
{
CountryIsoCode: "MW",
Currencies: ["MWK"],
Decimals: 2
},
{
CountryIsoCode: "MX",
Currencies: ["MXN", "MXV"],
Decimals: 2
},
{
CountryIsoCode: "MY",
Currencies: ["MYR"],
Decimals: 2
},
{
CountryIsoCode: "MZ",
Currencies: ["MZN"],
Decimals: 2
},
{
CountryIsoCode: "NA",
Currencies: ["NAD", "ZAR"],
Decimals: 2
},
{
CountryIsoCode: "NC",
Currencies: ["XPF"],
Decimals: 2
},
{
CountryIsoCode: "NE",
Currencies: ["XOF"],
Decimals: 0
},
{
CountryIsoCode: "NF",
Currencies: ["AUD"],
Decimals: 2
},
{
CountryIsoCode: "NG",
Currencies: ["NGN"],
Decimals: 2
},
{
CountryIsoCode: "NI",
Currencies: ["NIO"],
Decimals: 2
},
{
CountryIsoCode: "NL",
Currencies: ["EUR"],
Decimals: 2
},
{
CountryIsoCode: "NO",
Currencies: ["NOK"],
Decimals: 2
},
{
CountryIsoCode: "NP",
Currencies: ["NPR"],
Decimals: 2
},
{
CountryIsoCode: "NR",
Currencies: ["AUD"],
Decimals: 2
},
{
CountryIsoCode: "NU",
Currencies: ["NZD"],
Decimals: 2
},
{
CountryIsoCode: "NZ",
Currencies: ["NZD"],
Decimals: 2
},
{
CountryIsoCode: "OM",
Currencies: ["OMR"],
Decimals: 3
},
{
CountryIsoCode: "PA",
Currencies: ["PAB", "USD"],
Decimals: 2
},
{
CountryIsoCode: "PE",
Currencies: ["PEN"],
Decimals: 2
},
{
CountryIsoCode: "PF",
Currencies: ["XPF"],
Decimals: 2
},
{
CountryIsoCode: "PG",
Currencies: ["PGK"],
Decimals: 2
},
{
CountryIsoCode: "PH",
Currencies: ["PHP"],
Decimals: 2
},
{
CountryIsoCode: "PK",
Currencies: ["PKR"],
Decimals: 2
},
{
CountryIsoCode: "PL",
Currencies: ["PLN"],
Decimals: 2
},
{
CountryIsoCode: "PM",
Currencies: ["EUR"],
Decimals: 2
},
{
CountryIsoCode: "PN",
Currencies: ["NZD"],
Decimals: 2
},
{
CountryIsoCode: "PR",
Currencies: ["USD"],
Decimals: 2
},
{
CountryIsoCode: "PS",
Currencies: ["JOD", "EGP", "ILS"],
Decimals: 2
},
{
CountryIsoCode: "PT",
Currencies: ["EUR"],
Decimals: 2
},
{
CountryIsoCode: "PW",
Currencies: ["USD"],
Decimals: 2
},
{
CountryIsoCode: "PY",
Currencies: ["PYG"],
Decimals: 0
},
{
CountryIsoCode: "QA",
Currencies: ["QAR"],
Decimals: 2
},
{
CountryIsoCode: "RE",
Currencies: ["EUR"],
Decimals: 2
},
{
CountryIsoCode: "RO",
Currencies: ["RON"],
Decimals: 2
},
{
CountryIsoCode: "RS",
Currencies: ["RSD"],
Decimals: 2
},
{
CountryIsoCode: "RU",
Currencies: ["RUB"],
Decimals: 2
},
{
CountryIsoCode: "RW",
Currencies: ["RWF"],
Decimals: 0
},
{
CountryIsoCode: "SA",
Currencies: ["SAR"],
Decimals: 2
},
{
CountryIsoCode: "SB",
Currencies: ["SBD"],
Decimals: 2
},
{
CountryIsoCode: "SC",
Currencies: ["SCR"],
Decimals: 2
},
{
CountryIsoCode: "SD",
Currencies: ["SDG"],
Decimals: 2
},
{
CountryIsoCode: "SE",
Currencies: ["SEK"],
Decimals: 2
},
{
CountryIsoCode: "SG",
Currencies: ["SGD"],
Decimals: 2
},
{
CountryIsoCode: "SH",
Currencies: ["SHP"],
Decimals: 2
},
{
CountryIsoCode: "SI",
Currencies: ["EUR"],
Decimals: 2
},
{
CountryIsoCode: "SJ",
Currencies: ["NOK"],
Decimals: 2
},
{
CountryIsoCode: "SK",
Currencies: ["EUR"],
Decimals: 2
},
{
CountryIsoCode: "SL",
Currencies: ["SLL"],
Decimals: 0
},
{
CountryIsoCode: "SM",
Currencies: ["EUR"],
Decimals: 2
},
{
CountryIsoCode: "SN",
Currencies: ["XOF"],
Decimals: 0
},
{
CountryIsoCode: "SO",
Currencies: ["SOS"],
Decimals: 2
},
{
CountryIsoCode: "SR",
Currencies: ["SRD"],
Decimals: 2
},
{
CountryIsoCode: "SS",
Currencies: ["SSP"],
Decimals: 2
},
{
CountryIsoCode: "ST",
Currencies: ["STD"],
Decimals: 0
},
{
CountryIsoCode: "SV",
Currencies: ["USD"],
Decimals: 2
},
{
CountryIsoCode: "SX",
Currencies: ["ANG"],
Decimals: 2
},
{
CountryIsoCode: "SY",
Currencies: ["SYP"],
Decimals: 2
},
{
CountryIsoCode: "SZ",
Currencies: ["SZL"],
Decimals: 2
},
{
CountryIsoCode: "TA",
Currencies: ["GBP"],
Decimals: 2
},
{
CountryIsoCode: "TC",
Currencies: ["USD"],
Decimals: 2
},
{
CountryIsoCode: "TD",
Currencies: ["XOF"],
Decimals: 0
},
{
CountryIsoCode: "TF",
Currencies: ["EUR"],
Decimals: 2
},
{
CountryIsoCode: "TG",
Currencies: ["XOF"],
Decimals: 0
},
{
CountryIsoCode: "TH",
Currencies: ["THB"],
Decimals: 2
},
{
CountryIsoCode: "TJ",
Currencies: ["TJS"],
Decimals: 2
},
{
CountryIsoCode: "TK",
Currencies: ["NZD"],
Decimals: 2
},
{
CountryIsoCode: "TL",
Currencies: ["USD"],
Decimals: 2
},
{
CountryIsoCode: "TM",
Currencies: ["TMT"],
Decimals: 2
},
{
CountryIsoCode: "TN",
Currencies: ["TND"],
Decimals: 3
},
{
CountryIsoCode: "TO",
Currencies: ["TOP"],
Decimals: 2
},
{
CountryIsoCode: "TR",
Currencies: ["TRY"],
Decimals: 2
},
{
CountryIsoCode: "TT",
Currencies: ["TTD"],
Decimals: 2
},
{
CountryIsoCode: "TV",
Currencies: ["AUD"],
Decimals: 2
},
{
CountryIsoCode: "TW",
Currencies: ["TWD"],
Decimals: 2
},
{
CountryIsoCode: "TZ",
Currencies: ["TZS"],
Decimals: 2
},
{
CountryIsoCode: "UA",
Currencies: ["UAH"],
Decimals: 2
},
{
CountryIsoCode: "UG",
Currencies: ["UGX"],
Decimals: 2
},
{
CountryIsoCode: "UM",
Currencies: ["USD"],
Decimals: 2
},
{
CountryIsoCode: "US",
Currencies: ["USD"],
Decimals: 2
},
{
CountryIsoCode: "UY",
Currencies: ["UYU", "UYI"],
Decimals: 0
},
{
CountryIsoCode: "UZ",
Currencies: ["UZS"],
Decimals: 2
},
{
CountryIsoCode: "VA",
Currencies: ["EUR"],
Decimals: 2
},
{
CountryIsoCode: "VC",
Currencies: ["XCD"],
Decimals: 2
},
{
CountryIsoCode: "VE",
Currencies: ["VEF"],
Decimals: 2
},
{
CountryIsoCode: "VG",
Currencies: ["USD"],
Decimals: 2
},
{
CountryIsoCode: "VI",
Currencies: ["USD"],
Decimals: 2
},
{
CountryIsoCode: "VN",
Currencies: ["VND"],
Decimals: 0
},
{
CountryIsoCode: "VU",
Currencies: ["VUV"],
Decimals: 0
},
{
CountryIsoCode: "WF",
Currencies: ["XPF"],
Decimals: 2
},
{
CountryIsoCode: "WS",
Currencies: ["WST"],
Decimals: 2
},
{
CountryIsoCode: "XK",
Currencies: ["EUR"],
Decimals: 2
},
{
CountryIsoCode: "YE",
Currencies: ["YER"],
Decimals: 2
},
{
CountryIsoCode: "YT",
Currencies: ["EUR"],
Decimals: 2
},
{
CountryIsoCode: "ZA",
Currencies: ["ZAR"],
Decimals: 2
},
{
CountryIsoCode: "ZM",
Currencies: ["ZMW"],
Decimals: 2
},
{
CountryIsoCode: "ZW",
Currencies: ["USD", "ZAR", "BWP", "GBP", "EUR"],
Decimals: 2
}
];
// index.ts
var getCurrency = (isoCode) => {
var _a;
let currency = (_a = currencies.find((x) => x.CountryIsoCode == isoCode)) == null ? void 0 : _a.Currencies[0];
if (currency == void 0) throw new Error(`Unable to find currency for isocode: ${isoCode}`);
return currency;
};
var getCurrencies = () => {
return currencies;
};
var getDecimalsByCountryIsoCode = (isoCode) => {
var _a;
let decimal = (_a = currencies.find((x) => x.CountryIsoCode == isoCode)) == null ? void 0 : _a.Decimals;
if (decimal == void 0) throw new Error(`Unable to find decimals for isocode: ${isoCode}`);
return decimal;
};
var getDecimalsByCurrencyIsoCode = (currencyIsoCode) => {
var _a;
let decimal = (_a = currencies.find((x) => x.Currencies.find((z) => z == currencyIsoCode))) == null ? void 0 : _a.Decimals;
if (decimal == void 0) throw new Error(`Unable to find decimals for a currency with isocode: ${currencyIsoCode}`);
return decimal;
};
var getCountry = (isoCode) => {
let country = currencies.find((x) => x.CountryIsoCode == isoCode);
if (country == void 0) throw new Error(`Unable to find country for isocode: ${isoCode}`);
return country;
};
export {
getCountry,
getCurrencies,
getCurrency,
getDecimalsByCountryIsoCode,
getDecimalsByCurrencyIsoCode
};