@clear-street/clearstreet 0.113.0 → 0.114.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/CHANGELOG.md +14 -0
- package/package.json +1 -1
- package/resources/v1/accounts.d.mts +16 -1
- package/resources/v1/accounts.d.mts.map +1 -1
- package/resources/v1/accounts.d.ts +16 -1
- package/resources/v1/accounts.d.ts.map +1 -1
- package/resources/v1/calendar.d.mts +1 -2
- package/resources/v1/calendar.d.mts.map +1 -1
- package/resources/v1/calendar.d.ts +1 -2
- package/resources/v1/calendar.d.ts.map +1 -1
- package/resources/v1/index.d.mts +2 -2
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +2 -2
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/instrument-data/market-data.d.mts +12 -4
- package/resources/v1/instrument-data/market-data.d.mts.map +1 -1
- package/resources/v1/instrument-data/market-data.d.ts +12 -4
- package/resources/v1/instrument-data/market-data.d.ts.map +1 -1
- package/resources/v1/instrument-data/market-data.js +2 -4
- package/resources/v1/instrument-data/market-data.js.map +1 -1
- package/resources/v1/instrument-data/market-data.mjs +2 -4
- package/resources/v1/instrument-data/market-data.mjs.map +1 -1
- package/resources/v1/instruments.d.mts +536 -6
- package/resources/v1/instruments.d.mts.map +1 -1
- package/resources/v1/instruments.d.ts +536 -6
- package/resources/v1/instruments.d.ts.map +1 -1
- package/resources/v1/instruments.js +121 -0
- package/resources/v1/instruments.js.map +1 -1
- package/resources/v1/instruments.mjs +121 -0
- package/resources/v1/instruments.mjs.map +1 -1
- package/resources/v1/orders.d.mts +2 -2
- package/resources/v1/orders.d.mts.map +1 -1
- package/resources/v1/orders.d.ts +2 -2
- package/resources/v1/orders.d.ts.map +1 -1
- package/resources/v1/positions.d.mts +4 -0
- package/resources/v1/positions.d.mts.map +1 -1
- package/resources/v1/positions.d.ts +4 -0
- package/resources/v1/positions.d.ts.map +1 -1
- package/resources/v1/v1.d.mts +5 -5
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +5 -5
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs.map +1 -1
- package/src/resources/v1/accounts.ts +18 -0
- package/src/resources/v1/calendar.ts +1 -2
- package/src/resources/v1/index.ts +18 -0
- package/src/resources/v1/instrument-data/market-data.ts +13 -4
- package/src/resources/v1/instruments.ts +648 -5
- package/src/resources/v1/orders.ts +2 -2
- package/src/resources/v1/positions.ts +5 -0
- package/src/resources/v1/v1.ts +37 -1
- 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
|
@@ -66,6 +66,140 @@ export class Instruments extends APIResource {
|
|
|
66
66
|
return this._client.get('/v1/instruments/options/contracts', { query, ...options });
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
+
/**
|
|
70
|
+
* > **Alpha** — this endpoint is experimental and may change or be removed at any
|
|
71
|
+
* > time.
|
|
72
|
+
*
|
|
73
|
+
* Lists the distinct categories, sorted alphabetically, of every prediction market
|
|
74
|
+
* contract that can currently be listed: contracts that are initialized or active
|
|
75
|
+
* and have not yet closed.
|
|
76
|
+
*
|
|
77
|
+
* The list refreshes every 15 minutes. Returns `503` until the categories first
|
|
78
|
+
* load after a restart.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```ts
|
|
82
|
+
* const response =
|
|
83
|
+
* await client.v1.instruments.getPredictionCategories();
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
getPredictionCategories(options?: RequestOptions): APIPromise<InstrumentGetPredictionCategoriesResponse> {
|
|
87
|
+
return this._client.get('/v1/instruments/predictions/categories', options);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* > **Alpha** — this endpoint is experimental and may change or be removed at any
|
|
92
|
+
* > time.
|
|
93
|
+
*
|
|
94
|
+
* Lists the prediction market events that have at least one market that can
|
|
95
|
+
* currently be listed: initialized or active and not yet closed. A market that is
|
|
96
|
+
* paused does not count, so an event whose markets are all paused is not listed.
|
|
97
|
+
*
|
|
98
|
+
* Events are ordered by code unless `sort_by` names another key or `search` is
|
|
99
|
+
* set; ties break on code ascending. `series_codes` and `categories` keep events
|
|
100
|
+
* of those series or with a listable market in those categories, ignoring case.
|
|
101
|
+
*
|
|
102
|
+
* `search` keeps events whose code, series code, or a market's question or title
|
|
103
|
+
* contains every word of the text. Words match by prefix and English stem,
|
|
104
|
+
* ignoring case and punctuation; text with no searchable word, such as `the`,
|
|
105
|
+
* matches nothing. A word of four or more letters that matches nothing is replaced
|
|
106
|
+
* by up to three close spellings. Without `sort_by`, the best match comes first,
|
|
107
|
+
* closest spellings first. Search covers listable events unless
|
|
108
|
+
* `include_settled=true`.
|
|
109
|
+
*
|
|
110
|
+
* With `include_settled=true`, settled and expired events are listed too: every
|
|
111
|
+
* market counts as listable for `categories`, `title`, `open_at.*`, `close_at.*`,
|
|
112
|
+
* `search`, and `sort_by`. Such a request that takes longer than 30 seconds fails
|
|
113
|
+
* with `504`; narrow `search` or the filters and try again.
|
|
114
|
+
*
|
|
115
|
+
* `open_at.*` and `close_at.*` bound an event's open and close time, which are the
|
|
116
|
+
* earliest across its listable markets, and `sort_by` uses the same times.
|
|
117
|
+
*
|
|
118
|
+
* An event's `title` is the question of its first listable market by symbol, and
|
|
119
|
+
* its `categories` are those of its listable markets.
|
|
120
|
+
*
|
|
121
|
+
* With `include_markets=true`, each event carries `markets`: a summary of every
|
|
122
|
+
* market of the event, ordered by symbol, in any status. This includes paused
|
|
123
|
+
* markets of a listed event and settled markets. Pages carry no totals: follow
|
|
124
|
+
* `next_page_token` until it is absent.
|
|
125
|
+
*
|
|
126
|
+
* `market_ids` (1-100 market ids or tickers, in any status) keeps the events those
|
|
127
|
+
* markets belong to, each once, and the other filters still apply. Ids that match
|
|
128
|
+
* no market are reported: `207` with the events found and the missing ids in
|
|
129
|
+
* `error.details`, or `404` when none matched.
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* ```ts
|
|
133
|
+
* const response =
|
|
134
|
+
* await client.v1.instruments.getPredictionEvents();
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
137
|
+
getPredictionEvents(
|
|
138
|
+
query: InstrumentGetPredictionEventsParams | null | undefined = {},
|
|
139
|
+
options?: RequestOptions,
|
|
140
|
+
): APIPromise<InstrumentGetPredictionEventsResponse> {
|
|
141
|
+
return this._client.get('/v1/instruments/predictions/events', { query, ...options });
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* > **Alpha** — this endpoint is experimental and may change or be removed at any
|
|
146
|
+
* > time.
|
|
147
|
+
*
|
|
148
|
+
* Looks up prediction markets in any status, by `market_ids` (1-100 market ids or
|
|
149
|
+
* tickers) or by `event_code`. Exactly one of the two is required. Markets are
|
|
150
|
+
* ordered by symbol.
|
|
151
|
+
*
|
|
152
|
+
* `statuses` keeps markets in any listed status. It defaults to `OPEN` with
|
|
153
|
+
* `event_code` and to every status with `market_ids`.
|
|
154
|
+
*
|
|
155
|
+
* With `event_code`, pages carry no totals: follow `next_page_token` until it is
|
|
156
|
+
* absent. `market_ids` lookups are not paginated and ignore page parameters.
|
|
157
|
+
*
|
|
158
|
+
* With `market_ids`, ids that match no market are reported: `207` with the markets
|
|
159
|
+
* found and the missing ids in `error.details`, or `404` when none matched. A
|
|
160
|
+
* market removed only by `statuses` is not reported as missing.
|
|
161
|
+
*
|
|
162
|
+
* Each market trades one YES-denominated instrument; there is no NO instrument.
|
|
163
|
+
* Prices, including those from `/market-data/snapshot`, are YES prices in dollars,
|
|
164
|
+
* and `no_price = 1 - yes_price`. A negative position quantity is NO exposure.
|
|
165
|
+
*
|
|
166
|
+
* @example
|
|
167
|
+
* ```ts
|
|
168
|
+
* const response =
|
|
169
|
+
* await client.v1.instruments.getPredictionMarkets();
|
|
170
|
+
* ```
|
|
171
|
+
*/
|
|
172
|
+
getPredictionMarkets(
|
|
173
|
+
query: InstrumentGetPredictionMarketsParams | null | undefined = {},
|
|
174
|
+
options?: RequestOptions,
|
|
175
|
+
): APIPromise<InstrumentGetPredictionMarketsResponse> {
|
|
176
|
+
return this._client.get('/v1/instruments/predictions/markets', { query, ...options });
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* > **Alpha** — this endpoint is experimental and may change or be removed at any
|
|
181
|
+
* > time.
|
|
182
|
+
*
|
|
183
|
+
* Lists the distinct series codes of prediction markets that can currently be
|
|
184
|
+
* listed: markets that are initialized or active and have not yet closed. Series
|
|
185
|
+
* are ordered by code.
|
|
186
|
+
*
|
|
187
|
+
* `categories` keeps series with a market in any listed category, ignoring case.
|
|
188
|
+
* Pages carry no totals: follow `next_page_token` until it is absent.
|
|
189
|
+
*
|
|
190
|
+
* @example
|
|
191
|
+
* ```ts
|
|
192
|
+
* const response =
|
|
193
|
+
* await client.v1.instruments.getPredictionSeries();
|
|
194
|
+
* ```
|
|
195
|
+
*/
|
|
196
|
+
getPredictionSeries(
|
|
197
|
+
query: InstrumentGetPredictionSeriesParams | null | undefined = {},
|
|
198
|
+
options?: RequestOptions,
|
|
199
|
+
): APIPromise<InstrumentGetPredictionSeriesResponse> {
|
|
200
|
+
return this._client.get('/v1/instruments/predictions/series', { query, ...options });
|
|
201
|
+
}
|
|
202
|
+
|
|
69
203
|
/**
|
|
70
204
|
* Search instruments by symbol, alternate identifier, or company name.
|
|
71
205
|
*
|
|
@@ -255,8 +389,7 @@ export interface Instrument {
|
|
|
255
389
|
* or `NOT_SHORTABLE`. Easy-to-borrow instruments can be shorted without a locate.
|
|
256
390
|
* A hard-to-borrow instrument is not easy to borrow but has locate inventory
|
|
257
391
|
* remaining and supports short selling; anything else is not shortable. Omitted
|
|
258
|
-
* for instruments
|
|
259
|
-
* contracts are always `NOT_SHORTABLE`. When a null/undefined value is observed,
|
|
392
|
+
* for instruments it does not apply to. When a null/undefined value is observed,
|
|
260
393
|
* it indicates it does not apply.
|
|
261
394
|
*/
|
|
262
395
|
shortable_attribute?: ShortableAttribute | null;
|
|
@@ -401,8 +534,7 @@ export interface InstrumentCore {
|
|
|
401
534
|
* or `NOT_SHORTABLE`. Easy-to-borrow instruments can be shorted without a locate.
|
|
402
535
|
* A hard-to-borrow instrument is not easy to borrow but has locate inventory
|
|
403
536
|
* remaining and supports short selling; anything else is not shortable. Omitted
|
|
404
|
-
* for instruments
|
|
405
|
-
* contracts are always `NOT_SHORTABLE`. When a null/undefined value is observed,
|
|
537
|
+
* for instruments it does not apply to. When a null/undefined value is observed,
|
|
406
538
|
* it indicates it does not apply.
|
|
407
539
|
*/
|
|
408
540
|
shortable_attribute?: ShortableAttribute | null;
|
|
@@ -561,6 +693,267 @@ export interface OptionsContract {
|
|
|
561
693
|
|
|
562
694
|
export type OptionsContractList = Array<OptionsContract>;
|
|
563
695
|
|
|
696
|
+
/**
|
|
697
|
+
* Categories of the prediction market contracts that can currently be listed.
|
|
698
|
+
*/
|
|
699
|
+
export interface PredictionCategories {
|
|
700
|
+
/**
|
|
701
|
+
* Distinct categories, sorted alphabetically.
|
|
702
|
+
*/
|
|
703
|
+
categories: Array<string>;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
/**
|
|
707
|
+
* A prediction market event: a set of related markets that resolve together.
|
|
708
|
+
*/
|
|
709
|
+
export interface PredictionEvent {
|
|
710
|
+
/**
|
|
711
|
+
* Distinct categories of the event's listable markets, sorted alphabetically.
|
|
712
|
+
*/
|
|
713
|
+
categories: Array<string>;
|
|
714
|
+
|
|
715
|
+
/**
|
|
716
|
+
* Event code.
|
|
717
|
+
*/
|
|
718
|
+
code: string;
|
|
719
|
+
|
|
720
|
+
/**
|
|
721
|
+
* Every market of the event in any status, ordered by symbol. Present only when
|
|
722
|
+
* `include_markets` is `true`.
|
|
723
|
+
*/
|
|
724
|
+
markets?: Array<PredictionMarketSummary> | null;
|
|
725
|
+
|
|
726
|
+
/**
|
|
727
|
+
* The question of the event's first listable market, by symbol.
|
|
728
|
+
*/
|
|
729
|
+
title?: string | null;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
/**
|
|
733
|
+
* Prediction market events with at least one market that can currently be listed.
|
|
734
|
+
*/
|
|
735
|
+
export interface PredictionEvents {
|
|
736
|
+
/**
|
|
737
|
+
* Events in the requested order.
|
|
738
|
+
*/
|
|
739
|
+
events: Array<PredictionEvent>;
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
/**
|
|
743
|
+
* A prediction market.
|
|
744
|
+
*/
|
|
745
|
+
export interface PredictionMarket {
|
|
746
|
+
/**
|
|
747
|
+
* Instrument id of the market.
|
|
748
|
+
*/
|
|
749
|
+
id: string;
|
|
750
|
+
|
|
751
|
+
/**
|
|
752
|
+
* Whether the market may close before `close_at`.
|
|
753
|
+
*/
|
|
754
|
+
can_close_early: boolean;
|
|
755
|
+
|
|
756
|
+
/**
|
|
757
|
+
* Categories of the market.
|
|
758
|
+
*/
|
|
759
|
+
categories: Array<string>;
|
|
760
|
+
|
|
761
|
+
/**
|
|
762
|
+
* Code of the event the market belongs to.
|
|
763
|
+
*/
|
|
764
|
+
event_code: string;
|
|
765
|
+
|
|
766
|
+
/**
|
|
767
|
+
* Whether only orders that reduce a position are accepted.
|
|
768
|
+
*/
|
|
769
|
+
is_liquidation_only: boolean;
|
|
770
|
+
|
|
771
|
+
/**
|
|
772
|
+
* Whether the market accepts orders now.
|
|
773
|
+
*/
|
|
774
|
+
is_tradable: boolean;
|
|
775
|
+
|
|
776
|
+
/**
|
|
777
|
+
* Trading restrictions of the market.
|
|
778
|
+
*/
|
|
779
|
+
restrictions: Array<string>;
|
|
780
|
+
|
|
781
|
+
/**
|
|
782
|
+
* Code of the series the market belongs to.
|
|
783
|
+
*/
|
|
784
|
+
series_code: string;
|
|
785
|
+
|
|
786
|
+
/**
|
|
787
|
+
* Current status of the market.
|
|
788
|
+
*/
|
|
789
|
+
status: PredictionMarketStatus;
|
|
790
|
+
|
|
791
|
+
/**
|
|
792
|
+
* Market ticker.
|
|
793
|
+
*/
|
|
794
|
+
symbol: string;
|
|
795
|
+
|
|
796
|
+
/**
|
|
797
|
+
* When trading is scheduled to close.
|
|
798
|
+
*/
|
|
799
|
+
close_at?: string | null;
|
|
800
|
+
|
|
801
|
+
/**
|
|
802
|
+
* Link to the contract terms document.
|
|
803
|
+
*/
|
|
804
|
+
contract_terms_url?: string | null;
|
|
805
|
+
|
|
806
|
+
/**
|
|
807
|
+
* Condition under which the market closes early.
|
|
808
|
+
*/
|
|
809
|
+
early_close_condition?: string | null;
|
|
810
|
+
|
|
811
|
+
/**
|
|
812
|
+
* When settlement is expected after the market closes.
|
|
813
|
+
*/
|
|
814
|
+
expected_settlement_at?: string | null;
|
|
815
|
+
|
|
816
|
+
/**
|
|
817
|
+
* Full title of the market, event and market together.
|
|
818
|
+
*/
|
|
819
|
+
full_title?: string | null;
|
|
820
|
+
|
|
821
|
+
/**
|
|
822
|
+
* When trading opens.
|
|
823
|
+
*/
|
|
824
|
+
open_at?: string | null;
|
|
825
|
+
|
|
826
|
+
/**
|
|
827
|
+
* Winning side. Set only when `status` is `SETTLED` and the market resolved `YES`
|
|
828
|
+
* or `NO`. Absent otherwise, including for voided and scalar markets.
|
|
829
|
+
*/
|
|
830
|
+
outcome?: PredictionMarketOutcome | null;
|
|
831
|
+
|
|
832
|
+
/**
|
|
833
|
+
* The question the market resolves.
|
|
834
|
+
*/
|
|
835
|
+
predicate?: string | null;
|
|
836
|
+
|
|
837
|
+
/**
|
|
838
|
+
* Primary rules of the market.
|
|
839
|
+
*/
|
|
840
|
+
rules_primary?: string | null;
|
|
841
|
+
|
|
842
|
+
/**
|
|
843
|
+
* Secondary rules of the market.
|
|
844
|
+
*/
|
|
845
|
+
rules_secondary?: string | null;
|
|
846
|
+
|
|
847
|
+
/**
|
|
848
|
+
* Settlement value of the YES side, in dollars per contract. Set only when
|
|
849
|
+
* `status` is `SETTLED`, and absent otherwise.
|
|
850
|
+
*/
|
|
851
|
+
settlement_price?: string | null;
|
|
852
|
+
|
|
853
|
+
/**
|
|
854
|
+
* Short title of the market, for example the name of the candidate.
|
|
855
|
+
*/
|
|
856
|
+
title?: string | null;
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
/**
|
|
860
|
+
* Winning side of a settled prediction market.
|
|
861
|
+
*/
|
|
862
|
+
export type PredictionMarketOutcome = 'YES' | 'NO';
|
|
863
|
+
|
|
864
|
+
/**
|
|
865
|
+
* Coarse status of a prediction market.
|
|
866
|
+
*/
|
|
867
|
+
export type PredictionMarketStatus = 'OPEN' | 'UNOPENED' | 'PAUSED' | 'CLOSED' | 'SETTLED';
|
|
868
|
+
|
|
869
|
+
/**
|
|
870
|
+
* Summary of a prediction market inside an event listing. Request the market by
|
|
871
|
+
* `id` or `symbol` for its full detail.
|
|
872
|
+
*/
|
|
873
|
+
export interface PredictionMarketSummary {
|
|
874
|
+
/**
|
|
875
|
+
* Instrument id of the market.
|
|
876
|
+
*/
|
|
877
|
+
id: string;
|
|
878
|
+
|
|
879
|
+
/**
|
|
880
|
+
* Whether only orders that reduce a position are accepted.
|
|
881
|
+
*/
|
|
882
|
+
is_liquidation_only: boolean;
|
|
883
|
+
|
|
884
|
+
/**
|
|
885
|
+
* Whether the market accepts orders now.
|
|
886
|
+
*/
|
|
887
|
+
is_tradable: boolean;
|
|
888
|
+
|
|
889
|
+
/**
|
|
890
|
+
* Current status of the market.
|
|
891
|
+
*/
|
|
892
|
+
status: PredictionMarketStatus;
|
|
893
|
+
|
|
894
|
+
/**
|
|
895
|
+
* Market ticker.
|
|
896
|
+
*/
|
|
897
|
+
symbol: string;
|
|
898
|
+
|
|
899
|
+
/**
|
|
900
|
+
* When trading is scheduled to close.
|
|
901
|
+
*/
|
|
902
|
+
close_at?: string | null;
|
|
903
|
+
|
|
904
|
+
/**
|
|
905
|
+
* When trading opens.
|
|
906
|
+
*/
|
|
907
|
+
open_at?: string | null;
|
|
908
|
+
|
|
909
|
+
/**
|
|
910
|
+
* Winning side. Set only when `status` is `SETTLED` and the market resolved `YES`
|
|
911
|
+
* or `NO`. Absent otherwise, including for voided and scalar markets.
|
|
912
|
+
*/
|
|
913
|
+
outcome?: PredictionMarketOutcome | null;
|
|
914
|
+
|
|
915
|
+
/**
|
|
916
|
+
* Settlement value of the YES side, in dollars per contract. Set only when
|
|
917
|
+
* `status` is `SETTLED`, and absent otherwise.
|
|
918
|
+
*/
|
|
919
|
+
settlement_price?: string | null;
|
|
920
|
+
|
|
921
|
+
/**
|
|
922
|
+
* Short title of the market, for example the name of the candidate.
|
|
923
|
+
*/
|
|
924
|
+
title?: string | null;
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
/**
|
|
928
|
+
* Prediction markets matching the request.
|
|
929
|
+
*/
|
|
930
|
+
export interface PredictionMarkets {
|
|
931
|
+
/**
|
|
932
|
+
* Markets ordered by symbol.
|
|
933
|
+
*/
|
|
934
|
+
markets: Array<PredictionMarket>;
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
/**
|
|
938
|
+
* A prediction market series: a family of related markets that share a code.
|
|
939
|
+
*/
|
|
940
|
+
export interface PredictionSeries {
|
|
941
|
+
/**
|
|
942
|
+
* Series code, shared by the markets in the family.
|
|
943
|
+
*/
|
|
944
|
+
code: string;
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
/**
|
|
948
|
+
* Prediction market series with at least one market that can currently be listed.
|
|
949
|
+
*/
|
|
950
|
+
export interface PredictionSeriesList {
|
|
951
|
+
/**
|
|
952
|
+
* Series ordered by code.
|
|
953
|
+
*/
|
|
954
|
+
series: Array<PredictionSeries>;
|
|
955
|
+
}
|
|
956
|
+
|
|
564
957
|
/**
|
|
565
958
|
* How readily a tradable equity can be shorted.
|
|
566
959
|
*/
|
|
@@ -604,6 +997,34 @@ export interface InstrumentGetOptionContractsResponse extends Shared.BaseRespons
|
|
|
604
997
|
data: OptionsContractList;
|
|
605
998
|
}
|
|
606
999
|
|
|
1000
|
+
export interface InstrumentGetPredictionCategoriesResponse extends Shared.BaseResponse {
|
|
1001
|
+
/**
|
|
1002
|
+
* Categories of the prediction market contracts that can currently be listed.
|
|
1003
|
+
*/
|
|
1004
|
+
data: PredictionCategories;
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
export interface InstrumentGetPredictionEventsResponse extends Shared.BaseResponse {
|
|
1008
|
+
/**
|
|
1009
|
+
* Prediction market events with at least one market that can currently be listed.
|
|
1010
|
+
*/
|
|
1011
|
+
data: PredictionEvents;
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
export interface InstrumentGetPredictionMarketsResponse extends Shared.BaseResponse {
|
|
1015
|
+
/**
|
|
1016
|
+
* Prediction markets matching the request.
|
|
1017
|
+
*/
|
|
1018
|
+
data: PredictionMarkets;
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
export interface InstrumentGetPredictionSeriesResponse extends Shared.BaseResponse {
|
|
1022
|
+
/**
|
|
1023
|
+
* Prediction market series with at least one market that can currently be listed.
|
|
1024
|
+
*/
|
|
1025
|
+
data: PredictionSeriesList;
|
|
1026
|
+
}
|
|
1027
|
+
|
|
607
1028
|
export interface InstrumentSearchInstrumentsResponse extends Shared.BaseResponse {
|
|
608
1029
|
data: InstrumentCoreList;
|
|
609
1030
|
}
|
|
@@ -630,7 +1051,7 @@ export interface InstrumentGetInstrumentsParams {
|
|
|
630
1051
|
/**
|
|
631
1052
|
* Filter by instrument type (e.g. COMMON_STOCK, OPTION)
|
|
632
1053
|
*/
|
|
633
|
-
instrument_type?: 'COMMON_STOCK' | 'INDEX' | 'OPTION' | 'CASH';
|
|
1054
|
+
instrument_type?: 'COMMON_STOCK' | 'INDEX' | 'OPTION' | 'CASH' | 'EVENT_CONTRACT';
|
|
634
1055
|
|
|
635
1056
|
/**
|
|
636
1057
|
* Filter by liquidation only status
|
|
@@ -723,6 +1144,211 @@ export interface InstrumentGetOptionContractsParams {
|
|
|
723
1144
|
underlying_instrument_id?: string;
|
|
724
1145
|
}
|
|
725
1146
|
|
|
1147
|
+
export interface InstrumentGetPredictionEventsParams {
|
|
1148
|
+
/**
|
|
1149
|
+
* Comma-separated categories. Keeps events with a listable market in any of them,
|
|
1150
|
+
* ignoring case.
|
|
1151
|
+
*/
|
|
1152
|
+
categories?: string;
|
|
1153
|
+
|
|
1154
|
+
close_at?: InstrumentGetPredictionEventsParams.CloseAt;
|
|
1155
|
+
|
|
1156
|
+
/**
|
|
1157
|
+
* Embed a summary of every market of each event, in any status. Default false.
|
|
1158
|
+
*/
|
|
1159
|
+
include_markets?: boolean;
|
|
1160
|
+
|
|
1161
|
+
/**
|
|
1162
|
+
* Also list settled and expired events, not only events with a listable market.
|
|
1163
|
+
* Every market then counts as listable for the other filters, `title`,
|
|
1164
|
+
* `categories`, and the open and close times. Default false. A request that takes
|
|
1165
|
+
* longer than 30 seconds fails with `504`; narrow `search` or the filters and try
|
|
1166
|
+
* again.
|
|
1167
|
+
*/
|
|
1168
|
+
include_settled?: boolean;
|
|
1169
|
+
|
|
1170
|
+
/**
|
|
1171
|
+
* Comma-separated market ids (UUID) or tickers, 1-100. Keeps events of those
|
|
1172
|
+
* markets, in any status; the other filters still apply. Ids that match no market
|
|
1173
|
+
* are reported: `207`, or `404` when none match.
|
|
1174
|
+
*/
|
|
1175
|
+
market_ids?: string;
|
|
1176
|
+
|
|
1177
|
+
open_at?: InstrumentGetPredictionEventsParams.OpenAt;
|
|
1178
|
+
|
|
1179
|
+
/**
|
|
1180
|
+
* The number of items to return per page. Only used when page_token is not
|
|
1181
|
+
* provided.
|
|
1182
|
+
*/
|
|
1183
|
+
page_size?: number;
|
|
1184
|
+
|
|
1185
|
+
/**
|
|
1186
|
+
* Token for retrieving the next or previous page of results. Contains encoded
|
|
1187
|
+
* pagination state; when provided, page_size is ignored.
|
|
1188
|
+
*/
|
|
1189
|
+
page_token?: string;
|
|
1190
|
+
|
|
1191
|
+
/**
|
|
1192
|
+
* Keeps events whose code, series code, or a market's question or title contains
|
|
1193
|
+
* every word, matched by prefix and English stem, ignoring case. Searches listable
|
|
1194
|
+
* events, or every event with `include_settled`. A word of four or more letters
|
|
1195
|
+
* that matches nothing is replaced by up to three close spellings. Without
|
|
1196
|
+
* `sort_by`, orders by relevance, closest spellings first.
|
|
1197
|
+
*/
|
|
1198
|
+
search?: string;
|
|
1199
|
+
|
|
1200
|
+
/**
|
|
1201
|
+
* Comma-separated series codes. Keeps events of those series, ignoring case.
|
|
1202
|
+
*/
|
|
1203
|
+
series_codes?: string;
|
|
1204
|
+
|
|
1205
|
+
/**
|
|
1206
|
+
* Sort key. Defaults to relevance when `search` is set, else the event code. Ties
|
|
1207
|
+
* break on event code ascending.
|
|
1208
|
+
*/
|
|
1209
|
+
sort_by?: 'OPEN_AT' | 'CLOSE_AT';
|
|
1210
|
+
|
|
1211
|
+
/**
|
|
1212
|
+
* Sort direction. Defaults to ascending. Ignored when sorting by relevance.
|
|
1213
|
+
*/
|
|
1214
|
+
sort_direction?: 'ASC' | 'DESC';
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
export namespace InstrumentGetPredictionEventsParams {
|
|
1218
|
+
export interface CloseAt {
|
|
1219
|
+
/**
|
|
1220
|
+
* Return only rows where `close_at` is strictly after the given value. A bare
|
|
1221
|
+
* `YYYY-MM-DD` date expands to the end of that day (UTC), so this matches from the
|
|
1222
|
+
* start of the following day. See
|
|
1223
|
+
* [Range filters](https://docs.clearstreet.com/guides/api-fundamentals#range-filters)
|
|
1224
|
+
* for accepted formats, bare-date expansion, and combining bounds. Returns 400 if
|
|
1225
|
+
* the resulting range is inverted.
|
|
1226
|
+
*/
|
|
1227
|
+
gt?: string;
|
|
1228
|
+
|
|
1229
|
+
/**
|
|
1230
|
+
* Return only rows where `close_at` is on or after the given value. A bare
|
|
1231
|
+
* `YYYY-MM-DD` date expands to the start of that day (UTC). See
|
|
1232
|
+
* [Range filters](https://docs.clearstreet.com/guides/api-fundamentals#range-filters)
|
|
1233
|
+
* for accepted formats, bare-date expansion, and combining bounds. Returns 400 if
|
|
1234
|
+
* the resulting range is inverted.
|
|
1235
|
+
*/
|
|
1236
|
+
gte?: string;
|
|
1237
|
+
|
|
1238
|
+
/**
|
|
1239
|
+
* Return only rows where `close_at` is strictly before the given value. A bare
|
|
1240
|
+
* `YYYY-MM-DD` date expands to the start of that day (UTC). See
|
|
1241
|
+
* [Range filters](https://docs.clearstreet.com/guides/api-fundamentals#range-filters)
|
|
1242
|
+
* for accepted formats, bare-date expansion, and combining bounds. Returns 400 if
|
|
1243
|
+
* the resulting range is inverted.
|
|
1244
|
+
*/
|
|
1245
|
+
lt?: string;
|
|
1246
|
+
|
|
1247
|
+
/**
|
|
1248
|
+
* Return only rows where `close_at` is on or before the given value. A bare
|
|
1249
|
+
* `YYYY-MM-DD` date expands to the end of that day (UTC), so this matches through
|
|
1250
|
+
* the end of that day. See
|
|
1251
|
+
* [Range filters](https://docs.clearstreet.com/guides/api-fundamentals#range-filters)
|
|
1252
|
+
* for accepted formats, bare-date expansion, and combining bounds. Returns 400 if
|
|
1253
|
+
* the resulting range is inverted.
|
|
1254
|
+
*/
|
|
1255
|
+
lte?: string;
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
export interface OpenAt {
|
|
1259
|
+
/**
|
|
1260
|
+
* Return only rows where `open_at` is strictly after the given value. A bare
|
|
1261
|
+
* `YYYY-MM-DD` date expands to the end of that day (UTC), so this matches from the
|
|
1262
|
+
* start of the following day. See
|
|
1263
|
+
* [Range filters](https://docs.clearstreet.com/guides/api-fundamentals#range-filters)
|
|
1264
|
+
* for accepted formats, bare-date expansion, and combining bounds. Returns 400 if
|
|
1265
|
+
* the resulting range is inverted.
|
|
1266
|
+
*/
|
|
1267
|
+
gt?: string;
|
|
1268
|
+
|
|
1269
|
+
/**
|
|
1270
|
+
* Return only rows where `open_at` is on or after the given value. A bare
|
|
1271
|
+
* `YYYY-MM-DD` date expands to the start of that day (UTC). See
|
|
1272
|
+
* [Range filters](https://docs.clearstreet.com/guides/api-fundamentals#range-filters)
|
|
1273
|
+
* for accepted formats, bare-date expansion, and combining bounds. Returns 400 if
|
|
1274
|
+
* the resulting range is inverted.
|
|
1275
|
+
*/
|
|
1276
|
+
gte?: string;
|
|
1277
|
+
|
|
1278
|
+
/**
|
|
1279
|
+
* Return only rows where `open_at` is strictly before the given value. A bare
|
|
1280
|
+
* `YYYY-MM-DD` date expands to the start of that day (UTC). See
|
|
1281
|
+
* [Range filters](https://docs.clearstreet.com/guides/api-fundamentals#range-filters)
|
|
1282
|
+
* for accepted formats, bare-date expansion, and combining bounds. Returns 400 if
|
|
1283
|
+
* the resulting range is inverted.
|
|
1284
|
+
*/
|
|
1285
|
+
lt?: string;
|
|
1286
|
+
|
|
1287
|
+
/**
|
|
1288
|
+
* Return only rows where `open_at` is on or before the given value. A bare
|
|
1289
|
+
* `YYYY-MM-DD` date expands to the end of that day (UTC), so this matches through
|
|
1290
|
+
* the end of that day. See
|
|
1291
|
+
* [Range filters](https://docs.clearstreet.com/guides/api-fundamentals#range-filters)
|
|
1292
|
+
* for accepted formats, bare-date expansion, and combining bounds. Returns 400 if
|
|
1293
|
+
* the resulting range is inverted.
|
|
1294
|
+
*/
|
|
1295
|
+
lte?: string;
|
|
1296
|
+
}
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
export interface InstrumentGetPredictionMarketsParams {
|
|
1300
|
+
/**
|
|
1301
|
+
* Event code; returns the markets of the event. Mutually exclusive with
|
|
1302
|
+
* `market_ids`.
|
|
1303
|
+
*/
|
|
1304
|
+
event_code?: string;
|
|
1305
|
+
|
|
1306
|
+
/**
|
|
1307
|
+
* Comma-separated market ids (UUID) or tickers, 1-100, in any status. Mutually
|
|
1308
|
+
* exclusive with `event_code`.
|
|
1309
|
+
*/
|
|
1310
|
+
market_ids?: string;
|
|
1311
|
+
|
|
1312
|
+
/**
|
|
1313
|
+
* The number of items to return per page. Only used when page_token is not
|
|
1314
|
+
* provided.
|
|
1315
|
+
*/
|
|
1316
|
+
page_size?: number;
|
|
1317
|
+
|
|
1318
|
+
/**
|
|
1319
|
+
* Token for retrieving the next or previous page of results. Contains encoded
|
|
1320
|
+
* pagination state; when provided, page_size is ignored.
|
|
1321
|
+
*/
|
|
1322
|
+
page_token?: string;
|
|
1323
|
+
|
|
1324
|
+
/**
|
|
1325
|
+
* Comma-separated statuses to keep: `OPEN`, `UNOPENED`, `PAUSED`, `CLOSED`,
|
|
1326
|
+
* `SETTLED`. Defaults to `OPEN` with `event_code` and to every status with
|
|
1327
|
+
* `market_ids`. Unrecognized values are ignored.
|
|
1328
|
+
*/
|
|
1329
|
+
statuses?: string;
|
|
1330
|
+
}
|
|
1331
|
+
|
|
1332
|
+
export interface InstrumentGetPredictionSeriesParams {
|
|
1333
|
+
/**
|
|
1334
|
+
* Comma-separated categories. Keeps series with a market in any of them, ignoring
|
|
1335
|
+
* case.
|
|
1336
|
+
*/
|
|
1337
|
+
categories?: string;
|
|
1338
|
+
|
|
1339
|
+
/**
|
|
1340
|
+
* The number of items to return per page. Only used when page_token is not
|
|
1341
|
+
* provided.
|
|
1342
|
+
*/
|
|
1343
|
+
page_size?: number;
|
|
1344
|
+
|
|
1345
|
+
/**
|
|
1346
|
+
* Token for retrieving the next or previous page of results. Contains encoded
|
|
1347
|
+
* pagination state; when provided, page_size is ignored.
|
|
1348
|
+
*/
|
|
1349
|
+
page_token?: string;
|
|
1350
|
+
}
|
|
1351
|
+
|
|
726
1352
|
export interface InstrumentSearchInstrumentsParams {
|
|
727
1353
|
/**
|
|
728
1354
|
* Search term applied case-insensitively to ticker symbols, alternate identifiers
|
|
@@ -783,15 +1409,32 @@ export declare namespace Instruments {
|
|
|
783
1409
|
type OptionExpiryDate as OptionExpiryDate,
|
|
784
1410
|
type OptionsContract as OptionsContract,
|
|
785
1411
|
type OptionsContractList as OptionsContractList,
|
|
1412
|
+
type PredictionCategories as PredictionCategories,
|
|
1413
|
+
type PredictionEvent as PredictionEvent,
|
|
1414
|
+
type PredictionEvents as PredictionEvents,
|
|
1415
|
+
type PredictionMarket as PredictionMarket,
|
|
1416
|
+
type PredictionMarketOutcome as PredictionMarketOutcome,
|
|
1417
|
+
type PredictionMarketStatus as PredictionMarketStatus,
|
|
1418
|
+
type PredictionMarketSummary as PredictionMarketSummary,
|
|
1419
|
+
type PredictionMarkets as PredictionMarkets,
|
|
1420
|
+
type PredictionSeries as PredictionSeries,
|
|
1421
|
+
type PredictionSeriesList as PredictionSeriesList,
|
|
786
1422
|
type ShortableAttribute as ShortableAttribute,
|
|
787
1423
|
type TickRule as TickRule,
|
|
788
1424
|
type InstrumentGetInstrumentByIDResponse as InstrumentGetInstrumentByIDResponse,
|
|
789
1425
|
type InstrumentGetInstrumentsResponse as InstrumentGetInstrumentsResponse,
|
|
790
1426
|
type InstrumentGetOptionContractsResponse as InstrumentGetOptionContractsResponse,
|
|
1427
|
+
type InstrumentGetPredictionCategoriesResponse as InstrumentGetPredictionCategoriesResponse,
|
|
1428
|
+
type InstrumentGetPredictionEventsResponse as InstrumentGetPredictionEventsResponse,
|
|
1429
|
+
type InstrumentGetPredictionMarketsResponse as InstrumentGetPredictionMarketsResponse,
|
|
1430
|
+
type InstrumentGetPredictionSeriesResponse as InstrumentGetPredictionSeriesResponse,
|
|
791
1431
|
type InstrumentSearchInstrumentsResponse as InstrumentSearchInstrumentsResponse,
|
|
792
1432
|
type InstrumentGetInstrumentByIDParams as InstrumentGetInstrumentByIDParams,
|
|
793
1433
|
type InstrumentGetInstrumentsParams as InstrumentGetInstrumentsParams,
|
|
794
1434
|
type InstrumentGetOptionContractsParams as InstrumentGetOptionContractsParams,
|
|
1435
|
+
type InstrumentGetPredictionEventsParams as InstrumentGetPredictionEventsParams,
|
|
1436
|
+
type InstrumentGetPredictionMarketsParams as InstrumentGetPredictionMarketsParams,
|
|
1437
|
+
type InstrumentGetPredictionSeriesParams as InstrumentGetPredictionSeriesParams,
|
|
795
1438
|
type InstrumentSearchInstrumentsParams as InstrumentSearchInstrumentsParams,
|
|
796
1439
|
};
|
|
797
1440
|
}
|