1 | import {
|
2 | OrderSide,
|
3 | OrderType,
|
4 | OrderTimeInForce,
|
5 | DataSource,
|
6 | } from './entities.js';
|
7 |
|
8 | export interface AddToWatchList {
|
9 | uuid: string;
|
10 | symbol: string;
|
11 | }
|
12 |
|
13 | export interface CancelOrder {
|
14 | order_id: string;
|
15 | }
|
16 |
|
17 | export interface ClosePosition {
|
18 | symbol: string;
|
19 | qty?: number;
|
20 | percentage?: number;
|
21 | }
|
22 |
|
23 | export interface ClosePositions {
|
24 | cancel_orders?: boolean;
|
25 | }
|
26 |
|
27 | export interface CreateWatchList {
|
28 | name: string;
|
29 | symbols?: string[];
|
30 | }
|
31 |
|
32 | export interface DeleteWatchList {
|
33 | uuid: string;
|
34 | }
|
35 |
|
36 | export interface GetAccountActivities {
|
37 | activity_type?: string;
|
38 | activity_types?: string | string[];
|
39 | date?: string;
|
40 | until?: string;
|
41 | after?: string;
|
42 | direction?: 'asc' | 'desc';
|
43 | page_size?: number;
|
44 | page_token?: string;
|
45 | }
|
46 |
|
47 | export interface GetAsset {
|
48 | asset_id_or_symbol: string;
|
49 | }
|
50 |
|
51 | export interface GetAssets {
|
52 | status?: 'active' | 'inactive';
|
53 | asset_class?: string;
|
54 | }
|
55 |
|
56 | export interface GetCalendar {
|
57 | start?: Date;
|
58 | end?: Date;
|
59 | }
|
60 |
|
61 | export interface GetTrades {
|
62 | symbol: string;
|
63 | start: Date;
|
64 | end: Date;
|
65 | limit?: number;
|
66 | page_token?: string;
|
67 | }
|
68 |
|
69 | export interface GetQuotes {
|
70 | symbol: string;
|
71 | start: Date;
|
72 | end: Date;
|
73 | limit?: number;
|
74 | page_token?: string;
|
75 | }
|
76 |
|
77 | export interface GetSnapshot {
|
78 | symbol: string;
|
79 | }
|
80 |
|
81 | export interface GetSnapshots {
|
82 | symbols: string[];
|
83 | }
|
84 |
|
85 | export interface GetBars {
|
86 | symbol: string;
|
87 | start: Date;
|
88 | end: Date;
|
89 | limit?: number;
|
90 | page_token?: string;
|
91 | timeframe: BarsTimeframe;
|
92 | adjustment?: 'all' | 'dividend' | 'raw' | 'split';
|
93 | }
|
94 |
|
95 | export interface GetBars_v1 {
|
96 | timeframe: BarsV1Timeframe;
|
97 | symbols: string[];
|
98 | limit?: number;
|
99 | start?: Date;
|
100 | end?: Date;
|
101 | after?: Date;
|
102 | until?: Date;
|
103 | }
|
104 |
|
105 | export interface GetLastQuote_v1 {
|
106 | symbol: string;
|
107 | }
|
108 |
|
109 | export interface GetLastTrade_v1 {
|
110 | symbol: string;
|
111 | }
|
112 |
|
113 | export interface GetOrder {
|
114 | order_id?: string;
|
115 | client_order_id?: string;
|
116 | nested?: boolean;
|
117 | }
|
118 |
|
119 | export interface GetOrders {
|
120 | status?: 'open' | 'closed' | 'all';
|
121 | limit?: number;
|
122 | after?: Date;
|
123 | until?: Date;
|
124 | direction?: 'asc' | 'desc';
|
125 | nested?: boolean;
|
126 | symbols?: string[];
|
127 | }
|
128 |
|
129 | export interface GetPortfolioHistory {
|
130 | period?: string;
|
131 | timeframe?: string;
|
132 | date_end?: Date;
|
133 | extended_hours?: boolean;
|
134 | }
|
135 |
|
136 | export interface GetPosition {
|
137 | symbol: string;
|
138 | }
|
139 |
|
140 | export interface GetWatchList {
|
141 | uuid: string;
|
142 | }
|
143 |
|
144 | export interface PlaceOrder {
|
145 | symbol: string;
|
146 | side: OrderSide;
|
147 | type: OrderType;
|
148 | time_in_force: OrderTimeInForce;
|
149 | qty?: number;
|
150 | notional?: number;
|
151 | limit_price?: number;
|
152 | stop_price?: number;
|
153 | extended_hours?: boolean;
|
154 | client_order_id?: string;
|
155 | trail_price?: number;
|
156 | trail_percent?: number;
|
157 | order_class?: 'simple' | 'bracket' | 'oco' | 'oto';
|
158 | take_profit?: {
|
159 | limit_price: number;
|
160 | };
|
161 | stop_loss?: {
|
162 | stop_price: number;
|
163 | limit_price?: number;
|
164 | };
|
165 | }
|
166 |
|
167 | export interface RemoveFromWatchList {
|
168 | uuid: string;
|
169 | symbol: string;
|
170 | }
|
171 |
|
172 | export interface ReplaceOrder {
|
173 | order_id: string;
|
174 | qty?: number;
|
175 | time_in_force?: OrderTimeInForce;
|
176 | limit_price?: number;
|
177 | stop_price?: number;
|
178 | client_order_id?: string;
|
179 | }
|
180 |
|
181 | export type BarsV1Timeframe = '1Min' | '5Min' | '15Min' | '1Day';
|
182 |
|
183 |
|
184 | export type BarsTimeframe =
|
185 | | BarsV1Timeframe
|
186 | | '30Min'
|
187 | | '1Hour'
|
188 | | '2Hour'
|
189 | | '4Hour';
|
190 |
|
191 | export interface UpdateAccountConfigurations {
|
192 | dtbp_check?: string;
|
193 | no_shorting?: boolean;
|
194 | suspend_trade?: boolean;
|
195 | trade_confirm_email?: string;
|
196 | }
|
197 |
|
198 | export interface GetLatestTrade {
|
199 | symbol: string;
|
200 | feed?: DataSource;
|
201 | limit?: number;
|
202 | }
|
203 |
|
204 | export interface UpdateWatchList {
|
205 | uuid: string;
|
206 | name?: string;
|
207 | symbols?: string[];
|
208 | }
|
209 |
|
210 | export interface GetNews {
|
211 | symbols?: string[] | string;
|
212 | start?: Date;
|
213 | end?: Date;
|
214 | limit?: number;
|
215 | sort?: 'ASC' | 'DESC';
|
216 | include_content?: boolean;
|
217 | exclude_contentless?: boolean;
|
218 | page_token?: string;
|
219 | }
|