kucoin-api 2.0.0 → 2.0.2
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/dist/cjs/FuturesClient.d.ts +129 -24
- package/dist/cjs/FuturesClient.js +108 -16
- package/dist/cjs/FuturesClient.js.map +1 -1
- package/dist/cjs/SpotClient.d.ts +80 -85
- package/dist/cjs/SpotClient.js +55 -55
- package/dist/cjs/SpotClient.js.map +1 -1
- package/dist/cjs/WebsocketClient.d.ts +1 -0
- package/dist/cjs/WebsocketClient.js +23 -22
- package/dist/cjs/WebsocketClient.js.map +1 -1
- package/dist/cjs/lib/BaseRestClient.d.ts +6 -2
- package/dist/cjs/lib/BaseRestClient.js +8 -1
- package/dist/cjs/lib/BaseRestClient.js.map +1 -1
- package/dist/cjs/lib/requestUtils.d.ts +1 -0
- package/dist/cjs/lib/requestUtils.js.map +1 -1
- package/dist/cjs/types/request/futures.types.d.ts +68 -16
- package/dist/cjs/types/request/spot-account.d.ts +1 -1
- package/dist/cjs/types/request/spot-funding.d.ts +0 -2
- package/dist/cjs/types/request/spot-trading.d.ts +11 -20
- package/dist/cjs/types/response/futures.types.d.ts +118 -58
- package/dist/cjs/types/response/spot-account.d.ts +76 -28
- package/dist/cjs/types/response/spot-funding.d.ts +34 -32
- package/dist/cjs/types/response/spot-margin-trading.d.ts +80 -15
- package/dist/cjs/types/response/spot-misc.d.ts +1 -1
- package/dist/cjs/types/response/spot-trading.d.ts +100 -74
- package/dist/cjs/types/websockets/client.d.ts +4 -0
- package/dist/mjs/FuturesClient.d.ts +129 -24
- package/dist/mjs/FuturesClient.js +108 -16
- package/dist/mjs/FuturesClient.js.map +1 -1
- package/dist/mjs/SpotClient.d.ts +80 -85
- package/dist/mjs/SpotClient.js +55 -55
- package/dist/mjs/SpotClient.js.map +1 -1
- package/dist/mjs/WebsocketClient.d.ts +1 -0
- package/dist/mjs/WebsocketClient.js +23 -22
- package/dist/mjs/WebsocketClient.js.map +1 -1
- package/dist/mjs/lib/BaseRestClient.d.ts +6 -2
- package/dist/mjs/lib/BaseRestClient.js +8 -1
- package/dist/mjs/lib/BaseRestClient.js.map +1 -1
- package/dist/mjs/lib/requestUtils.d.ts +1 -0
- package/dist/mjs/lib/requestUtils.js.map +1 -1
- package/dist/mjs/types/request/futures.types.d.ts +68 -16
- package/dist/mjs/types/request/spot-account.d.ts +1 -1
- package/dist/mjs/types/request/spot-funding.d.ts +0 -2
- package/dist/mjs/types/request/spot-trading.d.ts +11 -20
- package/dist/mjs/types/response/futures.types.d.ts +118 -58
- package/dist/mjs/types/response/spot-account.d.ts +76 -28
- package/dist/mjs/types/response/spot-funding.d.ts +34 -32
- package/dist/mjs/types/response/spot-margin-trading.d.ts +80 -15
- package/dist/mjs/types/response/spot-misc.d.ts +1 -1
- package/dist/mjs/types/response/spot-trading.d.ts +100 -74
- package/dist/mjs/types/websockets/client.d.ts +4 -0
- package/package.json +2 -2
|
@@ -10,17 +10,6 @@
|
|
|
10
10
|
* Market data
|
|
11
11
|
*
|
|
12
12
|
*/
|
|
13
|
-
interface Chain {
|
|
14
|
-
chainName: string;
|
|
15
|
-
withdrawalMinSize: string;
|
|
16
|
-
withdrawalMinFee: string;
|
|
17
|
-
isWithdrawEnabled: boolean;
|
|
18
|
-
isDepositEnabled: boolean;
|
|
19
|
-
confirms: number;
|
|
20
|
-
preConfirms: number;
|
|
21
|
-
contractAddress: string;
|
|
22
|
-
chainId: string;
|
|
23
|
-
}
|
|
24
13
|
export interface CurrencyInfo {
|
|
25
14
|
currency: string;
|
|
26
15
|
name: string;
|
|
@@ -31,10 +20,23 @@ export interface CurrencyInfo {
|
|
|
31
20
|
isMarginEnabled: boolean;
|
|
32
21
|
isDebitEnabled: boolean;
|
|
33
22
|
chains: Chain[];
|
|
23
|
+
}
|
|
24
|
+
interface Chain {
|
|
25
|
+
chainName: string;
|
|
26
|
+
withdrawalMinSize: string;
|
|
27
|
+
depositMinSize: string | null;
|
|
28
|
+
withdrawFeeRate: string;
|
|
29
|
+
withdrawalMinFee: string;
|
|
30
|
+
isWithdrawEnabled: boolean;
|
|
31
|
+
isDepositEnabled: boolean;
|
|
32
|
+
confirms: number;
|
|
33
|
+
preConfirms: number;
|
|
34
|
+
contractAddress: string;
|
|
34
35
|
withdrawPrecision: number;
|
|
36
|
+
maxWithdraw: string | null;
|
|
37
|
+
maxDeposit: string | null;
|
|
35
38
|
needTag: boolean;
|
|
36
|
-
|
|
37
|
-
maxDeposit: string;
|
|
39
|
+
chainId: string;
|
|
38
40
|
}
|
|
39
41
|
export interface SymbolInfo {
|
|
40
42
|
symbol: string;
|
|
@@ -42,7 +44,7 @@ export interface SymbolInfo {
|
|
|
42
44
|
baseCurrency: string;
|
|
43
45
|
quoteCurrency: string;
|
|
44
46
|
feeCurrency: string;
|
|
45
|
-
market:
|
|
47
|
+
market: 'USDS' | 'BTC' | 'ALTS';
|
|
46
48
|
baseMinSize: string;
|
|
47
49
|
quoteMinSize: string;
|
|
48
50
|
baseMaxSize: string;
|
|
@@ -54,6 +56,10 @@ export interface SymbolInfo {
|
|
|
54
56
|
minFunds: string;
|
|
55
57
|
isMarginEnabled: boolean;
|
|
56
58
|
enableTrading: boolean;
|
|
59
|
+
feeCategory: 1 | 2 | 3;
|
|
60
|
+
makerFeeCoefficient: string;
|
|
61
|
+
takerFeeCoefficient: string;
|
|
62
|
+
st: boolean;
|
|
57
63
|
}
|
|
58
64
|
export interface Ticker {
|
|
59
65
|
sequence: string;
|
|
@@ -65,6 +71,30 @@ export interface Ticker {
|
|
|
65
71
|
bestBidSize: string;
|
|
66
72
|
time: number;
|
|
67
73
|
}
|
|
74
|
+
export interface AllTickers {
|
|
75
|
+
time: number;
|
|
76
|
+
ticker: Ticker[];
|
|
77
|
+
}
|
|
78
|
+
export interface AllTickersItem {
|
|
79
|
+
symbol: string;
|
|
80
|
+
symbolName: string;
|
|
81
|
+
buy: string;
|
|
82
|
+
bestBidSize: string;
|
|
83
|
+
sell: string;
|
|
84
|
+
bestAskSize: string;
|
|
85
|
+
changeRate: string;
|
|
86
|
+
changePrice: string;
|
|
87
|
+
high: string;
|
|
88
|
+
low: string;
|
|
89
|
+
vol: string;
|
|
90
|
+
volValue: string;
|
|
91
|
+
last: string;
|
|
92
|
+
averagePrice: string;
|
|
93
|
+
takerFeeRate: string;
|
|
94
|
+
makerFeeRate: string;
|
|
95
|
+
takerCoefficient: string;
|
|
96
|
+
makerCoefficient: string;
|
|
97
|
+
}
|
|
68
98
|
export interface Symbol24hrStats {
|
|
69
99
|
time: number;
|
|
70
100
|
symbol: string;
|
|
@@ -96,15 +126,7 @@ export interface TradeHistory {
|
|
|
96
126
|
size: string;
|
|
97
127
|
side: string;
|
|
98
128
|
}
|
|
99
|
-
export
|
|
100
|
-
startAt: string;
|
|
101
|
-
open: string;
|
|
102
|
-
close: string;
|
|
103
|
-
high: string;
|
|
104
|
-
low: string;
|
|
105
|
-
volume: string;
|
|
106
|
-
amount: string;
|
|
107
|
-
}
|
|
129
|
+
export type Kline = [string, string, string, string, string, string, string];
|
|
108
130
|
/**
|
|
109
131
|
*
|
|
110
132
|
* Spot HF trade
|
|
@@ -140,7 +162,8 @@ export interface SubmitMultipleHFOrdersSyncResponse {
|
|
|
140
162
|
clientOid: string;
|
|
141
163
|
}
|
|
142
164
|
export interface SyncCancelHFOrderResponse {
|
|
143
|
-
|
|
165
|
+
clientOid?: string;
|
|
166
|
+
orderId?: string;
|
|
144
167
|
originSize: string;
|
|
145
168
|
dealSize: string;
|
|
146
169
|
remainSize: string;
|
|
@@ -162,12 +185,13 @@ export interface AutoCancelHFOrderSettingQueryResponse {
|
|
|
162
185
|
}
|
|
163
186
|
export interface HFFilledOrder {
|
|
164
187
|
id: number;
|
|
165
|
-
symbol: string;
|
|
166
|
-
tradeId: number;
|
|
167
188
|
orderId: string;
|
|
168
189
|
counterOrderId: string;
|
|
169
|
-
|
|
170
|
-
|
|
190
|
+
tradeId: number;
|
|
191
|
+
symbol: string;
|
|
192
|
+
side: 'buy' | 'sell';
|
|
193
|
+
liquidity: 'taker' | 'maker';
|
|
194
|
+
type: 'limit' | 'market';
|
|
171
195
|
forceTaker: boolean;
|
|
172
196
|
price: string;
|
|
173
197
|
size: string;
|
|
@@ -177,43 +201,45 @@ export interface HFFilledOrder {
|
|
|
177
201
|
feeCurrency: string;
|
|
178
202
|
stop: string;
|
|
179
203
|
tradeType: string;
|
|
180
|
-
|
|
204
|
+
taxRate: string;
|
|
205
|
+
tax: string;
|
|
181
206
|
createdAt: number;
|
|
182
207
|
}
|
|
183
208
|
export interface HFOrder {
|
|
184
209
|
id: string;
|
|
210
|
+
clientOid: string;
|
|
185
211
|
symbol: string;
|
|
186
212
|
opType: string;
|
|
187
|
-
type:
|
|
188
|
-
side:
|
|
213
|
+
type: 'limit' | 'market';
|
|
214
|
+
side: 'buy' | 'sell';
|
|
189
215
|
price: string;
|
|
190
216
|
size: string;
|
|
191
|
-
dealSize: string;
|
|
192
|
-
cancelledSize: string;
|
|
193
|
-
remainSize: string;
|
|
194
217
|
funds: string;
|
|
218
|
+
dealSize: string;
|
|
195
219
|
dealFunds: string;
|
|
196
|
-
|
|
220
|
+
remainSize: string;
|
|
197
221
|
remainFunds: string;
|
|
222
|
+
cancelledSize: string;
|
|
223
|
+
cancelledFunds: string;
|
|
198
224
|
fee: string;
|
|
199
225
|
feeCurrency: string;
|
|
200
|
-
stp
|
|
201
|
-
timeInForce:
|
|
226
|
+
stp?: 'DC' | 'CO' | 'CN' | 'CB' | null;
|
|
227
|
+
timeInForce: 'GTC' | 'GTT' | 'IOC' | 'FOK';
|
|
202
228
|
postOnly: boolean;
|
|
203
229
|
hidden: boolean;
|
|
204
230
|
iceberg: boolean;
|
|
205
231
|
visibleSize: string;
|
|
206
232
|
cancelAfter: number;
|
|
207
233
|
channel: string;
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
tags: string;
|
|
211
|
-
active: boolean;
|
|
212
|
-
inOrderBook: boolean;
|
|
234
|
+
remark?: string | null;
|
|
235
|
+
tags?: string | null;
|
|
213
236
|
cancelExist: boolean;
|
|
237
|
+
tradeType: string;
|
|
238
|
+
inOrderBook: boolean;
|
|
239
|
+
active: boolean;
|
|
240
|
+
tax: string;
|
|
214
241
|
createdAt: number;
|
|
215
242
|
lastUpdatedAt: number;
|
|
216
|
-
tradeType: string;
|
|
217
243
|
}
|
|
218
244
|
/**
|
|
219
245
|
*
|
|
@@ -324,37 +350,37 @@ export interface StopOrders {
|
|
|
324
350
|
items: StopOrderItem[];
|
|
325
351
|
}
|
|
326
352
|
export interface StopOrderItem {
|
|
327
|
-
id
|
|
328
|
-
symbol
|
|
329
|
-
userId
|
|
330
|
-
status
|
|
331
|
-
type
|
|
332
|
-
side
|
|
333
|
-
price
|
|
334
|
-
size
|
|
335
|
-
funds
|
|
336
|
-
stp
|
|
337
|
-
timeInForce
|
|
338
|
-
cancelAfter
|
|
339
|
-
postOnly
|
|
340
|
-
hidden
|
|
341
|
-
iceberg
|
|
342
|
-
visibleSize
|
|
343
|
-
channel
|
|
344
|
-
clientOid
|
|
345
|
-
remark
|
|
346
|
-
tags
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
353
|
+
id?: string;
|
|
354
|
+
symbol?: string;
|
|
355
|
+
userId?: string;
|
|
356
|
+
status?: 'NEW' | 'TRIGGERED';
|
|
357
|
+
type?: 'limit' | 'market' | 'limit_stop' | 'market_stop';
|
|
358
|
+
side?: 'buy' | 'sell';
|
|
359
|
+
price?: string;
|
|
360
|
+
size?: string;
|
|
361
|
+
funds?: string | null;
|
|
362
|
+
stp?: string | null;
|
|
363
|
+
timeInForce?: 'GTC' | 'GTT' | 'IOC' | 'FOK';
|
|
364
|
+
cancelAfter?: number;
|
|
365
|
+
postOnly?: boolean;
|
|
366
|
+
hidden?: boolean;
|
|
367
|
+
iceberg?: boolean;
|
|
368
|
+
visibleSize?: string | null;
|
|
369
|
+
channel?: string;
|
|
370
|
+
clientOid?: string;
|
|
371
|
+
remark?: string | null;
|
|
372
|
+
tags?: string | null;
|
|
373
|
+
domainId?: string;
|
|
374
|
+
tradeSource?: 'USER' | 'MARGIN_SYSTEM';
|
|
375
|
+
tradeType?: 'TRADE' | 'MARGIN_TRADE' | 'MARGIN_ISOLATED_TRADE';
|
|
376
|
+
feeCurrency?: string;
|
|
377
|
+
takerFeeRate?: string;
|
|
378
|
+
makerFeeRate?: string;
|
|
379
|
+
createdAt?: number;
|
|
380
|
+
stop?: 'loss' | 'entry';
|
|
381
|
+
stopTriggerTime?: number | null;
|
|
382
|
+
stopPrice?: string;
|
|
383
|
+
orderTime?: number;
|
|
358
384
|
}
|
|
359
385
|
/**
|
|
360
386
|
*
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { AxiosRequestConfig } from 'axios';
|
|
2
|
+
import { RestClientOptions } from '../../lib/requestUtils.js';
|
|
1
3
|
/** General configuration for the WebsocketClient */
|
|
2
4
|
export interface WSClientConfigurableOptions {
|
|
3
5
|
/** Your API key */
|
|
@@ -14,6 +16,8 @@ export interface WSClientConfigurableOptions {
|
|
|
14
16
|
pongTimeout?: number;
|
|
15
17
|
/** Delay in milliseconds before respawning the connection */
|
|
16
18
|
reconnectTimeout?: number;
|
|
19
|
+
restOptions?: RestClientOptions;
|
|
20
|
+
requestOptions?: AxiosRequestConfig;
|
|
17
21
|
wsOptions?: {
|
|
18
22
|
protocols?: string[];
|
|
19
23
|
agent?: any;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kucoin-api",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "Complete & robust Node.js SDK for Kucoin's REST APIs and WebSockets, with TypeScript & strong end to end tests.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"clean": "rm -rf dist",
|
|
@@ -81,4 +81,4 @@
|
|
|
81
81
|
"url": "https://github.com/tiagosiebler/kucoin-api/issues"
|
|
82
82
|
},
|
|
83
83
|
"homepage": "https://github.com/tiagosiebler/kucoin-api#readme"
|
|
84
|
-
}
|
|
84
|
+
}
|