okx-api 1.3.7 → 1.4.0

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 (50) hide show
  1. package/lib/rest-client.d.ts +523 -42
  2. package/lib/rest-client.js +602 -47
  3. package/lib/rest-client.js.map +1 -1
  4. package/lib/types/rest/request/account.d.ts +93 -0
  5. package/lib/types/rest/request/block-trading.d.ts +16 -0
  6. package/lib/types/rest/request/copy-trading.d.ts +117 -0
  7. package/lib/types/rest/request/copy-trading.js +3 -0
  8. package/lib/types/rest/request/copy-trading.js.map +1 -0
  9. package/lib/types/rest/request/funding.d.ts +7 -0
  10. package/lib/types/rest/request/grid-trading.d.ts +14 -0
  11. package/lib/types/rest/request/index.d.ts +5 -0
  12. package/lib/types/rest/request/index.js +5 -0
  13. package/lib/types/rest/request/index.js.map +1 -1
  14. package/lib/types/rest/request/public.d.ts +40 -0
  15. package/lib/types/rest/request/recurring-buy.d.ts +28 -0
  16. package/lib/types/rest/request/recurring-buy.js +3 -0
  17. package/lib/types/rest/request/recurring-buy.js.map +1 -0
  18. package/lib/types/rest/request/signal-bot.d.ts +97 -0
  19. package/lib/types/rest/request/signal-bot.js +3 -0
  20. package/lib/types/rest/request/signal-bot.js.map +1 -0
  21. package/lib/types/rest/request/simple-earn.d.ts +23 -0
  22. package/lib/types/rest/request/simple-earn.js +3 -0
  23. package/lib/types/rest/request/simple-earn.js.map +1 -0
  24. package/lib/types/rest/request/spread-trading.d.ts +69 -0
  25. package/lib/types/rest/request/spread-trading.js +3 -0
  26. package/lib/types/rest/request/spread-trading.js.map +1 -0
  27. package/lib/types/rest/request/subaccount.d.ts +21 -0
  28. package/lib/types/rest/request/trade.d.ts +4 -0
  29. package/lib/types/rest/response/index.d.ts +4 -0
  30. package/lib/types/rest/response/index.js +4 -0
  31. package/lib/types/rest/response/index.js.map +1 -1
  32. package/lib/types/rest/response/private-account.d.ts +113 -0
  33. package/lib/types/rest/response/private-block-trading.d.ts +35 -0
  34. package/lib/types/rest/response/private-copy-trading.d.ts +259 -0
  35. package/lib/types/rest/response/private-copy-trading.js +3 -0
  36. package/lib/types/rest/response/private-copy-trading.js.map +1 -0
  37. package/lib/types/rest/response/private-funding.d.ts +14 -0
  38. package/lib/types/rest/response/private-recurring-buy.d.ts +63 -0
  39. package/lib/types/rest/response/private-recurring-buy.js +3 -0
  40. package/lib/types/rest/response/private-recurring-buy.js.map +1 -0
  41. package/lib/types/rest/response/private-signal-bot.d.ts +22 -0
  42. package/lib/types/rest/response/private-signal-bot.js +3 -0
  43. package/lib/types/rest/response/private-signal-bot.js.map +1 -0
  44. package/lib/types/rest/response/private-spread-trading.d.ts +125 -0
  45. package/lib/types/rest/response/private-spread-trading.js +3 -0
  46. package/lib/types/rest/response/private-spread-trading.js.map +1 -0
  47. package/lib/types/rest/response/private-subaccount.d.ts +16 -0
  48. package/lib/types/rest/response/private-trade.d.ts +5 -0
  49. package/lib/types/rest/response/public-data.d.ts +27 -0
  50. package/package.json +1 -1
