ccxt 4.5.13 → 4.5.14
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/README.md +5 -5
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/arkham.js +2 -2
- package/dist/cjs/src/binance.js +8 -2
- package/dist/cjs/src/bitget.js +75 -34
- package/dist/cjs/src/cryptocom.js +22 -18
- package/dist/cjs/src/gate.js +79 -27
- package/dist/cjs/src/hyperliquid.js +69 -7
- package/dist/cjs/src/kucoin.js +41 -3
- package/dist/cjs/src/pro/binance.js +6 -6
- package/dist/cjs/src/pro/bitfinex.js +9 -6
- package/dist/cjs/src/pro/htx.js +8 -6
- package/dist/cjs/src/toobit.js +1 -1
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/binance.d.ts +1 -0
- package/js/src/abstract/binancecoinm.d.ts +1 -0
- package/js/src/abstract/binanceus.d.ts +1 -0
- package/js/src/abstract/binanceusdm.d.ts +1 -0
- package/js/src/abstract/gate.d.ts +62 -18
- package/js/src/abstract/gateio.d.ts +62 -18
- package/js/src/abstract/kucoin.d.ts +30 -0
- package/js/src/abstract/kucoinfutures.d.ts +30 -0
- package/js/src/arkham.js +2 -2
- package/js/src/base/Exchange.d.ts +9 -11
- package/js/src/binance.js +8 -2
- package/js/src/bitget.d.ts +12 -0
- package/js/src/bitget.js +75 -34
- package/js/src/cryptocom.js +22 -18
- package/js/src/gate.js +79 -27
- package/js/src/hyperliquid.d.ts +3 -1
- package/js/src/hyperliquid.js +69 -7
- package/js/src/kucoin.js +41 -3
- package/js/src/pro/binance.js +6 -6
- package/js/src/pro/bitfinex.js +9 -6
- package/js/src/pro/htx.js +8 -6
- package/js/src/toobit.js +1 -1
- package/package.json +1 -1
package/js/src/cryptocom.js
CHANGED
|
@@ -310,30 +310,34 @@ export default class cryptocom extends Exchange {
|
|
|
310
310
|
},
|
|
311
311
|
'fees': {
|
|
312
312
|
'trading': {
|
|
313
|
-
'maker': this.parseNumber('0.
|
|
314
|
-
'taker': this.parseNumber('0.
|
|
313
|
+
'maker': this.parseNumber('0.0025'),
|
|
314
|
+
'taker': this.parseNumber('0.005'),
|
|
315
315
|
'tiers': {
|
|
316
316
|
'maker': [
|
|
317
|
-
[this.parseNumber('0'), this.parseNumber('0.
|
|
318
|
-
[this.parseNumber('
|
|
317
|
+
[this.parseNumber('0'), this.parseNumber('0.0025')],
|
|
318
|
+
[this.parseNumber('10000'), this.parseNumber('0.002')],
|
|
319
319
|
[this.parseNumber('50000'), this.parseNumber('0.0015')],
|
|
320
|
-
[this.parseNumber('
|
|
321
|
-
[this.parseNumber('
|
|
322
|
-
[this.parseNumber('
|
|
323
|
-
[this.parseNumber('
|
|
324
|
-
[this.parseNumber('
|
|
325
|
-
[this.parseNumber('
|
|
320
|
+
[this.parseNumber('250000'), this.parseNumber('0.001')],
|
|
321
|
+
[this.parseNumber('500000'), this.parseNumber('0.0008')],
|
|
322
|
+
[this.parseNumber('2500000'), this.parseNumber('0.00065')],
|
|
323
|
+
[this.parseNumber('10000000'), this.parseNumber('0')],
|
|
324
|
+
[this.parseNumber('25000000'), this.parseNumber('0')],
|
|
325
|
+
[this.parseNumber('100000000'), this.parseNumber('0')],
|
|
326
|
+
[this.parseNumber('250000000'), this.parseNumber('0')],
|
|
327
|
+
[this.parseNumber('500000000'), this.parseNumber('0')],
|
|
326
328
|
],
|
|
327
329
|
'taker': [
|
|
328
|
-
[this.parseNumber('0'), this.parseNumber('0.
|
|
329
|
-
[this.parseNumber('
|
|
330
|
+
[this.parseNumber('0'), this.parseNumber('0.005')],
|
|
331
|
+
[this.parseNumber('10000'), this.parseNumber('0.004')],
|
|
330
332
|
[this.parseNumber('50000'), this.parseNumber('0.0025')],
|
|
331
|
-
[this.parseNumber('
|
|
332
|
-
[this.parseNumber('
|
|
333
|
-
[this.parseNumber('
|
|
334
|
-
[this.parseNumber('
|
|
335
|
-
[this.parseNumber('
|
|
336
|
-
[this.parseNumber('
|
|
333
|
+
[this.parseNumber('250000'), this.parseNumber('0.002')],
|
|
334
|
+
[this.parseNumber('500000'), this.parseNumber('0.0018')],
|
|
335
|
+
[this.parseNumber('2500000'), this.parseNumber('0.001')],
|
|
336
|
+
[this.parseNumber('10000000'), this.parseNumber('0.0005')],
|
|
337
|
+
[this.parseNumber('25000000'), this.parseNumber('0.0004')],
|
|
338
|
+
[this.parseNumber('100000000'), this.parseNumber('0.00035')],
|
|
339
|
+
[this.parseNumber('250000000'), this.parseNumber('0.00031')],
|
|
340
|
+
[this.parseNumber('500000000'), this.parseNumber('0.00025')],
|
|
337
341
|
],
|
|
338
342
|
},
|
|
339
343
|
},
|
package/js/src/gate.js
CHANGED
|
@@ -185,6 +185,12 @@ export default class gate extends Exchange {
|
|
|
185
185
|
'currency_chains': 1,
|
|
186
186
|
},
|
|
187
187
|
},
|
|
188
|
+
'unified': {
|
|
189
|
+
'get': {
|
|
190
|
+
'currencies': 1,
|
|
191
|
+
'history_loan_rate': 1,
|
|
192
|
+
},
|
|
193
|
+
},
|
|
188
194
|
'spot': {
|
|
189
195
|
'get': {
|
|
190
196
|
'currencies': 1,
|
|
@@ -196,22 +202,25 @@ export default class gate extends Exchange {
|
|
|
196
202
|
'trades': 1,
|
|
197
203
|
'candlesticks': 1,
|
|
198
204
|
'time': 1,
|
|
205
|
+
'insurance_history': 1,
|
|
199
206
|
},
|
|
200
207
|
},
|
|
201
208
|
'margin': {
|
|
202
209
|
'get': {
|
|
210
|
+
'uni/currency_pairs': 1,
|
|
211
|
+
'uni/currency_pairs/{currency_pair}': 1,
|
|
212
|
+
'loan_margin_tiers': 1,
|
|
203
213
|
'currency_pairs': 1,
|
|
204
214
|
'currency_pairs/{currency_pair}': 1,
|
|
205
215
|
'funding_book': 1,
|
|
206
216
|
'cross/currencies': 1,
|
|
207
|
-
'cross/currencies/{currency}': 1,
|
|
208
|
-
'uni/currency_pairs': 1,
|
|
209
|
-
'uni/currency_pairs/{currency_pair}': 1,
|
|
217
|
+
'cross/currencies/{currency}': 1, // deprecated
|
|
210
218
|
},
|
|
211
219
|
},
|
|
212
220
|
'flash_swap': {
|
|
213
221
|
'get': {
|
|
214
|
-
'
|
|
222
|
+
'currency_pairs': 1,
|
|
223
|
+
'currencies': 1, // deprecated
|
|
215
224
|
},
|
|
216
225
|
},
|
|
217
226
|
'futures': {
|
|
@@ -240,6 +249,7 @@ export default class gate extends Exchange {
|
|
|
240
249
|
'{settle}/candlesticks': 1,
|
|
241
250
|
'{settle}/tickers': 1,
|
|
242
251
|
'{settle}/insurance': 1,
|
|
252
|
+
'{settle}/risk_limit_tiers': 1,
|
|
243
253
|
},
|
|
244
254
|
},
|
|
245
255
|
'options': {
|
|
@@ -262,6 +272,17 @@ export default class gate extends Exchange {
|
|
|
262
272
|
'get': {
|
|
263
273
|
'uni/currencies': 1,
|
|
264
274
|
'uni/currencies/{currency}': 1,
|
|
275
|
+
'dual/investment_plan': 1,
|
|
276
|
+
'structured/products': 1,
|
|
277
|
+
},
|
|
278
|
+
},
|
|
279
|
+
'loan': {
|
|
280
|
+
'get': {
|
|
281
|
+
'collateral/currencies': 1,
|
|
282
|
+
'multi_collateral/currencies': 1,
|
|
283
|
+
'multi_collateral/ltv': 1,
|
|
284
|
+
'multi_collateral/fixed_rate': 1,
|
|
285
|
+
'multi_collateral/current_rate': 1,
|
|
265
286
|
},
|
|
266
287
|
},
|
|
267
288
|
},
|
|
@@ -325,25 +346,28 @@ export default class gate extends Exchange {
|
|
|
325
346
|
'unified': {
|
|
326
347
|
'get': {
|
|
327
348
|
'accounts': 20 / 15,
|
|
328
|
-
'account_mode': 20 / 15,
|
|
329
349
|
'borrowable': 20 / 15,
|
|
330
350
|
'transferable': 20 / 15,
|
|
351
|
+
'transferables': 20 / 15,
|
|
352
|
+
'batch_borrowable': 20 / 15,
|
|
331
353
|
'loans': 20 / 15,
|
|
332
354
|
'loan_records': 20 / 15,
|
|
333
355
|
'interest_records': 20 / 15,
|
|
334
|
-
'estimate_rate': 20 / 15,
|
|
335
|
-
'currency_discount_tiers': 20 / 15,
|
|
336
356
|
'risk_units': 20 / 15,
|
|
337
357
|
'unified_mode': 20 / 15,
|
|
358
|
+
'estimate_rate': 20 / 15,
|
|
359
|
+
'currency_discount_tiers': 20 / 15,
|
|
338
360
|
'loan_margin_tiers': 20 / 15,
|
|
339
361
|
'leverage/user_currency_config': 20 / 15,
|
|
340
362
|
'leverage/user_currency_setting': 20 / 15,
|
|
363
|
+
'account_mode': 20 / 15, // deprecated
|
|
341
364
|
},
|
|
342
365
|
'post': {
|
|
343
|
-
'account_mode': 20 / 15,
|
|
344
366
|
'loans': 200 / 15,
|
|
345
367
|
'portfolio_calculator': 20 / 15,
|
|
346
368
|
'leverage/user_currency_setting': 20 / 15,
|
|
369
|
+
'collateral_currencies': 20 / 15,
|
|
370
|
+
'account_mode': 20 / 15, // deprecated
|
|
347
371
|
},
|
|
348
372
|
'put': {
|
|
349
373
|
'unified_mode': 20 / 15,
|
|
@@ -389,6 +413,13 @@ export default class gate extends Exchange {
|
|
|
389
413
|
'funding_accounts': 20 / 15,
|
|
390
414
|
'auto_repay': 20 / 15,
|
|
391
415
|
'transferable': 20 / 15,
|
|
416
|
+
'uni/estimate_rate': 20 / 15,
|
|
417
|
+
'uni/loans': 20 / 15,
|
|
418
|
+
'uni/loan_records': 20 / 15,
|
|
419
|
+
'uni/interest_records': 20 / 15,
|
|
420
|
+
'uni/borrowable': 20 / 15,
|
|
421
|
+
'user/loan_margin_tiers': 20 / 15,
|
|
422
|
+
'user/account': 20 / 15,
|
|
392
423
|
'loans': 20 / 15,
|
|
393
424
|
'loans/{loan_id}': 20 / 15,
|
|
394
425
|
'loans/{loan_id}/repayment': 20 / 15,
|
|
@@ -403,34 +434,28 @@ export default class gate extends Exchange {
|
|
|
403
434
|
'cross/interest_records': 20 / 15,
|
|
404
435
|
'cross/transferable': 20 / 15,
|
|
405
436
|
'cross/estimate_rate': 20 / 15,
|
|
406
|
-
'cross/borrowable': 20 / 15,
|
|
407
|
-
'uni/estimate_rate': 20 / 15,
|
|
408
|
-
'uni/loans': 20 / 15,
|
|
409
|
-
'uni/loan_records': 20 / 15,
|
|
410
|
-
'uni/interest_records': 20 / 15,
|
|
411
|
-
'uni/borrowable': 20 / 15,
|
|
437
|
+
'cross/borrowable': 20 / 15, // deprecated
|
|
412
438
|
},
|
|
413
439
|
'post': {
|
|
414
440
|
'auto_repay': 20 / 15,
|
|
441
|
+
'uni/loans': 20 / 15,
|
|
442
|
+
'leverage/user_market_setting': 20 / 15,
|
|
415
443
|
'loans': 20 / 15,
|
|
416
444
|
'merged_loans': 20 / 15,
|
|
417
445
|
'loans/{loan_id}/repayment': 20 / 15,
|
|
418
446
|
'cross/loans': 20 / 15,
|
|
419
|
-
'cross/repayments': 20 / 15,
|
|
420
|
-
'uni/loans': 20 / 15,
|
|
447
|
+
'cross/repayments': 20 / 15, // deprecated
|
|
421
448
|
},
|
|
422
449
|
'patch': {
|
|
423
450
|
'loans/{loan_id}': 20 / 15,
|
|
424
|
-
'loan_records/{loan_record_id}': 20 / 15,
|
|
451
|
+
'loan_records/{loan_record_id}': 20 / 15, // deprecated
|
|
425
452
|
},
|
|
426
453
|
'delete': {
|
|
427
|
-
'loans/{loan_id}': 20 / 15,
|
|
454
|
+
'loans/{loan_id}': 20 / 15, // deprecated
|
|
428
455
|
},
|
|
429
456
|
},
|
|
430
457
|
'flash_swap': {
|
|
431
458
|
'get': {
|
|
432
|
-
'currencies': 1,
|
|
433
|
-
'currency_pairs': 1,
|
|
434
459
|
'orders': 1,
|
|
435
460
|
'orders/{order_id}': 1,
|
|
436
461
|
},
|
|
@@ -455,7 +480,7 @@ export default class gate extends Exchange {
|
|
|
455
480
|
'{settle}/liquidates': 1,
|
|
456
481
|
'{settle}/auto_deleverages': 1,
|
|
457
482
|
'{settle}/fee': 1,
|
|
458
|
-
'{settle}/
|
|
483
|
+
'{settle}/risk_limit_table': 1,
|
|
459
484
|
'{settle}/price_orders': 1,
|
|
460
485
|
'{settle}/price_orders/{order_id}': 1,
|
|
461
486
|
},
|
|
@@ -463,6 +488,8 @@ export default class gate extends Exchange {
|
|
|
463
488
|
'{settle}/positions/{contract}/margin': 1,
|
|
464
489
|
'{settle}/positions/{contract}/leverage': 1,
|
|
465
490
|
'{settle}/positions/{contract}/risk_limit': 1,
|
|
491
|
+
'{settle}/positions/cross_mode': 1,
|
|
492
|
+
'{settle}/dual_comp/positions/cross_mode': 1,
|
|
466
493
|
'{settle}/dual_mode': 1,
|
|
467
494
|
'{settle}/dual_comp/positions/{contract}/margin': 1,
|
|
468
495
|
'{settle}/dual_comp/positions/{contract}/leverage': 1,
|
|
@@ -471,6 +498,8 @@ export default class gate extends Exchange {
|
|
|
471
498
|
'{settle}/batch_orders': 0.4,
|
|
472
499
|
'{settle}/countdown_cancel_all': 0.4,
|
|
473
500
|
'{settle}/batch_cancel_orders': 0.4,
|
|
501
|
+
'{settle}/batch_amend_orders': 0.4,
|
|
502
|
+
'{settle}/bbo_orders': 0.4,
|
|
474
503
|
'{settle}/price_orders': 0.4,
|
|
475
504
|
},
|
|
476
505
|
'put': {
|
|
@@ -538,19 +567,32 @@ export default class gate extends Exchange {
|
|
|
538
567
|
},
|
|
539
568
|
'earn': {
|
|
540
569
|
'get': {
|
|
541
|
-
'uni/currencies': 20 / 15,
|
|
542
|
-
'uni/currencies/{currency}': 20 / 15,
|
|
543
570
|
'uni/lends': 20 / 15,
|
|
544
571
|
'uni/lend_records': 20 / 15,
|
|
545
572
|
'uni/interests/{currency}': 20 / 15,
|
|
546
573
|
'uni/interest_records': 20 / 15,
|
|
547
574
|
'uni/interest_status/{currency}': 20 / 15,
|
|
575
|
+
'uni/chart': 20 / 15,
|
|
576
|
+
'uni/rate': 20 / 15,
|
|
577
|
+
'staking/eth2/rate_records': 20 / 15,
|
|
578
|
+
'dual/orders': 20 / 15,
|
|
579
|
+
'structured/orders': 20 / 15,
|
|
580
|
+
'staking/coins': 20 / 15,
|
|
581
|
+
'staking/order_list': 20 / 15,
|
|
582
|
+
'staking/award_list': 20 / 15,
|
|
583
|
+
'staking/assets': 20 / 15,
|
|
584
|
+
'uni/currencies': 20 / 15,
|
|
585
|
+
'uni/currencies/{currency}': 20 / 15, // deprecated
|
|
548
586
|
},
|
|
549
587
|
'post': {
|
|
550
588
|
'uni/lends': 20 / 15,
|
|
589
|
+
'staking/eth2/swap': 20 / 15,
|
|
590
|
+
'dual/orders': 20 / 15,
|
|
591
|
+
'structured/orders': 20 / 15,
|
|
592
|
+
'staking/swap': 20 / 15,
|
|
551
593
|
},
|
|
552
594
|
'put': {
|
|
553
|
-
'uni/interest_reinvest': 20 / 15,
|
|
595
|
+
'uni/interest_reinvest': 20 / 15, // deprecated
|
|
554
596
|
},
|
|
555
597
|
'patch': {
|
|
556
598
|
'uni/lends': 20 / 15,
|
|
@@ -564,16 +606,16 @@ export default class gate extends Exchange {
|
|
|
564
606
|
'collateral/collaterals': 20 / 15,
|
|
565
607
|
'collateral/total_amount': 20 / 15,
|
|
566
608
|
'collateral/ltv': 20 / 15,
|
|
567
|
-
'collateral/currencies': 20 / 15,
|
|
568
609
|
'multi_collateral/orders': 20 / 15,
|
|
569
610
|
'multi_collateral/orders/{order_id}': 20 / 15,
|
|
570
611
|
'multi_collateral/repay': 20 / 15,
|
|
571
612
|
'multi_collateral/mortgage': 20 / 15,
|
|
572
613
|
'multi_collateral/currency_quota': 20 / 15,
|
|
614
|
+
'collateral/currencies': 20 / 15,
|
|
573
615
|
'multi_collateral/currencies': 20 / 15,
|
|
574
616
|
'multi_collateral/ltv': 20 / 15,
|
|
575
617
|
'multi_collateral/fixed_rate': 20 / 15,
|
|
576
|
-
'multi_collateral/current_rate': 20 / 15,
|
|
618
|
+
'multi_collateral/current_rate': 20 / 15, // deprecated
|
|
577
619
|
},
|
|
578
620
|
'post': {
|
|
579
621
|
'collateral/orders': 20 / 15,
|
|
@@ -587,14 +629,17 @@ export default class gate extends Exchange {
|
|
|
587
629
|
'account': {
|
|
588
630
|
'get': {
|
|
589
631
|
'detail': 20 / 15,
|
|
632
|
+
'main_keys': 20 / 15,
|
|
590
633
|
'rate_limit': 20 / 15,
|
|
591
634
|
'stp_groups': 20 / 15,
|
|
592
635
|
'stp_groups/{stp_id}/users': 20 / 15,
|
|
593
636
|
'stp_groups/debit_fee': 20 / 15,
|
|
637
|
+
'debit_fee': 20 / 15,
|
|
594
638
|
},
|
|
595
639
|
'post': {
|
|
596
640
|
'stp_groups': 20 / 15,
|
|
597
641
|
'stp_groups/{stp_id}/users': 20 / 15,
|
|
642
|
+
'debit_fee': 20 / 15,
|
|
598
643
|
},
|
|
599
644
|
'delete': {
|
|
600
645
|
'stp_groups/{stp_id}/users': 20 / 15,
|
|
@@ -604,6 +649,13 @@ export default class gate extends Exchange {
|
|
|
604
649
|
'get': {
|
|
605
650
|
'agency/transaction_history': 20 / 15,
|
|
606
651
|
'agency/commission_history': 20 / 15,
|
|
652
|
+
'partner/transaction_history': 20 / 15,
|
|
653
|
+
'partner/commission_history': 20 / 15,
|
|
654
|
+
'partner/sub_list': 20 / 15,
|
|
655
|
+
'broker/commission_history': 20 / 15,
|
|
656
|
+
'broker/transaction_history': 20 / 15,
|
|
657
|
+
'user/info': 20 / 15,
|
|
658
|
+
'user/sub_relation': 20 / 15,
|
|
607
659
|
},
|
|
608
660
|
},
|
|
609
661
|
},
|
|
@@ -6383,7 +6435,7 @@ export default class gate extends Exchange {
|
|
|
6383
6435
|
if (type !== 'future' && type !== 'swap') {
|
|
6384
6436
|
throw new BadRequest(this.id + ' fetchMarketLeverageTiers only supports swap and future');
|
|
6385
6437
|
}
|
|
6386
|
-
const response = await this.
|
|
6438
|
+
const response = await this.publicFuturesGetSettleRiskLimitTiers(this.extend(request, requestParams));
|
|
6387
6439
|
//
|
|
6388
6440
|
// [
|
|
6389
6441
|
// {
|
package/js/src/hyperliquid.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/hyperliquid.js';
|
|
2
|
-
import type { Market, TransferEntry, Balances, Int, OrderBook, OHLCV, Str, FundingRateHistory, Order, OrderType, OrderSide, Trade, Strings, Position, OrderRequest, Dict, Num, MarginModification, Currencies, CancellationRequest, int, Transaction, Currency, TradingFeeInterface, Ticker, Tickers, LedgerEntry, FundingRates, FundingRate, OpenInterests } from './base/types.js';
|
|
2
|
+
import type { Market, TransferEntry, Balances, Int, OrderBook, OHLCV, Str, FundingRateHistory, Order, OrderType, OrderSide, Trade, Strings, Position, OrderRequest, Dict, Num, MarginModification, Currencies, CancellationRequest, int, Transaction, Currency, TradingFeeInterface, Ticker, Tickers, LedgerEntry, FundingRates, FundingRate, OpenInterests, MarketInterface } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class hyperliquid
|
|
5
5
|
* @augments Exchange
|
|
@@ -7,6 +7,8 @@ import type { Market, TransferEntry, Balances, Int, OrderBook, OHLCV, Str, Fundi
|
|
|
7
7
|
export default class hyperliquid extends Exchange {
|
|
8
8
|
describe(): any;
|
|
9
9
|
setSandboxMode(enabled: any): void;
|
|
10
|
+
market(symbol: string): MarketInterface;
|
|
11
|
+
safeMarket(marketId?: Str, market?: Market, delimiter?: Str, marketType?: Str): MarketInterface;
|
|
10
12
|
/**
|
|
11
13
|
* @method
|
|
12
14
|
* @name hyperliquid#fetchCurrencies
|
package/js/src/hyperliquid.js
CHANGED
|
@@ -345,6 +345,56 @@ export default class hyperliquid extends Exchange {
|
|
|
345
345
|
super.setSandboxMode(enabled);
|
|
346
346
|
this.options['sandboxMode'] = enabled;
|
|
347
347
|
}
|
|
348
|
+
market(symbol) {
|
|
349
|
+
if (this.markets === undefined) {
|
|
350
|
+
throw new ExchangeError(this.id + ' markets not loaded');
|
|
351
|
+
}
|
|
352
|
+
if (symbol in this.markets) {
|
|
353
|
+
const market = this.markets[symbol];
|
|
354
|
+
if (market['spot']) {
|
|
355
|
+
const baseName = this.safeString(market, 'baseName');
|
|
356
|
+
const spotCurrencyMapping = this.safeDict(this.options, 'spotCurrencyMapping', {});
|
|
357
|
+
if (baseName in spotCurrencyMapping) {
|
|
358
|
+
const unifiedBaseName = this.safeString(spotCurrencyMapping, baseName);
|
|
359
|
+
const quote = this.safeString(market, 'quote');
|
|
360
|
+
const newSymbol = this.safeCurrencyCode(unifiedBaseName) + '/' + quote;
|
|
361
|
+
if (newSymbol in this.markets) {
|
|
362
|
+
return this.markets[newSymbol];
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
const res = super.market(symbol);
|
|
368
|
+
return res;
|
|
369
|
+
}
|
|
370
|
+
safeMarket(marketId = undefined, market = undefined, delimiter = undefined, marketType = undefined) {
|
|
371
|
+
if (marketId !== undefined) {
|
|
372
|
+
if ((this.markets_by_id !== undefined) && (marketId in this.markets_by_id)) {
|
|
373
|
+
const markets = this.markets_by_id[marketId];
|
|
374
|
+
const numMarkets = markets.length;
|
|
375
|
+
if (numMarkets === 1) {
|
|
376
|
+
return markets[0];
|
|
377
|
+
}
|
|
378
|
+
else {
|
|
379
|
+
if (numMarkets > 2) {
|
|
380
|
+
throw new ExchangeError(this.id + ' safeMarket() found more than two markets with the same market id ' + marketId);
|
|
381
|
+
}
|
|
382
|
+
const firstMarket = markets[0];
|
|
383
|
+
const secondMarket = markets[1];
|
|
384
|
+
if (this.safeString(firstMarket, 'type') !== this.safeString(secondMarket, 'type')) {
|
|
385
|
+
throw new ExchangeError(this.id + ' safeMarket() found two different market types with the same market id ' + marketId);
|
|
386
|
+
}
|
|
387
|
+
const baseCurrency = this.safeString(firstMarket, 'base');
|
|
388
|
+
const spotCurrencyMapping = this.safeDict(this.options, 'spotCurrencyMapping', {});
|
|
389
|
+
if (baseCurrency in spotCurrencyMapping) {
|
|
390
|
+
return secondMarket;
|
|
391
|
+
}
|
|
392
|
+
return firstMarket;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
return super.safeMarket(marketId, market, delimiter, marketType);
|
|
397
|
+
}
|
|
348
398
|
/**
|
|
349
399
|
* @method
|
|
350
400
|
* @name hyperliquid#fetchCurrencies
|
|
@@ -691,12 +741,14 @@ export default class hyperliquid extends Exchange {
|
|
|
691
741
|
// backward support
|
|
692
742
|
const base = this.safeCurrencyCode(baseName);
|
|
693
743
|
const quote = this.safeCurrencyCode(quoteId);
|
|
744
|
+
const newEntry = this.extend({}, entry);
|
|
694
745
|
const symbol = base + '/' + quote;
|
|
695
746
|
if (symbol !== mappedSymbol) {
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
747
|
+
newEntry['symbol'] = symbol;
|
|
748
|
+
newEntry['base'] = base;
|
|
749
|
+
newEntry['quote'] = quote;
|
|
750
|
+
newEntry['baseName'] = baseName;
|
|
751
|
+
markets.push(this.safeMarketStructure(newEntry));
|
|
700
752
|
}
|
|
701
753
|
}
|
|
702
754
|
return markets;
|
|
@@ -1144,6 +1196,9 @@ export default class hyperliquid extends Exchange {
|
|
|
1144
1196
|
// optimization if limit is provided
|
|
1145
1197
|
const timeframeInMilliseconds = this.parseTimeframe(timeframe) * 1000;
|
|
1146
1198
|
since = this.sum(until, timeframeInMilliseconds * limit * -1);
|
|
1199
|
+
if (since < 0) {
|
|
1200
|
+
since = 0;
|
|
1201
|
+
}
|
|
1147
1202
|
useTail = false;
|
|
1148
1203
|
}
|
|
1149
1204
|
else {
|
|
@@ -2901,8 +2956,15 @@ export default class hyperliquid extends Exchange {
|
|
|
2901
2956
|
}
|
|
2902
2957
|
const rawUnrealizedPnl = this.safeString(entry, 'unrealizedPnl');
|
|
2903
2958
|
const absRawUnrealizedPnl = Precise.stringAbs(rawUnrealizedPnl);
|
|
2904
|
-
const
|
|
2905
|
-
|
|
2959
|
+
const marginUsed = this.safeString(entry, 'marginUsed');
|
|
2960
|
+
let initialMargin = undefined;
|
|
2961
|
+
if (isIsolated) {
|
|
2962
|
+
initialMargin = Precise.stringSub(marginUsed, rawUnrealizedPnl);
|
|
2963
|
+
}
|
|
2964
|
+
else {
|
|
2965
|
+
initialMargin = marginUsed;
|
|
2966
|
+
}
|
|
2967
|
+
const percentage = Precise.stringMul(Precise.stringDiv(absRawUnrealizedPnl, marginUsed), '100');
|
|
2906
2968
|
return this.safePosition({
|
|
2907
2969
|
'info': position,
|
|
2908
2970
|
'id': undefined,
|
|
@@ -2918,7 +2980,7 @@ export default class hyperliquid extends Exchange {
|
|
|
2918
2980
|
'markPrice': undefined,
|
|
2919
2981
|
'notional': this.safeNumber(entry, 'positionValue'),
|
|
2920
2982
|
'leverage': this.safeNumber(leverage, 'value'),
|
|
2921
|
-
'collateral': this.
|
|
2983
|
+
'collateral': this.parseNumber(marginUsed),
|
|
2922
2984
|
'initialMargin': this.parseNumber(initialMargin),
|
|
2923
2985
|
'maintenanceMargin': undefined,
|
|
2924
2986
|
'initialMarginPercentage': undefined,
|
package/js/src/kucoin.js
CHANGED
|
@@ -122,6 +122,7 @@ export default class kucoin extends Exchange {
|
|
|
122
122
|
'webExchange': 'https://kucoin.com/_api',
|
|
123
123
|
'broker': 'https://api-broker.kucoin.com',
|
|
124
124
|
'earn': 'https://api.kucoin.com',
|
|
125
|
+
'uta': 'https://api.kucoin.com',
|
|
125
126
|
},
|
|
126
127
|
'www': 'https://www.kucoin.com',
|
|
127
128
|
'doc': [
|
|
@@ -161,7 +162,8 @@ export default class kucoin extends Exchange {
|
|
|
161
162
|
'mark-price/{symbol}/current': 3,
|
|
162
163
|
'mark-price/all-symbols': 3,
|
|
163
164
|
'margin/config': 25,
|
|
164
|
-
'announcements': 20,
|
|
165
|
+
'announcements': 20,
|
|
166
|
+
'margin/collateralRatio': 10,
|
|
165
167
|
},
|
|
166
168
|
'post': {
|
|
167
169
|
// ws
|
|
@@ -243,6 +245,9 @@ export default class kucoin extends Exchange {
|
|
|
243
245
|
'purchase/orders': 10,
|
|
244
246
|
// broker
|
|
245
247
|
'broker/api/rebase/download': 3,
|
|
248
|
+
'broker/queryMyCommission': 3,
|
|
249
|
+
'broker/queryUser': 3,
|
|
250
|
+
'broker/queryDetailByUid': 3,
|
|
246
251
|
'migrate/user/account/status': 3,
|
|
247
252
|
// affiliate
|
|
248
253
|
'affiliate/inviter/statistics': 30,
|
|
@@ -364,7 +369,9 @@ export default class kucoin extends Exchange {
|
|
|
364
369
|
'positions': 3,
|
|
365
370
|
'margin/maxWithdrawMargin': 15,
|
|
366
371
|
'contracts/risk-limit/{symbol}': 7.5,
|
|
367
|
-
'funding-history': 7.5,
|
|
372
|
+
'funding-history': 7.5,
|
|
373
|
+
'copy-trade/futures/get-max-open-size': 6,
|
|
374
|
+
'copy-trade/futures/position/margin/max-withdraw-margin': 15, // 10FW
|
|
368
375
|
},
|
|
369
376
|
'post': {
|
|
370
377
|
// funding
|
|
@@ -378,6 +385,17 @@ export default class kucoin extends Exchange {
|
|
|
378
385
|
'margin/withdrawMargin': 15,
|
|
379
386
|
'position/margin/deposit-margin': 6,
|
|
380
387
|
'position/risk-limit-level/change': 6,
|
|
388
|
+
'copy-trade/futures/orders': 3,
|
|
389
|
+
'copy-trade/futures/orders/test': 3,
|
|
390
|
+
'copy-trade/futures/st-orders': 3,
|
|
391
|
+
'copy-trade/futures/position/margin/deposit-margin': 6,
|
|
392
|
+
'copy-trade/futures/position/margin/withdraw-margin': 15,
|
|
393
|
+
'copy-trade/futures/position/risk-limit-level/change': 3,
|
|
394
|
+
'copy-trade/futures/position/margin/auto-deposit-status': 6,
|
|
395
|
+
'copy-trade/futures/position/changeMarginMode': 3,
|
|
396
|
+
'copy-trade/futures/position/changeCrossUserLeverage': 3,
|
|
397
|
+
'copy-trade/getCrossModeMarginRequirement': 4.5,
|
|
398
|
+
'copy-trade/position/switchPositionMode': 3,
|
|
381
399
|
// ws
|
|
382
400
|
'bullet-private': 15, // 10FW
|
|
383
401
|
},
|
|
@@ -385,7 +403,9 @@ export default class kucoin extends Exchange {
|
|
|
385
403
|
'orders/{orderId}': 1.5,
|
|
386
404
|
'orders/client-order/{clientOid}': 1.5,
|
|
387
405
|
'orders': 45,
|
|
388
|
-
'stopOrders': 22.5,
|
|
406
|
+
'stopOrders': 22.5,
|
|
407
|
+
'copy-trade/futures/orders': 1.5,
|
|
408
|
+
'copy-trade/futures/orders/client-order': 1.5, // 1FW
|
|
389
409
|
},
|
|
390
410
|
},
|
|
391
411
|
'webExchange': {
|
|
@@ -433,6 +453,21 @@ export default class kucoin extends Exchange {
|
|
|
433
453
|
'earn/orders': 7.5, // 5EW
|
|
434
454
|
},
|
|
435
455
|
},
|
|
456
|
+
'uta': {
|
|
457
|
+
'get': {
|
|
458
|
+
'market/announcement': 20,
|
|
459
|
+
'market/currency': 3,
|
|
460
|
+
'market/instrument': 4,
|
|
461
|
+
'market/ticker': 15,
|
|
462
|
+
'market/orderbook': 3,
|
|
463
|
+
'market/trade': 3,
|
|
464
|
+
'market/kline': 3,
|
|
465
|
+
'market/funding-rate': 2,
|
|
466
|
+
'market/funding-rate-history': 5,
|
|
467
|
+
'market/cross-config': 25,
|
|
468
|
+
'market/server/status': 3,
|
|
469
|
+
},
|
|
470
|
+
},
|
|
436
471
|
},
|
|
437
472
|
'timeframes': {
|
|
438
473
|
'1m': '1min',
|
|
@@ -5063,6 +5098,9 @@ export default class kucoin extends Exchange {
|
|
|
5063
5098
|
if (api === 'earn') {
|
|
5064
5099
|
endpoint = '/api/v1/' + this.implodeParams(path, params);
|
|
5065
5100
|
}
|
|
5101
|
+
if (api === 'uta') {
|
|
5102
|
+
endpoint = '/api/ua/v1/' + this.implodeParams(path, params);
|
|
5103
|
+
}
|
|
5066
5104
|
const query = this.omit(params, this.extractParams(path));
|
|
5067
5105
|
let endpart = '';
|
|
5068
5106
|
headers = (headers !== undefined) ? headers : {};
|
package/js/src/pro/binance.js
CHANGED
|
@@ -2317,10 +2317,6 @@ export default class binance extends binanceRest {
|
|
|
2317
2317
|
}
|
|
2318
2318
|
signParams(params = {}) {
|
|
2319
2319
|
this.checkRequiredCredentials();
|
|
2320
|
-
let extendedParams = this.extend({
|
|
2321
|
-
'timestamp': this.nonce(),
|
|
2322
|
-
'apiKey': this.apiKey,
|
|
2323
|
-
}, params);
|
|
2324
2320
|
const defaultRecvWindow = this.safeInteger(this.options, 'recvWindow');
|
|
2325
2321
|
if (defaultRecvWindow !== undefined) {
|
|
2326
2322
|
params['recvWindow'] = defaultRecvWindow;
|
|
@@ -2329,6 +2325,10 @@ export default class binance extends binanceRest {
|
|
|
2329
2325
|
if (recvWindow !== undefined) {
|
|
2330
2326
|
params['recvWindow'] = recvWindow;
|
|
2331
2327
|
}
|
|
2328
|
+
let extendedParams = this.extend({
|
|
2329
|
+
'timestamp': this.nonce(),
|
|
2330
|
+
'apiKey': this.apiKey,
|
|
2331
|
+
}, params);
|
|
2332
2332
|
extendedParams = this.keysort(extendedParams);
|
|
2333
2333
|
const query = this.urlencode(extendedParams);
|
|
2334
2334
|
let signature = undefined;
|
|
@@ -3549,7 +3549,7 @@ export default class binance extends binanceRest {
|
|
|
3549
3549
|
else if (this.isInverse(type, subType)) {
|
|
3550
3550
|
type = 'delivery';
|
|
3551
3551
|
}
|
|
3552
|
-
params = this.extend(params, { 'type': type, 'symbol': symbol }); // needed inside authenticate for isolated margin
|
|
3552
|
+
params = this.extend(params, { 'type': type, 'symbol': symbol, 'subType': subType }); // needed inside authenticate for isolated margin
|
|
3553
3553
|
await this.authenticate(params);
|
|
3554
3554
|
let marginMode = undefined;
|
|
3555
3555
|
[marginMode, params] = this.handleMarginModeAndParams('watchOrders', params);
|
|
@@ -4228,7 +4228,7 @@ export default class binance extends binanceRest {
|
|
|
4228
4228
|
messageHash += ':' + symbol;
|
|
4229
4229
|
params = this.extend(params, { 'type': market['type'], 'symbol': symbol });
|
|
4230
4230
|
}
|
|
4231
|
-
await this.authenticate(params);
|
|
4231
|
+
await this.authenticate(this.extend({ 'type': type, 'subType': subType }, params));
|
|
4232
4232
|
let urlType = type; // we don't change type because the listening key is different
|
|
4233
4233
|
if (type === 'margin') {
|
|
4234
4234
|
urlType = 'spot'; // spot-margin shares the same stream as regular spot
|
package/js/src/pro/bitfinex.js
CHANGED
|
@@ -56,12 +56,15 @@ export default class bitfinex extends bitfinexRest {
|
|
|
56
56
|
};
|
|
57
57
|
const result = await this.watch(url, messageHash, this.deepExtend(request, params), messageHash, { 'checksum': false });
|
|
58
58
|
const checksum = this.safeBool(this.options, 'checksum', true);
|
|
59
|
-
if (checksum &&
|
|
60
|
-
client.subscriptions[messageHash]
|
|
61
|
-
|
|
62
|
-
'
|
|
63
|
-
|
|
64
|
-
|
|
59
|
+
if (checksum && (channel === 'book')) {
|
|
60
|
+
const sub = client.subscriptions[messageHash];
|
|
61
|
+
if (sub && !sub['checksum']) {
|
|
62
|
+
client.subscriptions[messageHash]['checksum'] = true;
|
|
63
|
+
await client.send({
|
|
64
|
+
'event': 'conf',
|
|
65
|
+
'flags': 131072,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
65
68
|
}
|
|
66
69
|
return result;
|
|
67
70
|
}
|