@clear-street/studio-sdk 0.1.0-alpha.10

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 (305) hide show
  1. package/CHANGELOG.md +135 -0
  2. package/LICENSE +201 -0
  3. package/README.md +290 -0
  4. package/_shims/MultipartBody.d.ts +9 -0
  5. package/_shims/MultipartBody.d.ts.map +1 -0
  6. package/_shims/MultipartBody.js +16 -0
  7. package/_shims/MultipartBody.js.map +1 -0
  8. package/_shims/MultipartBody.mjs +12 -0
  9. package/_shims/MultipartBody.mjs.map +1 -0
  10. package/_shims/README.md +46 -0
  11. package/_shims/auto/runtime-bun.d.ts +5 -0
  12. package/_shims/auto/runtime-bun.d.ts.map +1 -0
  13. package/_shims/auto/runtime-bun.js +21 -0
  14. package/_shims/auto/runtime-bun.js.map +1 -0
  15. package/_shims/auto/runtime-bun.mjs +2 -0
  16. package/_shims/auto/runtime-bun.mjs.map +1 -0
  17. package/_shims/auto/runtime-node.d.ts +5 -0
  18. package/_shims/auto/runtime-node.d.ts.map +1 -0
  19. package/_shims/auto/runtime-node.js +21 -0
  20. package/_shims/auto/runtime-node.js.map +1 -0
  21. package/_shims/auto/runtime-node.mjs +2 -0
  22. package/_shims/auto/runtime-node.mjs.map +1 -0
  23. package/_shims/auto/runtime.d.ts +5 -0
  24. package/_shims/auto/runtime.d.ts.map +1 -0
  25. package/_shims/auto/runtime.js +21 -0
  26. package/_shims/auto/runtime.js.map +1 -0
  27. package/_shims/auto/runtime.mjs +2 -0
  28. package/_shims/auto/runtime.mjs.map +1 -0
  29. package/_shims/auto/types-node.d.ts +5 -0
  30. package/_shims/auto/types-node.d.ts.map +1 -0
  31. package/_shims/auto/types-node.js +21 -0
  32. package/_shims/auto/types-node.js.map +1 -0
  33. package/_shims/auto/types-node.mjs +2 -0
  34. package/_shims/auto/types-node.mjs.map +1 -0
  35. package/_shims/auto/types.d.ts +101 -0
  36. package/_shims/auto/types.js +3 -0
  37. package/_shims/auto/types.mjs +3 -0
  38. package/_shims/bun-runtime.d.ts +6 -0
  39. package/_shims/bun-runtime.d.ts.map +1 -0
  40. package/_shims/bun-runtime.js +14 -0
  41. package/_shims/bun-runtime.js.map +1 -0
  42. package/_shims/bun-runtime.mjs +10 -0
  43. package/_shims/bun-runtime.mjs.map +1 -0
  44. package/_shims/index.d.ts +81 -0
  45. package/_shims/index.js +13 -0
  46. package/_shims/index.mjs +7 -0
  47. package/_shims/manual-types.d.ts +12 -0
  48. package/_shims/manual-types.js +3 -0
  49. package/_shims/manual-types.mjs +3 -0
  50. package/_shims/node-runtime.d.ts +3 -0
  51. package/_shims/node-runtime.d.ts.map +1 -0
  52. package/_shims/node-runtime.js +89 -0
  53. package/_shims/node-runtime.js.map +1 -0
  54. package/_shims/node-runtime.mjs +56 -0
  55. package/_shims/node-runtime.mjs.map +1 -0
  56. package/_shims/node-types.d.ts +42 -0
  57. package/_shims/node-types.js +3 -0
  58. package/_shims/node-types.mjs +3 -0
  59. package/_shims/registry.d.ts +37 -0
  60. package/_shims/registry.d.ts.map +1 -0
  61. package/_shims/registry.js +41 -0
  62. package/_shims/registry.js.map +1 -0
  63. package/_shims/registry.mjs +37 -0
  64. package/_shims/registry.mjs.map +1 -0
  65. package/_shims/web-runtime.d.ts +5 -0
  66. package/_shims/web-runtime.d.ts.map +1 -0
  67. package/_shims/web-runtime.js +78 -0
  68. package/_shims/web-runtime.js.map +1 -0
  69. package/_shims/web-runtime.mjs +71 -0
  70. package/_shims/web-runtime.mjs.map +1 -0
  71. package/_shims/web-types.d.ts +83 -0
  72. package/_shims/web-types.js +3 -0
  73. package/_shims/web-types.mjs +3 -0
  74. package/core.d.ts +242 -0
  75. package/core.d.ts.map +1 -0
  76. package/core.js +901 -0
  77. package/core.js.map +1 -0
  78. package/core.mjs +869 -0
  79. package/core.mjs.map +1 -0
  80. package/error.d.ts +53 -0
  81. package/error.d.ts.map +1 -0
  82. package/error.js +143 -0
  83. package/error.js.map +1 -0
  84. package/error.mjs +127 -0
  85. package/error.mjs.map +1 -0
  86. package/index.d.mts +144 -0
  87. package/index.d.ts +144 -0
  88. package/index.d.ts.map +1 -0
  89. package/index.js +122 -0
  90. package/index.js.map +1 -0
  91. package/index.mjs +94 -0
  92. package/index.mjs.map +1 -0
  93. package/package.json +103 -0
  94. package/resource.d.ts +6 -0
  95. package/resource.d.ts.map +1 -0
  96. package/resource.js +11 -0
  97. package/resource.js.map +1 -0
  98. package/resource.mjs +7 -0
  99. package/resource.mjs.map +1 -0
  100. package/resources/accounts/accounts.d.ts +84 -0
  101. package/resources/accounts/accounts.d.ts.map +1 -0
  102. package/resources/accounts/accounts.js +79 -0
  103. package/resources/accounts/accounts.js.map +1 -0
  104. package/resources/accounts/accounts.mjs +52 -0
  105. package/resources/accounts/accounts.mjs.map +1 -0
  106. package/resources/accounts/bulk-orders.d.ts +134 -0
  107. package/resources/accounts/bulk-orders.d.ts.map +1 -0
  108. package/resources/accounts/bulk-orders.js +29 -0
  109. package/resources/accounts/bulk-orders.js.map +1 -0
  110. package/resources/accounts/bulk-orders.mjs +25 -0
  111. package/resources/accounts/bulk-orders.mjs.map +1 -0
  112. package/resources/accounts/easy-borrows.d.ts +17 -0
  113. package/resources/accounts/easy-borrows.d.ts.map +1 -0
  114. package/resources/accounts/easy-borrows.js +18 -0
  115. package/resources/accounts/easy-borrows.js.map +1 -0
  116. package/resources/accounts/easy-borrows.mjs +14 -0
  117. package/resources/accounts/easy-borrows.mjs.map +1 -0
  118. package/resources/accounts/holdings.d.ts +73 -0
  119. package/resources/accounts/holdings.d.ts.map +1 -0
  120. package/resources/accounts/holdings.js +18 -0
  121. package/resources/accounts/holdings.js.map +1 -0
  122. package/resources/accounts/holdings.mjs +14 -0
  123. package/resources/accounts/holdings.mjs.map +1 -0
  124. package/resources/accounts/index.d.ts +12 -0
  125. package/resources/accounts/index.d.ts.map +1 -0
  126. package/resources/accounts/index.js +27 -0
  127. package/resources/accounts/index.js.map +1 -0
  128. package/resources/accounts/index.mjs +13 -0
  129. package/resources/accounts/index.mjs.map +1 -0
  130. package/resources/accounts/locate-orders.d.ts +56 -0
  131. package/resources/accounts/locate-orders.d.ts.map +1 -0
  132. package/resources/accounts/locate-orders.js +39 -0
  133. package/resources/accounts/locate-orders.js.map +1 -0
  134. package/resources/accounts/locate-orders.mjs +35 -0
  135. package/resources/accounts/locate-orders.mjs.map +1 -0
  136. package/resources/accounts/orders.d.ts +164 -0
  137. package/resources/accounts/orders.d.ts.map +1 -0
  138. package/resources/accounts/orders.js +53 -0
  139. package/resources/accounts/orders.js.map +1 -0
  140. package/resources/accounts/orders.mjs +49 -0
  141. package/resources/accounts/orders.mjs.map +1 -0
  142. package/resources/accounts/pnl-details.d.ts +113 -0
  143. package/resources/accounts/pnl-details.d.ts.map +1 -0
  144. package/resources/accounts/pnl-details.js +17 -0
  145. package/resources/accounts/pnl-details.js.map +1 -0
  146. package/resources/accounts/pnl-details.mjs +13 -0
  147. package/resources/accounts/pnl-details.mjs.map +1 -0
  148. package/resources/accounts/pnl-summary.d.ts +10 -0
  149. package/resources/accounts/pnl-summary.d.ts.map +1 -0
  150. package/resources/accounts/pnl-summary.js +15 -0
  151. package/resources/accounts/pnl-summary.js.map +1 -0
  152. package/resources/accounts/pnl-summary.mjs +11 -0
  153. package/resources/accounts/pnl-summary.mjs.map +1 -0
  154. package/resources/accounts/pnl-sums.d.ts +138 -0
  155. package/resources/accounts/pnl-sums.d.ts.map +1 -0
  156. package/resources/accounts/pnl-sums.js +18 -0
  157. package/resources/accounts/pnl-sums.js.map +1 -0
  158. package/resources/accounts/pnl-sums.mjs +14 -0
  159. package/resources/accounts/pnl-sums.mjs.map +1 -0
  160. package/resources/accounts/positions.d.ts +37 -0
  161. package/resources/accounts/positions.d.ts.map +1 -0
  162. package/resources/accounts/positions.js +24 -0
  163. package/resources/accounts/positions.js.map +1 -0
  164. package/resources/accounts/positions.mjs +20 -0
  165. package/resources/accounts/positions.mjs.map +1 -0
  166. package/resources/accounts/trades.d.ts +37 -0
  167. package/resources/accounts/trades.d.ts.map +1 -0
  168. package/resources/accounts/trades.js +24 -0
  169. package/resources/accounts/trades.js.map +1 -0
  170. package/resources/accounts/trades.mjs +20 -0
  171. package/resources/accounts/trades.mjs.map +1 -0
  172. package/resources/entities/entities.d.ts +458 -0
  173. package/resources/entities/entities.d.ts.map +1 -0
  174. package/resources/entities/entities.js +61 -0
  175. package/resources/entities/entities.js.map +1 -0
  176. package/resources/entities/entities.mjs +34 -0
  177. package/resources/entities/entities.mjs.map +1 -0
  178. package/resources/entities/index.d.ts +6 -0
  179. package/resources/entities/index.d.ts.map +1 -0
  180. package/resources/entities/index.js +15 -0
  181. package/resources/entities/index.js.map +1 -0
  182. package/resources/entities/index.mjs +7 -0
  183. package/resources/entities/index.mjs.map +1 -0
  184. package/resources/entities/pnl-summaries.d.ts +10 -0
  185. package/resources/entities/pnl-summaries.d.ts.map +1 -0
  186. package/resources/entities/pnl-summaries.js +15 -0
  187. package/resources/entities/pnl-summaries.js.map +1 -0
  188. package/resources/entities/pnl-summaries.mjs +11 -0
  189. package/resources/entities/pnl-summaries.mjs.map +1 -0
  190. package/resources/entities/portfolio-margins.d.ts +10 -0
  191. package/resources/entities/portfolio-margins.d.ts.map +1 -0
  192. package/resources/entities/portfolio-margins.js +15 -0
  193. package/resources/entities/portfolio-margins.js.map +1 -0
  194. package/resources/entities/portfolio-margins.mjs +11 -0
  195. package/resources/entities/portfolio-margins.mjs.map +1 -0
  196. package/resources/entities/regt-margin-simulations.d.ts +97 -0
  197. package/resources/entities/regt-margin-simulations.d.ts.map +1 -0
  198. package/resources/entities/regt-margin-simulations.js +30 -0
  199. package/resources/entities/regt-margin-simulations.js.map +1 -0
  200. package/resources/entities/regt-margin-simulations.mjs +26 -0
  201. package/resources/entities/regt-margin-simulations.mjs.map +1 -0
  202. package/resources/entities/regt-margins.d.ts +10 -0
  203. package/resources/entities/regt-margins.d.ts.map +1 -0
  204. package/resources/entities/regt-margins.js +15 -0
  205. package/resources/entities/regt-margins.js.map +1 -0
  206. package/resources/entities/regt-margins.mjs +11 -0
  207. package/resources/entities/regt-margins.mjs.map +1 -0
  208. package/resources/index.d.ts +5 -0
  209. package/resources/index.d.ts.map +1 -0
  210. package/resources/index.js +26 -0
  211. package/resources/index.js.map +1 -0
  212. package/resources/index.mjs +6 -0
  213. package/resources/index.mjs.map +1 -0
  214. package/resources/instruments.d.ts +45 -0
  215. package/resources/instruments.d.ts.map +1 -0
  216. package/resources/instruments.js +18 -0
  217. package/resources/instruments.js.map +1 -0
  218. package/resources/instruments.mjs +14 -0
  219. package/resources/instruments.mjs.map +1 -0
  220. package/resources/shared.d.ts +332 -0
  221. package/resources/shared.d.ts.map +1 -0
  222. package/resources/shared.js +4 -0
  223. package/resources/shared.js.map +1 -0
  224. package/resources/shared.mjs +3 -0
  225. package/resources/shared.mjs.map +1 -0
  226. package/shims/node.d.ts +30 -0
  227. package/shims/node.d.ts.map +1 -0
  228. package/shims/node.js +31 -0
  229. package/shims/node.js.map +1 -0
  230. package/shims/node.mjs +5 -0
  231. package/shims/node.mjs.map +1 -0
  232. package/shims/web.d.ts +26 -0
  233. package/shims/web.d.ts.map +1 -0
  234. package/shims/web.js +31 -0
  235. package/shims/web.js.map +1 -0
  236. package/shims/web.mjs +5 -0
  237. package/shims/web.mjs.map +1 -0
  238. package/src/_shims/MultipartBody.ts +9 -0
  239. package/src/_shims/README.md +46 -0
  240. package/src/_shims/auto/runtime-bun.ts +4 -0
  241. package/src/_shims/auto/runtime-node.ts +4 -0
  242. package/src/_shims/auto/runtime.ts +4 -0
  243. package/src/_shims/auto/types-node.ts +4 -0
  244. package/src/_shims/auto/types.d.ts +101 -0
  245. package/src/_shims/auto/types.js +3 -0
  246. package/src/_shims/auto/types.mjs +3 -0
  247. package/src/_shims/bun-runtime.ts +14 -0
  248. package/src/_shims/index.d.ts +81 -0
  249. package/src/_shims/index.js +13 -0
  250. package/src/_shims/index.mjs +7 -0
  251. package/src/_shims/manual-types.d.ts +12 -0
  252. package/src/_shims/manual-types.js +3 -0
  253. package/src/_shims/manual-types.mjs +3 -0
  254. package/src/_shims/node-runtime.ts +81 -0
  255. package/src/_shims/node-types.d.ts +42 -0
  256. package/src/_shims/node-types.js +3 -0
  257. package/src/_shims/node-types.mjs +3 -0
  258. package/src/_shims/registry.ts +67 -0
  259. package/src/_shims/web-runtime.ts +103 -0
  260. package/src/_shims/web-types.d.ts +83 -0
  261. package/src/_shims/web-types.js +3 -0
  262. package/src/_shims/web-types.mjs +3 -0
  263. package/src/core.ts +1190 -0
  264. package/src/error.ts +146 -0
  265. package/src/index.ts +231 -0
  266. package/src/lib/.keep +4 -0
  267. package/src/resource.ts +11 -0
  268. package/src/resources/accounts/accounts.ts +97 -0
  269. package/src/resources/accounts/bulk-orders.ts +161 -0
  270. package/src/resources/accounts/easy-borrows.ts +23 -0
  271. package/src/resources/accounts/holdings.ts +103 -0
  272. package/src/resources/accounts/index.ts +27 -0
  273. package/src/resources/accounts/locate-orders.ts +94 -0
  274. package/src/resources/accounts/orders.ts +243 -0
  275. package/src/resources/accounts/pnl-details.ts +143 -0
  276. package/src/resources/accounts/pnl-summary.ts +14 -0
  277. package/src/resources/accounts/pnl-sums.ts +176 -0
  278. package/src/resources/accounts/positions.ts +66 -0
  279. package/src/resources/accounts/trades.ts +62 -0
  280. package/src/resources/entities/entities.ts +562 -0
  281. package/src/resources/entities/index.ts +12 -0
  282. package/src/resources/entities/pnl-summaries.ts +14 -0
  283. package/src/resources/entities/portfolio-margins.ts +14 -0
  284. package/src/resources/entities/regt-margin-simulations.ts +127 -0
  285. package/src/resources/entities/regt-margins.ts +14 -0
  286. package/src/resources/index.ts +13 -0
  287. package/src/resources/instruments.ts +70 -0
  288. package/src/resources/shared.ts +428 -0
  289. package/src/shims/node.ts +50 -0
  290. package/src/shims/web.ts +50 -0
  291. package/src/tsconfig.json +11 -0
  292. package/src/uploads.ts +255 -0
  293. package/src/version.ts +1 -0
  294. package/uploads.d.ts +75 -0
  295. package/uploads.d.ts.map +1 -0
  296. package/uploads.js +171 -0
  297. package/uploads.js.map +1 -0
  298. package/uploads.mjs +158 -0
  299. package/uploads.mjs.map +1 -0
  300. package/version.d.ts +2 -0
  301. package/version.d.ts.map +1 -0
  302. package/version.js +5 -0
  303. package/version.js.map +1 -0
  304. package/version.mjs +2 -0
  305. package/version.mjs.map +1 -0
