pmxtjs 2.49.0 → 2.49.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 (57) hide show
  1. package/README.md +72 -10
  2. package/dist/esm/generated/src/models/Balance.d.ts +6 -0
  3. package/dist/esm/generated/src/models/Balance.js +2 -0
  4. package/dist/esm/generated/src/models/BuiltOrder.d.ts +6 -0
  5. package/dist/esm/generated/src/models/BuiltOrder.js +2 -0
  6. package/dist/esm/generated/src/models/ErrorDetail.d.ts +58 -2
  7. package/dist/esm/generated/src/models/ErrorDetail.js +37 -0
  8. package/dist/esm/generated/src/models/ExchangeOptions.d.ts +70 -0
  9. package/dist/esm/generated/src/models/ExchangeOptions.js +53 -0
  10. package/dist/esm/generated/src/models/MatchedMarketPair.d.ts +1 -1
  11. package/dist/esm/generated/src/models/Order.d.ts +18 -0
  12. package/dist/esm/generated/src/models/Order.js +6 -0
  13. package/dist/esm/generated/src/models/Position.d.ts +33 -9
  14. package/dist/esm/generated/src/models/Position.js +12 -12
  15. package/dist/esm/generated/src/models/UnifiedSeries.d.ts +4 -4
  16. package/dist/esm/generated/src/models/UserTrade.d.ts +18 -0
  17. package/dist/esm/generated/src/models/UserTrade.js +6 -0
  18. package/dist/esm/generated/src/models/index.d.ts +1 -0
  19. package/dist/esm/generated/src/models/index.js +1 -0
  20. package/dist/generated/src/models/Balance.d.ts +6 -0
  21. package/dist/generated/src/models/Balance.js +2 -0
  22. package/dist/generated/src/models/BuiltOrder.d.ts +6 -0
  23. package/dist/generated/src/models/BuiltOrder.js +2 -0
  24. package/dist/generated/src/models/ErrorDetail.d.ts +58 -2
  25. package/dist/generated/src/models/ErrorDetail.js +38 -0
  26. package/dist/generated/src/models/ExchangeOptions.d.ts +70 -0
  27. package/dist/generated/src/models/ExchangeOptions.js +60 -0
  28. package/dist/generated/src/models/MatchedMarketPair.d.ts +1 -1
  29. package/dist/generated/src/models/Order.d.ts +18 -0
  30. package/dist/generated/src/models/Order.js +6 -0
  31. package/dist/generated/src/models/Position.d.ts +33 -9
  32. package/dist/generated/src/models/Position.js +12 -12
  33. package/dist/generated/src/models/UnifiedSeries.d.ts +4 -4
  34. package/dist/generated/src/models/UserTrade.d.ts +18 -0
  35. package/dist/generated/src/models/UserTrade.js +6 -0
  36. package/dist/generated/src/models/index.d.ts +1 -0
  37. package/dist/generated/src/models/index.js +1 -0
  38. package/generated/.openapi-generator/FILES +2 -0
  39. package/generated/docs/Balance.md +2 -0
  40. package/generated/docs/BuiltOrder.md +2 -0
  41. package/generated/docs/ErrorDetail.md +9 -0
  42. package/generated/docs/ExchangeOptions.md +47 -0
  43. package/generated/docs/Order.md +6 -0
  44. package/generated/docs/Position.md +9 -0
  45. package/generated/docs/UserTrade.md +6 -0
  46. package/generated/package.json +1 -1
  47. package/generated/src/models/Balance.ts +8 -0
  48. package/generated/src/models/BuiltOrder.ts +8 -0
  49. package/generated/src/models/ErrorDetail.ts +67 -2
  50. package/generated/src/models/ExchangeOptions.ts +115 -0
  51. package/generated/src/models/MatchedMarketPair.ts +1 -1
  52. package/generated/src/models/Order.ts +24 -0
  53. package/generated/src/models/Position.ts +45 -17
  54. package/generated/src/models/UnifiedSeries.ts +4 -4
  55. package/generated/src/models/UserTrade.ts +24 -0
  56. package/generated/src/models/index.ts +1 -0
  57. package/package.json +2 -2
