@depay/local-currency
Advanced tools
Comparing version 3.1.0 to 3.2.1
@@ -439,7 +439,5 @@ var timezoneToCurrency = { | ||
static async fromUSD({ amount, code, timeZone, apiKey }) { | ||
static async fromUSD({ amount, code, timeZone }) { | ||
let currency = new Currency({ amount, code, timeZone }); | ||
let rate = await fetch('https://api.depay.fi/v2/currencies/' + currency.code, { | ||
headers: { 'X-Api-Key': apiKey }, | ||
}) | ||
let rate = await fetch('https://public.depay.fi/currencies/' + currency.code) | ||
.then((response) => response.json()) | ||
@@ -446,0 +444,0 @@ .then((data) => parseFloat(data)); |
@@ -445,7 +445,5 @@ (function (global, factory) { | ||
static async fromUSD({ amount, code, timeZone, apiKey }) { | ||
static async fromUSD({ amount, code, timeZone }) { | ||
let currency = new Currency({ amount, code, timeZone }); | ||
let rate = await fetch('https://api.depay.fi/v2/currencies/' + currency.code, { | ||
headers: { 'X-Api-Key': apiKey }, | ||
}) | ||
let rate = await fetch('https://public.depay.fi/currencies/' + currency.code) | ||
.then((response) => response.json()) | ||
@@ -452,0 +450,0 @@ .then((data) => parseFloat(data)); |
{ | ||
"name": "@depay/local-currency", | ||
"moduleName": "LocalCurrency", | ||
"version": "3.1.0", | ||
"version": "3.2.1", | ||
"description": "JavaScript library that detects user's local currency and provides functionalities to convert between multiple currencies.", | ||
@@ -6,0 +6,0 @@ "main": "dist/umd/index.js", |
@@ -54,3 +54,3 @@ ## Quickstart | ||
```javascript | ||
let currency = await Currency.fromUSD({ amount: 20, apiKey: 'MY-API-KEY' }) | ||
let currency = await Currency.fromUSD({ amount: 20 }) | ||
currency.toString() | ||
@@ -60,6 +60,2 @@ // €16.88 | ||
Requires you to pass an `apiKey` in order to convert currencies! | ||
See: https://depay.fi/documentation/api#fiat | ||
### getCode | ||
@@ -66,0 +62,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31635
915
82