ccxt 4.1.98 → 4.1.100

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 (53) hide show
  1. package/README.md +101 -100
  2. package/dist/ccxt.browser.js +3162 -542
  3. package/dist/ccxt.browser.min.js +7 -7
  4. package/dist/cjs/ccxt.js +4 -1
  5. package/dist/cjs/src/abstract/bitteam.js +9 -0
  6. package/dist/cjs/src/base/Exchange.js +29 -0
  7. package/dist/cjs/src/bequant.js +1 -1
  8. package/dist/cjs/src/binance.js +84 -59
  9. package/dist/cjs/src/bingx.js +24 -7
  10. package/dist/cjs/src/bitget.js +98 -38
  11. package/dist/cjs/src/bitmart.js +71 -17
  12. package/dist/cjs/src/bitteam.js +2309 -0
  13. package/dist/cjs/src/bitvavo.js +52 -14
  14. package/dist/cjs/src/coinex.js +58 -21
  15. package/dist/cjs/src/kraken.js +21 -16
  16. package/dist/cjs/src/mexc.js +3 -3
  17. package/dist/cjs/src/okx.js +5 -4
  18. package/dist/cjs/src/pro/binance.js +1 -1
  19. package/dist/cjs/src/pro/bitget.js +1 -1
  20. package/dist/cjs/src/pro/bybit.js +1 -1
  21. package/dist/cjs/src/pro/kucoin.js +10 -2
  22. package/dist/cjs/src/pro/kucoinfutures.js +10 -2
  23. package/js/ccxt.d.ts +5 -2
  24. package/js/ccxt.js +4 -2
  25. package/js/src/abstract/binance.d.ts +16 -0
  26. package/js/src/abstract/binancecoinm.d.ts +16 -0
  27. package/js/src/abstract/binanceus.d.ts +16 -0
  28. package/js/src/abstract/binanceusdm.d.ts +16 -0
  29. package/js/src/abstract/bitteam.d.ts +32 -0
  30. package/js/src/abstract/bitteam.js +11 -0
  31. package/js/src/abstract/coinex.d.ts +14 -1
  32. package/js/src/base/Exchange.d.ts +4 -0
  33. package/js/src/base/Exchange.js +29 -0
  34. package/js/src/base/types.d.ts +1 -0
  35. package/js/src/bequant.js +1 -1
  36. package/js/src/binance.js +84 -59
  37. package/js/src/bingx.js +24 -7
  38. package/js/src/bitget.js +98 -38
  39. package/js/src/bitmart.js +71 -17
  40. package/js/src/bitteam.d.ts +46 -0
  41. package/js/src/bitteam.js +2310 -0
  42. package/js/src/bitvavo.js +52 -14
  43. package/js/src/coinex.js +58 -21
  44. package/js/src/kraken.js +21 -16
  45. package/js/src/mexc.js +3 -3
  46. package/js/src/okx.js +5 -4
  47. package/js/src/pro/binance.js +1 -1
  48. package/js/src/pro/bitget.js +1 -1
  49. package/js/src/pro/bybit.js +1 -1
  50. package/js/src/pro/kucoin.js +10 -2
  51. package/js/src/pro/kucoinfutures.js +10 -2
  52. package/package.json +1 -1
  53. package/skip-tests.json +13 -0
