pmxtjs 1.0.4 → 1.1.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 (37) hide show
  1. package/dist/esm/generated/src/apis/DefaultApi.d.ts +45 -1
  2. package/dist/esm/generated/src/apis/DefaultApi.js +75 -1
  3. package/dist/esm/generated/src/models/WatchOrderBookRequest.d.ts +40 -0
  4. package/dist/esm/generated/src/models/WatchOrderBookRequest.js +47 -0
  5. package/dist/esm/generated/src/models/WatchOrderBookRequestArgsInner.d.ts +21 -0
  6. package/dist/esm/generated/src/models/WatchOrderBookRequestArgsInner.js +43 -0
  7. package/dist/esm/generated/src/models/WatchTradesRequest.d.ts +40 -0
  8. package/dist/esm/generated/src/models/WatchTradesRequest.js +47 -0
  9. package/dist/esm/generated/src/models/index.d.ts +3 -0
  10. package/dist/esm/generated/src/models/index.js +3 -0
  11. package/dist/esm/pmxt/client.d.ts +44 -0
  12. package/dist/esm/pmxt/client.js +90 -0
  13. package/dist/generated/src/apis/DefaultApi.d.ts +45 -1
  14. package/dist/generated/src/apis/DefaultApi.js +75 -1
  15. package/dist/generated/src/models/WatchOrderBookRequest.d.ts +40 -0
  16. package/dist/generated/src/models/WatchOrderBookRequest.js +54 -0
  17. package/dist/generated/src/models/WatchOrderBookRequestArgsInner.d.ts +21 -0
  18. package/dist/generated/src/models/WatchOrderBookRequestArgsInner.js +49 -0
  19. package/dist/generated/src/models/WatchTradesRequest.d.ts +40 -0
  20. package/dist/generated/src/models/WatchTradesRequest.js +54 -0
  21. package/dist/generated/src/models/index.d.ts +3 -0
  22. package/dist/generated/src/models/index.js +3 -0
  23. package/dist/pmxt/client.d.ts +44 -0
  24. package/dist/pmxt/client.js +90 -0
  25. package/generated/.openapi-generator/FILES +6 -0
  26. package/generated/docs/DefaultApi.md +142 -0
  27. package/generated/docs/WatchOrderBookRequest.md +36 -0
  28. package/generated/docs/WatchOrderBookRequestArgsInner.md +32 -0
  29. package/generated/docs/WatchTradesRequest.md +36 -0
  30. package/generated/package.json +1 -1
  31. package/generated/src/apis/DefaultApi.ts +116 -0
  32. package/generated/src/models/WatchOrderBookRequest.ts +89 -0
  33. package/generated/src/models/WatchOrderBookRequestArgsInner.ts +55 -0
  34. package/generated/src/models/WatchTradesRequest.ts +89 -0
  35. package/generated/src/models/index.ts +3 -0
  36. package/package.json +2 -2
  37. package/pmxt/client.ts +101 -0
