kucoin-api 2.0.0 → 2.0.1
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/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/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/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/package.json +1 -1
|
@@ -14,8 +14,6 @@ export interface CreateDepositAddressV3Request {
|
|
|
14
14
|
export interface GetMarginBalanceRequest {
|
|
15
15
|
quoteCurrency?: string;
|
|
16
16
|
queryType?: 'MARGIN' | 'MARGIN_V2' | 'ALL';
|
|
17
|
-
currentPage?: number;
|
|
18
|
-
pageSize?: number;
|
|
19
17
|
}
|
|
20
18
|
export interface GetIsolatedMarginBalanceRequest {
|
|
21
19
|
symbol?: string;
|
|
@@ -22,30 +22,22 @@ export interface GetSpotKlinesRequest {
|
|
|
22
22
|
*
|
|
23
23
|
*/
|
|
24
24
|
export interface SubmitHFOrderRequest {
|
|
25
|
-
clientOid?: string;
|
|
26
|
-
symbol: string;
|
|
27
25
|
type: 'limit' | 'market';
|
|
26
|
+
symbol: string;
|
|
28
27
|
side: 'buy' | 'sell';
|
|
29
|
-
|
|
28
|
+
clientOid?: string;
|
|
29
|
+
stp?: 'DC' | 'CO' | 'CN' | 'CB';
|
|
30
30
|
tags?: string;
|
|
31
31
|
remark?: string;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
clientOid?: string;
|
|
35
|
-
symbol: string;
|
|
36
|
-
type: 'limit' | 'market';
|
|
32
|
+
price?: string;
|
|
33
|
+
size?: string;
|
|
37
34
|
timeInForce?: 'GTC' | 'GTT' | 'IOC' | 'FOK';
|
|
38
|
-
stp?: 'CN' | 'CO' | 'CB' | 'DC';
|
|
39
|
-
side: 'buy' | 'sell';
|
|
40
|
-
price: string;
|
|
41
|
-
size: string;
|
|
42
35
|
cancelAfter?: number;
|
|
43
36
|
postOnly?: boolean;
|
|
44
37
|
hidden?: boolean;
|
|
45
38
|
iceberg?: boolean;
|
|
46
39
|
visibleSize?: string;
|
|
47
|
-
|
|
48
|
-
remark?: string;
|
|
40
|
+
funds?: string;
|
|
49
41
|
}
|
|
50
42
|
export interface ModifyHFOrderRequest {
|
|
51
43
|
symbol: string;
|
|
@@ -154,14 +146,13 @@ export interface GetFillsRequest {
|
|
|
154
146
|
*
|
|
155
147
|
*/
|
|
156
148
|
export interface SubmitStopOrderRequest {
|
|
157
|
-
clientOid: string;
|
|
158
|
-
side: 'buy' | 'sell';
|
|
159
149
|
symbol: string;
|
|
160
|
-
|
|
150
|
+
side: 'buy' | 'sell';
|
|
151
|
+
stopPrice: string;
|
|
152
|
+
type: 'limit' | 'market';
|
|
153
|
+
clientOid?: string;
|
|
154
|
+
stp?: 'DC' | 'CO' | 'CN' | 'CB';
|
|
161
155
|
remark?: string;
|
|
162
|
-
stop?: 'loss' | 'entry';
|
|
163
|
-
stopPrice?: string;
|
|
164
|
-
stp?: 'CN' | 'CO' | 'CB' | 'DC';
|
|
165
156
|
tradeType?: 'TRADE' | 'MARGIN_TRADE' | 'MARGIN_ISOLATED_TRADE';
|
|
166
157
|
price?: string;
|
|
167
158
|
size?: string;
|
|
@@ -58,9 +58,17 @@ export interface AccountSummary {
|
|
|
58
58
|
availableBalanceTotal: number;
|
|
59
59
|
currency: string;
|
|
60
60
|
}
|
|
61
|
-
export
|
|
61
|
+
export interface FuturesSubAccount {
|
|
62
62
|
accountName: string;
|
|
63
|
-
|
|
63
|
+
accountEquity: number;
|
|
64
|
+
unrealisedPNL: number;
|
|
65
|
+
marginBalance: number;
|
|
66
|
+
positionMargin: number;
|
|
67
|
+
orderMargin: number;
|
|
68
|
+
frozenFunds: number;
|
|
69
|
+
availableBalance: number;
|
|
70
|
+
currency: string;
|
|
71
|
+
}
|
|
64
72
|
/**
|
|
65
73
|
* REST - FUNDING - TRANSFER
|
|
66
74
|
*/
|
|
@@ -110,7 +118,7 @@ export interface FuturesTransferRecords {
|
|
|
110
118
|
export interface FuturesSymbolInfo {
|
|
111
119
|
symbol: string;
|
|
112
120
|
rootSymbol: string;
|
|
113
|
-
type:
|
|
121
|
+
type: 'FFWCSX' | 'FFICSX';
|
|
114
122
|
firstOpenDate: number;
|
|
115
123
|
expireDate: number | null;
|
|
116
124
|
settleDate: number | null;
|
|
@@ -136,16 +144,17 @@ export interface FuturesSymbolInfo {
|
|
|
136
144
|
isDeleverage: boolean;
|
|
137
145
|
isQuanto: boolean;
|
|
138
146
|
isInverse: boolean;
|
|
139
|
-
markMethod:
|
|
140
|
-
fairMethod:
|
|
147
|
+
markMethod: 'FairPrice';
|
|
148
|
+
fairMethod: 'FundingRate';
|
|
141
149
|
fundingBaseSymbol: string;
|
|
142
150
|
fundingQuoteSymbol: string;
|
|
143
151
|
fundingRateSymbol: string;
|
|
144
152
|
indexSymbol: string;
|
|
145
|
-
settlementSymbol: string;
|
|
146
|
-
status:
|
|
153
|
+
settlementSymbol: string | null;
|
|
154
|
+
status: 'Init' | 'Open' | 'BeingSettled' | 'Settled' | 'Paused' | 'Closed' | 'CancelOnly';
|
|
147
155
|
fundingFeeRate: number;
|
|
148
156
|
predictedFundingFeeRate: number;
|
|
157
|
+
fundingRateGranularity: number;
|
|
149
158
|
openInterest: string;
|
|
150
159
|
turnoverOf24h: number;
|
|
151
160
|
volumeOf24h: number;
|
|
@@ -163,9 +172,12 @@ export interface FuturesSymbolInfo {
|
|
|
163
172
|
highPrice: number;
|
|
164
173
|
priceChgPct: number;
|
|
165
174
|
priceChg: number;
|
|
175
|
+
k: number;
|
|
176
|
+
m: number;
|
|
177
|
+
f: number;
|
|
178
|
+
mmrLimit: number;
|
|
179
|
+
mmrLevConstant: number;
|
|
166
180
|
supportCross: boolean;
|
|
167
|
-
buyLimit: number;
|
|
168
|
-
sellLimit: number;
|
|
169
181
|
}
|
|
170
182
|
export interface TickerDetail {
|
|
171
183
|
sequence: number;
|
|
@@ -193,8 +205,8 @@ export interface MarketTradeDetail {
|
|
|
193
205
|
export interface FullOrderBookDetail {
|
|
194
206
|
symbol: string;
|
|
195
207
|
sequence: number;
|
|
196
|
-
asks: [
|
|
197
|
-
bids: [
|
|
208
|
+
asks: [number, number][];
|
|
209
|
+
bids: [number, number][];
|
|
198
210
|
ts: number;
|
|
199
211
|
}
|
|
200
212
|
export type FuturesKline = [
|
|
@@ -250,18 +262,18 @@ export interface PremiumIndexItem {
|
|
|
250
262
|
export interface FuturesOrder {
|
|
251
263
|
id: string;
|
|
252
264
|
symbol: string;
|
|
253
|
-
type:
|
|
254
|
-
side:
|
|
265
|
+
type: 'market' | 'limit';
|
|
266
|
+
side: 'buy' | 'sell';
|
|
255
267
|
price: string;
|
|
256
268
|
size: number;
|
|
257
269
|
value: string;
|
|
258
270
|
dealValue: string;
|
|
259
271
|
dealSize: number;
|
|
260
|
-
stp:
|
|
272
|
+
stp: 'CN' | 'CO' | 'CB' | '';
|
|
261
273
|
stop: string;
|
|
262
|
-
stopPriceType:
|
|
274
|
+
stopPriceType: 'TP' | 'MP' | 'IP' | '';
|
|
263
275
|
stopTriggered: boolean;
|
|
264
|
-
stopPrice:
|
|
276
|
+
stopPrice: number | null;
|
|
265
277
|
timeInForce: string;
|
|
266
278
|
postOnly: boolean;
|
|
267
279
|
hidden: boolean;
|
|
@@ -269,23 +281,23 @@ export interface FuturesOrder {
|
|
|
269
281
|
leverage: string;
|
|
270
282
|
forceHold: boolean;
|
|
271
283
|
closeOrder: boolean;
|
|
272
|
-
visibleSize: number
|
|
284
|
+
visibleSize: number;
|
|
273
285
|
clientOid: string;
|
|
274
286
|
remark: string | null;
|
|
275
|
-
tags: string
|
|
287
|
+
tags: string;
|
|
276
288
|
isActive: boolean;
|
|
277
289
|
cancelExist: boolean;
|
|
278
290
|
createdAt: number;
|
|
279
291
|
updatedAt: number;
|
|
280
|
-
endAt: number;
|
|
292
|
+
endAt: number | null;
|
|
281
293
|
orderTime: number;
|
|
282
294
|
settleCurrency: string;
|
|
283
|
-
|
|
295
|
+
marginMode: 'ISOLATED' | 'CROSS';
|
|
296
|
+
avgDealPrice: string;
|
|
284
297
|
filledSize: number;
|
|
285
298
|
filledValue: string;
|
|
299
|
+
status: 'open' | 'done';
|
|
286
300
|
reduceOnly: boolean;
|
|
287
|
-
marginMode: 'ISOLATED' | 'CROSS';
|
|
288
|
-
avgDealPrice: string;
|
|
289
301
|
}
|
|
290
302
|
export interface BatchCancelOrderResult {
|
|
291
303
|
orderId: string | null;
|
|
@@ -316,25 +328,27 @@ export interface FuturesFill {
|
|
|
316
328
|
symbol: string;
|
|
317
329
|
tradeId: string;
|
|
318
330
|
orderId: string;
|
|
319
|
-
side:
|
|
320
|
-
liquidity:
|
|
331
|
+
side: 'buy' | 'sell';
|
|
332
|
+
liquidity: 'taker' | 'maker';
|
|
321
333
|
forceTaker: boolean;
|
|
322
334
|
price: string;
|
|
323
335
|
size: number;
|
|
324
336
|
value: string;
|
|
337
|
+
openFeePay: string;
|
|
338
|
+
closeFeePay: string;
|
|
339
|
+
stop: string;
|
|
325
340
|
feeRate: string;
|
|
326
341
|
fixFee: string;
|
|
327
342
|
feeCurrency: string;
|
|
328
|
-
|
|
343
|
+
marginMode: 'ISOLATED' | 'CROSS';
|
|
329
344
|
fee: string;
|
|
330
|
-
orderType: string;
|
|
331
|
-
tradeType: string;
|
|
332
|
-
createdAt: number;
|
|
333
345
|
settleCurrency: string;
|
|
334
|
-
|
|
335
|
-
|
|
346
|
+
orderType: 'market' | 'limit';
|
|
347
|
+
displayType: 'limit' | 'market' | 'limit_stop' | 'market_stop';
|
|
348
|
+
tradeType: 'trade' | 'cancel' | 'liquid' | 'adl' | 'settlement';
|
|
349
|
+
subTradeType: string | null;
|
|
336
350
|
tradeTime: number;
|
|
337
|
-
|
|
351
|
+
createdAt: number;
|
|
338
352
|
}
|
|
339
353
|
export interface FuturesFills {
|
|
340
354
|
currentPage: number;
|
|
@@ -363,10 +377,7 @@ export interface MaxOpenSize {
|
|
|
363
377
|
export interface FuturesPosition {
|
|
364
378
|
id: string;
|
|
365
379
|
symbol: string;
|
|
366
|
-
|
|
367
|
-
maintMarginReq: number;
|
|
368
|
-
riskLimit: number;
|
|
369
|
-
realLeverage: number;
|
|
380
|
+
marginMode: 'CROSS' | 'ISOLATED';
|
|
370
381
|
crossMode: boolean;
|
|
371
382
|
delevPercentage: number;
|
|
372
383
|
openingTimestamp: number;
|
|
@@ -374,36 +385,41 @@ export interface FuturesPosition {
|
|
|
374
385
|
currentQty: number;
|
|
375
386
|
currentCost: number;
|
|
376
387
|
currentComm: number;
|
|
377
|
-
|
|
388
|
+
realisedGrossPnl: number;
|
|
378
389
|
realisedGrossCost: number;
|
|
379
390
|
realisedCost: number;
|
|
391
|
+
unrealisedCost: number;
|
|
392
|
+
unrealisedPnlPcnt: number;
|
|
393
|
+
unrealisedPnl: number;
|
|
394
|
+
unrealisedRoePcnt: number;
|
|
380
395
|
isOpen: boolean;
|
|
381
396
|
markPrice: number;
|
|
382
397
|
markValue: number;
|
|
383
398
|
posCost: number;
|
|
384
|
-
posCross: number;
|
|
385
399
|
posInit: number;
|
|
386
|
-
posComm: number;
|
|
387
|
-
posLoss: number;
|
|
388
400
|
posMargin: number;
|
|
389
|
-
posMaint: number;
|
|
390
|
-
maintMargin: number;
|
|
391
|
-
realisedGrossPnl: number;
|
|
392
401
|
realisedPnl: number;
|
|
393
|
-
unrealisedPnl: number;
|
|
394
|
-
unrealisedPnlPcnt: number;
|
|
395
|
-
unrealisedRoePcnt: number;
|
|
396
402
|
avgEntryPrice: number;
|
|
397
403
|
liquidationPrice: number;
|
|
398
404
|
bankruptPrice: number;
|
|
399
405
|
settleCurrency: string;
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
riskLimitLevel: number;
|
|
403
|
-
marginMode: 'ISOLATED' | 'CROSS';
|
|
404
|
-
positionSide: string;
|
|
405
|
-
posFunding: number;
|
|
406
|
+
isInverse: boolean;
|
|
407
|
+
positionSide: 'BOTH';
|
|
406
408
|
leverage: number;
|
|
409
|
+
autoDeposit?: boolean;
|
|
410
|
+
maintMarginReq?: number;
|
|
411
|
+
riskLimit?: number;
|
|
412
|
+
realLeverage?: number;
|
|
413
|
+
posCross?: number;
|
|
414
|
+
posCrossMargin?: number;
|
|
415
|
+
posComm?: number;
|
|
416
|
+
posCommCommon?: number;
|
|
417
|
+
posLoss?: number;
|
|
418
|
+
posFunding?: number;
|
|
419
|
+
posMaint?: number;
|
|
420
|
+
maintMargin?: number;
|
|
421
|
+
maintainMargin?: number;
|
|
422
|
+
riskLimitLevel?: number;
|
|
407
423
|
}
|
|
408
424
|
export interface AddMargin {
|
|
409
425
|
id: string;
|
|
@@ -487,28 +503,26 @@ export interface FuturesAccountFundingRateHistory {
|
|
|
487
503
|
positionCost: number;
|
|
488
504
|
funding: number;
|
|
489
505
|
settleCurrency: string;
|
|
506
|
+
context: string;
|
|
507
|
+
marginMode: 'ISOLATED' | 'CROSS';
|
|
490
508
|
}
|
|
491
509
|
export interface FuturesClosedPosition {
|
|
492
510
|
closeId: string;
|
|
493
|
-
positionId: string;
|
|
494
|
-
uid: number;
|
|
495
511
|
userId: string;
|
|
496
512
|
symbol: string;
|
|
497
513
|
settleCurrency: string;
|
|
498
514
|
leverage: string;
|
|
499
515
|
type: string;
|
|
500
|
-
side: string | null;
|
|
501
|
-
closeSize: number | null;
|
|
502
516
|
pnl: string;
|
|
503
517
|
realisedGrossCost: string;
|
|
504
518
|
withdrawPnl: string;
|
|
505
|
-
roe: number | null;
|
|
506
519
|
tradeFee: string;
|
|
507
520
|
fundingFee: string;
|
|
508
521
|
openTime: number;
|
|
509
522
|
closeTime: number;
|
|
510
|
-
openPrice:
|
|
511
|
-
closePrice:
|
|
523
|
+
openPrice: string;
|
|
524
|
+
closePrice: string;
|
|
525
|
+
marginMode: 'CROSS' | 'ISOLATED';
|
|
512
526
|
}
|
|
513
527
|
export interface FuturesClosedPositions {
|
|
514
528
|
currentPage: number;
|
|
@@ -517,4 +531,50 @@ export interface FuturesClosedPositions {
|
|
|
517
531
|
totalPage: number;
|
|
518
532
|
items: FuturesClosedPosition[];
|
|
519
533
|
}
|
|
534
|
+
/**
|
|
535
|
+
*
|
|
536
|
+
* Copy Trading
|
|
537
|
+
*
|
|
538
|
+
*/
|
|
539
|
+
export interface CopyTradePosition {
|
|
540
|
+
id: string;
|
|
541
|
+
symbol: string;
|
|
542
|
+
autoDeposit: boolean;
|
|
543
|
+
maintMarginReq: string;
|
|
544
|
+
riskLimit: number;
|
|
545
|
+
realLeverage: string;
|
|
546
|
+
crossMode: boolean;
|
|
547
|
+
marginMode: string;
|
|
548
|
+
positionSide: string;
|
|
549
|
+
leverage: string;
|
|
550
|
+
delevPercentage: number;
|
|
551
|
+
openingTimestamp: number;
|
|
552
|
+
currentTimestamp: number;
|
|
553
|
+
currentQty: number;
|
|
554
|
+
currentCost: string;
|
|
555
|
+
currentComm: string;
|
|
556
|
+
unrealisedCost: string;
|
|
557
|
+
realisedGrossCost: string;
|
|
558
|
+
realisedCost: string;
|
|
559
|
+
isOpen: boolean;
|
|
560
|
+
markPrice: string;
|
|
561
|
+
markValue: string;
|
|
562
|
+
posCost: string;
|
|
563
|
+
posCross: string;
|
|
564
|
+
posInit: string;
|
|
565
|
+
posComm: string;
|
|
566
|
+
posLoss: string;
|
|
567
|
+
posMargin: string;
|
|
568
|
+
posMaint: string;
|
|
569
|
+
maintMargin: string;
|
|
570
|
+
realisedGrossPnl: string;
|
|
571
|
+
realisedPnl: string;
|
|
572
|
+
unrealisedPnl: string;
|
|
573
|
+
unrealisedPnlPcnt: string;
|
|
574
|
+
unrealisedRoePcnt: string;
|
|
575
|
+
avgEntryPrice: string;
|
|
576
|
+
liquidationPrice: string;
|
|
577
|
+
bankruptPrice: string;
|
|
578
|
+
settleCurrency: string;
|
|
579
|
+
}
|
|
520
580
|
export {};
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
export interface SpotAccountSummary {
|
|
2
2
|
level: number;
|
|
3
3
|
subQuantity: number;
|
|
4
|
-
maxDefaultSubQuantity: number;
|
|
5
|
-
maxSubQuantity: number;
|
|
6
4
|
spotSubQuantity: number;
|
|
7
5
|
marginSubQuantity: number;
|
|
8
6
|
futuresSubQuantity: number;
|
|
7
|
+
optionSubQuantity: number;
|
|
8
|
+
maxSubQuantity: number;
|
|
9
|
+
maxDefaultSubQuantity: number;
|
|
9
10
|
maxSpotSubQuantity: number;
|
|
10
11
|
maxMarginSubQuantity: number;
|
|
11
12
|
maxFuturesSubQuantity: number;
|
|
13
|
+
maxOptionSubQuantity: number;
|
|
12
14
|
}
|
|
13
15
|
export interface Balances {
|
|
14
16
|
id: string;
|
|
15
17
|
currency: string;
|
|
16
|
-
type: 'main' | 'trade'
|
|
18
|
+
type: 'main' | 'trade';
|
|
17
19
|
balance: string;
|
|
18
20
|
available: string;
|
|
19
21
|
holds: string;
|
|
@@ -29,9 +31,10 @@ export interface SpotAccountTransaction {
|
|
|
29
31
|
currency: string;
|
|
30
32
|
amount: string;
|
|
31
33
|
fee: string;
|
|
34
|
+
tax: string;
|
|
32
35
|
balance: string;
|
|
33
|
-
accountType:
|
|
34
|
-
bizType:
|
|
36
|
+
accountType: string;
|
|
37
|
+
bizType: string;
|
|
35
38
|
direction: 'out' | 'in';
|
|
36
39
|
createdAt: string;
|
|
37
40
|
context: string;
|
|
@@ -53,6 +56,7 @@ export interface AccountHFMarginTransactions {
|
|
|
53
56
|
bizType: 'TRANSFER' | 'MARGIN_EXCHANGE' | 'ISOLATED_EXCHANGE' | 'LIQUIDATION' | 'ASSERT_RETURN';
|
|
54
57
|
direction: 'out' | 'in';
|
|
55
58
|
createdAt: string;
|
|
59
|
+
tax: string;
|
|
56
60
|
context: string;
|
|
57
61
|
}
|
|
58
62
|
/**
|
|
@@ -60,37 +64,45 @@ export interface AccountHFMarginTransactions {
|
|
|
60
64
|
* Sub-Account
|
|
61
65
|
*
|
|
62
66
|
*/
|
|
67
|
+
export interface SubAccountsV2 {
|
|
68
|
+
currentPage: number;
|
|
69
|
+
pageSize: number;
|
|
70
|
+
totalNum: number;
|
|
71
|
+
totalPage: number;
|
|
72
|
+
items: SubAccountInfo[];
|
|
73
|
+
}
|
|
63
74
|
export interface SubAccountInfo {
|
|
64
75
|
userId: string;
|
|
65
|
-
uid:
|
|
76
|
+
uid: number;
|
|
66
77
|
subName: string;
|
|
78
|
+
status: number;
|
|
67
79
|
type: number;
|
|
68
|
-
remarks: string | null;
|
|
69
80
|
access: string;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
balance: string;
|
|
76
|
-
available: string;
|
|
77
|
-
holds: string;
|
|
78
|
-
baseCurrency: string;
|
|
79
|
-
baseCurrencyPrice: string;
|
|
80
|
-
baseAmount: string;
|
|
81
|
+
createdAt: number;
|
|
82
|
+
remarks: string;
|
|
83
|
+
tradeTypes: string[];
|
|
84
|
+
openedTradeTypes: string[];
|
|
85
|
+
hostedStatus: null | string;
|
|
81
86
|
}
|
|
82
|
-
export interface
|
|
87
|
+
export interface CreateSubAccount {
|
|
83
88
|
currentPage: number;
|
|
84
89
|
pageSize: number;
|
|
85
90
|
totalNum: number;
|
|
86
91
|
totalPage: number;
|
|
87
|
-
items:
|
|
92
|
+
items: SubAccountItem[];
|
|
88
93
|
}
|
|
89
|
-
export interface
|
|
94
|
+
export interface SubAccountItem {
|
|
95
|
+
userId: string;
|
|
90
96
|
uid: number;
|
|
91
97
|
subName: string;
|
|
92
|
-
|
|
98
|
+
status: number;
|
|
99
|
+
type: number;
|
|
93
100
|
access: string;
|
|
101
|
+
createdAt: number;
|
|
102
|
+
remarks: string;
|
|
103
|
+
tradeTypes: string[];
|
|
104
|
+
openedTradeTypes: string[];
|
|
105
|
+
hostedStatus: null | string;
|
|
94
106
|
}
|
|
95
107
|
export interface SubAccountBalances {
|
|
96
108
|
subUserId: string;
|
|
@@ -99,6 +111,15 @@ export interface SubAccountBalances {
|
|
|
99
111
|
tradeAccounts: SubAccountBalance[];
|
|
100
112
|
marginAccounts: SubAccountBalance[];
|
|
101
113
|
}
|
|
114
|
+
export interface SubAccountBalance {
|
|
115
|
+
currency: string;
|
|
116
|
+
balance: string;
|
|
117
|
+
available: string;
|
|
118
|
+
holds: string;
|
|
119
|
+
baseCurrency: string;
|
|
120
|
+
baseCurrencyPrice: string;
|
|
121
|
+
baseAmount: string;
|
|
122
|
+
}
|
|
102
123
|
export interface SubAccountBalancesV2 {
|
|
103
124
|
currentPage: number;
|
|
104
125
|
pageSize: number;
|
|
@@ -110,6 +131,24 @@ export interface SubAccountBalancesV2 {
|
|
|
110
131
|
mainAccounts: SubAccountBalance[];
|
|
111
132
|
}[];
|
|
112
133
|
}
|
|
134
|
+
export interface SubAccountBalanceItemV2 {
|
|
135
|
+
subUserId: string;
|
|
136
|
+
subName: string;
|
|
137
|
+
mainAccounts: SubAccountV2Details[];
|
|
138
|
+
tradeAccounts: SubAccountV2Details[];
|
|
139
|
+
marginAccounts: SubAccountV2Details[];
|
|
140
|
+
tradeHFAccounts: string[];
|
|
141
|
+
}
|
|
142
|
+
export interface SubAccountV2Details {
|
|
143
|
+
currency?: string;
|
|
144
|
+
balance?: string;
|
|
145
|
+
available?: string;
|
|
146
|
+
holds?: string;
|
|
147
|
+
baseCurrency?: string;
|
|
148
|
+
baseCurrencyPrice?: string;
|
|
149
|
+
baseAmount?: string;
|
|
150
|
+
tag?: string;
|
|
151
|
+
}
|
|
113
152
|
/**
|
|
114
153
|
*
|
|
115
154
|
* Sub-Account API
|
|
@@ -117,17 +156,26 @@ export interface SubAccountBalancesV2 {
|
|
|
117
156
|
*
|
|
118
157
|
*/
|
|
119
158
|
export interface SubAccountAPIInfo {
|
|
159
|
+
subName: string;
|
|
160
|
+
remark: string;
|
|
120
161
|
apiKey: string;
|
|
121
|
-
|
|
122
|
-
ipWhitelist: string;
|
|
162
|
+
apiVersion: number;
|
|
123
163
|
permission: string;
|
|
124
|
-
|
|
125
|
-
|
|
164
|
+
ipWhitelist: string;
|
|
165
|
+
createdAt: number;
|
|
166
|
+
uid: number;
|
|
167
|
+
isMaster: boolean;
|
|
126
168
|
}
|
|
127
|
-
export
|
|
169
|
+
export interface CreateSubAPI {
|
|
170
|
+
subName: string;
|
|
171
|
+
remark: string;
|
|
172
|
+
apiKey: string;
|
|
128
173
|
apiSecret: string;
|
|
174
|
+
apiVersion: number;
|
|
129
175
|
passphrase: string;
|
|
130
|
-
|
|
176
|
+
permission: string;
|
|
177
|
+
createdAt: number;
|
|
178
|
+
}
|
|
131
179
|
export interface UpdateSubAPI {
|
|
132
180
|
apiKey: string;
|
|
133
181
|
ipWhitelist: string;
|
|
@@ -34,13 +34,6 @@ export interface MarginAccountDetail {
|
|
|
34
34
|
borrowEnabled: boolean;
|
|
35
35
|
transferInEnabled: boolean;
|
|
36
36
|
}
|
|
37
|
-
export interface IsolatedMarginAssetDetail {
|
|
38
|
-
symbol: string;
|
|
39
|
-
debtRatio: string;
|
|
40
|
-
status: 'EFFECTIVE' | 'BANKRUPTCY' | 'LIQUIDATION' | 'REPAY' | 'BORROW';
|
|
41
|
-
baseAsset: MarginAssetDetail;
|
|
42
|
-
quoteAsset: MarginAssetDetail;
|
|
43
|
-
}
|
|
44
37
|
export interface MarginBalance {
|
|
45
38
|
totalAssetOfQuoteCurrency: string;
|
|
46
39
|
totalLiabilityOfQuoteCurrency: string;
|
|
@@ -54,6 +47,13 @@ export interface IsolatedMarginBalance {
|
|
|
54
47
|
timestamp: number;
|
|
55
48
|
assets: IsolatedMarginAssetDetail[];
|
|
56
49
|
}
|
|
50
|
+
export interface IsolatedMarginAssetDetail {
|
|
51
|
+
symbol: string;
|
|
52
|
+
debtRatio: string;
|
|
53
|
+
status: 'EFFECTIVE' | 'BANKRUPTCY' | 'LIQUIDATION' | 'REPAY' | 'BORROW';
|
|
54
|
+
baseAsset: MarginAssetDetail;
|
|
55
|
+
quoteAsset: MarginAssetDetail;
|
|
56
|
+
}
|
|
57
57
|
/**
|
|
58
58
|
*
|
|
59
59
|
* Deposit
|
|
@@ -70,26 +70,12 @@ export type DepositAddressV2 = DepositAddress & {
|
|
|
70
70
|
export interface DepositAddressV3 {
|
|
71
71
|
address: string;
|
|
72
72
|
memo: string;
|
|
73
|
-
chainName: string;
|
|
74
73
|
chainId: string;
|
|
75
|
-
|
|
74
|
+
to: 'MAIN' | 'TRADE';
|
|
76
75
|
expirationDate: number;
|
|
77
|
-
to: 'main' | 'trade';
|
|
78
|
-
currency: string;
|
|
79
|
-
}
|
|
80
|
-
export interface DepositItem {
|
|
81
|
-
address: string;
|
|
82
|
-
memo: string;
|
|
83
|
-
amount: string;
|
|
84
|
-
fee: string;
|
|
85
76
|
currency: string;
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
walletTxId: string;
|
|
89
|
-
status: 'PROCESSING' | 'SUCCESS' | 'FAILURE';
|
|
90
|
-
remark: string;
|
|
91
|
-
createdAt: number;
|
|
92
|
-
updatedAt: number;
|
|
77
|
+
contractAddress: string;
|
|
78
|
+
chainName: string;
|
|
93
79
|
}
|
|
94
80
|
export interface HistoricalDepositItem {
|
|
95
81
|
currency: string;
|
|
@@ -106,6 +92,21 @@ export interface Deposits {
|
|
|
106
92
|
totalPage: number;
|
|
107
93
|
items: DepositItem[];
|
|
108
94
|
}
|
|
95
|
+
export interface DepositItem {
|
|
96
|
+
currency?: string;
|
|
97
|
+
chain?: string;
|
|
98
|
+
status?: 'PROCESSING' | 'SUCCESS' | 'FAILURE';
|
|
99
|
+
address?: string;
|
|
100
|
+
memo?: string;
|
|
101
|
+
isInner?: boolean;
|
|
102
|
+
amount?: string;
|
|
103
|
+
fee?: string;
|
|
104
|
+
walletTxId?: string | null;
|
|
105
|
+
createdAt?: number;
|
|
106
|
+
updatedAt?: number;
|
|
107
|
+
remark?: string;
|
|
108
|
+
arrears?: boolean;
|
|
109
|
+
}
|
|
109
110
|
export interface V1HistoricalDeposits {
|
|
110
111
|
currentPage: number;
|
|
111
112
|
pageSize: number;
|
|
@@ -166,21 +167,22 @@ export interface HistoricalWithdrawalsV1 {
|
|
|
166
167
|
items: HistoricalWithdrawal[];
|
|
167
168
|
}
|
|
168
169
|
export interface WithdrawalQuotas {
|
|
170
|
+
currency: string;
|
|
169
171
|
limitBTCAmount: string;
|
|
172
|
+
usedBTCAmount: string;
|
|
170
173
|
quotaCurrency: string;
|
|
171
|
-
|
|
174
|
+
limitQuotaCurrencyAmount: string;
|
|
175
|
+
usedQuotaCurrencyAmount: string;
|
|
172
176
|
remainAmount: string;
|
|
177
|
+
availableAmount: string;
|
|
178
|
+
withdrawMinFee: string;
|
|
173
179
|
innerWithdrawMinFee: string;
|
|
174
|
-
usedBTCAmount: string;
|
|
175
|
-
limitQuotaCurrencyAmount: string;
|
|
176
180
|
withdrawMinSize: string;
|
|
177
|
-
|
|
181
|
+
isWithdrawEnabled: boolean;
|
|
178
182
|
precision: number;
|
|
183
|
+
chain: string;
|
|
179
184
|
reason: string | null;
|
|
180
|
-
|
|
181
|
-
currency: string;
|
|
182
|
-
availableAmount: string;
|
|
183
|
-
isWithdrawEnabled: boolean;
|
|
185
|
+
lockedAmount: string;
|
|
184
186
|
}
|
|
185
187
|
/**
|
|
186
188
|
*
|