@mostlyrightmd/markets 0.1.0-rc.7

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,89 @@
1
+ interface KalshiStation {
2
+ station: string;
3
+ citation: string;
4
+ }
5
+ declare const KALSHI_SETTLEMENT_STATIONS: Readonly<Record<string, KalshiStation>>;
6
+ declare const KNOWN_WRONG_STATIONS: ReadonlySet<string>;
7
+
8
+ interface PolymarketCityStation {
9
+ default: string;
10
+ high?: string;
11
+ low?: string;
12
+ [measure: string]: string | undefined;
13
+ }
14
+ declare const POLYMARKET_CITY_STATIONS: Readonly<Record<string, PolymarketCityStation>>;
15
+
16
+ interface NHighResolution {
17
+ readonly settlementSource: "cli.archive";
18
+ readonly settlementStation: string;
19
+ readonly cityTicker: string;
20
+ readonly contractDate: string;
21
+ }
22
+ /**
23
+ * Custom error type for contract-id parsing / validation failures.
24
+ *
25
+ * Mirrors the Python `ValueError`/`TypeError` distinction: in TS we use a
26
+ * named subclass so callers can `instanceof`-check rather than parse
27
+ * error messages.
28
+ */
29
+ declare class ContractIdError extends Error {
30
+ constructor(message: string);
31
+ }
32
+ /**
33
+ * Resolve a Kalshi NHIGH contract to its settlement source + station.
34
+ *
35
+ * The contract id format is `KHIGH<CITY>` (case-insensitive), where
36
+ * `<CITY>` is a city ticker present in
37
+ * {@link KALSHI_SETTLEMENT_STATIONS}.
38
+ *
39
+ * @param contractId Kalshi market identifier. Case-insensitive.
40
+ * @param settlementDate Calendar date the market settles for. Either a
41
+ * UTC date-only `Date` (H/M/S/ms == 0) or a `YYYY-MM-DD` string.
42
+ * @returns A frozen {@link NHighResolution}.
43
+ * @throws {ContractIdError} The contract id doesn't follow
44
+ * `KHIGH<CITY>`, the city is unknown, or the settlement date is
45
+ * invalid.
46
+ */
47
+ declare function kalshiNhighResolve(contractId: string, settlementDate: Date | string): NHighResolution;
48
+
49
+ interface NLowResolution {
50
+ readonly settlementSource: "cli.archive";
51
+ readonly settlementStation: string;
52
+ readonly cityTicker: string;
53
+ readonly contractDate: string;
54
+ }
55
+ /**
56
+ * Resolve a Kalshi NLOW contract to its settlement source + station.
57
+ *
58
+ * The contract id format is `KLOW<CITY>` (case-insensitive), where
59
+ * `<CITY>` is a city ticker present in
60
+ * {@link KALSHI_SETTLEMENT_STATIONS}.
61
+ *
62
+ * @param contractId Kalshi market identifier. Case-insensitive.
63
+ * @param settlementDate Calendar date the market settles for. Either a
64
+ * UTC date-only `Date` (H/M/S/ms == 0) or a `YYYY-MM-DD` string.
65
+ * @returns A frozen {@link NLowResolution}.
66
+ * @throws {ContractIdError} The contract id doesn't follow
67
+ * `KLOW<CITY>`, the city is unknown, or the settlement date is
68
+ * invalid.
69
+ */
70
+ declare function kalshiNlowResolve(contractId: string, settlementDate: Date | string): NLowResolution;
71
+
72
+ type KalshiSettlement = NHighResolution | NLowResolution;
73
+ /**
74
+ * Resolve a Kalshi NHIGH or NLOW contract id to its settlement metadata.
75
+ *
76
+ * `KHIGH*` prefixes dispatch to the NHIGH resolver; `KLOW*` prefixes
77
+ * dispatch to NLOW. Anything else raises `ContractIdError`.
78
+ *
79
+ * @example
80
+ * kalshiSettlementFor("KHIGHNYC", "2025-01-06")
81
+ * // → { settlementSource: "cli.archive", settlementStation: "KNYC",
82
+ * // cityTicker: "NYC", contractDate: "2025-01-06" }
83
+ */
84
+ declare function kalshiSettlementFor(contractId: string, date: string): KalshiSettlement;
85
+
86
+ declare const version = "0.0.0";
87
+ declare function helloMarkets(): string;
88
+
89
+ export { ContractIdError, KALSHI_SETTLEMENT_STATIONS, KNOWN_WRONG_STATIONS, type KalshiSettlement, type KalshiStation, type NHighResolution, type NLowResolution, POLYMARKET_CITY_STATIONS, type PolymarketCityStation, helloMarkets, kalshiNhighResolve, kalshiNlowResolve, kalshiSettlementFor, version };
@@ -0,0 +1,467 @@
1
+ "use strict";
2
+ var mostlyrightMarkets = (() => {
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/index.ts
22
+ var index_exports = {};
23
+ __export(index_exports, {
24
+ ContractIdError: () => ContractIdError,
25
+ KALSHI_SETTLEMENT_STATIONS: () => KALSHI_SETTLEMENT_STATIONS,
26
+ KNOWN_WRONG_STATIONS: () => KNOWN_WRONG_STATIONS,
27
+ POLYMARKET_CITY_STATIONS: () => POLYMARKET_CITY_STATIONS,
28
+ helloMarkets: () => helloMarkets,
29
+ kalshiNhighResolve: () => kalshiNhighResolve,
30
+ kalshiNlowResolve: () => kalshiNlowResolve,
31
+ kalshiSettlementFor: () => kalshiSettlementFor,
32
+ version: () => version
33
+ });
34
+
35
+ // src/data/generated/kalshi-stations.ts
36
+ var KALSHI_SETTLEMENT_STATIONS = {
37
+ ATL: {
38
+ citation: "https://kalshi.com/markets/khighatl (Atlanta Hartsfield-Jackson)",
39
+ station: "KATL"
40
+ },
41
+ AUS: {
42
+ citation: "https://kalshi.com/markets/khighaus (Austin-Bergstrom; the only Austin station Kalshi cites)",
43
+ station: "KAUS"
44
+ },
45
+ BNA: {
46
+ citation: "https://kalshi.com/markets/khighbna (Nashville International)",
47
+ station: "KBNA"
48
+ },
49
+ BOS: {
50
+ citation: "https://kalshi.com/markets/khighbos (Boston Logan)",
51
+ station: "KBOS"
52
+ },
53
+ CHI: {
54
+ citation: "https://kalshi.com/markets/khighchi (Midway, NOT ORD)",
55
+ station: "KMDW"
56
+ },
57
+ CVG: {
58
+ citation: "https://kalshi.com/markets/khighcvg (Cincinnati/Northern Kentucky International)",
59
+ station: "KCVG"
60
+ },
61
+ DAL: {
62
+ citation: "https://kalshi.com/markets/khighdal (DFW, NOT Love Field)",
63
+ station: "KDFW"
64
+ },
65
+ DCA: {
66
+ citation: "https://kalshi.com/markets/khighdca (Reagan National, NOT Dulles or BWI)",
67
+ station: "KDCA"
68
+ },
69
+ DEN: {
70
+ citation: "https://kalshi.com/markets/khighden (Denver International)",
71
+ station: "KDEN"
72
+ },
73
+ DTW: {
74
+ citation: "https://kalshi.com/markets/khighdtw (Detroit Metropolitan)",
75
+ station: "KDTW"
76
+ },
77
+ HOU: {
78
+ citation: "https://kalshi.com/markets/khighhou (Intercontinental, NOT Hobby; Kalshi cites IAH)",
79
+ station: "KIAH"
80
+ },
81
+ LAX: {
82
+ citation: "https://kalshi.com/markets/khighlax (LAX international)",
83
+ station: "KLAX"
84
+ },
85
+ MIA: {
86
+ citation: "https://kalshi.com/markets/khighmia (Miami International)",
87
+ station: "KMIA"
88
+ },
89
+ MSP: {
90
+ citation: "https://kalshi.com/markets/khighmsp (Minneapolis-St. Paul International)",
91
+ station: "KMSP"
92
+ },
93
+ NYC: {
94
+ citation: "https://kalshi.com/markets/khighny (Central Park, NOT LGA/JFK)",
95
+ station: "KNYC"
96
+ },
97
+ PHL: {
98
+ citation: "https://kalshi.com/markets/khighphl (Philadelphia International)",
99
+ station: "KPHL"
100
+ },
101
+ PHX: {
102
+ citation: "https://kalshi.com/markets/khighphx (Sky Harbor International)",
103
+ station: "KPHX"
104
+ },
105
+ SEA: {
106
+ citation: "https://kalshi.com/markets/khighsea (SeaTac, NOT BFI)",
107
+ station: "KSEA"
108
+ },
109
+ SFO: {
110
+ citation: "https://kalshi.com/markets/khighsfo (San Francisco International, NOT OAK)",
111
+ station: "KSFO"
112
+ },
113
+ SLC: {
114
+ citation: "https://kalshi.com/markets/khighslc (Salt Lake City International)",
115
+ station: "KSLC"
116
+ }
117
+ };
118
+ var KNOWN_WRONG_STATIONS = /* @__PURE__ */ new Set([
119
+ "KBWI",
120
+ "KDAL",
121
+ "KEWR",
122
+ "KHOU",
123
+ "KIAD",
124
+ "KJFK",
125
+ "KLGA",
126
+ "KOAK",
127
+ "KORD"
128
+ ]);
129
+
130
+ // src/data/generated/polymarket-city-stations.ts
131
+ var POLYMARKET_CITY_STATIONS = {
132
+ amsterdam: {
133
+ default: "EHAM"
134
+ },
135
+ atlanta: {
136
+ default: "KATL"
137
+ },
138
+ auckland: {
139
+ default: "NZAA"
140
+ },
141
+ austin: {
142
+ default: "KAUS"
143
+ },
144
+ bangkok: {
145
+ default: "VTBS"
146
+ },
147
+ barcelona: {
148
+ default: "LEBL"
149
+ },
150
+ beijing: {
151
+ default: "ZBAA"
152
+ },
153
+ berlin: {
154
+ default: "EDDB"
155
+ },
156
+ boston: {
157
+ default: "KBOS"
158
+ },
159
+ brisbane: {
160
+ default: "YBBN"
161
+ },
162
+ buenos_aires: {
163
+ default: "SAEZ"
164
+ },
165
+ chicago: {
166
+ default: "KORD",
167
+ high: "KORD",
168
+ low: "KORD"
169
+ },
170
+ copenhagen: {
171
+ default: "EKCH"
172
+ },
173
+ dallas: {
174
+ default: "KDFW"
175
+ },
176
+ delhi: {
177
+ default: "VIDP"
178
+ },
179
+ denver: {
180
+ default: "KDEN"
181
+ },
182
+ detroit: {
183
+ default: "KDTW"
184
+ },
185
+ doha: {
186
+ default: "OTHH"
187
+ },
188
+ dubai: {
189
+ default: "OMDB"
190
+ },
191
+ frankfurt: {
192
+ default: "EDDF"
193
+ },
194
+ helsinki: {
195
+ default: "EFHK"
196
+ },
197
+ hong_kong: {
198
+ default: "VHHH",
199
+ high: "VHHH",
200
+ low: "VHHH"
201
+ },
202
+ houston: {
203
+ default: "KIAH"
204
+ },
205
+ london: {
206
+ default: "EGLL"
207
+ },
208
+ london_gatwick: {
209
+ default: "EGKK"
210
+ },
211
+ los_angeles: {
212
+ default: "KLAX",
213
+ high: "KLAX",
214
+ low: "KLAX"
215
+ },
216
+ madrid: {
217
+ default: "LEMD"
218
+ },
219
+ melbourne: {
220
+ default: "YMML"
221
+ },
222
+ miami: {
223
+ default: "KMIA"
224
+ },
225
+ milan: {
226
+ default: "LIMC"
227
+ },
228
+ minneapolis: {
229
+ default: "KMSP"
230
+ },
231
+ moscow: {
232
+ default: "UUEE"
233
+ },
234
+ mumbai: {
235
+ default: "VABB"
236
+ },
237
+ munich: {
238
+ default: "EDDM"
239
+ },
240
+ nyc: {
241
+ default: "KLGA",
242
+ high: "KLGA",
243
+ low: "KLGA"
244
+ },
245
+ paris: {
246
+ default: "LFPG",
247
+ high: "LFPG",
248
+ low: "LFPB"
249
+ },
250
+ paris_orly: {
251
+ default: "LFPO"
252
+ },
253
+ philadelphia: {
254
+ default: "KPHL"
255
+ },
256
+ phoenix: {
257
+ default: "KPHX"
258
+ },
259
+ riyadh: {
260
+ default: "OERK"
261
+ },
262
+ rome: {
263
+ default: "LIRF"
264
+ },
265
+ san_francisco: {
266
+ default: "KSFO"
267
+ },
268
+ sao_paulo: {
269
+ default: "SBGR"
270
+ },
271
+ seattle: {
272
+ default: "KSEA"
273
+ },
274
+ seoul: {
275
+ default: "RKSI"
276
+ },
277
+ shanghai: {
278
+ default: "ZSPD"
279
+ },
280
+ singapore: {
281
+ default: "WSSS"
282
+ },
283
+ stockholm: {
284
+ default: "ESSA"
285
+ },
286
+ sydney: {
287
+ default: "YSSY"
288
+ },
289
+ taipei: {
290
+ default: "RCTP"
291
+ },
292
+ tokyo: {
293
+ default: "RJTT",
294
+ high: "RJTT",
295
+ low: "RJTT"
296
+ },
297
+ tokyo_narita: {
298
+ default: "RJAA"
299
+ },
300
+ vienna: {
301
+ default: "LOWW"
302
+ },
303
+ warsaw: {
304
+ default: "EPWA"
305
+ },
306
+ washington_dc: {
307
+ default: "KDCA"
308
+ },
309
+ wellington: {
310
+ default: "NZWN"
311
+ },
312
+ zurich: {
313
+ default: "LSZH"
314
+ }
315
+ };
316
+
317
+ // src/resolvers/kalshi-nhigh.ts
318
+ var ContractIdError = class extends Error {
319
+ constructor(message) {
320
+ super(message);
321
+ this.name = "ContractIdError";
322
+ }
323
+ };
324
+ function coerceContractDate(value) {
325
+ if (typeof value === "string") {
326
+ if (!/^\d{4}-\d{2}-\d{2}$/.test(value)) {
327
+ throw new ContractIdError(
328
+ `settlementDate string must be YYYY-MM-DD; got ${JSON.stringify(value)}`
329
+ );
330
+ }
331
+ const parsed = /* @__PURE__ */ new Date(`${value}T00:00:00Z`);
332
+ if (Number.isNaN(parsed.getTime())) {
333
+ throw new ContractIdError(
334
+ `settlementDate string is not a valid calendar date; got ${JSON.stringify(value)}`
335
+ );
336
+ }
337
+ const iso = parsed.toISOString().slice(0, 10);
338
+ if (iso !== value) {
339
+ throw new ContractIdError(
340
+ `settlementDate string is not a valid calendar date; got ${JSON.stringify(value)}`
341
+ );
342
+ }
343
+ return value;
344
+ }
345
+ if (value instanceof Date) {
346
+ if (Number.isNaN(value.getTime())) {
347
+ throw new ContractIdError("settlementDate is an invalid Date instance");
348
+ }
349
+ if (value.getUTCHours() !== 0 || value.getUTCMinutes() !== 0 || value.getUTCSeconds() !== 0 || value.getUTCMilliseconds() !== 0) {
350
+ throw new ContractIdError(
351
+ `settlementDate must be a UTC date-only Date (H/M/S/ms = 0); got ${value.toISOString()}. Use new Date('YYYY-MM-DDT00:00:00Z') or pass a 'YYYY-MM-DD' string.`
352
+ );
353
+ }
354
+ return value.toISOString().slice(0, 10);
355
+ }
356
+ throw new ContractIdError("settlementDate must be a Date instance or YYYY-MM-DD string");
357
+ }
358
+ function kalshiNhighResolve(contractId, settlementDate) {
359
+ if (typeof contractId !== "string") {
360
+ throw new ContractIdError(`contractId must be a string; got ${typeof contractId}`);
361
+ }
362
+ const contractDate = coerceContractDate(settlementDate);
363
+ const cid = contractId.toUpperCase();
364
+ if (!cid.startsWith("KHIGH") || cid.length <= 5) {
365
+ throw new ContractIdError(
366
+ `NHIGH contractId must follow 'KHIGH<CITY>' format; got ${JSON.stringify(contractId)}`
367
+ );
368
+ }
369
+ const cityTicker = cid.slice(5);
370
+ const station = KALSHI_SETTLEMENT_STATIONS[cityTicker];
371
+ if (station === void 0) {
372
+ const known = Object.keys(KALSHI_SETTLEMENT_STATIONS).sort();
373
+ throw new ContractIdError(
374
+ `unknown city ${JSON.stringify(cityTicker)} (known: ${known.join(", ")})`
375
+ );
376
+ }
377
+ return Object.freeze({
378
+ settlementSource: "cli.archive",
379
+ settlementStation: station.station,
380
+ cityTicker,
381
+ contractDate
382
+ });
383
+ }
384
+
385
+ // src/resolvers/kalshi-nlow.ts
386
+ function coerceContractDate2(value) {
387
+ if (typeof value === "string") {
388
+ if (!/^\d{4}-\d{2}-\d{2}$/.test(value)) {
389
+ throw new ContractIdError(
390
+ `settlementDate string must be YYYY-MM-DD; got ${JSON.stringify(value)}`
391
+ );
392
+ }
393
+ const parsed = /* @__PURE__ */ new Date(`${value}T00:00:00Z`);
394
+ if (Number.isNaN(parsed.getTime())) {
395
+ throw new ContractIdError(
396
+ `settlementDate string is not a valid calendar date; got ${JSON.stringify(value)}`
397
+ );
398
+ }
399
+ const iso = parsed.toISOString().slice(0, 10);
400
+ if (iso !== value) {
401
+ throw new ContractIdError(
402
+ `settlementDate string is not a valid calendar date; got ${JSON.stringify(value)}`
403
+ );
404
+ }
405
+ return value;
406
+ }
407
+ if (value instanceof Date) {
408
+ if (Number.isNaN(value.getTime())) {
409
+ throw new ContractIdError("settlementDate is an invalid Date instance");
410
+ }
411
+ if (value.getUTCHours() !== 0 || value.getUTCMinutes() !== 0 || value.getUTCSeconds() !== 0 || value.getUTCMilliseconds() !== 0) {
412
+ throw new ContractIdError(
413
+ `settlementDate must be a UTC date-only Date (H/M/S/ms = 0); got ${value.toISOString()}. Use new Date('YYYY-MM-DDT00:00:00Z') or pass a 'YYYY-MM-DD' string.`
414
+ );
415
+ }
416
+ return value.toISOString().slice(0, 10);
417
+ }
418
+ throw new ContractIdError("settlementDate must be a Date instance or YYYY-MM-DD string");
419
+ }
420
+ function kalshiNlowResolve(contractId, settlementDate) {
421
+ if (typeof contractId !== "string") {
422
+ throw new ContractIdError(`contractId must be a string; got ${typeof contractId}`);
423
+ }
424
+ const contractDate = coerceContractDate2(settlementDate);
425
+ const cid = contractId.toUpperCase();
426
+ if (!cid.startsWith("KLOW") || cid.length <= 4) {
427
+ throw new ContractIdError(
428
+ `NLOW contractId must follow 'KLOW<CITY>' format; got ${JSON.stringify(contractId)}`
429
+ );
430
+ }
431
+ const cityTicker = cid.slice(4);
432
+ const station = KALSHI_SETTLEMENT_STATIONS[cityTicker];
433
+ if (station === void 0) {
434
+ const known = Object.keys(KALSHI_SETTLEMENT_STATIONS).sort();
435
+ throw new ContractIdError(
436
+ `unknown city ${JSON.stringify(cityTicker)} (known: ${known.join(", ")})`
437
+ );
438
+ }
439
+ return Object.freeze({
440
+ settlementSource: "cli.archive",
441
+ settlementStation: station.station,
442
+ cityTicker,
443
+ contractDate
444
+ });
445
+ }
446
+
447
+ // src/kalshi-settlement.ts
448
+ function kalshiSettlementFor(contractId, date) {
449
+ if (typeof contractId !== "string" || contractId.length === 0) {
450
+ throw new ContractIdError("contractId must be a non-empty string");
451
+ }
452
+ const upper = contractId.toUpperCase();
453
+ if (upper.startsWith("KHIGH")) return kalshiNhighResolve(upper, date);
454
+ if (upper.startsWith("KLOW")) return kalshiNlowResolve(upper, date);
455
+ throw new ContractIdError(
456
+ `contractId ${JSON.stringify(contractId)} does not start with KHIGH or KLOW`
457
+ );
458
+ }
459
+
460
+ // src/index.ts
461
+ var version = "0.0.0";
462
+ function helloMarkets() {
463
+ return "hello @mostlyrightmd/markets";
464
+ }
465
+ return __toCommonJS(index_exports);
466
+ })();
467
+ //# sourceMappingURL=index.global.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/data/generated/kalshi-stations.ts","../src/data/generated/polymarket-city-stations.ts","../src/resolvers/kalshi-nhigh.ts","../src/resolvers/kalshi-nlow.ts","../src/kalshi-settlement.ts"],"sourcesContent":["// @mostlyrightmd/markets — placeholder scaffold for TS-W0 Wave 1.\n// Real implementation (Kalshi NHIGH/NLOW resolvers, Polymarket discover/settle) lands in TS-W1+.\n\nexport const version = \"0.0.0\";\n\nexport function helloMarkets(): string {\n return \"hello @mostlyrightmd/markets\";\n}\n\n// Re-export generated data (NOT auto-generated; hand-maintained barrel).\n// The targets ARE auto-generated by @mostlyrightmd/codegen — see packages-ts/codegen.\nexport * from \"./data/generated/index.js\";\n\n// Kalshi NHIGH/NLOW resolvers (TS-W1 Wave 2).\nexport * from \"./resolvers/index.js\";\n\n// Kalshi settlement helper (TS-W5 Wave 5) — higher-level dispatch by\n// prefix (KHIGH* vs KLOW*).\nexport { kalshiSettlementFor } from \"./kalshi-settlement.js\";\nexport type { KalshiSettlement } from \"./kalshi-settlement.js\";\n\n// NOTE: Polymarket discover/settle (TS-W5 Waves 1-4) live at the\n// `./polymarket` subpath, NOT the root barrel — keeps the IIFE bundle\n// lean (Polymarket is server-side by design; CORS-blocked from\n// browsers per .planning/research/TS-CORS-MATRIX.md). Import with:\n//\n// import { polymarketDiscover, polymarketSettle } from \"@mostlyrightmd/markets/polymarket\";\n","// AUTO-GENERATED by @mostlyrightmd/codegen from schemas/kalshi-settlement-stations.json.\n// DO NOT EDIT — regenerate with: pnpm codegen\n// Last manifest SHA recorded in schemas/EXPORT_MANIFEST.json\n\nexport interface KalshiStation {\n station: string;\n citation: string;\n}\n\nexport const KALSHI_SETTLEMENT_STATIONS: Readonly<Record<string, KalshiStation>> = {\n ATL: {\n citation: \"https://kalshi.com/markets/khighatl (Atlanta Hartsfield-Jackson)\",\n station: \"KATL\",\n },\n AUS: {\n citation: \"https://kalshi.com/markets/khighaus (Austin-Bergstrom; the only Austin station Kalshi cites)\",\n station: \"KAUS\",\n },\n BNA: {\n citation: \"https://kalshi.com/markets/khighbna (Nashville International)\",\n station: \"KBNA\",\n },\n BOS: {\n citation: \"https://kalshi.com/markets/khighbos (Boston Logan)\",\n station: \"KBOS\",\n },\n CHI: {\n citation: \"https://kalshi.com/markets/khighchi (Midway, NOT ORD)\",\n station: \"KMDW\",\n },\n CVG: {\n citation: \"https://kalshi.com/markets/khighcvg (Cincinnati/Northern Kentucky International)\",\n station: \"KCVG\",\n },\n DAL: {\n citation: \"https://kalshi.com/markets/khighdal (DFW, NOT Love Field)\",\n station: \"KDFW\",\n },\n DCA: {\n citation: \"https://kalshi.com/markets/khighdca (Reagan National, NOT Dulles or BWI)\",\n station: \"KDCA\",\n },\n DEN: {\n citation: \"https://kalshi.com/markets/khighden (Denver International)\",\n station: \"KDEN\",\n },\n DTW: {\n citation: \"https://kalshi.com/markets/khighdtw (Detroit Metropolitan)\",\n station: \"KDTW\",\n },\n HOU: {\n citation: \"https://kalshi.com/markets/khighhou (Intercontinental, NOT Hobby; Kalshi cites IAH)\",\n station: \"KIAH\",\n },\n LAX: {\n citation: \"https://kalshi.com/markets/khighlax (LAX international)\",\n station: \"KLAX\",\n },\n MIA: {\n citation: \"https://kalshi.com/markets/khighmia (Miami International)\",\n station: \"KMIA\",\n },\n MSP: {\n citation: \"https://kalshi.com/markets/khighmsp (Minneapolis-St. Paul International)\",\n station: \"KMSP\",\n },\n NYC: {\n citation: \"https://kalshi.com/markets/khighny (Central Park, NOT LGA/JFK)\",\n station: \"KNYC\",\n },\n PHL: {\n citation: \"https://kalshi.com/markets/khighphl (Philadelphia International)\",\n station: \"KPHL\",\n },\n PHX: {\n citation: \"https://kalshi.com/markets/khighphx (Sky Harbor International)\",\n station: \"KPHX\",\n },\n SEA: {\n citation: \"https://kalshi.com/markets/khighsea (SeaTac, NOT BFI)\",\n station: \"KSEA\",\n },\n SFO: {\n citation: \"https://kalshi.com/markets/khighsfo (San Francisco International, NOT OAK)\",\n station: \"KSFO\",\n },\n SLC: {\n citation: \"https://kalshi.com/markets/khighslc (Salt Lake City International)\",\n station: \"KSLC\",\n },\n} as const;\n\nexport const KNOWN_WRONG_STATIONS: ReadonlySet<string> = new Set<string>([\n \"KBWI\",\n \"KDAL\",\n \"KEWR\",\n \"KHOU\",\n \"KIAD\",\n \"KJFK\",\n \"KLGA\",\n \"KOAK\",\n \"KORD\",\n]);\n","// AUTO-GENERATED by @mostlyrightmd/codegen from schemas/polymarket-city-stations.json.\n// DO NOT EDIT — regenerate with: pnpm codegen\n// Last manifest SHA recorded in schemas/EXPORT_MANIFEST.json\n\nexport interface PolymarketCityStation {\n default: string;\n high?: string;\n low?: string;\n [measure: string]: string | undefined;\n}\n\nexport const POLYMARKET_CITY_STATIONS: Readonly<Record<string, PolymarketCityStation>> = {\n amsterdam: {\n default: \"EHAM\",\n },\n atlanta: {\n default: \"KATL\",\n },\n auckland: {\n default: \"NZAA\",\n },\n austin: {\n default: \"KAUS\",\n },\n bangkok: {\n default: \"VTBS\",\n },\n barcelona: {\n default: \"LEBL\",\n },\n beijing: {\n default: \"ZBAA\",\n },\n berlin: {\n default: \"EDDB\",\n },\n boston: {\n default: \"KBOS\",\n },\n brisbane: {\n default: \"YBBN\",\n },\n buenos_aires: {\n default: \"SAEZ\",\n },\n chicago: {\n default: \"KORD\",\n high: \"KORD\",\n low: \"KORD\",\n },\n copenhagen: {\n default: \"EKCH\",\n },\n dallas: {\n default: \"KDFW\",\n },\n delhi: {\n default: \"VIDP\",\n },\n denver: {\n default: \"KDEN\",\n },\n detroit: {\n default: \"KDTW\",\n },\n doha: {\n default: \"OTHH\",\n },\n dubai: {\n default: \"OMDB\",\n },\n frankfurt: {\n default: \"EDDF\",\n },\n helsinki: {\n default: \"EFHK\",\n },\n hong_kong: {\n default: \"VHHH\",\n high: \"VHHH\",\n low: \"VHHH\",\n },\n houston: {\n default: \"KIAH\",\n },\n london: {\n default: \"EGLL\",\n },\n london_gatwick: {\n default: \"EGKK\",\n },\n los_angeles: {\n default: \"KLAX\",\n high: \"KLAX\",\n low: \"KLAX\",\n },\n madrid: {\n default: \"LEMD\",\n },\n melbourne: {\n default: \"YMML\",\n },\n miami: {\n default: \"KMIA\",\n },\n milan: {\n default: \"LIMC\",\n },\n minneapolis: {\n default: \"KMSP\",\n },\n moscow: {\n default: \"UUEE\",\n },\n mumbai: {\n default: \"VABB\",\n },\n munich: {\n default: \"EDDM\",\n },\n nyc: {\n default: \"KLGA\",\n high: \"KLGA\",\n low: \"KLGA\",\n },\n paris: {\n default: \"LFPG\",\n high: \"LFPG\",\n low: \"LFPB\",\n },\n paris_orly: {\n default: \"LFPO\",\n },\n philadelphia: {\n default: \"KPHL\",\n },\n phoenix: {\n default: \"KPHX\",\n },\n riyadh: {\n default: \"OERK\",\n },\n rome: {\n default: \"LIRF\",\n },\n san_francisco: {\n default: \"KSFO\",\n },\n sao_paulo: {\n default: \"SBGR\",\n },\n seattle: {\n default: \"KSEA\",\n },\n seoul: {\n default: \"RKSI\",\n },\n shanghai: {\n default: \"ZSPD\",\n },\n singapore: {\n default: \"WSSS\",\n },\n stockholm: {\n default: \"ESSA\",\n },\n sydney: {\n default: \"YSSY\",\n },\n taipei: {\n default: \"RCTP\",\n },\n tokyo: {\n default: \"RJTT\",\n high: \"RJTT\",\n low: \"RJTT\",\n },\n tokyo_narita: {\n default: \"RJAA\",\n },\n vienna: {\n default: \"LOWW\",\n },\n warsaw: {\n default: \"EPWA\",\n },\n washington_dc: {\n default: \"KDCA\",\n },\n wellington: {\n default: \"NZWN\",\n },\n zurich: {\n default: \"LSZH\",\n },\n} as const;\n","// Kalshi NHIGH (daily HIGH temperature) contract resolver.\n//\n// NHIGH markets resolve against the NWS CLI `max_temp_f` value for a\n// specific station on a specific date. `kalshiNhighResolve` is the\n// deterministic mapping from a Kalshi market identifier to the\n// (settlement_source, settlement_station) tuple downstream code uses\n// to pull the right settlement row from the CLI catalog.\n//\n// Ported byte-faithful from packages/markets/src/mostlyright/markets/catalog/kalshi_nhigh.py.\n\nimport { KALSHI_SETTLEMENT_STATIONS } from \"../data/generated/kalshi-stations.js\";\n\nexport interface NHighResolution {\n readonly settlementSource: \"cli.archive\";\n readonly settlementStation: string; // 4-letter ICAO\n readonly cityTicker: string;\n readonly contractDate: string; // YYYY-MM-DD\n}\n\n/**\n * Custom error type for contract-id parsing / validation failures.\n *\n * Mirrors the Python `ValueError`/`TypeError` distinction: in TS we use a\n * named subclass so callers can `instanceof`-check rather than parse\n * error messages.\n */\nexport class ContractIdError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"ContractIdError\";\n }\n}\n\n/**\n * Coerce a Date or YYYY-MM-DD string into an ISO date-only string.\n *\n * Rejects Date instances whose UTC hours/minutes/seconds/ms are non-zero —\n * those would silently corrupt downstream settlement-date matching\n * (date-equality is strict).\n *\n * Mirrors the Python `isinstance(settlement_date, datetime)` guard in\n * `kalshi_nhigh.resolve`.\n */\nfunction coerceContractDate(value: Date | string): string {\n if (typeof value === \"string\") {\n // YYYY-MM-DD strict format check.\n if (!/^\\d{4}-\\d{2}-\\d{2}$/.test(value)) {\n throw new ContractIdError(\n `settlementDate string must be YYYY-MM-DD; got ${JSON.stringify(value)}`,\n );\n }\n // Validate it parses to a real calendar date.\n const parsed = new Date(`${value}T00:00:00Z`);\n if (Number.isNaN(parsed.getTime())) {\n throw new ContractIdError(\n `settlementDate string is not a valid calendar date; got ${JSON.stringify(value)}`,\n );\n }\n // Round-trip check — guards against e.g. \"2025-02-30\" silently\n // rolling forward.\n const iso = parsed.toISOString().slice(0, 10);\n if (iso !== value) {\n throw new ContractIdError(\n `settlementDate string is not a valid calendar date; got ${JSON.stringify(value)}`,\n );\n }\n return value;\n }\n if (value instanceof Date) {\n if (Number.isNaN(value.getTime())) {\n throw new ContractIdError(\"settlementDate is an invalid Date instance\");\n }\n // Reject any Date with a non-zero UTC time component — mirrors\n // Python's `isinstance(settlement_date, datetime)` guard. A Date\n // carries a time component which would break downstream\n // date-equality matching.\n if (\n value.getUTCHours() !== 0 ||\n value.getUTCMinutes() !== 0 ||\n value.getUTCSeconds() !== 0 ||\n value.getUTCMilliseconds() !== 0\n ) {\n throw new ContractIdError(\n `settlementDate must be a UTC date-only Date (H/M/S/ms = 0); got ${value.toISOString()}. Use new Date('YYYY-MM-DDT00:00:00Z') or pass a 'YYYY-MM-DD' string.`,\n );\n }\n return value.toISOString().slice(0, 10);\n }\n throw new ContractIdError(\"settlementDate must be a Date instance or YYYY-MM-DD string\");\n}\n\n/**\n * Resolve a Kalshi NHIGH contract to its settlement source + station.\n *\n * The contract id format is `KHIGH<CITY>` (case-insensitive), where\n * `<CITY>` is a city ticker present in\n * {@link KALSHI_SETTLEMENT_STATIONS}.\n *\n * @param contractId Kalshi market identifier. Case-insensitive.\n * @param settlementDate Calendar date the market settles for. Either a\n * UTC date-only `Date` (H/M/S/ms == 0) or a `YYYY-MM-DD` string.\n * @returns A frozen {@link NHighResolution}.\n * @throws {ContractIdError} The contract id doesn't follow\n * `KHIGH<CITY>`, the city is unknown, or the settlement date is\n * invalid.\n */\nexport function kalshiNhighResolve(\n contractId: string,\n settlementDate: Date | string,\n): NHighResolution {\n if (typeof contractId !== \"string\") {\n throw new ContractIdError(`contractId must be a string; got ${typeof contractId}`);\n }\n\n const contractDate = coerceContractDate(settlementDate);\n\n const cid = contractId.toUpperCase();\n if (!cid.startsWith(\"KHIGH\") || cid.length <= 5) {\n throw new ContractIdError(\n `NHIGH contractId must follow 'KHIGH<CITY>' format; got ${JSON.stringify(contractId)}`,\n );\n }\n const cityTicker = cid.slice(5);\n const station = KALSHI_SETTLEMENT_STATIONS[cityTicker];\n if (station === undefined) {\n const known = Object.keys(KALSHI_SETTLEMENT_STATIONS).sort();\n throw new ContractIdError(\n `unknown city ${JSON.stringify(cityTicker)} (known: ${known.join(\", \")})`,\n );\n }\n\n return Object.freeze({\n settlementSource: \"cli.archive\" as const,\n settlementStation: station.station,\n cityTicker,\n contractDate,\n });\n}\n","// Kalshi NLOW (daily LOW temperature) contract resolver.\n//\n// Mirror of kalshi-nhigh — same station whitelist + same source\n// (cli.archive); only the metric differs. NLOW markets resolve against\n// the NWS CLI `min_temp_f` value for a specific station on a specific\n// date.\n//\n// Ported byte-faithful from packages/markets/src/mostlyright/markets/catalog/kalshi_nlow.py.\n\nimport { KALSHI_SETTLEMENT_STATIONS } from \"../data/generated/kalshi-stations.js\";\nimport { ContractIdError } from \"./kalshi-nhigh.js\";\n\nexport interface NLowResolution {\n readonly settlementSource: \"cli.archive\";\n readonly settlementStation: string; // 4-letter ICAO\n readonly cityTicker: string;\n readonly contractDate: string; // YYYY-MM-DD\n}\n\n/**\n * Coerce a Date or YYYY-MM-DD string into an ISO date-only string.\n *\n * Rejects Date instances whose UTC hours/minutes/seconds/ms are non-zero —\n * those would silently corrupt downstream settlement-date matching.\n *\n * Mirrors the Python `isinstance(settlement_date, datetime)` guard.\n *\n * Note: duplicated here (rather than imported) so kalshi-nlow stays a\n * standalone file matching the Python module split. The two functions\n * are byte-identical by design.\n */\nfunction coerceContractDate(value: Date | string): string {\n if (typeof value === \"string\") {\n if (!/^\\d{4}-\\d{2}-\\d{2}$/.test(value)) {\n throw new ContractIdError(\n `settlementDate string must be YYYY-MM-DD; got ${JSON.stringify(value)}`,\n );\n }\n const parsed = new Date(`${value}T00:00:00Z`);\n if (Number.isNaN(parsed.getTime())) {\n throw new ContractIdError(\n `settlementDate string is not a valid calendar date; got ${JSON.stringify(value)}`,\n );\n }\n const iso = parsed.toISOString().slice(0, 10);\n if (iso !== value) {\n throw new ContractIdError(\n `settlementDate string is not a valid calendar date; got ${JSON.stringify(value)}`,\n );\n }\n return value;\n }\n if (value instanceof Date) {\n if (Number.isNaN(value.getTime())) {\n throw new ContractIdError(\"settlementDate is an invalid Date instance\");\n }\n if (\n value.getUTCHours() !== 0 ||\n value.getUTCMinutes() !== 0 ||\n value.getUTCSeconds() !== 0 ||\n value.getUTCMilliseconds() !== 0\n ) {\n throw new ContractIdError(\n `settlementDate must be a UTC date-only Date (H/M/S/ms = 0); got ${value.toISOString()}. Use new Date('YYYY-MM-DDT00:00:00Z') or pass a 'YYYY-MM-DD' string.`,\n );\n }\n return value.toISOString().slice(0, 10);\n }\n throw new ContractIdError(\"settlementDate must be a Date instance or YYYY-MM-DD string\");\n}\n\n/**\n * Resolve a Kalshi NLOW contract to its settlement source + station.\n *\n * The contract id format is `KLOW<CITY>` (case-insensitive), where\n * `<CITY>` is a city ticker present in\n * {@link KALSHI_SETTLEMENT_STATIONS}.\n *\n * @param contractId Kalshi market identifier. Case-insensitive.\n * @param settlementDate Calendar date the market settles for. Either a\n * UTC date-only `Date` (H/M/S/ms == 0) or a `YYYY-MM-DD` string.\n * @returns A frozen {@link NLowResolution}.\n * @throws {ContractIdError} The contract id doesn't follow\n * `KLOW<CITY>`, the city is unknown, or the settlement date is\n * invalid.\n */\nexport function kalshiNlowResolve(\n contractId: string,\n settlementDate: Date | string,\n): NLowResolution {\n if (typeof contractId !== \"string\") {\n throw new ContractIdError(`contractId must be a string; got ${typeof contractId}`);\n }\n\n const contractDate = coerceContractDate(settlementDate);\n\n const cid = contractId.toUpperCase();\n if (!cid.startsWith(\"KLOW\") || cid.length <= 4) {\n throw new ContractIdError(\n `NLOW contractId must follow 'KLOW<CITY>' format; got ${JSON.stringify(contractId)}`,\n );\n }\n const cityTicker = cid.slice(4);\n const station = KALSHI_SETTLEMENT_STATIONS[cityTicker];\n if (station === undefined) {\n const known = Object.keys(KALSHI_SETTLEMENT_STATIONS).sort();\n throw new ContractIdError(\n `unknown city ${JSON.stringify(cityTicker)} (known: ${known.join(\", \")})`,\n );\n }\n\n return Object.freeze({\n settlementSource: \"cli.archive\" as const,\n settlementStation: station.station,\n cityTicker,\n contractDate,\n });\n}\n","// TS-W5 Wave 5 — kalshiSettlementFor higher-level helper.\n//\n// Dispatch by Kalshi contract-id prefix (KHIGH* vs KLOW*) to the right\n// resolver. Returns the same shape both NHIGH and NLOW resolvers use so\n// downstream consumers don't need to know about the city-suffix split.\n\nimport { type NHighResolution, kalshiNhighResolve } from \"./resolvers/kalshi-nhigh.js\";\nimport { ContractIdError } from \"./resolvers/kalshi-nhigh.js\";\nimport { type NLowResolution, kalshiNlowResolve } from \"./resolvers/kalshi-nlow.js\";\n\nexport type KalshiSettlement = NHighResolution | NLowResolution;\n\n/**\n * Resolve a Kalshi NHIGH or NLOW contract id to its settlement metadata.\n *\n * `KHIGH*` prefixes dispatch to the NHIGH resolver; `KLOW*` prefixes\n * dispatch to NLOW. Anything else raises `ContractIdError`.\n *\n * @example\n * kalshiSettlementFor(\"KHIGHNYC\", \"2025-01-06\")\n * // → { settlementSource: \"cli.archive\", settlementStation: \"KNYC\",\n * // cityTicker: \"NYC\", contractDate: \"2025-01-06\" }\n */\nexport function kalshiSettlementFor(contractId: string, date: string): KalshiSettlement {\n if (typeof contractId !== \"string\" || contractId.length === 0) {\n throw new ContractIdError(\"contractId must be a non-empty string\");\n }\n const upper = contractId.toUpperCase();\n if (upper.startsWith(\"KHIGH\")) return kalshiNhighResolve(upper, date);\n if (upper.startsWith(\"KLOW\")) return kalshiNlowResolve(upper, date);\n throw new ContractIdError(\n `contractId ${JSON.stringify(contractId)} does not start with KHIGH or KLOW`,\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACSO,MAAM,6BAAsE;AAAA,IACjF,KAAK;AAAA,MACH,UAAU;AAAA,MACV,SAAS;AAAA,IACX;AAAA,IACA,KAAK;AAAA,MACH,UAAU;AAAA,MACV,SAAS;AAAA,IACX;AAAA,IACA,KAAK;AAAA,MACH,UAAU;AAAA,MACV,SAAS;AAAA,IACX;AAAA,IACA,KAAK;AAAA,MACH,UAAU;AAAA,MACV,SAAS;AAAA,IACX;AAAA,IACA,KAAK;AAAA,MACH,UAAU;AAAA,MACV,SAAS;AAAA,IACX;AAAA,IACA,KAAK;AAAA,MACH,UAAU;AAAA,MACV,SAAS;AAAA,IACX;AAAA,IACA,KAAK;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