ccxt 4.3.59 → 4.3.60

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.
@@ -1155,7 +1155,33 @@ class bitfinex extends bitfinex$1 {
1155
1155
  const request = {
1156
1156
  'order_id': parseInt(id),
1157
1157
  };
1158
- return await this.privatePostOrderCancel(this.extend(request, params));
1158
+ const response = await this.privatePostOrderCancel(this.extend(request, params));
1159
+ //
1160
+ // {
1161
+ // id: '161236928925',
1162
+ // cid: '1720172026812',
1163
+ // cid_date: '2024-07-05',
1164
+ // gid: null,
1165
+ // symbol: 'adaust',
1166
+ // exchange: 'bitfinex',
1167
+ // price: '0.33',
1168
+ // avg_execution_price: '0.0',
1169
+ // side: 'buy',
1170
+ // type: 'exchange limit',
1171
+ // timestamp: '1720172026.813',
1172
+ // is_live: true,
1173
+ // is_cancelled: false,
1174
+ // is_hidden: false,
1175
+ // oco_order: null,
1176
+ // was_forced: false,
1177
+ // original_amount: '10.0',
1178
+ // remaining_amount: '10.0',
1179
+ // executed_amount: '0.0',
1180
+ // src: 'api',
1181
+ // meta: {}
1182
+ // }
1183
+ //
1184
+ return this.parseOrder(response);
1159
1185
  }
1160
1186
  async cancelAllOrders(symbol = undefined, params = {}) {
1161
1187
  /**
@@ -1163,11 +1189,19 @@ class bitfinex extends bitfinex$1 {
1163
1189
  * @name bitfinex#cancelAllOrders
1164
1190
  * @description cancel all open orders
1165
1191
  * @see https://docs.bitfinex.com/v1/reference/rest-auth-cancel-all-orders
1166
- * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
1192
+ * @param {string} symbol not used by bitfinex cancelAllOrders
1167
1193
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1168
1194
  * @returns {object} response from exchange
1169
1195
  */
1170
- return await this.privatePostOrderCancelAll(params);
1196
+ const response = await this.privatePostOrderCancelAll(params);
1197
+ //
1198
+ // { result: 'Submitting 1 order cancellations.' }
1199
+ //
1200
+ return [
1201
+ this.safeOrder({
1202
+ 'info': response,
1203
+ }),
1204
+ ];
1171
1205
  }