@@ -57,6 +57,24 @@ export interface UserTrade {
57
57
  * @memberof UserTrade
58
58
  */
59
59
  orderId?: string;
60
+ /**
61
+ * Populated in hosted mode after on-chain settlement; null for local-mode and for non-on-chain venues.
62
+ * @type {string}
63
+ * @memberof UserTrade
64
+ */
65
+ txHash?: string | null;
66
+ /**
67
+ * Populated in hosted mode after on-chain settlement; null for local-mode and for non-on-chain venues.
68
+ * @type {string}
69
+ * @memberof UserTrade
70
+ */
71
+ chain?: string | null;
72
+ /**
73
+ * Populated in hosted mode after on-chain settlement; null for local-mode and for non-on-chain venues.
74
+ * @type {number}
75
+ * @memberof UserTrade
76
+ */
77
+ blockNumber?: number | null;
60
78
  }
61
79
  /**
62
80
  * @export
@@ -50,6 +50,9 @@ export function UserTradeFromJSONTyped(json, ignoreDiscriminator) {
50
50
  'side': json['side'],
51
51
  'outcomeId': json['outcomeId'] == null ? undefined : json['outcomeId'],
52
52
  'orderId': json['orderId'] == null ? undefined : json['orderId'],
53
+ 'txHash': json['txHash'] == null ? undefined : json['txHash'],
54
+ 'chain': json['chain'] == null ? undefined : json['chain'],
55
+ 'blockNumber': json['blockNumber'] == null ? undefined : json['blockNumber'],
53
56
  };
54
57
  }
55
58
  export function UserTradeToJSON(json) {
@@ -67,5 +70,8 @@ export function UserTradeToJSONTyped(value, ignoreDiscriminator = false) {
67
70
  'side': value['side'],
68
71
  'outcomeId': value['outcomeId'],
69
72
  'orderId': value['orderId'],
73
+ 'txHash': value['txHash'],
74
+ 'chain': value['chain'],
75
+ 'blockNumber': value['blockNumber'],
70
76
  };
71
77
  }
@@ -21,6 +21,7 @@ export * from './EventFilterCriteriaTotalVolume.js';
21
21
  export * from './EventMatchResult.js';
22
22
  export * from './ExchangeCredentials.js';
23
23
  export * from './ExchangeCredentialsSignatureType.js';
24
+ export * from './ExchangeOptions.js';
24
25
  export * from './ExecutionPriceResult.js';
25
26
  export * from './FeedFetchHistoricalPrices200Response.js';
26
27
  export * from './FeedFetchOHLCV200Response.js';
@@ -23,6 +23,7 @@ export * from './EventFilterCriteriaTotalVolume.js';
23
23
  export * from './EventMatchResult.js';
24
24
  export * from './ExchangeCredentials.js';
25
25
  export * from './ExchangeCredentialsSignatureType.js';
26
+ export * from './ExchangeOptions.js';
26
27
  export * from './ExecutionPriceResult.js';
27
28
  export * from './FeedFetchHistoricalPrices200Response.js';
28
29
  export * from './FeedFetchOHLCV200Response.js';
@@ -39,6 +39,12 @@ export interface Balance {
39
39
  * @memberof Balance
40
40
  */
41
41
  locked: number;
42
+ /**
43
+ * Hosted-mode: which venue this balance belongs to in a multi-venue response. Null when the balance is venue-agnostic.
44
+ * @type {string}
45
+ * @memberof Balance
46
+ */
47
+ venue?: string | null;
42
48
  }
43
49
  /**
44
50
  * Check if a given object implements the Balance interface.
@@ -44,6 +44,7 @@ function BalanceFromJSONTyped(json, ignoreDiscriminator) {
44
44
  'total': json['total'],
45
45
  'available': json['available'],
46
46
  'locked': json['locked'],
47
+ 'venue': json['venue'] == null ? undefined : json['venue'],
47
48
  };
48
49
  }
49
50
  function BalanceToJSON(json) {
@@ -58,5 +59,6 @@ function BalanceToJSONTyped(value, ignoreDiscriminator = false) {
58
59
  'total': value['total'],
59
60
  'available': value['available'],
60
61
  'locked': value['locked'],
62
+ 'venue': value['venue'],
61
63
  };
62
64
  }
@@ -49,6 +49,12 @@ export interface BuiltOrder {
49
49
  * @memberof BuiltOrder
50
50
  */
51
51
  raw: any | null;
52
+ /**
53
+ * Unix epoch (ms) when this built order expires server-side. Submitting after expiry returns BUILT_ORDER_EXPIRED.
54
+ * @type {number}
55
+ * @memberof BuiltOrder
56
+ */
57
+ expiry?: number | null;
52
58
  }
