forked from tiagosiebler/okx-api
/
shared.ts
68 lines (52 loc) · 1.25 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
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';
export type AlgoState = 'effective' | 'canceled' | 'order_failed';
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 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;
}