1172
1206
  parseOrder(order, market = undefined) {
1173
1207
  //
@@ -1646,7 +1680,7 @@ class bitfinex extends bitfinex$1 {
1646
1680
  return response;
1647
1681
  }
1648
1682
  nonce() {
1649
- return this.milliseconds();
1683
+ return this.microseconds();
1650
1684
  }
1651
1685
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
1652
1686
  let request = '/' + this.implodeParams(path, params);
@@ -97,7 +97,10 @@ class bitso extends bitso$1 {
97
97
  'urls': {
98
98
  'logo': 'https://user-images.githubusercontent.com/51840849/87295554-11f98280-c50e-11ea-80d6-15b3bafa8cbf.jpg',
99
99
  'api': {
100
- 'rest': 'https://api.bitso.com',
100
+ 'rest': 'https://bitso.com/api',
101
+ },
102
+ 'test': {
103
+ 'rest': 'https://stage.bitso.com/api',
101
104
  },
102
105
  'www': 'https://bitso.com',
103
106
  'doc': 'https://bitso.com/api_info',
@@ -4446,10 +4446,8 @@ class bybit extends bybit$1 {
4446
4446
  * @name bybit#cancelOrdersForSymbols
4447
4447
  * @description cancel multiple orders for multiple symbols
4448
4448
  * @see https://bybit-exchange.github.io/docs/v5/order/batch-cancel
4449
- * @param {string[]} ids order ids
4450
- * @param {string} symbol unified symbol of the market the order was made in
4449
+ * @param {CancellationRequest[]} orders list of order ids with symbol, example [{"id": "a", "symbol": "BTC/USDT"}, {"id": "b", "symbol": "ETH/USDT"}]
4451
4450
  * @param {object} [params] extra parameters specific to the exchange API endpoint
4452
- * @param {string[]} [params.clientOrderIds] client order ids
4453
4451
  * @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
4454
4452
  */
4455
4453
  await this.loadMarkets();
@@ -814,15 +814,23 @@ class cryptocom extends cryptocom$1 {
814
814
  'instrument_name': market['id'],
815
815
  'timeframe': this.safeString(this.timeframes, timeframe, timeframe),
816
816
  };
817
- if (since !== undefined) {
818
- request['start_ts'] = since;
819
- }
820
817
  if (limit !== undefined) {
821
818
  request['count'] = limit;
822
819
  }
823
- const until = this.safeInteger(params, 'until');
820
+ const now = this.microseconds();
821
+ const duration = this.parseTimeframe(timeframe);
822
+ const until = this.safeInteger(params, 'until', now);
824
823
  params = this.omit(params, ['until']);
825
- if (until !== undefined) {
824
+ if (since !== undefined) {
825
+ request['start_ts'] = since;
826
+ if (limit !== undefined) {
827
+ request['end_ts'] = this.sum(since, duration * (limit + 1) * 1000) - 1;
828
+ }
829
+ else {
830
+ request['end_ts'] = until;
831
+ }
832
+ }
833
+ else {
826
834
  request['end_ts'] = until;
827
835
  }
828
836
  const response = await this.v1PublicGetPublicGetCandlestick(this.extend(request, params));
@@ -1475,7 +1483,7 @@ class cryptocom extends cryptocom$1 {
1475
1483
  * @name cryptocom#cancelOrdersForSymbols
1476
1484
  * @description cancel multiple orders for multiple symbols
1477
1485
  * @see https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-cancel-order-list-list
1478
- * @param {CancellationRequest[]} orders each order should contain the parameters required by cancelOrder namely id and symbol
1486
+ * @param {CancellationRequest[]} orders each order should contain the parameters required by cancelOrder namely id and symbol, example [{"id": "a", "symbol": "BTC/USDT"}, {"id": "b", "symbol": "ETH/USDT"}]
1479
1487
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1480
1488
  * @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
1481
1489
  */
@@ -5137,8 +5137,7 @@ class gate extends gate$1 {
5137
5137
  * @name gate#cancelOrdersForSymbols
5138
5138
  * @description cancel multiple orders for multiple symbols
5139
5139
  * @see https://www.gate.io/docs/developers/apiv4/en/#cancel-a-batch-of-orders-with-an-id-list
5140
- * @param {string[]} ids order ids
5141
- * @param {string} symbol unified symbol of the market the order was made in
5140
+ * @param {CancellationRequest[]} orders list of order ids with symbol, example [{"id": "a", "symbol": "BTC/USDT"}, {"id": "b", "symbol": "ETH/USDT"}]
5142
5141
  * @param {object} [params] extra parameters specific to the exchange API endpoint
5143
5142
  * @param {string[]} [params.clientOrderIds] client order ids
5144
5143
  * @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -1315,7 +1315,7 @@ class hyperliquid extends hyperliquid$1 {
1315
1315
  * @description cancel multiple orders for multiple symbols
1316
1316
  * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s
1317
1317
  * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s-by-cloid
1318
- * @param {CancellationRequest[]} orders each order should contain the parameters required by cancelOrder namely id and symbol
1318
+ * @param {CancellationRequest[]} orders each order should contain the parameters required by cancelOrder namely id and symbol, example [{"id": "a", "symbol": "BTC/USDT"}, {"id": "b", "symbol": "ETH/USDT"}]
1319
1319
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1320
1320
  * @param {string} [params.vaultAddress] the vault address
1321
1321
  * @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -1049,7 +1049,7 @@ class kraken extends kraken$1 {
1049
1049
  else {
1050
1050
  direction = 'in';
1051
1051
  }
1052
- const timestamp = this.safeTimestamp(item, 'time');
1052
+ const timestamp = this.safeIntegerProduct(item, 'time', 1000);
1053
1053
  return {
1054
1054
  'info': item,
1055
1055
  'id': id,
@@ -924,7 +924,16 @@ class okx extends okx$1 {
924
924
  '64003': errors.AccountNotEnabled,
925
925
  '70010': errors.BadRequest,
926
926
  '70013': errors.BadRequest,
927
- '70016': errors.BadRequest, // Please specify your instrument settings for at least one instType.
927
+ '70016': errors.BadRequest,
928
+ '1009': errors.BadRequest,
929
+ '4001': errors.AuthenticationError,
930
+ '4002': errors.BadRequest,
931
+ '4003': errors.RateLimitExceeded,
932
+ '4004': errors.NetworkError,
933
+ '4005': errors.ExchangeNotAvailable,
934
+ '4006': errors.BadRequest,
935
+ '4007': errors.AuthenticationError,
936
+ '4008': errors.RateLimitExceeded, // The number of subscribed channels exceeds the maximum limit.
928
937
  },
929
938
  'broad': {
930
939
  'Internal Server Error': errors.ExchangeNotAvailable,
@@ -3348,7 +3357,7 @@ class okx extends okx$1 {
3348
3357
  * @description cancel multiple orders for multiple symbols
3349
3358
  * @see https://www.okx.com/docs-v5/en/#order-book-trading-trade-post-cancel-multiple-orders
3350
3359
  * @see https://www.okx.com/docs-v5/en/#order-book-trading-algo-trading-post-cancel-algo-order
3351
- * @param {CancellationRequest[]} orders each order should contain the parameters required by cancelOrder namely id and symbol
3360
+ * @param {CancellationRequest[]} orders each order should contain the parameters required by cancelOrder namely id and symbol, example [{"id": "a", "symbol": "BTC/USDT"}, {"id": "b", "symbol": "ETH/USDT"}]
3352
3361
  * @param {object} [params] extra parameters specific to the exchange API endpoint
3353
3362
  * @param {boolean} [params.trigger] whether the order is a stop/trigger order
3354
3363
  * @param {boolean} [params.trailing] set to true if you want to cancel trailing orders
@@ -1012,7 +1012,7 @@ class cex extends cex$1 {
1012
1012
  // }
1013
1013
  //
1014
1014
  const data = this.safeValue(message, 'data', {});
1015
- const incrementalId = this.safeNumber(data, 'id');
1015
+ const incrementalId = this.safeInteger(data, 'id');
1016
1016
  const pair = this.safeString(data, 'pair', '');
1017
1017
  const symbol = this.pairToSymbol(pair);
1018
1018
  const storedOrderBook = this.safeValue(this.orderbooks, symbol);
@@ -40,6 +40,9 @@ class kucoin extends kucoin$1 {
40
40
  'snapshotMaxRetries': 3,
41
41
  'method': '/market/level2', // '/spotMarket/level2Depth5' or '/spotMarket/level2Depth50'
42
42
  },
43
+ 'watchMyTrades': {
44
+ 'method': '/spotMarket/tradeOrders', // or '/spot/tradeFills'
45
+ },
43
46
  },
44
47
  'streaming': {
45
48
  // kucoin does not support built-in ws protocol-level ping-pong
@@ -983,11 +986,14 @@ class kucoin extends kucoin$1 {
983
986
  * @param {int} [since] the earliest time in ms to fetch trades for
984
987
  * @param {int} [limit] the maximum number of trade structures to retrieve
985
988
  * @param {object} [params] extra parameters specific to the exchange API endpoint
989
+ * @param {string} [params.method] '/spotMarket/tradeOrders' or '/spot/tradeFills' default is '/spotMarket/tradeOrders'
986
990
  * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
987
991
  */
988
992
  await this.loadMarkets();
989
993
  const url = await this.negotiate(true);
990
- const topic = '/spotMarket/tradeOrders';
994
+ const options = this.safeDict(this.options, 'watchMyTrades');
995
+ const defaultMethod = this.safeString(params, 'method', '/spotMarket/tradeOrders');
996
+ const topic = (defaultMethod !== undefined) ? defaultMethod : this.safeString(options, 'method');
991
997
  const request = {
992
998
  'privateChannel': true,
993
999
  };
@@ -1045,6 +1051,8 @@ class kucoin extends kucoin$1 {
1045
1051
  client.resolve(this.myTrades, symbolSpecificMessageHash);
1046
1052
  }
1047
1053
  parseWsTrade(trade, market = undefined) {
1054
+ //
1055
+ // /spotMarket/tradeOrders
1048
1056
  //
1049
1057
  // {
1050
1058
  // "symbol": "KCS-USDT",
@@ -1067,6 +1075,22 @@ class kucoin extends kucoin$1 {
1067
1075
  // "ts": 1670329987311000000
1068
1076
  // }
1069
1077
  //
1078
+ // /spot/tradeFills
1079
+ //
1080
+ // {
1081
+ // "fee": 0.00262148,
1082
+ // "feeCurrency": "USDT",
1083
+ // "feeRate": 0.001,
1084
+ // "orderId": "62417436b29df8000183df2f",
1085
+ // "orderType": "market",
1086
+ // "price": 131.074,
1087
+ // "side": "sell",
1088
+ // "size": 0.02,
1089
+ // "symbol": "LTC-USDT",
1090
+ // "time": "1648456758734571745",
1091
+ // "tradeId": "624174362e113d2f467b3043"
1092
+ // }
1093
+ //
1070
1094
  const marketId = this.safeString(trade, 'symbol');
1071
1095
  market = this.safeMarket(marketId, market, '-');
1072
1096
  const symbol = market['symbol'];
@@ -1076,7 +1100,10 @@ class kucoin extends kucoin$1 {
1076
1100
  const price = this.safeString(trade, 'matchPrice');
1077
1101
  const amount = this.safeString(trade, 'matchSize');
1078
1102
  const order = this.safeString(trade, 'orderId');
1079
- const timestamp = this.safeIntegerProduct(trade, 'ts', 0.000001);
1103
+ const timestamp = this.safeIntegerProduct2(trade, 'ts', 'time', 0.000001);
1104
+ const feeCurrency = market['quote'];
1105
+ const feeRate = this.safeString(trade, 'feeRate');
1106
+ const feeCost = this.safeString(trade, 'fee');
1080
1107
  return this.safeTrade({
1081
1108
  'info': trade,
1082
1109
  'timestamp': timestamp,
@@ -1090,7 +1117,11 @@ class kucoin extends kucoin$1 {
1090
1117
  'price': price,
1091
1118
  'amount': amount,
1092
1119
  'cost': undefined,
1093
- 'fee': undefined,
1120
+ 'fee': {
1121
+ 'cost': feeCost,
1122
+ 'rate': feeRate,
1123
+ 'currency': feeCurrency,
1124
+ },
1094
1125
  }, market);
1095
1126
  }
1096
1127
  async watchBalance(params = {}) {
@@ -1199,6 +1230,7 @@ class kucoin extends kucoin$1 {
1199
1230
  'account.balance': this.handleBalance,
1200
1231
  'orderChange': this.handleOrder,
1201
1232
  'stopOrder': this.handleOrder,
1233
+ '/spot/tradeFills': this.handleMyTrade,
1202
1234
  };
1203
1235
  const method = this.safeValue(methods, subject);
1204
1236
  if (method !== undefined) {
@@ -39,7 +39,7 @@ class phemex extends phemex$1 {
39
39
  'OHLCVLimit': 1000,
40
40
  },
41
41
  'streaming': {
42
- 'keepAlive': 10000,
42
+ 'keepAlive': 9000,
43
43
  },
44
44
  });
45
45
  }
@@ -249,7 +249,11 @@ class xt extends xt$1 {
249
249
  await this.loadMarkets();
250
250
  const market = this.market(symbol);
251
251
  const name = 'kline@' + market['id'] + ',' + timeframe;
252
- return await this.subscribe(name, 'public', 'watchOHLCV', market, undefined, params);
252
+ const ohlcv = await this.subscribe(name, 'public', 'watchOHLCV', market, undefined, params);
253
+ if (this.newUpdates) {
254
+ limit = ohlcv.getLimit(symbol, limit);
255
+ }
256
+ return this.filterBySinceLimit(ohlcv, since, limit, 0, true);
253
257
  }
254
258
  async watchTrades(symbol, since = undefined, limit = undefined, params = {}) {
255
259
  /**
@@ -876,7 +876,8 @@ class timex extends timex$1 {
876
876
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
877
877
  */
878
878
  await this.loadMarkets();
879
- return await this.cancelOrders([id], symbol, params);
879
+ const orders = await this.cancelOrders([id], symbol, params);
880
+ return this.safeDict(orders, 0);
880
881
  }
881
882
  async cancelOrders(ids, symbol = undefined, params = {}) {
882
883
  /**
@@ -918,7 +919,22 @@ class timex extends timex$1 {
918
919
  // ],
919
920
  // "unchangedOrders": [ "string" ],
920
921
  // }
921
- return response;
922
+ //
923
+ const changedOrders = this.safeList(response, 'changedOrders', []);
924
+ const unchangedOrders = this.safeList(response, 'unchangedOrders', []);
925
+ const orders = [];
926
+ for (let i = 0; i < changedOrders.length; i++) {
927
+ const newOrder = this.safeDict(changedOrders[i], 'newOrder');
928
+ orders.push(this.parseOrder(newOrder));
929
+ }
930
+ for (let i = 0; i < unchangedOrders.length; i++) {
931
+ orders.push(this.safeOrder({
932
+ 'info': unchangedOrders[i],
933
+ 'id': unchangedOrders[i],
934
+ 'status': 'unchanged',
935
+ }));
936
+ }
937
+ return orders;
922
938
  }
923
939
  async fetchOrder(id, symbol = undefined, params = {}) {
924
940
  /**
@@ -824,7 +824,7 @@ class xt extends xt$1 {
824
824
  'name': this.safeString(entry, 'fullName'),
825
825
  'active': active,
826
826
  'fee': this.parseNumber(minWithdrawFeeString),
827
- 'precision': undefined,
827
+ 'precision': minPrecision,
828
828
  'deposit': deposit,
829
829
  'withdraw': withdraw,
830
830
  'networks': networks,
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 { Int, int, Str, Strings, Num, Bool, IndexType, OrderSide, OrderType, MarketType, SubType, Dict, NullableDict, List, NullableList, Fee, OHLCV, OHLCVC, implicitReturnType, Market, Currency, Dictionary, MinMax, FeeInterface, TradingFeeInterface, MarketInterface, Trade, Order, OrderBook, Ticker, Transaction, Tickers, CurrencyInterface, Balance, BalanceAccount, Account, PartialBalances, Balances, DepositAddress, WithdrawalResponse, DepositAddressResponse, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, TransferEntries, LeverageTiers } from './src/base/types.js';
6
6
  import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, BadResponse, NullResponse, CancelPending } from './src/base/errors.js';
7
- declare const version = "4.3.58";
7
+ declare const version = "4.3.59";
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, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, BadResponse, NullResponse, CancelPending } from './src/base/errors.js';
39
39
  //-----------------------------------------------------------------------------
40
40
  // this is updated by vss.js when building
41
- const version = '4.3.59';
41
+ const version = '4.3.60';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import ace from './src/ace.js';
@@ -89,8 +89,8 @@ interface Exchange {
89
89
  cswapV1PrivateGetUserBalance(params?: {}): Promise<implicitReturnType>;
90
90
  cswapV1PrivatePostTradeOrder(params?: {}): Promise<implicitReturnType>;
91
91
  cswapV1PrivatePostTradeLeverage(params?: {}): Promise<implicitReturnType>;
92
- cswapV1PrivatePostTradeAllOpenOrders(params?: {}): Promise<implicitReturnType>;
93
92
  cswapV1PrivatePostTradeCloseAllPositions(params?: {}): Promise<implicitReturnType>;
93
+ cswapV1PrivateDeleteTradeAllOpenOrders(params?: {}): Promise<implicitReturnType>;
94
94
  contractV1PrivateGetAllPosition(params?: {}): Promise<implicitReturnType>;
95
95
  contractV1PrivateGetAllOrders(params?: {}): Promise<implicitReturnType>;
96
96
  contractV1PrivateGetBalance(params?: {}): Promise<implicitReturnType>;
@@ -68,7 +68,7 @@ export default class binance extends Exchange {
68
68
  fetchCanceledOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<any>;
69
69
  fetchCanceledAndClosedOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
70
70
  cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
71
- cancelAllOrders(symbol?: Str, params?: {}): Promise<any>;
71
+ cancelAllOrders(symbol?: Str, params?: {}): Promise<Order[]>;
72
72
  cancelOrders(ids: string[], symbol?: Str, params?: {}): Promise<Order[]>;
73
73
  fetchOrderTrades(id: string, symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
74
74
  fetchMyTrades(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
package/js/src/binance.js CHANGED
@@ -7105,31 +7105,73 @@ export default class binance extends Exchange {
7105
7105
  let response = undefined;
7106
7106
  if (market['option']) {
7107
7107
  response = await this.eapiPrivateDeleteAllOpenOrders(this.extend(request, params));
7108
+ //
7109
+ // {
7110
+ // "code": 0,
7111
+ // "msg": "success"
7112
+ // }
7113
+ //
7108
7114
  }
7109
7115
  else if (market['linear']) {
7110
7116
  if (isPortfolioMargin) {
7111
7117
  if (isConditional) {
7112
7118
  response = await this.papiDeleteUmConditionalAllOpenOrders(this.extend(request, params));
7119
+ //
7120
+ // {
7121
+ // "code": "200",
7122
+ // "msg": "The operation of cancel all conditional open order is done."
7123
+ // }
7124
+ //
7113
7125
  }
7114
7126
  else {
7115
7127
  response = await this.papiDeleteUmAllOpenOrders(this.extend(request, params));
7128
+ //
7129
+ // {
7130
+ // "code": 200,
7131
+ // "msg": "The operation of cancel all open order is done."
7132
+ // }
7133
+ //
7116
7134
  }
7117
7135
  }
7118
7136
  else {
7119
7137
  response = await this.fapiPrivateDeleteAllOpenOrders(this.extend(request, params));
7138
+ //
7139
+ // {
7140
+ // "code": 200,
7141
+ // "msg": "The operation of cancel all open order is done."
7142
+ // }
7143
+ //
7120
7144
  }
7121
7145
  }
7122
7146
  else if (market['inverse']) {
7123
7147
  if (isPortfolioMargin) {
7124
7148
  if (isConditional) {
7125
7149
  response = await this.papiDeleteCmConditionalAllOpenOrders(this.extend(request, params));
7150
+ //
7151
+ // {
7152
+ // "code": "200",
7153
+ // "msg": "The operation of cancel all conditional open order is done."
7154
+ // }
7155
+ //
7126
7156
  }
7127
7157
  else {
7128
7158
  response = await this.papiDeleteCmAllOpenOrders(this.extend(request, params));
7159
+ //
7160
+ // {
7161
+ // "code": 200,
7162
+ // "msg": "The operation of cancel all open order is done."
7163
+ // }
7164
+ //
7129
7165
  }
7130
7166
  }
7131
7167
  else {
7132
7168
  response = await this.dapiPrivateDeleteAllOpenOrders(this.extend(request, params));
7169
+ //
7170
+ // {
7171
+ // "code": 200,
7172
+ // "msg": "The operation of cancel all open order is done."
7173
+ // }
7174
+ //
7133
7175
  }
7134
7176
  }
7135
7177
  else if ((type === 'margin') || (marginMode !== undefined) || isPortfolioMargin) {
@@ -7141,16 +7183,63 @@ export default class binance extends Exchange {
7141
7183
  request['isIsolated'] = true;
7142
7184
  }
7143
7185
  response = await this.sapiDeleteMarginOpenOrders(this.extend(request, params));
7186
+ //
7187
+ // [
7188
+ // {
7189
+ // "symbol": "BTCUSDT",
7190
+ // "isIsolated": true, // if isolated margin
7191
+ // "origClientOrderId": "E6APeyTJvkMvLMYMqu1KQ4",
7192
+ // "orderId": 11,
7193
+ // "orderListId": -1,
7194
+ // "clientOrderId": "pXLV6Hz6mprAcVYpVMTGgx",
7195
+ // "price": "0.089853",
7196
+ // "origQty": "0.178622",
7197
+ // "executedQty": "0.000000",
7198
+ // "cummulativeQuoteQty": "0.000000",
7199
+ // "status": "CANCELED",
7200
+ // "timeInForce": "GTC",
7201
+ // "type": "LIMIT",
7202
+ // "side": "BUY",
7203
+ // "selfTradePreventionMode": "NONE"
7204
+ // },
7205
+ // ...
7206
+ // ]
7207
+ //
7144
7208
  }
7145
7209
  }
7146
7210
  else {
7147
7211
  response = await this.privateDeleteOpenOrders(this.extend(request, params));
7212
+ //
7213
+ // [
7214
+ // {
7215
+ // "symbol": "ADAUSDT",
7216
+ // "origClientOrderId": "x-R4BD3S82662cde7a90114475b86e21",
7217
+ // "orderId": 3935107,
7218
+ // "orderListId": -1,
7219
+ // "clientOrderId": "bqM2w1oTlugfRAjnTIFBE8",
7220
+ // "transactTime": 1720589016657,
7221
+ // "price": "0.35000000",
7222
+ // "origQty": "30.00000000",
7223
+ // "executedQty": "0.00000000",
7224
+ // "cummulativeQuoteQty": "0.00000000",
7225
+ // "status": "CANCELED",
7226
+ // "timeInForce": "GTC",
7227
+ // "type": "LIMIT",
7228
+ // "side": "BUY",
7229
+ // "selfTradePreventionMode": "EXPIRE_MAKER"
7230
+ // }
7231
+ // ]
7232
+ //
7148
7233
  }
7149
7234
  if (Array.isArray(response)) {
7150
7235
  return this.parseOrders(response, market);
7151
7236
  }
7152
7237
  else {
7153
- return response;
7238
+ return [
7239
+ this.safeOrder({
7240
+ 'info': response,
7241
+ }),
7242
+ ];
7154
7243
  }
7155
7244
  }
7156
7245
  async cancelOrders(ids, symbol = undefined, params = {}) {