pmxt-core 2.50.16 → 2.51.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.
Files changed (50) hide show
  1. package/dist/exchanges/hunch/api.d.ts +736 -0
  2. package/dist/exchanges/hunch/api.js +820 -0
  3. package/dist/exchanges/hunch/auth.d.ts +36 -0
  4. package/dist/exchanges/hunch/auth.js +63 -0
  5. package/dist/exchanges/hunch/errors.d.ts +26 -0
  6. package/dist/exchanges/hunch/errors.js +94 -0
  7. package/dist/exchanges/hunch/fetcher.d.ts +204 -0
  8. package/dist/exchanges/hunch/fetcher.js +130 -0
  9. package/dist/exchanges/hunch/index.d.ts +51 -0
  10. package/dist/exchanges/hunch/index.js +330 -0
  11. package/dist/exchanges/hunch/normalizer.d.ts +56 -0
  12. package/dist/exchanges/hunch/normalizer.js +180 -0
  13. package/dist/exchanges/hunch/price.d.ts +5 -0
  14. package/dist/exchanges/hunch/price.js +12 -0
  15. package/dist/exchanges/hunch/utils.d.ts +79 -0
  16. package/dist/exchanges/hunch/utils.js +182 -0
  17. package/dist/exchanges/hunch/websocket.d.ts +25 -0
  18. package/dist/exchanges/hunch/websocket.js +137 -0
  19. package/dist/exchanges/hyperliquid/auth.js +15 -2
  20. package/dist/exchanges/hyperliquid/fetcher.d.ts +26 -1
  21. package/dist/exchanges/hyperliquid/fetcher.js +66 -4
  22. package/dist/exchanges/hyperliquid/index.d.ts +4 -1
  23. package/dist/exchanges/hyperliquid/index.js +84 -20
  24. package/dist/exchanges/hyperliquid/normalizer.d.ts +4 -3
  25. package/dist/exchanges/hyperliquid/normalizer.js +69 -11
  26. package/dist/exchanges/hyperliquid/utils.d.ts +7 -1
  27. package/dist/exchanges/hyperliquid/utils.js +16 -4
  28. package/dist/exchanges/kalshi/api.d.ts +1 -1
  29. package/dist/exchanges/kalshi/api.js +1 -1
  30. package/dist/exchanges/limitless/api.d.ts +1 -1
  31. package/dist/exchanges/limitless/api.js +1 -1
  32. package/dist/exchanges/myriad/api.d.ts +1 -1
  33. package/dist/exchanges/myriad/api.js +1 -1
  34. package/dist/exchanges/opinion/api.d.ts +1 -1
  35. package/dist/exchanges/opinion/api.js +1 -1
  36. package/dist/exchanges/polymarket/api-clob.d.ts +1 -1
  37. package/dist/exchanges/polymarket/api-clob.js +1 -1
  38. package/dist/exchanges/polymarket/api-data.d.ts +1 -1
  39. package/dist/exchanges/polymarket/api-data.js +1 -1
  40. package/dist/exchanges/polymarket/api-gamma.d.ts +1 -1
  41. package/dist/exchanges/polymarket/api-gamma.js +1 -1
  42. package/dist/exchanges/probable/api.d.ts +1 -1
  43. package/dist/exchanges/probable/api.js +1 -1
  44. package/dist/index.d.ts +4 -0
  45. package/dist/index.js +5 -1
  46. package/dist/server/app.js +1 -0
  47. package/dist/server/exchange-factory.js +8 -0
  48. package/dist/server/openapi.yaml +17 -0
  49. package/dist/types.d.ts +4 -0
  50. package/package.json +3 -3
