@allratestoday/exchange-plugins 0.0.0-stage → 1.0.1

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.
@@ -0,0 +1,266 @@
1
+ /**
2
+ * One rate request. `date` is `YYYY-MM-DD`; omit it for the latest rate.
3
+ */
4
+ interface RateHint {
5
+ fromCurrency: string;
6
+ toCurrency: string;
7
+ date?: string;
8
+ }
9
+ /** How the number was produced by the plugin that answered. */
10
+ type RateMethod = 'published' | 'inverse' | 'cross';
11
+ interface RatePair {
12
+ fromCurrency: string;
13
+ toCurrency: string;
14
+ /** Units of `toCurrency` per 1 `fromCurrency`. */
15
+ rate: number;
16
+ /** The date the rate is for (`YYYY-MM-DD`). */
17
+ date: string;
18
+ /** `pluginId` of the plugin that answered. */
19
+ pluginId: string;
20
+ /** `mid-market` for live rates, otherwise the institution's own label (`reference`, `official`, ...). */
21
+ rateType: string;
22
+ method: RateMethod;
23
+ }
24
+ interface RateInfo {
25
+ /** Stable identifier, also used as the key when registering plugins. */
26
+ pluginId: string;
27
+ displayName: string;
28
+ /** True when the plugin works without an API key. */
29
+ keyless: boolean;
30
+ homepage: string;
31
+ }
32
+ interface RatePlugin {
33
+ rateInfo: RateInfo;
34
+ /**
35
+ * Answer as many hints as this plugin can. Hints it cannot answer are
36
+ * simply left out of the result (never throw for a missing pair), so an
37
+ * engine can fall through to the next plugin.
38
+ */
39
+ fetchRates: (hints: RateHint[]) => Promise<RatePair[]>;
40
+ }
41
+ interface PluginOptions {
42
+ /** AllRatesToday API key. Optional for keyless plugins. */
43
+ apiKey?: string;
44
+ /** Override the API origin (default `https://allratestoday.com`). */
45
+ baseUrl?: string;
46
+ /** Custom fetch, for tests or runtimes without a global fetch. */
47
+ fetch?: typeof fetch;
48
+ /** Abort a request after this many milliseconds (default 10000). */
49
+ timeoutMs?: number;
50
+ }
51
+ type RatePluginFactory = (options?: PluginOptions) => RatePlugin;
52
+
53
+ declare const DEFAULT_BASE_URL = "https://allratestoday.com";
54
+ declare class ExchangePluginError extends Error {
55
+ readonly status: number;
56
+ readonly body: unknown;
57
+ constructor(message: string, status: number, body: unknown);
58
+ }
59
+
60
+ /** One row of a published table: `value` units of `quote` per 1 `base`. */
61
+ interface TableRow {
62
+ base: string;
63
+ quote: string;
64
+ value: number;
65
+ type: string;
66
+ }
67
+ /**
68
+ * Resolve a pair from a full table: direct row, inverted row, or a cross
69
+ * through a currency both sides are quoted against. Returns null when the
70
+ * table does not cover the pair.
71
+ */
72
+ declare function resolvePair(rows: TableRow[], from: string, to: string): {
73
+ rate: number;
74
+ method: RateMethod;
75
+ type: string;
76
+ } | null;
77
+ declare function answerFromTable(rows: TableRow[], hints: RateHint[], date: string, pluginId: string, rateType?: string): RatePair[];
78
+
79
+ interface RateEngine {
80
+ readonly plugins: RatePlugin[];
81
+ /** Ask each plugin in order; a hint answered by an earlier plugin is not asked again. */
82
+ fetchRates: (hints: RateHint[]) => Promise<RatePair[]>;
83
+ /** One pair, or null when no plugin covers it. */
84
+ getRate: (fromCurrency: string, toCurrency: string, date?: string) => Promise<RatePair | null>;
85
+ /** Convert an amount; throws when no plugin covers the pair. */
86
+ convert: (amount: number, fromCurrency: string, toCurrency: string, date?: string) => Promise<{
87
+ amount: number;
88
+ result: number;
89
+ pair: RatePair;
90
+ }>;
91
+ }
92
+ /**
93
+ * Ordered fallback over plugins. Pass the plugins in preference order, e.g.
94
+ * live first, then the daily reference rate, then an official table.
95
+ */
96
+ declare function makeRateEngine(plugins: RatePlugin[] | Record<string, RatePlugin>): RateEngine;
97
+
98
+ /**
99
+ * Live mid-market rates from `GET /api/v1/rates`. Needs an API key (the free
100
+ * tier is 300 requests, no card). Answers only undated hints; dated hints are
101
+ * left for the reference-rate or central-bank plugins.
102
+ */
103
+ declare const makeAllRatesTodayPlugin: (options?: PluginOptions) => RatePlugin;
104
+
105
+ /**
106
+ * The AllRatesToday daily reference rate: one USD-based table a day, fixed at
107
+ * 16:00 London. The latest table is keyless (`/api/open/reference-rate`);
108
+ * dated tables (`/api/v1/reference-rate/{date}`) need an API key. Any pair is
109
+ * crossed through USD.
110
+ */
111
+ declare const makeReferenceRatePlugin: (options?: PluginOptions) => RatePlugin;
112
+
113
+ declare const makeCentralBankPlugin: (bank: string, options?: PluginOptions) => RatePlugin;
114
+ /**
115
+ * Source codes served by AllRatesToday on 2026-10-19 (125). `composite` is the
116
+ * cross-bank USD table. Refresh with `GET /api/open/central-banks`.
117
+ */
118
+ declare const CENTRAL_BANK_CODES: readonly ["amcm", "bam", "banguat", "banxico", "bazg", "bb", "bcb", "bcbol", "bcc", "bcch", "bccr", "bccu", "bceao", "bch", "bcm", "bcn", "bcp", "bcra", "bcrd", "bcrp", "bcstp", "bct", "bcu", "bcv", "bda", "bdi", "bdm", "beac", "bfm", "bi", "bmu", "bna", "bnb", "bnm", "bnr", "bnrw", "boa", "bob", "boc", "boe", "bog", "bogy", "boi", "boj", "bojm", "bok", "bol", "bom", "bon", "bot", "botz", "bou", "boz", "brh", "bsl", "bsp", "cba", "cbar", "cbb", "cbbd", "cbbh", "cbbz", "cbc", "cbe", "cbg", "cbi", "cbiq", "cbj", "cbk", "cbke", "cbl", "cbm", "cbn", "cbo", "cbr", "cbsl", "cbt", "cbtt", "cbu", "cbuae", "cbvs", "cnb", "composite", "dnb", "ecb", "fed", "hkma", "hmrc", "lb", "mas", "mma", "mnb", "nbc", "nbe", "nbg", "nbk", "nbkr", "nbm", "nbp", "nbrb", "nbrm", "nbs", "nbt", "nbu", "norges", "nrb", "pboc", "pma", "qcb", "rba", "rbf", "rbi", "rbm", "rbnz", "rbz", "riksbank", "rma", "sama", "sarb", "sbp", "sbv", "sfc", "snb", "tcmb", "ustreasury"];
119
+ type CentralBankCode = (typeof CENTRAL_BANK_CODES)[number];
120
+ /** One factory per source, keyed by code: `centralBanks.ecb()`, `centralBanks.boe()`, ... */
121
+ declare const centralBanks: Record<CentralBankCode, (options?: PluginOptions) => RatePlugin>;
122
+
123
+ /**
124
+ * Every plugin factory in this package, keyed by pluginId. Mirrors the
125
+ * `plugins` export of edge-exchange-plugins: pick the ones you want, or
126
+ * register them all.
127
+ */
128
+ declare const plugins: {
129
+ amcm: (options?: PluginOptions) => RatePlugin;
130
+ bam: (options?: PluginOptions) => RatePlugin;
131
+ banguat: (options?: PluginOptions) => RatePlugin;
132
+ banxico: (options?: PluginOptions) => RatePlugin;
133
+ bazg: (options?: PluginOptions) => RatePlugin;
134
+ bb: (options?: PluginOptions) => RatePlugin;
135
+ bcb: (options?: PluginOptions) => RatePlugin;
136
+ bcbol: (options?: PluginOptions) => RatePlugin;
137
+ bcc: (options?: PluginOptions) => RatePlugin;
138
+ bcch: (options?: PluginOptions) => RatePlugin;
139
+ bccr: (options?: PluginOptions) => RatePlugin;
140
+ bccu: (options?: PluginOptions) => RatePlugin;
141
+ bceao: (options?: PluginOptions) => RatePlugin;
142
+ bch: (options?: PluginOptions) => RatePlugin;
143
+ bcm: (options?: PluginOptions) => RatePlugin;
144
+ bcn: (options?: PluginOptions) => RatePlugin;
145
+ bcp: (options?: PluginOptions) => RatePlugin;
146
+ bcra: (options?: PluginOptions) => RatePlugin;
147
+ bcrd: (options?: PluginOptions) => RatePlugin;
148
+ bcrp: (options?: PluginOptions) => RatePlugin;
149
+ bcstp: (options?: PluginOptions) => RatePlugin;
150
+ bct: (options?: PluginOptions) => RatePlugin;
151
+ bcu: (options?: PluginOptions) => RatePlugin;
152
+ bcv: (options?: PluginOptions) => RatePlugin;
153
+ bda: (options?: PluginOptions) => RatePlugin;
154
+ bdi: (options?: PluginOptions) => RatePlugin;
155
+ bdm: (options?: PluginOptions) => RatePlugin;
156
+ beac: (options?: PluginOptions) => RatePlugin;
157
+ bfm: (options?: PluginOptions) => RatePlugin;
158
+ bi: (options?: PluginOptions) => RatePlugin;
159
+ bmu: (options?: PluginOptions) => RatePlugin;
160
+ bna: (options?: PluginOptions) => RatePlugin;
161
+ bnb: (options?: PluginOptions) => RatePlugin;
162
+ bnm: (options?: PluginOptions) => RatePlugin;
163
+ bnr: (options?: PluginOptions) => RatePlugin;
164
+ bnrw: (options?: PluginOptions) => RatePlugin;
165
+ boa: (options?: PluginOptions) => RatePlugin;
166
+ bob: (options?: PluginOptions) => RatePlugin;
167
+ boc: (options?: PluginOptions) => RatePlugin;
168
+ boe: (options?: PluginOptions) => RatePlugin;
169
+ bog: (options?: PluginOptions) => RatePlugin;
170
+ bogy: (options?: PluginOptions) => RatePlugin;
171
+ boi: (options?: PluginOptions) => RatePlugin;
172
+ boj: (options?: PluginOptions) => RatePlugin;
173
+ bojm: (options?: PluginOptions) => RatePlugin;
174
+ bok: (options?: PluginOptions) => RatePlugin;
175
+ bol: (options?: PluginOptions) => RatePlugin;
176
+ bom: (options?: PluginOptions) => RatePlugin;
177
+ bon: (options?: PluginOptions) => RatePlugin;
178
+ bot: (options?: PluginOptions) => RatePlugin;
179
+ botz: (options?: PluginOptions) => RatePlugin;
180
+ bou: (options?: PluginOptions) => RatePlugin;
181
+ boz: (options?: PluginOptions) => RatePlugin;
182
+ brh: (options?: PluginOptions) => RatePlugin;
183
+ bsl: (options?: PluginOptions) => RatePlugin;
184
+ bsp: (options?: PluginOptions) => RatePlugin;
185
+ cba: (options?: PluginOptions) => RatePlugin;
186
+ cbar: (options?: PluginOptions) => RatePlugin;
187
+ cbb: (options?: PluginOptions) => RatePlugin;
188
+ cbbd: (options?: PluginOptions) => RatePlugin;
189
+ cbbh: (options?: PluginOptions) => RatePlugin;
190
+ cbbz: (options?: PluginOptions) => RatePlugin;
191
+ cbc: (options?: PluginOptions) => RatePlugin;
192
+ cbe: (options?: PluginOptions) => RatePlugin;
193
+ cbg: (options?: PluginOptions) => RatePlugin;
194
+ cbi: (options?: PluginOptions) => RatePlugin;
195
+ cbiq: (options?: PluginOptions) => RatePlugin;
196
+ cbj: (options?: PluginOptions) => RatePlugin;
197
+ cbk: (options?: PluginOptions) => RatePlugin;
198
+ cbke: (options?: PluginOptions) => RatePlugin;
199
+ cbl: (options?: PluginOptions) => RatePlugin;
200
+ cbm: (options?: PluginOptions) => RatePlugin;
201
+ cbn: (options?: PluginOptions) => RatePlugin;
202
+ cbo: (options?: PluginOptions) => RatePlugin;
203
+ cbr: (options?: PluginOptions) => RatePlugin;
204
+ cbsl: (options?: PluginOptions) => RatePlugin;
205
+ cbt: (options?: PluginOptions) => RatePlugin;
206
+ cbtt: (options?: PluginOptions) => RatePlugin;
207
+ cbu: (options?: PluginOptions) => RatePlugin;
208
+ cbuae: (options?: PluginOptions) => RatePlugin;
209
+ cbvs: (options?: PluginOptions) => RatePlugin;
210
+ cnb: (options?: PluginOptions) => RatePlugin;
211
+ composite: (options?: PluginOptions) => RatePlugin;
212
+ dnb: (options?: PluginOptions) => RatePlugin;
213
+ ecb: (options?: PluginOptions) => RatePlugin;
214
+ fed: (options?: PluginOptions) => RatePlugin;
215
+ hkma: (options?: PluginOptions) => RatePlugin;
216
+ hmrc: (options?: PluginOptions) => RatePlugin;
217
+ lb: (options?: PluginOptions) => RatePlugin;
218
+ mas: (options?: PluginOptions) => RatePlugin;
219
+ mma: (options?: PluginOptions) => RatePlugin;
220
+ mnb: (options?: PluginOptions) => RatePlugin;
221
+ nbc: (options?: PluginOptions) => RatePlugin;
222
+ nbe: (options?: PluginOptions) => RatePlugin;
223
+ nbg: (options?: PluginOptions) => RatePlugin;
224
+ nbk: (options?: PluginOptions) => RatePlugin;
225
+ nbkr: (options?: PluginOptions) => RatePlugin;
226
+ nbm: (options?: PluginOptions) => RatePlugin;
227
+ nbp: (options?: PluginOptions) => RatePlugin;
228
+ nbrb: (options?: PluginOptions) => RatePlugin;
229
+ nbrm: (options?: PluginOptions) => RatePlugin;
230
+ nbs: (options?: PluginOptions) => RatePlugin;
231
+ nbt: (options?: PluginOptions) => RatePlugin;
232
+ nbu: (options?: PluginOptions) => RatePlugin;
233
+ norges: (options?: PluginOptions) => RatePlugin;
234
+ nrb: (options?: PluginOptions) => RatePlugin;
235
+ pboc: (options?: PluginOptions) => RatePlugin;
236
+ pma: (options?: PluginOptions) => RatePlugin;
237
+ qcb: (options?: PluginOptions) => RatePlugin;
238
+ rba: (options?: PluginOptions) => RatePlugin;
239
+ rbf: (options?: PluginOptions) => RatePlugin;
240
+ rbi: (options?: PluginOptions) => RatePlugin;
241
+ rbm: (options?: PluginOptions) => RatePlugin;
242
+ rbnz: (options?: PluginOptions) => RatePlugin;
243
+ rbz: (options?: PluginOptions) => RatePlugin;
244
+ riksbank: (options?: PluginOptions) => RatePlugin;
245
+ rma: (options?: PluginOptions) => RatePlugin;
246
+ sama: (options?: PluginOptions) => RatePlugin;
247
+ sarb: (options?: PluginOptions) => RatePlugin;
248
+ sbp: (options?: PluginOptions) => RatePlugin;
249
+ sbv: (options?: PluginOptions) => RatePlugin;
250
+ sfc: (options?: PluginOptions) => RatePlugin;
251
+ snb: (options?: PluginOptions) => RatePlugin;
252
+ tcmb: (options?: PluginOptions) => RatePlugin;
253
+ ustreasury: (options?: PluginOptions) => RatePlugin;
254
+ allratestoday: (options?: PluginOptions) => RatePlugin;
255
+ referenceRate: (options?: PluginOptions) => RatePlugin;
256
+ };
257
+ type PluginId = keyof typeof plugins;
258
+ /**
259
+ * Instantiate a set of plugins with shared options. Pass ids in preference
260
+ * order; the result is ready for `makeRateEngine`.
261
+ */
262
+ declare function makePlugins(ids: PluginId[], options?: PluginOptions): RatePlugin[];
263
+ /** The recommended default stack: live when a key is set, then reference rate, then the composite table. */
264
+ declare function makeDefaultPlugins(options?: PluginOptions): RatePlugin[];
265
+
266
+ export { CENTRAL_BANK_CODES, type CentralBankCode, DEFAULT_BASE_URL, ExchangePluginError, type PluginId, type PluginOptions, type RateEngine, type RateHint, type RateInfo, type RateMethod, type RatePair, type RatePlugin, type RatePluginFactory, type TableRow, answerFromTable, centralBanks, plugins as default, makeAllRatesTodayPlugin, makeCentralBankPlugin, makeDefaultPlugins, makePlugins, makeRateEngine, makeReferenceRatePlugin, plugins, resolvePair };
@@ -0,0 +1,266 @@
1
+ /**
2
+ * One rate request. `date` is `YYYY-MM-DD`; omit it for the latest rate.
3
+ */
4
+ interface RateHint {
5
+ fromCurrency: string;
6
+ toCurrency: string;
7
+ date?: string;
8
+ }
9
+ /** How the number was produced by the plugin that answered. */
10
+ type RateMethod = 'published' | 'inverse' | 'cross';
11
+ interface RatePair {
12
+ fromCurrency: string;
13
+ toCurrency: string;
14
+ /** Units of `toCurrency` per 1 `fromCurrency`. */
15
+ rate: number;
16
+ /** The date the rate is for (`YYYY-MM-DD`). */
17
+ date: string;
18
+ /** `pluginId` of the plugin that answered. */
19
+ pluginId: string;
20
+ /** `mid-market` for live rates, otherwise the institution's own label (`reference`, `official`, ...). */
21
+ rateType: string;
22
+ method: RateMethod;
23
+ }
24
+ interface RateInfo {
25
+ /** Stable identifier, also used as the key when registering plugins. */
26
+ pluginId: string;
27
+ displayName: string;
28
+ /** True when the plugin works without an API key. */
29
+ keyless: boolean;
30
+ homepage: string;
31
+ }
32
+ interface RatePlugin {
33
+ rateInfo: RateInfo;
34
+ /**
35
+ * Answer as many hints as this plugin can. Hints it cannot answer are
36
+ * simply left out of the result (never throw for a missing pair), so an
37
+ * engine can fall through to the next plugin.
38
+ */
39
+ fetchRates: (hints: RateHint[]) => Promise<RatePair[]>;
40
+ }
41
+ interface PluginOptions {
42
+ /** AllRatesToday API key. Optional for keyless plugins. */
43
+ apiKey?: string;
44
+ /** Override the API origin (default `https://allratestoday.com`). */
45
+ baseUrl?: string;
46
+ /** Custom fetch, for tests or runtimes without a global fetch. */
47
+ fetch?: typeof fetch;
48
+ /** Abort a request after this many milliseconds (default 10000). */
49
+ timeoutMs?: number;
50
+ }
51
+ type RatePluginFactory = (options?: PluginOptions) => RatePlugin;
52
+
53
+ declare const DEFAULT_BASE_URL = "https://allratestoday.com";
54
+ declare class ExchangePluginError extends Error {
55
+ readonly status: number;
56
+ readonly body: unknown;
57
+ constructor(message: string, status: number, body: unknown);
58
+ }
59
+
60
+ /** One row of a published table: `value` units of `quote` per 1 `base`. */
61
+ interface TableRow {
62
+ base: string;
63
+ quote: string;
64
+ value: number;
65
+ type: string;
66
+ }
67
+ /**
68
+ * Resolve a pair from a full table: direct row, inverted row, or a cross
69
+ * through a currency both sides are quoted against. Returns null when the
70
+ * table does not cover the pair.
71
+ */
72
+ declare function resolvePair(rows: TableRow[], from: string, to: string): {
73
+ rate: number;
74
+ method: RateMethod;
75
+ type: string;
76
+ } | null;
77
+ declare function answerFromTable(rows: TableRow[], hints: RateHint[], date: string, pluginId: string, rateType?: string): RatePair[];
78
+
79
+ interface RateEngine {
80
+ readonly plugins: RatePlugin[];
81
+ /** Ask each plugin in order; a hint answered by an earlier plugin is not asked again. */
82
+ fetchRates: (hints: RateHint[]) => Promise<RatePair[]>;
83
+ /** One pair, or null when no plugin covers it. */
84
+ getRate: (fromCurrency: string, toCurrency: string, date?: string) => Promise<RatePair | null>;
85
+ /** Convert an amount; throws when no plugin covers the pair. */
86
+ convert: (amount: number, fromCurrency: string, toCurrency: string, date?: string) => Promise<{
87
+ amount: number;
88
+ result: number;
89
+ pair: RatePair;
90
+ }>;
91
+ }
92
+ /**
93
+ * Ordered fallback over plugins. Pass the plugins in preference order, e.g.
94
+ * live first, then the daily reference rate, then an official table.
95
+ */
96
+ declare function makeRateEngine(plugins: RatePlugin[] | Record<string, RatePlugin>): RateEngine;
97
+
98
+ /**
99
+ * Live mid-market rates from `GET /api/v1/rates`. Needs an API key (the free
100
+ * tier is 300 requests, no card). Answers only undated hints; dated hints are
101
+ * left for the reference-rate or central-bank plugins.
102
+ */
103
+ declare const makeAllRatesTodayPlugin: (options?: PluginOptions) => RatePlugin;
104
+
105
+ /**
106
+ * The AllRatesToday daily reference rate: one USD-based table a day, fixed at
107
+ * 16:00 London. The latest table is keyless (`/api/open/reference-rate`);
108
+ * dated tables (`/api/v1/reference-rate/{date}`) need an API key. Any pair is
109
+ * crossed through USD.
110
+ */
111
+ declare const makeReferenceRatePlugin: (options?: PluginOptions) => RatePlugin;
112
+
113
+ declare const makeCentralBankPlugin: (bank: string, options?: PluginOptions) => RatePlugin;
114
+ /**
115
+ * Source codes served by AllRatesToday on 2026-10-19 (125). `composite` is the
116
+ * cross-bank USD table. Refresh with `GET /api/open/central-banks`.
117
+ */
118
+ declare const CENTRAL_BANK_CODES: readonly ["amcm", "bam", "banguat", "banxico", "bazg", "bb", "bcb", "bcbol", "bcc", "bcch", "bccr", "bccu", "bceao", "bch", "bcm", "bcn", "bcp", "bcra", "bcrd", "bcrp", "bcstp", "bct", "bcu", "bcv", "bda", "bdi", "bdm", "beac", "bfm", "bi", "bmu", "bna", "bnb", "bnm", "bnr", "bnrw", "boa", "bob", "boc", "boe", "bog", "bogy", "boi", "boj", "bojm", "bok", "bol", "bom", "bon", "bot", "botz", "bou", "boz", "brh", "bsl", "bsp", "cba", "cbar", "cbb", "cbbd", "cbbh", "cbbz", "cbc", "cbe", "cbg", "cbi", "cbiq", "cbj", "cbk", "cbke", "cbl", "cbm", "cbn", "cbo", "cbr", "cbsl", "cbt", "cbtt", "cbu", "cbuae", "cbvs", "cnb", "composite", "dnb", "ecb", "fed", "hkma", "hmrc", "lb", "mas", "mma", "mnb", "nbc", "nbe", "nbg", "nbk", "nbkr", "nbm", "nbp", "nbrb", "nbrm", "nbs", "nbt", "nbu", "norges", "nrb", "pboc", "pma", "qcb", "rba", "rbf", "rbi", "rbm", "rbnz", "rbz", "riksbank", "rma", "sama", "sarb", "sbp", "sbv", "sfc", "snb", "tcmb", "ustreasury"];
119
+ type CentralBankCode = (typeof CENTRAL_BANK_CODES)[number];
120
+ /** One factory per source, keyed by code: `centralBanks.ecb()`, `centralBanks.boe()`, ... */
121
+ declare const centralBanks: Record<CentralBankCode, (options?: PluginOptions) => RatePlugin>;
122
+
123
+ /**
124
+ * Every plugin factory in this package, keyed by pluginId. Mirrors the
125
+ * `plugins` export of edge-exchange-plugins: pick the ones you want, or
126
+ * register them all.
127
+ */
128
+ declare const plugins: {
129
+ amcm: (options?: PluginOptions) => RatePlugin;
130
+ bam: (options?: PluginOptions) => RatePlugin;
131
+ banguat: (options?: PluginOptions) => RatePlugin;
132
+ banxico: (options?: PluginOptions) => RatePlugin;
133
+ bazg: (options?: PluginOptions) => RatePlugin;
134
+ bb: (options?: PluginOptions) => RatePlugin;
135
+ bcb: (options?: PluginOptions) => RatePlugin;
136
+ bcbol: (options?: PluginOptions) => RatePlugin;
137
+ bcc: (options?: PluginOptions) => RatePlugin;
138
+ bcch: (options?: PluginOptions) => RatePlugin;
139
+ bccr: (options?: PluginOptions) => RatePlugin;
140
+ bccu: (options?: PluginOptions) => RatePlugin;
141
+ bceao: (options?: PluginOptions) => RatePlugin;
142
+ bch: (options?: PluginOptions) => RatePlugin;
143
+ bcm: (options?: PluginOptions) => RatePlugin;
144
+ bcn: (options?: PluginOptions) => RatePlugin;
145
+ bcp: (options?: PluginOptions) => RatePlugin;
146
+ bcra: (options?: PluginOptions) => RatePlugin;
147
+ bcrd: (options?: PluginOptions) => RatePlugin;
148
+ bcrp: (options?: PluginOptions) => RatePlugin;
149
+ bcstp: (options?: PluginOptions) => RatePlugin;
150
+ bct: (options?: PluginOptions) => RatePlugin;
151
+ bcu: (options?: PluginOptions) => RatePlugin;
152
+ bcv: (options?: PluginOptions) => RatePlugin;
153
+ bda: (options?: PluginOptions) => RatePlugin;
154
+ bdi: (options?: PluginOptions) => RatePlugin;
155
+ bdm: (options?: PluginOptions) => RatePlugin;
156
+ beac: (options?: PluginOptions) => RatePlugin;
157
+ bfm: (options?: PluginOptions) => RatePlugin;
158
+ bi: (options?: PluginOptions) => RatePlugin;
159
+ bmu: (options?: PluginOptions) => RatePlugin;
160
+ bna: (options?: PluginOptions) => RatePlugin;
161
+ bnb: (options?: PluginOptions) => RatePlugin;
162
+ bnm: (options?: PluginOptions) => RatePlugin;
163
+ bnr: (options?: PluginOptions) => RatePlugin;
164
+ bnrw: (options?: PluginOptions) => RatePlugin;
165
+ boa: (options?: PluginOptions) => RatePlugin;
166
+ bob: (options?: PluginOptions) => RatePlugin;
167
+ boc: (options?: PluginOptions) => RatePlugin;
168
+ boe: (options?: PluginOptions) => RatePlugin;
169
+ bog: (options?: PluginOptions) => RatePlugin;
170
+ bogy: (options?: PluginOptions) => RatePlugin;
171
+ boi: (options?: PluginOptions) => RatePlugin;
172
+ boj: (options?: PluginOptions) => RatePlugin;
173
+ bojm: (options?: PluginOptions) => RatePlugin;
174
+ bok: (options?: PluginOptions) => RatePlugin;
175
+ bol: (options?: PluginOptions) => RatePlugin;
176
+ bom: (options?: PluginOptions) => RatePlugin;
177
+ bon: (options?: PluginOptions) => RatePlugin;
178
+ bot: (options?: PluginOptions) => RatePlugin;
179
+ botz: (options?: PluginOptions) => RatePlugin;
180
+ bou: (options?: PluginOptions) => RatePlugin;
181
+ boz: (options?: PluginOptions) => RatePlugin;
182
+ brh: (options?: PluginOptions) => RatePlugin;
183
+ bsl: (options?: PluginOptions) => RatePlugin;
184
+ bsp: (options?: PluginOptions) => RatePlugin;
185
+ cba: (options?: PluginOptions) => RatePlugin;
186
+ cbar: (options?: PluginOptions) => RatePlugin;
187
+ cbb: (options?: PluginOptions) => RatePlugin;
188
+ cbbd: (options?: PluginOptions) => RatePlugin;
189
+ cbbh: (options?: PluginOptions) => RatePlugin;
190
+ cbbz: (options?: PluginOptions) => RatePlugin;
191
+ cbc: (options?: PluginOptions) => RatePlugin;
192
+ cbe: (options?: PluginOptions) => RatePlugin;
193
+ cbg: (options?: PluginOptions) => RatePlugin;
194
+ cbi: (options?: PluginOptions) => RatePlugin;
195
+ cbiq: (options?: PluginOptions) => RatePlugin;
196
+ cbj: (options?: PluginOptions) => RatePlugin;
197
+ cbk: (options?: PluginOptions) => RatePlugin;
198
+ cbke: (options?: PluginOptions) => RatePlugin;
199
+ cbl: (options?: PluginOptions) => RatePlugin;
200
+ cbm: (options?: PluginOptions) => RatePlugin;
201
+ cbn: (options?: PluginOptions) => RatePlugin;
202
+ cbo: (options?: PluginOptions) => RatePlugin;
203
+ cbr: (options?: PluginOptions) => RatePlugin;
204
+ cbsl: (options?: PluginOptions) => RatePlugin;
205
+ cbt: (options?: PluginOptions) => RatePlugin;
206
+ cbtt: (options?: PluginOptions) => RatePlugin;
207
+ cbu: (options?: PluginOptions) => RatePlugin;
208
+ cbuae: (options?: PluginOptions) => RatePlugin;
209
+ cbvs: (options?: PluginOptions) => RatePlugin;
210
+ cnb: (options?: PluginOptions) => RatePlugin;
211
+ composite: (options?: PluginOptions) => RatePlugin;
212
+ dnb: (options?: PluginOptions) => RatePlugin;
213
+ ecb: (options?: PluginOptions) => RatePlugin;
214
+ fed: (options?: PluginOptions) => RatePlugin;
215
+ hkma: (options?: PluginOptions) => RatePlugin;
216
+ hmrc: (options?: PluginOptions) => RatePlugin;
217
+ lb: (options?: PluginOptions) => RatePlugin;
218
+ mas: (options?: PluginOptions) => RatePlugin;
219
+ mma: (options?: PluginOptions) => RatePlugin;
220
+ mnb: (options?: PluginOptions) => RatePlugin;
221
+ nbc: (options?: PluginOptions) => RatePlugin;
222
+ nbe: (options?: PluginOptions) => RatePlugin;
223
+ nbg: (options?: PluginOptions) => RatePlugin;
224
+ nbk: (options?: PluginOptions) => RatePlugin;
225
+ nbkr: (options?: PluginOptions) => RatePlugin;
226
+ nbm: (options?: PluginOptions) => RatePlugin;
227
+ nbp: (options?: PluginOptions) => RatePlugin;
228
+ nbrb: (options?: PluginOptions) => RatePlugin;
229
+ nbrm: (options?: PluginOptions) => RatePlugin;
230
+ nbs: (options?: PluginOptions) => RatePlugin;
231
+ nbt: (options?: PluginOptions) => RatePlugin;
232
+ nbu: (options?: PluginOptions) => RatePlugin;
233
+ norges: (options?: PluginOptions) => RatePlugin;
234
+ nrb: (options?: PluginOptions) => RatePlugin;
235
+ pboc: (options?: PluginOptions) => RatePlugin;
236
+ pma: (options?: PluginOptions) => RatePlugin;
237
+ qcb: (options?: PluginOptions) => RatePlugin;
238
+ rba: (options?: PluginOptions) => RatePlugin;
239
+ rbf: (options?: PluginOptions) => RatePlugin;
240
+ rbi: (options?: PluginOptions) => RatePlugin;
241
+ rbm: (options?: PluginOptions) => RatePlugin;
242
+ rbnz: (options?: PluginOptions) => RatePlugin;
243
+ rbz: (options?: PluginOptions) => RatePlugin;
244
+ riksbank: (options?: PluginOptions) => RatePlugin;
245
+ rma: (options?: PluginOptions) => RatePlugin;
246
+ sama: (options?: PluginOptions) => RatePlugin;
247
+ sarb: (options?: PluginOptions) => RatePlugin;
248
+ sbp: (options?: PluginOptions) => RatePlugin;
249
+ sbv: (options?: PluginOptions) => RatePlugin;
250
+ sfc: (options?: PluginOptions) => RatePlugin;
251
+ snb: (options?: PluginOptions) => RatePlugin;
252
+ tcmb: (options?: PluginOptions) => RatePlugin;
253
+ ustreasury: (options?: PluginOptions) => RatePlugin;
254
+ allratestoday: (options?: PluginOptions) => RatePlugin;
255
+ referenceRate: (options?: PluginOptions) => RatePlugin;
256
+ };
257
+ type PluginId = keyof typeof plugins;
258
+ /**
259
+ * Instantiate a set of plugins with shared options. Pass ids in preference
260
+ * order; the result is ready for `makeRateEngine`.
261
+ */
262
+ declare function makePlugins(ids: PluginId[], options?: PluginOptions): RatePlugin[];
263
+ /** The recommended default stack: live when a key is set, then reference rate, then the composite table. */
264
+ declare function makeDefaultPlugins(options?: PluginOptions): RatePlugin[];
265
+
266
+ export { CENTRAL_BANK_CODES, type CentralBankCode, DEFAULT_BASE_URL, ExchangePluginError, type PluginId, type PluginOptions, type RateEngine, type RateHint, type RateInfo, type RateMethod, type RatePair, type RatePlugin, type RatePluginFactory, type TableRow, answerFromTable, centralBanks, plugins as default, makeAllRatesTodayPlugin, makeCentralBankPlugin, makeDefaultPlugins, makePlugins, makeRateEngine, makeReferenceRatePlugin, plugins, resolvePair };