@ducatjs/money 0.1.0 → 0.2.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/README.md +479 -62
- package/data/cash-rounding.json +123 -2
- package/data/cldr-cash.json +101 -0
- package/data/historic.json +78 -0
- package/data/iso4217-list-three.xml +1185 -0
- package/dist/adyen-fx.d.ts.map +1 -1
- package/dist/adyen-fx.js +22 -4
- package/dist/adyen-fx.js.map +1 -1
- package/dist/boc.d.ts +31 -0
- package/dist/boc.d.ts.map +1 -0
- package/dist/boc.js +114 -0
- package/dist/boc.js.map +1 -0
- package/dist/boe.d.ts +33 -0
- package/dist/boe.d.ts.map +1 -0
- package/dist/boe.js +114 -0
- package/dist/boe.js.map +1 -0
- package/dist/cash.d.ts +30 -1
- package/dist/cash.d.ts.map +1 -1
- package/dist/cash.js +50 -2
- package/dist/cash.js.map +1 -1
- package/dist/convert.d.ts +10 -9
- package/dist/convert.d.ts.map +1 -1
- package/dist/convert.js +13 -3
- package/dist/convert.js.map +1 -1
- package/dist/drizzle/mysql.d.ts +105 -0
- package/dist/drizzle/mysql.d.ts.map +1 -0
- package/dist/drizzle/mysql.js +60 -0
- package/dist/drizzle/mysql.js.map +1 -0
- package/dist/drizzle/pg.d.ts +103 -0
- package/dist/drizzle/pg.d.ts.map +1 -0
- package/dist/drizzle/pg.js +60 -0
- package/dist/drizzle/pg.js.map +1 -0
- package/dist/drizzle/sqlite.d.ts +102 -0
- package/dist/drizzle/sqlite.d.ts.map +1 -0
- package/dist/drizzle/sqlite.js +59 -0
- package/dist/drizzle/sqlite.js.map +1 -0
- package/dist/ecb.d.ts +37 -2
- package/dist/ecb.d.ts.map +1 -1
- package/dist/ecb.js +148 -10
- package/dist/ecb.js.map +1 -1
- package/dist/fed.d.ts +35 -0
- package/dist/fed.d.ts.map +1 -0
- package/dist/fed.js +134 -0
- package/dist/fed.js.map +1 -0
- package/dist/fetch.d.ts +45 -0
- package/dist/fetch.d.ts.map +1 -1
- package/dist/fetch.js +167 -24
- package/dist/fetch.js.map +1 -1
- package/dist/fn.d.ts +8 -1
- package/dist/fn.d.ts.map +1 -1
- package/dist/fn.js +8 -1
- package/dist/fn.js.map +1 -1
- package/dist/generated/cash.d.ts +2 -0
- package/dist/generated/cash.d.ts.map +1 -1
- package/dist/generated/cash.js +101 -0
- package/dist/generated/cash.js.map +1 -1
- package/dist/generated/historic.d.ts +337 -0
- package/dist/generated/historic.d.ts.map +1 -0
- package/dist/generated/historic.js +66 -0
- package/dist/generated/historic.js.map +1 -0
- package/dist/historic.d.ts +40 -0
- package/dist/historic.d.ts.map +1 -0
- package/dist/historic.js +43 -0
- package/dist/historic.js.map +1 -0
- package/dist/history.d.ts +96 -0
- package/dist/history.d.ts.map +1 -0
- package/dist/history.js +213 -0
- package/dist/history.js.map +1 -0
- package/dist/hmrc.d.ts +28 -0
- package/dist/hmrc.d.ts.map +1 -0
- package/dist/hmrc.js +108 -0
- package/dist/hmrc.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/kysely.d.ts +120 -0
- package/dist/kysely.d.ts.map +1 -0
- package/dist/kysely.js +309 -0
- package/dist/kysely.js.map +1 -0
- package/dist/money.d.ts +93 -9
- package/dist/money.d.ts.map +1 -1
- package/dist/money.js +135 -9
- package/dist/money.js.map +1 -1
- package/dist/parse.d.ts +45 -1
- package/dist/parse.d.ts.map +1 -1
- package/dist/parse.js +290 -3
- package/dist/parse.js.map +1 -1
- package/dist/pg.d.ts +100 -0
- package/dist/pg.d.ts.map +1 -0
- package/dist/pg.js +343 -0
- package/dist/pg.js.map +1 -0
- package/dist/plugins/all.d.ts +8 -1
- package/dist/plugins/all.d.ts.map +1 -1
- package/dist/plugins/all.js +8 -1
- package/dist/plugins/all.js.map +1 -1
- package/dist/plugins/convert.d.ts +3 -4
- package/dist/plugins/convert.d.ts.map +1 -1
- package/dist/plugins/convert.js.map +1 -1
- package/dist/plugins/tax.d.ts +4 -5
- package/dist/plugins/tax.d.ts.map +1 -1
- package/dist/plugins/tax.js.map +1 -1
- package/dist/policy.d.ts +34 -0
- package/dist/policy.d.ts.map +1 -0
- package/dist/policy.js +90 -0
- package/dist/policy.js.map +1 -0
- package/dist/prisma.d.ts +25 -14
- package/dist/prisma.d.ts.map +1 -1
- package/dist/prisma.js +29 -19
- package/dist/prisma.js.map +1 -1
- package/dist/provider.d.ts +21 -7
- package/dist/provider.d.ts.map +1 -1
- package/dist/provider.js +51 -11
- package/dist/provider.js.map +1 -1
- package/dist/rate-text.d.ts +38 -0
- package/dist/rate-text.d.ts.map +1 -0
- package/dist/rate-text.js +143 -0
- package/dist/rate-text.js.map +1 -0
- package/dist/rate.d.ts +61 -5
- package/dist/rate.d.ts.map +1 -1
- package/dist/rate.js +133 -33
- package/dist/rate.js.map +1 -1
- package/dist/rounding.js +1 -1
- package/dist/rounding.js.map +1 -1
- package/dist/schema.d.ts +43 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +77 -0
- package/dist/schema.js.map +1 -0
- package/dist/sql.d.ts +54 -0
- package/dist/sql.d.ts.map +1 -0
- package/dist/sql.js +131 -0
- package/dist/sql.js.map +1 -0
- package/dist/tax.d.ts +13 -9
- package/dist/tax.d.ts.map +1 -1
- package/dist/tax.js +20 -4
- package/dist/tax.js.map +1 -1
- package/dist/testing/arbitraries.d.ts +43 -0
- package/dist/testing/arbitraries.d.ts.map +1 -0
- package/dist/testing/arbitraries.js +98 -0
- package/dist/testing/arbitraries.js.map +1 -0
- package/dist/testing/index.d.ts +67 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +159 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/jest.d.ts +2 -0
- package/dist/testing/jest.d.ts.map +1 -0
- package/dist/testing/jest.js +15 -0
- package/dist/testing/jest.js.map +1 -0
- package/dist/testing/vitest.d.ts +7 -0
- package/dist/testing/vitest.d.ts.map +1 -0
- package/dist/testing/vitest.js +12 -0
- package/dist/testing/vitest.js.map +1 -0
- package/dist/valibot.d.ts +33 -0
- package/dist/valibot.d.ts.map +1 -0
- package/dist/valibot.js +61 -0
- package/dist/valibot.js.map +1 -0
- package/dist/zod.d.ts +36 -0
- package/dist/zod.d.ts.map +1 -0
- package/dist/zod.js +58 -0
- package/dist/zod.js.map +1 -0
- package/package.json +116 -5
- package/src/adyen-fx.ts +25 -4
- package/src/boc.ts +136 -0
- package/src/boe.ts +131 -0
- package/src/cash.ts +70 -2
- package/src/convert.ts +33 -15
- package/src/drizzle/mysql.ts +78 -0
- package/src/drizzle/pg.ts +78 -0
- package/src/drizzle/sqlite.ts +70 -0
- package/src/ecb.ts +179 -13
- package/src/fed.ts +146 -0
- package/src/fetch.ts +207 -28
- package/src/fn.ts +14 -0
- package/src/generated/cash.ts +103 -0
- package/src/generated/historic.ts +67 -0
- package/src/historic.ts +77 -0
- package/src/history.ts +333 -0
- package/src/hmrc.ts +125 -0
- package/src/index.ts +4 -0
- package/src/kysely.ts +588 -0
- package/src/money.ts +210 -12
- package/src/parse.ts +371 -4
- package/src/pg.ts +410 -0
- package/src/plugins/all.ts +10 -0
- package/src/plugins/convert.ts +4 -5
- package/src/plugins/tax.ts +9 -10
- package/src/policy.ts +124 -0
- package/src/prisma.ts +91 -10
- package/src/provider.ts +81 -16
- package/src/rate-text.ts +151 -0
- package/src/rate.ts +205 -36
- package/src/rounding.ts +1 -1
- package/src/schema.ts +119 -0
- package/src/sql.ts +178 -0
- package/src/tax.ts +40 -9
- package/src/testing/arbitraries.ts +134 -0
- package/src/testing/index.ts +247 -0
- package/src/testing/jest.ts +18 -0
- package/src/testing/vitest.ts +18 -0
- package/src/valibot.ts +87 -0
- package/src/zod.ts +78 -0
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
/** Publication date of the ISO 4217 List Three snapshot. */
|
|
2
|
+
export declare const ISO_4217_LIST_THREE_PUBLISHED = "2026-01-01";
|
|
3
|
+
/**
|
|
4
|
+
* Withdrawn ISO 4217 codes (with `numeric` and `withdrawn`, the year and month ISO lists) and
|
|
5
|
+
* non-ISO codes (without them), each with the exponent ISO gave it while it was current.
|
|
6
|
+
*/
|
|
7
|
+
export declare const HISTORIC_CURRENCY_TABLE: {
|
|
8
|
+
readonly ADP: {
|
|
9
|
+
readonly name: "Andorran Peseta";
|
|
10
|
+
readonly numeric: "020";
|
|
11
|
+
readonly exponent: 0;
|
|
12
|
+
readonly withdrawn: "2003-07";
|
|
13
|
+
};
|
|
14
|
+
readonly AFA: {
|
|
15
|
+
readonly name: "Afghani";
|
|
16
|
+
readonly numeric: "004";
|
|
17
|
+
readonly exponent: 2;
|
|
18
|
+
readonly withdrawn: "2003-01";
|
|
19
|
+
};
|
|
20
|
+
readonly ANG: {
|
|
21
|
+
readonly name: "Netherlands Antillean Guilder";
|
|
22
|
+
readonly numeric: "532";
|
|
23
|
+
readonly exponent: 2;
|
|
24
|
+
readonly withdrawn: "2025-03";
|
|
25
|
+
};
|
|
26
|
+
readonly ATS: {
|
|
27
|
+
readonly name: "Schilling";
|
|
28
|
+
readonly numeric: "040";
|
|
29
|
+
readonly exponent: 2;
|
|
30
|
+
readonly withdrawn: "2002-03";
|
|
31
|
+
};
|
|
32
|
+
readonly AYM: {
|
|
33
|
+
readonly name: "Azerbaijan Manat";
|
|
34
|
+
readonly numeric: "945";
|
|
35
|
+
readonly exponent: 2;
|
|
36
|
+
readonly withdrawn: "2005-10";
|
|
37
|
+
};
|
|
38
|
+
readonly AZM: {
|
|
39
|
+
readonly name: "Azerbaijanian Manat";
|
|
40
|
+
readonly numeric: "031";
|
|
41
|
+
readonly exponent: 2;
|
|
42
|
+
readonly withdrawn: "2005-12";
|
|
43
|
+
};
|
|
44
|
+
readonly BEF: {
|
|
45
|
+
readonly name: "Belgian Franc";
|
|
46
|
+
readonly numeric: "056";
|
|
47
|
+
readonly exponent: 0;
|
|
48
|
+
readonly withdrawn: "2002-03";
|
|
49
|
+
};
|
|
50
|
+
readonly BGL: {
|
|
51
|
+
readonly name: "Lev";
|
|
52
|
+
readonly numeric: "100";
|
|
53
|
+
readonly exponent: 2;
|
|
54
|
+
readonly withdrawn: "2003-11";
|
|
55
|
+
};
|
|
56
|
+
readonly BGN: {
|
|
57
|
+
readonly name: "Bulgarian Lev";
|
|
58
|
+
readonly numeric: "975";
|
|
59
|
+
readonly exponent: 2;
|
|
60
|
+
readonly withdrawn: "2026-01";
|
|
61
|
+
};
|
|
62
|
+
readonly BYB: {
|
|
63
|
+
readonly name: "Belarusian Ruble";
|
|
64
|
+
readonly numeric: "112";
|
|
65
|
+
readonly exponent: 0;
|
|
66
|
+
readonly withdrawn: "2001-01";
|
|
67
|
+
};
|
|
68
|
+
readonly BYR: {
|
|
69
|
+
readonly name: "Belarusian Ruble";
|
|
70
|
+
readonly numeric: "974";
|
|
71
|
+
readonly exponent: 0;
|
|
72
|
+
readonly withdrawn: "2017-01";
|
|
73
|
+
};
|
|
74
|
+
readonly CNH: {
|
|
75
|
+
readonly name: "Chinese Yuan Renminbi (offshore)";
|
|
76
|
+
readonly exponent: 2;
|
|
77
|
+
};
|
|
78
|
+
readonly CSD: {
|
|
79
|
+
readonly name: "Serbian Dinar";
|
|
80
|
+
readonly numeric: "891";
|
|
81
|
+
readonly exponent: 2;
|
|
82
|
+
readonly withdrawn: "2006-10";
|
|
83
|
+
};
|
|
84
|
+
readonly CUC: {
|
|
85
|
+
readonly name: "Peso Convertible";
|
|
86
|
+
readonly numeric: "931";
|
|
87
|
+
readonly exponent: 2;
|
|
88
|
+
readonly withdrawn: "2021-06";
|
|
89
|
+
};
|
|
90
|
+
readonly CYP: {
|
|
91
|
+
readonly name: "Cyprus Pound";
|
|
92
|
+
readonly numeric: "196";
|
|
93
|
+
readonly exponent: 2;
|
|
94
|
+
readonly withdrawn: "2008-01";
|
|
95
|
+
};
|
|
96
|
+
readonly DEM: {
|
|
97
|
+
readonly name: "Deutsche Mark";
|
|
98
|
+
readonly numeric: "276";
|
|
99
|
+
readonly exponent: 2;
|
|
100
|
+
readonly withdrawn: "2002-03";
|
|
101
|
+
};
|
|
102
|
+
readonly EEK: {
|
|
103
|
+
readonly name: "Kroon";
|
|
104
|
+
readonly numeric: "233";
|
|
105
|
+
readonly exponent: 2;
|
|
106
|
+
readonly withdrawn: "2011-01";
|
|
107
|
+
};
|
|
108
|
+
readonly ESP: {
|
|
109
|
+
readonly name: "Spanish Peseta";
|
|
110
|
+
readonly numeric: "724";
|
|
111
|
+
readonly exponent: 0;
|
|
112
|
+
readonly withdrawn: "2002-03";
|
|
113
|
+
};
|
|
114
|
+
readonly FIM: {
|
|
115
|
+
readonly name: "Markka";
|
|
116
|
+
readonly numeric: "246";
|
|
117
|
+
readonly exponent: 2;
|
|
118
|
+
readonly withdrawn: "2002-03";
|
|
119
|
+
};
|
|
120
|
+
readonly FRF: {
|
|
121
|
+
readonly name: "French Franc";
|
|
122
|
+
readonly numeric: "250";
|
|
123
|
+
readonly exponent: 2;
|
|
124
|
+
readonly withdrawn: "2002-03";
|
|
125
|
+
};
|
|
126
|
+
readonly GHC: {
|
|
127
|
+
readonly name: "Cedi";
|
|
128
|
+
readonly numeric: "288";
|
|
129
|
+
readonly exponent: 2;
|
|
130
|
+
readonly withdrawn: "2008-01";
|
|
131
|
+
};
|
|
132
|
+
readonly GRD: {
|
|
133
|
+
readonly name: "Drachma";
|
|
134
|
+
readonly numeric: "300";
|
|
135
|
+
readonly exponent: 0;
|
|
136
|
+
readonly withdrawn: "2002-03";
|
|
137
|
+
};
|
|
138
|
+
readonly GWP: {
|
|
139
|
+
readonly name: "Guinea-Bissau Peso";
|
|
140
|
+
readonly numeric: "624";
|
|
141
|
+
readonly exponent: 2;
|
|
142
|
+
readonly withdrawn: "1997-05";
|
|
143
|
+
};
|
|
144
|
+
readonly HRK: {
|
|
145
|
+
readonly name: "Kuna";
|
|
146
|
+
readonly numeric: "191";
|
|
147
|
+
readonly exponent: 2;
|
|
148
|
+
readonly withdrawn: "2023-01";
|
|
149
|
+
};
|
|
150
|
+
readonly IEP: {
|
|
151
|
+
readonly name: "Irish Pound";
|
|
152
|
+
readonly numeric: "372";
|
|
153
|
+
readonly exponent: 2;
|
|
154
|
+
readonly withdrawn: "2002-03";
|
|
155
|
+
};
|
|
156
|
+
readonly ITL: {
|
|
157
|
+
readonly name: "Italian Lira";
|
|
158
|
+
readonly numeric: "380";
|
|
159
|
+
readonly exponent: 0;
|
|
160
|
+
readonly withdrawn: "2002-03";
|
|
161
|
+
};
|
|
162
|
+
readonly LTL: {
|
|
163
|
+
readonly name: "Lithuanian Litas";
|
|
164
|
+
readonly numeric: "440";
|
|
165
|
+
readonly exponent: 2;
|
|
166
|
+
readonly withdrawn: "2014-12";
|
|
167
|
+
};
|
|
168
|
+
readonly LUF: {
|
|
169
|
+
readonly name: "Luxembourg Franc";
|
|
170
|
+
readonly numeric: "442";
|
|
171
|
+
readonly exponent: 0;
|
|
172
|
+
readonly withdrawn: "2002-03";
|
|
173
|
+
};
|
|
174
|
+
readonly LVL: {
|
|
175
|
+
readonly name: "Latvian Lats";
|
|
176
|
+
readonly numeric: "428";
|
|
177
|
+
readonly exponent: 2;
|
|
178
|
+
readonly withdrawn: "2014-01";
|
|
179
|
+
};
|
|
180
|
+
readonly MGF: {
|
|
181
|
+
readonly name: "Malagasy Franc";
|
|
182
|
+
readonly numeric: "450";
|
|
183
|
+
readonly exponent: 0;
|
|
184
|
+
readonly withdrawn: "2004-12";
|
|
185
|
+
};
|
|
186
|
+
readonly MRO: {
|
|
187
|
+
readonly name: "Ouguiya";
|
|
188
|
+
readonly numeric: "478";
|
|
189
|
+
readonly exponent: 2;
|
|
190
|
+
readonly withdrawn: "2017-12";
|
|
191
|
+
};
|
|
192
|
+
readonly MTL: {
|
|
193
|
+
readonly name: "Maltese Lira";
|
|
194
|
+
readonly numeric: "470";
|
|
195
|
+
readonly exponent: 2;
|
|
196
|
+
readonly withdrawn: "2008-01";
|
|
197
|
+
};
|
|
198
|
+
readonly MZM: {
|
|
199
|
+
readonly name: "Mozambique Metical";
|
|
200
|
+
readonly numeric: "508";
|
|
201
|
+
readonly exponent: 2;
|
|
202
|
+
readonly withdrawn: "2006-06";
|
|
203
|
+
};
|
|
204
|
+
readonly NLG: {
|
|
205
|
+
readonly name: "Netherlands Guilder";
|
|
206
|
+
readonly numeric: "528";
|
|
207
|
+
readonly exponent: 2;
|
|
208
|
+
readonly withdrawn: "2002-03";
|
|
209
|
+
};
|
|
210
|
+
readonly PTE: {
|
|
211
|
+
readonly name: "Portuguese Escudo";
|
|
212
|
+
readonly numeric: "620";
|
|
213
|
+
readonly exponent: 0;
|
|
214
|
+
readonly withdrawn: "2002-03";
|
|
215
|
+
};
|
|
216
|
+
readonly ROL: {
|
|
217
|
+
readonly name: "Old Leu";
|
|
218
|
+
readonly numeric: "642";
|
|
219
|
+
readonly exponent: 0;
|
|
220
|
+
readonly withdrawn: "2005-06";
|
|
221
|
+
};
|
|
222
|
+
readonly RUR: {
|
|
223
|
+
readonly name: "Russian Ruble";
|
|
224
|
+
readonly numeric: "810";
|
|
225
|
+
readonly exponent: 2;
|
|
226
|
+
readonly withdrawn: "2004-01";
|
|
227
|
+
};
|
|
228
|
+
readonly SDD: {
|
|
229
|
+
readonly name: "Sudanese Dinar";
|
|
230
|
+
readonly numeric: "736";
|
|
231
|
+
readonly exponent: 2;
|
|
232
|
+
readonly withdrawn: "2007-07";
|
|
233
|
+
};
|
|
234
|
+
readonly SIT: {
|
|
235
|
+
readonly name: "Tolar";
|
|
236
|
+
readonly numeric: "705";
|
|
237
|
+
readonly exponent: 2;
|
|
238
|
+
readonly withdrawn: "2007-01";
|
|
239
|
+
};
|
|
240
|
+
readonly SKK: {
|
|
241
|
+
readonly name: "Slovak Koruna";
|
|
242
|
+
readonly numeric: "703";
|
|
243
|
+
readonly exponent: 2;
|
|
244
|
+
readonly withdrawn: "2009-01";
|
|
245
|
+
};
|
|
246
|
+
readonly SLL: {
|
|
247
|
+
readonly name: "Leone";
|
|
248
|
+
readonly numeric: "694";
|
|
249
|
+
readonly exponent: 2;
|
|
250
|
+
readonly withdrawn: "2023-12";
|
|
251
|
+
};
|
|
252
|
+
readonly SRG: {
|
|
253
|
+
readonly name: "Surinam Guilder";
|
|
254
|
+
readonly numeric: "740";
|
|
255
|
+
readonly exponent: 2;
|
|
256
|
+
readonly withdrawn: "2003-12";
|
|
257
|
+
};
|
|
258
|
+
readonly STD: {
|
|
259
|
+
readonly name: "Dobra";
|
|
260
|
+
readonly numeric: "678";
|
|
261
|
+
readonly exponent: 2;
|
|
262
|
+
readonly withdrawn: "2017-12";
|
|
263
|
+
};
|
|
264
|
+
readonly TMM: {
|
|
265
|
+
readonly name: "Turkmenistan Manat";
|
|
266
|
+
readonly numeric: "795";
|
|
267
|
+
readonly exponent: 2;
|
|
268
|
+
readonly withdrawn: "2009-01";
|
|
269
|
+
};
|
|
270
|
+
readonly TPE: {
|
|
271
|
+
readonly name: "Timor Escudo";
|
|
272
|
+
readonly numeric: "626";
|
|
273
|
+
readonly exponent: 0;
|
|
274
|
+
readonly withdrawn: "2002-11";
|
|
275
|
+
};
|
|
276
|
+
readonly TRL: {
|
|
277
|
+
readonly name: "Old Turkish Lira";
|
|
278
|
+
readonly numeric: "792";
|
|
279
|
+
readonly exponent: 0;
|
|
280
|
+
readonly withdrawn: "2005-12";
|
|
281
|
+
};
|
|
282
|
+
readonly USS: {
|
|
283
|
+
readonly name: "US Dollar (Same day)";
|
|
284
|
+
readonly numeric: "998";
|
|
285
|
+
readonly exponent: 2;
|
|
286
|
+
readonly withdrawn: "2014-03";
|
|
287
|
+
};
|
|
288
|
+
readonly VEB: {
|
|
289
|
+
readonly name: "Bolivar";
|
|
290
|
+
readonly numeric: "862";
|
|
291
|
+
readonly exponent: 2;
|
|
292
|
+
readonly withdrawn: "2008-01";
|
|
293
|
+
};
|
|
294
|
+
readonly VEF: {
|
|
295
|
+
readonly name: "Bolívar";
|
|
296
|
+
readonly numeric: "937";
|
|
297
|
+
readonly exponent: 2;
|
|
298
|
+
readonly withdrawn: "2018-08";
|
|
299
|
+
};
|
|
300
|
+
readonly YUM: {
|
|
301
|
+
readonly name: "New Dinar";
|
|
302
|
+
readonly numeric: "891";
|
|
303
|
+
readonly exponent: 2;
|
|
304
|
+
readonly withdrawn: "2003-07";
|
|
305
|
+
};
|
|
306
|
+
readonly ZMK: {
|
|
307
|
+
readonly name: "Zambian Kwacha";
|
|
308
|
+
readonly numeric: "894";
|
|
309
|
+
readonly exponent: 2;
|
|
310
|
+
readonly withdrawn: "2012-12";
|
|
311
|
+
};
|
|
312
|
+
readonly ZWD: {
|
|
313
|
+
readonly name: "Zimbabwe Dollar";
|
|
314
|
+
readonly numeric: "716";
|
|
315
|
+
readonly exponent: 2;
|
|
316
|
+
readonly withdrawn: "2008-08";
|
|
317
|
+
};
|
|
318
|
+
readonly ZWL: {
|
|
319
|
+
readonly name: "Zimbabwe Dollar";
|
|
320
|
+
readonly numeric: "932";
|
|
321
|
+
readonly exponent: 2;
|
|
322
|
+
readonly withdrawn: "2024-09";
|
|
323
|
+
};
|
|
324
|
+
readonly ZWN: {
|
|
325
|
+
readonly name: "Zimbabwe Dollar (new)";
|
|
326
|
+
readonly numeric: "942";
|
|
327
|
+
readonly exponent: 2;
|
|
328
|
+
readonly withdrawn: "2006-09";
|
|
329
|
+
};
|
|
330
|
+
readonly ZWR: {
|
|
331
|
+
readonly name: "Zimbabwe Dollar";
|
|
332
|
+
readonly numeric: "935";
|
|
333
|
+
readonly exponent: 2;
|
|
334
|
+
readonly withdrawn: "2009-06";
|
|
335
|
+
};
|
|
336
|
+
};
|
|
337
|
+
//# sourceMappingURL=historic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"historic.d.ts","sourceRoot":"","sources":["../../src/generated/historic.ts"],"names":[],"mappings":"AAGA,4DAA4D;AAC5D,eAAO,MAAM,6BAA6B,eAAe,CAAC;AAE1D;;;GAGG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwD1B,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// GENERATED by scripts/gen-currencies.mjs from data/iso4217-list-three.xml and data/historic.json. Do not edit by hand.
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/** Publication date of the ISO 4217 List Three snapshot. */
|
|
4
|
+
export const ISO_4217_LIST_THREE_PUBLISHED = "2026-01-01";
|
|
5
|
+
/**
|
|
6
|
+
* Withdrawn ISO 4217 codes (with `numeric` and `withdrawn`, the year and month ISO lists) and
|
|
7
|
+
* non-ISO codes (without them), each with the exponent ISO gave it while it was current.
|
|
8
|
+
*/
|
|
9
|
+
export const HISTORIC_CURRENCY_TABLE = {
|
|
10
|
+
ADP: { "name": "Andorran Peseta", "numeric": "020", "exponent": 0, "withdrawn": "2003-07" },
|
|
11
|
+
AFA: { "name": "Afghani", "numeric": "004", "exponent": 2, "withdrawn": "2003-01" },
|
|
12
|
+
ANG: { "name": "Netherlands Antillean Guilder", "numeric": "532", "exponent": 2, "withdrawn": "2025-03" },
|
|
13
|
+
ATS: { "name": "Schilling", "numeric": "040", "exponent": 2, "withdrawn": "2002-03" },
|
|
14
|
+
AYM: { "name": "Azerbaijan Manat", "numeric": "945", "exponent": 2, "withdrawn": "2005-10" },
|
|
15
|
+
AZM: { "name": "Azerbaijanian Manat", "numeric": "031", "exponent": 2, "withdrawn": "2005-12" },
|
|
16
|
+
BEF: { "name": "Belgian Franc", "numeric": "056", "exponent": 0, "withdrawn": "2002-03" },
|
|
17
|
+
BGL: { "name": "Lev", "numeric": "100", "exponent": 2, "withdrawn": "2003-11" },
|
|
18
|
+
BGN: { "name": "Bulgarian Lev", "numeric": "975", "exponent": 2, "withdrawn": "2026-01" },
|
|
19
|
+
BYB: { "name": "Belarusian Ruble", "numeric": "112", "exponent": 0, "withdrawn": "2001-01" },
|
|
20
|
+
BYR: { "name": "Belarusian Ruble", "numeric": "974", "exponent": 0, "withdrawn": "2017-01" },
|
|
21
|
+
CNH: { "name": "Chinese Yuan Renminbi (offshore)", "exponent": 2 },
|
|
22
|
+
CSD: { "name": "Serbian Dinar", "numeric": "891", "exponent": 2, "withdrawn": "2006-10" },
|
|
23
|
+
CUC: { "name": "Peso Convertible", "numeric": "931", "exponent": 2, "withdrawn": "2021-06" },
|
|
24
|
+
CYP: { "name": "Cyprus Pound", "numeric": "196", "exponent": 2, "withdrawn": "2008-01" },
|
|
25
|
+
DEM: { "name": "Deutsche Mark", "numeric": "276", "exponent": 2, "withdrawn": "2002-03" },
|
|
26
|
+
EEK: { "name": "Kroon", "numeric": "233", "exponent": 2, "withdrawn": "2011-01" },
|
|
27
|
+
ESP: { "name": "Spanish Peseta", "numeric": "724", "exponent": 0, "withdrawn": "2002-03" },
|
|
28
|
+
FIM: { "name": "Markka", "numeric": "246", "exponent": 2, "withdrawn": "2002-03" },
|
|
29
|
+
FRF: { "name": "French Franc", "numeric": "250", "exponent": 2, "withdrawn": "2002-03" },
|
|
30
|
+
GHC: { "name": "Cedi", "numeric": "288", "exponent": 2, "withdrawn": "2008-01" },
|
|
31
|
+
GRD: { "name": "Drachma", "numeric": "300", "exponent": 0, "withdrawn": "2002-03" },
|
|
32
|
+
GWP: { "name": "Guinea-Bissau Peso", "numeric": "624", "exponent": 2, "withdrawn": "1997-05" },
|
|
33
|
+
HRK: { "name": "Kuna", "numeric": "191", "exponent": 2, "withdrawn": "2023-01" },
|
|
34
|
+
IEP: { "name": "Irish Pound", "numeric": "372", "exponent": 2, "withdrawn": "2002-03" },
|
|
35
|
+
ITL: { "name": "Italian Lira", "numeric": "380", "exponent": 0, "withdrawn": "2002-03" },
|
|
36
|
+
LTL: { "name": "Lithuanian Litas", "numeric": "440", "exponent": 2, "withdrawn": "2014-12" },
|
|
37
|
+
LUF: { "name": "Luxembourg Franc", "numeric": "442", "exponent": 0, "withdrawn": "2002-03" },
|
|
38
|
+
LVL: { "name": "Latvian Lats", "numeric": "428", "exponent": 2, "withdrawn": "2014-01" },
|
|
39
|
+
MGF: { "name": "Malagasy Franc", "numeric": "450", "exponent": 0, "withdrawn": "2004-12" },
|
|
40
|
+
MRO: { "name": "Ouguiya", "numeric": "478", "exponent": 2, "withdrawn": "2017-12" },
|
|
41
|
+
MTL: { "name": "Maltese Lira", "numeric": "470", "exponent": 2, "withdrawn": "2008-01" },
|
|
42
|
+
MZM: { "name": "Mozambique Metical", "numeric": "508", "exponent": 2, "withdrawn": "2006-06" },
|
|
43
|
+
NLG: { "name": "Netherlands Guilder", "numeric": "528", "exponent": 2, "withdrawn": "2002-03" },
|
|
44
|
+
PTE: { "name": "Portuguese Escudo", "numeric": "620", "exponent": 0, "withdrawn": "2002-03" },
|
|
45
|
+
ROL: { "name": "Old Leu", "numeric": "642", "exponent": 0, "withdrawn": "2005-06" },
|
|
46
|
+
RUR: { "name": "Russian Ruble", "numeric": "810", "exponent": 2, "withdrawn": "2004-01" },
|
|
47
|
+
SDD: { "name": "Sudanese Dinar", "numeric": "736", "exponent": 2, "withdrawn": "2007-07" },
|
|
48
|
+
SIT: { "name": "Tolar", "numeric": "705", "exponent": 2, "withdrawn": "2007-01" },
|
|
49
|
+
SKK: { "name": "Slovak Koruna", "numeric": "703", "exponent": 2, "withdrawn": "2009-01" },
|
|
50
|
+
SLL: { "name": "Leone", "numeric": "694", "exponent": 2, "withdrawn": "2023-12" },
|
|
51
|
+
SRG: { "name": "Surinam Guilder", "numeric": "740", "exponent": 2, "withdrawn": "2003-12" },
|
|
52
|
+
STD: { "name": "Dobra", "numeric": "678", "exponent": 2, "withdrawn": "2017-12" },
|
|
53
|
+
TMM: { "name": "Turkmenistan Manat", "numeric": "795", "exponent": 2, "withdrawn": "2009-01" },
|
|
54
|
+
TPE: { "name": "Timor Escudo", "numeric": "626", "exponent": 0, "withdrawn": "2002-11" },
|
|
55
|
+
TRL: { "name": "Old Turkish Lira", "numeric": "792", "exponent": 0, "withdrawn": "2005-12" },
|
|
56
|
+
USS: { "name": "US Dollar (Same day)", "numeric": "998", "exponent": 2, "withdrawn": "2014-03" },
|
|
57
|
+
VEB: { "name": "Bolivar", "numeric": "862", "exponent": 2, "withdrawn": "2008-01" },
|
|
58
|
+
VEF: { "name": "Bolívar", "numeric": "937", "exponent": 2, "withdrawn": "2018-08" },
|
|
59
|
+
YUM: { "name": "New Dinar", "numeric": "891", "exponent": 2, "withdrawn": "2003-07" },
|
|
60
|
+
ZMK: { "name": "Zambian Kwacha", "numeric": "894", "exponent": 2, "withdrawn": "2012-12" },
|
|
61
|
+
ZWD: { "name": "Zimbabwe Dollar", "numeric": "716", "exponent": 2, "withdrawn": "2008-08" },
|
|
62
|
+
ZWL: { "name": "Zimbabwe Dollar", "numeric": "932", "exponent": 2, "withdrawn": "2024-09" },
|
|
63
|
+
ZWN: { "name": "Zimbabwe Dollar (new)", "numeric": "942", "exponent": 2, "withdrawn": "2006-09" },
|
|
64
|
+
ZWR: { "name": "Zimbabwe Dollar", "numeric": "935", "exponent": 2, "withdrawn": "2009-06" },
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=historic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"historic.js","sourceRoot":"","sources":["../../src/generated/historic.ts"],"names":[],"mappings":"AAAA,wHAAwH;AACxH,oBAAoB;AAEpB,4DAA4D;AAC5D,MAAM,CAAC,MAAM,6BAA6B,GAAG,YAAY,CAAC;AAE1D;;;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U,EAAC,CAAC,EAAC,WAAW,EAAC,SAAS,EAAC;IACjF,GAAG,EAAE,EAAC,MAAM,EAAC,iBAAiB,EAAC,SAAS,EAAC,KAAK,EAAC,UAAU,EAAC,CAAC,EAAC,WAAW,EAAC,SAAS,EAAC;IAClF,GAAG,EAAE,EAAC,MAAM,EAAC,iBAAiB,EAAC,SAAS,EAAC,KAAK,EAAC,UAAU,EAAC,CAAC,EAAC,WAAW,EAAC,SAAS,EAAC;IAClF,GAAG,EAAE,EAAC,MAAM,EAAC,uBAAuB,EAAC,SAAS,EAAC,KAAK,EAAC,UAAU,EAAC,CAAC,EAAC,WAAW,EAAC,SAAS,EAAC;IACxF,GAAG,EAAE,EAAC,MAAM,EAAC,iBAAiB,EAAC,SAAS,EAAC,KAAK,EAAC,UAAU,EAAC,CAAC,EAAC,WAAW,EAAC,SAAS,EAAC;CAC1E,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { HISTORIC_CURRENCY_TABLE, ISO_4217_LIST_THREE_PUBLISHED } from './generated/historic.js';
|
|
2
|
+
export { ISO_4217_LIST_THREE_PUBLISHED };
|
|
3
|
+
/** A code in the historic table. */
|
|
4
|
+
export type HistoricCurrencyCode = keyof typeof HISTORIC_CURRENCY_TABLE;
|
|
5
|
+
/**
|
|
6
|
+
* Every historic code, for the `CurrencyCode` type:
|
|
7
|
+
*
|
|
8
|
+
* declare module '@ducatjs/money' {
|
|
9
|
+
* interface CustomCurrencies extends HistoricCurrencies {}
|
|
10
|
+
* }
|
|
11
|
+
*/
|
|
12
|
+
export type HistoricCurrencies = {
|
|
13
|
+
readonly [Code in HistoricCurrencyCode]: true;
|
|
14
|
+
};
|
|
15
|
+
/** One entry of the historic table. */
|
|
16
|
+
export interface HistoricCurrency {
|
|
17
|
+
readonly code: HistoricCurrencyCode;
|
|
18
|
+
/** The name ISO 4217 List Three gives it (for non-ISO codes, a descriptive name). */
|
|
19
|
+
readonly name: string;
|
|
20
|
+
/** Its minor-unit exponent while it was current: what stored minor units of it mean. */
|
|
21
|
+
readonly exponent: number;
|
|
22
|
+
/** The ISO 4217 numeric code; absent for codes that were never ISO (CNH). */
|
|
23
|
+
readonly numeric?: string;
|
|
24
|
+
/**
|
|
25
|
+
* The year and month ISO 4217 withdrew it ('2023-01'), from List Three. A code withdrawn
|
|
26
|
+
* country by country has the last date. Absent for codes that were never ISO.
|
|
27
|
+
*/
|
|
28
|
+
readonly withdrawn?: string;
|
|
29
|
+
}
|
|
30
|
+
/** The table entry for a code, or undefined for a code that isn't in it. */
|
|
31
|
+
export declare function historicCurrency(code: string): HistoricCurrency | undefined;
|
|
32
|
+
/** Every entry of the table, by code. */
|
|
33
|
+
export declare function historicCurrencies(): HistoricCurrency[];
|
|
34
|
+
/**
|
|
35
|
+
* Registers historic codes with `defineCurrency`, so Money can hold them: all of them, or only
|
|
36
|
+
* `codes`. Registering one again is harmless; a code already defined with another exponent throws,
|
|
37
|
+
* as `defineCurrency` does.
|
|
38
|
+
*/
|
|
39
|
+
export declare function defineHistoricCurrencies(codes?: readonly HistoricCurrencyCode[]): void;
|
|
40
|
+
//# sourceMappingURL=historic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"historic.d.ts","sourceRoot":"","sources":["../src/historic.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,uBAAuB,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAEjG,OAAO,EAAE,6BAA6B,EAAE,CAAC;AAEzC,oCAAoC;AACpC,MAAM,MAAM,oBAAoB,GAAG,MAAM,OAAO,uBAAuB,CAAC;AAExE;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAAE,QAAQ,EAAE,IAAI,IAAI,oBAAoB,GAAG,IAAI;CAAE,CAAC;AAEnF,uCAAuC;AACvC,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,oBAAoB,CAAC;IACpC,qFAAqF;IACrF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,wFAAwF;IACxF,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,6EAA6E;IAC7E,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAID,4EAA4E;AAC5E,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS,CAM3E;AAED,yCAAyC;AACzC,wBAAgB,kBAAkB,IAAI,gBAAgB,EAAE,CAEvD;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,CAAC,EAAE,SAAS,oBAAoB,EAAE,GAAG,IAAI,CAatF"}
|
package/dist/historic.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@ducatjs/money/historic`: withdrawn ISO 4217 codes and a few non-ISO ones, with the exponent
|
|
3
|
+
* each had and, for ISO codes, the month ISO withdrew it. Nothing is registered until you ask, so
|
|
4
|
+
* the core registry stays ISO 4217 as currently published:
|
|
5
|
+
*
|
|
6
|
+
* defineHistoricCurrencies(['HRK', 'BGN']);
|
|
7
|
+
* money('100', 'HRK'); // 100.00 HRK
|
|
8
|
+
* historicCurrency('HRK')?.withdrawn; // '2023-01'
|
|
9
|
+
*/
|
|
10
|
+
import { defineCurrency } from './currency.js';
|
|
11
|
+
import { HISTORIC_CURRENCY_TABLE, ISO_4217_LIST_THREE_PUBLISHED } from './generated/historic.js';
|
|
12
|
+
export { ISO_4217_LIST_THREE_PUBLISHED };
|
|
13
|
+
const table = HISTORIC_CURRENCY_TABLE;
|
|
14
|
+
/** The table entry for a code, or undefined for a code that isn't in it. */
|
|
15
|
+
export function historicCurrency(code) {
|
|
16
|
+
// own properties only, so 'toString' and friends are not currencies
|
|
17
|
+
if (!Object.hasOwn(table, code)) {
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
return { code: code, ...table[code] };
|
|
21
|
+
}
|
|
22
|
+
/** Every entry of the table, by code. */
|
|
23
|
+
export function historicCurrencies() {
|
|
24
|
+
return Object.keys(table).map((code) => historicCurrency(code));
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Registers historic codes with `defineCurrency`, so Money can hold them: all of them, or only
|
|
28
|
+
* `codes`. Registering one again is harmless; a code already defined with another exponent throws,
|
|
29
|
+
* as `defineCurrency` does.
|
|
30
|
+
*/
|
|
31
|
+
export function defineHistoricCurrencies(codes) {
|
|
32
|
+
const selected = codes ?? Object.keys(table);
|
|
33
|
+
// check every code first, so a typo registers nothing
|
|
34
|
+
for (const code of selected) {
|
|
35
|
+
if (!Object.hasOwn(table, code)) {
|
|
36
|
+
throw new RangeError(`${code} is not in the historic currency table`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
for (const code of selected) {
|
|
40
|
+
defineCurrency(code, table[code].exponent);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=historic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"historic.js","sourceRoot":"","sources":["../src/historic.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAEjG,OAAO,EAAE,6BAA6B,EAAE,CAAC;AA8BzC,MAAM,KAAK,GAA6D,uBAAuB,CAAC;AAEhG,4EAA4E;AAC5E,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,oEAAoE;IACpE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC;QAChC,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,IAA4B,EAAE,GAAG,KAAK,CAAC,IAAI,CAAE,EAAE,CAAC;AACjE,CAAC;AAED,yCAAyC;AACzC,MAAM,UAAU,kBAAkB;IAChC,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAE,CAAC,CAAC;AACnE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAAuC;IAC9E,MAAM,QAAQ,GAAsB,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAEhE,sDAAsD;IACtD,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;QAC5B,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC;YAChC,MAAM,IAAI,UAAU,CAAC,GAAG,IAAI,wCAAwC,CAAC,CAAC;QACxE,CAAC;IACH,CAAC;IAED,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;QAC5B,cAAc,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAE,CAAC,QAAQ,CAAC,CAAC;IAC9C,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { CurrencyInput } from './money.js';
|
|
2
|
+
import { type RateProvider, type RateQuery, type RateTable, type RateTableSpec } from './provider.js';
|
|
3
|
+
import { Rate } from './rate.js';
|
|
4
|
+
import type { RateInfo, RateQuote } from './rate.js';
|
|
5
|
+
/**
|
|
6
|
+
* Why a lookup passed over a day: no table that day (a weekend or holiday), the table not yet
|
|
7
|
+
* published at the time asked for, its period over, or the pair not in it (`missing` when the
|
|
8
|
+
* source listed the currency without a value, `notQuoted` when it isn't listed at all).
|
|
9
|
+
*/
|
|
10
|
+
export type FallbackReason = 'noTable' | 'notYetAvailable' | 'expired' | 'missing' | 'notQuoted';
|
|
11
|
+
/** A day a lookup passed over, and why. */
|
|
12
|
+
export interface Fallback {
|
|
13
|
+
readonly day: string;
|
|
14
|
+
readonly reason: FallbackReason;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A Rate from a published quote: `per` units and the direction are applied exactly, and the quote
|
|
18
|
+
* is kept on the Rate.
|
|
19
|
+
*
|
|
20
|
+
* rateFromQuote('JPY', 'NOK', { rate: '6.50', per: 100 }) // JPY→NOK 0.065
|
|
21
|
+
* rateFromQuote('USD', 'EUR', { rate: '1.1650', inverted: true }) // USD→EUR 200/233
|
|
22
|
+
*/
|
|
23
|
+
export declare function rateFromQuote<From extends CurrencyInput, To extends CurrencyInput>(from: From, to: To, quote: RateQuote, info?: Omit<RateInfo, 'quote'>): Rate<From, To>;
|
|
24
|
+
/** One published rate in a quoted table. */
|
|
25
|
+
export interface QuotedRate {
|
|
26
|
+
/** The rate as published, a decimal string. */
|
|
27
|
+
readonly rate: string;
|
|
28
|
+
/**
|
|
29
|
+
* How many units the published number is for: of `base`, or of the currency when the rate is
|
|
30
|
+
* `inverted` ("NOK per 100 JPY" is `{ rate: '6.50', per: 100, inverted: true }` in a NOK table).
|
|
31
|
+
*/
|
|
32
|
+
readonly per?: number;
|
|
33
|
+
/** Published as base per unit of the currency, the other way round from the table. */
|
|
34
|
+
readonly inverted?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* The decimals the source publishes, for feeds that strip trailing zeros: '1.175' with 4 is
|
|
37
|
+
* kept as '1.1750'.
|
|
38
|
+
*/
|
|
39
|
+
readonly decimals?: number;
|
|
40
|
+
}
|
|
41
|
+
/** A one-base table of published quotes: a decimal string, a QuotedRate, or null (no value). */
|
|
42
|
+
export interface QuotedTableSpec extends Omit<RateTableSpec, 'rates'> {
|
|
43
|
+
readonly rates: Readonly<Record<string, string | QuotedRate | null>>;
|
|
44
|
+
/**
|
|
45
|
+
* Every rate is published as base per unit of the currency (CAD per USD, as the Bank of Canada
|
|
46
|
+
* quotes), unless its entry says otherwise.
|
|
47
|
+
*/
|
|
48
|
+
readonly inverted?: boolean;
|
|
49
|
+
/** The decimals every rate is published with, unless its entry says otherwise. */
|
|
50
|
+
readonly decimals?: number;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* A rateTable from rates as a source published them: each is stored exactly in the table's
|
|
54
|
+
* direction, base → currency, and keeps its quote (`rate.quote`).
|
|
55
|
+
*
|
|
56
|
+
* const boc = quotedTable({ base: 'CAD', inverted: true, asOf: '2026-11-06', rates: { USD: '1.3654' } });
|
|
57
|
+
* boc.rate('CAD', 'USD')?.inverse().toString(); // '1.3654'
|
|
58
|
+
*/
|
|
59
|
+
export declare function quotedTable(spec: QuotedTableSpec): RateTable;
|
|
60
|
+
/** Options for rateHistory(). */
|
|
61
|
+
export interface RateHistoryOptions {
|
|
62
|
+
/**
|
|
63
|
+
* How many days before the day asked for to look back for a daily table (weekends, holidays,
|
|
64
|
+
* currencies missing that day). Default 4, which covers Good Friday to Easter Monday. A table
|
|
65
|
+
* valid for a period (`validUntil`) answers for its whole period instead.
|
|
66
|
+
*/
|
|
67
|
+
readonly lookback?: number;
|
|
68
|
+
}
|
|
69
|
+
/** A rate lookup with its reasons: the rate, or undefined, and the days passed over. */
|
|
70
|
+
export interface RateLookup<From extends string = string, To extends string = string> {
|
|
71
|
+
readonly rate: Rate<From, To> | undefined;
|
|
72
|
+
/** Days passed over before the answer (or before giving up), newest first. */
|
|
73
|
+
readonly skipped: readonly Fallback[];
|
|
74
|
+
}
|
|
75
|
+
/** Dated tables held in memory, answering any day synchronously. */
|
|
76
|
+
export interface RateHistory extends RateProvider {
|
|
77
|
+
/** The dated tables, newest first. */
|
|
78
|
+
readonly tables: readonly RateTable[];
|
|
79
|
+
/** The same lookup as `rate`, reporting the days it passed over and why. */
|
|
80
|
+
lookup<From extends string, To extends string>(from: From, to: To, query?: RateQuery): RateLookup<From, To>;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* A provider over many dated tables, such as a date range loaded in one call: for each lookup it
|
|
84
|
+
* takes the latest table at or before `asOf` that has the pair, published by then and still
|
|
85
|
+
* valid, looking back up to `lookback` days. Each currency pair falls back on its own, so a
|
|
86
|
+
* currency missing on a holiday comes from the day before while the others stay current; the
|
|
87
|
+
* Rate's `asOf` says which day it is from. Without an `asOf`, the newest table with the pair
|
|
88
|
+
* answers. `lookup` reports why a lookup fell back.
|
|
89
|
+
*
|
|
90
|
+
* const history = rateHistory(parseEcbXml(xml90Days));
|
|
91
|
+
* history.rate('EUR', 'USD', { asOf: '2026-11-08' }); // Sunday: Friday's rate
|
|
92
|
+
* history.lookup('EUR', 'USD', { asOf: '2026-11-08' }).skipped;
|
|
93
|
+
* // [{ day: '2026-11-08', reason: 'noTable' }, { day: '2026-11-07', reason: 'noTable' }]
|
|
94
|
+
*/
|
|
95
|
+
export declare function rateHistory(tables: readonly RateTable[], options?: RateHistoryOptions): RateHistory;
|
|
96
|
+
//# sourceMappingURL=history.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../src/history.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,aAAa,EACnB,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAwB,IAAI,EAAe,MAAM,WAAW,CAAC;AACpE,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAKrD;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,iBAAiB,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,CAAC;AAEjG,2CAA2C;AAC3C,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;CACjC;AAoBD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,IAAI,SAAS,aAAa,EAAE,EAAE,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