53
59
  /**
54
60
  * Check if a given object implements the BuiltOrder interface.
@@ -45,6 +45,7 @@ function BuiltOrderFromJSONTyped(json, ignoreDiscriminator) {
45
45
  'signedOrder': json['signedOrder'] == null ? undefined : json['signedOrder'],
46
46
  'tx': json['tx'] == null ? undefined : (0, BuiltOrderTx_1.BuiltOrderTxFromJSON)(json['tx']),
47
47
  'raw': json['raw'],
48
+ 'expiry': json['expiry'] == null ? undefined : json['expiry'],
48
49
  };
49
50
  }
50
51
  function BuiltOrderToJSON(json) {
@@ -60,5 +61,6 @@ function BuiltOrderToJSONTyped(value, ignoreDiscriminator = false) {
60
61
  'signedOrder': value['signedOrder'],
61
62
  'tx': (0, BuiltOrderTx_1.BuiltOrderTxToJSON)(value['tx']),
62
63
  'raw': value['raw'],
64
+ 'expiry': value['expiry'],
63
65
  };
64
66
  }
@@ -10,18 +10,74 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  /**
13
- *
13
+ * Structured error envelope returned inside `BaseResponse.error` and `ErrorResponse.error`. Hosted-mode endpoints populate `code`, `retryable`, and optionally `exchange` / `detail`; legacy local-mode endpoints may still return only `message`.
14
14
  * @export
15
15
  * @interface ErrorDetail
16
16
  */
17
17
  export interface ErrorDetail {
18
18
  /**
19
- *
19
+ * Human-readable error message.
20
20
  * @type {string}
21
21
  * @memberof ErrorDetail
22
22
  */
23
23
  message?: string;
24
+ /**
25
+ * Stable machine-readable error code. Hosted-mode errors use the `HostedTradingError` family (e.g. `INSUFFICIENT_ESCROW_BALANCE`, `BUILT_ORDER_EXPIRED`); pre-hosted local errors use the legacy family (e.g. `BAD_REQUEST`, `NOT_FOUND`).
26
+ * @type {string}
27
+ * @memberof ErrorDetail
28
+ */
29
+ code?: ErrorDetailCodeEnum;
30
+ /**
31
+ * Hint for clients: when `true`, the same request may succeed on retry (e.g. transient network or rate-limit conditions); when `false`, the caller should not retry without modifying the request.
32
+ * @type {boolean}
33
+ * @memberof ErrorDetail
34
+ */
35
+ retryable?: boolean;
36
+ /**
37
+ * Venue the error originated from, when known (e.g. 'polymarket', 'kalshi').
38
+ * @type {string}
39
+ * @memberof ErrorDetail
40
+ */
41
+ exchange?: string | null;
42
+ /**
43
+ * Free-form hosted-mode detail blob. Shape depends on `code` — e.g. for `INSUFFICIENT_ESCROW_BALANCE` it may include `{ requested, available }`; for `ORDER_SIZE_TOO_SMALL` it may include `{ min }`; for `BUILT_ORDER_EXPIRED` it may include `{ expiry }`.
44
+ * @type {{ [key: string]: any; }}
45
+ * @memberof ErrorDetail
46
+ */
47
+ detail?: {
48
+ [key: string]: any;
49
+ } | null;
24
50
  }
51
+ /**
52
+ * @export
53
+ */
54
+ export declare const ErrorDetailCodeEnum: {
55
+ readonly HostedTradingError: "HOSTED_TRADING_ERROR";
56
+ readonly InsufficientEscrowBalance: "INSUFFICIENT_ESCROW_BALANCE";
57
+ readonly OrderSizeTooSmall: "ORDER_SIZE_TOO_SMALL";
58
+ readonly InvalidApiKey: "INVALID_API_KEY";
59
+ readonly OutcomeNotFound: "OUTCOME_NOT_FOUND";
60
+ readonly CatalogUnavailable: "CATALOG_UNAVAILABLE";
61
+ readonly BuiltOrderExpired: "BUILT_ORDER_EXPIRED";
62
+ readonly InvalidSignature: "INVALID_SIGNATURE";
63
+ readonly NoLiquidity: "NO_LIQUIDITY";
64
+ readonly MissingWalletAddress: "MISSING_WALLET_ADDRESS";
65
+ readonly BadRequest: "BAD_REQUEST";
66
+ readonly AuthenticationError: "AUTHENTICATION_ERROR";
67
+ readonly PermissionDenied: "PERMISSION_DENIED";
68
+ readonly NotFound: "NOT_FOUND";
69
+ readonly OrderNotFound: "ORDER_NOT_FOUND";
70
+ readonly MarketNotFound: "MARKET_NOT_FOUND";
71
+ readonly EventNotFound: "EVENT_NOT_FOUND";
72
+ readonly RateLimitExceeded: "RATE_LIMIT_EXCEEDED";
73
+ readonly InvalidOrder: "INVALID_ORDER";
74
+ readonly InsufficientFunds: "INSUFFICIENT_FUNDS";
75
+ readonly ValidationError: "VALIDATION_ERROR";
76
+ readonly NetworkError: "NETWORK_ERROR";
77
+ readonly ExchangeNotAvailable: "EXCHANGE_NOT_AVAILABLE";
78
+ readonly NotSupported: "NOT_SUPPORTED";
79
+ };
80
+ export type ErrorDetailCodeEnum = typeof ErrorDetailCodeEnum[keyof typeof ErrorDetailCodeEnum];
25
81
  /**
26
82
  * Check if a given object implements the ErrorDetail interface.
27
83
  */