@@ -17,6 +17,8 @@ All URIs are relative to *http://localhost:3847*
17
17
  | [**getMarketsBySlug**](DefaultApi.md#getmarketsbyslugoperation) | **POST** /api/{exchange}/getMarketsBySlug | Get Market by Slug |
18
18
  | [**healthCheck**](DefaultApi.md#healthcheck) | **GET** /health | Server Health Check |
19
19
  | [**searchMarkets**](DefaultApi.md#searchmarketsoperation) | **POST** /api/{exchange}/searchMarkets | Search Markets |
20
+ | [**watchOrderBook**](DefaultApi.md#watchorderbookoperation) | **POST** /api/{exchange}/watchOrderBook | Watch Order Book (WebSocket Stream) |
21
+ | [**watchTrades**](DefaultApi.md#watchtradesoperation) | **POST** /api/{exchange}/watchTrades | Watch Trades (WebSocket Stream) |
20
22
 
21
23
 
22
24
 
@@ -894,3 +896,143 @@ No authorization required
894
896
 
895
897
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
896
898
 
899
+
900
+ ## watchOrderBook
901
+
902
+ > FetchOrderBook200Response watchOrderBook(exchange, watchOrderBookRequest)
903
+
904
+ Watch Order Book (WebSocket Stream)
905
+
906
+ Subscribe to real-time order book updates via WebSocket. Returns a promise that resolves with the next order book update. Call repeatedly in a loop to stream updates (CCXT Pro pattern).
907
+
908
+ ### Example
909
+
910
+ ```ts
911
+ import {
912
+ Configuration,
913
+ DefaultApi,
914
+ } from 'pmxtjs';
915
+ import type { WatchOrderBookOperationRequest } from 'pmxtjs';
916
+
917
+ async function example() {
918
+ console.log("🚀 Testing pmxtjs SDK...");
919
+ const api = new DefaultApi();
920
+
921
+ const body = {
922
+ // 'polymarket' | 'kalshi' | The prediction market exchange to target.
923
+ exchange: exchange_example,
924
+ // WatchOrderBookRequest (optional)
925
+ watchOrderBookRequest: ...,
926
+ } satisfies WatchOrderBookOperationRequest;
927
+
928
+ try {
929
+ const data = await api.watchOrderBook(body);
930
+ console.log(data);
931
+ } catch (error) {
932
+ console.error(error);
933
+ }
934
+ }
935
+
936
+ // Run the test
937
+ example().catch(console.error);
938
+ ```
939
+
940
+ ### Parameters
941
+
942
+
943
+ | Name | Type | Description | Notes |
944
+ |------------- | ------------- | ------------- | -------------|
945
+ | **exchange** | `polymarket`, `kalshi` | The prediction market exchange to target. | [Defaults to `undefined`] [Enum: polymarket, kalshi] |
946
+ | **watchOrderBookRequest** | [WatchOrderBookRequest](WatchOrderBookRequest.md) | | [Optional] |
947
+
948
+ ### Return type
949
+
950
+ [**FetchOrderBook200Response**](FetchOrderBook200Response.md)
951
+
952
+ ### Authorization
953
+
954
+ No authorization required
955
+
956
+ ### HTTP request headers
957
+
958
+ - **Content-Type**: `application/json`
959
+ - **Accept**: `application/json`
960
+
961
+
962
+ ### HTTP response details
963
+ | Status code | Description | Response headers |
964
+ |-------------|-------------|------------------|
965
+ | **200** | Next order book update | - |
966
+
967
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
968
+
969
+
970
+ ## watchTrades
971
+
972
+ > FetchTrades200Response watchTrades(exchange, watchTradesRequest)
973
+
974
+ Watch Trades (WebSocket Stream)
975
+
976
+ Subscribe to real-time trade updates via WebSocket. Returns a promise that resolves with the next trade(s). Call repeatedly in a loop to stream updates (CCXT Pro pattern).
977
+
978
+ ### Example
979
+
980
+ ```ts
981
+ import {
982
+ Configuration,
983
+ DefaultApi,
984
+ } from 'pmxtjs';
985
+ import type { WatchTradesOperationRequest } from 'pmxtjs';
986
+
987
+ async function example() {
988
+ console.log("🚀 Testing pmxtjs SDK...");
989
+ const api = new DefaultApi();
990
+
991
+ const body = {
992
+ // 'polymarket' | 'kalshi' | The prediction market exchange to target.
993
+ exchange: exchange_example,
994
+ // WatchTradesRequest (optional)
995
+ watchTradesRequest: ...,
996
+ } satisfies WatchTradesOperationRequest;
997
+
998
+ try {
999
+ const data = await api.watchTrades(body);
1000
+ console.log(data);
1001
+ } catch (error) {
1002
+ console.error(error);
1003
+ }
1004
+ }
1005
+
1006
+ // Run the test
1007
+ example().catch(console.error);
1008
+ ```
1009
+
1010
+ ### Parameters
1011
+
1012
+
1013
+ | Name | Type | Description | Notes |
1014
+ |------------- | ------------- | ------------- | -------------|
1015
+ | **exchange** | `polymarket`, `kalshi` | The prediction market exchange to target. | [Defaults to `undefined`] [Enum: polymarket, kalshi] |
1016
+ | **watchTradesRequest** | [WatchTradesRequest](WatchTradesRequest.md) | | [Optional] |
1017
+
1018
+ ### Return type
1019
+
1020
+ [**FetchTrades200Response**](FetchTrades200Response.md)
1021
+
1022
+ ### Authorization
1023
+
1024
+ No authorization required
1025
+
1026
+ ### HTTP request headers
1027
+
1028
+ - **Content-Type**: `application/json`
1029
+ - **Accept**: `application/json`
1030
+
1031
+
1032
+ ### HTTP response details
1033
+ | Status code | Description | Response headers |
1034
+ |-------------|-------------|------------------|
1035
+ | **200** | Next trade update(s) | - |
1036
+
1037
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
1038
+
@@ -0,0 +1,36 @@
1
+
2
+ # WatchOrderBookRequest
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `args` | [Array<WatchOrderBookRequestArgsInner>](WatchOrderBookRequestArgsInner.md)
10
+ `credentials` | [ExchangeCredentials](ExchangeCredentials.md)
11
+
12
+ ## Example
13
+
14
+ ```typescript
15
+ import type { WatchOrderBookRequest } from 'pmxtjs'
16
+
17
+ // TODO: Update the object below with actual values
18
+ const example = {
19
+ "args": null,
20
+ "credentials": null,
21
+ } satisfies WatchOrderBookRequest
22
+
23
+ console.log(example)
24
+
25
+ // Convert the instance to a JSON string
26
+ const exampleJSON: string = JSON.stringify(example)
27
+ console.log(exampleJSON)
28
+
29
+ // Parse the JSON string back to an object
30
+ const exampleParsed = JSON.parse(exampleJSON) as WatchOrderBookRequest
31
+ console.log(exampleParsed)
32
+ ```
33
+
34
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
35
+
36
+
@@ -0,0 +1,32 @@
1
+
2
+ # WatchOrderBookRequestArgsInner
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+
10
+ ## Example
11
+
12
+ ```typescript
13
+ import type { WatchOrderBookRequestArgsInner } from 'pmxtjs'
14
+
15
+ // TODO: Update the object below with actual values
16
+ const example = {
17
+ } satisfies WatchOrderBookRequestArgsInner
18
+
19
+ console.log(example)
20
+
21
+ // Convert the instance to a JSON string
22
+ const exampleJSON: string = JSON.stringify(example)
23
+ console.log(exampleJSON)
24
+
25
+ // Parse the JSON string back to an object
26
+ const exampleParsed = JSON.parse(exampleJSON) as WatchOrderBookRequestArgsInner
27
+ console.log(exampleParsed)
28
+ ```
29
+
30
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
31
+
32
+
@@ -0,0 +1,36 @@
1
+
2
+ # WatchTradesRequest
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `args` | [Array<WatchOrderBookRequestArgsInner>](WatchOrderBookRequestArgsInner.md)
10
+ `credentials` | [ExchangeCredentials](ExchangeCredentials.md)
11
+
12
+ ## Example
13
+
14
+ ```typescript
15
+ import type { WatchTradesRequest } from 'pmxtjs'
16
+
17
+ // TODO: Update the object below with actual values
18
+ const example = {
19
+ "args": null,
20
+ "credentials": null,
21
+ } satisfies WatchTradesRequest
22
+
23
+ console.log(example)
24
+
25
+ // Convert the instance to a JSON string
26
+ const exampleJSON: string = JSON.stringify(example)
27
+ console.log(exampleJSON)
28
+
29
+ // Parse the JSON string back to an object
30
+ const exampleParsed = JSON.parse(exampleJSON) as WatchTradesRequest
31
+ console.log(exampleParsed)
32
+ ```
33
+
34
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
35
+
36
+
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmxtjs",
3
- "version": "1.0.4",
3
+ "version": "1.1.0",
4
4
  "description": "OpenAPI client for pmxtjs",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -34,6 +34,8 @@ import type {
34
34
  GetMarketsBySlugRequest,
35
35
  HealthCheck200Response,
36
36
  SearchMarketsRequest,
37
+ WatchOrderBookRequest,
38
+ WatchTradesRequest,
37
39
  } from '../models/index';
38
40
  import {
39
41
  CancelOrderRequestFromJSON,
@@ -74,6 +76,10 @@ import {
74
76
  HealthCheck200ResponseToJSON,
75
77
  SearchMarketsRequestFromJSON,
76
78
  SearchMarketsRequestToJSON,
79
+ WatchOrderBookRequestFromJSON,
80
+ WatchOrderBookRequestToJSON,
81
+ WatchTradesRequestFromJSON,
82
+ WatchTradesRequestToJSON,
77
83
  } from '../models/index';
78
84
 
79
85
  export interface CancelOrderOperationRequest {
@@ -136,6 +142,16 @@ export interface SearchMarketsOperationRequest {
136
142
  searchMarketsRequest?: SearchMarketsRequest;
137
143
  }
138
144
 
145
+ export interface WatchOrderBookOperationRequest {
146
+ exchange: WatchOrderBookOperationExchangeEnum;
147
+ watchOrderBookRequest?: WatchOrderBookRequest;
148
+ }
149
+
150
+ export interface WatchTradesOperationRequest {
151
+ exchange: WatchTradesOperationExchangeEnum;
152
+ watchTradesRequest?: WatchTradesRequest;
153
+ }
154
+
139
155
  /**
140
156
  *
141
157
  */
@@ -652,6 +668,90 @@ export class DefaultApi extends runtime.BaseAPI {
652
668
  return await response.value();
653
669
  }
654
670
 
671
+ /**
672
+ * Subscribe to real-time order book updates via WebSocket. Returns a promise that resolves with the next order book update. Call repeatedly in a loop to stream updates (CCXT Pro pattern).
673
+ * Watch Order Book (WebSocket Stream)
674
+ */
675
+ async watchOrderBookRaw(requestParameters: WatchOrderBookOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FetchOrderBook200Response>> {
676
+ if (requestParameters['exchange'] == null) {
677
+ throw new runtime.RequiredError(
678
+ 'exchange',
679
+ 'Required parameter "exchange" was null or undefined when calling watchOrderBook().'
680
+ );
681
+ }
682
+
683
+ const queryParameters: any = {};
684
+
685
+ const headerParameters: runtime.HTTPHeaders = {};
686
+
687
+ headerParameters['Content-Type'] = 'application/json';
688
+
689
+
690
+ let urlPath = `/api/{exchange}/watchOrderBook`;
691
+ urlPath = urlPath.replace(`{${"exchange"}}`, encodeURIComponent(String(requestParameters['exchange'])));
692
+
693
+ const response = await this.request({
694
+ path: urlPath,
695
+ method: 'POST',
696
+ headers: headerParameters,
697
+ query: queryParameters,
698
+ body: WatchOrderBookRequestToJSON(requestParameters['watchOrderBookRequest']),
699
+ }, initOverrides);
700
+
701
+ return new runtime.JSONApiResponse(response, (jsonValue) => FetchOrderBook200ResponseFromJSON(jsonValue));
702
+ }
703
+
704
+ /**
705
+ * Subscribe to real-time order book updates via WebSocket. Returns a promise that resolves with the next order book update. Call repeatedly in a loop to stream updates (CCXT Pro pattern).
706
+ * Watch Order Book (WebSocket Stream)
707
+ */
708
+ async watchOrderBook(requestParameters: WatchOrderBookOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FetchOrderBook200Response> {
709
+ const response = await this.watchOrderBookRaw(requestParameters, initOverrides);
710
+ return await response.value();
711
+ }
712
+
713
+ /**
714
+ * Subscribe to real-time trade updates via WebSocket. Returns a promise that resolves with the next trade(s). Call repeatedly in a loop to stream updates (CCXT Pro pattern).
715
+ * Watch Trades (WebSocket Stream)
716
+ */
717
+ async watchTradesRaw(requestParameters: WatchTradesOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FetchTrades200Response>> {
718
+ if (requestParameters['exchange'] == null) {
719
+ throw new runtime.RequiredError(
720
+ 'exchange',
721
+ 'Required parameter "exchange" was null or undefined when calling watchTrades().'
722
+ );
723
+ }
724
+
725
+ const queryParameters: any = {};
726
+
727
+ const headerParameters: runtime.HTTPHeaders = {};
728
+
729
+ headerParameters['Content-Type'] = 'application/json';
730
+
731
+
732
+ let urlPath = `/api/{exchange}/watchTrades`;
733
+ urlPath = urlPath.replace(`{${"exchange"}}`, encodeURIComponent(String(requestParameters['exchange'])));
734
+
735
+ const response = await this.request({
736
+ path: urlPath,
737
+ method: 'POST',
738
+ headers: headerParameters,
739
+ query: queryParameters,
740
+ body: WatchTradesRequestToJSON(requestParameters['watchTradesRequest']),
741
+ }, initOverrides);
742
+
743
+ return new runtime.JSONApiResponse(response, (jsonValue) => FetchTrades200ResponseFromJSON(jsonValue));
744
+ }
745
+
746
+ /**
747
+ * Subscribe to real-time trade updates via WebSocket. Returns a promise that resolves with the next trade(s). Call repeatedly in a loop to stream updates (CCXT Pro pattern).
748
+ * Watch Trades (WebSocket Stream)
749
+ */
750
+ async watchTrades(requestParameters: WatchTradesOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FetchTrades200Response> {
751
+ const response = await this.watchTradesRaw(requestParameters, initOverrides);
752
+ return await response.value();
753
+ }
754
+
655
755
  }
656
756
 
657
757
  /**
@@ -750,3 +850,19 @@ export const SearchMarketsOperationExchangeEnum = {
750
850
  Kalshi: 'kalshi'
751
851
  } as const;
752
852
  export type SearchMarketsOperationExchangeEnum = typeof SearchMarketsOperationExchangeEnum[keyof typeof SearchMarketsOperationExchangeEnum];
853
+ /**
854
+ * @export
855
+ */
856
+ export const WatchOrderBookOperationExchangeEnum = {
857
+ Polymarket: 'polymarket',
858
+ Kalshi: 'kalshi'
859
+ } as const;
860
+ export type WatchOrderBookOperationExchangeEnum = typeof WatchOrderBookOperationExchangeEnum[keyof typeof WatchOrderBookOperationExchangeEnum];
861
+ /**
862
+ * @export
863
+ */
864
+ export const WatchTradesOperationExchangeEnum = {
865
+ Polymarket: 'polymarket',
866
+ Kalshi: 'kalshi'
867
+ } as const;
868
+ export type WatchTradesOperationExchangeEnum = typeof WatchTradesOperationExchangeEnum[keyof typeof WatchTradesOperationExchangeEnum];
@@ -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 { WatchOrderBookRequestArgsInner } from './WatchOrderBookRequestArgsInner';
24
+ import {
25
+ WatchOrderBookRequestArgsInnerFromJSON,
26
+ WatchOrderBookRequestArgsInnerFromJSONTyped,
27
+ WatchOrderBookRequestArgsInnerToJSON,
28
+ WatchOrderBookRequestArgsInnerToJSONTyped,
29
+ } from './WatchOrderBookRequestArgsInner';
30
+
31
+ /**
32
+ *
33
+ * @export
34
+ * @interface WatchOrderBookRequest
35
+ */
36
+ export interface WatchOrderBookRequest {
37
+ /**
38
+ * [outcomeId, limit?]
39
+ * @type {Array<WatchOrderBookRequestArgsInner>}
40
+ * @memberof WatchOrderBookRequest
41
+ */
42
+ args: Array<WatchOrderBookRequestArgsInner>;
43
+ /**
44
+ *
45
+ * @type {ExchangeCredentials}
46
+ * @memberof WatchOrderBookRequest
47
+ */
48
+ credentials?: ExchangeCredentials;
49
+ }
50
+
51
+ /**
52
+ * Check if a given object implements the WatchOrderBookRequest interface.
53
+ */
54
+ export function instanceOfWatchOrderBookRequest(value: object): value is WatchOrderBookRequest {
55
+ if (!('args' in value) || value['args'] === undefined) return false;
56
+ return true;
57
+ }
58
+
59
+ export function WatchOrderBookRequestFromJSON(json: any): WatchOrderBookRequest {
60
+ return WatchOrderBookRequestFromJSONTyped(json, false);
61
+ }
62
+
63
+ export function WatchOrderBookRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): WatchOrderBookRequest {
64
+ if (json == null) {
65
+ return json;
66
+ }
67
+ return {
68
+
69
+ 'args': ((json['args'] as Array<any>).map(WatchOrderBookRequestArgsInnerFromJSON)),
70
+ 'credentials': json['credentials'] == null ? undefined : ExchangeCredentialsFromJSON(json['credentials']),
71
+ };
72
+ }
73
+
74
+ export function WatchOrderBookRequestToJSON(json: any): WatchOrderBookRequest {
75
+ return WatchOrderBookRequestToJSONTyped(json, false);
76
+ }
77
+
78
+ export function WatchOrderBookRequestToJSONTyped(value?: WatchOrderBookRequest | 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(WatchOrderBookRequestArgsInnerToJSON)),
86
+ 'credentials': ExchangeCredentialsToJSON(value['credentials']),
87
+ };
88
+ }
89
+
@@ -0,0 +1,55 @@
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
+ /**
16
+ * @type WatchOrderBookRequestArgsInner
17
+ *
18
+ * @export
19
+ */
20
+ export type WatchOrderBookRequestArgsInner = number | string;
21
+
22
+ export function WatchOrderBookRequestArgsInnerFromJSON(json: any): WatchOrderBookRequestArgsInner {
23
+ return WatchOrderBookRequestArgsInnerFromJSONTyped(json, false);
24
+ }
25
+
26
+ export function WatchOrderBookRequestArgsInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): WatchOrderBookRequestArgsInner {
27
+ if (json == null) {
28
+ return json;
29
+ }
30
+ if (typeof json === 'number') {
31
+ return json;
32
+ }
33
+ if (typeof json === 'string') {
34
+ return json;
35
+ }
36
+ return {} as any;
37
+ }
38
+
39
+ export function WatchOrderBookRequestArgsInnerToJSON(json: any): any {
40
+ return WatchOrderBookRequestArgsInnerToJSONTyped(json, false);
41
+ }
42
+
43
+ export function WatchOrderBookRequestArgsInnerToJSONTyped(value?: WatchOrderBookRequestArgsInner | null, ignoreDiscriminator: boolean = false): any {
44
+ if (value == null) {
45
+ return value;
46
+ }
47
+ if (typeof value === 'number') {
48
+ return value;
49
+ }
50
+ if (typeof value === 'string') {
51
+ return value;
52
+ }
53
+ return {};
54
+ }
55
+
@@ -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 { WatchOrderBookRequestArgsInner } from './WatchOrderBookRequestArgsInner';
24
+ import {
25
+ WatchOrderBookRequestArgsInnerFromJSON,
26
+ WatchOrderBookRequestArgsInnerFromJSONTyped,
27
+ WatchOrderBookRequestArgsInnerToJSON,
28
+ WatchOrderBookRequestArgsInnerToJSONTyped,
29
+ } from './WatchOrderBookRequestArgsInner';
30
+
31
+ /**
32
+ *
33
+ * @export
34
+ * @interface WatchTradesRequest
35
+ */
36
+ export interface WatchTradesRequest {
37
+ /**
38
+ * [outcomeId, since?, limit?]
39
+ * @type {Array<WatchOrderBookRequestArgsInner>}
40
+ * @memberof WatchTradesRequest
41
+ */
42
+ args: Array<WatchOrderBookRequestArgsInner>;
43
+ /**
44
+ *
45
+ * @type {ExchangeCredentials}
46
+ * @memberof WatchTradesRequest
47
+ */
48
+ credentials?: ExchangeCredentials;
49
+ }
50
+
51
+ /**
52
+ * Check if a given object implements the WatchTradesRequest interface.
53
+ */
54
+ export function instanceOfWatchTradesRequest(value: object): value is WatchTradesRequest {
55
+ if (!('args' in value) || value['args'] === undefined) return false;
56
+ return true;
57
+ }
58
+
59
+ export function WatchTradesRequestFromJSON(json: any): WatchTradesRequest {
60
+ return WatchTradesRequestFromJSONTyped(json, false);
61
+ }
62
+
63
+ export function WatchTradesRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): WatchTradesRequest {
64
+ if (json == null) {
65
+ return json;
66
+ }
67
+ return {
68
+
69
+ 'args': ((json['args'] as Array<any>).map(WatchOrderBookRequestArgsInnerFromJSON)),
70
+ 'credentials': json['credentials'] == null ? undefined : ExchangeCredentialsFromJSON(json['credentials']),
71
+ };
72
+ }
73
+
74
+ export function WatchTradesRequestToJSON(json: any): WatchTradesRequest {
75
+ return WatchTradesRequestToJSONTyped(json, false);
76
+ }
77
+
78
+ export function WatchTradesRequestToJSONTyped(value?: WatchTradesRequest | 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(WatchOrderBookRequestArgsInnerToJSON)),
86
+ 'credentials': ExchangeCredentialsToJSON(value['credentials']),
87
+ };
88
+ }
89
+
@@ -38,3 +38,6 @@ export * from './SearchMarketsRequest';
38
38
  export * from './SearchMarketsRequestArgsInner';
39
39
  export * from './Trade';
40
40
  export * from './UnifiedMarket';
41
+ export * from './WatchOrderBookRequest';
42
+ export * from './WatchOrderBookRequestArgsInner';
43
+ export * from './WatchTradesRequest';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmxtjs",
3
- "version": "1.0.4",
3
+ "version": "1.1.0",
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.0.4"
45
+ "pmxt-core": "1.1.0"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/jest": "^30.0.0",