@@ -0,0 +1,125 @@
1
+ export interface PlaceSpreadOrderResponse {
2
+ ordId: string;
3
+ clOrdId: string;
4
+ tag: string;
5
+ sCode: string;
6
+ sMsg: string;
7
+ }
8
+ export interface CancelSpreadOrderResponse {
9
+ ordId: string;
10
+ clOrdId: string;
11
+ sCode: string;
12
+ sMsg: string;
13
+ }
14
+ export interface UpdateSpreadOrderResponse {
15
+ ordId: string;
16
+ clOrdId: string;
17
+ reqId: string;
18
+ sCode: string;
19
+ sMsg: string;
20
+ }
21
+ export interface SpreadOrder {
22
+ instId: string;
23
+ ordId: string;
24
+ clOrdId: string;
25
+ tag: string;
26
+ px: string;
27
+ sz: string;
28
+ ordType: 'limit' | 'post_only' | 'ioc';
29
+ side: 'buy' | 'sell';
30
+ fillSz: string;
31
+ fillPx: string;
32
+ tradeId: string;
33
+ accFillSz: string;
34
+ pendingFillSz: string;
35
+ pendingSettleSz: string;
36
+ canceledSz: string;
37
+ avgPx: string;
38
+ state: 'canceled' | 'live' | 'partially_filled' | 'filled';
39
+ cancelSource: string;
40
+ uTime: string;
41
+ cTime: string;
42
+ }
43
+ export interface SpreadTradeLeg {
44
+ instId: string;
45
+ px: string;
46
+ sz: string;
47
+ side: 'buy' | 'sell';
48
+ fee: string;
49
+ feeCcy: string;
50
+ tradeId: string;
51
+ }
52
+ export interface SpreadTrade {
53
+ sprdId: string;
54
+ tradeId: string;
55
+ ordId: string;
56
+ clOrdId: string;
57
+ tag: string;
58
+ fillPx: string;
59
+ fillSz: string;
60
+ side: 'buy' | 'sell';
61
+ state: 'filled' | 'rejected';
62
+ execType: 'T' | 'M';
63
+ ts: string;
64
+ legs: SpreadTradeLeg[];
65
+ }
66
+ export interface SpreadLeg {
67
+ instId: string;
68
+ side: 'buy' | 'sell';
69
+ }
70
+ export interface SpreadDetails {
71
+ sprdId: string;
72
+ sprdType: 'linear' | 'inverse' | 'hybrid';
73
+ state: 'live' | 'expired' | 'suspend';
74
+ baseCcy: string;
75
+ szCcy: string;
76
+ quoteCcy: string;
77
+ tickSz: string;
78
+ minSz: string;
79
+ lotSz: string;
80
+ listTime: string;
81
+ expTime: string;
82
+ uTime: string;
83
+ legs: SpreadLeg[];
84
+ }
85
+ export interface OrderBookEntry {
86
+ price: string;
87
+ quantity: string;
88
+ orderCount: string;
89
+ }
90
+ export interface SpreadOrderBook {
91
+ asks: OrderBookEntry[];
92
+ bids: OrderBookEntry[];
93
+ ts: string;
94
+ }
95
+ export interface SpreadTicker {
96
+ sprdId: string;
97
+ last: string;
98
+ lastSz: string;
99
+ askPx: string;
100
+ askSz: string;
101
+ bidPx: string;
102
+ bidSz: string;
103
+ open24h: string;
104
+ high24h: string;
105
+ low24h: string;
106
+ vol24h: string;
107
+ ts: string;
108
+ }
109
+ export interface PublicSpreadTrade {
110
+ sprdId: string;
111
+ tradeId: string;
112
+ px: string;
113
+ sz: string;
114
+ side: 'buy' | 'sell';
115
+ ts: string;
116
+ }
117
+ export interface SpreadCandle {
118
+ ts: string;
119
+ o: string;
120
+ h: string;
121
+ l: string;
122
+ c: string;
123
+ vol: string;
124
+ confirm: string;
125
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=private-spread-trading.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"private-spread-trading.js","sourceRoot":"","sources":["../../../../src/types/rest/response/private-spread-trading.ts"],"names":[],"mappings":""}
@@ -54,3 +54,19 @@ export interface SubAccountBalances {
54
54
  export interface SubAccountTransferResult {
55
55
  transId: string;
56
56
  }
57
+ export interface SubAccountMaxWithdrawal {
58
+ ccy: string;
59
+ maxWd: string;
60
+ maxWdEx: string;
61
+ spotOffsetMaxWd: string;
62
+ spotOffsetMaxWdEx: string;
63
+ }
64
+ export interface ManagedSubAccountTransfer {
65
+ billId: string;
66
+ ccy: string;
67
+ amt: string;
68
+ type: string;
69
+ subAcct: string;
70
+ subUid: string;
71
+ ts: string;
72
+ }
@@ -332,3 +332,8 @@ export interface HistoricAlgoOrder {
332
332
  triggerTime: string;
333
333
  amendPxOnTriggerType: string;
334
334
  }
335
+ export interface CancelAllAfterResponse {
336
+ triggerTime: string;
337
+ tag: string;
338
+ ts: string;
339
+ }
@@ -136,4 +136,31 @@ export interface FundingRateHistory {
136
136
  export interface SystemTime {
137
137
  ts: string;
138
138
  }
139
+ export interface OptionsTradeInfo {
140
+ instId: string;
141
+ tradeId: string;
142
+ px: string;
143
+ sz: string;
144
+ side: 'buy' | 'sell';
145
+ ts: string;
146
+ }
147
+ export interface OptionTrade {
148
+ vol24h: string;
149
+ optType: 'C' | 'P';
150
+ tradeInfo: OptionsTradeInfo[];
151
+ }
152
+ export interface OptionTrades {
153
+ instId: string;
154
+ instFamily: string;
155
+ tradeId: string;
156
+ px: string;
157
+ sz: string;
158
+ side: 'buy' | 'sell';
159
+ optType: 'C' | 'P';
160
+ fillVol: string;
161
+ fwdPx: string;
162
+ idxPx: string;
163
+ markPx: string;
164
+ ts: string;
165
+ }
139
166
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "okx-api",
3
- "version": "1.3.7",
3
+ "version": "1.4.0",
4
4
  "description": "Complete & robust Node.js SDK for OKX's REST APIs and WebSockets, with TypeScript & end-to-end tests",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",