@@ -13,11 +13,41 @@
13
13
  * Do not edit the class manually.
14
14
  */
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.ErrorDetailCodeEnum = void 0;
16
17
  exports.instanceOfErrorDetail = instanceOfErrorDetail;
17
18
  exports.ErrorDetailFromJSON = ErrorDetailFromJSON;
18
19
  exports.ErrorDetailFromJSONTyped = ErrorDetailFromJSONTyped;
19
20
  exports.ErrorDetailToJSON = ErrorDetailToJSON;
20
21
  exports.ErrorDetailToJSONTyped = ErrorDetailToJSONTyped;
22
+ /**
23
+ * @export
24
+ */
25
+ exports.ErrorDetailCodeEnum = {
26
+ HostedTradingError: 'HOSTED_TRADING_ERROR',
27
+ InsufficientEscrowBalance: 'INSUFFICIENT_ESCROW_BALANCE',
28
+ OrderSizeTooSmall: 'ORDER_SIZE_TOO_SMALL',
29
+ InvalidApiKey: 'INVALID_API_KEY',
30
+ OutcomeNotFound: 'OUTCOME_NOT_FOUND',
31
+ CatalogUnavailable: 'CATALOG_UNAVAILABLE',
32
+ BuiltOrderExpired: 'BUILT_ORDER_EXPIRED',
33
+ InvalidSignature: 'INVALID_SIGNATURE',
34
+ NoLiquidity: 'NO_LIQUIDITY',
35
+ MissingWalletAddress: 'MISSING_WALLET_ADDRESS',
36
+ BadRequest: 'BAD_REQUEST',
37
+ AuthenticationError: 'AUTHENTICATION_ERROR',
38
+ PermissionDenied: 'PERMISSION_DENIED',
39
+ NotFound: 'NOT_FOUND',
40
+ OrderNotFound: 'ORDER_NOT_FOUND',
41
+ MarketNotFound: 'MARKET_NOT_FOUND',
42
+ EventNotFound: 'EVENT_NOT_FOUND',
43
+ RateLimitExceeded: 'RATE_LIMIT_EXCEEDED',
44
+ InvalidOrder: 'INVALID_ORDER',
45
+ InsufficientFunds: 'INSUFFICIENT_FUNDS',
46
+ ValidationError: 'VALIDATION_ERROR',
47
+ NetworkError: 'NETWORK_ERROR',
48
+ ExchangeNotAvailable: 'EXCHANGE_NOT_AVAILABLE',
49
+ NotSupported: 'NOT_SUPPORTED'
50
+ };
21
51
  /**
22
52
  * Check if a given object implements the ErrorDetail interface.
23
53
  */
@@ -33,6 +63,10 @@ function ErrorDetailFromJSONTyped(json, ignoreDiscriminator) {
33
63
  }
34
64
  return {
35
65
  'message': json['message'] == null ? undefined : json['message'],
66
+ 'code': json['code'] == null ? undefined : json['code'],
67
+ 'retryable': json['retryable'] == null ? undefined : json['retryable'],
68
+ 'exchange': json['exchange'] == null ? undefined : json['exchange'],
69
+ 'detail': json['detail'] == null ? undefined : json['detail'],
36
70
  };
37
71
  }
38
72
  function ErrorDetailToJSON(json) {
@@ -44,5 +78,9 @@ function ErrorDetailToJSONTyped(value, ignoreDiscriminator = false) {
44
78
  }
45
79
  return {
46
80
  'message': value['message'],
81
+ 'code': value['code'],
82
+ 'retryable': value['retryable'],
83
+ 'exchange': value['exchange'],
84
+ 'detail': value['detail'],
47
85
  };
48
86
  }
