@wahoopredict/trading-sdk 0.2.0 → 0.4.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.
@@ -10,7 +10,7 @@
10
10
  */ /** @description Player’s balance after the order is placed */ /** @description Order cancelled successfully */ /**
11
11
  * @description Operation status
12
12
  * @enum {string}
13
- */ /** @description Order is not found or already cancelled */ /** @description Collect win or loss when event is resolved */ /** @description Position collected successfully */ /** @enum {string} */ /** @description Position is not found or not collectable yet */ /** @description Get list of user's orders */ /** @description OK */ /**
13
+ */ /** @description Order is not found or already cancelled */ /** @description Collect win or loss when event is resolved */ /** @description Position collected successfully */ /** @enum {string} */ /** @description Position is not found or not collectable yet */ /** @description Get list of user's orders */ /** @description If true, include orders on SPECIAL events. */ /** @description OK */ /**
14
14
  * @example {
15
15
  * "data": [
16
16
  * {
@@ -41,7 +41,11 @@
41
41
  * "hasPreviousPage": false,
42
42
  * "totalItems": 1
43
43
  * }
44
- */ /** @description Get list of user's positions */ /** @description OK */ /**
44
+ */ /** @description Get list of user's positions */ /**
45
+ * @description Filter by position type. OPEN = active, CLOSED = settled/collected.
46
+ * @default OPEN
47
+ * @enum {string}
48
+ */ /** @description If true, include positions on SPECIAL events. */ /** @description OK */ /**
45
49
  * @example {
46
50
  * "data": [
47
51
  * {
@@ -96,13 +100,13 @@
96
100
  */ /** @description A history of prices/probabilities. */ /**
97
101
  * Format: double
98
102
  * @description The total volume traded for this option.
99
- */ /** Format: double */ /** Format: integer */ /** Format: double */ /** Format: double */ /** Format: double */ /** Format: date-time */ /** Format: date-time */ /** Format: integer */ /** @description The unique ID of the event. */ /** @enum {string} */ /** Format: date-time */ /** Format: date-time */ /** Format: date-time */ /** Format: date-time */ /** Format: integer */ /** @enum {string|null} */ /** @description Details on the best available offer/option. */ /**
103
+ */ /** Format: double */ /** Format: integer */ /** @description User's positions on this option. Populated by event-details endpoint when authenticated. */ /** @description Open order stubs (id only). Populated by events-list endpoint. */ /** Format: double */ /** Format: double */ /** Format: double */ /** Format: date-time */ /** Format: date-time */ /** Format: integer */ /** @description The unique ID of the event. */ /** @enum {string} */ /** Format: date-time */ /** Format: date-time */ /** Format: date-time */ /** Format: date-time */ /** Format: integer */ /** @description Array of user IDs who favorited this event. */ /** @enum {string|null} */ /** @description Details on the best available offer/option. */ /**
100
104
  * @description The price of the order (as a string to handle high precision).
101
105
  * @example 0.100
102
106
  */ /**
103
107
  * @description The size/amount of the order (as a string to handle high precision).
104
108
  * @example 1.00
105
- */ /** @description A list of buy orders, typically sorted by price descending. */ /** @description A list of sell orders, typically sorted by price ascending. */ /** @enum {string} */ /** @enum {string} */ /** @enum {string} */ /** @enum {string} */ /** @enum {string} */ /**
109
+ */ /** @description A list of buy orders, typically sorted by price descending. */ /** @description A list of sell orders, typically sorted by price ascending. */ /** @description Average fill price as a decimal string. */ /** @enum {string} */ /** @enum {string} */ /** @enum {string} */ /** @enum {string} */ /** @enum {string} */ /**
106
110
  * @example {
107
111
  * "eventId": "cma1kj99c0050nq01v9zaypq5",
108
112
  * "outcomeOptionId": "cma1kkyus0055nq01u3xs12n0",
@@ -117,7 +121,7 @@
117
121
  */ /** @description Amount in dollars. Required for MARKET BUY order */ /** @description Size in parts. Required for all types except MARKET BUY */ /** @description Price of part in dollars. Required for LIMIT orders */ /**
118
122
  * @description Type of the order
119
123
  * @enum {string}
120
- */ /**
124
+ */ /** @description Optional expiration timestamp for the order. */ /**
121
125
  * @description error or success
122
126
  * @enum {string}
123
127
  */ /** @description Type of the error */ /** @description Human-readable description of the error */ /** @description Optional details about the error */ /** @description Authentication required or invalid token. */ export { }; /**
@@ -0,0 +1,1245 @@
1
+ /**
2
+ * This file was auto-generated by openapi-typescript.
3
+ * Do not make direct changes to the file.
4
+ */
5
+
6
+ export interface paths {
7
+ "/event/events-list": {
8
+ parameters: {
9
+ query?: never;
10
+ header?: never;
11
+ path?: never;
12
+ cookie?: never;
13
+ };
14
+ get?: never;
15
+ put?: never;
16
+ /** Get a list of events */
17
+ post: operations["getEventsList"];
18
+ delete?: never;
19
+ options?: never;
20
+ head?: never;
21
+ patch?: never;
22
+ trace?: never;
23
+ };
24
+ "/event/event-details/{eventId}": {
25
+ parameters: {
26
+ query?: never;
27
+ header?: never;
28
+ path?: never;
29
+ cookie?: never;
30
+ };
31
+ /** Get detailed information for a specific event */
32
+ get: operations["getEventDetails"];
33
+ put?: never;
34
+ post?: never;
35
+ delete?: never;
36
+ options?: never;
37
+ head?: never;
38
+ patch?: never;
39
+ trace?: never;
40
+ };
41
+ "/event/orderbook": {
42
+ parameters: {
43
+ query?: never;
44
+ header?: never;
45
+ path?: never;
46
+ cookie?: never;
47
+ };
48
+ /** Retrieve the order book for a specific outcome option. */
49
+ get: operations["getOrderbook"];
50
+ put?: never;
51
+ post?: never;
52
+ delete?: never;
53
+ options?: never;
54
+ head?: never;
55
+ patch?: never;
56
+ trace?: never;
57
+ };
58
+ "/event/test-order": {
59
+ parameters: {
60
+ query?: never;
61
+ header?: never;
62
+ path?: never;
63
+ cookie?: never;
64
+ };
65
+ get?: never;
66
+ put?: never;
67
+ /** @description Get estimation of the order */
68
+ post: {
69
+ parameters: {
70
+ query?: never;
71
+ header?: never;
72
+ path?: never;
73
+ cookie?: never;
74
+ };
75
+ requestBody: {
76
+ content: {
77
+ "application/json": components["schemas"]["placeOrderRequestBody"];
78
+ };
79
+ };
80
+ responses: {
81
+ /** @description Order tested successfully */
82
+ 200: {
83
+ headers: {
84
+ [name: string]: unknown;
85
+ };
86
+ content: {
87
+ "application/json": {
88
+ /**
89
+ * @description Operation status
90
+ * @enum {string}
91
+ */
92
+ result: "success";
93
+ /** @description Player’s estimated win after the order is placed */
94
+ potentialReturn: string;
95
+ };
96
+ };
97
+ };
98
+ 400: {
99
+ headers: {
100
+ [name: string]: unknown;
101
+ };
102
+ content: {
103
+ "application/json": components["schemas"]["ApiError"];
104
+ };
105
+ };
106
+ 403: {
107
+ headers: {
108
+ [name: string]: unknown;
109
+ };
110
+ content: {
111
+ "application/json": components["schemas"]["ApiError"];
112
+ };
113
+ };
114
+ };
115
+ };
116
+ delete?: never;
117
+ options?: never;
118
+ head?: never;
119
+ patch?: never;
120
+ trace?: never;
121
+ };
122
+ "/event/place-order": {
123
+ parameters: {
124
+ query?: never;
125
+ header?: never;
126
+ path?: never;
127
+ cookie?: never;
128
+ };
129
+ get?: never;
130
+ put?: never;
131
+ /** @description Create an order on an outcome option */
132
+ post: {
133
+ parameters: {
134
+ query?: never;
135
+ header?: never;
136
+ path?: never;
137
+ cookie?: never;
138
+ };
139
+ requestBody: {
140
+ content: {
141
+ "application/json": components["schemas"]["placeOrderRequestBody"];
142
+ };
143
+ };
144
+ responses: {
145
+ /** @description Order created successfully */
146
+ 200: {
147
+ headers: {
148
+ [name: string]: unknown;
149
+ };
150
+ content: {
151
+ "application/json": {
152
+ /**
153
+ * @description Operation status
154
+ * @enum {string}
155
+ */
156
+ result: "success";
157
+ /** @description Player’s balance after the order is placed */
158
+ newBalance: string;
159
+ };
160
+ };
161
+ };
162
+ 400: {
163
+ headers: {
164
+ [name: string]: unknown;
165
+ };
166
+ content: {
167
+ "application/json": components["schemas"]["ApiError"];
168
+ };
169
+ };
170
+ 403: {
171
+ headers: {
172
+ [name: string]: unknown;
173
+ };
174
+ content: {
175
+ "application/json": components["schemas"]["ApiError"];
176
+ };
177
+ };
178
+ };
179
+ };
180
+ delete?: never;
181
+ options?: never;
182
+ head?: never;
183
+ patch?: never;
184
+ trace?: never;
185
+ };
186
+ "/event/cancel-order": {
187
+ parameters: {
188
+ query?: never;
189
+ header?: never;
190
+ path?: never;
191
+ cookie?: never;
192
+ };
193
+ get?: never;
194
+ put?: never;
195
+ post?: never;
196
+ delete: {
197
+ parameters: {
198
+ query: {
199
+ orderId: string;
200
+ };
201
+ header?: never;
202
+ path?: never;
203
+ cookie?: never;
204
+ };
205
+ requestBody?: never;
206
+ responses: {
207
+ /** @description Order cancelled successfully */
208
+ 200: {
209
+ headers: {
210
+ [name: string]: unknown;
211
+ };
212
+ content: {
213
+ "application/json": {
214
+ /**
215
+ * @description Operation status
216
+ * @enum {string}
217
+ */
218
+ result: "success";
219
+ newBalance?: number;
220
+ };
221
+ };
222
+ };
223
+ /** @description Order is not found or already cancelled */
224
+ 404: {
225
+ headers: {
226
+ [name: string]: unknown;
227
+ };
228
+ content: {
229
+ "application/json": components["schemas"]["ApiError"];
230
+ };
231
+ };
232
+ };
233
+ };
234
+ options?: never;
235
+ head?: never;
236
+ patch?: never;
237
+ trace?: never;
238
+ };
239
+ "/event/collect-position": {
240
+ parameters: {
241
+ query?: never;
242
+ header?: never;
243
+ path?: never;
244
+ cookie?: never;
245
+ };
246
+ get?: never;
247
+ put?: never;
248
+ /** @description Collect win or loss when event is resolved */
249
+ post: {
250
+ parameters: {
251
+ query?: never;
252
+ header?: never;
253
+ path?: never;
254
+ cookie?: never;
255
+ };
256
+ requestBody: {
257
+ content: {
258
+ "application/json": {
259
+ positionId: string;
260
+ };
261
+ };
262
+ };
263
+ responses: {
264
+ /** @description Position collected successfully */
265
+ 200: {
266
+ headers: {
267
+ [name: string]: unknown;
268
+ };
269
+ content: {
270
+ "application/json": {
271
+ /** @enum {string} */
272
+ result: "success";
273
+ newBalance: number;
274
+ };
275
+ };
276
+ };
277
+ /** @description Position is not found or not collectable yet */
278
+ 404: {
279
+ headers: {
280
+ [name: string]: unknown;
281
+ };
282
+ content: {
283
+ "application/json": components["schemas"]["ApiError"];
284
+ };
285
+ };
286
+ };
287
+ };
288
+ delete?: never;
289
+ options?: never;
290
+ head?: never;
291
+ patch?: never;
292
+ trace?: never;
293
+ };
294
+ "/event/orders": {
295
+ parameters: {
296
+ query?: never;
297
+ header?: never;
298
+ path?: never;
299
+ cookie?: never;
300
+ };
301
+ get?: never;
302
+ put?: never;
303
+ /** @description Get list of user's orders */
304
+ post: {
305
+ parameters: {
306
+ query?: never;
307
+ header?: never;
308
+ path?: never;
309
+ cookie?: never;
310
+ };
311
+ requestBody: {
312
+ content: {
313
+ "application/json": {
314
+ page?: number;
315
+ limit?: number;
316
+ filter?: {
317
+ isOpen?: boolean;
318
+ search?: string;
319
+ userId?: string;
320
+ /** @description If true, include orders on SPECIAL events. */
321
+ includeSpecial?: boolean;
322
+ };
323
+ };
324
+ };
325
+ };
326
+ responses: {
327
+ /** @description OK */
328
+ 200: {
329
+ headers: {
330
+ [name: string]: unknown;
331
+ };
332
+ content: {
333
+ /**
334
+ * @example {
335
+ * "data": [
336
+ * {
337
+ * "id": "cmbt9kftk0001lf01fg093ut3",
338
+ * "userId": "6751d122e7ac1b342423b97f",
339
+ * "outcomeOptionId": "cma1kkyus0055nq01u3xs12n0",
340
+ * "size": "5.00",
341
+ * "price": "0.500",
342
+ * "filled": "0.00",
343
+ * "side": "BUY",
344
+ * "type": "LIMIT",
345
+ * "status": "OPEN",
346
+ * "createdAt": "2025-06-12T10:56:45.081Z",
347
+ * "outcomeOption": {
348
+ * "option": "Yes",
349
+ * "outcome": {
350
+ * "description": "Will Ivanka, Gisele, or Karlie Post a Group Selfie on Instagram?",
351
+ * "imageUrl": "https://wahoo-events.s3.us-east-1.amazonaws.com/j1fL5hwGMZfz_oGf8ug81",
352
+ * "event": {
353
+ * "id": "cmbt9kftk0001lf01fg093ut3"
354
+ * }
355
+ * }
356
+ * }
357
+ * }
358
+ * ],
359
+ * "totalPages": 1,
360
+ * "hasNextPage": false,
361
+ * "hasPreviousPage": false,
362
+ * "totalItems": 1
363
+ * }
364
+ */
365
+ "application/json": {
366
+ totalPages: number;
367
+ hasNextPage: boolean;
368
+ hasPreviousPage: boolean;
369
+ totalItems: number;
370
+ data: components["schemas"]["Order"][];
371
+ };
372
+ };
373
+ };
374
+ };
375
+ };
376
+ delete?: never;
377
+ options?: never;
378
+ head?: never;
379
+ patch?: never;
380
+ trace?: never;
381
+ };
382
+ "/event/positions": {
383
+ parameters: {
384
+ query?: never;
385
+ header?: never;
386
+ path?: never;
387
+ cookie?: never;
388
+ };
389
+ get?: never;
390
+ put?: never;
391
+ /** @description Get list of user's positions */
392
+ post: {
393
+ parameters: {
394
+ query?: never;
395
+ header?: never;
396
+ path?: never;
397
+ cookie?: never;
398
+ };
399
+ requestBody: {
400
+ content: {
401
+ "application/json": {
402
+ page?: number;
403
+ limit?: number;
404
+ filter?: {
405
+ search?: string;
406
+ userId?: string;
407
+ /**
408
+ * @description Filter by position type. OPEN = active, CLOSED = settled/collected.
409
+ * @default OPEN
410
+ * @enum {string}
411
+ */
412
+ type?: "OPEN" | "CLOSED";
413
+ /** @description If true, include positions on SPECIAL events. */
414
+ includeSpecial?: boolean;
415
+ };
416
+ };
417
+ };
418
+ };
419
+ responses: {
420
+ /** @description OK */
421
+ 200: {
422
+ headers: {
423
+ [name: string]: unknown;
424
+ };
425
+ content: {
426
+ /**
427
+ * @example {
428
+ * "data": [
429
+ * {
430
+ * "id": "cmbtcquc0000ppf01l9bx03tc",
431
+ * "userId": "6751d122e7ac1b342423b97f",
432
+ * "outcomeOptionId": "cma1kkyus0055nq01u3xs12n0",
433
+ * "avgPrice": "0.500",
434
+ * "part": "5.00",
435
+ * "createdAt": "2025-06-12T10:56:45.081Z",
436
+ * "outcomeOption": {
437
+ * "option": "Yes",
438
+ * "probability": 0.6,
439
+ * "outcome": {
440
+ * "description": "Will Ivanka, Gisele, or Karlie Post a Group Selfie on Instagram?",
441
+ * "imageUrl": "https://wahoo-events.s3.us-east-1.amazonaws.com/j1fL5hwGMZfz_oGf8ug81",
442
+ * "event": {
443
+ * "id": "cmbt9kftk0001lf01fg093ut3"
444
+ * }
445
+ * }
446
+ * }
447
+ * }
448
+ * ],
449
+ * "totalPages": 1,
450
+ * "hasNextPage": false,
451
+ * "hasPreviousPage": false,
452
+ * "totalItems": 1
453
+ * }
454
+ */
455
+ "application/json": {
456
+ totalPages: number;
457
+ hasNextPage: boolean;
458
+ hasPreviousPage: boolean;
459
+ totalItems: number;
460
+ data: components["schemas"]["Position"][];
461
+ };
462
+ };
463
+ };
464
+ };
465
+ };
466
+ delete?: never;
467
+ options?: never;
468
+ head?: never;
469
+ patch?: never;
470
+ trace?: never;
471
+ };
472
+ "/user/profile": {
473
+ parameters: {
474
+ query?: never;
475
+ header?: never;
476
+ path?: never;
477
+ cookie?: never;
478
+ };
479
+ /** @description Get user profile */
480
+ get: {
481
+ parameters: {
482
+ query?: {
483
+ /**
484
+ * @description Comma-separated list of fields to include in the response.
485
+ * If omitted, a default set of public fields will be returned (e.g., id, username, email).
486
+ */
487
+ fields?: ("id" | "username" | "role" | "firstName" | "lastName" | "email" | "photo" | "phone" | "verifications" | "permissions" | "transactionsLimit" | "hasPassword" | "OTPEnabled" | "balance" | "bonusBalance" | "totalBalance" | "unsubscribed_mails" | "payId" | "referralProfit")[];
488
+ };
489
+ header?: never;
490
+ path?: never;
491
+ cookie?: never;
492
+ };
493
+ requestBody?: never;
494
+ responses: {
495
+ /** @description User data successfully retrieved. */
496
+ 200: {
497
+ headers: {
498
+ [name: string]: unknown;
499
+ };
500
+ content: {
501
+ "application/json": {
502
+ user?: {
503
+ /** @description Unique identifier for the user. */
504
+ id?: number;
505
+ /** @description User's chosen username. */
506
+ username?: string;
507
+ /** @enum {string} */
508
+ role?: "admin" | "user" | "manager";
509
+ firstName?: string;
510
+ lastName?: string;
511
+ /** Format: email */
512
+ email?: string;
513
+ /**
514
+ * Format: uri
515
+ * @description URL to the user's profile picture.
516
+ */
517
+ photo?: string;
518
+ phone?: string;
519
+ verifications?: Record<string, never>;
520
+ permissions?: Record<string, never>;
521
+ transactionsLimit?: number;
522
+ /** @description Indicates if the user has a password set. */
523
+ hasPassword?: boolean;
524
+ /** @description Indicates if two-factor authentication is enabled. */
525
+ OTPEnabled?: boolean;
526
+ /**
527
+ * Format: float
528
+ * @description Current account balance.
529
+ */
530
+ balance?: number;
531
+ /**
532
+ * Format: float
533
+ * @description Current bonus balance.
534
+ */
535
+ bonusBalance?: number;
536
+ /**
537
+ * Format: float
538
+ * @description Sum of balance and bonusBalance.
539
+ */
540
+ totalBalance?: number;
541
+ /** @description Array indicating if the user is unsubscribed from marketing emails. */
542
+ unsubscribed_mails?: unknown[];
543
+ /** @description Unique payment identifier. */
544
+ payId?: string;
545
+ /**
546
+ * Format: float
547
+ * @description Total profit earned from referrals.
548
+ */
549
+ referralProfit?: number;
550
+ };
551
+ };
552
+ };
553
+ };
554
+ };
555
+ };
556
+ put?: never;
557
+ post?: never;
558
+ delete?: never;
559
+ options?: never;
560
+ head?: never;
561
+ patch?: never;
562
+ trace?: never;
563
+ };
564
+ }
565
+ export type webhooks = Record<string, never>;
566
+ export interface components {
567
+ schemas: {
568
+ /**
569
+ * @description The status of the event.
570
+ * @enum {string}
571
+ */
572
+ EventStatus: "LIVE" | "PENDING" | "RESOLVED" | "ARCHIVED";
573
+ OutcomeOption: {
574
+ /** @description The unique ID of the outcome option. */
575
+ id: string;
576
+ /** @description The ID of the parent outcome. */
577
+ outcomeId: string;
578
+ /** @description The name of the option (e.g., "Yes", "No"). */
579
+ option: string;
580
+ /**
581
+ * Format: double
582
+ * @description The current probability/price of the option.
583
+ */
584
+ probability: number;
585
+ /** @description A history of prices/probabilities. */
586
+ pricesHistory?: number[];
587
+ /**
588
+ * Format: double
589
+ * @description The total volume traded for this option.
590
+ */
591
+ totalVolume: number;
592
+ slug: string;
593
+ /** Format: double */
594
+ totalPart: number;
595
+ /** Format: integer */
596
+ order: number;
597
+ marketId: string;
598
+ liquidityStatus: string;
599
+ /** @description User's positions on this option. Populated by event-details endpoint when authenticated. */
600
+ position?: components["schemas"]["Position"][];
601
+ /** @description Open order stubs (id only). Populated by events-list endpoint. */
602
+ orders?: {
603
+ id?: string;
604
+ }[];
605
+ /** Format: double */
606
+ buyPrice: number;
607
+ /** Format: double */
608
+ sellPrice: number;
609
+ /** Format: double */
610
+ potentialWin: number;
611
+ };
612
+ Outcome: {
613
+ id: string;
614
+ title: string;
615
+ description: string;
616
+ resolution: string;
617
+ rules: string;
618
+ slug: string;
619
+ eventId: string;
620
+ /** Format: date-time */
621
+ estimatedEnd?: string | null;
622
+ /** Format: date-time */
623
+ endDate?: string | null;
624
+ imageUrl?: string | null;
625
+ /** Format: integer */
626
+ volume: number;
627
+ status: components["schemas"]["EventStatus"];
628
+ externalId?: string | null;
629
+ OutcomeOption: components["schemas"]["OutcomeOption"][];
630
+ };
631
+ Event: {
632
+ /** @description The unique ID of the event. */
633
+ id: string;
634
+ title: string;
635
+ description: string;
636
+ metaDescription?: string;
637
+ newsSource?: string | null;
638
+ slug: string;
639
+ imageUrl: string;
640
+ status: components["schemas"]["EventStatus"];
641
+ /** @enum {string} */
642
+ type: "COLLECTION" | "COMPETITIVE";
643
+ /** Format: date-time */
644
+ estimatedEnd?: string | null;
645
+ /** Format: date-time */
646
+ endDate?: string | null;
647
+ /** Format: date-time */
648
+ updatedAt: string;
649
+ /** Format: date-time */
650
+ createdAt: string;
651
+ /** Format: integer */
652
+ volume: number;
653
+ externalId?: string | null;
654
+ /** @description Array of user IDs who favorited this event. */
655
+ favorites?: string[];
656
+ /** @enum {string|null} */
657
+ feature?: "TRENDING" | "FEATURED" | "FAST_MARKET" | null;
658
+ outcomes: components["schemas"]["Outcome"][];
659
+ tags?: components["schemas"]["Tag"][];
660
+ /** @description Details on the best available offer/option. */
661
+ bestOffer?: {
662
+ outcomeId: string;
663
+ optionId: string;
664
+ } | null;
665
+ };
666
+ OrderbookEntry: {
667
+ /**
668
+ * @description The price of the order (as a string to handle high precision).
669
+ * @example 0.100
670
+ */
671
+ price: string;
672
+ /**
673
+ * @description The size/amount of the order (as a string to handle high precision).
674
+ * @example 1.00
675
+ */
676
+ size: string;
677
+ };
678
+ Orderbook: {
679
+ /** @description A list of buy orders, typically sorted by price descending. */
680
+ bids: components["schemas"]["OrderbookEntry"][];
681
+ /** @description A list of sell orders, typically sorted by price ascending. */
682
+ asks: components["schemas"]["OrderbookEntry"][];
683
+ };
684
+ Tag: {
685
+ label: string;
686
+ slug: string;
687
+ };
688
+ Position: {
689
+ id: string;
690
+ userId: string;
691
+ outcomeOptionId: string;
692
+ avgPrice: string;
693
+ part: string;
694
+ createdAt: string;
695
+ outcomeOption?: {
696
+ option?: string;
697
+ probability?: number;
698
+ outcome?: {
699
+ title?: string;
700
+ description?: string;
701
+ status?: components["schemas"]["EventStatus"];
702
+ imageUrl?: string;
703
+ event?: {
704
+ id?: string;
705
+ imageUrl?: string;
706
+ };
707
+ };
708
+ };
709
+ };
710
+ Order: {
711
+ id: string;
712
+ userId: string;
713
+ outcomeOptionId: string;
714
+ size: string;
715
+ price: string;
716
+ filled: string;
717
+ /** @description Average fill price as a decimal string. */
718
+ avgPrice: string;
719
+ /** @enum {string} */
720
+ side: "BUY" | "SELL";
721
+ /** @enum {string} */
722
+ type: "MARKET" | "LIMIT";
723
+ /** @enum {string} */
724
+ status: "OPEN" | "PART_FILLED" | "FULFILLED" | "CANCELED";
725
+ createdAt: string;
726
+ outcomeOption?: {
727
+ option?: string;
728
+ outcome?: {
729
+ title?: string;
730
+ description?: string;
731
+ imageUrl?: string;
732
+ event?: {
733
+ id?: string;
734
+ imageUrl?: string;
735
+ };
736
+ };
737
+ };
738
+ };
739
+ Trade: {
740
+ id?: string;
741
+ size?: string;
742
+ price?: string;
743
+ createdAt?: string;
744
+ takerOrderId?: string;
745
+ makerOrderId?: string;
746
+ takerFee?: string;
747
+ makerFee?: string;
748
+ makerOrder?: {
749
+ userId?: string;
750
+ /** @enum {string} */
751
+ side?: "BUY" | "SELL";
752
+ };
753
+ takerOrder?: {
754
+ userId?: string;
755
+ /** @enum {string} */
756
+ side?: "BUY" | "SELL";
757
+ };
758
+ };
759
+ /**
760
+ * @example {
761
+ * "eventId": "cma1kj99c0050nq01v9zaypq5",
762
+ * "outcomeOptionId": "cma1kkyus0055nq01u3xs12n0",
763
+ * "side": "BUY",
764
+ * "size": "5",
765
+ * "price": "0.5",
766
+ * "type": "LIMIT"
767
+ * }
768
+ */
769
+ placeOrderRequestBody: {
770
+ /** @description ID of the event the order is placed on */
771
+ eventId: string;
772
+ /** @description ID of the specific outcome option */
773
+ outcomeOptionId: string;
774
+ /**
775
+ * @description Side of the order
776
+ * @enum {string}
777
+ */
778
+ side: "BUY" | "SELL";
779
+ /** @description Amount in dollars. Required for MARKET BUY order */
780
+ amount?: string;
781
+ /** @description Size in parts. Required for all types except MARKET BUY */
782
+ size?: string;
783
+ /** @description Price of part in dollars. Required for LIMIT orders */
784
+ price?: string;
785
+ /**
786
+ * @description Type of the order
787
+ * @enum {string}
788
+ */
789
+ type: "LIMIT" | "MARKET";
790
+ /** @description Optional expiration timestamp for the order. */
791
+ expiration?: number;
792
+ };
793
+ ApiError: {
794
+ /**
795
+ * @description error or success
796
+ * @enum {string}
797
+ */
798
+ result: "error" | "success";
799
+ /** @description Type of the error */
800
+ error: string;
801
+ /** @description Human-readable description of the error */
802
+ message: string;
803
+ /** @description Optional details about the error */
804
+ details?: {
805
+ record?: string;
806
+ field?: string;
807
+ };
808
+ };
809
+ };
810
+ responses: {
811
+ /** @description Authentication required or invalid token. */
812
+ UnauthorizedError: {
813
+ headers: {
814
+ [name: string]: unknown;
815
+ };
816
+ content: {
817
+ "application/json": components["schemas"]["ApiError"];
818
+ };
819
+ };
820
+ };
821
+ parameters: never;
822
+ requestBodies: never;
823
+ headers: never;
824
+ pathItems: never;
825
+ }
826
+ export type $defs = Record<string, never>;
827
+ export interface operations {
828
+ getEventsList: {
829
+ parameters: {
830
+ query?: never;
831
+ header?: never;
832
+ path?: never;
833
+ cookie?: never;
834
+ };
835
+ requestBody: {
836
+ content: {
837
+ "application/json": {
838
+ /**
839
+ * Format: integer
840
+ * @description The page number for pagination.
841
+ * @default 1
842
+ */
843
+ page: number;
844
+ /**
845
+ * Format: integer
846
+ * @description The number of items per page.
847
+ * @default 20
848
+ */
849
+ limit: number;
850
+ /** @description Sorting criteria for the list. */
851
+ sort?: {
852
+ /**
853
+ * @default estimatedEnd
854
+ * @enum {string}
855
+ */
856
+ sortBy?: "id" | "title" | "status" | "estimatedEnd" | "endDate" | "createdAt" | "volume" | "priceUpdate" | "feature";
857
+ /**
858
+ * @default desc
859
+ * @enum {string}
860
+ */
861
+ sortOrder?: "desc" | "asc";
862
+ } | null;
863
+ /**
864
+ * @description Filtering criteria for the list.
865
+ * @default {
866
+ * "status": [
867
+ * "LIVE",
868
+ * "PENDING"
869
+ * ]
870
+ * }
871
+ */
872
+ filter: {
873
+ /** @description Filter by one or more event statuses. */
874
+ status?: components["schemas"]["EventStatus"][];
875
+ /** @description A search string to filter events by title/description. The `transform` logic is not directly expressible in OpenAPI but is noted here. */
876
+ search?: string | null;
877
+ /** @description Filter by one or more tags. */
878
+ tags?: string[] | null;
879
+ };
880
+ };
881
+ };
882
+ };
883
+ responses: {
884
+ /** @description A paginated list of events */
885
+ 200: {
886
+ headers: {
887
+ [name: string]: unknown;
888
+ };
889
+ content: {
890
+ /**
891
+ * @example {
892
+ * "data": [
893
+ * {
894
+ * "id": "cm60tbc8b0005qt015r1lv4og",
895
+ * "title": "Trump will announce planning for a bust of himself on Mount Rushmore?",
896
+ * "description": "Will President Trump make history by adding his likeness to the iconic Mount Rushmore? Imagine the controversy and the headlines—bet on whether Trump will announce plans to carve his bust into the mountain before the Event Date Close. Make a Prediction Now! This Event Outcome will Settle to \"Yes\" if a credible reporting source confirms that President Donald Trump has announced plans to carve his bust into Mount Rushmore before the Event Date Close. If it becomes impossible for this Event Outcome to Settle to \"Yes\", the Event Outcome may Settle immediately to \"No\". The primary source for this Event Outcome will be official statements from President Trump or his representatives, however a consensus of credible reporting sources may also be used. The Event Outcome is a Prediction on an Announcement from a credible reporting source.",
897
+ * "metaDescription": "Will Trump etch his legacy in stone? Bet on Mount Rushmore's next face! Make a Prediction Now!",
898
+ * "newsSource": null,
899
+ * "slug": "president-donald-trump-will-announce-planning-for-a-bust-of-himself-on-mount-rushmore",
900
+ * "imageUrl": "https://wahoo-events.s3.us-east-1.amazonaws.com/2Iag9S762_b0YmIacrV_u_dvjh",
901
+ * "status": "LIVE",
902
+ * "type": "COLLECTION",
903
+ * "estimatedEnd": "2028-01-01T04:59:00.000Z",
904
+ * "endDate": null,
905
+ * "updatedAt": "2025-09-30T05:41:02.191Z",
906
+ * "createdAt": "2025-01-17T17:32:05.234Z",
907
+ * "volume": 25266,
908
+ * "externalId": null,
909
+ * "favorites": [],
910
+ * "feature": "FEATURED",
911
+ * "outcomes": [
912
+ * {
913
+ * "id": "cm60tcr8q0007qt01y74j0uc3",
914
+ * "title": "Trump will announce planning for a bust of himself on Mount Rushmore?",
915
+ * "description": "Trump will announce planning for a bust of himself on Mount Rushmore?",
916
+ * "resolution": "Resolution ID: cm60tcr8q0007qt01y74j0uc3",
917
+ * "rules": "You can dispute the decision within 7 days after the settlement; to do so, write to our technical support by email and telegram.",
918
+ * "slug": "trump-will-announce-planning-for-a-bust-of-himself-on-mount-rushmore",
919
+ * "eventId": "cm60tbc8b0005qt015r1lv4og",
920
+ * "estimatedEnd": "2028-01-01T04:59:00.000Z",
921
+ * "endDate": null,
922
+ * "imageUrl": "https://wahoo-events.s3.us-east-1.amazonaws.com/3ak9b8GPxQ4YtAtiO0iqq_dvjh",
923
+ * "volume": 25266,
924
+ * "status": "LIVE",
925
+ * "externalId": null,
926
+ * "OutcomeOption": [
927
+ * {
928
+ * "id": "cm60tcr8q0008qt01gi5d7qb9",
929
+ * "outcomeId": "cm60tcr8q0007qt01y74j0uc3",
930
+ * "option": "Yes",
931
+ * "probability": 0.075,
932
+ * "pricesHistory": [
933
+ * 0.15,
934
+ * 0.05,
935
+ * 0.05,
936
+ * 0.05
937
+ * ],
938
+ * "totalVolume": 541.9420969262309,
939
+ * "slug": "yes",
940
+ * "totalPart": 12150.69525869904,
941
+ * "order": 0,
942
+ * "marketId": "cmbscqa7a007jo2014lgh3pt3",
943
+ * "liquidityStatus": "LOW",
944
+ * "orders": [
945
+ * {
946
+ * "id": "cmetqh82i00itqv010z4rkeqf"
947
+ * },
948
+ * {
949
+ * "id": "cmetqh82e00irqv01kt1bx7y0"
950
+ * },
951
+ * {
952
+ * "id": "cmf9u9p0h008coa01u1gq7z80"
953
+ * },
954
+ * {
955
+ * "id": "cmf9ub1mp008ioa01d4s3j1nm"
956
+ * },
957
+ * {
958
+ * "id": "cmf9ub1mn008goa01g440lajo"
959
+ * },
960
+ * {
961
+ * "id": "cmf9ub6sw008ooa013984yl5g"
962
+ * },
963
+ * {
964
+ * "id": "cmf9u3v04008aoa01sktgryj2"
965
+ * },
966
+ * {
967
+ * "id": "cmf9ubg2n008uoa01heb9708h"
968
+ * },
969
+ * {
970
+ * "id": "cmf9ubg2l008soa01gerce4u2"
971
+ * },
972
+ * {
973
+ * "id": "cmf9ubyn1008yoa01e0t5bvua"
974
+ * },
975
+ * {
976
+ * "id": "cmflfmbto005yl501qciay559"
977
+ * },
978
+ * {
979
+ * "id": "cmflfmbtm005wl501c77btyw6"
980
+ * },
981
+ * {
982
+ * "id": "cmflfoh0p0068l501d38y20og"
983
+ * },
984
+ * {
985
+ * "id": "cmflfoh0l0066l501usqqtye0"
986
+ * },
987
+ * {
988
+ * "id": "cmfy1vpjg001ymv01emdrgc12"
989
+ * },
990
+ * {
991
+ * "id": "cmfld3lif01pkl501tkmfgfcw"
992
+ * },
993
+ * {
994
+ * "id": "cmfld3lid01pil501eg96ypaa"
995
+ * }
996
+ * ],
997
+ * "buyPrice": 0.08415841584158412,
998
+ * "sellPrice": 0.07425742574257425,
999
+ * "potentialWin": 444.44444
1000
+ * },
1001
+ * {
1002
+ * "id": "cm60tcr8q0009qt01gom1jytx",
1003
+ * "outcomeId": "cm60tcr8q0007qt01y74j0uc3",
1004
+ * "option": "No",
1005
+ * "probability": 0.925,
1006
+ * "pricesHistory": [
1007
+ * 0.85,
1008
+ * 0.95,
1009
+ * 0.95,
1010
+ * 0.95
1011
+ * ],
1012
+ * "totalVolume": 4053.950169881916,
1013
+ * "slug": "no",
1014
+ * "totalPart": 4210.806263227002,
1015
+ * "order": 1,
1016
+ * "marketId": "cmbscqa7a007jo2014lgh3pt3",
1017
+ * "liquidityStatus": "LOW",
1018
+ * "orders": [],
1019
+ * "buyPrice": 0.9257425742574258,
1020
+ * "sellPrice": 0.9158415841584159,
1021
+ * "potentialWin": 101.9368
1022
+ * }
1023
+ * ]
1024
+ * }
1025
+ * ],
1026
+ * "tags": [
1027
+ * {
1028
+ * "slug": "politics",
1029
+ * "label": "Politics"
1030
+ * },
1031
+ * {
1032
+ * "slug": "america",
1033
+ * "label": "America"
1034
+ * },
1035
+ * {
1036
+ * "slug": "trump",
1037
+ * "label": "Trump"
1038
+ * },
1039
+ * {
1040
+ * "slug": "consumer",
1041
+ * "label": "Consumer"
1042
+ * }
1043
+ * ]
1044
+ * }
1045
+ * ],
1046
+ * "suggestions": [],
1047
+ * "totalPages": 14,
1048
+ * "hasNextPage": true,
1049
+ * "hasPreviousPage": false,
1050
+ * "totalItems": 280
1051
+ * }
1052
+ */
1053
+ "application/json": {
1054
+ /** @description The list of events. */
1055
+ data: components["schemas"]["Event"][];
1056
+ /** @description List of suggestions (if any). */
1057
+ suggestions?: Record<string, never>[];
1058
+ /**
1059
+ * Format: integer
1060
+ * @description Total number of pages available.
1061
+ */
1062
+ totalPages: number;
1063
+ /** @description Indicates if there is a next page. */
1064
+ hasNextPage: boolean;
1065
+ /** @description Indicates if there is a previous page. */
1066
+ hasPreviousPage: boolean;
1067
+ /**
1068
+ * Format: integer
1069
+ * @description Total number of items across all pages.
1070
+ */
1071
+ totalItems: number;
1072
+ };
1073
+ };
1074
+ };
1075
+ };
1076
+ };
1077
+ getEventDetails: {
1078
+ parameters: {
1079
+ query?: never;
1080
+ header?: never;
1081
+ path: {
1082
+ /** @description The unique identifier of the event. */
1083
+ eventId: string;
1084
+ };
1085
+ cookie?: never;
1086
+ };
1087
+ requestBody?: never;
1088
+ responses: {
1089
+ /** @description Successfully retrieved event details. */
1090
+ 200: {
1091
+ headers: {
1092
+ [name: string]: unknown;
1093
+ };
1094
+ content: {
1095
+ /**
1096
+ * @example {
1097
+ * "id": "cm60tbc8b0005qt015r1lv4og",
1098
+ * "title": "Trump will announce planning for a bust of himself on Mount Rushmore?",
1099
+ * "description": "Will President Trump make history by adding his likeness to the iconic Mount Rushmore? Imagine the controversy and the headlines—bet on whether Trump will announce plans to carve his bust into the mountain before the Event Date Close. Make a Prediction Now! This Event Outcome will Settle to \"Yes\" if a credible reporting source confirms that President Donald Trump has announced plans to carve his bust into Mount Rushmore before the Event Date Close. If it becomes impossible for this Event Outcome to Settle to \"Yes\", the Event Outcome may Settle immediately to \"No\". The primary source for this Event Outcome will be official statements from President Trump or his representatives, however a consensus of credible reporting sources may also be used. The Event Outcome is a Prediction on an Announcement from a credible reporting source.",
1100
+ * "metaDescription": "Will Trump etch his legacy in stone? Bet on Mount Rushmore's next face! Make a Prediction Now!",
1101
+ * "newsSource": null,
1102
+ * "slug": "president-donald-trump-will-announce-planning-for-a-bust-of-himself-on-mount-rushmore",
1103
+ * "imageUrl": "https://wahoo-events.s3.us-east-1.amazonaws.com/2Iag9S762_b0YmIacrV_u_dvjh",
1104
+ * "status": "LIVE",
1105
+ * "type": "COLLECTION",
1106
+ * "estimatedEnd": "2028-01-01T04:59:00.000Z",
1107
+ * "endDate": null,
1108
+ * "updatedAt": "2025-09-30T05:41:02.191Z",
1109
+ * "createdAt": "2025-01-17T17:32:05.234Z",
1110
+ * "volume": 25266,
1111
+ * "externalId": null,
1112
+ * "favorites": [],
1113
+ * "feature": "FEATURED",
1114
+ * "outcomes": [
1115
+ * {
1116
+ * "id": "cm60tcr8q0007qt01y74j0uc3",
1117
+ * "title": "Trump will announce planning for a bust of himself on Mount Rushmore?",
1118
+ * "description": "Trump will announce planning for a bust of himself on Mount Rushmore?",
1119
+ * "resolution": "Resolution ID: cm60tcr8q0007qt01y74j0uc3",
1120
+ * "rules": "You can dispute the decision within 7 days after the settlement; to do so, write to our technical support by email and telegram.",
1121
+ * "slug": "trump-will-announce-planning-for-a-bust-of-himself-on-mount-rushmore",
1122
+ * "eventId": "cm60tbc8b0005qt015r1lv4og",
1123
+ * "estimatedEnd": "2028-01-01T04:59:00.000Z",
1124
+ * "endDate": null,
1125
+ * "imageUrl": "https://wahoo-events.s3.us-east-1.amazonaws.com/3ak9b8GPxQ4YtAtiO0iqq_dvjh",
1126
+ * "volume": 25266,
1127
+ * "status": "LIVE",
1128
+ * "externalId": null,
1129
+ * "OutcomeOption": [
1130
+ * {
1131
+ * "id": "cm60tcr8q0008qt01gi5d7qb9",
1132
+ * "outcomeId": "cm60tcr8q0007qt01y74j0uc3",
1133
+ * "option": "Yes",
1134
+ * "probability": 0.075,
1135
+ * "pricesHistory": [
1136
+ * 0.15,
1137
+ * 0.05,
1138
+ * 0.05,
1139
+ * 0.05
1140
+ * ],
1141
+ * "totalVolume": 541.9420969262309,
1142
+ * "slug": "yes",
1143
+ * "totalPart": 12150.69525869904,
1144
+ * "order": 0,
1145
+ * "marketId": "cmbscqa7a007jo2014lgh3pt3",
1146
+ * "liquidityStatus": "LOW",
1147
+ * "position": [],
1148
+ * "buyPrice": 0.08415841584158412,
1149
+ * "sellPrice": 0.07425742574257425,
1150
+ * "potentialWin": 444.44444
1151
+ * },
1152
+ * {
1153
+ * "id": "cm60tcr8q0009qt01gom1jytx",
1154
+ * "outcomeId": "cm60tcr8q0007qt01y74j0uc3",
1155
+ * "option": "No",
1156
+ * "probability": 0.925,
1157
+ * "pricesHistory": [
1158
+ * 0.85,
1159
+ * 0.95,
1160
+ * 0.95,
1161
+ * 0.95
1162
+ * ],
1163
+ * "totalVolume": 4053.950169881916,
1164
+ * "slug": "no",
1165
+ * "totalPart": 4210.806263227002,
1166
+ * "order": 1,
1167
+ * "marketId": "cmbscqa7a007jo2014lgh3pt3",
1168
+ * "liquidityStatus": "LOW",
1169
+ * "position": [],
1170
+ * "buyPrice": 0.9257425742574258,
1171
+ * "sellPrice": 0.9158415841584159,
1172
+ * "potentialWin": 101.9368
1173
+ * }
1174
+ * ]
1175
+ * }
1176
+ * ],
1177
+ * "tags": [
1178
+ * {
1179
+ * "label": "Politics",
1180
+ * "slug": "politics"
1181
+ * },
1182
+ * {
1183
+ * "label": "America",
1184
+ * "slug": "america"
1185
+ * },
1186
+ * {
1187
+ * "label": "Trump",
1188
+ * "slug": "trump"
1189
+ * },
1190
+ * {
1191
+ * "label": "Consumer",
1192
+ * "slug": "consumer"
1193
+ * }
1194
+ * ],
1195
+ * "bestOffer": {
1196
+ * "outcomeId": "cm60tcr8q0007qt01y74j0uc3",
1197
+ * "optionId": "cm60tcr8q0008qt01gi5d7qb9"
1198
+ * }
1199
+ * }
1200
+ */
1201
+ "application/json": components["schemas"]["Event"];
1202
+ };
1203
+ };
1204
+ };
1205
+ };
1206
+ getOrderbook: {
1207
+ parameters: {
1208
+ query: {
1209
+ /** @description The ID of the outcome option to retrieve the order book for. */
1210
+ outcomeOptionId: string;
1211
+ };
1212
+ header?: never;
1213
+ path?: never;
1214
+ cookie?: never;
1215
+ };
1216
+ requestBody?: never;
1217
+ responses: {
1218
+ /** @description Successful retrieval of the order book. */
1219
+ 200: {
1220
+ headers: {
1221
+ [name: string]: unknown;
1222
+ };
1223
+ content: {
1224
+ /**
1225
+ * @example {
1226
+ * "bids": [
1227
+ * {
1228
+ * "price": "0.100",
1229
+ * "size": "1.00"
1230
+ * }
1231
+ * ],
1232
+ * "asks": [
1233
+ * {
1234
+ * "price": "0.200",
1235
+ * "size": "1.00"
1236
+ * }
1237
+ * ]
1238
+ * }
1239
+ */
1240
+ "application/json": components["schemas"]["Orderbook"];
1241
+ };
1242
+ };
1243
+ };
1244
+ };
1245
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wahoopredict/trading-sdk",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "TypeScript SDK for the WahooPredict trading API",
5
5
  "author": "WahooPredict",
6
6
  "license": "MIT",
@@ -27,7 +27,7 @@
27
27
  "build": "npm run build:esm && npm run build:cjs && npm run build:types",
28
28
  "build:esm": "swc --config-file esm.swcrc ./src -d dist/esm --strip-leading-paths && node -e \"require('fs').writeFileSync('dist/esm/package.json', JSON.stringify({type: 'module'}))\"",
29
29
  "build:cjs": "swc --config-file cjs.swcrc ./src -d dist/cjs --strip-leading-paths",
30
- "build:types": "tsc --project tsconfig.types.json",
30
+ "build:types": "tsc --project tsconfig.types.json && cp src/schema.d.ts dist/types/schema.d.ts",
31
31
  "lint": "eslint src/",
32
32
  "lint:types": "tsc --noEmit",
33
33
  "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",