ccxt 4.3.35 → 4.3.36

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.
Files changed (43) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +1 -1
  4. package/dist/cjs/src/bingx.js +2 -2
  5. package/dist/cjs/src/bit2c.js +2 -1
  6. package/dist/cjs/src/bitget.js +11 -4
  7. package/dist/cjs/src/paymium.js +4 -1
  8. package/dist/cjs/src/pro/binance.js +4 -4
  9. package/dist/cjs/src/pro/bingx.js +10 -4
  10. package/dist/cjs/src/pro/bitfinex2.js +5 -5
  11. package/dist/cjs/src/pro/bitmart.js +9 -5
  12. package/dist/cjs/src/pro/bybit.js +6 -6
  13. package/dist/cjs/src/pro/htx.js +5 -6
  14. package/dist/cjs/src/pro/okx.js +3 -4
  15. package/dist/cjs/src/pro/woo.js +4 -4
  16. package/dist/cjs/src/whitebit.js +24 -3
  17. package/dist/cjs/src/zaif.js +30 -2
  18. package/dist/cjs/src/zonda.js +6 -0
  19. package/js/ccxt.d.ts +1 -1
  20. package/js/ccxt.js +1 -1
  21. package/js/src/abstract/bitbay.d.ts +6 -0
  22. package/js/src/abstract/zonda.d.ts +6 -0
  23. package/js/src/bingx.js +2 -2
  24. package/js/src/bit2c.d.ts +1 -1
  25. package/js/src/bit2c.js +2 -1
  26. package/js/src/bitget.js +11 -4
  27. package/js/src/paymium.d.ts +1 -1
  28. package/js/src/paymium.js +4 -1
  29. package/js/src/pro/binance.js +4 -4
  30. package/js/src/pro/bingx.js +10 -4
  31. package/js/src/pro/bitfinex2.js +5 -5
  32. package/js/src/pro/bitmart.js +10 -6
  33. package/js/src/pro/bybit.js +6 -6
  34. package/js/src/pro/htx.js +5 -6
  35. package/js/src/pro/okx.js +3 -4
  36. package/js/src/pro/woo.js +4 -4
  37. package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +1 -1
  38. package/js/src/whitebit.d.ts +2 -2
  39. package/js/src/whitebit.js +24 -3
  40. package/js/src/zaif.d.ts +1 -1
  41. package/js/src/zaif.js +30 -2
  42. package/js/src/zonda.js +6 -0
  43. package/package.json +1 -1
package/dist/cjs/ccxt.js CHANGED
@@ -185,7 +185,7 @@ var woofipro$1 = require('./src/pro/woofipro.js');
185
185
 
186
186
  //-----------------------------------------------------------------------------
187
187
  // this is updated by vss.js when building
188
- const version = '4.3.35';
188
+ const version = '4.3.36';
189
189
  Exchange["default"].ccxtVersion = version;