@@ -0,0 +1,332 @@
1
+ import * as EntitiesAPI from "./entities/entities.js";
2
+ import * as RegtMarginSimulationsAPI from "./entities/regt-margin-simulations.js";
3
+ export interface BaseStrategy {
4
+ /**
5
+ * The type of strategy. This must be set to the respective strategy type.
6
+ */
7
+ type: 'sor' | 'dark' | 'ap' | 'pov' | 'twap' | 'vwap' | 'dma';
8
+ /**
9
+ * The timestamp to stop routing, defaults to market close.
10
+ */
11
+ end_at?: number;
12
+ /**
13
+ * The timestamp to start routing, defaults to now.
14
+ */
15
+ start_at?: number;
16
+ /**
17
+ * The urgency associated with the execution strategy.
18
+ */
19
+ urgency?: 'super-passive' | 'passive' | 'moderate' | 'aggressive' | 'super-aggressive';
20
+ }
21
+ export interface LocateOrder {
22
+ /**
23
+ * Account ID for the account.
24
+ */
25
+ account_id: string;
26
+ /**
27
+ * Unique locate ID assigned by us.
28
+ */
29
+ locate_order_id: string;
30
+ /**
31
+ * Unique MPID assigned by us.
32
+ */
33
+ mpid: string;
34
+ /**
35
+ * The timestamp indicating when the locate order was requested.
36
+ */
37
+ requested_at: number;
38
+ /**
39
+ * String representation of quantity.
40
+ */
41
+ requested_quantity: string;
42
+ /**
43
+ * The status of the locate order.
44
+ */
45
+ status: 'pending' | 'offered' | 'filled' | 'rejected' | 'declined' | 'expired' | 'cancelled';
46
+ symbol: string;
47
+ /**
48
+ * The timestamp indicating when the locate order was last updated.
49
+ */
50
+ updated_at: number;
51
+ /**
52
+ * The rate charged if the instrument is held overnight.
53
+ */
54
+ borrow_rate?: string;
55
+ /**
56
+ * Comment from the desk.
57
+ */
58
+ desk_comment?: string;
59
+ /**
60
+ * The timestamp indicating when the locate-order will expire.
61
+ */
62
+ expires_at?: number;
63
+ /**
64
+ * The locate ID, available once the locate order has been offered
65
+ */
66
+ locate_id?: string;
67
+ /**
68
+ * The timestamp indicating when the locate-order was located.
69
+ */
70
+ located_at?: number;
71
+ /**
72
+ * The quantity that has been located.
73
+ */
74
+ located_quantity?: string;
75
+ /**
76
+ * The reference ID provided by you.
77
+ */
78
+ reference_id?: string;
79
+ /**
80
+ * The total cost of the locate.
81
+ */
82
+ total_cost?: string;
83
+ /**
84
+ * Comment from the trader.
85
+ */
86
+ trader_comment?: string;
87
+ }
88
+ export interface Order {
89
+ /**
90
+ * Account ID for the account.
91
+ */
92
+ account_id: string;
93
+ /**
94
+ * When the order was created in milliseconds since epoch.
95
+ */
96
+ created_at: number;
97
+ /**
98
+ * The quantity that has been filled.
99
+ */
100
+ filled_quantity: string;
101
+ /**
102
+ * An internally generated unique ID for this order.
103
+ */
104
+ order_id: string;
105
+ /**
106
+ * The type of order, can be one of the following:
107
+ *
108
+ * - `limit`: A limit order will execute at-or-better than the limit price you
109
+ * specify
110
+ * - `market`: An order that will execute at the prevailing market prices
111
+ * - `stop`: A stop order will result in a market order when the market price
112
+ * reaches the specified stop price
113
+ * - `stop-limit`: A stop limit order will result in a limit order when the market
114
+ * price reaches the specified stop price
115
+ */
116
+ order_type: 'limit' | 'market' | 'stop' | 'stop-limit';
117
+ /**
118
+ * The requested quantity on this order.
119
+ */
120
+ quantity: string;
121
+ /**
122
+ * Buy, sell, sell-short indicator.
123
+ */
124
+ side: 'buy' | 'sell' | 'sell-short';
125
+ /**
126
+ * Simplified order state, which is inferred from `OrderStatus`. Makes it easier to
127
+ * determine whether an order can be executed against.
128
+ *
129
+ * - `open`: Order _can_ potentially be executed against.
130
+ * - `rejected`: Order _cannot_ be executed against because it was rejected. This
131
+ * is a terminal state.
132
+ * - `closed`: Order _cannot_ be executed against. This is a terminal state.
133
+ */
134
+ state: 'open' | 'rejected' | 'closed';
135
+ /**
136
+ * Granular order status using
137
+ * [standard values come FIX tag 39](https://www.fixtrading.org/online-specification/order-state-changes).
138
+ */
139
+ status: 'new' | 'partially-filled' | 'filled' | 'canceled' | 'replaced' | 'pending-cancel' | 'stopped' | 'rejected' | 'suspended' | 'pending-new' | 'calculated' | 'expired' | 'accepted-for-bidding' | 'pending-replace' | 'done-for-day';
140
+ symbol: string;
141
+ /**
142
+ * The lifecycle enforcement of this order.
143
+ *
144
+ * - `day`: The order will exist for the duration of the current trading session
145
+ * - `ioc`: The order will immediately be executed or cancelled
146
+ * - `day-plus`: The order will exist only for the duration the current trading
147
+ * session plus extended hours, if applicable
148
+ * - `at-open`: The order will exist only for the opening auction of the next
149
+ * session
150
+ * - `at-close`: The order will exist only for the closing auction of the current
151
+ * session
152
+ */
153
+ time_in_force: 'day' | 'ioc' | 'day-plus' | 'at-open' | 'at-close';
154
+ /**
155
+ * When the order was updated in milliseconds since epoch.
156
+ */
157
+ updated_at: number;
158
+ /**
159
+ * A monotonically increasing number indicating the version of this order. A higher
160
+ * number indicates a more recent version of the order.
161
+ */
162
+ version: number;
163
+ /**
164
+ * Calculated average price of all fills on this order.
165
+ */
166
+ average_price?: number;
167
+ /**
168
+ * The last reason why this order was updated
169
+ */
170
+ order_update_reason?: 'place' | 'modify' | 'cancel' | 'execution-report' | 'cancel-reject';
171
+ /**
172
+ * The requested limit price on this order.
173
+ */
174
+ price?: string;
175
+ /**
176
+ * The ID you provided when creating this order.
177
+ */
178
+ reference_id?: string;
179
+ /**
180
+ * The requested stop price on this order.
181
+ */
182
+ stop_price?: string;
183
+ /**
184
+ * The execution strategy used for this order.
185
+ */
186
+ strategy?: Strategy;
187
+ /**
188
+ * Free form text typically contains reasons for a reject.
189
+ */
190
+ text?: string;
191
+ }
192
+ export interface Position {
193
+ /**
194
+ * Account ID for the account.
195
+ */
196
+ account_id?: string;
197
+ /**
198
+ * String representation of quantity.
199
+ */
200
+ quantity?: string;
201
+ symbol?: string;
202
+ }
203
+ export interface RegtMarginSimulation {
204
+ /**
205
+ * The margin calculation after applying simulated trades.
206
+ */
207
+ after: EntitiesAPI.RegtMargin;
208
+ /**
209
+ * The margin calculation before applying simulated trades.
210
+ */
211
+ before: EntitiesAPI.RegtMargin;
212
+ /**
213
+ * Timestamp of when this simulation was created.
214
+ */
215
+ created_at: number;
216
+ /**
217
+ * Name of this simulation that you provided when creating it.
218
+ */
219
+ name: string;
220
+ /**
221
+ * Unique ID for a simulation.
222
+ */
223
+ simulation_id: RegtMarginSimulationsAPI.SimulationID;
224
+ }
225
+ export type Strategy = BaseStrategy | BaseStrategy | BaseStrategy | BaseStrategy | BaseStrategy | BaseStrategy | Strategy.DmaStrategy;
226
+ export declare namespace Strategy {
227
+ interface DmaStrategy {
228
+ /**
229
+ * Order Destination.
230
+ *
231
+ * <table><thead>
232
+ * <tr>
233
+ * <th>MIC</th>
234
+ * <th>Exchange</th>
235
+ * </tr></thead>
236
+ * <tbody>
237
+ * <tr>
238
+ * <td>ARCX</td>
239
+ * <td>NYSE ARCA</td>
240
+ * </tr>
241
+ * <tr>
242
+ * <td>BATS</td>
243
+ * <td>BATS Exchange</td>
244
+ * </tr>
245
+ * <tr>
246
+ * <td>BATY</td>
247
+ * <td>BATS Y Exchange</td>
248
+ * </tr>
249
+ * <tr>
250
+ * <td>EDGA</td>
251
+ * <td>EDGA Exchange</td>
252
+ * </tr>
253
+ * <tr>
254
+ * <td>EDGX</td>
255
+ * <td>EDGX Exchange</td>
256
+ * </tr>
257
+ * <tr>
258
+ * <td>EPRL</td>
259
+ * <td>MIAX Pearl Equities</td>
260
+ * </tr>
261
+ * <tr>
262
+ * <td>IEXG</td>
263
+ * <td>Investors' Exchange</td>
264
+ * </tr>
265
+ * <tr>
266
+ * <td>MEMX</td>
267
+ * <td>Members' Exchange</td>
268
+ * </tr>
269
+ * <tr>
270
+ * <td>XASE</td>
271
+ * <td>NYSE American</td>
272
+ * </tr>
273
+ * <tr>
274
+ * <td>XBOS</td>
275
+ * <td>NASDAQ BX Exchange</td>
276
+ * </tr>
277
+ * <tr>
278
+ * <td>XCIS</td>
279
+ * <td>NYSE National</td>
280
+ * </tr>
281
+ * <tr>
282
+ * <td>XNMS</td>
283
+ * <td>NASDAQ/NMS (Global Market)</td>
284
+ * </tr>
285
+ * <tr>
286
+ * <td>XNYS</td>
287
+ * <td>New York Stock Exchange</td>
288
+ * </tr>
289
+ * </tbody></table>
290
+ */
291
+ destination: 'arcx' | 'bats' | 'baty' | 'edga' | 'edgx' | 'eprl' | 'iexg' | 'memx' | 'xase' | 'xbos' | 'xcis' | 'xnms' | 'xnys';
292
+ /**
293
+ * The type of strategy. This must be set to the respective strategy type.
294
+ */
295
+ type: 'sor' | 'dark' | 'ap' | 'pov' | 'twap' | 'vwap' | 'dma';
296
+ }
297
+ }
298
+ export interface Trade {
299
+ /**
300
+ * When this trade happened in milliseconds since epoch.
301
+ */
302
+ created_at: number;
303
+ /**
304
+ * The order ID of the order this trade occurred on.
305
+ */
306
+ order_id: string;
307
+ /**
308
+ * The traded price.
309
+ */
310
+ price: string;
311
+ /**
312
+ * The amount that was traded.
313
+ */
314
+ quantity: string;
315
+ /**
316
+ * The side this trade occurred on.
317
+ */
318
+ side: 'buy' | 'sell' | 'sell-short';
319
+ /**
320
+ * Unique trade ID assigned by us.
321
+ */
322
+ trade_id: string;
323
+ /**
324
+ * Account ID for the account.
325
+ */
326
+ account_id?: string;
327
+ /**
328
+ * The symbol this trade was for.
329
+ */
330
+ symbol?: string;
331
+ }
332
+ //# sourceMappingURL=shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../src/resources/shared.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,WAAW,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,wBAAwB,MAAM,oCAAoC,CAAC;AAE/E,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,IAAI,EAAE,KAAK,GAAG,MAAM,GAAG,IAAI,GAAG,KAAK,GAA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EpC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=shared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.js","sourceRoot":"","sources":["../src/resources/shared.ts"],"names":[],"mappings":";AAAA,sFAAsF"}
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ export {};
3
+ //# sourceMappingURL=shared.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.mjs","sourceRoot":"","sources":["../src/resources/shared.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
@@ -0,0 +1,30 @@
1
+
2
+
3
+
4
+
5
+ import * as types from "../_shims/node-types.js";
6
+ declare module '../_shims/manual-types' {
7
+ namespace manual {
8
+ type Agent = types.Agent;
9
+ export import fetch = types.fetch;
10
+ type Request = types.Request;
11
+ type RequestInfo = types.RequestInfo;
12
+ type RequestInit = types.RequestInit;
13
+ type Response = types.Response;
14
+ type ResponseInit = types.ResponseInit;
15
+ type ResponseType = types.ResponseType;
16
+ type BodyInit = types.BodyInit;
17
+ type Headers = types.Headers;
18
+ type HeadersInit = types.HeadersInit;
19
+ type BlobPropertyBag = types.BlobPropertyBag;
20
+ type FilePropertyBag = types.FilePropertyBag;
21
+ type FileFromPathOptions = types.FileFromPathOptions;
22
+ export import FormData = types.FormData;
23
+ export import File = types.File;
24
+ export import Blob = types.Blob;
25
+ type Readable = types.Readable;
26
+ type FsReadStream = types.FsReadStream;
27
+ export import ReadableStream = types.ReadableStream;
28
+ }
29
+ }
30
+ //# sourceMappingURL=node.d.ts.map
@@ -0,0 +1 @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node.js ADDED
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ // @ts-ignore
27
+ const types = __importStar(require("../_shims/node-types.js"));
28
+ const registry_1 = require("../_shims/registry.js");
29
+ const node_runtime_1 = require("../_shims/node-runtime.js");
30
+ (0, registry_1.setShims)((0, node_runtime_1.getRuntime)());
31
+ //# sourceMappingURL=node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.js","sourceRoot":"","sources":["../src/shims/node.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,aAAa;AACb,+DAA8C;AAC9C,oDAA8C;AAC9C,4DAAoD;AACpD,IAAA,mBAAQ,EAAC,IAAA,yBAAU,GAAE,CAAC,CAAC"}
package/shims/node.mjs ADDED
@@ -0,0 +1,5 @@
1
+ import * as types from "../_shims/node-types.mjs";
2
+ import { setShims } from "../_shims/registry.mjs";
3
+ import { getRuntime } from "../_shims/node-runtime.mjs";
4
+ setShims(getRuntime());
5
+ //# sourceMappingURL=node.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.mjs","sourceRoot":"","sources":["../src/shims/node.ts"],"names":[],"mappings":"OACO,KAAK,KAAK;OACV,EAAE,QAAQ,EAAE;OACZ,EAAE,UAAU,EAAE;AACrB,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC"}
package/shims/web.d.ts ADDED
@@ -0,0 +1,26 @@
1
+ import * as types from "../_shims/web-types.js";
2
+ declare module '../_shims/manual-types' {
3
+ namespace manual {
4
+ type Agent = types.Agent;
5
+ export import fetch = types.fetch;
6
+ type Request = types.Request;
7
+ type RequestInfo = types.RequestInfo;
8
+ type RequestInit = types.RequestInit;
9
+ type Response = types.Response;
10
+ type ResponseInit = types.ResponseInit;
11
+ type ResponseType = types.ResponseType;
12
+ type BodyInit = types.BodyInit;
13
+ type Headers = types.Headers;
14
+ type HeadersInit = types.HeadersInit;
15
+ type BlobPropertyBag = types.BlobPropertyBag;
16
+ type FilePropertyBag = types.FilePropertyBag;
17
+ type FileFromPathOptions = types.FileFromPathOptions;
18
+ export import FormData = types.FormData;
19
+ export import File = types.File;
20
+ export import Blob = types.Blob;
21
+ type Readable = types.Readable;
22
+ type FsReadStream = types.FsReadStream;
23
+ export import ReadableStream = types.ReadableStream;
24
+ }
25
+ }
26
+ //# sourceMappingURL=web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web.d.ts","sourceRoot":"","sources":["../src/shims/web.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,qBAAqB,CAAC;AAK7C,OAAO,QAAQ,wBAAwB,CAAC;IACtC,UAAiB,MAAM,CAAC;QAEtB,KAAY,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;QAEhC,MAAM,QAAQ,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;QAElC,KAAY,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QAEpC,KAAY,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;QAE5C,KAAY,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;QAE5C,KAAY,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QAEtC,KAAY,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;QAE9C,KAAY,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;QAE9C,KAAY,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QAEtC,KAAY,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QAEpC,KAAY,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;QAE5C,KAAY,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC;QAEpD,KAAY,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC;QAEpD,KAAY,mBAAmB,GAAG,KAAK,CAAC,mBAAmB,CAAC;QAE5D,MAAM,QAAQ,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QAExC,MAAM,QAAQ,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;QAEhC,MAAM,QAAQ,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;QAEhC,KAAY,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QAEtC,KAAY,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;QAE9C,MAAM,QAAQ,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC;KACrD;CACF"}
package/shims/web.js ADDED
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ // @ts-ignore
27
+ const types = __importStar(require("../_shims/web-types.js"));
28
+ const registry_1 = require("../_shims/registry.js");
29
+ const web_runtime_1 = require("../_shims/web-runtime.js");
30
+ (0, registry_1.setShims)((0, web_runtime_1.getRuntime)({ manuallyImported: true }));
31
+ //# sourceMappingURL=web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web.js","sourceRoot":"","sources":["../src/shims/web.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,aAAa;AACb,8DAA6C;AAC7C,oDAA8C;AAC9C,0DAAmD;AACnD,IAAA,mBAAQ,EAAC,IAAA,wBAAU,EAAC,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC"}
package/shims/web.mjs ADDED
@@ -0,0 +1,5 @@
1
+ import * as types from "../_shims/web-types.mjs";
2
+ import { setShims } from "../_shims/registry.mjs";
3
+ import { getRuntime } from "../_shims/web-runtime.mjs";
4
+ setShims(getRuntime({ manuallyImported: true }));
5
+ //# sourceMappingURL=web.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web.mjs","sourceRoot":"","sources":["../src/shims/web.ts"],"names":[],"mappings":"OACO,KAAK,KAAK;OACV,EAAE,QAAQ,EAAE;OACZ,EAAE,UAAU,EAAE;AACrB,QAAQ,CAAC,UAAU,CAAC,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
+ */
4
+ export class MultipartBody {
5
+ constructor(public body: any) {}
6
+ get [Symbol.toStringTag](): string {
7
+ return 'MultipartBody';
8
+ }
9
+ }
@@ -0,0 +1,46 @@
1
+ # 👋 Wondering what everything in here does?
2
+
3
+ `@clear-street/studio-sdk` supports a wide variety of runtime environments like Node.js, Deno, Bun, browsers, and various
4
+ edge runtimes, as well as both CommonJS (CJS) and EcmaScript Modules (ESM).
5
+
6
+ To do this, `@clear-street/studio-sdk` provides shims for either using `node-fetch` when in Node (because `fetch` is still experimental there) or the global `fetch` API built into the environment when not in Node.
7
+
8
+ It uses [conditional exports](https://nodejs.org/api/packages.html#conditional-exports) to
9
+ automatically select the correct shims for each environment. However, conditional exports are a fairly new
10
+ feature and not supported everywhere. For instance, the TypeScript `"moduleResolution": "node"`
11
+
12
+ setting doesn't consult the `exports` map, compared to `"moduleResolution": "nodeNext"`, which does.
13
+ Unfortunately that's still the default setting, and it can result in errors like
14
+ getting the wrong raw `Response` type from `.asResponse()`, for example.
15
+
16
+ The user can work around these issues by manually importing one of:
17
+
18
+ - `import '@clear-street/studio-sdk/shims/node'`
19
+ - `import '@clear-street/studio-sdk/shims/web'`
20
+
21
+ All of the code here in `_shims` handles selecting the automatic default shims or manual overrides.
22
+
23
+ ### How it works - Runtime
24
+
25
+ Runtime shims get installed by calling `setShims` exported by `@clear-street/studio-sdk/_shims/registry`.
26
+
27
+ Manually importing `@clear-street/studio-sdk/shims/node` or `@clear-street/studio-sdk/shims/web`, calls `setShims` with the respective runtime shims.
28
+
29
+ All client code imports shims from `@clear-street/studio-sdk/_shims/index`, which:
30
+
31
+ - checks if shims have been set manually
32
+ - if not, calls `setShims` with the shims from `@clear-street/studio-sdk/_shims/auto/runtime`
33
+ - re-exports the installed shims from `@clear-street/studio-sdk/_shims/registry`.
34
+
35
+ `@clear-street/studio-sdk/_shims/auto/runtime` exports web runtime shims.
36
+ If the `node` export condition is set, the export map replaces it with `@clear-street/studio-sdk/_shims/auto/runtime-node`.
37
+
38
+ ### How it works - Type time
39
+
40
+ All client code imports shim types from `@clear-street/studio-sdk/_shims/index`, which selects the manual types from `@clear-street/studio-sdk/_shims/manual-types` if they have been declared, otherwise it exports the auto types from `@clear-street/studio-sdk/_shims/auto/types`.
41
+
42
+ `@clear-street/studio-sdk/_shims/manual-types` exports an empty namespace.
43
+ Manually importing `@clear-street/studio-sdk/shims/node` or `@clear-street/studio-sdk/shims/web` merges declarations into this empty namespace, so they get picked up by `@clear-street/studio-sdk/_shims/index`.
44
+
45
+ `@clear-street/studio-sdk/_shims/auto/types` exports web type definitions.
46
+ If the `node` export condition is set, the export map replaces it with `@clear-street/studio-sdk/_shims/auto/types-node`, though TS only picks this up if `"moduleResolution": "nodenext"` or `"moduleResolution": "bundler"`.
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
+ */
4
+ export * from '../bun-runtime';
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
+ */
4
+ export * from '../node-runtime';
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
+ */
4
+ export * from '../web-runtime';
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
+ */
4
+ export * from '../node-types';