ccxt 4.4.44 → 4.4.45
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 +3 -3
- package/dist/ccxt.browser.min.js +15 -15
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/binance.js +161 -39
- package/dist/cjs/src/bingx.js +15 -9
- package/dist/cjs/src/bitfinex.js +1 -1
- package/dist/cjs/src/bitget.js +3 -3
- package/dist/cjs/src/bitmart.js +3 -3
- package/dist/cjs/src/bitmex.js +1 -1
- package/dist/cjs/src/blofin.js +22 -0
- package/dist/cjs/src/bybit.js +4 -4
- package/dist/cjs/src/coinbase.js +1 -1
- package/dist/cjs/src/coinex.js +1 -1
- package/dist/cjs/src/cryptocom.js +1 -1
- package/dist/cjs/src/exmo.js +18 -8
- package/dist/cjs/src/gate.js +1 -1
- package/dist/cjs/src/hashkey.js +7 -1
- package/dist/cjs/src/htx.js +2 -2
- package/dist/cjs/src/hyperliquid.js +1 -1
- package/dist/cjs/src/kraken.js +1 -1
- package/dist/cjs/src/krakenfutures.js +1 -1
- package/dist/cjs/src/kucoin.js +1 -1
- package/dist/cjs/src/kucoinfutures.js +2 -3
- package/dist/cjs/src/lykke.js +1 -1
- package/dist/cjs/src/mexc.js +2 -2
- package/dist/cjs/src/myokx.js +8 -0
- package/dist/cjs/src/okx.js +4 -4
- package/dist/cjs/src/onetrading.js +2 -1
- package/dist/cjs/src/pro/binance.js +2 -1
- package/dist/cjs/src/pro/myokx.js +5 -0
- package/dist/cjs/src/whitebit.js +34 -8
- package/dist/cjs/src/woo.js +1 -1
- package/dist/cjs/src/woofipro.js +2 -2
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/blofin.d.ts +22 -0
- package/js/src/binance.d.ts +4 -0
- package/js/src/binance.js +161 -39
- package/js/src/bingx.js +15 -9
- package/js/src/bitfinex.js +1 -1
- package/js/src/bitget.js +3 -3
- package/js/src/bitmart.js +3 -3
- package/js/src/bitmex.js +1 -1
- package/js/src/blofin.js +22 -0
- package/js/src/bybit.js +4 -4
- package/js/src/coinbase.js +1 -1
- package/js/src/coinex.js +1 -1
- package/js/src/cryptocom.js +1 -1
- package/js/src/exmo.d.ts +1 -0
- package/js/src/exmo.js +18 -8
- package/js/src/gate.js +1 -1
- package/js/src/hashkey.js +7 -1
- package/js/src/htx.js +2 -2
- package/js/src/hyperliquid.js +1 -1
- package/js/src/kraken.js +1 -1
- package/js/src/krakenfutures.js +1 -1
- package/js/src/kucoin.js +1 -1
- package/js/src/kucoinfutures.js +2 -3
- package/js/src/lykke.js +1 -1
- package/js/src/mexc.js +2 -2
- package/js/src/myokx.js +8 -0
- package/js/src/okx.js +4 -4
- package/js/src/onetrading.js +2 -1
- package/js/src/pro/binance.js +2 -1
- package/js/src/pro/myokx.js +5 -0
- package/js/src/whitebit.d.ts +2 -1
- package/js/src/whitebit.js +34 -8
- package/js/src/woo.js +1 -1
- package/js/src/woofipro.js +2 -2
- package/package.json +1 -1
package/dist/cjs/ccxt.js
CHANGED
|
@@ -202,7 +202,7 @@ var xt$1 = require('./src/pro/xt.js');
|
|
|
202
202
|
|
|
203
203
|
//-----------------------------------------------------------------------------
|
|
204
204
|
// this is updated by vss.js when building
|
|
205
|
-
const version = '4.4.
|
|
205
|
+
const version = '4.4.45';
|
|
206
206
|
Exchange["default"].ccxtVersion = version;
|
|
207
207
|
const exchanges = {
|
|
208
208
|
'ace': ace,
|
package/dist/cjs/src/binance.js
CHANGED
|
@@ -1619,7 +1619,7 @@ class binance extends binance$1 {
|
|
|
1619
1619
|
'fetchClosedOrders': {
|
|
1620
1620
|
'marginMode': true,
|
|
1621
1621
|
'limit': 1000,
|
|
1622
|
-
'
|
|
1622
|
+
'daysBack': undefined,
|
|
1623
1623
|
'daysBackCanceled': undefined,
|
|
1624
1624
|
'untilDays': 10000,
|
|
1625
1625
|
'trigger': false,
|
|
@@ -1689,7 +1689,7 @@ class binance extends binance$1 {
|
|
|
1689
1689
|
'fetchClosedOrders': {
|
|
1690
1690
|
'marginMode': true,
|
|
1691
1691
|
'limit': 1000,
|
|
1692
|
-
'
|
|
1692
|
+
'daysBack': 90,
|
|
1693
1693
|
'daysBackCanceled': 3,
|
|
1694
1694
|
'untilDays': 7,
|
|
1695
1695
|
'trigger': false,
|
|
@@ -2412,22 +2412,72 @@ class binance extends binance$1 {
|
|
|
2412
2412
|
'portfolioMargin': {
|
|
2413
2413
|
'exact': {
|
|
2414
2414
|
//
|
|
2415
|
-
//
|
|
2415
|
+
// 10xx General Server or Network Issues
|
|
2416
2416
|
//
|
|
2417
|
+
'-1000': errors.OperationFailed,
|
|
2418
|
+
'-1001': errors.ExchangeError,
|
|
2419
|
+
'-1002': errors.PermissionDenied,
|
|
2420
|
+
'-1003': errors.RateLimitExceeded,
|
|
2421
|
+
'-1004': errors.BadRequest,
|
|
2417
2422
|
'-1005': errors.PermissionDenied,
|
|
2423
|
+
'-1006': errors.BadResponse,
|
|
2424
|
+
'-1007': errors.BadResponse,
|
|
2425
|
+
'-1008': errors.OperationFailed,
|
|
2426
|
+
'-1010': errors.ExchangeError,
|
|
2418
2427
|
'-1011': errors.PermissionDenied,
|
|
2428
|
+
'-1013': errors.ExchangeError,
|
|
2429
|
+
'-1014': errors.InvalidOrder,
|
|
2430
|
+
'-1015': errors.InvalidOrder,
|
|
2431
|
+
'-1016': errors.NotSupported,
|
|
2432
|
+
'-1020': errors.NotSupported,
|
|
2433
|
+
'-1021': errors.BadRequest,
|
|
2434
|
+
'-1022': errors.BadRequest,
|
|
2419
2435
|
'-1023': errors.BadRequest,
|
|
2436
|
+
'-1099': errors.OperationFailed,
|
|
2437
|
+
//
|
|
2438
|
+
// 11xx Request Issues
|
|
2439
|
+
//
|
|
2440
|
+
'-1100': errors.BadRequest,
|
|
2441
|
+
'-1101': errors.BadRequest,
|
|
2442
|
+
'-1102': errors.BadRequest,
|
|
2443
|
+
'-1103': errors.BadRequest,
|
|
2444
|
+
'-1104': errors.BadRequest,
|
|
2445
|
+
'-1105': errors.BadRequest,
|
|
2446
|
+
'-1106': errors.BadRequest,
|
|
2447
|
+
'-1108': errors.BadRequest,
|
|
2420
2448
|
'-1109': errors.BadRequest,
|
|
2421
2449
|
'-1110': errors.BadSymbol,
|
|
2450
|
+
'-1111': errors.BadRequest,
|
|
2451
|
+
'-1112': errors.BadRequest,
|
|
2422
2452
|
'-1113': errors.BadRequest,
|
|
2453
|
+
'-1114': errors.BadRequest,
|
|
2454
|
+
'-1115': errors.BadRequest,
|
|
2455
|
+
'-1116': errors.BadRequest,
|
|
2456
|
+
'-1117': errors.BadRequest,
|
|
2457
|
+
'-1118': errors.BadRequest,
|
|
2458
|
+
'-1119': errors.BadRequest,
|
|
2459
|
+
'-1120': errors.BadRequest,
|
|
2460
|
+
'-1121': errors.BadSymbol,
|
|
2461
|
+
'-1125': errors.BadRequest,
|
|
2462
|
+
'-1127': errors.BadRequest,
|
|
2423
2463
|
'-1128': errors.BadRequest,
|
|
2464
|
+
'-1130': errors.BadRequest,
|
|
2465
|
+
'-1131': errors.BadRequest,
|
|
2466
|
+
'-1134': errors.BadRequest,
|
|
2424
2467
|
'-1136': errors.BadRequest,
|
|
2468
|
+
'-1145': errors.BadRequest,
|
|
2469
|
+
'-1151': errors.BadRequest,
|
|
2425
2470
|
//
|
|
2426
|
-
//
|
|
2471
|
+
// 20xx Processing Issues
|
|
2427
2472
|
//
|
|
2428
|
-
'-
|
|
2429
|
-
'-
|
|
2430
|
-
'-
|
|
2473
|
+
'-2010': errors.InvalidOrder,
|
|
2474
|
+
'-2011': errors.OperationRejected,
|
|
2475
|
+
'-2013': errors.BadRequest,
|
|
2476
|
+
'-2014': errors.OperationRejected,
|
|
2477
|
+
'-2015': errors.OperationRejected,
|
|
2478
|
+
'-2016': errors.OperationFailed,
|
|
2479
|
+
'-2018': errors.OperationFailed,
|
|
2480
|
+
'-2019': errors.OperationFailed,
|
|
2431
2481
|
'-2020': errors.OrderNotFillable,
|
|
2432
2482
|
'-2021': errors.OrderImmediatelyFillable,
|
|
2433
2483
|
'-2022': errors.InvalidOrder,
|
|
@@ -2438,12 +2488,67 @@ class binance extends binance$1 {
|
|
|
2438
2488
|
'-2027': errors.OperationRejected,
|
|
2439
2489
|
'-2028': errors.OperationRejected,
|
|
2440
2490
|
//
|
|
2441
|
-
// 4xxx
|
|
2491
|
+
// 4xxx Filters and other issues
|
|
2442
2492
|
//
|
|
2493
|
+
'-4000': errors.BadRequest,
|
|
2494
|
+
'-4001': errors.BadRequest,
|
|
2495
|
+
'-4002': errors.BadRequest,
|
|
2496
|
+
'-4003': errors.BadRequest,
|
|
2497
|
+
'-4004': errors.BadRequest,
|
|
2498
|
+
'-4005': errors.BadRequest,
|
|
2499
|
+
'-4006': errors.BadRequest,
|
|
2500
|
+
'-4007': errors.BadRequest,
|
|
2501
|
+
'-4008': errors.BadRequest,
|
|
2502
|
+
'-4009': errors.BadRequest,
|
|
2503
|
+
'-4010': errors.BadRequest,
|
|
2504
|
+
'-4011': errors.BadRequest,
|
|
2505
|
+
'-4012': errors.BadRequest,
|
|
2506
|
+
'-4013': errors.BadRequest,
|
|
2507
|
+
'-4014': errors.BadRequest,
|
|
2508
|
+
'-4015': errors.BadRequest,
|
|
2509
|
+
'-4016': errors.BadRequest,
|
|
2510
|
+
'-4017': errors.BadRequest,
|
|
2511
|
+
'-4018': errors.BadRequest,
|
|
2512
|
+
'-4019': errors.BadRequest,
|
|
2513
|
+
'-4020': errors.BadRequest,
|
|
2514
|
+
'-4021': errors.BadRequest,
|
|
2515
|
+
'-4022': errors.BadRequest,
|
|
2516
|
+
'-4023': errors.BadRequest,
|
|
2517
|
+
'-4024': errors.BadRequest,
|
|
2518
|
+
'-4025': errors.BadRequest,
|
|
2519
|
+
'-4026': errors.BadRequest,
|
|
2520
|
+
'-4027': errors.BadRequest,
|
|
2521
|
+
'-4028': errors.BadRequest,
|
|
2522
|
+
'-4029': errors.BadRequest,
|
|
2523
|
+
'-4030': errors.BadRequest,
|
|
2524
|
+
'-4031': errors.BadRequest,
|
|
2525
|
+
'-4032': errors.BadRequest,
|
|
2526
|
+
'-4033': errors.BadRequest,
|
|
2527
|
+
'-4044': errors.BadRequest,
|
|
2528
|
+
'-4045': errors.BadRequest,
|
|
2529
|
+
'-4046': errors.BadRequest,
|
|
2530
|
+
'-4047': errors.BadRequest,
|
|
2531
|
+
'-4048': errors.BadRequest,
|
|
2532
|
+
'-4049': errors.BadRequest,
|
|
2533
|
+
'-4050': errors.BadRequest,
|
|
2534
|
+
'-4051': errors.BadRequest,
|
|
2535
|
+
'-4052': errors.BadRequest,
|
|
2536
|
+
'-4053': errors.BadRequest,
|
|
2537
|
+
'-4054': errors.BadRequest,
|
|
2538
|
+
'-4055': errors.BadRequest,
|
|
2539
|
+
'-4056': errors.PermissionDenied,
|
|
2540
|
+
'-4057': errors.PermissionDenied,
|
|
2541
|
+
'-4058': errors.BadRequest,
|
|
2542
|
+
'-4059': errors.BadRequest,
|
|
2543
|
+
'-4060': errors.BadRequest,
|
|
2544
|
+
'-4061': errors.InvalidOrder,
|
|
2545
|
+
'-4062': errors.BadRequest,
|
|
2443
2546
|
'-4063': errors.BadRequest,
|
|
2444
2547
|
'-4064': errors.BadRequest,
|
|
2445
2548
|
'-4065': errors.BadRequest,
|
|
2446
2549
|
'-4066': errors.BadRequest,
|
|
2550
|
+
'-4067': errors.BadRequest,
|
|
2551
|
+
'-4068': errors.BadRequest,
|
|
2447
2552
|
'-4069': errors.BadRequest,
|
|
2448
2553
|
'-4070': errors.BadRequest,
|
|
2449
2554
|
'-4071': errors.BadRequest,
|
|
@@ -2457,47 +2562,39 @@ class binance extends binance$1 {
|
|
|
2457
2562
|
'-4079': errors.BadRequest,
|
|
2458
2563
|
'-4080': errors.PermissionDenied,
|
|
2459
2564
|
'-4081': errors.BadRequest,
|
|
2565
|
+
'-4082': errors.BadRequest,
|
|
2566
|
+
'-4083': errors.BadRequest,
|
|
2567
|
+
'-4084': errors.NotSupported,
|
|
2460
2568
|
'-4085': errors.BadRequest,
|
|
2461
2569
|
'-4086': errors.BadRequest,
|
|
2462
2570
|
'-4087': errors.PermissionDenied,
|
|
2463
2571
|
'-4088': errors.PermissionDenied,
|
|
2572
|
+
'-4104': errors.BadRequest,
|
|
2464
2573
|
'-4114': errors.BadRequest,
|
|
2465
2574
|
'-4115': errors.BadRequest,
|
|
2466
2575
|
'-4118': errors.OperationRejected,
|
|
2467
2576
|
'-4131': errors.OperationRejected,
|
|
2468
|
-
'-
|
|
2577
|
+
'-4135': errors.BadRequest,
|
|
2578
|
+
'-4137': errors.BadRequest,
|
|
2579
|
+
'-4138': errors.BadRequest,
|
|
2580
|
+
'-4139': errors.BadRequest,
|
|
2581
|
+
'-4140': errors.OrderImmediatelyFillable,
|
|
2469
2582
|
'-4141': errors.BadRequest,
|
|
2583
|
+
'-4142': errors.OrderImmediatelyFillable,
|
|
2470
2584
|
'-4144': errors.BadSymbol,
|
|
2471
2585
|
'-4161': errors.OperationRejected,
|
|
2472
|
-
'-4164': errors.
|
|
2586
|
+
'-4164': errors.InvalidOrder,
|
|
2473
2587
|
'-4165': errors.BadRequest,
|
|
2474
|
-
'-4183': errors.
|
|
2475
|
-
'-4184': errors.
|
|
2588
|
+
'-4183': errors.InvalidOrder,
|
|
2589
|
+
'-4184': errors.InvalidOrder,
|
|
2590
|
+
'-4408': errors.InvalidOrder,
|
|
2476
2591
|
//
|
|
2477
|
-
// 5xxx
|
|
2592
|
+
// 5xxx Order Execution Issues
|
|
2478
2593
|
//
|
|
2479
2594
|
'-5021': errors.OrderNotFillable,
|
|
2480
2595
|
'-5022': errors.OrderNotFillable,
|
|
2481
|
-
|
|
2482
|
-
//
|
|
2483
|
-
//
|
|
2484
|
-
'-20121': errors.ExchangeError,
|
|
2485
|
-
'-20124': errors.ExchangeError,
|
|
2486
|
-
'-20130': errors.ExchangeError,
|
|
2487
|
-
'-20132': errors.ExchangeError,
|
|
2488
|
-
'-20194': errors.ExchangeError,
|
|
2489
|
-
'-20195': errors.ExchangeError,
|
|
2490
|
-
'-20196': errors.ExchangeError,
|
|
2491
|
-
'-20198': errors.ExchangeError,
|
|
2492
|
-
'-20204': errors.ExchangeError,
|
|
2493
|
-
// 21xxx - PORTFOLIO MARGIN (documented in spot docs)
|
|
2494
|
-
'-21001': errors.BadRequest,
|
|
2495
|
-
'-21002': errors.BadRequest,
|
|
2496
|
-
'-21003': errors.BadResponse,
|
|
2497
|
-
'-21004': errors.OperationRejected,
|
|
2498
|
-
'-21005': errors.InsufficientFunds,
|
|
2499
|
-
'-21006': errors.OperationFailed,
|
|
2500
|
-
'-21007': errors.OperationFailed, // User failed to repay portfolio margin bankruptcy loan since liquidation was in process
|
|
2596
|
+
'-5028': errors.OperationFailed,
|
|
2597
|
+
'-5041': errors.RateLimitExceeded, // Time out for too many requests from this account queueing at the same time.
|
|
2501
2598
|
},
|
|
2502
2599
|
},
|
|
2503
2600
|
'exact': {
|
|
@@ -3601,7 +3698,11 @@ class binance extends binance$1 {
|
|
|
3601
3698
|
account['total'] = this.safeString(entry, 'crossMarginAsset');
|
|
3602
3699
|
}
|
|
3603
3700
|
else {
|
|
3604
|
-
|
|
3701
|
+
const usedLinear = this.safeString(entry, 'umUnrealizedPNL');
|
|
3702
|
+
const usedInverse = this.safeString(entry, 'cmUnrealizedPNL');
|
|
3703
|
+
const totalUsed = Precise["default"].stringAdd(usedLinear, usedInverse);
|
|
3704
|
+
const totalWalletBalance = this.safeString(entry, 'totalWalletBalance');
|
|
3705
|
+
account['total'] = Precise["default"].stringAdd(totalUsed, totalWalletBalance);
|
|
3605
3706
|
}
|
|
3606
3707
|
result[code] = account;
|
|
3607
3708
|
}
|
|
@@ -5355,10 +5456,10 @@ class binance extends binance$1 {
|
|
|
5355
5456
|
const request = {
|
|
5356
5457
|
'symbol': market['id'],
|
|
5357
5458
|
'side': side.toUpperCase(),
|
|
5459
|
+
'orderId': id,
|
|
5460
|
+
'quantity': this.amountToPrecision(symbol, amount),
|
|
5358
5461
|
};
|
|
5359
5462
|
const clientOrderId = this.safeStringN(params, ['newClientOrderId', 'clientOrderId', 'origClientOrderId']);
|
|
5360
|
-
request['orderId'] = id;
|
|
5361
|
-
request['quantity'] = this.amountToPrecision(symbol, amount);
|
|
5362
5463
|
if (price !== undefined) {
|
|
5363
5464
|
request['price'] = this.priceToPrecision(symbol, price);
|
|
5364
5465
|
}
|
|
@@ -5374,6 +5475,8 @@ class binance extends binance$1 {
|
|
|
5374
5475
|
* @description edit a trade order
|
|
5375
5476
|
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order
|
|
5376
5477
|
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Order
|
|
5478
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Modify-UM-Order
|
|
5479
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Modify-CM-Order
|
|
5377
5480
|
* @param {string} id cancel order id
|
|
5378
5481
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
5379
5482
|
* @param {string} type 'market' or 'limit'
|
|
@@ -5381,18 +5484,36 @@ class binance extends binance$1 {
|
|
|
5381
5484
|
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
5382
5485
|
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
5383
5486
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5487
|
+
* @param {boolean} [params.portfolioMargin] set to true if you would like to edit an order in a portfolio margin account
|
|
5384
5488
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5385
5489
|
*/
|
|
5386
5490
|
async editContractOrder(id, symbol, type, side, amount, price = undefined, params = {}) {
|
|
5387
5491
|
await this.loadMarkets();
|
|
5388
5492
|
const market = this.market(symbol);
|
|
5493
|
+
let isPortfolioMargin = undefined;
|
|
5494
|
+
[isPortfolioMargin, params] = this.handleOptionAndParams2(params, 'editContractOrder', 'papi', 'portfolioMargin', false);
|
|
5495
|
+
if (market['linear'] || isPortfolioMargin) {
|
|
5496
|
+
if (price === undefined) {
|
|
5497
|
+
throw new errors.ArgumentsRequired(this.id + ' editOrder() requires a price argument for portfolio margin and linear orders');
|
|
5498
|
+
}
|
|
5499
|
+
}
|
|
5389
5500
|
const request = this.editContractOrderRequest(id, symbol, type, side, amount, price, params);
|
|
5390
5501
|
let response = undefined;
|
|
5391
5502
|
if (market['linear']) {
|
|
5392
|
-
|
|
5503
|
+
if (isPortfolioMargin) {
|
|
5504
|
+
response = await this.papiPutUmOrder(this.extend(request, params));
|
|
5505
|
+
}
|
|
5506
|
+
else {
|
|
5507
|
+
response = await this.fapiPrivatePutOrder(this.extend(request, params));
|
|
5508
|
+
}
|
|
5393
5509
|
}
|
|
5394
5510
|
else if (market['inverse']) {
|
|
5395
|
-
|
|
5511
|
+
if (isPortfolioMargin) {
|
|
5512
|
+
response = await this.papiPutCmOrder(this.extend(request, params));
|
|
5513
|
+
}
|
|
5514
|
+
else {
|
|
5515
|
+
response = await this.dapiPrivatePutOrder(this.extend(request, params));
|
|
5516
|
+
}
|
|
5396
5517
|
}
|
|
5397
5518
|
//
|
|
5398
5519
|
// swap and future
|
|
@@ -5437,6 +5558,7 @@ class binance extends binance$1 {
|
|
|
5437
5558
|
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
5438
5559
|
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
5439
5560
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5561
|
+
* @param {boolean} [params.portfolioMargin] set to true if you would like to edit an order in a portfolio margin account
|
|
5440
5562
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5441
5563
|
*/
|
|
5442
5564
|
async editOrder(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
|
|
@@ -11949,7 +12071,7 @@ class binance extends binance$1 {
|
|
|
11949
12071
|
marketType = 'option';
|
|
11950
12072
|
}
|
|
11951
12073
|
else if (url.startsWith('https://papi.' + hostname + '/')) {
|
|
11952
|
-
marketType = '
|
|
12074
|
+
marketType = 'portfolioMargin';
|
|
11953
12075
|
}
|
|
11954
12076
|
if (marketType !== undefined) {
|
|
11955
12077
|
const exceptionsForMarketType = this.safeDict(this.exceptions, marketType, {});
|
package/dist/cjs/src/bingx.js
CHANGED
|
@@ -550,7 +550,7 @@ class bingx extends bingx$1 {
|
|
|
550
550
|
'mark': true,
|
|
551
551
|
'index': true,
|
|
552
552
|
},
|
|
553
|
-
'
|
|
553
|
+
'price': true,
|
|
554
554
|
},
|
|
555
555
|
'timeInForce': {
|
|
556
556
|
'IOC': true,
|
|
@@ -597,7 +597,7 @@ class bingx extends bingx$1 {
|
|
|
597
597
|
'fetchClosedOrders': {
|
|
598
598
|
'marginMode': false,
|
|
599
599
|
'limit': 1000,
|
|
600
|
-
'
|
|
600
|
+
'daysBack': undefined,
|
|
601
601
|
'daysBackCanceled': undefined,
|
|
602
602
|
'untilDays': 7,
|
|
603
603
|
'trigger': false,
|
|
@@ -621,7 +621,7 @@ class bingx extends bingx$1 {
|
|
|
621
621
|
'fetchClosedOrders': {
|
|
622
622
|
'marginMode': false,
|
|
623
623
|
'limit': 1000,
|
|
624
|
-
'
|
|
624
|
+
'daysBack': undefined,
|
|
625
625
|
'daysBackCanceled': undefined,
|
|
626
626
|
'untilDays': 7,
|
|
627
627
|
'trigger': false,
|
|
@@ -2737,8 +2737,10 @@ class bingx extends bingx$1 {
|
|
|
2737
2737
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2738
2738
|
*/
|
|
2739
2739
|
async createMarketOrderWithCost(symbol, side, cost, params = {}) {
|
|
2740
|
-
|
|
2741
|
-
|
|
2740
|
+
const req = {
|
|
2741
|
+
'quoteOrderQty': cost,
|
|
2742
|
+
};
|
|
2743
|
+
return await this.createOrder(symbol, 'market', side, cost, undefined, this.extend(req, params));
|
|
2742
2744
|
}
|
|
2743
2745
|
/**
|
|
2744
2746
|
* @method
|
|
@@ -2750,8 +2752,10 @@ class bingx extends bingx$1 {
|
|
|
2750
2752
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2751
2753
|
*/
|
|
2752
2754
|
async createMarketBuyOrderWithCost(symbol, cost, params = {}) {
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
+
const req = {
|
|
2756
|
+
'quoteOrderQty': cost,
|
|
2757
|
+
};
|
|
2758
|
+
return await this.createOrder(symbol, 'market', 'buy', cost, undefined, this.extend(req, params));
|
|
2755
2759
|
}
|
|
2756
2760
|
/**
|
|
2757
2761
|
* @method
|
|
@@ -2763,8 +2767,10 @@ class bingx extends bingx$1 {
|
|
|
2763
2767
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2764
2768
|
*/
|
|
2765
2769
|
async createMarketSellOrderWithCost(symbol, cost, params = {}) {
|
|
2766
|
-
|
|
2767
|
-
|
|
2770
|
+
const req = {
|
|
2771
|
+
'quoteOrderQty': cost,
|
|
2772
|
+
};
|
|
2773
|
+
return await this.createOrder(symbol, 'market', 'sell', cost, undefined, this.extend(req, params));
|
|
2768
2774
|
}
|
|
2769
2775
|
createOrderRequest(symbol, type, side, amount, price = undefined, params = {}) {
|
|
2770
2776
|
/**
|
package/dist/cjs/src/bitfinex.js
CHANGED
|
@@ -451,7 +451,7 @@ class bitfinex extends bitfinex$1 {
|
|
|
451
451
|
'fetchClosedOrders': {
|
|
452
452
|
'marginMode': false,
|
|
453
453
|
'limit': undefined,
|
|
454
|
-
'
|
|
454
|
+
'daysBack': undefined,
|
|
455
455
|
'daysBackCanceled': undefined,
|
|
456
456
|
'untilDays': 100000,
|
|
457
457
|
'trigger': false,
|
package/dist/cjs/src/bitget.js
CHANGED
|
@@ -1460,7 +1460,7 @@ class bitget extends bitget$1 {
|
|
|
1460
1460
|
'mark': false,
|
|
1461
1461
|
'index': false,
|
|
1462
1462
|
},
|
|
1463
|
-
'
|
|
1463
|
+
'price': true,
|
|
1464
1464
|
},
|
|
1465
1465
|
'timeInForce': {
|
|
1466
1466
|
'IOC': true,
|
|
@@ -1502,7 +1502,7 @@ class bitget extends bitget$1 {
|
|
|
1502
1502
|
'fetchClosedOrders': {
|
|
1503
1503
|
'marginMode': true,
|
|
1504
1504
|
'limit': 100,
|
|
1505
|
-
'
|
|
1505
|
+
'daysBack': undefined,
|
|
1506
1506
|
'daysBackCanceled': undefined,
|
|
1507
1507
|
'untilDays': 90,
|
|
1508
1508
|
'trigger': true,
|
|
@@ -1530,7 +1530,7 @@ class bitget extends bitget$1 {
|
|
|
1530
1530
|
'mark': true,
|
|
1531
1531
|
'index': true,
|
|
1532
1532
|
},
|
|
1533
|
-
'
|
|
1533
|
+
'price': false,
|
|
1534
1534
|
},
|
|
1535
1535
|
'timeInForce': {
|
|
1536
1536
|
'IOC': true,
|
package/dist/cjs/src/bitmart.js
CHANGED
|
@@ -737,7 +737,7 @@ class bitmart extends bitmart$1 {
|
|
|
737
737
|
'fetchClosedOrders': {
|
|
738
738
|
'marginMode': true,
|
|
739
739
|
'limit': 200,
|
|
740
|
-
'
|
|
740
|
+
'daysBack': undefined,
|
|
741
741
|
'daysBackCanceled': undefined,
|
|
742
742
|
'untilDays': undefined,
|
|
743
743
|
'trigger': false,
|
|
@@ -766,7 +766,7 @@ class bitmart extends bitmart$1 {
|
|
|
766
766
|
'mark': true,
|
|
767
767
|
'index': false,
|
|
768
768
|
},
|
|
769
|
-
'
|
|
769
|
+
'price': false,
|
|
770
770
|
},
|
|
771
771
|
'timeInForce': {
|
|
772
772
|
'IOC': true,
|
|
@@ -804,7 +804,7 @@ class bitmart extends bitmart$1 {
|
|
|
804
804
|
'fetchClosedOrders': {
|
|
805
805
|
'marginMode': true,
|
|
806
806
|
'limit': 200,
|
|
807
|
-
'
|
|
807
|
+
'daysBack': undefined,
|
|
808
808
|
'daysBackCanceled': undefined,
|
|
809
809
|
'untilDays': undefined,
|
|
810
810
|
'trigger': false,
|
package/dist/cjs/src/bitmex.js
CHANGED
package/dist/cjs/src/blofin.js
CHANGED
|
@@ -195,6 +195,18 @@ class blofin extends blofin$1 {
|
|
|
195
195
|
'trade/orders-tpsl-history': 1,
|
|
196
196
|
'user/query-apikey': 1,
|
|
197
197
|
'affiliate/basic': 1,
|
|
198
|
+
'copytrading/instruments': 1,
|
|
199
|
+
'copytrading/account/balance': 1,
|
|
200
|
+
'copytrading/account/positions-by-order': 1,
|
|
201
|
+
'copytrading/account/positions-details-by-order': 1,
|
|
202
|
+
'copytrading/account/positions-by-contract': 1,
|
|
203
|
+
'copytrading/account/position-mode': 1,
|
|
204
|
+
'copytrading/account/leverage-info': 1,
|
|
205
|
+
'copytrading/trade/orders-pending': 1,
|
|
206
|
+
'copytrading/trade/pending-tpsl-by-contract': 1,
|
|
207
|
+
'copytrading/trade/position-history-by-order': 1,
|
|
208
|
+
'copytrading/trade/orders-history': 1,
|
|
209
|
+
'copytrading/trade/pending-tpsl-by-order': 1,
|
|
198
210
|
},
|
|
199
211
|
'post': {
|
|
200
212
|
'trade/order': 1,
|
|
@@ -206,6 +218,16 @@ class blofin extends blofin$1 {
|
|
|
206
218
|
'trade/cancel-tpsl': 1,
|
|
207
219
|
'trade/close-position': 1,
|
|
208
220
|
'asset/transfer': 1,
|
|
221
|
+
'copytrading/account/set-position-mode': 1,
|
|
222
|
+
'copytrading/account/set-leverage': 1,
|
|
223
|
+
'copytrading/trade/place-order': 1,
|
|
224
|
+
'copytrading/trade/cancel-order': 1,
|
|
225
|
+
'copytrading/trade/place-tpsl-by-contract': 1,
|
|
226
|
+
'copytrading/trade/cancel-tpsl-by-contract': 1,
|
|
227
|
+
'copytrading/trade/place-tpsl-by-order': 1,
|
|
228
|
+
'copytrading/trade/cancel-tpsl-by-order': 1,
|
|
229
|
+
'copytrading/trade/close-position-by-order': 1,
|
|
230
|
+
'copytrading/trade/close-position-by-contract': 1,
|
|
209
231
|
},
|
|
210
232
|
},
|
|
211
233
|
},
|
package/dist/cjs/src/bybit.js
CHANGED
|
@@ -1098,7 +1098,7 @@ class bybit extends bybit$1 {
|
|
|
1098
1098
|
'mark': true,
|
|
1099
1099
|
'index': true,
|
|
1100
1100
|
},
|
|
1101
|
-
'
|
|
1101
|
+
'price': true,
|
|
1102
1102
|
},
|
|
1103
1103
|
'timeInForce': {
|
|
1104
1104
|
'IOC': true,
|
|
@@ -1138,7 +1138,7 @@ class bybit extends bybit$1 {
|
|
|
1138
1138
|
'fetchClosedOrders': {
|
|
1139
1139
|
'marginMode': false,
|
|
1140
1140
|
'limit': 50,
|
|
1141
|
-
'
|
|
1141
|
+
'daysBack': 365 * 2,
|
|
1142
1142
|
'daysBackCanceled': 1,
|
|
1143
1143
|
'untilDays': 7,
|
|
1144
1144
|
'trigger': true,
|
|
@@ -1155,7 +1155,7 @@ class bybit extends bybit$1 {
|
|
|
1155
1155
|
'triggerDirection': false,
|
|
1156
1156
|
'attachedStopLossTakeProfit': {
|
|
1157
1157
|
'triggerPriceType': undefined,
|
|
1158
|
-
'
|
|
1158
|
+
'price': true,
|
|
1159
1159
|
},
|
|
1160
1160
|
'marketBuyRequiresPrice': true,
|
|
1161
1161
|
},
|
|
@@ -1242,7 +1242,7 @@ class bybit extends bybit$1 {
|
|
|
1242
1242
|
* @returns {any} [enableUnifiedMargin, enableUnifiedAccount]
|
|
1243
1243
|
*/
|
|
1244
1244
|
async isUnifiedEnabled(params = {}) {
|
|
1245
|
-
// The API key of user id must own one of permissions will be allowed to call following API endpoints
|
|
1245
|
+
// The API key of user id must own one of permissions will be allowed to call following API endpoints:
|
|
1246
1246
|
// SUB UID: "Account Transfer"
|
|
1247
1247
|
// MASTER UID: "Account Transfer", "Subaccount Transfer", "Withdrawal"
|
|
1248
1248
|
const enableUnifiedMargin = this.safeBool(this.options, 'enableUnifiedMargin');
|
package/dist/cjs/src/coinbase.js
CHANGED
|
@@ -428,7 +428,7 @@ class coinbase extends coinbase$1 {
|
|
|
428
428
|
'fetchClosedOrders': {
|
|
429
429
|
'marginMode': false,
|
|
430
430
|
'limit': undefined,
|
|
431
|
-
'
|
|
431
|
+
'daysBack': undefined,
|
|
432
432
|
'daysBackCanceled': undefined,
|
|
433
433
|
'untilDays': 10000,
|
|
434
434
|
'trigger': false,
|
package/dist/cjs/src/coinex.js
CHANGED
package/dist/cjs/src/exmo.js
CHANGED
|
@@ -865,39 +865,49 @@ class exmo extends exmo$1 {
|
|
|
865
865
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
866
866
|
* @param {int} [limit] the maximum amount of candles to fetch
|
|
867
867
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
868
|
+
* @param {int} [params.until] timestamp in ms of the latest candle to fetch
|
|
868
869
|
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
869
870
|
*/
|
|
870
871
|
async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
|
|
871
872
|
await this.loadMarkets();
|
|
872
873
|
const market = this.market(symbol);
|
|
874
|
+
const until = this.safeIntegerProduct(params, 'until', 0.001);
|
|
875
|
+
const untilIsDefined = (until !== undefined);
|
|
873
876
|
const request = {
|
|
874
877
|
'symbol': market['id'],
|
|
875
878
|
'resolution': this.safeString(this.timeframes, timeframe, timeframe),
|
|
876
879
|
};
|
|
877
880
|
const maxLimit = 3000;
|
|
878
881
|
const duration = this.parseTimeframe(timeframe);
|
|
879
|
-
const now = this.milliseconds();
|
|
882
|
+
const now = this.parseToInt(this.milliseconds() / 1000);
|
|
880
883
|
if (since === undefined) {
|
|
884
|
+
const to = untilIsDefined ? Math.min(until, now) : now;
|
|
881
885
|
if (limit === undefined) {
|
|
882
886
|
limit = 1000; // cap default at generous amount
|
|
883
887
|
}
|
|
884
888
|
else {
|
|
885
889
|
limit = Math.min(limit, maxLimit);
|
|
886
890
|
}
|
|
887
|
-
request['from'] =
|
|
888
|
-
request['to'] =
|
|
891
|
+
request['from'] = to - (limit * duration) - 1;
|
|
892
|
+
request['to'] = to;
|
|
889
893
|
}
|
|
890
894
|
else {
|
|
891
895
|
request['from'] = this.parseToInt(since / 1000) - 1;
|
|
892
|
-
if (
|
|
893
|
-
|
|
896
|
+
if (untilIsDefined) {
|
|
897
|
+
request['to'] = Math.min(until, now);
|
|
894
898
|
}
|
|
895
899
|
else {
|
|
896
|
-
|
|
900
|
+
if (limit === undefined) {
|
|
901
|
+
limit = maxLimit;
|
|
902
|
+
}
|
|
903
|
+
else {
|
|
904
|
+
limit = Math.min(limit, maxLimit);
|
|
905
|
+
}
|
|
906
|
+
const to = this.sum(since, limit * duration);
|
|
907
|
+
request['to'] = Math.min(to, now);
|
|
897
908
|
}
|
|
898
|
-
const to = this.sum(since, limit * duration * 1000);
|
|
899
|
-
request['to'] = this.parseToInt(to / 1000);
|
|
900
909
|
}
|
|
910
|
+
params = this.omit(params, 'until');
|
|
901
911
|
const response = await this.publicGetCandlesHistory(this.extend(request, params));
|
|
902
912
|
//
|
|
903
913
|
// {
|