@@ -989,7 +989,7 @@ class bitvavo extends bitvavo$1 {
989
989
  * @method
990
990
  * @name bitvavo#createOrder
991
991
  * @description create a trade order
992
- * @see https://docs.bitvavo.com/#tag/Orders/paths/~1order/post
992
+ * @see https://docs.bitvavo.com/#tag/Trading-endpoints/paths/~1order/post
993
993
  * @param {string} symbol unified symbol of the market to create an order in
994
994
  * @param {string} type 'market' or 'limit'
995
995
  * @param {string} side 'buy' or 'sell'
@@ -1007,6 +1007,7 @@ class bitvavo extends bitvavo$1 {
1007
1007
  * @param {string} [params.selfTradePrevention] "decrementAndCancel", "cancelOldest", "cancelNewest", "cancelBoth"
1008
1008
  * @param {bool} [params.disableMarketProtection] don't cancel if the next fill price is 10% worse than the best fill price
1009
1009
  * @param {bool} [params.responseRequired] Set this to 'false' when only an acknowledgement of success or failure is required, this is faster.
1010
+ * @param {string} [params.clientOrderId] An ID supplied by the client that must be unique among all open orders for the same market
1010
1011
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
1011
1012
  */
1012
1013
  await this.loadMarkets();
@@ -1117,25 +1118,54 @@ class bitvavo extends bitvavo$1 {
1117
1118
  return this.parseOrder(response, market);
1118
1119
  }
1119
1120
  async editOrder(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
1121
+ /**
1122
+ * @method
1123
+ * @name bitvavo#editOrder
1124
+ * @description edit a trade order
1125
+ * @see https://docs.bitvavo.com/#tag/Trading-endpoints/paths/~1order/put
1126
+ * @param {string} symbol unified symbol of the market to create an order in
1127
+ * @param {string} type 'market' or 'limit'
1128
+ * @param {string} side 'buy' or 'sell'
1129
+ * @param {float} amount how much of currency you want to trade in units of base currency
1130
+ * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
1131
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1132
+ * @param {string} [params.timeInForce] "GTC", "IOC", or "PO"
1133
+ * @param {bool} [params.postOnly] If true, the order will only be posted to the order book and not executed immediately
1134
+ * @param {float} [params.stopPrice] The price at which a trigger order is triggered at
1135
+ * @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
1136
+ * @param {string} [params.selfTradePrevention] "decrementAndCancel", "cancelOldest", "cancelNewest", "cancelBoth"
1137
+ * @param {bool} [params.responseRequired] Set this to 'false' when only an acknowledgement of success or failure is required, this is faster.
1138
+ * @param {string} [params.clientOrderId] An ID supplied by the client
1139
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
1140
+ */
1120
1141
  await this.loadMarkets();
1121
1142
  const market = this.market(symbol);
1122
- let request = {};
1143
+ const request = {
1144
+ 'market': market['id'],
1145
+ };
1146
+ const clientOrderId = this.safeString(params, 'clientOrderId');
1147
+ if (clientOrderId === undefined) {
1148
+ request['orderId'] = id;
1149
+ }
1123
1150
  const amountRemaining = this.safeNumber(params, 'amountRemaining');
1124
- params = this.omit(params, 'amountRemaining');
1151
+ const triggerPrice = this.safeStringN(params, ['triggerPrice', 'stopPrice', 'triggerAmount']);
1152
+ params = this.omit(params, ['amountRemaining', 'triggerPrice', 'stopPrice', 'triggerAmount']);
1153
+ let updateRequest = {};
1125
1154
  if (price !== undefined) {
1126
- request['price'] = this.priceToPrecision(symbol, price);
1155
+ updateRequest['price'] = this.priceToPrecision(symbol, price);
1127
1156
  }
1128
1157
  if (amount !== undefined) {
1129
- request['amount'] = this.amountToPrecision(symbol, amount);
1158
+ updateRequest['amount'] = this.amountToPrecision(symbol, amount);
1130
1159
  }
1131
1160
  if (amountRemaining !== undefined) {
1132
- request['amountRemaining'] = this.amountToPrecision(symbol, amountRemaining);
1161
+ updateRequest['amountRemaining'] = this.amountToPrecision(symbol, amountRemaining);
1133
1162
  }
1134
- request = this.extend(request, params);
1135
- if (Object.keys(request).length) {
1136
- request['orderId'] = id;
1137
- request['market'] = market['id'];
1138
- const response = await this.privatePutOrder(this.extend(request, params));
1163
+ if (triggerPrice !== undefined) {
1164
+ updateRequest['triggerAmount'] = this.priceToPrecision(symbol, triggerPrice);
1165
+ }
1166
+ updateRequest = this.extend(updateRequest, params);
1167
+ if (Object.keys(updateRequest).length) {
1168
+ const response = await this.privatePutOrder(this.extend(request, updateRequest));
1139
1169
  return this.parseOrder(response, market);
1140
1170
  }
1141
1171
  else {
@@ -1147,6 +1177,7 @@ class bitvavo extends bitvavo$1 {
1147
1177
  * @method
1148
1178
  * @name bitvavo#cancelOrder
1149
1179
  * @description cancels an open order
1180
+ * @see https://docs.bitvavo.com/#tag/Trading-endpoints/paths/~1order/delete
1150
1181
  * @param {string} id order id
1151
1182
  * @param {string} symbol unified symbol of the market the order was made in
1152
1183
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -1158,9 +1189,12 @@ class bitvavo extends bitvavo$1 {
1158
1189
  await this.loadMarkets();
1159
1190
  const market = this.market(symbol);
1160
1191
  const request = {
1161
- 'orderId': id,
1162
1192
  'market': market['id'],
1163
1193
  };
1194
+ const clientOrderId = this.safeString(params, 'clientOrderId');
1195
+ if (clientOrderId === undefined) {
1196
+ request['orderId'] = id;
1197
+ }
1164
1198
  const response = await this.privateDeleteOrder(this.extend(request, params));
1165
1199
  //
1166
1200
  // {
@@ -1200,6 +1234,7 @@ class bitvavo extends bitvavo$1 {
1200
1234
  * @method
1201
1235
  * @name bitvavo#fetchOrder
1202
1236
  * @description fetches information on an order made by the user
1237
+ * @see https://docs.bitvavo.com/#tag/Trading-endpoints/paths/~1order/get
1203
1238
  * @param {string} symbol unified symbol of the market the order was made in
1204
1239
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1205
1240
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -1210,9 +1245,12 @@ class bitvavo extends bitvavo$1 {
1210
1245
  await this.loadMarkets();
1211
1246
  const market = this.market(symbol);
1212
1247
  const request = {
1213
- 'orderId': id,
1214
1248
  'market': market['id'],
1215
1249
  };
1250
+ const clientOrderId = this.safeString(params, 'clientOrderId');
1251
+ if (clientOrderId === undefined) {
1252
+ request['orderId'] = id;
1253
+ }
1216
1254
  const response = await this.privateGetOrder(this.extend(request, params));
1217
1255
  //
1218
1256
  // {
@@ -1254,7 +1292,7 @@ class bitvavo extends bitvavo$1 {
1254
1292
  /**
1255
1293
  * @method
1256
1294
  * @name bitvavo#fetchOrders
1257
- * @see https://docs.bitvavo.com/#tag/Orders/paths/~1orders/get
1295
+ * @see https://docs.bitvavo.com/#tag/Trading-endpoints/paths/~1orders/get
1258
1296
  * @description fetches information on multiple orders made by the user
1259
1297
  * @param {string} symbol unified market symbol of the market orders were made in
1260
1298
  * @param {int} [since] the earliest time in ms to fetch orders for
@@ -208,6 +208,8 @@ class coinex extends coinex$1 {
208
208
  },
209
209
  'put': {
210
210
  'balance/deposit/address/{coin_type}': 40,
211
+ 'sub_account/unfrozen': 40,
212
+ 'sub_account/frozen': 40,
211
213
  'sub_account/auth/api/{user_auth_id}': 40,
212
214
  'v1/account/settings': 40,
213
215
  },
@@ -217,7 +219,10 @@ class coinex extends coinex$1 {
217
219
  'order/pending': 13.334,
218
220
  'order/stop/pending': 40,
219
221
  'order/stop/pending/{id}': 13.334,
222
+ 'order/pending/by_client_id': 40,
223
+ 'order/stop/pending/by_client_id': 40,
220
224
  'sub_account/auth/api/{user_auth_id}': 40,
225
+ 'sub_account/authorize/{id}': 40,
221
226
  },
222
227
  },
223
228
  'perpetualPublic': {
@@ -231,12 +236,12 @@ class coinex extends coinex$1 {
231
236
  'market/depth': 1,
232
237
  'market/deals': 1,
233
238
  'market/funding_history': 1,
234
- 'market/user_deals': 1,
235
239
  'market/kline': 1,
236
240
  },
237
241
  },
238
242
  'perpetualPrivate': {
239
243
  'get': {
244
+ 'market/user_deals': 1,
240
245
  'asset/query': 40,
241
246
  'order/pending': 8,
242
247
  'order/finished': 40,
@@ -244,8 +249,13 @@ class coinex extends coinex$1 {
244
249
  'order/stop_pending': 8,
245
250
  'order/status': 8,
246
251
  'order/stop_status': 8,
252
+ 'position/finished': 40,
247
253
  'position/pending': 40,
248
254
  'position/funding': 40,
255
+ 'position/adl_history': 40,
256
+ 'market/preference': 40,
257
+ 'position/margin_history': 40,
258
+ 'position/settle_history': 40,
249
259
  },
250
260
  'post': {
251
261
  'market/adjust_leverage': 1,
@@ -267,6 +277,9 @@ class coinex extends coinex$1 {
267
277
  'position/stop_loss': 20,
268
278
  'position/take_profit': 20,
269
279
  'position/market_close': 20,
280
+ 'order/cancel/by_client_id': 20,
281
+ 'order/cancel_stop/by_client_id': 20,
282
+ 'market/preference': 20,
270
283
  },
271
284
  },
272
285
  },
@@ -1087,9 +1100,10 @@ class coinex extends coinex$1 {
1087
1100
  const priceString = this.safeString(trade, 'price');
1088
1101
  const amountString = this.safeString(trade, 'amount');
1089
1102
  const marketId = this.safeString(trade, 'market');
1090
- const defaultType = this.safeString(this.options, 'defaultType');
1103
+ const marketType = this.safeString(trade, 'market_type');
1104
+ const defaultType = (marketType === undefined) ? 'spot' : 'swap';
1091
1105
  market = this.safeMarket(marketId, market, undefined, defaultType);
1092
- const symbol = this.safeSymbol(marketId, market, undefined, defaultType);
1106
+ const symbol = market['symbol'];
1093
1107
  const costString = this.safeString(trade, 'deal_money');
1094
1108
  let fee = undefined;
1095
1109
  const feeCostString = this.safeString2(trade, 'fee', 'deal_fee');
@@ -2587,11 +2601,17 @@ class coinex extends coinex$1 {
2587
2601
  * @description cancels an open order
2588
2602
  * @see https://viabtc.github.io/coinex_api_en_doc/spot/#docsspot003_trade018_cancle_stop_pending_order
2589
2603
  * @see https://viabtc.github.io/coinex_api_en_doc/spot/#docsspot003_trade015_cancel_order
2604
+ * @see https://viabtc.github.io/coinex_api_en_doc/spot/#docsspot003_trade024_cancel_order_by_client_id
2605
+ * @see https://viabtc.github.io/coinex_api_en_doc/spot/#docsspot003_trade025_cancel_stop_order_by_client_id
2590
2606
  * @see https://viabtc.github.io/coinex_api_en_doc/futures/#docsfutures001_http023_cancel_stop_order
2591
2607
  * @see https://viabtc.github.io/coinex_api_en_doc/futures/#docsfutures001_http021_cancel_order
2608
+ * @see https://viabtc.github.io/coinex_api_en_doc/futures/#docsfutures001_http042_cancel_order_by_client_id
2609
+ * @see https://viabtc.github.io/coinex_api_en_doc/futures/#docsfutures001_http043_cancel_stop_order_by_client_id
2592
2610
  * @param {string} id order id
2593
2611
  * @param {string} symbol unified symbol of the market the order was made in
2594
2612
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2613
+ * @param {string} [params.clientOrderId] client order id, defaults to id if not passed
2614
+ * @param {boolean} [params.stop] if stop order = true, default = false
2595
2615
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2596
2616
  */
2597
2617
  if (symbol === undefined) {
@@ -2604,32 +2624,54 @@ class coinex extends coinex$1 {
2604
2624
  const request = {
2605
2625
  'market': market['id'],
2606
2626
  };
2607
- const idRequest = swap ? 'order_id' : 'id';
2608
- request[idRequest] = id;
2609
2627
  const accountId = this.safeInteger(params, 'account_id');
2610
2628
  const defaultType = this.safeString(this.options, 'defaultType');
2629
+ const clientOrderId = this.safeString2(params, 'client_id', 'clientOrderId');
2611
2630
  if (defaultType === 'margin') {
2612
2631
  if (accountId === undefined) {
2613
2632
  throw new errors.BadRequest(this.id + ' cancelOrder() requires an account_id parameter for margin orders');
2614
2633
  }
2615
2634
  request['account_id'] = accountId;
2616
2635
  }
2617
- const query = this.omit(params, ['stop', 'account_id']);
2636
+ const query = this.omit(params, ['stop', 'account_id', 'clientOrderId']);
2618
2637
  let response = undefined;
2619
- if (stop) {
2620
- if (swap) {
2621
- response = await this.perpetualPrivatePostOrderCancelStop(this.extend(request, query));
2638
+ if (clientOrderId !== undefined) {
2639
+ request['client_id'] = clientOrderId;
2640
+ if (stop) {
2641
+ if (swap) {
2642
+ response = await this.perpetualPrivatePostOrderCancelStopByClientId(this.extend(request, query));
2643
+ }
2644
+ else {
2645
+ response = await this.privateDeleteOrderStopPendingByClientId(this.extend(request, query));
2646
+ }
2622
2647
  }
2623
2648
  else {
2624
- response = await this.privateDeleteOrderStopPendingId(this.extend(request, query));
2649
+ if (swap) {
2650
+ response = await this.perpetualPrivatePostOrderCancelByClientId(this.extend(request, query));
2651
+ }
2652
+ else {
2653
+ response = await this.privateDeleteOrderPendingByClientId(this.extend(request, query));
2654
+ }
2625
2655
  }
2626
2656
  }
2627
2657
  else {
2628
- if (swap) {
2629
- response = await this.perpetualPrivatePostOrderCancel(this.extend(request, query));
2658
+ const idRequest = swap ? 'order_id' : 'id';
2659
+ request[idRequest] = id;
2660
+ if (stop) {
2661
+ if (swap) {
2662
+ response = await this.perpetualPrivatePostOrderCancelStop(this.extend(request, query));
2663
+ }
2664
+ else {
2665
+ response = await this.privateDeleteOrderStopPendingId(this.extend(request, query));
2666
+ }
2630
2667
  }
2631
2668
  else {
2632
- response = await this.privateDeleteOrderPending(this.extend(request, query));
2669
+ if (swap) {
2670
+ response = await this.perpetualPrivatePostOrderCancel(this.extend(request, query));
2671
+ }
2672
+ else {
2673
+ response = await this.privateDeleteOrderPending(this.extend(request, query));
2674
+ }
2633
2675
  }
2634
2676
  }
2635
2677
  //
@@ -3371,16 +3413,11 @@ class coinex extends coinex$1 {
3371
3413
  }
3372
3414
  let response = undefined;
3373
3415
  if (swap) {
3374
- const side = this.safeInteger(params, 'side');
3375
- if (side === undefined) {
3376
- throw new errors.ArgumentsRequired(this.id + ' fetchMyTrades() requires a side parameter for swap markets');
3377
- }
3378
3416
  if (since !== undefined) {
3379
3417
  request['start_time'] = since;
3380
3418
  }
3381
- request['side'] = side;
3382
- params = this.omit(params, 'side');
3383
- response = await this.perpetualPublicGetMarketUserDeals(this.extend(request, params));
3419
+ request['side'] = 0;
3420
+ response = await this.perpetualPrivateGetMarketUserDeals(this.extend(request, params));
3384
3421
  }
3385
3422
  else {
3386
3423
  request['page'] = 1;
@@ -5309,7 +5346,7 @@ class coinex extends coinex$1 {
5309
5346
  }
5310
5347
  }
5311
5348
  }
5312
- if (api === 'perpetualPrivate' || url === 'https://api.coinex.com/perpetual/v1/market/user_deals') {
5349
+ if (api === 'perpetualPrivate') {
5313
5350
  this.checkRequiredCredentials();
5314
5351
  query = this.extend({
5315
5352
  'access_id': this.apiKey,
@@ -1357,7 +1357,9 @@ class kraken extends kraken$1 {
1357
1357
  * @param {bool} [params.reduceOnly] *margin only* indicates if this order is to reduce the size of a position
1358
1358
  * @param {float} [params.stopLossPrice] *margin only* the price that a stop loss order is triggered at
1359
1359
  * @param {float} [params.takeProfitPrice] *margin only* the price that a take profit order is triggered at
1360
- * @param {string} [params.trailingStopPrice] *margin only* the quote amount to trail away from the current market price
1360
+ * @param {string} [params.trailingAmount] *margin only* the quote amount to trail away from the current market price
1361
+ * @param {string} [params.trailingLimitAmount] *margin only* the quote amount away from the trailingAmount
1362
+ * @param {string} [params.offset] *margin only* '+' or '-' whether you want the trailingLimitAmount value to be positive or negative, default is negative '-'
1361
1363
  * @param {string} [params.trigger] *margin only* the activation price type, 'last' or 'index', default is 'last'
1362
1364
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
1363
1365
  */
@@ -1618,9 +1620,10 @@ class kraken extends kraken$1 {
1618
1620
  const isStopLossTriggerOrder = stopLossTriggerPrice !== undefined;
1619
1621
  const isTakeProfitTriggerOrder = takeProfitTriggerPrice !== undefined;
1620
1622
  const isStopLossOrTakeProfitTrigger = isStopLossTriggerOrder || isTakeProfitTriggerOrder;
1621
- const trailingStopPrice = this.safeString(params, 'trailingStopPrice');
1622
- const isTrailingStopPriceOrder = trailingStopPrice !== undefined;
1623
- if (type === 'limit') {
1623
+ const trailingAmount = this.safeString(params, 'trailingAmount');
1624
+ const trailingLimitAmount = this.safeString(params, 'trailingLimitAmount');
1625
+ const isTrailingAmountOrder = trailingAmount !== undefined;
1626
+ if ((type === 'limit') && !isTrailingAmountOrder) {
1624
1627
  request['price'] = this.priceToPrecision(symbol, price);
1625
1628
  }
1626
1629
  let reduceOnly = this.safeValue2(params, 'reduceOnly', 'reduce_only');
@@ -1636,19 +1639,19 @@ class kraken extends kraken$1 {
1636
1639
  request['price2'] = this.priceToPrecision(symbol, price);
1637
1640
  reduceOnly = true;
1638
1641
  }
1639
- else if (isTrailingStopPriceOrder) {
1640
- const trailingStopActivationPriceType = this.safeString(params, 'trigger', 'last');
1641
- const trailingStopPriceString = '+' + trailingStopPrice;
1642
- request['trigger'] = trailingStopActivationPriceType;
1643
- reduceOnly = true;
1644
- if (type === 'limit') {
1645
- const trailingStopLimitPriceString = '+' + this.numberToString(price);
1646
- request['price'] = trailingStopPriceString;
1647
- request['price2'] = trailingStopLimitPriceString;
1642
+ else if (isTrailingAmountOrder) {
1643
+ const trailingActivationPriceType = this.safeString(params, 'trigger', 'last');
1644
+ const trailingAmountString = '+' + trailingAmount;
1645
+ request['trigger'] = trailingActivationPriceType;
1646
+ if ((type === 'limit') || (trailingLimitAmount !== undefined)) {
1647
+ const offset = this.safeString(params, 'offset', '-');
1648
+ const trailingLimitAmountString = offset + this.numberToString(trailingLimitAmount);
1649
+ request['price'] = trailingAmountString;
1650
+ request['price2'] = trailingLimitAmountString;
1648
1651
  request['ordertype'] = 'trailing-stop-limit';
1649
1652
  }
1650
1653
  else {
1651
- request['price'] = trailingStopPriceString;
1654
+ request['price'] = trailingAmountString;
1652
1655
  request['ordertype'] = 'trailing-stop';
1653
1656
  }
1654
1657
  }
@@ -1678,7 +1681,7 @@ class kraken extends kraken$1 {
1678
1681
  if (postOnly) {
1679
1682
  request['oflags'] = 'post';
1680
1683
  }
1681
- params = this.omit(params, ['timeInForce', 'reduceOnly', 'stopLossPrice', 'takeProfitPrice', 'trailingStopPrice']);
1684
+ params = this.omit(params, ['timeInForce', 'reduceOnly', 'stopLossPrice', 'takeProfitPrice', 'trailingAmount', 'trailingLimitAmount', 'offset']);
1682
1685
  return [request, params];
1683
1686
  }
1684
1687
  async editOrder(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
@@ -1696,7 +1699,9 @@ class kraken extends kraken$1 {
1696
1699
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1697
1700
  * @param {float} [params.stopLossPrice] *margin only* the price that a stop loss order is triggered at
1698
1701
  * @param {float} [params.takeProfitPrice] *margin only* the price that a take profit order is triggered at
1699
- * @param {string} [params.trailingStopPrice] *margin only* the quote price away from the current market price
1702
+ * @param {string} [params.trailingAmount] *margin only* the quote price away from the current market price
1703
+ * @param {string} [params.trailingLimitAmount] *margin only* the quote amount away from the trailingAmount
1704
+ * @param {string} [params.offset] *margin only* '+' or '-' whether you want the trailingLimitAmount value to be positive or negative, default is negative '-'
1700
1705
  * @param {string} [params.trigger] *margin only* the activation price type, 'last' or 'index', default is 'last'
1701
1706
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
1702
1707
  */
@@ -442,7 +442,7 @@ class mexc extends mexc$1 {
442
442
  'BCH': 'BCH',
443
443
  'TRC20': 'Tron(TRC20)',
444
444
  'ERC20': 'Ethereum(ERC20)',
445
- 'BEP20': 'BNBSmartChain(BEP20)',
445
+ 'BEP20': 'BNB Smart Chain(BEP20)',
446
446
  'OPTIMISM': 'Optimism(OP)',
447
447
  'SOL': 'Solana(SOL)',
448
448
  'CRC20': 'CRONOS',
@@ -1040,7 +1040,7 @@ class mexc extends mexc$1 {
1040
1040
  'Algorand(ALGO)': 'ALGO',
1041
1041
  'ArbitrumOne(ARB)': 'ARBONE',
1042
1042
  'AvalancheCChain(AVAXCCHAIN)': 'AVAXC',
1043
- 'BNBSmartChain(BEP20)': 'BEP20',
1043
+ 'BNB Smart Chain(BEP20)': 'BEP20',
1044
1044
  'Polygon(MATIC)': 'MATIC',
1045
1045
  'Optimism(OP)': 'OPTIMISM',
1046
1046
  'Solana(SOL)': 'SOL',
@@ -4353,8 +4353,8 @@ class mexc extends mexc$1 {
4353
4353
  /**
4354
4354
  * @method
4355
4355
  * @name mexc3#createDepositAddress
4356
- * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#generate-deposit-address-supporting-network
4357
4356
  * @description create a currency deposit address
4357
+ * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#generate-deposit-address-supporting-network
4358
4358
  * @param {string} code unified currency code of the currency for the deposit address
4359
4359
  * @param {object} [params] extra parameters specific to the exchange API endpoint
4360
4360
  * @param {string} [params.network] the blockchain network name
@@ -871,8 +871,8 @@ class okx extends okx$1 {
871
871
  'ALGO': 'Algorand',
872
872
  'BHP': 'BHP',
873
873
  'APT': 'Aptos',
874
- 'ARBONE': 'Arbitrum one',
875
- 'AVAXC': 'Avalanche C-Chain',
874
+ 'ARBONE': 'Arbitrum One',
875
+ 'AVAXC': 'Avalanche C',
876
876
  'AVAXX': 'Avalanche X-Chain',
877
877
  'ARK': 'ARK',
878
878
  'AR': 'Arweave',
@@ -4466,15 +4466,16 @@ class okx extends okx$1 {
4466
4466
  // },
4467
4467
  //
4468
4468
  if (chain === 'USDT-Polygon') {
4469
- networkData = this.safeValue(networksById, 'USDT-Polygon-Bridge');
4469
+ networkData = this.safeValue2(networksById, 'USDT-Polygon-Bridge', 'USDT-Polygon');
4470
4470
  }
4471
4471
  const network = this.safeString(networkData, 'network');
4472
+ const networkCode = this.networkIdToCode(network, code);
4472
4473
  this.checkAddress(address);
4473
4474
  return {
4474
4475
  'currency': code,
4475
4476
  'address': address,
4476
4477
  'tag': tag,
4477
- 'network': network,
4478
+ 'network': networkCode,
4478
4479
  'info': depositAddress,
4479
4480
  };
4480
4481
  }
@@ -19,7 +19,7 @@ class binance extends binance$1 {
19
19
  'watchBalance': true,
20
20
  'watchMyTrades': true,
21
21
  'watchOHLCV': true,
22
- 'watchOHLCVForSymbols': true,
22
+ 'watchOHLCVForSymbols': false,
23
23
  'watchOrderBook': true,
24
24
  'watchOrderBookForSymbols': true,
25
25
  'watchOrders': true,
@@ -28,7 +28,7 @@ class bitget extends bitget$1 {
28
28
  'watchBalance': true,
29
29
  'watchMyTrades': true,
30
30
  'watchOHLCV': true,
31
- 'watchOHLCVForSymbols': true,
31
+ 'watchOHLCVForSymbols': false,
32
32
  'watchOrderBook': true,
33
33
  'watchOrderBookForSymbols': true,
34
34
  'watchOrders': true,
@@ -24,7 +24,7 @@ class bybit extends bybit$1 {
24
24
  'watchBalance': true,
25
25
  'watchMyTrades': true,
26
26
  'watchOHLCV': true,
27
- 'watchOHLCVForSymbols': true,
27
+ 'watchOHLCVForSymbols': false,
28
28
  'watchOrderBook': true,
29
29
  'watchOrderBookForSymbols': true,
30
30
  'watchOrders': true,
@@ -50,8 +50,9 @@ class kucoin extends kucoin$1 {
50
50
  negotiate(privateChannel, params = {}) {
51
51
  const connectId = privateChannel ? 'private' : 'public';
52
52
  const urls = this.safeValue(this.options, 'urls', {});
53
- if (connectId in urls) {
54
- return urls[connectId];
53
+ const spawaned = this.safeValue(urls, connectId);
54
+ if (spawaned !== undefined) {
55
+ return spawaned;
55
56
  }
56
57
  // we store an awaitable to the url
57
58
  // so that multiple calls don't asynchronously
@@ -1022,6 +1023,13 @@ class kucoin extends kucoin$1 {
1022
1023
  // }
1023
1024
  //
1024
1025
  const data = this.safeString(message, 'data', '');
1026
+ if (data === 'token is expired') {
1027
+ let type = 'public';
1028
+ if (client.url.indexOf('connectId=private') >= 0) {
1029
+ type = 'private';
1030
+ }
1031
+ this.options['urls'][type] = undefined;
1032
+ }
1025
1033
  this.handleErrors(undefined, undefined, client.url, undefined, undefined, data, message, undefined, undefined);
1026
1034
  }
1027
1035
  handleMessage(client, message) {
@@ -60,8 +60,9 @@ class kucoinfutures extends kucoinfutures$1 {
60
60
  negotiate(privateChannel, params = {}) {
61
61
  const connectId = privateChannel ? 'private' : 'public';
62
62
  const urls = this.safeValue(this.options, 'urls', {});
63
- if (connectId in urls) {
64
- return urls[connectId];
63
+ const spawaned = this.safeValue(urls, connectId);
64
+ if (spawaned !== undefined) {
65
+ return spawaned;
65
66
  }
66
67
  // we store an awaitable to the url
67
68
  // so that multiple calls don't asynchronously
@@ -951,6 +952,13 @@ class kucoinfutures extends kucoinfutures$1 {
951
952
  // }
952
953
  //
953
954
  const data = this.safeString(message, 'data', '');
955
+ if (data === 'token is expired') {
956
+ let type = 'public';
957
+ if (client.url.indexOf('connectId=private') >= 0) {
958
+ type = 'private';
959
+ }
960
+ this.options['urls'][type] = undefined;
961
+ }
954
962
  this.handleErrors(undefined, undefined, client.url, undefined, undefined, data, message, undefined, undefined);
955
963
  }
956
964
  handleMessage(client, message) {
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 } from './src/base/types.js';
6
6
  import { BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange } from './src/base/errors.js';
7
- declare const version = "4.1.97";
7
+ declare const version = "4.1.99";
8
8
  import ace from './src/ace.js';
9
9
  import alpaca from './src/alpaca.js';
10
10
  import ascendex from './src/ascendex.js';
@@ -33,6 +33,7 @@ import bitpanda from './src/bitpanda.js';
33
33
  import bitrue from './src/bitrue.js';
34
34
  import bitso from './src/bitso.js';
35
35
  import bitstamp from './src/bitstamp.js';
36
+ import bitteam from './src/bitteam.js';
36
37
  import bitvavo from './src/bitvavo.js';
37
38
  import bl3p from './src/bl3p.js';
38
39
  import blockchaincom from './src/blockchaincom.js';
@@ -187,6 +188,7 @@ declare const exchanges: {
187
188
  bitrue: typeof bitrue;
188
189
  bitso: typeof bitso;
189
190
  bitstamp: typeof bitstamp;
191
+ bitteam: typeof bitteam;
190
192
  bitvavo: typeof bitvavo;
191
193
  bl3p: typeof bl3p;
192
194
  blockchaincom: typeof blockchaincom;
@@ -407,6 +409,7 @@ declare const ccxt: {
407
409
  bitrue: typeof bitrue;
408
410
  bitso: typeof bitso;
409
411
  bitstamp: typeof bitstamp;
412
+ bitteam: typeof bitteam;
410
413
  bitvavo: typeof bitvavo;
411
414
  bl3p: typeof bl3p;
412
415
  blockchaincom: typeof blockchaincom;
@@ -477,5 +480,5 @@ declare const ccxt: {
477
480
  zaif: typeof zaif;
478
481
  zonda: typeof zonda;
479
482
  } & typeof functions & typeof errors;
480
- export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange, Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position, FundingRateHistory, Liquidation, FundingHistory, MarginMode, Greeks, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitforex, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitvavo, bl3p, blockchaincom, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbasepro, coincheck, coinex, coinlist, coinmate, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, p2b, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, upbit, wavesexchange, wazirx, whitebit, woo, yobit, zaif, zonda, };
483
+ export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange, Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position, FundingRateHistory, Liquidation, FundingHistory, MarginMode, Greeks, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitforex, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbasepro, coincheck, coinex, coinlist, coinmate, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, p2b, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, upbit, wavesexchange, wazirx, whitebit, woo, yobit, zaif, zonda, };
481
484
  export default ccxt;
package/js/ccxt.js CHANGED
@@ -38,7 +38,7 @@ import * as errors from './src/base/errors.js';
38
38
  import { BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange } from './src/base/errors.js';
39
39
  //-----------------------------------------------------------------------------
40
40
  // this is updated by vss.js when building
41
- const version = '4.1.98';
41
+ const version = '4.1.100';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import ace from './src/ace.js';
@@ -69,6 +69,7 @@ import bitpanda from './src/bitpanda.js';
69
69
  import bitrue from './src/bitrue.js';
70
70
  import bitso from './src/bitso.js';
71
71
  import bitstamp from './src/bitstamp.js';
72
+ import bitteam from './src/bitteam.js';
72
73
  import bitvavo from './src/bitvavo.js';
73
74
  import bl3p from './src/bl3p.js';
74
75
  import blockchaincom from './src/blockchaincom.js';
@@ -224,6 +225,7 @@ const exchanges = {
224
225
  'bitrue': bitrue,
225
226
  'bitso': bitso,
226
227
  'bitstamp': bitstamp,
228
+ 'bitteam': bitteam,
227
229
  'bitvavo': bitvavo,
228
230
  'bl3p': bl3p,
229
231
  'blockchaincom': blockchaincom,
@@ -364,6 +366,6 @@ pro.exchanges = Object.keys(pro);
364
366
  pro['Exchange'] = Exchange; // now the same for rest and ts
365
367
  //-----------------------------------------------------------------------------
366
368
  const ccxt = Object.assign({ version, Exchange, Precise, 'exchanges': Object.keys(exchanges), 'pro': pro }, exchanges, functions, errors);
367
- export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitforex, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitvavo, bl3p, blockchaincom, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbasepro, coincheck, coinex, coinlist, coinmate, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, p2b, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, upbit, wavesexchange, wazirx, whitebit, woo, yobit, zaif, zonda, };
369
+ export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitforex, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbasepro, coincheck, coinex, coinlist, coinmate, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, p2b, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, upbit, wavesexchange, wazirx, whitebit, woo, yobit, zaif, zonda, };
368
370
  export default ccxt;
369
371
  //-----------------------------------------------------------------------------