parsec-api 0.6.0 → 0.8.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.
- package/CHANGELOG.md +27 -0
- package/client.d.mts +2 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +2 -2
- package/client.d.ts.map +1 -1
- package/client.js +7 -0
- package/client.js.map +1 -1
- package/client.mjs +7 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/account.d.mts +15 -1
- package/resources/account.d.mts.map +1 -1
- package/resources/account.d.ts +15 -1
- package/resources/account.d.ts.map +1 -1
- package/resources/account.js +6 -0
- package/resources/account.js.map +1 -1
- package/resources/account.mjs +6 -0
- package/resources/account.mjs.map +1 -1
- package/resources/approvals.d.mts +4 -1
- package/resources/approvals.d.mts.map +1 -1
- package/resources/approvals.d.ts +4 -1
- package/resources/approvals.d.ts.map +1 -1
- package/resources/events.d.mts +9 -0
- package/resources/events.d.mts.map +1 -1
- package/resources/events.d.ts +9 -0
- package/resources/events.d.ts.map +1 -1
- package/resources/exchanges.d.mts +15 -5
- package/resources/exchanges.d.mts.map +1 -1
- package/resources/exchanges.d.ts +15 -5
- package/resources/exchanges.d.ts.map +1 -1
- package/resources/exchanges.js +1 -1
- package/resources/exchanges.mjs +1 -1
- package/resources/execution-price.d.mts +26 -11
- package/resources/execution-price.d.mts.map +1 -1
- package/resources/execution-price.d.ts +26 -11
- package/resources/execution-price.d.ts.map +1 -1
- package/resources/execution-price.js +2 -1
- package/resources/execution-price.js.map +1 -1
- package/resources/execution-price.mjs +2 -1
- package/resources/execution-price.mjs.map +1 -1
- package/resources/index.d.mts +2 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -3
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/markets.d.mts +9 -0
- package/resources/markets.d.mts.map +1 -1
- package/resources/markets.d.ts +9 -0
- package/resources/markets.d.ts.map +1 -1
- package/resources/orderbook.d.mts +8 -0
- package/resources/orderbook.d.mts.map +1 -1
- package/resources/orderbook.d.ts +8 -0
- package/resources/orderbook.d.ts.map +1 -1
- package/resources/orders.d.mts +4 -1
- package/resources/orders.d.mts.map +1 -1
- package/resources/orders.d.ts +4 -1
- package/resources/orders.d.ts.map +1 -1
- package/resources/trades.d.mts +1 -1
- package/resources/trades.d.mts.map +1 -1
- package/resources/trades.d.ts +1 -1
- package/resources/trades.d.ts.map +1 -1
- package/src/client.ts +10 -0
- package/src/resources/account.ts +20 -0
- package/src/resources/approvals.ts +4 -1
- package/src/resources/events.ts +11 -0
- package/src/resources/exchanges.ts +28 -6
- package/src/resources/execution-price.ts +30 -12
- package/src/resources/index.ts +2 -1
- package/src/resources/markets.ts +11 -0
- package/src/resources/orderbook.ts +10 -0
- package/src/resources/orders.ts +4 -1
- package/src/resources/trades.ts +2 -2
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/resources/orders.d.ts
CHANGED
|
@@ -58,7 +58,10 @@ export interface OrderCreateParams {
|
|
|
58
58
|
*/
|
|
59
59
|
size: number;
|
|
60
60
|
/**
|
|
61
|
-
* Body param
|
|
61
|
+
* Body param: Optional key-value parameters. Supported keys:
|
|
62
|
+
*
|
|
63
|
+
* - `order_type`: Order time-in-force. Values: `gtc` (default), `ioc`, `fok`.
|
|
64
|
+
* Unsupported types return 501 per exchange.
|
|
62
65
|
*/
|
|
63
66
|
params?: {
|
|
64
67
|
[key: string]: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orders.d.ts","sourceRoot":"","sources":["../src/resources/orders.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,MAAO,SAAQ,WAAW;IACrC;;OAEG;IACH,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WAAW,iBAAiB;IAChC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,IAAI,EAAE,KAAK,GAAG,MAAM,CAAC;IAErB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;;OAKG;IACH,MAAM,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CACpC;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,KAAK,IAAI,KAAK,EACnB,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;CACH"}
|
package/resources/trades.d.mts
CHANGED
|
@@ -28,6 +28,7 @@ export declare namespace TradeListResponse {
|
|
|
28
28
|
size: number;
|
|
29
29
|
source_channel: string;
|
|
30
30
|
timestamp: string;
|
|
31
|
+
id?: string;
|
|
31
32
|
/**
|
|
32
33
|
* Aggressor side (typically "buy" or "sell").
|
|
33
34
|
*/
|
|
@@ -36,7 +37,6 @@ export declare namespace TradeListResponse {
|
|
|
36
37
|
* Trade side (typically "buy" or "sell").
|
|
37
38
|
*/
|
|
38
39
|
side?: string;
|
|
39
|
-
trade_id?: string;
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
export interface TradeListParams {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trades.d.mts","sourceRoot":"","sources":["../src/resources/trades.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;OAGG;IACH,IAAI,CAAC,KAAK,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,iBAAiB,CAAC;CAGtF;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IAEjB,SAAS,EAAE,MAAM,CAAC;IAElB,OAAO,EAAE,MAAM,CAAC;IAEhB,SAAS,EAAE,MAAM,CAAC;IAElB,QAAQ,EAAE,MAAM,CAAC;IAEjB,MAAM,EAAE,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;CACxC;AAED,yBAAiB,iBAAiB,CAAC;IACjC,UAAiB,KAAK;QACpB;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;QAEd;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QAEb,cAAc,EAAE,MAAM,CAAC;QAEvB,SAAS,EAAE,MAAM,CAAC;QAElB
|
|
1
|
+
{"version":3,"file":"trades.d.mts","sourceRoot":"","sources":["../src/resources/trades.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;OAGG;IACH,IAAI,CAAC,KAAK,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,iBAAiB,CAAC;CAGtF;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IAEjB,SAAS,EAAE,MAAM,CAAC;IAElB,OAAO,EAAE,MAAM,CAAC;IAEhB,SAAS,EAAE,MAAM,CAAC;IAElB,QAAQ,EAAE,MAAM,CAAC;IAEjB,MAAM,EAAE,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;CACxC;AAED,yBAAiB,iBAAiB,CAAC;IACjC,UAAiB,KAAK;QACpB;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;QAEd;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QAEb,cAAc,EAAE,MAAM,CAAC;QAEvB,SAAS,EAAE,MAAM,CAAC;QAElB,EAAE,CAAC,EAAE,MAAM,CAAC;QAEZ;;WAEG;QACH,cAAc,CAAC,EAAE,MAAM,CAAC;QAExB;;WAEG;QACH,IAAI,CAAC,EAAE,MAAM,CAAC;KACf;CACF;AAED,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EAAE,KAAK,iBAAiB,IAAI,iBAAiB,EAAE,KAAK,eAAe,IAAI,eAAe,EAAE,CAAC;CACjG"}
|
package/resources/trades.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ export declare namespace TradeListResponse {
|
|
|
28
28
|
size: number;
|
|
29
29
|
source_channel: string;
|
|
30
30
|
timestamp: string;
|
|
31
|
+
id?: string;
|
|
31
32
|
/**
|
|
32
33
|
* Aggressor side (typically "buy" or "sell").
|
|
33
34
|
*/
|
|
@@ -36,7 +37,6 @@ export declare namespace TradeListResponse {
|
|
|
36
37
|
* Trade side (typically "buy" or "sell").
|
|
37
38
|
*/
|
|
38
39
|
side?: string;
|
|
39
|
-
trade_id?: string;
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
export interface TradeListParams {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trades.d.ts","sourceRoot":"","sources":["../src/resources/trades.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;OAGG;IACH,IAAI,CAAC,KAAK,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,iBAAiB,CAAC;CAGtF;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IAEjB,SAAS,EAAE,MAAM,CAAC;IAElB,OAAO,EAAE,MAAM,CAAC;IAEhB,SAAS,EAAE,MAAM,CAAC;IAElB,QAAQ,EAAE,MAAM,CAAC;IAEjB,MAAM,EAAE,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;CACxC;AAED,yBAAiB,iBAAiB,CAAC;IACjC,UAAiB,KAAK;QACpB;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;QAEd;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QAEb,cAAc,EAAE,MAAM,CAAC;QAEvB,SAAS,EAAE,MAAM,CAAC;QAElB
|
|
1
|
+
{"version":3,"file":"trades.d.ts","sourceRoot":"","sources":["../src/resources/trades.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;OAGG;IACH,IAAI,CAAC,KAAK,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,iBAAiB,CAAC;CAGtF;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IAEjB,SAAS,EAAE,MAAM,CAAC;IAElB,OAAO,EAAE,MAAM,CAAC;IAEhB,SAAS,EAAE,MAAM,CAAC;IAElB,QAAQ,EAAE,MAAM,CAAC;IAEjB,MAAM,EAAE,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;CACxC;AAED,yBAAiB,iBAAiB,CAAC;IACjC,UAAiB,KAAK;QACpB;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;QAEd;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QAEb,cAAc,EAAE,MAAM,CAAC;QAEvB,SAAS,EAAE,MAAM,CAAC;QAElB,EAAE,CAAC,EAAE,MAAM,CAAC;QAEZ;;WAEG;QACH,cAAc,CAAC,EAAE,MAAM,CAAC;QAExB;;WAEG;QACH,IAAI,CAAC,EAAE,MAAM,CAAC;KACf;CACF;AAED,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EAAE,KAAK,iBAAiB,IAAI,iBAAiB,EAAE,KAAK,eAAe,IAAI,eAAe,EAAE,CAAC;CACjG"}
|
package/src/client.ts
CHANGED
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
Account,
|
|
23
23
|
AccountBalanceParams,
|
|
24
24
|
AccountBalanceResponse,
|
|
25
|
+
AccountCapabilitiesResponse,
|
|
25
26
|
AccountPingParams,
|
|
26
27
|
AccountPingResponse,
|
|
27
28
|
AccountUpdateCredentialsParams,
|
|
@@ -759,6 +760,14 @@ export class ParsecAPI {
|
|
|
759
760
|
(Symbol.iterator in body && 'next' in body && typeof body.next === 'function'))
|
|
760
761
|
) {
|
|
761
762
|
return { bodyHeaders: undefined, body: Shims.ReadableStreamFrom(body as AsyncIterable<Uint8Array>) };
|
|
763
|
+
} else if (
|
|
764
|
+
typeof body === 'object' &&
|
|
765
|
+
headers.values.get('content-type') === 'application/x-www-form-urlencoded'
|
|
766
|
+
) {
|
|
767
|
+
return {
|
|
768
|
+
bodyHeaders: { 'content-type': 'application/x-www-form-urlencoded' },
|
|
769
|
+
body: this.stringifyQuery(body as Record<string, unknown>),
|
|
770
|
+
};
|
|
762
771
|
} else {
|
|
763
772
|
return this.#encoder({ body, headers });
|
|
764
773
|
}
|
|
@@ -911,6 +920,7 @@ export declare namespace ParsecAPI {
|
|
|
911
920
|
export {
|
|
912
921
|
Account as Account,
|
|
913
922
|
type AccountBalanceResponse as AccountBalanceResponse,
|
|
923
|
+
type AccountCapabilitiesResponse as AccountCapabilitiesResponse,
|
|
914
924
|
type AccountPingResponse as AccountPingResponse,
|
|
915
925
|
type AccountUserActivityResponse as AccountUserActivityResponse,
|
|
916
926
|
type AccountBalanceParams as AccountBalanceParams,
|
package/src/resources/account.ts
CHANGED
|
@@ -13,6 +13,13 @@ export class Account extends APIResource {
|
|
|
13
13
|
return this._client.get('/api/v1/balance', { query, ...options });
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
/**
|
|
17
|
+
* Returns the customer's tier and list of linked exchanges.
|
|
18
|
+
*/
|
|
19
|
+
capabilities(options?: RequestOptions): APIPromise<AccountCapabilitiesResponse> {
|
|
20
|
+
return this._client.get('/api/v1/session/capabilities', options);
|
|
21
|
+
}
|
|
22
|
+
|
|
16
23
|
/**
|
|
17
24
|
* Performs a lightweight balance fetch per exchange to verify connectivity/auth
|
|
18
25
|
* status.
|
|
@@ -51,6 +58,18 @@ export interface AccountBalanceResponse {
|
|
|
51
58
|
raw: { [key: string]: unknown };
|
|
52
59
|
}
|
|
53
60
|
|
|
61
|
+
export interface AccountCapabilitiesResponse {
|
|
62
|
+
/**
|
|
63
|
+
* Exchange IDs the customer has credentials linked for.
|
|
64
|
+
*/
|
|
65
|
+
linked_exchanges: Array<string>;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Customer tier (e.g., "free", "pro", "admin").
|
|
69
|
+
*/
|
|
70
|
+
tier: string;
|
|
71
|
+
}
|
|
72
|
+
|
|
54
73
|
export type AccountPingResponse = Array<AccountPingResponse.AccountPingResponseItem>;
|
|
55
74
|
|
|
56
75
|
export namespace AccountPingResponse {
|
|
@@ -131,6 +150,7 @@ export interface AccountUserActivityParams {
|
|
|
131
150
|
export declare namespace Account {
|
|
132
151
|
export {
|
|
133
152
|
type AccountBalanceResponse as AccountBalanceResponse,
|
|
153
|
+
type AccountCapabilitiesResponse as AccountCapabilitiesResponse,
|
|
134
154
|
type AccountPingResponse as AccountPingResponse,
|
|
135
155
|
type AccountUserActivityResponse as AccountUserActivityResponse,
|
|
136
156
|
type AccountBalanceParams as AccountBalanceParams,
|
package/src/resources/events.ts
CHANGED
|
@@ -195,6 +195,12 @@ export namespace EventListResponse {
|
|
|
195
195
|
*/
|
|
196
196
|
liquidity?: number;
|
|
197
197
|
|
|
198
|
+
/**
|
|
199
|
+
* Minimum order size in contracts. Varies per market on Polymarket (e.g. 5, 15);
|
|
200
|
+
* typically 1 on Kalshi.
|
|
201
|
+
*/
|
|
202
|
+
min_order_size?: number;
|
|
203
|
+
|
|
198
204
|
/**
|
|
199
205
|
* Current open interest (contracts/pairs).
|
|
200
206
|
*/
|
|
@@ -212,6 +218,11 @@ export namespace EventListResponse {
|
|
|
212
218
|
|
|
213
219
|
slug?: string;
|
|
214
220
|
|
|
221
|
+
/**
|
|
222
|
+
* Minimum price increment for orders on this market.
|
|
223
|
+
*/
|
|
224
|
+
tick_size?: number;
|
|
225
|
+
|
|
215
226
|
updated_at?: string;
|
|
216
227
|
|
|
217
228
|
/**
|
|
@@ -6,34 +6,56 @@ import { RequestOptions } from '../internal/request-options';
|
|
|
6
6
|
|
|
7
7
|
export class Exchanges extends APIResource {
|
|
8
8
|
/**
|
|
9
|
-
* Returns exchange
|
|
9
|
+
* Returns exchange capability objects available to the authenticated customer.
|
|
10
10
|
*/
|
|
11
11
|
list(options?: RequestOptions): APIPromise<ExchangeListResponse> {
|
|
12
12
|
return this._client.get('/api/v1/exchanges', options);
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
export type ExchangeListResponse = Array<ExchangeListResponse.
|
|
16
|
+
export type ExchangeListResponse = Array<ExchangeListResponse.ExchangeListResponseItem>;
|
|
17
17
|
|
|
18
18
|
export namespace ExchangeListResponse {
|
|
19
|
-
export interface
|
|
19
|
+
export interface ExchangeListResponseItem {
|
|
20
20
|
/**
|
|
21
21
|
* Exchange identifier (e.g., "polymarket", "kalshi").
|
|
22
22
|
*/
|
|
23
23
|
id: string;
|
|
24
24
|
|
|
25
|
+
has: ExchangeListResponseItem.Has;
|
|
26
|
+
|
|
25
27
|
/**
|
|
26
28
|
* Human-readable exchange name.
|
|
27
29
|
*/
|
|
28
30
|
name: string;
|
|
29
|
-
|
|
30
|
-
has: ExchangeCapability.Has;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
export namespace
|
|
33
|
+
export namespace ExchangeListResponseItem {
|
|
34
34
|
export interface Has {
|
|
35
|
+
approvals: boolean;
|
|
36
|
+
|
|
37
|
+
cancel_order: boolean;
|
|
38
|
+
|
|
35
39
|
create_order: boolean;
|
|
40
|
+
|
|
41
|
+
fetch_balance: boolean;
|
|
42
|
+
|
|
43
|
+
fetch_events: boolean;
|
|
44
|
+
|
|
36
45
|
fetch_markets: boolean;
|
|
46
|
+
|
|
47
|
+
fetch_orderbook: boolean;
|
|
48
|
+
|
|
49
|
+
fetch_positions: boolean;
|
|
50
|
+
|
|
51
|
+
fetch_price_history: boolean;
|
|
52
|
+
|
|
53
|
+
fetch_trades: boolean;
|
|
54
|
+
|
|
55
|
+
fetch_user_activity: boolean;
|
|
56
|
+
|
|
57
|
+
refresh_balance: boolean;
|
|
58
|
+
|
|
37
59
|
websocket: boolean;
|
|
38
60
|
}
|
|
39
61
|
}
|
|
@@ -6,7 +6,8 @@ import { RequestOptions } from '../internal/request-options';
|
|
|
6
6
|
|
|
7
7
|
export class ExecutionPrice extends APIResource {
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Walks the orderbook to estimate the volume-weighted average price (VWAP) for a
|
|
10
|
+
* hypothetical order of the given size. Does not place an order.
|
|
10
11
|
*/
|
|
11
12
|
retrieve(
|
|
12
13
|
query: ExecutionPriceRetrieveParams,
|
|
@@ -17,18 +18,13 @@ export class ExecutionPrice extends APIResource {
|
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
export interface ExecutionPriceRetrieveResponse {
|
|
20
|
-
/**
|
|
21
|
-
* Volume-weighted average execution price, or null when no liquidity is available.
|
|
22
|
-
*/
|
|
23
|
-
avg_price?: number | null;
|
|
24
|
-
|
|
25
21
|
/**
|
|
26
22
|
* Number of contracts that would be filled.
|
|
27
23
|
*/
|
|
28
24
|
filled_amount: number;
|
|
29
25
|
|
|
30
26
|
/**
|
|
31
|
-
* True
|
|
27
|
+
* True if the entire requested amount can be filled.
|
|
32
28
|
*/
|
|
33
29
|
fully_filled: boolean;
|
|
34
30
|
|
|
@@ -38,19 +34,41 @@ export interface ExecutionPriceRetrieveResponse {
|
|
|
38
34
|
levels_consumed: number;
|
|
39
35
|
|
|
40
36
|
/**
|
|
41
|
-
*
|
|
37
|
+
* Total cost of the filled portion.
|
|
38
|
+
*/
|
|
39
|
+
total_cost: number;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Volume-weighted average execution price (null if no liquidity).
|
|
43
|
+
*/
|
|
44
|
+
avg_price?: number | null;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Estimated exchange fee (null when fee rate is unknown).
|
|
48
|
+
*/
|
|
49
|
+
fee_estimate?: number | null;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Total cost including fees (total_cost + fee_estimate). Null when fee rate is
|
|
53
|
+
* unknown.
|
|
54
|
+
*/
|
|
55
|
+
net_cost?: number | null;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Price impact vs best price (null if no liquidity).
|
|
42
59
|
*/
|
|
43
60
|
slippage?: number | null;
|
|
44
61
|
|
|
45
62
|
/**
|
|
46
|
-
*
|
|
63
|
+
* Price of the last consumed orderbook level (worst fill price). Null if no
|
|
64
|
+
* liquidity.
|
|
47
65
|
*/
|
|
48
|
-
|
|
66
|
+
worst_price?: number | null;
|
|
49
67
|
}
|
|
50
68
|
|
|
51
69
|
export interface ExecutionPriceRetrieveParams {
|
|
52
70
|
/**
|
|
53
|
-
*
|
|
71
|
+
* Order size in contracts.
|
|
54
72
|
*/
|
|
55
73
|
amount: number;
|
|
56
74
|
|
|
@@ -60,7 +78,7 @@ export interface ExecutionPriceRetrieveParams {
|
|
|
60
78
|
parsec_id: string;
|
|
61
79
|
|
|
62
80
|
/**
|
|
63
|
-
* Order side.
|
|
81
|
+
* Order side ("buy" or "sell").
|
|
64
82
|
*/
|
|
65
83
|
side: 'buy' | 'sell';
|
|
66
84
|
|
package/src/resources/index.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
export {
|
|
4
4
|
Account,
|
|
5
5
|
type AccountBalanceResponse,
|
|
6
|
+
type AccountCapabilitiesResponse,
|
|
6
7
|
type AccountPingResponse,
|
|
7
8
|
type AccountUserActivityResponse,
|
|
8
9
|
type AccountBalanceParams,
|
|
@@ -19,12 +20,12 @@ export {
|
|
|
19
20
|
} from './approvals';
|
|
20
21
|
export { Events, type EventListResponse, type EventListParams } from './events';
|
|
21
22
|
export { Exchanges, type ExchangeListResponse } from './exchanges';
|
|
22
|
-
export { Markets, type MarketListResponse, type MarketListParams } from './markets';
|
|
23
23
|
export {
|
|
24
24
|
ExecutionPrice,
|
|
25
25
|
type ExecutionPriceRetrieveResponse,
|
|
26
26
|
type ExecutionPriceRetrieveParams,
|
|
27
27
|
} from './execution-price';
|
|
28
|
+
export { Markets, type MarketListResponse, type MarketListParams } from './markets';
|
|
28
29
|
export {
|
|
29
30
|
Orderbook,
|
|
30
31
|
type OrderbookRetrieveResponse,
|
package/src/resources/markets.ts
CHANGED
|
@@ -176,6 +176,12 @@ export namespace MarketListResponse {
|
|
|
176
176
|
*/
|
|
177
177
|
liquidity?: number;
|
|
178
178
|
|
|
179
|
+
/**
|
|
180
|
+
* Minimum order size in contracts. Varies per market on Polymarket (e.g. 5, 15);
|
|
181
|
+
* typically 1 on Kalshi.
|
|
182
|
+
*/
|
|
183
|
+
min_order_size?: number;
|
|
184
|
+
|
|
179
185
|
/**
|
|
180
186
|
* Current open interest (contracts/pairs).
|
|
181
187
|
*/
|
|
@@ -193,6 +199,11 @@ export namespace MarketListResponse {
|
|
|
193
199
|
|
|
194
200
|
slug?: string;
|
|
195
201
|
|
|
202
|
+
/**
|
|
203
|
+
* Minimum price increment for orders on this market.
|
|
204
|
+
*/
|
|
205
|
+
tick_size?: number;
|
|
206
|
+
|
|
196
207
|
updated_at?: string;
|
|
197
208
|
|
|
198
209
|
/**
|
|
@@ -36,6 +36,16 @@ export interface OrderbookRetrieveResponse {
|
|
|
36
36
|
|
|
37
37
|
token_id: string;
|
|
38
38
|
|
|
39
|
+
/**
|
|
40
|
+
* Minimum order size in contracts.
|
|
41
|
+
*/
|
|
42
|
+
min_order_size?: number;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Minimum price increment for orders on this market.
|
|
46
|
+
*/
|
|
47
|
+
tick_size?: number;
|
|
48
|
+
|
|
39
49
|
timestamp?: string | null;
|
|
40
50
|
}
|
|
41
51
|
|
package/src/resources/orders.ts
CHANGED
|
@@ -93,7 +93,10 @@ export interface OrderCreateParams {
|
|
|
93
93
|
size: number;
|
|
94
94
|
|
|
95
95
|
/**
|
|
96
|
-
* Body param
|
|
96
|
+
* Body param: Optional key-value parameters. Supported keys:
|
|
97
|
+
*
|
|
98
|
+
* - `order_type`: Order time-in-force. Values: `gtc` (default), `ioc`, `fok`.
|
|
99
|
+
* Unsupported types return 501 per exchange.
|
|
97
100
|
*/
|
|
98
101
|
params?: { [key: string]: string };
|
|
99
102
|
}
|
package/src/resources/trades.ts
CHANGED
|
@@ -44,6 +44,8 @@ export namespace TradeListResponse {
|
|
|
44
44
|
|
|
45
45
|
timestamp: string;
|
|
46
46
|
|
|
47
|
+
id?: string;
|
|
48
|
+
|
|
47
49
|
/**
|
|
48
50
|
* Aggressor side (typically "buy" or "sell").
|
|
49
51
|
*/
|
|
@@ -53,8 +55,6 @@ export namespace TradeListResponse {
|
|
|
53
55
|
* Trade side (typically "buy" or "sell").
|
|
54
56
|
*/
|
|
55
57
|
side?: string;
|
|
56
|
-
|
|
57
|
-
trade_id?: string;
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.8.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.8.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.8.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.8.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|