ccxt 4.4.44 → 4.4.46
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/ascendex.js +20 -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 +105 -42
- 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 +85 -41
- 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/delta.js +10 -4
- package/dist/cjs/src/exmo.js +18 -8
- package/dist/cjs/src/gate.js +1 -2
- package/dist/cjs/src/hashkey.js +7 -1
- package/dist/cjs/src/htx.js +2 -2
- package/dist/cjs/src/hyperliquid.js +3 -4
- 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 +3 -2
- package/dist/cjs/src/myokx.js +8 -0
- package/dist/cjs/src/okx.js +4 -4
- package/dist/cjs/src/onetrading.js +24 -5
- package/dist/cjs/src/pro/binance.js +2 -1
- package/dist/cjs/src/pro/coinex.js +1 -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/ascendex.d.ts +1 -0
- package/js/src/ascendex.js +20 -1
- 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 +105 -42
- 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 +85 -41
- package/js/src/coinbase.js +1 -1
- package/js/src/coinex.js +1 -1
- package/js/src/cryptocom.js +1 -1
- package/js/src/delta.d.ts +2 -1
- package/js/src/delta.js +10 -4
- package/js/src/exmo.d.ts +1 -0
- package/js/src/exmo.js +18 -8
- package/js/src/gate.js +1 -2
- package/js/src/hashkey.js +7 -1
- package/js/src/htx.js +2 -2
- package/js/src/hyperliquid.js +3 -4
- 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 +3 -2
- package/js/src/myokx.js +8 -0
- package/js/src/okx.js +4 -4
- package/js/src/onetrading.d.ts +2 -1
- package/js/src/onetrading.js +24 -5
- package/js/src/pro/binance.js +2 -1
- package/js/src/pro/coinex.js +1 -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/js/src/binance.js
CHANGED
|
@@ -1622,7 +1622,7 @@ export default class binance extends Exchange {
|
|
|
1622
1622
|
'fetchClosedOrders': {
|
|
1623
1623
|
'marginMode': true,
|
|
1624
1624
|
'limit': 1000,
|
|
1625
|
-
'
|
|
1625
|
+
'daysBack': undefined,
|
|
1626
1626
|
'daysBackCanceled': undefined,
|
|
1627
1627
|
'untilDays': 10000,
|
|
1628
1628
|
'trigger': false,
|
|
@@ -1692,7 +1692,7 @@ export default class binance extends Exchange {
|
|
|
1692
1692
|
'fetchClosedOrders': {
|
|
1693
1693
|
'marginMode': true,
|
|
1694
1694
|
'limit': 1000,
|
|
1695
|
-
'
|
|
1695
|
+
'daysBack': 90,
|
|
1696
1696
|
'daysBackCanceled': 3,
|
|
1697
1697
|
'untilDays': 7,
|
|
1698
1698
|
'trigger': false,
|
|
@@ -2415,22 +2415,72 @@ export default class binance extends Exchange {
|
|
|
2415
2415
|
'portfolioMargin': {
|
|
2416
2416
|
'exact': {
|
|
2417
2417
|
//
|
|
2418
|
-
//
|
|
2418
|
+
// 10xx General Server or Network Issues
|
|
2419
2419
|
//
|
|
2420
|
+
'-1000': OperationFailed,
|
|
2421
|
+
'-1001': ExchangeError,
|
|
2422
|
+
'-1002': PermissionDenied,
|
|
2423
|
+
'-1003': RateLimitExceeded,
|
|
2424
|
+
'-1004': BadRequest,
|
|
2420
2425
|
'-1005': PermissionDenied,
|
|
2426
|
+
'-1006': BadResponse,
|
|
2427
|
+
'-1007': BadResponse,
|
|
2428
|
+
'-1008': OperationFailed,
|
|
2429
|
+
'-1010': ExchangeError,
|
|
2421
2430
|
'-1011': PermissionDenied,
|
|
2431
|
+
'-1013': ExchangeError,
|
|
2432
|
+
'-1014': InvalidOrder,
|
|
2433
|
+
'-1015': InvalidOrder,
|
|
2434
|
+
'-1016': NotSupported,
|
|
2435
|
+
'-1020': NotSupported,
|
|
2436
|
+
'-1021': BadRequest,
|
|
2437
|
+
'-1022': BadRequest,
|
|
2422
2438
|
'-1023': BadRequest,
|
|
2439
|
+
'-1099': OperationFailed,
|
|
2440
|
+
//
|
|
2441
|
+
// 11xx Request Issues
|
|
2442
|
+
//
|
|
2443
|
+
'-1100': BadRequest,
|
|
2444
|
+
'-1101': BadRequest,
|
|
2445
|
+
'-1102': BadRequest,
|
|
2446
|
+
'-1103': BadRequest,
|
|
2447
|
+
'-1104': BadRequest,
|
|
2448
|
+
'-1105': BadRequest,
|
|
2449
|
+
'-1106': BadRequest,
|
|
2450
|
+
'-1108': BadRequest,
|
|
2423
2451
|
'-1109': BadRequest,
|
|
2424
2452
|
'-1110': BadSymbol,
|
|
2453
|
+
'-1111': BadRequest,
|
|
2454
|
+
'-1112': BadRequest,
|
|
2425
2455
|
'-1113': BadRequest,
|
|
2456
|
+
'-1114': BadRequest,
|
|
2457
|
+
'-1115': BadRequest,
|
|
2458
|
+
'-1116': BadRequest,
|
|
2459
|
+
'-1117': BadRequest,
|
|
2460
|
+
'-1118': BadRequest,
|
|
2461
|
+
'-1119': BadRequest,
|
|
2462
|
+
'-1120': BadRequest,
|
|
2463
|
+
'-1121': BadSymbol,
|
|
2464
|
+
'-1125': BadRequest,
|
|
2465
|
+
'-1127': BadRequest,
|
|
2426
2466
|
'-1128': BadRequest,
|
|
2467
|
+
'-1130': BadRequest,
|
|
2468
|
+
'-1131': BadRequest,
|
|
2469
|
+
'-1134': BadRequest,
|
|
2427
2470
|
'-1136': BadRequest,
|
|
2471
|
+
'-1145': BadRequest,
|
|
2472
|
+
'-1151': BadRequest,
|
|
2428
2473
|
//
|
|
2429
|
-
//
|
|
2474
|
+
// 20xx Processing Issues
|
|
2430
2475
|
//
|
|
2431
|
-
'-
|
|
2432
|
-
'-
|
|
2433
|
-
'-
|
|
2476
|
+
'-2010': InvalidOrder,
|
|
2477
|
+
'-2011': OperationRejected,
|
|
2478
|
+
'-2013': OrderNotFound,
|
|
2479
|
+
'-2014': OperationRejected,
|
|
2480
|
+
'-2015': OperationRejected,
|
|
2481
|
+
'-2016': OperationFailed,
|
|
2482
|
+
'-2018': OperationFailed,
|
|
2483
|
+
'-2019': OperationFailed,
|
|
2434
2484
|
'-2020': OrderNotFillable,
|
|
2435
2485
|
'-2021': OrderImmediatelyFillable,
|
|
2436
2486
|
'-2022': InvalidOrder,
|
|
@@ -2441,12 +2491,67 @@ export default class binance extends Exchange {
|
|
|
2441
2491
|
'-2027': OperationRejected,
|
|
2442
2492
|
'-2028': OperationRejected,
|
|
2443
2493
|
//
|
|
2444
|
-
// 4xxx
|
|
2494
|
+
// 4xxx Filters and other issues
|
|
2445
2495
|
//
|
|
2496
|
+
'-4000': BadRequest,
|
|
2497
|
+
'-4001': BadRequest,
|
|
2498
|
+
'-4002': BadRequest,
|
|
2499
|
+
'-4003': BadRequest,
|
|
2500
|
+
'-4004': BadRequest,
|
|
2501
|
+
'-4005': BadRequest,
|
|
2502
|
+
'-4006': BadRequest,
|
|
2503
|
+
'-4007': BadRequest,
|
|
2504
|
+
'-4008': BadRequest,
|
|
2505
|
+
'-4009': BadRequest,
|
|
2506
|
+
'-4010': BadRequest,
|
|
2507
|
+
'-4011': BadRequest,
|
|
2508
|
+
'-4012': BadRequest,
|
|
2509
|
+
'-4013': BadRequest,
|
|
2510
|
+
'-4014': BadRequest,
|
|
2511
|
+
'-4015': BadRequest,
|
|
2512
|
+
'-4016': BadRequest,
|
|
2513
|
+
'-4017': BadRequest,
|
|
2514
|
+
'-4018': BadRequest,
|
|
2515
|
+
'-4019': BadRequest,
|
|
2516
|
+
'-4020': BadRequest,
|
|
2517
|
+
'-4021': BadRequest,
|
|
2518
|
+
'-4022': BadRequest,
|
|
2519
|
+
'-4023': BadRequest,
|
|
2520
|
+
'-4024': BadRequest,
|
|
2521
|
+
'-4025': BadRequest,
|
|
2522
|
+
'-4026': BadRequest,
|
|
2523
|
+
'-4027': BadRequest,
|
|
2524
|
+
'-4028': BadRequest,
|
|
2525
|
+
'-4029': BadRequest,
|
|
2526
|
+
'-4030': BadRequest,
|
|
2527
|
+
'-4031': BadRequest,
|
|
2528
|
+
'-4032': BadRequest,
|
|
2529
|
+
'-4033': BadRequest,
|
|
2530
|
+
'-4044': BadRequest,
|
|
2531
|
+
'-4045': BadRequest,
|
|
2532
|
+
'-4046': BadRequest,
|
|
2533
|
+
'-4047': BadRequest,
|
|
2534
|
+
'-4048': BadRequest,
|
|
2535
|
+
'-4049': BadRequest,
|
|
2536
|
+
'-4050': BadRequest,
|
|
2537
|
+
'-4051': BadRequest,
|
|
2538
|
+
'-4052': BadRequest,
|
|
2539
|
+
'-4053': BadRequest,
|
|
2540
|
+
'-4054': BadRequest,
|
|
2541
|
+
'-4055': BadRequest,
|
|
2542
|
+
'-4056': PermissionDenied,
|
|
2543
|
+
'-4057': PermissionDenied,
|
|
2544
|
+
'-4058': BadRequest,
|
|
2545
|
+
'-4059': BadRequest,
|
|
2546
|
+
'-4060': BadRequest,
|
|
2547
|
+
'-4061': InvalidOrder,
|
|
2548
|
+
'-4062': BadRequest,
|
|
2446
2549
|
'-4063': BadRequest,
|
|
2447
2550
|
'-4064': BadRequest,
|
|
2448
2551
|
'-4065': BadRequest,
|
|
2449
2552
|
'-4066': BadRequest,
|
|
2553
|
+
'-4067': BadRequest,
|
|
2554
|
+
'-4068': BadRequest,
|
|
2450
2555
|
'-4069': BadRequest,
|
|
2451
2556
|
'-4070': BadRequest,
|
|
2452
2557
|
'-4071': BadRequest,
|
|
@@ -2460,47 +2565,39 @@ export default class binance extends Exchange {
|
|
|
2460
2565
|
'-4079': BadRequest,
|
|
2461
2566
|
'-4080': PermissionDenied,
|
|
2462
2567
|
'-4081': BadRequest,
|
|
2568
|
+
'-4082': BadRequest,
|
|
2569
|
+
'-4083': BadRequest,
|
|
2570
|
+
'-4084': NotSupported,
|
|
2463
2571
|
'-4085': BadRequest,
|
|
2464
2572
|
'-4086': BadRequest,
|
|
2465
2573
|
'-4087': PermissionDenied,
|
|
2466
2574
|
'-4088': PermissionDenied,
|
|
2575
|
+
'-4104': BadRequest,
|
|
2467
2576
|
'-4114': BadRequest,
|
|
2468
2577
|
'-4115': BadRequest,
|
|
2469
2578
|
'-4118': OperationRejected,
|
|
2470
2579
|
'-4131': OperationRejected,
|
|
2471
|
-
'-
|
|
2580
|
+
'-4135': BadRequest,
|
|
2581
|
+
'-4137': BadRequest,
|
|
2582
|
+
'-4138': BadRequest,
|
|
2583
|
+
'-4139': BadRequest,
|
|
2584
|
+
'-4140': OrderImmediatelyFillable,
|
|
2472
2585
|
'-4141': BadRequest,
|
|
2586
|
+
'-4142': OrderImmediatelyFillable,
|
|
2473
2587
|
'-4144': BadSymbol,
|
|
2474
2588
|
'-4161': OperationRejected,
|
|
2475
|
-
'-4164':
|
|
2589
|
+
'-4164': InvalidOrder,
|
|
2476
2590
|
'-4165': BadRequest,
|
|
2477
|
-
'-4183':
|
|
2478
|
-
'-4184':
|
|
2591
|
+
'-4183': InvalidOrder,
|
|
2592
|
+
'-4184': InvalidOrder,
|
|
2593
|
+
'-4408': InvalidOrder,
|
|
2479
2594
|
//
|
|
2480
|
-
// 5xxx
|
|
2595
|
+
// 5xxx Order Execution Issues
|
|
2481
2596
|
//
|
|
2482
2597
|
'-5021': OrderNotFillable,
|
|
2483
2598
|
'-5022': OrderNotFillable,
|
|
2484
|
-
|
|
2485
|
-
//
|
|
2486
|
-
//
|
|
2487
|
-
'-20121': ExchangeError,
|
|
2488
|
-
'-20124': ExchangeError,
|
|
2489
|
-
'-20130': ExchangeError,
|
|
2490
|
-
'-20132': ExchangeError,
|
|
2491
|
-
'-20194': ExchangeError,
|
|
2492
|
-
'-20195': ExchangeError,
|
|
2493
|
-
'-20196': ExchangeError,
|
|
2494
|
-
'-20198': ExchangeError,
|
|
2495
|
-
'-20204': ExchangeError,
|
|
2496
|
-
// 21xxx - PORTFOLIO MARGIN (documented in spot docs)
|
|
2497
|
-
'-21001': BadRequest,
|
|
2498
|
-
'-21002': BadRequest,
|
|
2499
|
-
'-21003': BadResponse,
|
|
2500
|
-
'-21004': OperationRejected,
|
|
2501
|
-
'-21005': InsufficientFunds,
|
|
2502
|
-
'-21006': OperationFailed,
|
|
2503
|
-
'-21007': OperationFailed, // User failed to repay portfolio margin bankruptcy loan since liquidation was in process
|
|
2599
|
+
'-5028': OperationFailed,
|
|
2600
|
+
'-5041': RateLimitExceeded, // Time out for too many requests from this account queueing at the same time.
|
|
2504
2601
|
},
|
|
2505
2602
|
},
|
|
2506
2603
|
'exact': {
|
|
@@ -3604,7 +3701,11 @@ export default class binance extends Exchange {
|
|
|
3604
3701
|
account['total'] = this.safeString(entry, 'crossMarginAsset');
|
|
3605
3702
|
}
|
|
3606
3703
|
else {
|
|
3607
|
-
|
|
3704
|
+
const usedLinear = this.safeString(entry, 'umUnrealizedPNL');
|
|
3705
|
+
const usedInverse = this.safeString(entry, 'cmUnrealizedPNL');
|
|
3706
|
+
const totalUsed = Precise.stringAdd(usedLinear, usedInverse);
|
|
3707
|
+
const totalWalletBalance = this.safeString(entry, 'totalWalletBalance');
|
|
3708
|
+
account['total'] = Precise.stringAdd(totalUsed, totalWalletBalance);
|
|
3608
3709
|
}
|
|
3609
3710
|
result[code] = account;
|
|
3610
3711
|
}
|
|
@@ -5358,10 +5459,10 @@ export default class binance extends Exchange {
|
|
|
5358
5459
|
const request = {
|
|
5359
5460
|
'symbol': market['id'],
|
|
5360
5461
|
'side': side.toUpperCase(),
|
|
5462
|
+
'orderId': id,
|
|
5463
|
+
'quantity': this.amountToPrecision(symbol, amount),
|
|
5361
5464
|
};
|
|
5362
5465
|
const clientOrderId = this.safeStringN(params, ['newClientOrderId', 'clientOrderId', 'origClientOrderId']);
|
|
5363
|
-
request['orderId'] = id;
|
|
5364
|
-
request['quantity'] = this.amountToPrecision(symbol, amount);
|
|
5365
5466
|
if (price !== undefined) {
|
|
5366
5467
|
request['price'] = this.priceToPrecision(symbol, price);
|
|
5367
5468
|
}
|
|
@@ -5377,6 +5478,8 @@ export default class binance extends Exchange {
|
|
|
5377
5478
|
* @description edit a trade order
|
|
5378
5479
|
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order
|
|
5379
5480
|
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Order
|
|
5481
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Modify-UM-Order
|
|
5482
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Modify-CM-Order
|
|
5380
5483
|
* @param {string} id cancel order id
|
|
5381
5484
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
5382
5485
|
* @param {string} type 'market' or 'limit'
|
|
@@ -5384,18 +5487,36 @@ export default class binance extends Exchange {
|
|
|
5384
5487
|
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
5385
5488
|
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
5386
5489
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5490
|
+
* @param {boolean} [params.portfolioMargin] set to true if you would like to edit an order in a portfolio margin account
|
|
5387
5491
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5388
5492
|
*/
|
|
5389
5493
|
async editContractOrder(id, symbol, type, side, amount, price = undefined, params = {}) {
|
|
5390
5494
|
await this.loadMarkets();
|
|
5391
5495
|
const market = this.market(symbol);
|
|
5496
|
+
let isPortfolioMargin = undefined;
|
|
5497
|
+
[isPortfolioMargin, params] = this.handleOptionAndParams2(params, 'editContractOrder', 'papi', 'portfolioMargin', false);
|
|
5498
|
+
if (market['linear'] || isPortfolioMargin) {
|
|
5499
|
+
if (price === undefined) {
|
|
5500
|
+
throw new ArgumentsRequired(this.id + ' editOrder() requires a price argument for portfolio margin and linear orders');
|
|
5501
|
+
}
|
|
5502
|
+
}
|
|
5392
5503
|
const request = this.editContractOrderRequest(id, symbol, type, side, amount, price, params);
|
|
5393
5504
|
let response = undefined;
|
|
5394
5505
|
if (market['linear']) {
|
|
5395
|
-
|
|
5506
|
+
if (isPortfolioMargin) {
|
|
5507
|
+
response = await this.papiPutUmOrder(this.extend(request, params));
|
|
5508
|
+
}
|
|
5509
|
+
else {
|
|
5510
|
+
response = await this.fapiPrivatePutOrder(this.extend(request, params));
|
|
5511
|
+
}
|
|
5396
5512
|
}
|
|
5397
5513
|
else if (market['inverse']) {
|
|
5398
|
-
|
|
5514
|
+
if (isPortfolioMargin) {
|
|
5515
|
+
response = await this.papiPutCmOrder(this.extend(request, params));
|
|
5516
|
+
}
|
|
5517
|
+
else {
|
|
5518
|
+
response = await this.dapiPrivatePutOrder(this.extend(request, params));
|
|
5519
|
+
}
|
|
5399
5520
|
}
|
|
5400
5521
|
//
|
|
5401
5522
|
// swap and future
|
|
@@ -5440,6 +5561,7 @@ export default class binance extends Exchange {
|
|
|
5440
5561
|
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
5441
5562
|
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
5442
5563
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5564
|
+
* @param {boolean} [params.portfolioMargin] set to true if you would like to edit an order in a portfolio margin account
|
|
5443
5565
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5444
5566
|
*/
|
|
5445
5567
|
async editOrder(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
|
|
@@ -11952,7 +12074,7 @@ export default class binance extends Exchange {
|
|
|
11952
12074
|
marketType = 'option';
|
|
11953
12075
|
}
|
|
11954
12076
|
else if (url.startsWith('https://papi.' + hostname + '/')) {
|
|
11955
|
-
marketType = '
|
|
12077
|
+
marketType = 'portfolioMargin';
|
|
11956
12078
|
}
|
|
11957
12079
|
if (marketType !== undefined) {
|
|
11958
12080
|
const exceptionsForMarketType = this.safeDict(this.exceptions, marketType, {});
|
package/js/src/bingx.js
CHANGED
|
@@ -553,7 +553,7 @@ export default class bingx extends Exchange {
|
|
|
553
553
|
'mark': true,
|
|
554
554
|
'index': true,
|
|
555
555
|
},
|
|
556
|
-
'
|
|
556
|
+
'price': true,
|
|
557
557
|
},
|
|
558
558
|
'timeInForce': {
|
|
559
559
|
'IOC': true,
|
|
@@ -600,7 +600,7 @@ export default class bingx extends Exchange {
|
|
|
600
600
|
'fetchClosedOrders': {
|
|
601
601
|
'marginMode': false,
|
|
602
602
|
'limit': 1000,
|
|
603
|
-
'
|
|
603
|
+
'daysBack': undefined,
|
|
604
604
|
'daysBackCanceled': undefined,
|
|
605
605
|
'untilDays': 7,
|
|
606
606
|
'trigger': false,
|
|
@@ -624,7 +624,7 @@ export default class bingx extends Exchange {
|
|
|
624
624
|
'fetchClosedOrders': {
|
|
625
625
|
'marginMode': false,
|
|
626
626
|
'limit': 1000,
|
|
627
|
-
'
|
|
627
|
+
'daysBack': undefined,
|
|
628
628
|
'daysBackCanceled': undefined,
|
|
629
629
|
'untilDays': 7,
|
|
630
630
|
'trigger': false,
|
|
@@ -2740,8 +2740,10 @@ export default class bingx extends Exchange {
|
|
|
2740
2740
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2741
2741
|
*/
|
|
2742
2742
|
async createMarketOrderWithCost(symbol, side, cost, params = {}) {
|
|
2743
|
-
|
|
2744
|
-
|
|
2743
|
+
const req = {
|
|
2744
|
+
'quoteOrderQty': cost,
|
|
2745
|
+
};
|
|
2746
|
+
return await this.createOrder(symbol, 'market', side, cost, undefined, this.extend(req, params));
|
|
2745
2747
|
}
|
|
2746
2748
|
/**
|
|
2747
2749
|
* @method
|
|
@@ -2753,8 +2755,10 @@ export default class bingx extends Exchange {
|
|
|
2753
2755
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2754
2756
|
*/
|
|
2755
2757
|
async createMarketBuyOrderWithCost(symbol, cost, params = {}) {
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
+
const req = {
|
|
2759
|
+
'quoteOrderQty': cost,
|
|
2760
|
+
};
|
|
2761
|
+
return await this.createOrder(symbol, 'market', 'buy', cost, undefined, this.extend(req, params));
|
|
2758
2762
|
}
|
|
2759
2763
|
/**
|
|
2760
2764
|
* @method
|
|
@@ -2766,8 +2770,10 @@ export default class bingx extends Exchange {
|
|
|
2766
2770
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2767
2771
|
*/
|
|
2768
2772
|
async createMarketSellOrderWithCost(symbol, cost, params = {}) {
|
|
2769
|
-
|
|
2770
|
-
|
|
2773
|
+
const req = {
|
|
2774
|
+
'quoteOrderQty': cost,
|
|
2775
|
+
};
|
|
2776
|
+
return await this.createOrder(symbol, 'market', 'sell', cost, undefined, this.extend(req, params));
|
|
2771
2777
|
}
|
|
2772
2778
|
createOrderRequest(symbol, type, side, amount, price = undefined, params = {}) {
|
|
2773
2779
|
/**
|
package/js/src/bitfinex.js
CHANGED
|
@@ -454,7 +454,7 @@ export default class bitfinex extends Exchange {
|
|
|
454
454
|
'fetchClosedOrders': {
|
|
455
455
|
'marginMode': false,
|
|
456
456
|
'limit': undefined,
|
|
457
|
-
'
|
|
457
|
+
'daysBack': undefined,
|
|
458
458
|
'daysBackCanceled': undefined,
|
|
459
459
|
'untilDays': 100000,
|
|
460
460
|
'trigger': false,
|
package/js/src/bitget.js
CHANGED
|
@@ -1426,16 +1426,102 @@ export default class bitget extends Exchange {
|
|
|
1426
1426
|
},
|
|
1427
1427
|
'sandboxMode': false,
|
|
1428
1428
|
'networks': {
|
|
1429
|
+
// 'TRX': 'TRX', // different code for mainnet
|
|
1429
1430
|
'TRC20': 'TRC20',
|
|
1431
|
+
// 'ETH': 'ETH', // different code for mainnet
|
|
1430
1432
|
'ERC20': 'ERC20',
|
|
1431
1433
|
'BEP20': 'BSC',
|
|
1432
|
-
'
|
|
1433
|
-
'
|
|
1434
|
-
'
|
|
1434
|
+
// 'BEP20': 'BEP20', // different for BEP20
|
|
1435
|
+
'BSC': 'BEP20',
|
|
1436
|
+
'ATOM': 'ATOM',
|
|
1437
|
+
'ACA': 'AcalaToken',
|
|
1435
1438
|
'APT': 'Aptos',
|
|
1439
|
+
'ARBONE': 'ArbitrumOne',
|
|
1440
|
+
'ARBNOVA': 'ArbitrumNova',
|
|
1441
|
+
'AVAXC': 'C-Chain',
|
|
1442
|
+
'AVAXX': 'X-Chain',
|
|
1443
|
+
'AR': 'Arweave',
|
|
1444
|
+
'BCH': 'BCH',
|
|
1445
|
+
'BCHA': 'BCHA',
|
|
1446
|
+
'BITCI': 'BITCI',
|
|
1447
|
+
'BTC': 'BTC',
|
|
1448
|
+
'CELO': 'CELO',
|
|
1449
|
+
'CSPR': 'CSPR',
|
|
1450
|
+
'ADA': 'Cardano',
|
|
1451
|
+
'CHZ': 'ChilizChain',
|
|
1452
|
+
'CRC20': 'CronosChain',
|
|
1453
|
+
'DOGE': 'DOGE',
|
|
1454
|
+
'DOT': 'DOT',
|
|
1455
|
+
'EOS': 'EOS',
|
|
1456
|
+
'ETHF': 'ETHFAIR',
|
|
1457
|
+
'ETHW': 'ETHW',
|
|
1458
|
+
'ETC': 'ETC',
|
|
1459
|
+
'EGLD': 'Elrond',
|
|
1460
|
+
'FIL': 'FIL',
|
|
1461
|
+
'FIO': 'FIO',
|
|
1462
|
+
'FTM': 'Fantom',
|
|
1463
|
+
'HRC20': 'HECO',
|
|
1464
|
+
'ONE': 'Harmony',
|
|
1465
|
+
'HNT': 'Helium',
|
|
1466
|
+
'ICP': 'ICP',
|
|
1467
|
+
'IOTX': 'IoTeX',
|
|
1468
|
+
'KARDIA': 'KAI',
|
|
1469
|
+
'KAVA': 'KAVA',
|
|
1470
|
+
'KDA': 'KDA',
|
|
1471
|
+
'KLAY': 'Klaytn',
|
|
1472
|
+
'KSM': 'Kusama',
|
|
1473
|
+
'LAT': 'LAT',
|
|
1474
|
+
'LTC': 'LTC',
|
|
1475
|
+
'MINA': 'MINA',
|
|
1476
|
+
'MOVR': 'MOVR',
|
|
1477
|
+
'METIS': 'MetisToken',
|
|
1478
|
+
'GLMR': 'Moonbeam',
|
|
1479
|
+
'NEAR': 'NEARProtocol',
|
|
1480
|
+
'NULS': 'NULS',
|
|
1481
|
+
'OASYS': 'OASYS',
|
|
1482
|
+
'OASIS': 'ROSE',
|
|
1483
|
+
'OMNI': 'OMNI',
|
|
1484
|
+
'ONT': 'Ontology',
|
|
1485
|
+
'OPTIMISM': 'Optimism',
|
|
1486
|
+
'OSMO': 'Osmosis',
|
|
1487
|
+
'POKT': 'PocketNetwork',
|
|
1436
1488
|
'MATIC': 'Polygon',
|
|
1489
|
+
'QTUM': 'QTUM',
|
|
1490
|
+
'REEF': 'REEF',
|
|
1491
|
+
'SOL': 'SOL',
|
|
1492
|
+
'SYS': 'SYS',
|
|
1493
|
+
'SXP': 'Solar',
|
|
1494
|
+
'XYM': 'Symbol',
|
|
1495
|
+
'TON': 'TON',
|
|
1496
|
+
'TT': 'TT',
|
|
1497
|
+
'TLOS': 'Telos',
|
|
1498
|
+
'THETA': 'ThetaToken',
|
|
1499
|
+
'VITE': 'VITE',
|
|
1500
|
+
'WAVES': 'WAVES',
|
|
1501
|
+
'WAX': 'WAXP',
|
|
1502
|
+
'WEMIX': 'WEMIXMainnet',
|
|
1503
|
+
'XDC': 'XDCNetworkXDC',
|
|
1504
|
+
'XRP': 'XRP',
|
|
1505
|
+
'FET': 'FETCH',
|
|
1506
|
+
'NEM': 'NEM',
|
|
1507
|
+
'REI': 'REINetwork',
|
|
1508
|
+
'ZIL': 'ZIL',
|
|
1509
|
+
'ABBC': 'ABBCCoin',
|
|
1510
|
+
'RSK': 'RSK',
|
|
1511
|
+
'AZERO': 'AZERO',
|
|
1512
|
+
'TRC10': 'TRC10',
|
|
1513
|
+
'JUNO': 'JUNO',
|
|
1514
|
+
// undetected: USDSP, more info at https://www.bitget.com/v1/spot/public/coinChainList
|
|
1515
|
+
// todo: uncomment below after unification
|
|
1516
|
+
// 'TERRACLASSIC': 'Terra', // tbd, that network id is also assigned to TERRANEW network
|
|
1517
|
+
// 'CUBENETWORK': 'CUBE',
|
|
1518
|
+
// 'CADUCEUS': 'CMP',
|
|
1519
|
+
// 'CONFLUX': 'CFX', // CFXeSpace is different
|
|
1520
|
+
// 'CERE': 'CERE',
|
|
1521
|
+
// 'CANTO': 'CANTO',
|
|
1522
|
+
'ZKSYNC': 'zkSyncEra',
|
|
1523
|
+
'STARKNET': 'Starknet',
|
|
1437
1524
|
'VIC': 'VICTION',
|
|
1438
|
-
'AVAXC': 'C-Chain',
|
|
1439
1525
|
},
|
|
1440
1526
|
'networksById': {},
|
|
1441
1527
|
'fetchPositions': {
|
|
@@ -1463,7 +1549,7 @@ export default class bitget extends Exchange {
|
|
|
1463
1549
|
'mark': false,
|
|
1464
1550
|
'index': false,
|
|
1465
1551
|
},
|
|
1466
|
-
'
|
|
1552
|
+
'price': true,
|
|
1467
1553
|
},
|
|
1468
1554
|
'timeInForce': {
|
|
1469
1555
|
'IOC': true,
|
|
@@ -1505,7 +1591,7 @@ export default class bitget extends Exchange {
|
|
|
1505
1591
|
'fetchClosedOrders': {
|
|
1506
1592
|
'marginMode': true,
|
|
1507
1593
|
'limit': 100,
|
|
1508
|
-
'
|
|
1594
|
+
'daysBack': undefined,
|
|
1509
1595
|
'daysBackCanceled': undefined,
|
|
1510
1596
|
'untilDays': 90,
|
|
1511
1597
|
'trigger': true,
|
|
@@ -1533,7 +1619,7 @@ export default class bitget extends Exchange {
|
|
|
1533
1619
|
'mark': true,
|
|
1534
1620
|
'index': true,
|
|
1535
1621
|
},
|
|
1536
|
-
'
|
|
1622
|
+
'price': false,
|
|
1537
1623
|
},
|
|
1538
1624
|
'timeInForce': {
|
|
1539
1625
|
'IOC': true,
|
|
@@ -2341,14 +2427,14 @@ export default class bitget extends Exchange {
|
|
|
2341
2427
|
*/
|
|
2342
2428
|
async withdraw(code, amount, address, tag = undefined, params = {}) {
|
|
2343
2429
|
this.checkAddress(address);
|
|
2344
|
-
|
|
2345
|
-
params = this.
|
|
2346
|
-
if (
|
|
2347
|
-
throw new ArgumentsRequired(this.id + ' withdraw() requires a
|
|
2430
|
+
let networkCode = undefined;
|
|
2431
|
+
[networkCode, params] = this.handleNetworkCodeAndParams(params);
|
|
2432
|
+
if (networkCode === undefined) {
|
|
2433
|
+
throw new ArgumentsRequired(this.id + ' withdraw() requires a "network" parameter');
|
|
2348
2434
|
}
|
|
2349
2435
|
await this.loadMarkets();
|
|
2350
2436
|
const currency = this.currency(code);
|
|
2351
|
-
const networkId = this.networkCodeToId(
|
|
2437
|
+
const networkId = this.networkCodeToId(networkCode);
|
|
2352
2438
|
const request = {
|
|
2353
2439
|
'coin': currency['id'],
|
|
2354
2440
|
'address': address,
|
|
@@ -2372,27 +2458,8 @@ export default class bitget extends Exchange {
|
|
|
2372
2458
|
// }
|
|
2373
2459
|
//
|
|
2374
2460
|
const data = this.safeValue(response, 'data', {});
|
|
2375
|
-
const result =
|
|
2376
|
-
|
|
2377
|
-
'info': response,
|
|
2378
|
-
'txid': undefined,
|
|
2379
|
-
'timestamp': undefined,
|
|
2380
|
-
'datetime': undefined,
|
|
2381
|
-
'network': undefined,
|
|
2382
|
-
'addressFrom': undefined,
|
|
2383
|
-
'address': undefined,
|
|
2384
|
-
'addressTo': undefined,
|
|
2385
|
-
'amount': undefined,
|
|
2386
|
-
'type': 'withdrawal',
|
|
2387
|
-
'currency': undefined,
|
|
2388
|
-
'status': undefined,
|
|
2389
|
-
'updated': undefined,
|
|
2390
|
-
'tagFrom': undefined,
|
|
2391
|
-
'tag': undefined,
|
|
2392
|
-
'tagTo': undefined,
|
|
2393
|
-
'comment': undefined,
|
|
2394
|
-
'fee': undefined,
|
|
2395
|
-
};
|
|
2461
|
+
const result = this.parseTransaction(data, currency);
|
|
2462
|
+
result['type'] = 'withdrawal';
|
|
2396
2463
|
const withdrawOptions = this.safeValue(this.options, 'withdraw', {});
|
|
2397
2464
|
const fillResponseFromRequest = this.safeBool(withdrawOptions, 'fillResponseFromRequest', true);
|
|
2398
2465
|
if (fillResponseFromRequest) {
|
|
@@ -2403,7 +2470,7 @@ export default class bitget extends Exchange {
|
|
|
2403
2470
|
result['tag'] = tag;
|
|
2404
2471
|
result['address'] = address;
|
|
2405
2472
|
result['addressTo'] = address;
|
|
2406
|
-
result['network'] =
|
|
2473
|
+
result['network'] = networkCode;
|
|
2407
2474
|
}
|
|
2408
2475
|
return result;
|
|
2409
2476
|
}
|
|
@@ -2571,18 +2638,14 @@ export default class bitget extends Exchange {
|
|
|
2571
2638
|
*/
|
|
2572
2639
|
async fetchDepositAddress(code, params = {}) {
|
|
2573
2640
|
await this.loadMarkets();
|
|
2574
|
-
|
|
2575
|
-
params = this.
|
|
2576
|
-
let networkId = undefined;
|
|
2577
|
-
if (networkCode !== undefined) {
|
|
2578
|
-
networkId = this.networkCodeToId(networkCode, code);
|
|
2579
|
-
}
|
|
2641
|
+
let networkCode = undefined;
|
|
2642
|
+
[networkCode, params] = this.handleNetworkCodeAndParams(params);
|
|
2580
2643
|
const currency = this.currency(code);
|
|
2581
2644
|
const request = {
|
|
2582
2645
|
'coin': currency['id'],
|
|
2583
2646
|
};
|
|
2584
|
-
if (
|
|
2585
|
-
request['chain'] =
|
|
2647
|
+
if (networkCode !== undefined) {
|
|
2648
|
+
request['chain'] = this.networkCodeToId(networkCode, code);
|
|
2586
2649
|
}
|
|
2587
2650
|
const response = await this.privateSpotGetV2SpotWalletDepositAddress(this.extend(request, params));
|
|
2588
2651
|
//
|
package/js/src/bitmart.js
CHANGED
|
@@ -740,7 +740,7 @@ export default class bitmart extends Exchange {
|
|
|
740
740
|
'fetchClosedOrders': {
|
|
741
741
|
'marginMode': true,
|
|
742
742
|
'limit': 200,
|
|
743
|
-
'
|
|
743
|
+
'daysBack': undefined,
|
|
744
744
|
'daysBackCanceled': undefined,
|
|
745
745
|
'untilDays': undefined,
|
|
746
746
|
'trigger': false,
|
|
@@ -769,7 +769,7 @@ export default class bitmart extends Exchange {
|
|
|
769
769
|
'mark': true,
|
|
770
770
|
'index': false,
|
|
771
771
|
},
|
|
772
|
-
'
|
|
772
|
+
'price': false,
|
|
773
773
|
},
|
|
774
774
|
'timeInForce': {
|
|
775
775
|
'IOC': true,
|
|
@@ -807,7 +807,7 @@ export default class bitmart extends Exchange {
|
|
|
807
807
|
'fetchClosedOrders': {
|
|
808
808
|
'marginMode': true,
|
|
809
809
|
'limit': 200,
|
|
810
|
-
'
|
|
810
|
+
'daysBack': undefined,
|
|
811
811
|
'daysBackCanceled': undefined,
|
|
812
812
|
'untilDays': undefined,
|
|
813
813
|
'trigger': false,
|
package/js/src/bitmex.js
CHANGED
|
@@ -335,7 +335,7 @@ export default class bitmex extends Exchange {
|
|
|
335
335
|
'fetchClosedOrders': {
|
|
336
336
|
'marginMode': false,
|
|
337
337
|
'limit': 500,
|
|
338
|
-
'
|
|
338
|
+
'daysBack': undefined,
|
|
339
339
|
'daysBackCanceled': undefined,
|
|
340
340
|
'untilDays': 1000000,
|
|
341
341
|
'trigger': false,
|