parsec-api 0.6.0 → 0.7.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 (70) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/client.d.mts +2 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +2 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js +7 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +7 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/account.d.mts +15 -1
  12. package/resources/account.d.mts.map +1 -1
  13. package/resources/account.d.ts +15 -1
  14. package/resources/account.d.ts.map +1 -1
  15. package/resources/account.js +6 -0
  16. package/resources/account.js.map +1 -1
  17. package/resources/account.mjs +6 -0
  18. package/resources/account.mjs.map +1 -1
  19. package/resources/approvals.d.mts +4 -1
  20. package/resources/approvals.d.mts.map +1 -1
  21. package/resources/approvals.d.ts +4 -1
  22. package/resources/approvals.d.ts.map +1 -1
  23. package/resources/events.d.mts +5 -0
  24. package/resources/events.d.mts.map +1 -1
  25. package/resources/events.d.ts +5 -0
  26. package/resources/events.d.ts.map +1 -1
  27. package/resources/exchanges.d.mts +5 -5
  28. package/resources/exchanges.d.mts.map +1 -1
  29. package/resources/exchanges.d.ts +5 -5
  30. package/resources/exchanges.d.ts.map +1 -1
  31. package/resources/exchanges.js +1 -1
  32. package/resources/exchanges.mjs +1 -1
  33. package/resources/execution-price.d.mts +13 -12
  34. package/resources/execution-price.d.mts.map +1 -1
  35. package/resources/execution-price.d.ts +13 -12
  36. package/resources/execution-price.d.ts.map +1 -1
  37. package/resources/execution-price.js +2 -1
  38. package/resources/execution-price.js.map +1 -1
  39. package/resources/execution-price.mjs +2 -1
  40. package/resources/execution-price.mjs.map +1 -1
  41. package/resources/index.d.mts +2 -2
  42. package/resources/index.d.mts.map +1 -1
  43. package/resources/index.d.ts +2 -2
  44. package/resources/index.d.ts.map +1 -1
  45. package/resources/index.js +3 -3
  46. package/resources/index.js.map +1 -1
  47. package/resources/index.mjs +1 -1
  48. package/resources/index.mjs.map +1 -1
  49. package/resources/markets.d.mts +5 -0
  50. package/resources/markets.d.mts.map +1 -1
  51. package/resources/markets.d.ts +5 -0
  52. package/resources/markets.d.ts.map +1 -1
  53. package/resources/orders.d.mts +4 -1
  54. package/resources/orders.d.mts.map +1 -1
  55. package/resources/orders.d.ts +4 -1
  56. package/resources/orders.d.ts.map +1 -1
  57. package/src/client.ts +10 -0
  58. package/src/resources/account.ts +20 -0
  59. package/src/resources/approvals.ts +4 -1
  60. package/src/resources/events.ts +6 -0
  61. package/src/resources/exchanges.ts +8 -6
  62. package/src/resources/execution-price.ts +14 -13
  63. package/src/resources/index.ts +2 -1
  64. package/src/resources/markets.ts +6 -0
  65. package/src/resources/orders.ts +4 -1
  66. package/src/version.ts +1 -1
  67. package/version.d.mts +1 -1
  68. package/version.d.ts +1 -1
  69. package/version.js +1 -1
  70. package/version.mjs +1 -1
@@ -6,34 +6,36 @@ import { RequestOptions } from '../internal/request-options';
6
6
 
7
7
  export class Exchanges extends APIResource {
8
8
  /**
9
- * Returns exchange capabilities available to the authenticated customer.
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.ExchangeCapability>;
16
+ export type ExchangeListResponse = Array<ExchangeListResponse.ExchangeListResponseItem>;
17
17
 
18
18
  export namespace ExchangeListResponse {
19
- export interface ExchangeCapability {
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 ExchangeCapability {
33
+ export namespace ExchangeListResponseItem {
34
34
  export interface Has {
35
35
  create_order: boolean;
36
+
36
37
  fetch_markets: boolean;
38
+
37
39
  websocket: boolean;
38
40
  }
39
41
  }
@@ -6,7 +6,8 @@ import { RequestOptions } from '../internal/request-options';
6
6
 
7
7
  export class ExecutionPrice extends APIResource {
8
8
  /**
9
- * Estimates execution price (VWAP) for a hypothetical order without placing it.
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 when the full requested amount is fillable from current depth.
27
+ * True if the entire requested amount can be filled.
32
28
  */
33
29
  fully_filled: boolean;
34
30
 
@@ -38,19 +34,24 @@ export interface ExecutionPriceRetrieveResponse {
38
34
  levels_consumed: number;
39
35
 
40
36
  /**
41
- * Price impact vs best price, or null when no liquidity is available.
37
+ * Total cost of the filled portion.
42
38
  */
43
- slippage?: number | null;
39
+ total_cost: number;
44
40
 
45
41
  /**
46
- * Total notional cost of the filled amount.
42
+ * Volume-weighted average execution price (null if no liquidity).
47
43
  */
48
- total_cost: number;
44
+ avg_price?: number | null;
45
+
46
+ /**
47
+ * Price impact vs best price (null if no liquidity).
48
+ */
49
+ slippage?: number | null;
49
50
  }
50
51
 
51
52
  export interface ExecutionPriceRetrieveParams {
52
53
  /**
53
- * Requested order size in contracts.
54
+ * Order size in contracts.
54
55
  */
55
56
  amount: number;
56
57
 
@@ -60,7 +61,7 @@ export interface ExecutionPriceRetrieveParams {
60
61
  parsec_id: string;
61
62
 
62
63
  /**
63
- * Order side.
64
+ * Order side ("buy" or "sell").
64
65
  */
65
66
  side: 'buy' | 'sell';
66
67
 
@@ -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,
@@ -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
  */
@@ -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/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.6.0'; // x-release-please-version
1
+ export const VERSION = '0.7.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.6.0";
1
+ export declare const VERSION = "0.7.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.6.0";
1
+ export declare const VERSION = "0.7.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.6.0'; // x-release-please-version
4
+ exports.VERSION = '0.7.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.6.0'; // x-release-please-version
1
+ export const VERSION = '0.7.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map