190
190
  const exchanges = {
191
191
  'ace': ace,
@@ -1036,7 +1036,7 @@ class bingx extends bingx$1 {
1036
1036
  time = undefined;
1037
1037
  }
1038
1038
  const cost = this.safeString(trade, 'quoteQty');
1039
- const type = (cost === undefined) ? 'spot' : 'swap';
1039
+ // const type = (cost === undefined) ? 'spot' : 'swap'; this is not reliable
1040
1040
  const currencyId = this.safeStringN(trade, ['currency', 'N', 'commissionAsset']);
1041
1041
  const currencyCode = this.safeCurrencyCode(currencyId);
1042
1042
  const m = this.safeBool(trade, 'm');
@@ -1073,7 +1073,7 @@ class bingx extends bingx$1 {
1073
1073
  'info': trade,
1074
1074
  'timestamp': time,
1075
1075
  'datetime': this.iso8601(time),
1076
- 'symbol': this.safeSymbol(marketId, market, '-', type),
1076
+ 'symbol': this.safeSymbol(marketId, market, '-'),
1077
1077
  'order': this.safeString2(trade, 'orderId', 'i'),
1078
1078
  'type': this.safeStringLower(trade, 'o'),
1079
1079
  'side': this.parseOrderSide(side),
@@ -464,7 +464,8 @@ class bit2c extends bit2c$1 {
464
464
  const request = {
465
465
  'id': id,
466
466
  };
467
- return await this.privatePostOrderCancelOrder(this.extend(request, params));
467
+ const response = await this.privatePostOrderCancelOrder(this.extend(request, params));
468
+ return this.parseOrder(response);
468
469
  }
469
470
  async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
470
471
  /**
@@ -1228,6 +1228,7 @@ class bitget extends bitget$1 {
1228
1228
  '40712': errors.InsufficientFunds,
1229
1229
  '40713': errors.ExchangeError,
1230
1230
  '40714': errors.ExchangeError,
1231
+ '40762': errors.InsufficientFunds,
1231
1232
  '40768': errors.OrderNotFound,
1232
1233
  '41114': errors.OnMaintenance,
1233
1234
  '43011': errors.InvalidOrder,
@@ -4343,11 +4344,17 @@ class bitget extends bitget$1 {
4343
4344
  }
4344
4345
  const marginModeRequest = (marginMode === 'cross') ? 'crossed' : 'isolated';
4345
4346
  request['marginMode'] = marginModeRequest;
4346
- const oneWayMode = this.safeBool(params, 'oneWayMode', false);
4347
- params = this.omit(params, 'oneWayMode');
4347
+ let hedged = undefined;
4348
+ [hedged, params] = this.handleParamBool(params, 'hedged', false);
4349
+ // backward compatibility for `oneWayMode`
4350
+ let oneWayMode = undefined;
4351
+ [oneWayMode, params] = this.handleParamBool(params, 'oneWayMode');
4352
+ if (oneWayMode !== undefined) {
4353
+ hedged = !oneWayMode;
4354
+ }
4348
4355
  let requestSide = side;
4349
4356
  if (reduceOnly) {
4350
- if (oneWayMode) {
4357
+ if (!hedged) {
4351
4358
  request['reduceOnly'] = 'YES';
4352
4359
  }
4353
4360
  else {
@@ -4357,7 +4364,7 @@ class bitget extends bitget$1 {
4357
4364
  }
4358
4365
  }
4359
4366
  else {
4360
- if (!oneWayMode) {
4367
+ if (hedged) {
4361
4368
  request['tradeSide'] = 'Open';
4362
4369
  }
4363
4370
  }
@@ -426,7 +426,10 @@ class paymium extends paymium$1 {
426
426
  const request = {
427
427
  'uuid': id,
428
428
  };
429
- return await this.privateDeleteUserOrdersUuidCancel(this.extend(request, params));
429
+ const response = await this.privateDeleteUserOrdersUuidCancel(this.extend(request, params));
430
+ return this.safeOrder({
431
+ 'info': response,
432
+ });
430
433
  }
431
434
  async transfer(code, amount, fromAccount, toAccount, params = {}) {
432
435
  /**
@@ -723,11 +723,11 @@ class binance extends binance$1 {
723
723
  // todo: this is a synch blocking call - make it async
724
724
  // default 100, max 1000, valid limits 5, 10, 20, 50, 100, 500, 1000
725
725
  const snapshot = await this.fetchRestOrderBookSafe(symbol, limit, params);
726
- const orderbook = this.safeValue(this.orderbooks, symbol);
727
- if (orderbook === undefined) {
726
+ if (this.safeValue(this.orderbooks, symbol) === undefined) {
728
727
  // if the orderbook is dropped before the snapshot is received
729
728
  return;
730
729
  }
730
+ const orderbook = this.orderbooks[symbol];
731
731
  orderbook.reset(snapshot);
732
732
  // unroll the accumulated deltas
733
733
  const messages = orderbook.cache;
@@ -813,8 +813,7 @@ class binance extends binance$1 {
813
813
  const symbol = market['symbol'];
814
814
  const name = 'depth';
815
815
  const messageHash = market['lowercaseId'] + '@' + name;
816
- const orderbook = this.safeValue(this.orderbooks, symbol);
817
- if (orderbook === undefined) {
816
+ if (!(symbol in this.orderbooks)) {
818
817
  //
819
818
  // https://github.com/ccxt/ccxt/issues/6672
820
819
  //
@@ -825,6 +824,7 @@ class binance extends binance$1 {
825
824
  //
826
825
  return;
827
826
  }
827
+ const orderbook = this.orderbooks[symbol];
828
828
  const nonce = this.safeInteger(orderbook, 'nonce');
829
829
  if (nonce === undefined) {
830
830
  // 2. Buffer the events you receive from the stream.
@@ -988,14 +988,17 @@ class bingx extends bingx$1 {
988
988
  // }
989
989
  //
990
990
  const isSpot = ('dataType' in message);
991
- const result = this.safeValue2(message, 'data', 'o', {});
991
+ const result = this.safeDict2(message, 'data', 'o', {});
992
992
  let cachedTrades = this.myTrades;
993
993
  if (cachedTrades === undefined) {
994
994
  const limit = this.safeInteger(this.options, 'tradesLimit', 1000);
995
995
  cachedTrades = new Cache.ArrayCacheBySymbolById(limit);
996
996
  this.myTrades = cachedTrades;
997
997
  }
998
- const parsed = this.parseTrade(result);
998
+ const type = isSpot ? 'spot' : 'swap';
999
+ const marketId = this.safeString(result, 's');
1000
+ const market = this.safeMarket(marketId, undefined, '-', type);
1001
+ const parsed = this.parseTrade(result, market);
999
1002
  const symbol = parsed['symbol'];
1000
1003
  const spotHash = 'spot:mytrades';
1001
1004
  const swapHash = 'swap:mytrades';
@@ -1041,10 +1044,13 @@ class bingx extends bingx$1 {
1041
1044
  // }
1042
1045
  // }
1043
1046
  //
1044
- const a = this.safeValue(message, 'a', {});
1045
- const data = this.safeValue(a, 'B', []);
1047
+ const a = this.safeDict(message, 'a', {});
1048
+ const data = this.safeList(a, 'B', []);
1046
1049
  const timestamp = this.safeInteger2(message, 'T', 'E');
1047
1050
  const type = ('P' in a) ? 'swap' : 'spot';
1051
+ if (!(type in this.balance)) {
1052
+ this.balance[type] = {};
1053
+ }
1048
1054
  this.balance[type]['info'] = data;
1049
1055
  this.balance[type]['timestamp'] = timestamp;
1050
1056
  this.balance[type]['datetime'] = this.iso8601(timestamp);
@@ -577,8 +577,7 @@ class bitfinex2 extends bitfinex2$1 {
577
577
  const prec = this.safeString(subscription, 'prec', 'P0');
578
578
  const isRaw = (prec === 'R0');
579
579
  // if it is an initial snapshot
580
- let orderbook = this.safeValue(this.orderbooks, symbol);
581
- if (orderbook === undefined) {
580
+ if (!(symbol in this.orderbooks)) {
582
581
  const limit = this.safeInteger(subscription, 'len');
583
582
  if (isRaw) {
584
583
  // raw order books
@@ -588,7 +587,7 @@ class bitfinex2 extends bitfinex2$1 {
588
587
  // P0, P1, P2, P3, P4
589
588
  this.orderbooks[symbol] = this.countedOrderBook({}, limit);
590
589
  }
591
- orderbook = this.orderbooks[symbol];
590
+ const orderbook = this.orderbooks[symbol];
592
591
  if (isRaw) {
593
592
  const deltas = message[1];
594
593
  for (let i = 0; i < deltas.length; i++) {
@@ -599,7 +598,7 @@ class bitfinex2 extends bitfinex2$1 {
599
598
  const bookside = orderbook[side];
600
599
  const idString = this.safeString(delta, 0);
601
600
  const price = this.safeFloat(delta, 1);
602
- bookside.store(price, size, idString);
601
+ bookside.storeArray([price, size, idString]);
603
602
  }
604
603
  }
605
604
  else {
@@ -612,13 +611,14 @@ class bitfinex2 extends bitfinex2$1 {
612
611
  const size = (amount < 0) ? -amount : amount;
613
612
  const side = (amount < 0) ? 'asks' : 'bids';
614
613
  const bookside = orderbook[side];
615
- bookside.store(price, size, counter);
614
+ bookside.storeArray([price, size, counter]);
616
615
  }
617
616
  }
618
617
  orderbook['symbol'] = symbol;
619
618
  client.resolve(orderbook, messageHash);
620
619
  }
621
620
  else {
621
+ const orderbook = this.orderbooks[symbol];
622
622
  const deltas = message[1];
623
623
  const orderbookItem = this.orderbooks[symbol];
624
624
  if (isRaw) {
@@ -355,9 +355,9 @@ class bitmart extends bitmart$1 {
355
355
  /**
356
356
  * @method
357
357
  * @name bitmart#watchOrders
358
- * @see https://developer-pro.bitmart.com/en/spot/#private-order-channel
359
- * @see https://developer-pro.bitmart.com/en/futures/#private-order-channel
360
358
  * @description watches information on multiple orders made by the user
359
+ * @see https://developer-pro.bitmart.com/en/spot/#private-order-progress
360
+ * @see https://developer-pro.bitmart.com/en/futures/#private-order-channel
361
361
  * @param {string} symbol unified market symbol of the market orders were made in
362
362
  * @param {int} [since] the earliest time in ms to fetch orders for
363
363
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -377,12 +377,16 @@ class bitmart extends bitmart$1 {
377
377
  await this.authenticate(type, params);
378
378
  let request = undefined;
379
379
  if (type === 'spot') {
380
- if (symbol === undefined) {
381
- throw new errors.ArgumentsRequired(this.id + ' watchOrders() requires a symbol argument for spot markets');
380
+ let argsRequest = 'spot/user/order:';
381
+ if (symbol !== undefined) {
382
+ argsRequest += market['id'];
383
+ }
384
+ else {
385
+ argsRequest = 'spot/user/orders:ALL_SYMBOLS';
382
386
  }
383
387
  request = {
384
388
  'op': 'subscribe',
385
- 'args': ['spot/user/order:' + market['id']],
389
+ 'args': [argsRequest],
386
390
  };
387
391
  }
388
392
  else {
@@ -707,23 +707,23 @@ class bybit extends bybit$1 {
707
707
  const isSpot = client.url.indexOf('spot') >= 0;
708
708
  const type = this.safeString(message, 'type');
709
709
  const isSnapshot = (type === 'snapshot');
710
- const data = this.safeValue(message, 'data', {});
710
+ const data = this.safeDict(message, 'data', {});
711
711
  const marketId = this.safeString(data, 's');
712
712
  const marketType = isSpot ? 'spot' : 'contract';
713
713
  const market = this.safeMarket(marketId, undefined, undefined, marketType);
714
714
  const symbol = market['symbol'];
715
715
  const timestamp = this.safeInteger(message, 'ts');
716
- let orderbook = this.safeValue(this.orderbooks, symbol);
717
- if (orderbook === undefined) {
718
- orderbook = this.orderBook();
716
+ if (!(symbol in this.orderbooks)) {
717
+ this.orderbooks[symbol] = this.orderBook();
719
718
  }
719
+ const orderbook = this.orderbooks[symbol];
720
720
  if (isSnapshot) {
721
721
  const snapshot = this.parseOrderBook(data, symbol, timestamp, 'b', 'a');
722
722
  orderbook.reset(snapshot);
723
723
  }
724
724
  else {
725
- const asks = this.safeValue(data, 'a', []);
726
- const bids = this.safeValue(data, 'b', []);
725
+ const asks = this.safeList(data, 'a', []);
726
+ const bids = this.safeList(data, 'b', []);
727
727
  this.handleDeltas(orderbook['asks'], asks);
728
728
  this.handleDeltas(orderbook['bids'], bids);
729
729
  orderbook['timestamp'] = timestamp;
@@ -629,20 +629,19 @@ class htx extends htx$1 {
629
629
  // }
630
630
  //
631
631
  const messageHash = this.safeString(message, 'ch');
632
- const tick = this.safeValue(message, 'tick');
632
+ const tick = this.safeDict(message, 'tick');
633
633
  const event = this.safeString(tick, 'event');
634
- const ch = this.safeValue(message, 'ch');
634
+ const ch = this.safeString(message, 'ch');
635
635
  const parts = ch.split('.');
636
636
  const marketId = this.safeString(parts, 1);
637
637
  const symbol = this.safeSymbol(marketId);
638
- let orderbook = this.safeValue(this.orderbooks, symbol);
639
- if (orderbook === undefined) {
638
+ if (!(symbol in this.orderbooks)) {
640
639
  const size = this.safeString(parts, 3);
641
640
  const sizeParts = size.split('_');
642
641
  const limit = this.safeInteger(sizeParts, 1);
643
- orderbook = this.orderBook({}, limit);
644
- this.orderbooks[symbol] = orderbook;
642
+ this.orderbooks[symbol] = this.orderBook({}, limit);
645
643
  }
644
+ const orderbook = this.orderbooks[symbol];
646
645
  if ((event === undefined) && (orderbook['nonce'] === undefined)) {
647
646
  orderbook.cache.push(message);
648
647
  }
@@ -1072,11 +1072,10 @@ class okx extends okx$1 {
1072
1072
  }
1073
1073
  }
1074
1074
  else if ((channel === 'books5') || (channel === 'bbo-tbt')) {
1075
- let orderbook = this.safeValue(this.orderbooks, symbol);
1076
- if (orderbook === undefined) {
1077
- orderbook = this.orderBook({}, limit);
1075
+ if (!(symbol in this.orderbooks)) {
1076
+ this.orderbooks[symbol] = this.orderBook({}, limit);
1078
1077
  }
1079
- this.orderbooks[symbol] = orderbook;
1078
+ const orderbook = this.orderbooks[symbol];
1080
1079
  for (let i = 0; i < data.length; i++) {
1081
1080
  const update = data[i];
1082
1081
  const timestamp = this.safeInteger(update, 'ts');
@@ -125,15 +125,15 @@ class woo extends woo$1 {
125
125
  // }
126
126
  // }
127
127
  //
128
- const data = this.safeValue(message, 'data');
128
+ const data = this.safeDict(message, 'data');
129
129
  const marketId = this.safeString(data, 'symbol');
130
130
  const market = this.safeMarket(marketId);
131
131
  const symbol = market['symbol'];
132
132
  const topic = this.safeString(message, 'topic');
133
- let orderbook = this.safeValue(this.orderbooks, symbol);
134
- if (orderbook === undefined) {
135
- orderbook = this.orderBook({});
133
+ if (!(symbol in this.orderbooks)) {
134
+ this.orderbooks[symbol] = this.orderBook({});
136
135
  }
136
+ const orderbook = this.orderbooks[symbol];
137
137
  const timestamp = this.safeInteger(message, 'ts');
138
138
  const snapshot = this.parseOrderBook(data, symbol, timestamp, 'bids', 'asks');
139
139
  orderbook.reset(snapshot);
@@ -1419,7 +1419,27 @@ class whitebit extends whitebit$1 {
1419
1419
  'market': market['id'],
1420
1420
  'orderId': parseInt(id),
1421
1421
  };
1422
- return await this.v4PrivatePostOrderCancel(this.extend(request, params));
1422
+ const response = await this.v4PrivatePostOrderCancel(this.extend(request, params));
1423
+ //
1424
+ // {
1425
+ // "orderId": 4180284841, // order id
1426
+ // "clientOrderId": "customId11", // custom order identifier; "clientOrderId": "" - if not specified.
1427
+ // "market": "BTC_USDT", // deal market
1428
+ // "side": "buy", // order side
1429
+ // "type": "stop market", // order type
1430
+ // "timestamp": 1595792396.165973, // current timestamp
1431
+ // "dealMoney": "0", // if order finished - amount in money currency that is finished
1432
+ // "dealStock": "0", // if order finished - amount in stock currency that is finished
1433
+ // "amount": "0.001", // amount
1434
+ // "takerFee": "0.001", // maker fee ratio. If the number less than 0.0001 - it will be rounded to zero
1435
+ // "makerFee": "0.001", // maker fee ratio. If the number less than 0.0001 - it will be rounded to zero
1436
+ // "left": "0.001", // if order not finished - rest of the amount that must be finished
1437
+ // "dealFee": "0", // fee in money that you pay if order is finished
1438
+ // "price": "40000", // price if price isset
1439
+ // "activation_price": "40000" // activation price if activation price is set
1440
+ // }
1441
+ //
1442
+ return this.parseOrder(response);
1423
1443
  }
1424
1444
  async cancelAllOrders(symbol = undefined, params = {}) {
1425
1445
  /**
@@ -1464,7 +1484,7 @@ class whitebit extends whitebit$1 {
1464
1484
  //
1465
1485
  // []
1466
1486
  //
1467
- return response;
1487
+ return this.parseOrders(response, market);
1468
1488
  }
1469
1489
  async cancelAllOrdersAfter(timeout, params = {}) {
1470
1490
  /**
@@ -1698,7 +1718,7 @@ class whitebit extends whitebit$1 {
1698
1718
  }
1699
1719
  parseOrder(order, market = undefined) {
1700
1720
  //
1701
- // createOrder, fetchOpenOrders
1721
+ // createOrder, fetchOpenOrders, cancelOrder
1702
1722
  //
1703
1723
  // {
1704
1724
  // "orderId":105687928629,
@@ -1713,6 +1733,7 @@ class whitebit extends whitebit$1 {
1713
1733
  // "takerFee":"0.001",
1714
1734
  // "makerFee":"0",
1715
1735
  // "left":"100",
1736
+ // "price": "40000", // price if price isset
1716
1737
  // "dealFee":"0",
1717
1738
  // "activation_price":"0.065" // stop price (if stop limit or stop market)
1718
1739
  // }
@@ -476,7 +476,23 @@ class zaif extends zaif$1 {
476
476
  const request = {
477
477
  'order_id': id,
478
478
  };
479
- return await this.privatePostCancelOrder(this.extend(request, params));
479
+ const response = await this.privatePostCancelOrder(this.extend(request, params));
480
+ //
481
+ // {
482
+ // "success": 1,
483
+ // "return": {
484
+ // "order_id": 184,
485
+ // "funds": {
486
+ // "jpy": 15320,
487
+ // "btc": 1.392,
488
+ // "mona": 2600,
489
+ // "kaori": 0.1
490
+ // }
491
+ // }
492
+ // }
493
+ //
494
+ const data = this.safeDict(response, 'return');
495
+ return this.parseOrder(data);
480
496
  }
481
497
  parseOrder(order, market = undefined) {
482
498
  //
@@ -489,6 +505,18 @@ class zaif extends zaif$1 {
489
505
  // "comment" : "demo"
490
506
  // }
491
507
  //
508
+ // cancelOrder
509
+ //
510
+ // {
511
+ // "order_id": 184,
512
+ // "funds": {
513
+ // "jpy": 15320,
514
+ // "btc": 1.392,
515
+ // "mona": 2600,
516
+ // "kaori": 0.1
517
+ // }
518
+ // }
519
+ //
492
520
  let side = this.safeString(order, 'action');
493
521
  side = (side === 'bid') ? 'buy' : 'sell';
494
522
  const timestamp = this.safeTimestamp(order, 'timestamp');
@@ -496,7 +524,7 @@ class zaif extends zaif$1 {
496
524
  const symbol = this.safeSymbol(marketId, market, '_');
497
525
  const price = this.safeString(order, 'price');
498
526
  const amount = this.safeString(order, 'amount');
499
- const id = this.safeString(order, 'id');
527
+ const id = this.safeString2(order, 'id', 'order_id');
500
528
  return this.safeOrder({
501
529
  'id': id,
502
530
  'clientOrderId': undefined,
@@ -169,6 +169,10 @@ class zonda extends zonda$1 {
169
169
  'balances/BITBAY/balance',
170
170
  'fiat_cantor/rate/{baseId}/{quoteId}',
171
171
  'fiat_cantor/history',
172
+ 'client_payments/v2/customer/crypto/{currency}/channels/deposit',
173
+ 'client_payments/v2/customer/crypto/{currency}/channels/withdrawal',
174
+ 'client_payments/v2/customer/crypto/deposit/fee',
175
+ 'client_payments/v2/customer/crypto/withdrawal/fee',
172
176
  ],
173
177
  'post': [
174
178
  'trading/offer/{symbol}',
@@ -179,6 +183,8 @@ class zonda extends zonda$1 {
179
183
  'fiat_cantor/exchange',
180
184
  'api_payments/withdrawals/crypto',
181
185
  'api_payments/withdrawals/fiat',
186
+ 'client_payments/v2/customer/crypto/deposit',
187
+ 'client_payments/v2/customer/crypto/withdrawal',
182
188
  ],
183
189
  'delete': [
184
190
  'trading/offer/{symbol}/{id}/{side}/{price}',
package/js/ccxt.d.ts CHANGED
@@ -4,7 +4,7 @@ import * as functions from './src/base/functions.js';
4
4
  import * as errors from './src/base/errors.js';
5
5
  import type { Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position, FundingRateHistory, Liquidation, FundingHistory, MarginMode, Greeks, Leverage, Leverages, Option, OptionChain, Conversion } from './src/base/types.js';
6
6
  import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout } from './src/base/errors.js';
7
- declare const version = "4.3.34";
7
+ declare const version = "4.3.35";
8
8
  import ace from './src/ace.js';
9
9
  import alpaca from './src/alpaca.js';
10
10
  import ascendex from './src/ascendex.js';
package/js/ccxt.js CHANGED
@@ -38,7 +38,7 @@ import * as errors from './src/base/errors.js';
38
38
  import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout } from './src/base/errors.js';
39
39
  //-----------------------------------------------------------------------------
40
40
  // this is updated by vss.js when building
41
- const version = '4.3.35';
41
+ const version = '4.3.36';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import ace from './src/ace.js';
@@ -33,6 +33,10 @@ interface zonda {
33
33
  v1_01PrivateGetBalancesBITBAYBalance(params?: {}): Promise<implicitReturnType>;
34
34
  v1_01PrivateGetFiatCantorRateBaseIdQuoteId(params?: {}): Promise<implicitReturnType>;
35
35
  v1_01PrivateGetFiatCantorHistory(params?: {}): Promise<implicitReturnType>;
36
+ v1_01PrivateGetClientPaymentsV2CustomerCryptoCurrencyChannelsDeposit(params?: {}): Promise<implicitReturnType>;
37
+ v1_01PrivateGetClientPaymentsV2CustomerCryptoCurrencyChannelsWithdrawal(params?: {}): Promise<implicitReturnType>;
38
+ v1_01PrivateGetClientPaymentsV2CustomerCryptoDepositFee(params?: {}): Promise<implicitReturnType>;
39
+ v1_01PrivateGetClientPaymentsV2CustomerCryptoWithdrawalFee(params?: {}): Promise<implicitReturnType>;
36
40
  v1_01PrivatePostTradingOfferSymbol(params?: {}): Promise<implicitReturnType>;
37
41
  v1_01PrivatePostTradingStopOfferSymbol(params?: {}): Promise<implicitReturnType>;
38
42
  v1_01PrivatePostTradingConfigSymbol(params?: {}): Promise<implicitReturnType>;
@@ -41,6 +45,8 @@ interface zonda {
41
45
  v1_01PrivatePostFiatCantorExchange(params?: {}): Promise<implicitReturnType>;
42
46
  v1_01PrivatePostApiPaymentsWithdrawalsCrypto(params?: {}): Promise<implicitReturnType>;
43
47
  v1_01PrivatePostApiPaymentsWithdrawalsFiat(params?: {}): Promise<implicitReturnType>;
48
+ v1_01PrivatePostClientPaymentsV2CustomerCryptoDeposit(params?: {}): Promise<implicitReturnType>;
49
+ v1_01PrivatePostClientPaymentsV2CustomerCryptoWithdrawal(params?: {}): Promise<implicitReturnType>;
44
50
  v1_01PrivateDeleteTradingOfferSymbolIdSidePrice(params?: {}): Promise<implicitReturnType>;
45
51
  v1_01PrivateDeleteTradingStopOfferSymbolIdSidePrice(params?: {}): Promise<implicitReturnType>;
46
52
  v1_01PrivatePutBalancesBITBAYBalanceId(params?: {}): Promise<implicitReturnType>;
@@ -33,6 +33,10 @@ interface Exchange {
33
33
  v1_01PrivateGetBalancesBITBAYBalance(params?: {}): Promise<implicitReturnType>;
34
34
  v1_01PrivateGetFiatCantorRateBaseIdQuoteId(params?: {}): Promise<implicitReturnType>;
35
35
  v1_01PrivateGetFiatCantorHistory(params?: {}): Promise<implicitReturnType>;
36
+ v1_01PrivateGetClientPaymentsV2CustomerCryptoCurrencyChannelsDeposit(params?: {}): Promise<implicitReturnType>;
37
+ v1_01PrivateGetClientPaymentsV2CustomerCryptoCurrencyChannelsWithdrawal(params?: {}): Promise<implicitReturnType>;
38
+ v1_01PrivateGetClientPaymentsV2CustomerCryptoDepositFee(params?: {}): Promise<implicitReturnType>;
39
+ v1_01PrivateGetClientPaymentsV2CustomerCryptoWithdrawalFee(params?: {}): Promise<implicitReturnType>;
36
40
  v1_01PrivatePostTradingOfferSymbol(params?: {}): Promise<implicitReturnType>;
37
41
  v1_01PrivatePostTradingStopOfferSymbol(params?: {}): Promise<implicitReturnType>;
38
42
  v1_01PrivatePostTradingConfigSymbol(params?: {}): Promise<implicitReturnType>;
@@ -41,6 +45,8 @@ interface Exchange {
41
45
  v1_01PrivatePostFiatCantorExchange(params?: {}): Promise<implicitReturnType>;
42
46
  v1_01PrivatePostApiPaymentsWithdrawalsCrypto(params?: {}): Promise<implicitReturnType>;
43
47
  v1_01PrivatePostApiPaymentsWithdrawalsFiat(params?: {}): Promise<implicitReturnType>;
48
+ v1_01PrivatePostClientPaymentsV2CustomerCryptoDeposit(params?: {}): Promise<implicitReturnType>;
49
+ v1_01PrivatePostClientPaymentsV2CustomerCryptoWithdrawal(params?: {}): Promise<implicitReturnType>;
44
50
  v1_01PrivateDeleteTradingOfferSymbolIdSidePrice(params?: {}): Promise<implicitReturnType>;
45
51
  v1_01PrivateDeleteTradingStopOfferSymbolIdSidePrice(params?: {}): Promise<implicitReturnType>;
46
52
  v1_01PrivatePutBalancesBITBAYBalanceId(params?: {}): Promise<implicitReturnType>;
package/js/src/bingx.js CHANGED
@@ -1039,7 +1039,7 @@ export default class bingx extends Exchange {
1039
1039
  time = undefined;
1040
1040
  }
1041
1041
  const cost = this.safeString(trade, 'quoteQty');
1042
- const type = (cost === undefined) ? 'spot' : 'swap';
1042
+ // const type = (cost === undefined) ? 'spot' : 'swap'; this is not reliable
1043
1043
  const currencyId = this.safeStringN(trade, ['currency', 'N', 'commissionAsset']);
1044
1044
  const currencyCode = this.safeCurrencyCode(currencyId);
1045
1045
  const m = this.safeBool(trade, 'm');
@@ -1076,7 +1076,7 @@ export default class bingx extends Exchange {
1076
1076
  'info': trade,
1077
1077
  'timestamp': time,
1078
1078
  'datetime': this.iso8601(time),
1079
- 'symbol': this.safeSymbol(marketId, market, '-', type),
1079
+ 'symbol': this.safeSymbol(marketId, market, '-'),
1080
1080
  'order': this.safeString2(trade, 'orderId', 'i'),
1081
1081
  'type': this.safeStringLower(trade, 'o'),
1082
1082
  'side': this.parseOrderSide(side),
package/js/src/bit2c.d.ts CHANGED
@@ -14,7 +14,7 @@ export default class bit2c extends Exchange {
14
14
  fetchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
15
15
  fetchTradingFees(params?: {}): Promise<TradingFees>;
16
16
  createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
17
- cancelOrder(id: string, symbol?: Str, params?: {}): Promise<any>;
17
+ cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
18
18
  fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
19
19
  fetchOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
20
20
  parseOrder(order: Dict, market?: Market): Order;
package/js/src/bit2c.js CHANGED
@@ -467,7 +467,8 @@ export default class bit2c extends Exchange {
467
467
  const request = {
468
468
  'id': id,
469
469
  };
470
- return await this.privatePostOrderCancelOrder(this.extend(request, params));
470
+ const response = await this.privatePostOrderCancelOrder(this.extend(request, params));
471
+ return this.parseOrder(response);
471
472
  }
472
473
  async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
473
474
  /**
package/js/src/bitget.js CHANGED
@@ -1231,6 +1231,7 @@ export default class bitget extends Exchange {
1231
1231
  '40712': InsufficientFunds,
1232
1232
  '40713': ExchangeError,
1233
1233
  '40714': ExchangeError,
1234
+ '40762': InsufficientFunds,
1234
1235
  '40768': OrderNotFound,
1235
1236
  '41114': OnMaintenance,
1236
1237
  '43011': InvalidOrder,
@@ -4346,11 +4347,17 @@ export default class bitget extends Exchange {
4346
4347
  }
4347
4348
  const marginModeRequest = (marginMode === 'cross') ? 'crossed' : 'isolated';
4348
4349
  request['marginMode'] = marginModeRequest;
4349
- const oneWayMode = this.safeBool(params, 'oneWayMode', false);
4350
- params = this.omit(params, 'oneWayMode');
4350
+ let hedged = undefined;
4351
+ [hedged, params] = this.handleParamBool(params, 'hedged', false);
4352
+ // backward compatibility for `oneWayMode`
4353
+ let oneWayMode = undefined;
4354
+ [oneWayMode, params] = this.handleParamBool(params, 'oneWayMode');
4355
+ if (oneWayMode !== undefined) {
4356
+ hedged = !oneWayMode;
4357
+ }
4351
4358
  let requestSide = side;
4352
4359
  if (reduceOnly) {
4353
- if (oneWayMode) {
4360
+ if (!hedged) {
4354
4361
  request['reduceOnly'] = 'YES';
4355
4362
  }
4356
4363
  else {
@@ -4360,7 +4367,7 @@ export default class bitget extends Exchange {
4360
4367
  }
4361
4368
  }
4362
4369
  else {
4363
- if (!oneWayMode) {
4370
+ if (hedged) {
4364
4371
  request['tradeSide'] = 'Open';
4365
4372
  }
4366
4373
  }
@@ -36,7 +36,7 @@ export default class paymium extends Exchange {
36
36
  network: any;
37
37
  };
38
38
  createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<import("./base/types.js").Order>;
39
- cancelOrder(id: string, symbol?: Str, params?: {}): Promise<any>;
39
+ cancelOrder(id: string, symbol?: Str, params?: {}): Promise<import("./base/types.js").Order>;
40
40
  transfer(code: string, amount: number, fromAccount: string, toAccount: string, params?: {}): Promise<TransferEntry>;
41
41
  parseTransfer(transfer: Dict, currency?: Currency): TransferEntry;
42
42
  parseTransferStatus(status: Str): Str;
package/js/src/paymium.js CHANGED
@@ -429,7 +429,10 @@ export default class paymium extends Exchange {
429
429
  const request = {
430
430
  'uuid': id,
431
431
  };
432
- return await this.privateDeleteUserOrdersUuidCancel(this.extend(request, params));
432
+ const response = await this.privateDeleteUserOrdersUuidCancel(this.extend(request, params));
433
+ return this.safeOrder({
434
+ 'info': response,
435
+ });
433
436
  }
434
437
  async transfer(code, amount, fromAccount, toAccount, params = {}) {
435
438
  /**