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.
- package/README.md +72 -10
- package/dist/esm/generated/src/models/Balance.d.ts +6 -0
- package/dist/esm/generated/src/models/Balance.js +2 -0
- package/dist/esm/generated/src/models/BuiltOrder.d.ts +6 -0
- package/dist/esm/generated/src/models/BuiltOrder.js +2 -0
- package/dist/esm/generated/src/models/ErrorDetail.d.ts +58 -2
- package/dist/esm/generated/src/models/ErrorDetail.js +37 -0
- package/dist/esm/generated/src/models/ExchangeOptions.d.ts +70 -0
- package/dist/esm/generated/src/models/ExchangeOptions.js +53 -0
- package/dist/esm/generated/src/models/MatchedMarketPair.d.ts +1 -1
- package/dist/esm/generated/src/models/Order.d.ts +18 -0
- package/dist/esm/generated/src/models/Order.js +6 -0
- package/dist/esm/generated/src/models/Position.d.ts +33 -9
- package/dist/esm/generated/src/models/Position.js +12 -12
- package/dist/esm/generated/src/models/UnifiedSeries.d.ts +4 -4
- package/dist/esm/generated/src/models/UserTrade.d.ts +18 -0
- package/dist/esm/generated/src/models/UserTrade.js +6 -0
- package/dist/esm/generated/src/models/index.d.ts +1 -0
- package/dist/esm/generated/src/models/index.js +1 -0
- package/dist/generated/src/models/Balance.d.ts +6 -0
- package/dist/generated/src/models/Balance.js +2 -0
- package/dist/generated/src/models/BuiltOrder.d.ts +6 -0
- package/dist/generated/src/models/BuiltOrder.js +2 -0
- package/dist/generated/src/models/ErrorDetail.d.ts +58 -2
- package/dist/generated/src/models/ErrorDetail.js +38 -0
- package/dist/generated/src/models/ExchangeOptions.d.ts +70 -0
- package/dist/generated/src/models/ExchangeOptions.js +60 -0
- package/dist/generated/src/models/MatchedMarketPair.d.ts +1 -1
- package/dist/generated/src/models/Order.d.ts +18 -0
- package/dist/generated/src/models/Order.js +6 -0
- package/dist/generated/src/models/Position.d.ts +33 -9
- package/dist/generated/src/models/Position.js +12 -12
- package/dist/generated/src/models/UnifiedSeries.d.ts +4 -4
- package/dist/generated/src/models/UserTrade.d.ts +18 -0
- package/dist/generated/src/models/UserTrade.js +6 -0
- package/dist/generated/src/models/index.d.ts +1 -0
- package/dist/generated/src/models/index.js +1 -0
- package/generated/.openapi-generator/FILES +2 -0
- package/generated/docs/Balance.md +2 -0
- package/generated/docs/BuiltOrder.md +2 -0
- package/generated/docs/ErrorDetail.md +9 -0
- package/generated/docs/ExchangeOptions.md +47 -0
- package/generated/docs/Order.md +6 -0
- package/generated/docs/Position.md +9 -0
- package/generated/docs/UserTrade.md +6 -0
- package/generated/package.json +1 -1
- package/generated/src/models/Balance.ts +8 -0
- package/generated/src/models/BuiltOrder.ts +8 -0
- package/generated/src/models/ErrorDetail.ts +67 -2
- package/generated/src/models/ExchangeOptions.ts +115 -0
- package/generated/src/models/MatchedMarketPair.ts +1 -1
- package/generated/src/models/Order.ts +24 -0
- package/generated/src/models/Position.ts +45 -17
- package/generated/src/models/UnifiedSeries.ts +4 -4
- package/generated/src/models/UserTrade.ts +24 -0
- package/generated/src/models/index.ts +1 -0
- package/package.json +2 -2
|
@@ -21,6 +21,7 @@ export * from './EventFilterCriteriaTotalVolume';
|
|
|
21
21
|
export * from './EventMatchResult';
|
|
22
22
|
export * from './ExchangeCredentials';
|
|
23
23
|
export * from './ExchangeCredentialsSignatureType';
|
|
24
|
+
export * from './ExchangeOptions';
|
|
24
25
|
export * from './ExecutionPriceResult';
|
|
25
26
|
export * from './FeedFetchHistoricalPrices200Response';
|
|
26
27
|
export * from './FeedFetchOHLCV200Response';
|
|
@@ -39,6 +39,7 @@ __exportStar(require("./EventFilterCriteriaTotalVolume"), exports);
|
|
|
39
39
|
__exportStar(require("./EventMatchResult"), exports);
|
|
40
40
|
__exportStar(require("./ExchangeCredentials"), exports);
|
|
41
41
|
__exportStar(require("./ExchangeCredentialsSignatureType"), exports);
|
|
42
|
+
__exportStar(require("./ExchangeOptions"), exports);
|
|
42
43
|
__exportStar(require("./ExecutionPriceResult"), exports);
|
|
43
44
|
__exportStar(require("./FeedFetchHistoricalPrices200Response"), exports);
|
|
44
45
|
__exportStar(require("./FeedFetchOHLCV200Response"), exports);
|
|
@@ -27,6 +27,7 @@ docs/EventFilterCriteriaTotalVolume.md
|
|
|
27
27
|
docs/EventMatchResult.md
|
|
28
28
|
docs/ExchangeCredentials.md
|
|
29
29
|
docs/ExchangeCredentialsSignatureType.md
|
|
30
|
+
docs/ExchangeOptions.md
|
|
30
31
|
docs/ExecutionPriceResult.md
|
|
31
32
|
docs/FeedFetchHistoricalPrices200Response.md
|
|
32
33
|
docs/FeedFetchOHLCV200Response.md
|
|
@@ -136,6 +137,7 @@ src/models/EventFilterCriteriaTotalVolume.ts
|
|
|
136
137
|
src/models/EventMatchResult.ts
|
|
137
138
|
src/models/ExchangeCredentials.ts
|
|
138
139
|
src/models/ExchangeCredentialsSignatureType.ts
|
|
140
|
+
src/models/ExchangeOptions.ts
|
|
139
141
|
src/models/ExecutionPriceResult.ts
|
|
140
142
|
src/models/FeedFetchHistoricalPrices200Response.ts
|
|
141
143
|
src/models/FeedFetchOHLCV200Response.ts
|
|
@@ -10,6 +10,7 @@ Name | Type
|
|
|
10
10
|
`total` | number
|
|
11
11
|
`available` | number
|
|
12
12
|
`locked` | number
|
|
13
|
+
`venue` | string
|
|
13
14
|
|
|
14
15
|
## Example
|
|
15
16
|
|
|
@@ -22,6 +23,7 @@ const example = {
|
|
|
22
23
|
"total": null,
|
|
23
24
|
"available": null,
|
|
24
25
|
"locked": null,
|
|
26
|
+
"venue": null,
|
|
25
27
|
} satisfies Balance
|
|
26
28
|
|
|
27
29
|
console.log(example)
|
|
@@ -11,6 +11,7 @@ Name | Type
|
|
|
11
11
|
`signedOrder` | { [key: string]: any; }
|
|
12
12
|
`tx` | [BuiltOrderTx](BuiltOrderTx.md)
|
|
13
13
|
`raw` | any
|
|
14
|
+
`expiry` | number
|
|
14
15
|
|
|
15
16
|
## Example
|
|
16
17
|
|
|
@@ -24,6 +25,7 @@ const example = {
|
|
|
24
25
|
"signedOrder": null,
|
|
25
26
|
"tx": null,
|
|
26
27
|
"raw": null,
|
|
28
|
+
"expiry": null,
|
|
27
29
|
} satisfies BuiltOrder
|
|
28
30
|
|
|
29
31
|
console.log(example)
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
|
|
2
2
|
# ErrorDetail
|
|
3
3
|
|
|
4
|
+
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`.
|
|
4
5
|
|
|
5
6
|
## Properties
|
|
6
7
|
|
|
7
8
|
Name | Type
|
|
8
9
|
------------ | -------------
|
|
9
10
|
`message` | string
|
|
11
|
+
`code` | string
|
|
12
|
+
`retryable` | boolean
|
|
13
|
+
`exchange` | string
|
|
14
|
+
`detail` | { [key: string]: any; }
|
|
10
15
|
|
|
11
16
|
## Example
|
|
12
17
|
|
|
@@ -16,6 +21,10 @@ import type { ErrorDetail } from 'pmxtjs'
|
|
|
16
21
|
// TODO: Update the object below with actual values
|
|
17
22
|
const example = {
|
|
18
23
|
"message": null,
|
|
24
|
+
"code": null,
|
|
25
|
+
"retryable": null,
|
|
26
|
+
"exchange": null,
|
|
27
|
+
"detail": null,
|
|
19
28
|
} satisfies ErrorDetail
|
|
20
29
|
|
|
21
30
|
console.log(example)
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
|
|
2
|
+
# ExchangeOptions
|
|
3
|
+
|
|
4
|
+
Constructor-level options for venue clients (Polymarket, Kalshi, Opinion, etc.). Hosted mode is the default when pmxtApiKey is set; otherwise the SDK runs against a local sidecar with venue credentials.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`pmxtApiKey` | string
|
|
11
|
+
`walletAddress` | string
|
|
12
|
+
`signer` | object
|
|
13
|
+
`privateKey` | string
|
|
14
|
+
`baseUrl` | string
|
|
15
|
+
`apiKey` | string
|
|
16
|
+
`autoStartServer` | boolean
|
|
17
|
+
|
|
18
|
+
## Example
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
import type { ExchangeOptions } from 'pmxtjs'
|
|
22
|
+
|
|
23
|
+
// TODO: Update the object below with actual values
|
|
24
|
+
const example = {
|
|
25
|
+
"pmxtApiKey": null,
|
|
26
|
+
"walletAddress": null,
|
|
27
|
+
"signer": null,
|
|
28
|
+
"privateKey": null,
|
|
29
|
+
"baseUrl": null,
|
|
30
|
+
"apiKey": null,
|
|
31
|
+
"autoStartServer": null,
|
|
32
|
+
} satisfies ExchangeOptions
|
|
33
|
+
|
|
34
|
+
console.log(example)
|
|
35
|
+
|
|
36
|
+
// Convert the instance to a JSON string
|
|
37
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
38
|
+
console.log(exampleJSON)
|
|
39
|
+
|
|
40
|
+
// Parse the JSON string back to an object
|
|
41
|
+
const exampleParsed = JSON.parse(exampleJSON) as ExchangeOptions
|
|
42
|
+
console.log(exampleParsed)
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
46
|
+
|
|
47
|
+
|
package/generated/docs/Order.md
CHANGED
|
@@ -20,6 +20,9 @@ Name | Type
|
|
|
20
20
|
`timestamp` | number
|
|
21
21
|
`fee` | number
|
|
22
22
|
`feeRateBps` | number
|
|
23
|
+
`txHash` | string
|
|
24
|
+
`chain` | string
|
|
25
|
+
`blockNumber` | number
|
|
23
26
|
|
|
24
27
|
## Example
|
|
25
28
|
|
|
@@ -42,6 +45,9 @@ const example = {
|
|
|
42
45
|
"timestamp": null,
|
|
43
46
|
"fee": null,
|
|
44
47
|
"feeRateBps": null,
|
|
48
|
+
"txHash": null,
|
|
49
|
+
"chain": null,
|
|
50
|
+
"blockNumber": null,
|
|
45
51
|
} satisfies Order
|
|
46
52
|
|
|
47
53
|
console.log(example)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
# Position
|
|
3
3
|
|
|
4
|
+
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.
|
|
4
5
|
|
|
5
6
|
## Properties
|
|
6
7
|
|
|
@@ -12,8 +13,12 @@ Name | Type
|
|
|
12
13
|
`size` | number
|
|
13
14
|
`entryPrice` | number
|
|
14
15
|
`currentPrice` | number
|
|
16
|
+
`currentValue` | number
|
|
15
17
|
`unrealizedPnL` | number
|
|
16
18
|
`realizedPnL` | number
|
|
19
|
+
`txHash` | string
|
|
20
|
+
`chain` | string
|
|
21
|
+
`blockNumber` | number
|
|
17
22
|
|
|
18
23
|
## Example
|
|
19
24
|
|
|
@@ -28,8 +33,12 @@ const example = {
|
|
|
28
33
|
"size": null,
|
|
29
34
|
"entryPrice": null,
|
|
30
35
|
"currentPrice": null,
|
|
36
|
+
"currentValue": null,
|
|
31
37
|
"unrealizedPnL": null,
|
|
32
38
|
"realizedPnL": null,
|
|
39
|
+
"txHash": null,
|
|
40
|
+
"chain": null,
|
|
41
|
+
"blockNumber": null,
|
|
33
42
|
} satisfies Position
|
|
34
43
|
|
|
35
44
|
console.log(example)
|
|
@@ -13,6 +13,9 @@ Name | Type
|
|
|
13
13
|
`side` | string
|
|
14
14
|
`outcomeId` | string
|
|
15
15
|
`orderId` | string
|
|
16
|
+
`txHash` | string
|
|
17
|
+
`chain` | string
|
|
18
|
+
`blockNumber` | number
|
|
16
19
|
|
|
17
20
|
## Example
|
|
18
21
|
|
|
@@ -28,6 +31,9 @@ const example = {
|
|
|
28
31
|
"side": null,
|
|
29
32
|
"outcomeId": null,
|
|
30
33
|
"orderId": null,
|
|
34
|
+
"txHash": null,
|
|
35
|
+
"chain": null,
|
|
36
|
+
"blockNumber": null,
|
|
31
37
|
} satisfies UserTrade
|
|
32
38
|
|
|
33
39
|
console.log(example)
|
package/generated/package.json
CHANGED
|
@@ -43,6 +43,12 @@ export interface Balance {
|
|
|
43
43
|
* @memberof Balance
|
|
44
44
|
*/
|
|
45
45
|
locked: number;
|
|
46
|
+
/**
|
|
47
|
+
* Hosted-mode: which venue this balance belongs to in a multi-venue response. Null when the balance is venue-agnostic.
|
|
48
|
+
* @type {string}
|
|
49
|
+
* @memberof Balance
|
|
50
|
+
*/
|
|
51
|
+
venue?: string | null;
|
|
46
52
|
}
|
|
47
53
|
|
|
48
54
|
/**
|
|
@@ -70,6 +76,7 @@ export function BalanceFromJSONTyped(json: any, ignoreDiscriminator: boolean): B
|
|
|
70
76
|
'total': json['total'],
|
|
71
77
|
'available': json['available'],
|
|
72
78
|
'locked': json['locked'],
|
|
79
|
+
'venue': json['venue'] == null ? undefined : json['venue'],
|
|
73
80
|
};
|
|
74
81
|
}
|
|
75
82
|
|
|
@@ -88,6 +95,7 @@ export function BalanceToJSONTyped(value?: Balance | null, ignoreDiscriminator:
|
|
|
88
95
|
'total': value['total'],
|
|
89
96
|
'available': value['available'],
|
|
90
97
|
'locked': value['locked'],
|
|
98
|
+
'venue': value['venue'],
|
|
91
99
|
};
|
|
92
100
|
}
|
|
93
101
|
|
|
@@ -64,6 +64,12 @@ export interface BuiltOrder {
|
|
|
64
64
|
* @memberof BuiltOrder
|
|
65
65
|
*/
|
|
66
66
|
raw: any | null;
|
|
67
|
+
/**
|
|
68
|
+
* Unix epoch (ms) when this built order expires server-side. Submitting after expiry returns BUILT_ORDER_EXPIRED.
|
|
69
|
+
* @type {number}
|
|
70
|
+
* @memberof BuiltOrder
|
|
71
|
+
*/
|
|
72
|
+
expiry?: number | null;
|
|
67
73
|
}
|
|
68
74
|
|
|
69
75
|
/**
|
|
@@ -91,6 +97,7 @@ export function BuiltOrderFromJSONTyped(json: any, ignoreDiscriminator: boolean)
|
|
|
91
97
|
'signedOrder': json['signedOrder'] == null ? undefined : json['signedOrder'],
|
|
92
98
|
'tx': json['tx'] == null ? undefined : BuiltOrderTxFromJSON(json['tx']),
|
|
93
99
|
'raw': json['raw'],
|
|
100
|
+
'expiry': json['expiry'] == null ? undefined : json['expiry'],
|
|
94
101
|
};
|
|
95
102
|
}
|
|
96
103
|
|
|
@@ -110,6 +117,7 @@ export function BuiltOrderToJSONTyped(value?: BuiltOrder | null, ignoreDiscrimin
|
|
|
110
117
|
'signedOrder': value['signedOrder'],
|
|
111
118
|
'tx': BuiltOrderTxToJSON(value['tx']),
|
|
112
119
|
'raw': value['raw'],
|
|
120
|
+
'expiry': value['expiry'],
|
|
113
121
|
};
|
|
114
122
|
}
|
|
115
123
|
|
|
@@ -14,19 +14,76 @@
|
|
|
14
14
|
|
|
15
15
|
import { mapValues } from '../runtime';
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* 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`.
|
|
18
18
|
* @export
|
|
19
19
|
* @interface ErrorDetail
|
|
20
20
|
*/
|
|
21
21
|
export interface ErrorDetail {
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* Human-readable error message.
|
|
24
24
|
* @type {string}
|
|
25
25
|
* @memberof ErrorDetail
|
|
26
26
|
*/
|
|
27
27
|
message?: string;
|
|
28
|
+
/**
|
|
29
|
+
* 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`).
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof ErrorDetail
|
|
32
|
+
*/
|
|
33
|
+
code?: ErrorDetailCodeEnum;
|
|
34
|
+
/**
|
|
35
|
+
* 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.
|
|
36
|
+
* @type {boolean}
|
|
37
|
+
* @memberof ErrorDetail
|
|
38
|
+
*/
|
|
39
|
+
retryable?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Venue the error originated from, when known (e.g. 'polymarket', 'kalshi').
|
|
42
|
+
* @type {string}
|
|
43
|
+
* @memberof ErrorDetail
|
|
44
|
+
*/
|
|
45
|
+
exchange?: string | null;
|
|
46
|
+
/**
|
|
47
|
+
* 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 }`.
|
|
48
|
+
* @type {{ [key: string]: any; }}
|
|
49
|
+
* @memberof ErrorDetail
|
|
50
|
+
*/
|
|
51
|
+
detail?: { [key: string]: any; } | null;
|
|
28
52
|
}
|
|
29
53
|
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @export
|
|
57
|
+
*/
|
|
58
|
+
export const ErrorDetailCodeEnum = {
|
|
59
|
+
HostedTradingError: 'HOSTED_TRADING_ERROR',
|
|
60
|
+
InsufficientEscrowBalance: 'INSUFFICIENT_ESCROW_BALANCE',
|
|
61
|
+
OrderSizeTooSmall: 'ORDER_SIZE_TOO_SMALL',
|
|
62
|
+
InvalidApiKey: 'INVALID_API_KEY',
|
|
63
|
+
OutcomeNotFound: 'OUTCOME_NOT_FOUND',
|
|
64
|
+
CatalogUnavailable: 'CATALOG_UNAVAILABLE',
|
|
65
|
+
BuiltOrderExpired: 'BUILT_ORDER_EXPIRED',
|
|
66
|
+
InvalidSignature: 'INVALID_SIGNATURE',
|
|
67
|
+
NoLiquidity: 'NO_LIQUIDITY',
|
|
68
|
+
MissingWalletAddress: 'MISSING_WALLET_ADDRESS',
|
|
69
|
+
BadRequest: 'BAD_REQUEST',
|
|
70
|
+
AuthenticationError: 'AUTHENTICATION_ERROR',
|
|
71
|
+
PermissionDenied: 'PERMISSION_DENIED',
|
|
72
|
+
NotFound: 'NOT_FOUND',
|
|
73
|
+
OrderNotFound: 'ORDER_NOT_FOUND',
|
|
74
|
+
MarketNotFound: 'MARKET_NOT_FOUND',
|
|
75
|
+
EventNotFound: 'EVENT_NOT_FOUND',
|
|
76
|
+
RateLimitExceeded: 'RATE_LIMIT_EXCEEDED',
|
|
77
|
+
InvalidOrder: 'INVALID_ORDER',
|
|
78
|
+
InsufficientFunds: 'INSUFFICIENT_FUNDS',
|
|
79
|
+
ValidationError: 'VALIDATION_ERROR',
|
|
80
|
+
NetworkError: 'NETWORK_ERROR',
|
|
81
|
+
ExchangeNotAvailable: 'EXCHANGE_NOT_AVAILABLE',
|
|
82
|
+
NotSupported: 'NOT_SUPPORTED'
|
|
83
|
+
} as const;
|
|
84
|
+
export type ErrorDetailCodeEnum = typeof ErrorDetailCodeEnum[keyof typeof ErrorDetailCodeEnum];
|
|
85
|
+
|
|
86
|
+
|
|
30
87
|
/**
|
|
31
88
|
* Check if a given object implements the ErrorDetail interface.
|
|
32
89
|
*/
|
|
@@ -45,6 +102,10 @@ export function ErrorDetailFromJSONTyped(json: any, ignoreDiscriminator: boolean
|
|
|
45
102
|
return {
|
|
46
103
|
|
|
47
104
|
'message': json['message'] == null ? undefined : json['message'],
|
|
105
|
+
'code': json['code'] == null ? undefined : json['code'],
|
|
106
|
+
'retryable': json['retryable'] == null ? undefined : json['retryable'],
|
|
107
|
+
'exchange': json['exchange'] == null ? undefined : json['exchange'],
|
|
108
|
+
'detail': json['detail'] == null ? undefined : json['detail'],
|
|
48
109
|
};
|
|
49
110
|
}
|
|
50
111
|
|
|
@@ -60,6 +121,10 @@ export function ErrorDetailToJSONTyped(value?: ErrorDetail | null, ignoreDiscrim
|
|
|
60
121
|
return {
|
|
61
122
|
|
|
62
123
|
'message': value['message'],
|
|
124
|
+
'code': value['code'],
|
|
125
|
+
'retryable': value['retryable'],
|
|
126
|
+
'exchange': value['exchange'],
|
|
127
|
+
'detail': value['detail'],
|
|
63
128
|
};
|
|
64
129
|
}
|
|
65
130
|
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* PMXT Sidecar API
|
|
5
|
+
* 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.
|
|
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
|
+
/**
|
|
17
|
+
* Constructor-level options for venue clients (Polymarket, Kalshi, Opinion, etc.).
|
|
18
|
+
* Hosted mode is the default when pmxtApiKey is set; otherwise the SDK runs against
|
|
19
|
+
* a local sidecar with venue credentials.
|
|
20
|
+
* @export
|
|
21
|
+
* @interface ExchangeOptions
|
|
22
|
+
*/
|
|
23
|
+
export interface ExchangeOptions {
|
|
24
|
+
/**
|
|
25
|
+
* 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.
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @memberof ExchangeOptions
|
|
28
|
+
*/
|
|
29
|
+
pmxtApiKey?: string;
|
|
30
|
+
/**
|
|
31
|
+
* EVM wallet address for hosted reads/writes. Required for endpoints that operate on a wallet (balances, positions, trades, open orders).
|
|
32
|
+
* @type {string}
|
|
33
|
+
* @memberof ExchangeOptions
|
|
34
|
+
*/
|
|
35
|
+
walletAddress?: string | null;
|
|
36
|
+
/**
|
|
37
|
+
* Optional pre-built signer for hosted writes. If absent and privateKey is set, the SDK auto-wraps privateKey into a signer.
|
|
38
|
+
* @type {object}
|
|
39
|
+
* @memberof ExchangeOptions
|
|
40
|
+
*/
|
|
41
|
+
signer?: object | null;
|
|
42
|
+
/**
|
|
43
|
+
* 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.
|
|
44
|
+
* @type {string}
|
|
45
|
+
* @memberof ExchangeOptions
|
|
46
|
+
*/
|
|
47
|
+
privateKey?: string | null;
|
|
48
|
+
/**
|
|
49
|
+
* Explicit base URL override. When unset, the SDK uses api.pmxt.dev when pmxtApiKey is set, or the local sidecar otherwise.
|
|
50
|
+
* @type {string}
|
|
51
|
+
* @memberof ExchangeOptions
|
|
52
|
+
*/
|
|
53
|
+
baseUrl?: string | null;
|
|
54
|
+
/**
|
|
55
|
+
* Venue-side API key (e.g. Polymarket CLOB key). Only relevant for self-hosted mode.
|
|
56
|
+
* @type {string}
|
|
57
|
+
* @memberof ExchangeOptions
|
|
58
|
+
*/
|
|
59
|
+
apiKey?: string | null;
|
|
60
|
+
/**
|
|
61
|
+
* Auto-start the local sidecar when running self-hosted. Defaults to true when no pmxtApiKey is set, false when hosted.
|
|
62
|
+
* @type {boolean}
|
|
63
|
+
* @memberof ExchangeOptions
|
|
64
|
+
*/
|
|
65
|
+
autoStartServer?: boolean | null;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Check if a given object implements the ExchangeOptions interface.
|
|
70
|
+
*/
|
|
71
|
+
export function instanceOfExchangeOptions(value: object): value is ExchangeOptions {
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function ExchangeOptionsFromJSON(json: any): ExchangeOptions {
|
|
76
|
+
return ExchangeOptionsFromJSONTyped(json, false);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function ExchangeOptionsFromJSONTyped(json: any, ignoreDiscriminator: boolean): ExchangeOptions {
|
|
80
|
+
if (json == null) {
|
|
81
|
+
return json;
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
|
|
85
|
+
'pmxtApiKey': json['pmxtApiKey'] == null ? undefined : json['pmxtApiKey'],
|
|
86
|
+
'walletAddress': json['walletAddress'] == null ? undefined : json['walletAddress'],
|
|
87
|
+
'signer': json['signer'] == null ? undefined : json['signer'],
|
|
88
|
+
'privateKey': json['privateKey'] == null ? undefined : json['privateKey'],
|
|
89
|
+
'baseUrl': json['baseUrl'] == null ? undefined : json['baseUrl'],
|
|
90
|
+
'apiKey': json['apiKey'] == null ? undefined : json['apiKey'],
|
|
91
|
+
'autoStartServer': json['autoStartServer'] == null ? undefined : json['autoStartServer'],
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function ExchangeOptionsToJSON(json: any): ExchangeOptions {
|
|
96
|
+
return ExchangeOptionsToJSONTyped(json, false);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export function ExchangeOptionsToJSONTyped(value?: ExchangeOptions | null, ignoreDiscriminator: boolean = false): any {
|
|
100
|
+
if (value == null) {
|
|
101
|
+
return value;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return {
|
|
105
|
+
|
|
106
|
+
'pmxtApiKey': value['pmxtApiKey'],
|
|
107
|
+
'walletAddress': value['walletAddress'],
|
|
108
|
+
'signer': value['signer'],
|
|
109
|
+
'privateKey': value['privateKey'],
|
|
110
|
+
'baseUrl': value['baseUrl'],
|
|
111
|
+
'apiKey': value['apiKey'],
|
|
112
|
+
'autoStartServer': value['autoStartServer'],
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
@@ -103,6 +103,24 @@ export interface Order {
|
|
|
103
103
|
* @memberof Order
|
|
104
104
|
*/
|
|
105
105
|
feeRateBps?: number;
|
|
106
|
+
/**
|
|
107
|
+
* Populated in hosted mode after on-chain settlement; null for local-mode and for non-on-chain venues.
|
|
108
|
+
* @type {string}
|
|
109
|
+
* @memberof Order
|
|
110
|
+
*/
|
|
111
|
+
txHash?: string | null;
|
|
112
|
+
/**
|
|
113
|
+
* Populated in hosted mode after on-chain settlement; null for local-mode and for non-on-chain venues.
|
|
114
|
+
* @type {string}
|
|
115
|
+
* @memberof Order
|
|
116
|
+
*/
|
|
117
|
+
chain?: string | null;
|
|
118
|
+
/**
|
|
119
|
+
* Populated in hosted mode after on-chain settlement; null for local-mode and for non-on-chain venues.
|
|
120
|
+
* @type {number}
|
|
121
|
+
* @memberof Order
|
|
122
|
+
*/
|
|
123
|
+
blockNumber?: number | null;
|
|
106
124
|
}
|
|
107
125
|
|
|
108
126
|
|
|
@@ -178,6 +196,9 @@ export function OrderFromJSONTyped(json: any, ignoreDiscriminator: boolean): Ord
|
|
|
178
196
|
'timestamp': json['timestamp'],
|
|
179
197
|
'fee': json['fee'] == null ? undefined : json['fee'],
|
|
180
198
|
'feeRateBps': json['feeRateBps'] == null ? undefined : json['feeRateBps'],
|
|
199
|
+
'txHash': json['txHash'] == null ? undefined : json['txHash'],
|
|
200
|
+
'chain': json['chain'] == null ? undefined : json['chain'],
|
|
201
|
+
'blockNumber': json['blockNumber'] == null ? undefined : json['blockNumber'],
|
|
181
202
|
};
|
|
182
203
|
}
|
|
183
204
|
|
|
@@ -206,6 +227,9 @@ export function OrderToJSONTyped(value?: Order | null, ignoreDiscriminator: bool
|
|
|
206
227
|
'timestamp': value['timestamp'],
|
|
207
228
|
'fee': value['fee'],
|
|
208
229
|
'feeRateBps': value['feeRateBps'],
|
|
230
|
+
'txHash': value['txHash'],
|
|
231
|
+
'chain': value['chain'],
|
|
232
|
+
'blockNumber': value['blockNumber'],
|
|
209
233
|
};
|
|
210
234
|
}
|
|
211
235
|
|