boc-exchange-rate 1.0.0 → 1.1.0
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/LICENSE +21 -0
- package/README.md +12 -4
- package/index.cjs +1 -1
- package/index.mjs +1 -1
- package/package.json +9 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 AllRatesToday (https://allratestoday.com)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Bank of Canada Exchange Rate API client
|
|
2
2
|
|
|
3
|
-
Official **Bank of Canada** (Canada) daily exchange rates in Node.js / TypeScript —
|
|
3
|
+
Official **Bank of Canada** (Canada) daily exchange rates in Node.js / TypeScript — 24 currencies against the CAD, with history back to 2017. Zero dependencies, works in Node 18+, Bun, Deno, and edge runtimes (uses global `fetch`).
|
|
4
4
|
|
|
5
|
-
These are the *published central bank rates* required for tax filings, customs valuations, audits, and compliant invoicing — not moving market rates. Every response carries the
|
|
5
|
+
These are the *published central bank 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/central-bank-rates-api/boc/). Get a free API key at [allratestoday.com/register](https://allratestoday.com/register) —
|
|
7
|
+
Powered by [AllRatesToday](https://allratestoday.com/central-bank-rates-api/boc/). 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
|
+
Bank of Canada currently publishes rates covering **25 currencies** (as of the latest table):
|
|
48
|
+
|
|
49
|
+
`AUD` · `BRL` · `CAD` · `CHF` · `CNY` · `EUR` · `GBP` · `HKD` · `IDR` · `INR` · `JPY` · `KRW` · `MXN` · `MYR` · `NOK` · `NZD` · `PEN` · `PLN` · `SEK` · `SGD` · `THB` · `TRY` · `TWD` · `USD` · `ZAR`
|
|
50
|
+
|
|
51
|
+
Pairs the central bank does not print directly are resolved from this table (see below).
|
|
52
|
+
|
|
45
53
|
## Published vs derived rates
|
|
46
54
|
|
|
47
55
|
If Bank of Canada does not print a pair directly, the API resolves it from the bank's table (inverse, or a cross rate via CAD) and flags it `derived: true` with the `method` — so official and computed values are never confused.
|
|
@@ -50,7 +58,7 @@ If Bank of Canada does not print a pair directly, the API resolves it from the b
|
|
|
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: [central bank rates API](https://allratestoday.com/central-bank-rates-api/)
|
|
54
62
|
|
|
55
63
|
## License
|
|
56
64
|
|
package/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
// Bank of Canada exchange rates via the AllRatesToday API.
|
|
3
3
|
const BASE = 'https://allratestoday.com/api/v1/central-bank/boc';
|
|
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
|
// Bank of Canada exchange rates via the AllRatesToday API.
|
|
2
2
|
const BASE = 'https://allratestoday.com/api/v1/central-bank/boc';
|
|
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": "boc-exchange-rate",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Official Bank of Canada (Canada) daily exchange rates —
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Official Bank of Canada (Canada) daily exchange rates — 24 currencies vs CAD, history since 2017. Zero-dependency Node.js/TypeScript client.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"boc",
|
|
7
7
|
"bank",
|
|
@@ -20,8 +20,12 @@
|
|
|
20
20
|
"typescript"
|
|
21
21
|
],
|
|
22
22
|
"homepage": "https://allratestoday.com/central-bank-rates-api/boc/",
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://github.com/AllRates-Today/boc-exchange-rate.git"
|
|
26
|
+
},
|
|
23
27
|
"bugs": {
|
|
24
|
-
"url": "https://
|
|
28
|
+
"url": "https://github.com/AllRates-Today/boc-exchange-rate/issues"
|
|
25
29
|
},
|
|
26
30
|
"license": "MIT",
|
|
27
31
|
"author": "AllRatesToday <hello@allratestoday.com> (https://allratestoday.com)",
|
|
@@ -40,7 +44,8 @@
|
|
|
40
44
|
"index.mjs",
|
|
41
45
|
"index.cjs",
|
|
42
46
|
"index.d.ts",
|
|
43
|
-
"README.md"
|
|
47
|
+
"README.md",
|
|
48
|
+
"LICENSE"
|
|
44
49
|
],
|
|
45
50
|
"engines": {
|
|
46
51
|
"node": ">=18"
|