@@ -0,0 +1,736 @@
1
+ /**
2
+ * Embedded Hunch agent-platform OpenAPI spec (subset).
3
+ *
4
+ * SOURCED VERBATIM from the LIVE spec at https://www.playhunch.xyz/openapi.json
5
+ * (fetched while authoring this adapter), trimmed to the operations the Hunch
6
+ * adapter actually drives. operationIds are preserved exactly so the implicit
7
+ * API generated by parseOpenApiSpec() exposes them under the same names:
8
+ * listMarkets, getMarket, researchMarket, quoteBet, placeBet,
9
+ * listPositions, getResult, checkWallet, getStats, getHealth.
10
+ *
11
+ * MAINTAINER NOTE: regenerate by re-fetching /openapi.json (the project would
12
+ * normally do this via `npm run fetch:openapi`; this exchange was authored
13
+ * against the live prod spec directly). Hunch reads are keyless (no security
14
+ * scheme); the trade route settles via x402 / EIP-3009 — see index.ts createOrder.
15
+ */
16
+ export declare const hunchApiSpec: {
17
+ readonly openapi: "3.1.0";
18
+ readonly info: {
19
+ readonly title: "Hunch agent platform API";
20
+ readonly version: "hunch-agent-api-v1";
21
+ };
22
+ readonly servers: readonly [{
23
+ readonly url: "https://www.playhunch.xyz";
24
+ }];
25
+ readonly paths: {
26
+ readonly "/api/agent/v1/markets": {
27
+ readonly get: {
28
+ readonly operationId: "listMarkets";
29
+ readonly summary: "List tradeable markets with live odds.";
30
+ readonly description: "List tradeable markets with live odds.";
31
+ readonly tags: readonly ["markets"];
32
+ readonly "x-hunch-status": "live";
33
+ readonly parameters: readonly [{
34
+ readonly name: "status";
35
+ readonly in: "query";
36
+ readonly required: false;
37
+ readonly description: "open (default) = tradeable now; all includes settled markets.";
38
+ readonly schema: {
39
+ readonly type: "string";
40
+ readonly enum: readonly ["open", "all"];
41
+ readonly default: "open";
42
+ };
43
+ }, {
44
+ readonly name: "type";
45
+ readonly in: "query";
46
+ readonly required: false;
47
+ readonly description: "Exact targetMetric filter (e.g. market_cap, price_direction, token_mcap_flip).";
48
+ readonly schema: {
49
+ readonly type: "string";
50
+ };
51
+ }, {
52
+ readonly name: "token";
53
+ readonly in: "query";
54
+ readonly required: false;
55
+ readonly description: "Case-insensitive token symbol filter (e.g. BNKR).";
56
+ readonly schema: {
57
+ readonly type: "string";
58
+ };
59
+ }, {
60
+ readonly name: "ids";
61
+ readonly in: "query";
62
+ readonly required: false;
63
+ readonly description: "Comma-separated batch of market ids or slugs.";
64
+ readonly schema: {
65
+ readonly type: "string";
66
+ };
67
+ }, {
68
+ readonly name: "limit";
69
+ readonly in: "query";
70
+ readonly required: false;
71
+ readonly description: "Maximum results (≤ 200).";
72
+ readonly schema: {
73
+ readonly type: "integer";
74
+ readonly minimum: 1;
75
+ readonly maximum: 200;
76
+ };
77
+ }];
78
+ readonly responses: {
79
+ readonly "200": {
80
+ readonly description: "The Base-only tradeable market list with live odds.";
81
+ readonly content: {
82
+ readonly "application/json": {
83
+ readonly schema: {
84
+ readonly type: "object";
85
+ readonly properties: {
86
+ readonly meta: {
87
+ readonly $ref: "#/components/schemas/AgentMeta";
88
+ };
89
+ readonly count: {
90
+ readonly type: "integer";
91
+ };
92
+ readonly markets: {
93
+ readonly type: "array";
94
+ readonly items: {
95
+ readonly $ref: "#/components/schemas/AgentMarketRef";
96
+ };
97
+ };
98
+ };
99
+ readonly required: readonly ["meta", "count", "markets"];
100
+ };
101
+ };
102
+ };
103
+ };
104
+ readonly "404": {
105
+ readonly description: "Not found — an unknown id/slug, or the agent platform flag is off (the entire /api/agent/v1 surface returns 404 while dark).";
106
+ readonly content: {
107
+ readonly "application/json": {
108
+ readonly schema: {
109
+ readonly $ref: "#/components/schemas/AgentError";
110
+ };
111
+ };
112
+ };
113
+ };
114
+ };
115
+ };
116
+ };
117
+ readonly "/api/agent/v1/markets/{id}": {
118
+ readonly get: {
119
+ readonly operationId: "getMarket";
120
+ readonly summary: "One market's full reference: question, odds, outcomes, deadline, fee, links.";
121
+ readonly description: "One market's full reference: question, odds, outcomes, deadline, fee, links.";
122
+ readonly tags: readonly ["markets"];
123
+ readonly "x-hunch-status": "live";
124
+ readonly parameters: readonly [{
125
+ readonly name: "id";
126
+ readonly in: "path";
127
+ readonly required: true;
128
+ readonly description: "Market id or slug.";
129
+ readonly schema: {
130
+ readonly type: "string";
131
+ };
132
+ }];
133
+ readonly responses: {
134
+ readonly "200": {
135
+ readonly description: "The market's enriched reference (live odds + stats folded in).";
136
+ readonly content: {
137
+ readonly "application/json": {
138
+ readonly schema: {
139
+ readonly type: "object";
140
+ readonly properties: {
141
+ readonly meta: {
142
+ readonly $ref: "#/components/schemas/AgentMeta";
143
+ };
144
+ readonly market: {
145
+ readonly $ref: "#/components/schemas/AgentMarketRef";
146
+ };
147
+ };
148
+ readonly required: readonly ["meta", "market"];
149
+ };
150
+ };
151
+ };
152
+ };
153
+ readonly "404": {
154
+ readonly description: "Not found — an unknown id/slug, or the agent platform flag is off (the entire /api/agent/v1 surface returns 404 while dark).";
155
+ readonly content: {
156
+ readonly "application/json": {
157
+ readonly schema: {
158
+ readonly $ref: "#/components/schemas/AgentError";
159
+ };
160
+ };
161
+ };
162
+ };
163
+ };
164
+ };
165
+ };
166
+ readonly "/api/agent/v1/markets/{id}/research": {
167
+ readonly get: {
168
+ readonly operationId: "researchMarket";
169
+ readonly summary: "Decision-grade research: resolution rules, odds history, observations, price impact, related markets.";
170
+ readonly description: "Decision-grade research: resolution rules, odds history, observations, price impact, related markets.";
171
+ readonly tags: readonly ["markets"];
172
+ readonly "x-hunch-status": "live";
173
+ readonly parameters: readonly [{
174
+ readonly name: "id";
175
+ readonly in: "path";
176
+ readonly required: true;
177
+ readonly description: "Market id or slug.";
178
+ readonly schema: {
179
+ readonly type: "string";
180
+ };
181
+ }];
182
+ readonly responses: {
183
+ readonly "200": {
184
+ readonly description: "Decision-grade research. The advisory field is DATA ONLY (always null in Phase 1) — the betting decision is the agent's own.";
185
+ readonly content: {
186
+ readonly "application/json": {
187
+ readonly schema: {
188
+ readonly type: "object";
189
+ readonly properties: {
190
+ readonly meta: {
191
+ readonly $ref: "#/components/schemas/AgentMeta";
192
+ };
193
+ readonly research: {
194
+ readonly $ref: "#/components/schemas/AgentResearch";
195
+ };
196
+ };
197
+ readonly required: readonly ["meta", "research"];
198
+ };
199
+ };
200
+ };
201
+ };
202
+ readonly "404": {
203
+ readonly description: "Not found — an unknown id/slug, or the agent platform flag is off (the entire /api/agent/v1 surface returns 404 while dark).";
204
+ readonly content: {
205
+ readonly "application/json": {
206
+ readonly schema: {
207
+ readonly $ref: "#/components/schemas/AgentError";
208
+ };
209
+ };
210
+ };
211
+ };
212
+ };
213
+ };
214
+ };
215
+ readonly "/api/agent/v1/quote": {
216
+ readonly get: {
217
+ readonly operationId: "quoteBet";
218
+ readonly summary: "Price a bet: tier, priceCents, estimatedShares, fee breakdown, 60s quoteId.";
219
+ readonly description: "Price a bet: tier, priceCents, estimatedShares, fee breakdown, 60s quoteId.";
220
+ readonly tags: readonly ["trading"];
221
+ readonly "x-hunch-status": "live";
222
+ readonly parameters: readonly [{
223
+ readonly name: "marketId";
224
+ readonly in: "query";
225
+ readonly required: true;
226
+ readonly description: "Market id or slug.";
227
+ readonly schema: {
228
+ readonly type: "string";
229
+ };
230
+ }, {
231
+ readonly name: "side";
232
+ readonly in: "query";
233
+ readonly required: false;
234
+ readonly description: "yes | no | up | down | <bucketKey> — validated against the market's outcome keys.";
235
+ readonly schema: {
236
+ readonly type: "string";
237
+ readonly default: "yes";
238
+ };
239
+ }, {
240
+ readonly name: "sizeUsd";
241
+ readonly in: "query";
242
+ readonly required: false;
243
+ readonly description: "Bet size in USD. $1 floor, NO maximum — a quote above $10 persists a verifiable 60-second lock behind its quoteId.";
244
+ readonly schema: {
245
+ readonly type: "number";
246
+ readonly minimum: 1;
247
+ readonly default: 1;
248
+ };
249
+ }];
250
+ readonly responses: {
251
+ readonly "200": {
252
+ readonly description: "The live quote. Always carries a quoteId; pass suggestedMinSharesOut back as minSharesOut on a locked-tier trade.";
253
+ readonly content: {
254
+ readonly "application/json": {
255
+ readonly schema: {
256
+ readonly type: "object";
257
+ readonly properties: {
258
+ readonly meta: {
259
+ readonly $ref: "#/components/schemas/AgentMeta";
260
+ };
261
+ readonly quote: {
262
+ readonly $ref: "#/components/schemas/AgentQuote";
263
+ };
264
+ };
265
+ readonly required: readonly ["meta", "quote"];
266
+ };
267
+ };
268
+ };
269
+ };
270
+ readonly "400": {
271
+ readonly description: "invalid_request — marketId missing, or sizeUsd above the $1,000,000,000 technical precision bound (split the bet).";
272
+ readonly content: {
273
+ readonly "application/json": {
274
+ readonly schema: {
275
+ readonly $ref: "#/components/schemas/AgentError";
276
+ };
277
+ };
278
+ };
279
+ };
280
+ readonly "404": {
281
+ readonly description: "Not found — an unknown id/slug, or the agent platform flag is off (the entire /api/agent/v1 surface returns 404 while dark).";
282
+ readonly content: {
283
+ readonly "application/json": {
284
+ readonly schema: {
285
+ readonly $ref: "#/components/schemas/AgentError";
286
+ };
287
+ };
288
+ };
289
+ };
290
+ readonly "422": {
291
+ readonly description: "size_below_min (the $1 floor) or invalid_side.";
292
+ readonly content: {
293
+ readonly "application/json": {
294
+ readonly schema: {
295
+ readonly $ref: "#/components/schemas/AgentError";
296
+ };
297
+ };
298
+ };
299
+ };
300
+ readonly "429": {
301
+ readonly description: "rate_limited — 30 quotes/min per IP.";
302
+ readonly content: {
303
+ readonly "application/json": {
304
+ readonly schema: {
305
+ readonly $ref: "#/components/schemas/AgentError";
306
+ };
307
+ };
308
+ };
309
+ };
310
+ readonly "500": {
311
+ readonly description: "internal_error — the book or quote storage was unreadable; retry shortly.";
312
+ readonly content: {
313
+ readonly "application/json": {
314
+ readonly schema: {
315
+ readonly $ref: "#/components/schemas/AgentError";
316
+ };
317
+ };
318
+ };
319
+ };
320
+ };
321
+ };
322
+ };
323
+ readonly "/api/agent/v1/trade": {
324
+ readonly post: {
325
+ readonly operationId: "placeBet";
326
+ readonly summary: "Place a bet via x402 (USDC on Base). simulate:true = $0 dry-run of the full pipeline. $1 floor, NO maximum.";
327
+ readonly description: "Settle a real USDC bet on Base via x402 — or dry-run it for $0 with \"simulate\": true (runs the FULL validation pipeline, including locked-tier quote verification, but moves nothing). Flow: POST the bet body with no payment header → HTTP 402 challenge → sign an EIP-3009 transferWithAuthorization for exactly accepts[0].maxAmountRequired → retry the SAME body with the X-PAYMENT header. Keyless: the paying wallet IS the account. $1 floor, NO maximum; above $10 the body must also carry quoteId plus minSharesOut or maxPriceCents (from GET /api/agent/v1/quote). Idempotent on idemKey — a replay returns the original receipt and never double-settles.";
328
+ readonly tags: readonly ["trading"];
329
+ readonly "x-hunch-status": "live";
330
+ readonly parameters: readonly [{
331
+ readonly name: "X-PAYMENT";
332
+ readonly in: "header";
333
+ readonly required: false;
334
+ readonly description: "base64(JSON x402 envelope) carrying the signed EIP-3009 transferWithAuthorization. Omit on the first call to receive the 402 challenge; retry the SAME body with this header to settle. Not needed when simulate is true.";
335
+ readonly schema: {
336
+ readonly type: "string";
337
+ };
338
+ }];
339
+ readonly requestBody: {
340
+ readonly required: true;
341
+ readonly content: {
342
+ readonly "application/json": {
343
+ readonly schema: {
344
+ readonly $ref: "#/components/schemas/AgentTradeRequest";
345
+ };
346
+ };
347
+ };
348
+ };
349
+ readonly responses: {
350
+ readonly "200": {
351
+ readonly description: "The trade receipt. simulated:true receipts carry txHash:null — no funds moved.";
352
+ readonly content: {
353
+ readonly "application/json": {
354
+ readonly schema: {
355
+ readonly type: "object";
356
+ readonly properties: {
357
+ readonly meta: {
358
+ readonly $ref: "#/components/schemas/AgentMeta";
359
+ };
360
+ readonly replay: {
361
+ readonly type: "boolean";
362
+ readonly description: "true when this idemKey had already settled — the ORIGINAL receipt is returned (no double-settle).";
363
+ };
364
+ readonly receipt: {
365
+ readonly $ref: "#/components/schemas/AgentTradeReceipt";
366
+ };
367
+ };
368
+ readonly required: readonly ["meta", "receipt"];
369
+ };
370
+ };
371
+ };
372
+ readonly headers: {
373
+ readonly "X-Payment-Response": {
374
+ readonly description: "base64 settlement summary {success, transaction, network, payer}. Present after real settlement; absent on a simulate receipt.";
375
+ readonly schema: {
376
+ readonly type: "string";
377
+ };
378
+ };
379
+ };
380
+ };
381
+ readonly "400": {
382
+ readonly description: "invalid_request — the body is not valid JSON or fails the strict AgentTradeRequest schema (per-field problems are listed in the error's issues extra).";
383
+ readonly content: {
384
+ readonly "application/json": {
385
+ readonly schema: {
386
+ readonly $ref: "#/components/schemas/AgentError";
387
+ };
388
+ };
389
+ };
390
+ };
391
+ readonly "402": {
392
+ readonly description: "x402 payment challenge — the request carried no (or an invalid) X-PAYMENT header. Sign an EIP-3009 transferWithAuthorization for exactly accepts[0].maxAmountRequired to accepts[0].payTo on Base, then retry the SAME POST body with the X-PAYMENT header (base64 of the signed envelope). The challenge resource embeds this trade's intent hash for audit.";
393
+ readonly content: {
394
+ readonly "application/json": {
395
+ readonly schema: {
396
+ readonly $ref: "#/components/schemas/X402Challenge";
397
+ };
398
+ };
399
+ };
400
+ };
401
+ readonly "404": {
402
+ readonly description: "Not found — an unknown id/slug, or the agent platform flag is off (the entire /api/agent/v1 surface returns 404 while dark).";
403
+ readonly content: {
404
+ readonly "application/json": {
405
+ readonly schema: {
406
+ readonly $ref: "#/components/schemas/AgentError";
407
+ };
408
+ };
409
+ };
410
+ };
411
+ readonly "409": {
412
+ readonly description: "market_closed (no longer accepts bets) or idem_conflict (this idemKey was used for a DIFFERENT trade — generate a fresh one).";
413
+ readonly content: {
414
+ readonly "application/json": {
415
+ readonly schema: {
416
+ readonly $ref: "#/components/schemas/AgentError";
417
+ };
418
+ };
419
+ };
420
+ };
421
+ readonly "422": {
422
+ readonly description: "invalid_side / invalid_wallet / size_below_min / quote_required / quote_expired / quote_mismatch / slippage_exceeded / insufficient_balance / pool_impact_exceeded / unsupported_market / payment_invalid — the error code + hint say exactly what to change.";
423
+ readonly content: {
424
+ readonly "application/json": {
425
+ readonly schema: {
426
+ readonly $ref: "#/components/schemas/AgentError";
427
+ };
428
+ };
429
+ };
430
+ };
431
+ readonly "429": {
432
+ readonly description: "rate_limited — 10 trades/min per wallet (also returned with status 409 semantics when the same idemKey is already settling — retry it shortly to fetch the receipt).";
433
+ readonly content: {
434
+ readonly "application/json": {
435
+ readonly schema: {
436
+ readonly $ref: "#/components/schemas/AgentError";
437
+ };
438
+ };
439
+ };
440
+ };
441
+ readonly "500": {
442
+ readonly description: "internal_error — possibly reconcilable: if the tx WAS submitted but recording failed, the body carries txHash; retry with the SAME idemKey to fetch the receipt (settlement is idempotent).";
443
+ readonly content: {
444
+ readonly "application/json": {
445
+ readonly schema: {
446
+ readonly $ref: "#/components/schemas/AgentError";
447
+ };
448
+ };
449
+ };
450
+ };
451
+ readonly "503": {
452
+ readonly description: "platform_paused — trading is temporarily paused (kill switch) or settlement is unavailable. Poll GET /api/agent/v1/health.";
453
+ readonly content: {
454
+ readonly "application/json": {
455
+ readonly schema: {
456
+ readonly $ref: "#/components/schemas/AgentError";
457
+ };
458
+ };
459
+ };
460
+ };
461
+ };
462
+ };
463
+ };
464
+ readonly "/api/agent/v1/positions": {
465
+ readonly get: {
466
+ readonly operationId: "listPositions";
467
+ readonly summary: "A wallet's open + resolved positions with live PnL (merges the Bankr partner rail).";
468
+ readonly description: "A wallet's open + resolved positions with live PnL (merges the Bankr partner rail).";
469
+ readonly tags: readonly ["positions"];
470
+ readonly "x-hunch-status": "live";
471
+ readonly parameters: readonly [{
472
+ readonly name: "wallet";
473
+ readonly in: "query";
474
+ readonly required: true;
475
+ readonly description: "The betting wallet (0x + 40 hex). Merges BOTH rail identities (agent: and bankr:) so the full book is visible.";
476
+ readonly schema: {
477
+ readonly type: "string";
478
+ readonly pattern: "^0x[0-9a-fA-F]{40}$";
479
+ };
480
+ }];
481
+ readonly responses: {
482
+ readonly "200": {
483
+ readonly description: "Open + resolved positions with live PnL, newest first.";
484
+ readonly content: {
485
+ readonly "application/json": {
486
+ readonly schema: {
487
+ readonly type: "object";
488
+ readonly properties: {
489
+ readonly meta: {
490
+ readonly $ref: "#/components/schemas/AgentMeta";
491
+ };
492
+ readonly wallet: {
493
+ readonly type: "string";
494
+ };
495
+ readonly count: {
496
+ readonly type: "integer";
497
+ };
498
+ readonly summary: {
499
+ readonly $ref: "#/components/schemas/AgentPositionsSummary";
500
+ };
501
+ readonly positions: {
502
+ readonly type: "array";
503
+ readonly items: {
504
+ readonly $ref: "#/components/schemas/AgentPosition";
505
+ };
506
+ };
507
+ };
508
+ readonly required: readonly ["meta", "wallet", "count", "summary", "positions"];
509
+ };
510
+ };
511
+ };
512
+ };
513
+ readonly "404": {
514
+ readonly description: "Not found — an unknown id/slug, or the agent platform flag is off (the entire /api/agent/v1 surface returns 404 while dark).";
515
+ readonly content: {
516
+ readonly "application/json": {
517
+ readonly schema: {
518
+ readonly $ref: "#/components/schemas/AgentError";
519
+ };
520
+ };
521
+ };
522
+ };
523
+ readonly "422": {
524
+ readonly description: "invalid_wallet — not a 0x + 40-hex Base address.";
525
+ readonly content: {
526
+ readonly "application/json": {
527
+ readonly schema: {
528
+ readonly $ref: "#/components/schemas/AgentError";
529
+ };
530
+ };
531
+ };
532
+ };
533
+ };
534
+ };
535
+ };
536
+ readonly "/api/agent/v1/result": {
537
+ readonly get: {
538
+ readonly operationId: "getResult";
539
+ readonly summary: "A market's resolution status, winning outcome, and payout-per-share.";
540
+ readonly description: "A market's resolution status, winning outcome, and payout-per-share.";
541
+ readonly tags: readonly ["positions"];
542
+ readonly "x-hunch-status": "live";
543
+ readonly parameters: readonly [{
544
+ readonly name: "marketId";
545
+ readonly in: "query";
546
+ readonly required: true;
547
+ readonly description: "Market id or slug — resolved against the FULL catalogue (anything the agent may hold).";
548
+ readonly schema: {
549
+ readonly type: "string";
550
+ };
551
+ }];
552
+ readonly responses: {
553
+ readonly "200": {
554
+ readonly description: "The resolution view. An unresolved market returns status \"pending\" with null outcome fields.";
555
+ readonly content: {
556
+ readonly "application/json": {
557
+ readonly schema: {
558
+ readonly type: "object";
559
+ readonly properties: {
560
+ readonly meta: {
561
+ readonly $ref: "#/components/schemas/AgentMeta";
562
+ };
563
+ readonly result: {
564
+ readonly $ref: "#/components/schemas/AgentResult";
565
+ };
566
+ };
567
+ readonly required: readonly ["meta", "result"];
568
+ };
569
+ };
570
+ };
571
+ };
572
+ readonly "400": {
573
+ readonly description: "invalid_request — marketId is required.";
574
+ readonly content: {
575
+ readonly "application/json": {
576
+ readonly schema: {
577
+ readonly $ref: "#/components/schemas/AgentError";
578
+ };
579
+ };
580
+ };
581
+ };
582
+ readonly "404": {
583
+ readonly description: "Not found — an unknown id/slug, or the agent platform flag is off (the entire /api/agent/v1 surface returns 404 while dark).";
584
+ readonly content: {
585
+ readonly "application/json": {
586
+ readonly schema: {
587
+ readonly $ref: "#/components/schemas/AgentError";
588
+ };
589
+ };
590
+ };
591
+ };
592
+ };
593
+ };
594
+ };
595
+ readonly "/api/agent/v1/wallet/{address}/readiness": {
596
+ readonly get: {
597
+ readonly operationId: "checkWallet";
598
+ readonly summary: "Wallet readiness: Base USDC balance, min-bet coverage, funding guidance (gas never needed).";
599
+ readonly description: "Wallet readiness: Base USDC balance, min-bet coverage, funding guidance (gas never needed).";
600
+ readonly tags: readonly ["platform"];
601
+ readonly "x-hunch-status": "live";
602
+ readonly parameters: readonly [{
603
+ readonly name: "address";
604
+ readonly in: "path";
605
+ readonly required: true;
606
+ readonly description: "Base wallet address (0x + 40 hex).";
607
+ readonly schema: {
608
+ readonly type: "string";
609
+ readonly pattern: "^0x[0-9a-fA-F]{40}$";
610
+ };
611
+ }];
612
+ readonly responses: {
613
+ readonly "200": {
614
+ readonly description: "Funding readiness: Base USDC balance, min-bet coverage, funding guidance. Gas is NEVER needed — transfers are relayed; the wallet only holds USDC.";
615
+ readonly content: {
616
+ readonly "application/json": {
617
+ readonly schema: {
618
+ readonly type: "object";
619
+ readonly properties: {
620
+ readonly meta: {
621
+ readonly $ref: "#/components/schemas/AgentMeta";
622
+ };
623
+ readonly readiness: {
624
+ readonly $ref: "#/components/schemas/AgentReadiness";
625
+ };
626
+ };
627
+ readonly required: readonly ["meta", "readiness"];
628
+ };
629
+ };
630
+ };
631
+ };
632
+ readonly "404": {
633
+ readonly description: "Not found — an unknown id/slug, or the agent platform flag is off (the entire /api/agent/v1 surface returns 404 while dark).";
634
+ readonly content: {
635
+ readonly "application/json": {
636
+ readonly schema: {
637
+ readonly $ref: "#/components/schemas/AgentError";
638
+ };
639
+ };
640
+ };
641
+ };
642
+ readonly "422": {
643
+ readonly description: "invalid_wallet — not a 0x + 40-hex Base address.";
644
+ readonly content: {
645
+ readonly "application/json": {
646
+ readonly schema: {
647
+ readonly $ref: "#/components/schemas/AgentError";
648
+ };
649
+ };
650
+ };
651
+ };
652
+ };
653
+ };
654
+ };
655
+ readonly "/api/agent/v1/stats": {
656
+ readonly get: {
657
+ readonly operationId: "getStats";
658
+ readonly summary: "Platform trust stats: markets, volume, payouts, auto-payout rate, proof samples.";
659
+ readonly description: "Platform trust stats: markets, volume, payouts, auto-payout rate, proof samples.";
660
+ readonly tags: readonly ["platform"];
661
+ readonly "x-hunch-status": "live";
662
+ readonly responses: {
663
+ readonly "200": {
664
+ readonly description: "Platform trust stats (cached ~60s): markets, lifetime bets + volume, paid-out USD, auto-payout rate, on-chain proof samples.";
665
+ readonly content: {
666
+ readonly "application/json": {
667
+ readonly schema: {
668
+ readonly type: "object";
669
+ readonly properties: {
670
+ readonly meta: {
671
+ readonly $ref: "#/components/schemas/AgentMeta";
672
+ };
673
+ readonly stats: {
674
+ readonly $ref: "#/components/schemas/AgentStats";
675
+ };
676
+ };
677
+ readonly required: readonly ["meta", "stats"];
678
+ };
679
+ };
680
+ };
681
+ };
682
+ readonly "404": {
683
+ readonly description: "Not found — an unknown id/slug, or the agent platform flag is off (the entire /api/agent/v1 surface returns 404 while dark).";
684
+ readonly content: {
685
+ readonly "application/json": {
686
+ readonly schema: {
687
+ readonly $ref: "#/components/schemas/AgentError";
688
+ };
689
+ };
690
+ };
691
+ };
692
+ };
693
+ };
694
+ };
695
+ readonly "/api/agent/v1/health": {
696
+ readonly get: {
697
+ readonly operationId: "getHealth";
698
+ readonly summary: "Liveness + trading status. 200 even when degraded; ok:false means paused.";
699
+ readonly description: "Liveness + trading status. Deliberately HTTP 200 even when degraded — branch on the BODY's health.ok (false = trading paused), never on the status code.";
700
+ readonly tags: readonly ["platform"];
701
+ readonly "x-hunch-status": "live";
702
+ readonly responses: {
703
+ readonly "200": {
704
+ readonly description: "Always 200 while the platform flag is on; health.ok carries the signal.";
705
+ readonly content: {
706
+ readonly "application/json": {
707
+ readonly schema: {
708
+ readonly type: "object";
709
+ readonly properties: {
710
+ readonly meta: {
711
+ readonly $ref: "#/components/schemas/AgentMeta";
712
+ };
713
+ readonly health: {
714
+ readonly $ref: "#/components/schemas/AgentHealth";
715
+ };
716
+ };
717
+ readonly required: readonly ["meta", "health"];
718
+ };
719
+ };
720
+ };
721
+ };
722
+ readonly "404": {
723
+ readonly description: "Not found — an unknown id/slug, or the agent platform flag is off (the entire /api/agent/v1 surface returns 404 while dark).";
724
+ readonly content: {
725
+ readonly "application/json": {
726
+ readonly schema: {
727
+ readonly $ref: "#/components/schemas/AgentError";
728
+ };
729
+ };
730
+ };
731
+ };
732
+ };
733
+ };
734
+ };
735
+ };
736
+ };