pmxtjs 1.1.4 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/esm/generated/src/apis/DefaultApi.d.ts +23 -1
  2. package/dist/esm/generated/src/apis/DefaultApi.js +38 -1
  3. package/dist/esm/generated/src/models/SearchEvents200Response.d.ts +46 -0
  4. package/dist/esm/generated/src/models/SearchEvents200Response.js +47 -0
  5. package/dist/esm/generated/src/models/SearchEventsRequest.d.ts +40 -0
  6. package/dist/esm/generated/src/models/SearchEventsRequest.js +47 -0
  7. package/dist/esm/generated/src/models/UnifiedEvent.d.ts +81 -0
  8. package/dist/esm/generated/src/models/UnifiedEvent.js +58 -0
  9. package/dist/esm/generated/src/models/UnifiedMarket.d.ts +24 -0
  10. package/dist/esm/generated/src/models/UnifiedMarket.js +8 -0
  11. package/dist/esm/generated/src/models/index.d.ts +3 -0
  12. package/dist/esm/generated/src/models/index.js +3 -0
  13. package/dist/esm/pmxt/client.js +11 -0
  14. package/dist/esm/pmxt/models.d.ts +8 -0
  15. package/dist/generated/src/apis/DefaultApi.d.ts +23 -1
  16. package/dist/generated/src/apis/DefaultApi.js +38 -1
  17. package/dist/generated/src/models/SearchEvents200Response.d.ts +46 -0
  18. package/dist/generated/src/models/SearchEvents200Response.js +54 -0
  19. package/dist/generated/src/models/SearchEventsRequest.d.ts +40 -0
  20. package/dist/generated/src/models/SearchEventsRequest.js +54 -0
  21. package/dist/generated/src/models/UnifiedEvent.d.ts +81 -0
  22. package/dist/generated/src/models/UnifiedEvent.js +65 -0
  23. package/dist/generated/src/models/UnifiedMarket.d.ts +24 -0
  24. package/dist/generated/src/models/UnifiedMarket.js +8 -0
  25. package/dist/generated/src/models/index.d.ts +3 -0
  26. package/dist/generated/src/models/index.js +3 -0
  27. package/dist/pmxt/client.js +11 -0
  28. package/dist/pmxt/models.d.ts +8 -0
  29. package/generated/.openapi-generator/FILES +6 -0
  30. package/generated/docs/DefaultApi.md +71 -0
  31. package/generated/docs/SearchEvents200Response.md +38 -0
  32. package/generated/docs/SearchEventsRequest.md +36 -0
  33. package/generated/docs/UnifiedEvent.md +51 -0
  34. package/generated/docs/UnifiedMarket.md +8 -0
  35. package/generated/package.json +1 -1
  36. package/generated/src/apis/DefaultApi.ts +61 -0
  37. package/generated/src/models/SearchEvents200Response.ts +96 -0
  38. package/generated/src/models/SearchEventsRequest.ts +89 -0
  39. package/generated/src/models/UnifiedEvent.ts +137 -0
  40. package/generated/src/models/UnifiedMarket.ts +32 -0
  41. package/generated/src/models/index.ts +3 -0
  42. package/package.json +2 -2
  43. package/pmxt/client.ts +13 -0
  44. package/pmxt/models.ts +12 -0
