@allratestoday/hmrc-exchange-rate 1.0.2 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -3
- package/index.cjs +1 -1
- package/index.mjs +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# HM Revenue & Customs Exchange Rate API client
|
|
2
2
|
|
|
3
|
-
Official **HM Revenue & Customs** (the United Kingdom) monthly exchange rates in Node.js / TypeScript —
|
|
3
|
+
Official **HM Revenue & Customs** (the United Kingdom) monthly exchange rates in Node.js / TypeScript — 141 currencies against the GBP, with history back to 2021. Zero dependencies, works in Node 18+, Bun, Deno, and edge runtimes (uses global `fetch`).
|
|
4
4
|
|
|
5
5
|
These are the *published tax authority rates* required for tax filings, customs valuations, audits, and compliant invoicing — not moving market rates. Every response carries the publisher's own publication date.
|
|
6
6
|
|
|
7
|
-
Powered by [AllRatesToday](https://allratestoday.com/
|
|
7
|
+
Powered by [AllRatesToday](https://allratestoday.com/tax-authority-rates-api/hmrc/). Get a free API key at [allratestoday.com/register](https://allratestoday.com/register) — no credit card required.
|
|
8
8
|
|
|
9
9
|
## Install
|
|
10
10
|
|
|
@@ -42,6 +42,14 @@ const series = await getHistory(
|
|
|
42
42
|
);
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
+
## Currencies covered
|
|
46
|
+
|
|
47
|
+
HM Revenue & Customs currently publishes rates covering **142 currencies** (as of the latest table):
|
|
48
|
+
|
|
49
|
+
`AED` · `ALL` · `AMD` · `AOA` · `ARS` · `AUD` · `AWG` · `AZN` · `BAM` · `BBD` · `BDT` · `BHD` · `BIF` · `BMD` · `BND` · `BOB` · `BRL` · `BSD` · `BTN` · `BWP` · `BYN` · `BZD` · `CAD` · `CDF` · `CHF` · `CLP` · `CNY` · `COP` · `CRC` · `CUP` · `CVE` · `CZK` · `DJF` · `DKK` · `DOP` · `DZD` · `EGP` · `ERN` · `ETB` · `EUR` · `FJD` · `GBP` · `GEL` · `GHS` · `GMD` · `GNF` · `GTQ` · `GYD` · `HKD` · `HNL` · `HTG` · `HUF` · `IDR` · `ILS` · `INR` · `IQD` · `ISK` · `JMD` · `JOD` · `JPY` · `KES` · `KGS` · `KHR` · `KMF` · `KRW` · `KWD` · `KYD` · `KZT` · `LAK` · `LBP` · `LKR` · `LRD` · `LSL` · `LYD` · `MAD` · `MDL` · `MGA` · `MKD` · `MMK` · `MNT` · `MOP` · `MRU` · `MUR` · `MVR` · `MWK` · `MXN` · `MYR` · `MZN` · `NGN` · `NIO` · `NOK` · `NPR` · `NZD` · `OMR` · `PAB` · `PEN` · `PGK` · `PHP` · `PKR` · `PLN` · `PYG` · `QAR` · `RON` · `RSD` · `RUB` · `RWF` · `SAR` · `SBD` · `SCR` · `SDG` · `SEK` · `SGD` · `SLE` · `SOS` · `SRD` · `SVC` · `SZL` · `THB` · `TMT` · `TND` · `TOP` · `TRY` · `TTD` · `TWD` · `TZS` · `UAH` · `UGX` · `USD` · `UYU` · `UZS` · `VES` · `VND` · `VUV` · `WST` · `XAF` · `XCD` · `XOF` · `XPF` · `YER` · `ZAR` · `ZMW` · `ZWG`
|
|
50
|
+
|
|
51
|
+
Pairs the tax authority does not print directly are resolved from this table (see below).
|
|
52
|
+
|
|
45
53
|
## Published vs derived rates
|
|
46
54
|
|
|
47
55
|
If HM Revenue & Customs does not print a pair directly, the API resolves it from the bank's table (inverse, or a cross rate via GBP) and flags it `derived: true` with the `method` — so official and computed values are never confused.
|
|
@@ -50,7 +58,7 @@ If HM Revenue & Customs does not print a pair directly, the API resolves it from
|
|
|
50
58
|
|
|
51
59
|
- Every request counts toward your AllRatesToday monthly quota. Rates change once per business day — cache a day's table locally and a small quota goes a long way.
|
|
52
60
|
- Latest rates are on every plan (including free); historical dates and time series need a [paid plan](https://allratestoday.com/pricing/).
|
|
53
|
-
- Full API reference: [allratestoday.com/docs#central-bank](https://allratestoday.com/docs/#central-bank) · All covered
|
|
61
|
+
- Full API reference: [allratestoday.com/docs#central-bank](https://allratestoday.com/docs/#central-bank) · All covered sources: [tax authority rates API](https://allratestoday.com/tax-authority-rates-api/)
|
|
54
62
|
|
|
55
63
|
## License
|
|
56
64
|
|
package/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
// HM Revenue & Customs exchange rates via the AllRatesToday API.
|
|
3
3
|
const BASE = 'https://allratestoday.com/api/v1/central-bank/hmrc';
|
|
4
|
-
const KEY_HINT = 'An apiKey is required — get a free key at https://allratestoday.com/register (
|
|
4
|
+
const KEY_HINT = 'An apiKey is required — get a free key at https://allratestoday.com/register (no credit card required).';
|
|
5
5
|
|
|
6
6
|
async function request(path, params, options) {
|
|
7
7
|
const apiKey = options && options.apiKey;
|
package/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// HM Revenue & Customs exchange rates via the AllRatesToday API.
|
|
2
2
|
const BASE = 'https://allratestoday.com/api/v1/central-bank/hmrc';
|
|
3
|
-
const KEY_HINT = 'An apiKey is required — get a free key at https://allratestoday.com/register (
|
|
3
|
+
const KEY_HINT = 'An apiKey is required — get a free key at https://allratestoday.com/register (no credit card required).';
|
|
4
4
|
|
|
5
5
|
async function request(path, params, options) {
|
|
6
6
|
const apiKey = options && options.apiKey;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allratestoday/hmrc-exchange-rate",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Official HM Revenue & Customs (United Kingdom) monthly exchange rates —
|
|
3
|
+
"version": "1.1.2",
|
|
4
|
+
"description": "Official HM Revenue & Customs (United Kingdom) monthly exchange rates — 141 currencies vs GBP, history since 2021. Zero-dependency Node.js/TypeScript client.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"hmrc",
|
|
7
7
|
"hm",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"api",
|
|
21
21
|
"typescript"
|
|
22
22
|
],
|
|
23
|
-
"homepage": "https://allratestoday.com/
|
|
23
|
+
"homepage": "https://allratestoday.com/tax-authority-rates-api/hmrc/",
|
|
24
24
|
"repository": {
|
|
25
25
|
"type": "git",
|
|
26
26
|
"url": "git+https://github.com/AllRates-Today/hmrc-exchange-rate.git"
|