@asefux/exchange-rates
v1.1.1
Published
aggregates currency exchange rates from multiple central banks
Downloads
7
Readme
@asefux/exchange-rates
gather exchange-rates from muiltiplie national banks
Usage
const ExchangeRates = require('@asefux/exchange-rates');
const exchangeRates = ExchangeRates();
exchangeRates.matrix()
.then((ratesMatrix)=>{
console.log(JSON.stringify(ratesMatrix, null, 2));
});
exchangeRates.rate(10, 'eur', 'usd').then(console.log); // will output how much USD is 10 EUR
Rates matrix of this format
{
[base]: {
[quote]: price
}
}
// how much quote would you get for 1 unit of base
Sources
- [x] Bank of Canada / Banqueu du Canada
- [x] Danmark National Bank
- [x] Bank of Estonia / Eesti Pank
- [x] Bank of Sweden / Sveriges Riksbank
- [x] Bank of Norway / Norges Bank
- [x] European Central Bank
- [x] Bank of Romania / Banca Nationala a Romaniei
- [x] Bank of Bulgaria
- [ ] Bank of Hungary / Magyar Nemzeti Bank
- [ ] Bank of Netherlands / De Nederlandsche Bank
- [ ] Bank of England
- [ ] Bank of France / Banque de France
- [ ] Bank of Spain / Banco de Espana
- [ ] Bank of Portugal / Banco de Portugal
- [ ] Bank of Italy / Banca d'Italia
- [ ] Bank of Germany / Deutsche Bundesbank
- [ ] Bank of Slovenia / Banka Slovenije
- [ ] Bank of Czech Republic / Ceska Narodni Banka
- [ ] Bank of Lithuania / Lietuvos Bankas
- [ ] Bank of Latvia / Latvijas Banka
- [ ] Bank of Slovakia / Narodna Banka Slovenska
- [ ] Bank of Poland / Narodowy Bank Polski
- [ ] Bank of Croatia / Hrvatska Narodna Banka
- [ ] Bank of Serbia
- [ ] Bank of Greece
- [ ] Bank of Ireland / Banc Ceannais na heireann
- [ ] Bank of Malta / Bank Centrali ta'Malta
- [ ] Bank of Cyprus
- [ ] Bank of Luxembourg / Banque Centrale du Luxembourg
- [ ] Bank of Belgium / Banque Nationale de Belgique / Bank van Belgie
- [ ] Bank of Austria / Oesterreichische Nationalbank
- [ ] Bank of Bosnia and Herzegovina / Centralna Banka Bosne I Hergegovine
- [ ] Bank of Australia
- [ ] Bank of Albania / Banka e Shqiperise
- [ ] Bank of Armenia
- [ ] Bank of Belarus
- [ ] Bank of Argentina / Banco Central de la Republica Argentina
- [ ] Central Bank of Brasil / Banco Central Do Brasil
- [ ] Bank of Chile / Banco Central de Chile
[ ] Bank of Finland / Suomen Pankki - same as ECB
[ ] Others
Changes
| Version | Changes | |-------------|-----------------| | 1.0.0 | initial code | | 1.0.1 | update api | | 1.1.0 | Bank of Bulgaria| | 1.1.1 | on weekends get rates of last working day|