@@ -0,0 +1,70 @@
1
+ /**
2
+ * PMXT Sidecar API
3
+ * A unified local sidecar API for prediction markets (Polymarket, Kalshi, Limitless). This API acts as a JSON-RPC-style gateway. Each endpoint corresponds to a specific method on the generic exchange implementation.
4
+ *
5
+ * The version of the OpenAPI document: 0.4.4
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ * Constructor-level options for venue clients (Polymarket, Kalshi, Opinion, etc.).
14
+ * Hosted mode is the default when pmxtApiKey is set; otherwise the SDK runs against
15
+ * a local sidecar with venue credentials.
16
+ * @export
17
+ * @interface ExchangeOptions
18
+ */
19
+ export interface ExchangeOptions {
20
+ /**
21
+ * PMXT customer API key. When set, the SDK routes to api.pmxt.dev (catalog) and trade.pmxt.dev (trading). Get one at pmxt.dev/dashboard.
22
+ * @type {string}
23
+ * @memberof ExchangeOptions
24
+ */
25
+ pmxtApiKey?: string;
26
+ /**
27
+ * EVM wallet address for hosted reads/writes. Required for endpoints that operate on a wallet (balances, positions, trades, open orders).
28
+ * @type {string}
29
+ * @memberof ExchangeOptions
30
+ */
31
+ walletAddress?: string | null;
32
+ /**
33
+ * Optional pre-built signer for hosted writes. If absent and privateKey is set, the SDK auto-wraps privateKey into a signer.
34
+ * @type {object}
35
+ * @memberof ExchangeOptions
36
+ */
37
+ signer?: object | null;
38
+ /**
39
+ * Private key. In hosted mode, used to derive an EIP-712 signer for writes (wraps into EthAccountSigner/EthersSigner). In self-hosted mode, used as the venue credential directly.
40
+ * @type {string}
41
+ * @memberof ExchangeOptions
42
+ */
43
+ privateKey?: string | null;
44
+ /**
45
+ * Explicit base URL override. When unset, the SDK uses api.pmxt.dev when pmxtApiKey is set, or the local sidecar otherwise.
46
+ * @type {string}
47
+ * @memberof ExchangeOptions
48
+ */
49
+ baseUrl?: string | null;
50
+ /**
51
+ * Venue-side API key (e.g. Polymarket CLOB key). Only relevant for self-hosted mode.
52
+ * @type {string}
53
+ * @memberof ExchangeOptions
54
+ */
55
+ apiKey?: string | null;
56
+ /**
57
+ * Auto-start the local sidecar when running self-hosted. Defaults to true when no pmxtApiKey is set, false when hosted.
58
+ * @type {boolean}
59
+ * @memberof ExchangeOptions
60
+ */
61
+ autoStartServer?: boolean | null;
62
+ }
63
+ /**
64
+ * Check if a given object implements the ExchangeOptions interface.
65
+ */
66
+ export declare function instanceOfExchangeOptions(value: object): value is ExchangeOptions;
67
+ export declare function ExchangeOptionsFromJSON(json: any): ExchangeOptions;
68
+ export declare function ExchangeOptionsFromJSONTyped(json: any, ignoreDiscriminator: boolean): ExchangeOptions;
69
+ export declare function ExchangeOptionsToJSON(json: any): ExchangeOptions;
70
+ export declare function ExchangeOptionsToJSONTyped(value?: ExchangeOptions | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * PMXT Sidecar API
6
+ * A unified local sidecar API for prediction markets (Polymarket, Kalshi, Limitless). This API acts as a JSON-RPC-style gateway. Each endpoint corresponds to a specific method on the generic exchange implementation.
7
+ *
8
+ * The version of the OpenAPI document: 0.4.4
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.instanceOfExchangeOptions = instanceOfExchangeOptions;
17
+ exports.ExchangeOptionsFromJSON = ExchangeOptionsFromJSON;
18
+ exports.ExchangeOptionsFromJSONTyped = ExchangeOptionsFromJSONTyped;
19
+ exports.ExchangeOptionsToJSON = ExchangeOptionsToJSON;
20
+ exports.ExchangeOptionsToJSONTyped = ExchangeOptionsToJSONTyped;
21
+ /**
22
+ * Check if a given object implements the ExchangeOptions interface.
23
+ */
24
+ function instanceOfExchangeOptions(value) {
25
+ return true;
26
+ }
27
+ function ExchangeOptionsFromJSON(json) {
28
+ return ExchangeOptionsFromJSONTyped(json, false);
29
+ }
30
+ function ExchangeOptionsFromJSONTyped(json, ignoreDiscriminator) {
31
+ if (json == null) {
32
+ return json;
33
+ }
34
+ return {
35
+ 'pmxtApiKey': json['pmxtApiKey'] == null ? undefined : json['pmxtApiKey'],
36
+ 'walletAddress': json['walletAddress'] == null ? undefined : json['walletAddress'],
37
+ 'signer': json['signer'] == null ? undefined : json['signer'],
38
+ 'privateKey': json['privateKey'] == null ? undefined : json['privateKey'],
39
+ 'baseUrl': json['baseUrl'] == null ? undefined : json['baseUrl'],
40
+ 'apiKey': json['apiKey'] == null ? undefined : json['apiKey'],
41
+ 'autoStartServer': json['autoStartServer'] == null ? undefined : json['autoStartServer'],
42
+ };
43
+ }
44
+ function ExchangeOptionsToJSON(json) {
45
+ return ExchangeOptionsToJSONTyped(json, false);
46
+ }
47
+ function ExchangeOptionsToJSONTyped(value, ignoreDiscriminator = false) {
48
+ if (value == null) {
49
+ return value;
50
+ }
51
+ return {
52
+ 'pmxtApiKey': value['pmxtApiKey'],
53
+ 'walletAddress': value['walletAddress'],
54
+ 'signer': value['signer'],
55
+ 'privateKey': value['privateKey'],
56
+ 'baseUrl': value['baseUrl'],
57
+ 'apiKey': value['apiKey'],
58
+ 'autoStartServer': value['autoStartServer'],
59
+ };
60
+ }
@@ -71,7 +71,7 @@ export interface MatchedMarketPair {
71
71
  */
72
72
  confidence?: number;
73
73
  /**
74
- *
74
+ * Why the two markets were matched.
75
75
  * @type {string}
76
76
  * @memberof MatchedMarketPair
77
77
  */
@@ -99,6 +99,24 @@ export interface Order {
99
99
  * @memberof Order
100
100
  */
101
101
  feeRateBps?: number;
102
+ /**
103
+ * Populated in hosted mode after on-chain settlement; null for local-mode and for non-on-chain venues.
104
+ * @type {string}
105
+ * @memberof Order
106
+ */
107
+ txHash?: string | null;
108
+ /**
109
+ * Populated in hosted mode after on-chain settlement; null for local-mode and for non-on-chain venues.
110
+ * @type {string}
111
+ * @memberof Order
112
+ */
113
+ chain?: string | null;
114
+ /**
115
+ * Populated in hosted mode after on-chain settlement; null for local-mode and for non-on-chain venues.
116
+ * @type {number}
117
+ * @memberof Order
118
+ */
119
+ blockNumber?: number | null;
102
120
  }
103
121
  /**
104
122
  * @export
@@ -91,6 +91,9 @@ function OrderFromJSONTyped(json, ignoreDiscriminator) {
91
91
  'timestamp': json['timestamp'],
92
92
  'fee': json['fee'] == null ? undefined : json['fee'],
93
93
  'feeRateBps': json['feeRateBps'] == null ? undefined : json['feeRateBps'],
94
+ 'txHash': json['txHash'] == null ? undefined : json['txHash'],
95
+ 'chain': json['chain'] == null ? undefined : json['chain'],
96
+ 'blockNumber': json['blockNumber'] == null ? undefined : json['blockNumber'],
94
97
  };
95
98
  }
96
99
  function OrderToJSON(json) {
@@ -115,5 +118,8 @@ function OrderToJSONTyped(value, ignoreDiscriminator = false) {
115
118
  'timestamp': value['timestamp'],
116
119
  'fee': value['fee'],
117
120
  'feeRateBps': value['feeRateBps'],
121
+ 'txHash': value['txHash'],
122
+ 'chain': value['chain'],
123
+ 'blockNumber': value['blockNumber'],
118
124
  };
119
125
  }
@@ -10,7 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  /**
13
- *
13
+ * A current position in a market. In hosted mode, `outcomeLabel`, `entryPrice`, `currentPrice` and `unrealizedPnL` may be null when the server cannot derive them (e.g. `with_mtm=false` or no fill history). Venue-direct callers continue to populate every field.
14
14
  * @export
15
15
  * @interface Position
16
16
  */
@@ -28,11 +28,11 @@ export interface Position {
28
28
  */
29
29
  outcomeId: string;
30
30
  /**
31
- * Human-readable label for the outcome held.
31
+ * Human-readable label for the outcome held. Optional in hosted mode.
32
32
  * @type {string}
33
33
  * @memberof Position
34
34
  */
35
- outcomeLabel: string;
35
+ outcomeLabel?: string | null;
36
36
  /**
37
37
  * Positive for long, negative for short
38
38
  * @type {number}
@@ -40,29 +40,53 @@ export interface Position {
40
40
  */
41
41
  size: number;
42
42
  /**
43
- * Average entry price for the position (probability between 0.0 and 1.0).
43
+ * Average entry price for the position (probability between 0.0 and 1.0). Optional in hosted mode when no fill history is available.
44
+ * @type {number}
45
+ * @memberof Position
46
+ */
47
+ entryPrice?: number | null;
48
+ /**
49
+ * Current mark price for the position (probability between 0.0 and 1.0). Optional in hosted mode when mark-to-market data is unavailable.
44
50
  * @type {number}
45
51
  * @memberof Position
46
52
  */
47
- entryPrice: number;
53
+ currentPrice?: number | null;
48
54
  /**
49
- * Current mark price for the position (probability between 0.0 and 1.0).
55
+ * Current market value of the position (size * currentPrice). Null when currentPrice is unavailable.
50
56
  * @type {number}
51
57
  * @memberof Position
52
58
  */
53
- currentPrice: number;
59
+ currentValue?: number | null;
54
60
  /**
55
- * Unrealized profit or loss at the current price (USD).
61
+ * Unrealized profit or loss at the current price (USD). Optional in hosted mode when mark-to-market data is unavailable.
56
62
  * @type {number}
57
63
  * @memberof Position
58
64
  */
59
- unrealizedPnL: number;
65
+ unrealizedPnL?: number | null;
60
66
  /**
61
67
  * Realized profit or loss booked so far (USD).
62
68
  * @type {number}
63
69
  * @memberof Position
64
70
  */
65
71
  realizedPnL?: number;
72
+ /**
73
+ * Populated in hosted mode after on-chain settlement (from the last fill); null for local-mode and for non-on-chain venues.
74
+ * @type {string}
75
+ * @memberof Position
76
+ */
77
+ txHash?: string | null;
78
+ /**
79
+ * Populated in hosted mode after on-chain settlement (from the last fill); null for local-mode and for non-on-chain venues.
80
+ * @type {string}
81
+ * @memberof Position
82
+ */
83
+ chain?: string | null;
84
+ /**
85
+ * Populated in hosted mode after on-chain settlement (from the last fill); null for local-mode and for non-on-chain venues.
86
+ * @type {number}
87
+ * @memberof Position
88
+ */
89
+ blockNumber?: number | null;
66
90
  }
67
91
  /**
68
92
  * Check if a given object implements the Position interface.
@@ -26,16 +26,8 @@ function instanceOfPosition(value) {
26
26
  return false;
27
27
  if (!('outcomeId' in value) || value['outcomeId'] === undefined)
28
28
  return false;
29
- if (!('outcomeLabel' in value) || value['outcomeLabel'] === undefined)
30
- return false;
31
29
  if (!('size' in value) || value['size'] === undefined)
32
30
  return false;
33
- if (!('entryPrice' in value) || value['entryPrice'] === undefined)
34
- return false;
35
- if (!('currentPrice' in value) || value['currentPrice'] === undefined)
36
- return false;
37
- if (!('unrealizedPnL' in value) || value['unrealizedPnL'] === undefined)
38
- return false;
39
31
  return true;
40
32
  }
41
33
  function PositionFromJSON(json) {
@@ -48,12 +40,16 @@ function PositionFromJSONTyped(json, ignoreDiscriminator) {
48
40
  return {
49
41
  'marketId': json['marketId'],
50
42
  'outcomeId': json['outcomeId'],
51
- 'outcomeLabel': json['outcomeLabel'],
43
+ 'outcomeLabel': json['outcomeLabel'] == null ? undefined : json['outcomeLabel'],
52
44
  'size': json['size'],
53
- 'entryPrice': json['entryPrice'],
54
- 'currentPrice': json['currentPrice'],
55
- 'unrealizedPnL': json['unrealizedPnL'],
45
+ 'entryPrice': json['entryPrice'] == null ? undefined : json['entryPrice'],
46
+ 'currentPrice': json['currentPrice'] == null ? undefined : json['currentPrice'],
47
+ 'currentValue': json['currentValue'] == null ? undefined : json['currentValue'],
48
+ 'unrealizedPnL': json['unrealizedPnL'] == null ? undefined : json['unrealizedPnL'],
56
49
  'realizedPnL': json['realizedPnL'] == null ? undefined : json['realizedPnL'],
50
+ 'txHash': json['txHash'] == null ? undefined : json['txHash'],
51
+ 'chain': json['chain'] == null ? undefined : json['chain'],
52
+ 'blockNumber': json['blockNumber'] == null ? undefined : json['blockNumber'],
57
53
  };
58
54
  }
59
55
  function PositionToJSON(json) {
@@ -70,7 +66,11 @@ function PositionToJSONTyped(value, ignoreDiscriminator = false) {
70
66
  'size': value['size'],
71
67
  'entryPrice': value['entryPrice'],
72
68
  'currentPrice': value['currentPrice'],
69
+ 'currentValue': value['currentValue'],
73
70
  'unrealizedPnL': value['unrealizedPnL'],
74
71
  'realizedPnL': value['realizedPnL'],
72
+ 'txHash': value['txHash'],
73
+ 'chain': value['chain'],
74
+ 'blockNumber': value['blockNumber'],
75
75
  };
76
76
  }
@@ -41,13 +41,13 @@ export interface UnifiedSeries {
41
41
  */
42
42
  title: string;
43
43
  /**
44
- *
44
+ * Long-form series description.
45
45
  * @type {string}
46
46
  * @memberof UnifiedSeries
47
47
  */
48
48
  description?: string | null;
49
49
  /**
50
- *
50
+ * Recurrence cadence the venue reports ('daily', 'weekly', 'annual', ...).
51
51
  * @type {string}
52
52
  * @memberof UnifiedSeries
53
53
  */
@@ -59,13 +59,13 @@ export interface UnifiedSeries {
59
59
  */
60
60
  events?: Array<UnifiedEvent>;
61
61
  /**
62
- *
62
+ * Canonical venue URL for the series.
63
63
  * @type {string}
64
64
  * @memberof UnifiedSeries
65
65
  */
66
66
  url?: string | null;
67
67
  /**
68
- *
68
+ * Venue-hosted image.
69
69
  * @type {string}
70
70
  * @memberof UnifiedSeries
71
71
  */
@@ -57,6 +57,24 @@ export interface UserTrade {
57
57
  * @memberof UserTrade
58
58
  */
59
59
  orderId?: string;
60
+ /**
61
+ * Populated in hosted mode after on-chain settlement; null for local-mode and for non-on-chain venues.
62
+ * @type {string}
63
+ * @memberof UserTrade
64
+ */
65
+ txHash?: string | null;
66
+ /**
67
+ * Populated in hosted mode after on-chain settlement; null for local-mode and for non-on-chain venues.
68
+ * @type {string}
69
+ * @memberof UserTrade
70
+ */
71
+ chain?: string | null;
72
+ /**
73
+ * Populated in hosted mode after on-chain settlement; null for local-mode and for non-on-chain venues.
74
+ * @type {number}
75
+ * @memberof UserTrade
76
+ */
77
+ blockNumber?: number | null;
60
78
  }
61
79
  /**
62
80
  * @export
@@ -58,6 +58,9 @@ function UserTradeFromJSONTyped(json, ignoreDiscriminator) {
58
58
  'side': json['side'],
59
59
  'outcomeId': json['outcomeId'] == null ? undefined : json['outcomeId'],
60
60
  'orderId': json['orderId'] == null ? undefined : json['orderId'],
61
+ 'txHash': json['txHash'] == null ? undefined : json['txHash'],
62
+ 'chain': json['chain'] == null ? undefined : json['chain'],
63
+ 'blockNumber': json['blockNumber'] == null ? undefined : json['blockNumber'],
61
64
  };
62
65
  }
63
66
  function UserTradeToJSON(json) {
@@ -75,5 +78,8 @@ function UserTradeToJSONTyped(value, ignoreDiscriminator = false) {
75
78
  'side': value['side'],
76
79
  'outcomeId': value['outcomeId'],
77
80
  'orderId': value['orderId'],
81
+ 'txHash': value['txHash'],
82
+ 'chain': value['chain'],
83
+ 'blockNumber': value['blockNumber'],
78
84
  };
79
85
  }