-
-
Notifications
You must be signed in to change notification settings - Fork 28
/
shared.ts
104 lines (83 loc) · 1.74 KB
/
shared.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
export type numberInString<T = string> = T;
export interface APIResponse<T> {
code: '0';
msg: '';
data: T;
}
export type AlgoOrderType =
| 'conditional'
| 'oco'
| 'trigger'
| 'move_order_stop'
| 'iceberg'
| 'twap'
| 'chase';
export type AlgoOrderState =
| 'live'
| 'pause'
| 'partially_effective'
| 'effective'
| 'canceled'
| 'order_failed'
| 'partially_failed';
export type AlgoPositionSide = 'long' | 'short';
export type ContractGridDirection = 'long' | 'short' | 'neutral';
export type GridAlgoSubOrderType = 'live' | 'filled';
export type InstrumentType = 'SPOT' | 'MARGIN' | 'SWAP' | 'FUTURES' | 'OPTION';
export type MarginMode = 'cross' | 'isolated';
export type OrderSide = 'buy' | 'sell';
export type OrderType =
| 'market'
| 'limit'
| 'post_only'
| 'fok'
| 'ioc'
| 'optimal_limit_ioc';
export type OrderState =
| 'canceled'
| 'live'
| 'partially_filled'
| 'filled'
| 'mmp_canceled';
export type PositionSide = 'net' | 'long' | 'short';
export type PriceTriggerType = 'last' | 'index' | 'mark';
export interface RFQLeg {
instId: string;
sz: string;
side: OrderSide;
tgtCcy?: string;
}
export interface RFQQuoteLegExtended {
px: string;
sz: string;
instId: string;
side: string;
fee: string;
feeCcy: string;
tradeId: string;
}
export type TradeMode = 'cross' | 'isolated' | 'cash';
export interface TimestampObject {
ts: numberInString;
}
export interface Pagination {
after?: string;
before?: string;
limit?: string;
}
export type PosMode = 'long_short_mode' | 'net_mode';
export type AccountLevel = '1' | '2' | '3' | '4';
export type WithdrawState =
| '-3'
| '-2'
| '-1'
| '0'
| '1'
| '2'
| '4'
| '5'
| '6'
| '8'
| '9'
| '10'
| '12';