@wahoopredict/trading-sdk 0.3.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 { }; /**
@@ -256,7 +256,7 @@ export interface paths {
256
256
  requestBody: {
257
257
  content: {
258
258
  "application/json": {
259
- positionId?: string;
259
+ positionId: string;
260
260
  };
261
261
  };
262
262
  };
@@ -269,8 +269,8 @@ export interface paths {
269
269
  content: {
270
270
  "application/json": {
271
271
  /** @enum {string} */
272
- result?: "success";
273
- newBalance?: number;
272
+ result: "success";
273
+ newBalance: number;
274
274
  };
275
275
  };
276
276
  };
@@ -317,6 +317,8 @@ export interface paths {
317
317
  isOpen?: boolean;
318
318
  search?: string;
319
319
  userId?: string;
320
+ /** @description If true, include orders on SPECIAL events. */
321
+ includeSpecial?: boolean;
320
322
  };
321
323
  };
322
324
  };
@@ -402,6 +404,14 @@ export interface paths {
402
404
  filter?: {
403
405
  search?: string;
404
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;
405
415
  };
406
416
  };
407
417
  };
@@ -559,7 +569,7 @@ export interface components {
559
569
  * @description The status of the event.
560
570
  * @enum {string}
561
571
  */
562
- EventStatus: "LIVE" | "ENDED" | "SETTLED" | "ARCHIVED";
572
+ EventStatus: "LIVE" | "PENDING" | "RESOLVED" | "ARCHIVED";
563
573
  OutcomeOption: {
564
574
  /** @description The unique ID of the outcome option. */
565
575
  id: string;
@@ -586,7 +596,12 @@ export interface components {
586
596
  order: number;
587
597
  marketId: string;
588
598
  liquidityStatus: string;
599
+ /** @description User's positions on this option. Populated by event-details endpoint when authenticated. */
589
600
  position?: components["schemas"]["Position"][];
601
+ /** @description Open order stubs (id only). Populated by events-list endpoint. */
602
+ orders?: {
603
+ id?: string;
604
+ }[];
590
605
  /** Format: double */
591
606
  buyPrice: number;
592
607
  /** Format: double */
@@ -597,9 +612,9 @@ export interface components {
597
612
  Outcome: {
598
613
  id: string;
599
614
  title: string;
600
- description?: string;
601
- resolution?: string;
602
- rules?: string;
615
+ description: string;
616
+ resolution: string;
617
+ rules: string;
603
618
  slug: string;
604
619
  eventId: string;
605
620
  /** Format: date-time */
@@ -624,7 +639,7 @@ export interface components {
624
639
  imageUrl: string;
625
640
  status: components["schemas"]["EventStatus"];
626
641
  /** @enum {string} */
627
- type: "COLLECTION";
642
+ type: "COLLECTION" | "COMPETITIVE";
628
643
  /** Format: date-time */
629
644
  estimatedEnd?: string | null;
630
645
  /** Format: date-time */
@@ -636,8 +651,10 @@ export interface components {
636
651
  /** Format: integer */
637
652
  volume: number;
638
653
  externalId?: string | null;
654
+ /** @description Array of user IDs who favorited this event. */
655
+ favorites?: string[];
639
656
  /** @enum {string|null} */
640
- feature?: "FEATURED" | null;
657
+ feature?: "TRENDING" | "FEATURED" | "FAST_MARKET" | null;
641
658
  outcomes: components["schemas"]["Outcome"][];
642
659
  tags?: components["schemas"]["Tag"][];
643
660
  /** @description Details on the best available offer/option. */
@@ -669,45 +686,52 @@ export interface components {
669
686
  slug: string;
670
687
  };
671
688
  Position: {
672
- id?: string;
673
- userId?: string;
674
- outcomeOptionId?: string;
675
- avgPrice?: string;
676
- part?: string;
677
- createdAt?: string;
689
+ id: string;
690
+ userId: string;
691
+ outcomeOptionId: string;
692
+ avgPrice: string;
693
+ part: string;
694
+ createdAt: string;
678
695
  outcomeOption?: {
679
696
  option?: string;
680
697
  probability?: number;
681
698
  outcome?: {
699
+ title?: string;
682
700
  description?: string;
701
+ status?: components["schemas"]["EventStatus"];
683
702
  imageUrl?: string;
684
703
  event?: {
685
704
  id?: string;
705
+ imageUrl?: string;
686
706
  };
687
707
  };
688
708
  };
689
709
  };
690
710
  Order: {
691
- id?: string;
692
- userId?: string;
693
- outcomeOptionId?: string;
694
- size?: string;
695
- price?: string;
696
- filled?: string;
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;
697
719
  /** @enum {string} */
698
- side?: "BUY" | "SELL";
720
+ side: "BUY" | "SELL";
699
721
  /** @enum {string} */
700
- type?: "MARKET" | "LIMIT";
722
+ type: "MARKET" | "LIMIT";
701
723
  /** @enum {string} */
702
- status?: "OPEN" | "PART_FILLED" | "FULFILLED" | "CLOSED";
703
- createdAt?: string;
724
+ status: "OPEN" | "PART_FILLED" | "FULFILLED" | "CANCELED";
725
+ createdAt: string;
704
726
  outcomeOption?: {
705
727
  option?: string;
706
728
  outcome?: {
729
+ title?: string;
707
730
  description?: string;
708
731
  imageUrl?: string;
709
732
  event?: {
710
733
  id?: string;
734
+ imageUrl?: string;
711
735
  };
712
736
  };
713
737
  };
@@ -763,6 +787,8 @@ export interface components {
763
787
  * @enum {string}
764
788
  */
765
789
  type: "LIMIT" | "MARKET";
790
+ /** @description Optional expiration timestamp for the order. */
791
+ expiration?: number;
766
792
  };
767
793
  ApiError: {
768
794
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wahoopredict/trading-sdk",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "TypeScript SDK for the WahooPredict trading API",
5
5
  "author": "WahooPredict",
6
6
  "license": "MIT",