@@ -0,0 +1,51 @@
1
+
2
+ # UnifiedEvent
3
+
4
+ A grouped collection of related markets (e.g., \"Who will be Fed Chair?\" contains multiple candidate markets)
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `id` | string
11
+ `title` | string
12
+ `description` | string
13
+ `slug` | string
14
+ `markets` | [Array<UnifiedMarket>](UnifiedMarket.md)
15
+ `url` | string
16
+ `image` | string
17
+ `category` | string
18
+ `tags` | Array<string>
19
+
20
+ ## Example
21
+
22
+ ```typescript
23
+ import type { UnifiedEvent } from 'pmxtjs'
24
+
25
+ // TODO: Update the object below with actual values
26
+ const example = {
27
+ "id": null,
28
+ "title": null,
29
+ "description": null,
30
+ "slug": null,
31
+ "markets": null,
32
+ "url": null,
33
+ "image": null,
34
+ "category": null,
35
+ "tags": null,
36
+ } satisfies UnifiedEvent
37
+
38
+ console.log(example)
39
+
40
+ // Convert the instance to a JSON string
41
+ const exampleJSON: string = JSON.stringify(example)
42
+ console.log(exampleJSON)
43
+
44
+ // Parse the JSON string back to an object
45
+ const exampleParsed = JSON.parse(exampleJSON) as UnifiedEvent
46
+ console.log(exampleParsed)
47
+ ```
48
+
49
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
50
+
51
+
@@ -19,6 +19,10 @@ Name | Type
19
19
  `image` | string
20
20
  `category` | string
21
21
  `tags` | Array<string>
22
+ `yes` | [MarketOutcome](MarketOutcome.md)
23
+ `no` | [MarketOutcome](MarketOutcome.md)
24
+ `up` | [MarketOutcome](MarketOutcome.md)
25
+ `down` | [MarketOutcome](MarketOutcome.md)
22
26
 
23
27
  ## Example
24
28
 
@@ -40,6 +44,10 @@ const example = {
40
44
  "image": null,
41
45
  "category": null,
42
46
  "tags": null,
47
+ "yes": null,
48
+ "no": null,
49
+ "up": null,
50
+ "down": null,
43
51
  } satisfies UnifiedMarket
44
52
 
45
53
  console.log(example)
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmxtjs",
3
- "version": "1.1.4",
3
+ "version": "1.3.1",
4
4
  "description": "OpenAPI client for pmxtjs",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -33,6 +33,8 @@ import type {
33
33
  FetchTradesRequest,
34
34
  GetMarketsBySlugRequest,
35
35
  HealthCheck200Response,
36
+ SearchEvents200Response,
37
+ SearchEventsRequest,
36
38
  SearchMarketsRequest,
37
39
  WatchOrderBookRequest,
38
40
  WatchTradesRequest,
@@ -74,6 +76,10 @@ import {
74
76
  GetMarketsBySlugRequestToJSON,
75
77
  HealthCheck200ResponseFromJSON,
76
78
  HealthCheck200ResponseToJSON,
79
+ SearchEvents200ResponseFromJSON,
80
+ SearchEvents200ResponseToJSON,
81
+ SearchEventsRequestFromJSON,
82
+ SearchEventsRequestToJSON,
77
83
  SearchMarketsRequestFromJSON,
78
84
  SearchMarketsRequestToJSON,
79
85
  WatchOrderBookRequestFromJSON,
@@ -137,6 +143,11 @@ export interface GetMarketsBySlugOperationRequest {
137
143
  getMarketsBySlugRequest?: GetMarketsBySlugRequest;
138
144
  }
139
145
 
146
+ export interface SearchEventsOperationRequest {
147
+ exchange: SearchEventsOperationExchangeEnum;
148
+ searchEventsRequest?: SearchEventsRequest;
149
+ }
150
+
140
151
  export interface SearchMarketsOperationRequest {
141
152
  exchange: SearchMarketsOperationExchangeEnum;
142
153
  searchMarketsRequest?: SearchMarketsRequest;
@@ -626,6 +637,48 @@ export class DefaultApi extends runtime.BaseAPI {
626
637
  return await response.value();
627
638
  }
628
639
 
640
+ /**
641
+ * Search for events (groups of related markets) by title or description.
642
+ * Search Events
643
+ */
644
+ async searchEventsRaw(requestParameters: SearchEventsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SearchEvents200Response>> {
645
+ if (requestParameters['exchange'] == null) {
646
+ throw new runtime.RequiredError(
647
+ 'exchange',
648
+ 'Required parameter "exchange" was null or undefined when calling searchEvents().'
649
+ );
650
+ }
651
+
652
+ const queryParameters: any = {};
653
+
654
+ const headerParameters: runtime.HTTPHeaders = {};
655
+
656
+ headerParameters['Content-Type'] = 'application/json';
657
+
658
+
659
+ let urlPath = `/api/{exchange}/searchEvents`;
660
+ urlPath = urlPath.replace(`{${"exchange"}}`, encodeURIComponent(String(requestParameters['exchange'])));
661
+
662
+ const response = await this.request({
663
+ path: urlPath,
664
+ method: 'POST',
665
+ headers: headerParameters,
666
+ query: queryParameters,
667
+ body: SearchEventsRequestToJSON(requestParameters['searchEventsRequest']),
668
+ }, initOverrides);
669
+
670
+ return new runtime.JSONApiResponse(response, (jsonValue) => SearchEvents200ResponseFromJSON(jsonValue));
671
+ }
672
+
673
+ /**
674
+ * Search for events (groups of related markets) by title or description.
675
+ * Search Events
676
+ */
677
+ async searchEvents(requestParameters: SearchEventsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SearchEvents200Response> {
678
+ const response = await this.searchEventsRaw(requestParameters, initOverrides);
679
+ return await response.value();
680
+ }
681
+
629
682
  /**
630
683
  * Search for markets by title or description.
631
684
  * Search Markets
@@ -842,6 +895,14 @@ export const GetMarketsBySlugOperationExchangeEnum = {
842
895
  Kalshi: 'kalshi'
843
896
  } as const;
844
897
  export type GetMarketsBySlugOperationExchangeEnum = typeof GetMarketsBySlugOperationExchangeEnum[keyof typeof GetMarketsBySlugOperationExchangeEnum];
898
+ /**
899
+ * @export
900
+ */
901
+ export const SearchEventsOperationExchangeEnum = {
902
+ Polymarket: 'polymarket',
903
+ Kalshi: 'kalshi'
904
+ } as const;
905
+ export type SearchEventsOperationExchangeEnum = typeof SearchEventsOperationExchangeEnum[keyof typeof SearchEventsOperationExchangeEnum];
845
906
  /**
846
907
  * @export
847
908
  */
@@ -0,0 +1,96 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * PMXT Sidecar API
5
+ * A unified local sidecar API for prediction markets (Polymarket, Kalshi). This API acts as a JSON-RPC-style gateway. Each endpoint corresponds to a specific method on the generic exchange implementation.
6
+ *
7
+ * The version of the OpenAPI document: 0.4.4
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ import type { ErrorDetail } from './ErrorDetail';
17
+ import {
18
+ ErrorDetailFromJSON,
19
+ ErrorDetailFromJSONTyped,
20
+ ErrorDetailToJSON,
21
+ ErrorDetailToJSONTyped,
22
+ } from './ErrorDetail';
23
+ import type { UnifiedEvent } from './UnifiedEvent';
24
+ import {
25
+ UnifiedEventFromJSON,
26
+ UnifiedEventFromJSONTyped,
27
+ UnifiedEventToJSON,
28
+ UnifiedEventToJSONTyped,
29
+ } from './UnifiedEvent';
30
+
31
+ /**
32
+ *
33
+ * @export
34
+ * @interface SearchEvents200Response
35
+ */
36
+ export interface SearchEvents200Response {
37
+ /**
38
+ *
39
+ * @type {boolean}
40
+ * @memberof SearchEvents200Response
41
+ */
42
+ success?: boolean;
43
+ /**
44
+ *
45
+ * @type {ErrorDetail}
46
+ * @memberof SearchEvents200Response
47
+ */
48
+ error?: ErrorDetail;
49
+ /**
50
+ *
51
+ * @type {Array<UnifiedEvent>}
52
+ * @memberof SearchEvents200Response
53
+ */
54
+ data?: Array<UnifiedEvent>;
55
+ }
56
+
57
+ /**
58
+ * Check if a given object implements the SearchEvents200Response interface.
59
+ */
60
+ export function instanceOfSearchEvents200Response(value: object): value is SearchEvents200Response {
61
+ return true;
62
+ }
63
+
64
+ export function SearchEvents200ResponseFromJSON(json: any): SearchEvents200Response {
65
+ return SearchEvents200ResponseFromJSONTyped(json, false);
66
+ }
67
+
68
+ export function SearchEvents200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): SearchEvents200Response {
69
+ if (json == null) {
70
+ return json;
71
+ }
72
+ return {
73
+
74
+ 'success': json['success'] == null ? undefined : json['success'],
75
+ 'error': json['error'] == null ? undefined : ErrorDetailFromJSON(json['error']),
76
+ 'data': json['data'] == null ? undefined : ((json['data'] as Array<any>).map(UnifiedEventFromJSON)),
77
+ };
78
+ }
79
+
80
+ export function SearchEvents200ResponseToJSON(json: any): SearchEvents200Response {
81
+ return SearchEvents200ResponseToJSONTyped(json, false);
82
+ }
83
+
84
+ export function SearchEvents200ResponseToJSONTyped(value?: SearchEvents200Response | null, ignoreDiscriminator: boolean = false): any {
85
+ if (value == null) {
86
+ return value;
87
+ }
88
+
89
+ return {
90
+
91
+ 'success': value['success'],
92
+ 'error': ErrorDetailToJSON(value['error']),
93
+ 'data': value['data'] == null ? undefined : ((value['data'] as Array<any>).map(UnifiedEventToJSON)),
94
+ };
95
+ }
96
+
@@ -0,0 +1,89 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * PMXT Sidecar API
5
+ * A unified local sidecar API for prediction markets (Polymarket, Kalshi). This API acts as a JSON-RPC-style gateway. Each endpoint corresponds to a specific method on the generic exchange implementation.
6
+ *
7
+ * The version of the OpenAPI document: 0.4.4
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ import type { ExchangeCredentials } from './ExchangeCredentials';
17
+ import {
18
+ ExchangeCredentialsFromJSON,
19
+ ExchangeCredentialsFromJSONTyped,
20
+ ExchangeCredentialsToJSON,
21
+ ExchangeCredentialsToJSONTyped,
22
+ } from './ExchangeCredentials';
23
+ import type { SearchMarketsRequestArgsInner } from './SearchMarketsRequestArgsInner';
24
+ import {
25
+ SearchMarketsRequestArgsInnerFromJSON,
26
+ SearchMarketsRequestArgsInnerFromJSONTyped,
27
+ SearchMarketsRequestArgsInnerToJSON,
28
+ SearchMarketsRequestArgsInnerToJSONTyped,
29
+ } from './SearchMarketsRequestArgsInner';
30
+
31
+ /**
32
+ *
33
+ * @export
34
+ * @interface SearchEventsRequest
35
+ */
36
+ export interface SearchEventsRequest {
37
+ /**
38
+ * [query, params?]
39
+ * @type {Array<SearchMarketsRequestArgsInner>}
40
+ * @memberof SearchEventsRequest
41
+ */
42
+ args: Array<SearchMarketsRequestArgsInner>;
43
+ /**
44
+ *
45
+ * @type {ExchangeCredentials}
46
+ * @memberof SearchEventsRequest
47
+ */
48
+ credentials?: ExchangeCredentials;
49
+ }
50
+
51
+ /**
52
+ * Check if a given object implements the SearchEventsRequest interface.
53
+ */
54
+ export function instanceOfSearchEventsRequest(value: object): value is SearchEventsRequest {
55
+ if (!('args' in value) || value['args'] === undefined) return false;
56
+ return true;
57
+ }
58
+
59
+ export function SearchEventsRequestFromJSON(json: any): SearchEventsRequest {
60
+ return SearchEventsRequestFromJSONTyped(json, false);
61
+ }
62
+
63
+ export function SearchEventsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): SearchEventsRequest {
64
+ if (json == null) {
65
+ return json;
66
+ }
67
+ return {
68
+
69
+ 'args': ((json['args'] as Array<any>).map(SearchMarketsRequestArgsInnerFromJSON)),
70
+ 'credentials': json['credentials'] == null ? undefined : ExchangeCredentialsFromJSON(json['credentials']),
71
+ };
72
+ }
73
+
74
+ export function SearchEventsRequestToJSON(json: any): SearchEventsRequest {
75
+ return SearchEventsRequestToJSONTyped(json, false);
76
+ }
77
+
78
+ export function SearchEventsRequestToJSONTyped(value?: SearchEventsRequest | null, ignoreDiscriminator: boolean = false): any {
79
+ if (value == null) {
80
+ return value;
81
+ }
82
+
83
+ return {
84
+
85
+ 'args': ((value['args'] as Array<any>).map(SearchMarketsRequestArgsInnerToJSON)),
86
+ 'credentials': ExchangeCredentialsToJSON(value['credentials']),
87
+ };
88
+ }
89
+
@@ -0,0 +1,137 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * PMXT Sidecar API
5
+ * A unified local sidecar API for prediction markets (Polymarket, Kalshi). This API acts as a JSON-RPC-style gateway. Each endpoint corresponds to a specific method on the generic exchange implementation.
6
+ *
7
+ * The version of the OpenAPI document: 0.4.4
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ import type { UnifiedMarket } from './UnifiedMarket';
17
+ import {
18
+ UnifiedMarketFromJSON,
19
+ UnifiedMarketFromJSONTyped,
20
+ UnifiedMarketToJSON,
21
+ UnifiedMarketToJSONTyped,
22
+ } from './UnifiedMarket';
23
+
24
+ /**
25
+ * A grouped collection of related markets (e.g., "Who will be Fed Chair?" contains multiple candidate markets)
26
+ * @export
27
+ * @interface UnifiedEvent
28
+ */
29
+ export interface UnifiedEvent {
30
+ /**
31
+ *
32
+ * @type {string}
33
+ * @memberof UnifiedEvent
34
+ */
35
+ id?: string;
36
+ /**
37
+ *
38
+ * @type {string}
39
+ * @memberof UnifiedEvent
40
+ */
41
+ title?: string;
42
+ /**
43
+ *
44
+ * @type {string}
45
+ * @memberof UnifiedEvent
46
+ */
47
+ description?: string;
48
+ /**
49
+ *
50
+ * @type {string}
51
+ * @memberof UnifiedEvent
52
+ */
53
+ slug?: string;
54
+ /**
55
+ *
56
+ * @type {Array<UnifiedMarket>}
57
+ * @memberof UnifiedEvent
58
+ */
59
+ markets?: Array<UnifiedMarket>;
60
+ /**
61
+ *
62
+ * @type {string}
63
+ * @memberof UnifiedEvent
64
+ */
65
+ url?: string;
66
+ /**
67
+ *
68
+ * @type {string}
69
+ * @memberof UnifiedEvent
70
+ */
71
+ image?: string;
72
+ /**
73
+ *
74
+ * @type {string}
75
+ * @memberof UnifiedEvent
76
+ */
77
+ category?: string;
78
+ /**
79
+ *
80
+ * @type {Array<string>}
81
+ * @memberof UnifiedEvent
82
+ */
83
+ tags?: Array<string>;
84
+ }
85
+
86
+ /**
87
+ * Check if a given object implements the UnifiedEvent interface.
88
+ */
89
+ export function instanceOfUnifiedEvent(value: object): value is UnifiedEvent {
90
+ return true;
91
+ }
92
+
93
+ export function UnifiedEventFromJSON(json: any): UnifiedEvent {
94
+ return UnifiedEventFromJSONTyped(json, false);
95
+ }
96
+
97
+ export function UnifiedEventFromJSONTyped(json: any, ignoreDiscriminator: boolean): UnifiedEvent {
98
+ if (json == null) {
99
+ return json;
100
+ }
101
+ return {
102
+
103
+ 'id': json['id'] == null ? undefined : json['id'],
104
+ 'title': json['title'] == null ? undefined : json['title'],
105
+ 'description': json['description'] == null ? undefined : json['description'],
106
+ 'slug': json['slug'] == null ? undefined : json['slug'],
107
+ 'markets': json['markets'] == null ? undefined : ((json['markets'] as Array<any>).map(UnifiedMarketFromJSON)),
108
+ 'url': json['url'] == null ? undefined : json['url'],
109
+ 'image': json['image'] == null ? undefined : json['image'],
110
+ 'category': json['category'] == null ? undefined : json['category'],
111
+ 'tags': json['tags'] == null ? undefined : json['tags'],
112
+ };
113
+ }
114
+
115
+ export function UnifiedEventToJSON(json: any): UnifiedEvent {
116
+ return UnifiedEventToJSONTyped(json, false);
117
+ }
118
+
119
+ export function UnifiedEventToJSONTyped(value?: UnifiedEvent | null, ignoreDiscriminator: boolean = false): any {
120
+ if (value == null) {
121
+ return value;
122
+ }
123
+
124
+ return {
125
+
126
+ 'id': value['id'],
127
+ 'title': value['title'],
128
+ 'description': value['description'],
129
+ 'slug': value['slug'],
130
+ 'markets': value['markets'] == null ? undefined : ((value['markets'] as Array<any>).map(UnifiedMarketToJSON)),
131
+ 'url': value['url'],
132
+ 'image': value['image'],
133
+ 'category': value['category'],
134
+ 'tags': value['tags'],
135
+ };
136
+ }
137
+
@@ -105,6 +105,30 @@ export interface UnifiedMarket {
105
105
  * @memberof UnifiedMarket
106
106
  */
107
107
  tags?: Array<string>;
108
+ /**
109
+ *
110
+ * @type {MarketOutcome}
111
+ * @memberof UnifiedMarket
112
+ */
113
+ yes?: MarketOutcome;
114
+ /**
115
+ *
116
+ * @type {MarketOutcome}
117
+ * @memberof UnifiedMarket
118
+ */
119
+ no?: MarketOutcome;
120
+ /**
121
+ *
122
+ * @type {MarketOutcome}
123
+ * @memberof UnifiedMarket
124
+ */
125
+ up?: MarketOutcome;
126
+ /**
127
+ *
128
+ * @type {MarketOutcome}
129
+ * @memberof UnifiedMarket
130
+ */
131
+ down?: MarketOutcome;
108
132
  }
109
133
 
110
134
  /**
@@ -137,6 +161,10 @@ export function UnifiedMarketFromJSONTyped(json: any, ignoreDiscriminator: boole
137
161
  'image': json['image'] == null ? undefined : json['image'],
138
162
  'category': json['category'] == null ? undefined : json['category'],
139
163
  'tags': json['tags'] == null ? undefined : json['tags'],
164
+ 'yes': json['yes'] == null ? undefined : MarketOutcomeFromJSON(json['yes']),
165
+ 'no': json['no'] == null ? undefined : MarketOutcomeFromJSON(json['no']),
166
+ 'up': json['up'] == null ? undefined : MarketOutcomeFromJSON(json['up']),
167
+ 'down': json['down'] == null ? undefined : MarketOutcomeFromJSON(json['down']),
140
168
  };
141
169
  }
142
170
 
@@ -164,6 +192,10 @@ export function UnifiedMarketToJSONTyped(value?: UnifiedMarket | null, ignoreDis
164
192
  'image': value['image'],
165
193
  'category': value['category'],
166
194
  'tags': value['tags'],
195
+ 'yes': MarketOutcomeToJSON(value['yes']),
196
+ 'no': MarketOutcomeToJSON(value['no']),
197
+ 'up': MarketOutcomeToJSON(value['up']),
198
+ 'down': MarketOutcomeToJSON(value['down']),
167
199
  };
168
200
  }
169
201
 
@@ -34,9 +34,12 @@ export * from './OrderBook';
34
34
  export * from './OrderLevel';
35
35
  export * from './Position';
36
36
  export * from './PriceCandle';
37
+ export * from './SearchEvents200Response';
38
+ export * from './SearchEventsRequest';
37
39
  export * from './SearchMarketsRequest';
38
40
  export * from './SearchMarketsRequestArgsInner';
39
41
  export * from './Trade';
42
+ export * from './UnifiedEvent';
40
43
  export * from './UnifiedMarket';
41
44
  export * from './WatchOrderBookRequest';
42
45
  export * from './WatchOrderBookRequestArgsInner';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmxtjs",
3
- "version": "1.1.4",
3
+ "version": "1.3.1",
4
4
  "description": "Unified prediction market data API - The ccxt for prediction markets",
5
5
  "author": "PMXT Contributors",
6
6
  "repository": {
@@ -42,7 +42,7 @@
42
42
  "unified"
43
43
  ],
44
44
  "dependencies": {
45
- "pmxt-core": "1.1.4"
45
+ "pmxt-core": "1.3.1"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/jest": "^30.0.0",
package/pmxt/client.ts CHANGED
@@ -48,6 +48,14 @@ function convertMarket(raw: any): UnifiedMarket {
48
48
  metadata: o.metadata,
49
49
  }));
50
50
 
51
+ const convertOutcome = (o: any) => o ? ({
52
+ id: o.id,
53
+ label: o.label,
54
+ price: o.price,
55
+ priceChange24h: o.priceChange24h,
56
+ metadata: o.metadata,
57
+ }) : undefined;
58
+
51
59
  return {
52
60
  id: raw.id,
53
61
  title: raw.title,
@@ -62,9 +70,14 @@ function convertMarket(raw: any): UnifiedMarket {
62
70
  image: raw.image,
63
71
  category: raw.category,
64
72
  tags: raw.tags,
73
+ yes: convertOutcome(raw.yes),
74
+ no: convertOutcome(raw.no),
75
+ up: convertOutcome(raw.up),
76
+ down: convertOutcome(raw.down),
65
77
  };
66
78
  }
67
79
 
80
+
68
81
  function convertCandle(raw: any): PriceCandle {
69
82
  return {
70
83
  timestamp: raw.timestamp,
package/pmxt/models.ts CHANGED
@@ -70,6 +70,18 @@ export interface UnifiedMarket {
70
70
 
71
71
  /** Market tags */
72
72
  tags?: string[];
73
+
74
+ /** Convenience access to the Yes outcome for binary markets. */
75
+ yes?: MarketOutcome;
76
+
77
+ /** Convenience access to the No outcome for binary markets. */
78
+ no?: MarketOutcome;
79
+
80
+ /** Convenience access to the Up outcome for binary markets. */
81
+ up?: MarketOutcome;
82
+
83
+ /** Convenience access to the Down outcome for binary markets. */
84
+ down?: MarketOutcome;
73
85
  }
74
86
 
75
87
  /**