ccxt 4.2.77 → 4.2.78

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/ccxt.js CHANGED
@@ -181,7 +181,7 @@ var woo$1 = require('./src/pro/woo.js');
181
181
 
182
182
  //-----------------------------------------------------------------------------
183
183
  // this is updated by vss.js when building
184
- const version = '4.2.77';
184
+ const version = '4.2.78';
185
185
  Exchange["default"].ccxtVersion = version;
186
186
  const exchanges = {
187
187
  'ace': ace,
@@ -8090,11 +8090,15 @@ class bybit extends bybit$1 {
8090
8090
  const tier = info[i];
8091
8091
  const marketId = this.safeString(info, 'symbol');
8092
8092
  market = this.safeMarket(marketId);
8093
+ let minNotional = this.parseNumber('0');
8094
+ if (i !== 0) {
8095
+ minNotional = this.safeNumber(info[i - 1], 'riskLimitValue');
8096
+ }
8093
8097
  tiers.push({
8094
8098
  'tier': this.safeInteger(tier, 'id'),
8095
8099
  'currency': market['settle'],
8096
- 'minNotional': undefined,
8097
- 'maxNotional': undefined,
8100
+ 'minNotional': minNotional,
8101
+ 'maxNotional': this.safeNumber(tier, 'riskLimitValue'),
8098
8102
  'maintenanceMarginRate': this.safeNumber(tier, 'maintenanceMargin'),
8099
8103
  'maxLeverage': this.safeNumber(tier, 'maxLeverage'),
8100
8104
  'info': tier,
@@ -1069,7 +1069,10 @@ class coinbase extends coinbase$1 {
1069
1069
  * @returns {object[]} an array of objects representing market data
1070
1070
  */
1071
1071
  const method = this.safeString(this.options, 'fetchMarkets', 'fetchMarketsV3');
1072
- return await this[method](params);
1072
+ if (method === 'fetchMarketsV3') {
1073
+ return await this.fetchMarketsV3(params);
1074
+ }
1075
+ return await this.fetchMarketsV2(params);
1073
1076
  }
1074
1077
  async fetchMarketsV2(params = {}) {
1075
1078
  const response = await this.fetchCurrenciesFromCache(params);
@@ -1144,7 +1147,13 @@ class coinbase extends coinbase$1 {
1144
1147
  return result;
1145
1148
  }
1146
1149
  async fetchMarketsV3(params = {}) {
1147
- const response = await this.v3PrivateGetBrokerageProducts(params);
1150
+ const promisesUnresolved = [
1151
+ this.v3PrivateGetBrokerageProducts(params),
1152
+ this.v3PrivateGetBrokerageTransactionSummary(params),
1153
+ ];
1154
+ // const response = await this.v3PrivateGetBrokerageProducts (params);
1155
+ const promises = await Promise.all(promisesUnresolved);
1156
+ const response = this.safeDict(promises, 0, {});
1148
1157
  //
1149
1158
  // [
1150
1159
  // {
@@ -1179,7 +1188,8 @@ class coinbase extends coinbase$1 {
1179
1188
  // ...
1180
1189
  // ]
1181
1190
  //
1182
- const fees = await this.v3PrivateGetBrokerageTransactionSummary(params);
1191
+ // const fees = await this.v3PrivateGetBrokerageTransactionSummary (params);
1192
+ const fees = this.safeDict(promises, 1, {});
1183
1193
  //
1184
1194
  // {
1185
1195
  // "total_volume": 0,
@@ -1896,6 +1906,9 @@ class coinbase extends coinbase$1 {
1896
1906
  const response = await this.v2PrivateGetAccountsAccountIdTransactions(this.extend(request, params));
1897
1907
  const ledger = this.parseLedger(response['data'], currency, since, limit);
1898
1908
  const length = ledger.length;
1909
+ if (length === 0) {
1910
+ return ledger;
1911
+ }
1899
1912
  const lastIndex = length - 1;
1900
1913
  const last = this.safeDict(ledger, lastIndex);
1901
1914
  const pagination = this.safeDict(response, 'pagination', {});
@@ -2235,9 +2248,9 @@ class coinbase extends coinbase$1 {
2235
2248
  'fee': fee,
2236
2249
  };
2237
2250
  }
2238
- async findAccountId(code) {
2251
+ async findAccountId(code, params = {}) {
2239
2252
  await this.loadMarkets();
2240
- await this.loadAccounts();
2253
+ await this.loadAccounts(false, params);
2241
2254
  for (let i = 0; i < this.accounts.length; i++) {
2242
2255
  const account = this.accounts[i];
2243
2256
  if (account['code'] === code) {
@@ -2266,7 +2279,7 @@ class coinbase extends coinbase$1 {
2266
2279
  if (code === undefined) {
2267
2280
  throw new errors.ArgumentsRequired(this.id + ' prepareAccountRequestWithCurrencyCode() method requires an account_id (or accountId) parameter OR a currency code argument');
2268
2281
  }
2269
- accountId = await this.findAccountId(code);
2282
+ accountId = await this.findAccountId(code, params);
2270
2283
  if (accountId === undefined) {
2271
2284
  throw new errors.ExchangeError(this.id + ' prepareAccountRequestWithCurrencyCode() could not find account id for ' + code);
2272
2285
  }
@@ -3410,7 +3423,7 @@ class coinbase extends coinbase$1 {
3410
3423
  if (code === undefined) {
3411
3424
  throw new errors.ArgumentsRequired(this.id + ' withdraw() requires an account_id (or accountId) parameter OR a currency code argument');
3412
3425
  }
3413
- accountId = await this.findAccountId(code);
3426
+ accountId = await this.findAccountId(code, params);
3414
3427
  if (accountId === undefined) {
3415
3428
  throw new errors.ExchangeError(this.id + ' withdraw() could not find account id for ' + code);
3416
3429
  }
@@ -3635,7 +3648,7 @@ class coinbase extends coinbase$1 {
3635
3648
  if (code === undefined) {
3636
3649
  throw new errors.ArgumentsRequired(this.id + ' deposit() requires an account_id (or accountId) parameter OR a currency code argument');
3637
3650
  }
3638
- accountId = await this.findAccountId(code);
3651
+ accountId = await this.findAccountId(code, params);
3639
3652
  if (accountId === undefined) {
3640
3653
  throw new errors.ExchangeError(this.id + ' deposit() could not find account id for ' + code);
3641
3654
  }
@@ -3705,7 +3718,7 @@ class coinbase extends coinbase$1 {
3705
3718
  if (code === undefined) {
3706
3719
  throw new errors.ArgumentsRequired(this.id + ' fetchDeposit() requires an account_id (or accountId) parameter OR a currency code argument');
3707
3720
  }
3708
- accountId = await this.findAccountId(code);
3721
+ accountId = await this.findAccountId(code, params);
3709
3722
  if (accountId === undefined) {
3710
3723
  throw new errors.ExchangeError(this.id + ' fetchDeposit() could not find account id for ' + code);
3711
3724
  }
@@ -49,6 +49,7 @@ class gate extends gate$1 {
49
49
  'rebate': 'https://api.gateio.ws/api/v4',
50
50
  'earn': 'https://api.gateio.ws/api/v4',
51
51
  'account': 'https://api.gateio.ws/api/v4',
52
+ 'loan': 'https://api.gateio.ws/api/v4',
52
53
  },
53
54
  },
54
55
  'test': {
@@ -2977,42 +2977,47 @@ class htx extends htx$1 {
2977
2977
  // 'from': parseInt ((since / 1000).toString ()), spot only
2978
2978
  // 'to': this.seconds (), spot only
2979
2979
  };
2980
- const price = this.safeString(params, 'price');
2981
- params = this.omit(params, 'price');
2980
+ const priceType = this.safeStringN(params, ['priceType', 'price']);
2981
+ params = this.omit(params, ['priceType', 'price']);
2982
+ let until = undefined;
2983
+ [until, params] = this.handleParamInteger(params, 'until');
2984
+ const untilSeconds = (until !== undefined) ? this.parseToInt(until / 1000) : undefined;
2982
2985
  if (market['contract']) {
2983
2986
  if (limit !== undefined) {
2984
- request['size'] = limit; // when using limit from and to are ignored
2987
+ request['size'] = limit; // when using limit: from & to are ignored
2985
2988
  // https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-get-kline-data
2986
2989
  }
2987
2990
  else {
2988
2991
  limit = 2000; // only used for from/to calculation
2989
2992
  }
2990
- if (price === undefined) {
2993
+ if (priceType === undefined) {
2991
2994
  const duration = this.parseTimeframe(timeframe);
2995
+ let calcualtedEnd = undefined;
2992
2996
  if (since === undefined) {
2993
2997
  const now = this.seconds();
2994
2998
  request['from'] = now - duration * (limit - 1);
2995
- request['to'] = now;
2999
+ calcualtedEnd = now;
2996
3000
  }
2997
3001
  else {
2998
3002
  const start = this.parseToInt(since / 1000);
2999
3003
  request['from'] = start;
3000
- request['to'] = this.sum(start, duration * (limit - 1));
3004
+ calcualtedEnd = this.sum(start, duration * (limit - 1));
3001
3005
  }
3006
+ request['to'] = (untilSeconds !== undefined) ? untilSeconds : calcualtedEnd;
3002
3007
  }
3003
3008
  }
3004
3009
  let response = undefined;
3005
3010
  if (market['future']) {
3006
3011
  if (market['inverse']) {
3007
3012
  request['symbol'] = market['id'];
3008
- if (price === 'mark') {
3013
+ if (priceType === 'mark') {
3009
3014
  response = await this.contractPublicGetIndexMarketHistoryMarkPriceKline(this.extend(request, params));
3010
3015
  }
3011
- else if (price === 'index') {
3016
+ else if (priceType === 'index') {
3012
3017
  response = await this.contractPublicGetIndexMarketHistoryIndex(this.extend(request, params));
3013
3018
  }
3014
- else if (price === 'premiumIndex') {
3015
- throw new errors.BadRequest(this.id + ' ' + market['type'] + ' has no api endpoint for ' + price + ' kline data');
3019
+ else if (priceType === 'premiumIndex') {
3020
+ throw new errors.BadRequest(this.id + ' ' + market['type'] + ' has no api endpoint for ' + priceType + ' kline data');
3016
3021
  }
3017
3022
  else {
3018
3023
  response = await this.contractPublicGetMarketHistoryKline(this.extend(request, params));
@@ -3020,13 +3025,13 @@ class htx extends htx$1 {
3020
3025
  }
3021
3026
  else if (market['linear']) {
3022
3027
  request['contract_code'] = market['id'];
3023
- if (price === 'mark') {
3028
+ if (priceType === 'mark') {
3024
3029
  response = await this.contractPublicGetIndexMarketHistoryLinearSwapMarkPriceKline(this.extend(request, params));
3025
3030
  }
3026
- else if (price === 'index') {
3027
- throw new errors.BadRequest(this.id + ' ' + market['type'] + ' has no api endpoint for ' + price + ' kline data');
3031
+ else if (priceType === 'index') {
3032
+ throw new errors.BadRequest(this.id + ' ' + market['type'] + ' has no api endpoint for ' + priceType + ' kline data');
3028
3033
  }
3029
- else if (price === 'premiumIndex') {
3034
+ else if (priceType === 'premiumIndex') {
3030
3035
  response = await this.contractPublicGetIndexMarketHistoryLinearSwapPremiumIndexKline(this.extend(request, params));
3031
3036
  }
3032
3037
  else {
@@ -3037,13 +3042,13 @@ class htx extends htx$1 {
3037
3042
  else if (market['swap']) {
3038
3043
  request['contract_code'] = market['id'];
3039
3044
  if (market['inverse']) {
3040
- if (price === 'mark') {
3045
+ if (priceType === 'mark') {
3041
3046
  response = await this.contractPublicGetIndexMarketHistorySwapMarkPriceKline(this.extend(request, params));
3042
3047
  }
3043
- else if (price === 'index') {
3044
- throw new errors.BadRequest(this.id + ' ' + market['type'] + ' has no api endpoint for ' + price + ' kline data');
3048
+ else if (priceType === 'index') {
3049
+ throw new errors.BadRequest(this.id + ' ' + market['type'] + ' has no api endpoint for ' + priceType + ' kline data');
3045
3050
  }
3046
- else if (price === 'premiumIndex') {
3051
+ else if (priceType === 'premiumIndex') {
3047
3052
  response = await this.contractPublicGetIndexMarketHistorySwapPremiumIndexKline(this.extend(request, params));
3048
3053
  }
3049
3054
  else {
@@ -3051,13 +3056,13 @@ class htx extends htx$1 {
3051
3056
  }
3052
3057
  }
3053
3058
  else if (market['linear']) {
3054
- if (price === 'mark') {
3059
+ if (priceType === 'mark') {
3055
3060
  response = await this.contractPublicGetIndexMarketHistoryLinearSwapMarkPriceKline(this.extend(request, params));
3056
3061
  }
3057
- else if (price === 'index') {
3058
- throw new errors.BadRequest(this.id + ' ' + market['type'] + ' has no api endpoint for ' + price + ' kline data');
3062
+ else if (priceType === 'index') {
3063
+ throw new errors.BadRequest(this.id + ' ' + market['type'] + ' has no api endpoint for ' + priceType + ' kline data');
3059
3064
  }
3060
- else if (price === 'premiumIndex') {
3065
+ else if (priceType === 'premiumIndex') {
3061
3066
  response = await this.contractPublicGetIndexMarketHistoryLinearSwapPremiumIndexKline(this.extend(request, params));
3062
3067
  }
3063
3068
  else {
@@ -3070,18 +3075,22 @@ class htx extends htx$1 {
3070
3075
  let useHistorical = undefined;
3071
3076
  [useHistorical, params] = this.handleOptionAndParams(params, 'fetchOHLCV', 'useHistoricalEndpointForSpot', true);
3072
3077
  if (!useHistorical) {
3073
- // `limit` only available for the this endpoint
3074
3078
  if (limit !== undefined) {
3075
- request['size'] = limit; // max 2000
3079
+ request['size'] = Math.min(2000, limit); // max 2000
3076
3080
  }
3077
3081
  response = await this.spotPublicGetMarketHistoryKline(this.extend(request, params));
3078
3082
  }
3079
3083
  else {
3080
- // `since` only available for the this endpoint
3084
+ // "from & to" only available for the this endpoint
3081
3085
  if (since !== undefined) {
3082
- // default 150 bars
3083
3086
  request['from'] = this.parseToInt(since / 1000);
3084
3087
  }
3088
+ if (untilSeconds !== undefined) {
3089
+ request['to'] = untilSeconds;
3090
+ }
3091
+ if (limit !== undefined) {
3092
+ request['size'] = Math.min(1000, limit); // max 1000, otherwise default returns 150
3093
+ }
3085
3094
  response = await this.spotPublicGetMarketHistoryCandles(this.extend(request, params));
3086
3095
  }
3087
3096
  }
@@ -3097,7 +3106,7 @@ class htx extends htx$1 {
3097
3106
  // ]
3098
3107
  // }
3099
3108
  //
3100
- const data = this.safeValue(response, 'data', []);
3109
+ const data = this.safeList(response, 'data', []);
3101
3110
  return this.parseOHLCVs(data, market, timeframe, since, limit);
3102
3111
  }
3103
3112
  async fetchAccounts(params = {}) {
@@ -761,8 +761,9 @@ class hyperliquid extends hyperliquid$1 {
761
761
  * @param {bool} [params.postOnly] true or false whether the order is post-only
762
762
  * @param {bool} [params.reduceOnly] true or false whether the order is reduce-only
763
763
  * @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
764
- * @param {string} [params.clientOrderId] client order id, optional 128 bit hex string
764
+ * @param {string} [params.clientOrderId] client order id, (optional 128 bit hex string e.g. 0x1234567890abcdef1234567890abcdef)
765
765
  * @param {string} [params.slippage] the slippage for market order
766
+ * @param {string} [params.vaultAddress] the vault address for order
766
767
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
767
768
  */
768
769
  await this.loadMarkets();
@@ -812,7 +813,7 @@ class hyperliquid extends hyperliquid$1 {
812
813
  }
813
814
  }
814
815
  }
815
- params = this.omit(params, ['slippage', 'clientOrderId', 'client_id', 'slippage', 'triggerPrice', 'stopPrice', 'stopLossPrice', 'takeProfitPrice']);
816
+ params = this.omit(params, ['slippage', 'clientOrderId', 'client_id', 'slippage', 'triggerPrice', 'stopPrice', 'stopLossPrice', 'takeProfitPrice', 'timeInForce']);
816
817
  const nonce = this.milliseconds();
817
818
  const orderReq = [];
818
819
  for (let i = 0; i < orders.length; i++) {
@@ -939,7 +940,7 @@ class hyperliquid extends hyperliquid$1 {
939
940
  * @param {string} id order id
940
941
  * @param {string} symbol unified symbol of the market the order was made in
941
942
  * @param {object} [params] extra parameters specific to the exchange API endpoint
942
- * @param {string} [params.clientOrderId] client order id (default undefined)
943
+ * @param {string} [params.clientOrderId] client order id, (optional 128 bit hex string e.g. 0x1234567890abcdef1234567890abcdef)
943
944
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
944
945
  */
945
946
  return await this.cancelOrders([id], symbol, params);
@@ -954,7 +955,7 @@ class hyperliquid extends hyperliquid$1 {
954
955
  * @param {string[]} ids order ids
955
956
  * @param {string} [symbol] unified market symbol
956
957
  * @param {object} [params] extra parameters specific to the exchange API endpoint
957
- * @param {string|string[]} [params.clientOrderId] client order ids (default undefined)
958
+ * @param {string|string[]} [params.clientOrderId] client order ids, (optional 128 bit hex string e.g. 0x1234567890abcdef1234567890abcdef)
958
959
  * @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
959
960
  */
960
961
  this.checkRequiredCredentials();
@@ -1037,6 +1038,7 @@ class hyperliquid extends hyperliquid$1 {
1037
1038
  * @param {bool} [params.reduceOnly] true or false whether the order is reduce-only
1038
1039
  * @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
1039
1040
  * @param {string} [params.clientOrderId] client order id, (optional 128 bit hex string e.g. 0x1234567890abcdef1234567890abcdef)
1041
+ * @param {string} [params.vaultAddress] the vault address for order
1040
1042
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
1041
1043
  */
1042
1044
  this.checkRequiredCredentials();
@@ -446,6 +446,56 @@ class kucoin extends kucoin$1 {
446
446
  '130202': errors.ExchangeError,
447
447
  '130203': errors.InsufficientFunds,
448
448
  '130204': errors.BadRequest,
449
+ '130301': errors.InsufficientFunds,
450
+ '130302': errors.PermissionDenied,
451
+ '130303': errors.NotSupported,
452
+ '130304': errors.NotSupported,
453
+ '130305': errors.NotSupported,
454
+ '130306': errors.NotSupported,
455
+ '130307': errors.NotSupported,
456
+ '130308': errors.InvalidOrder,
457
+ '130309': errors.InvalidOrder,
458
+ '130310': errors.ExchangeError,
459
+ '130311': errors.InvalidOrder,
460
+ '130312': errors.InvalidOrder,
461
+ '130313': errors.InvalidOrder,
462
+ '130314': errors.InvalidOrder,
463
+ '130315': errors.NotSupported,
464
+ '126000': errors.ExchangeError,
465
+ '126001': errors.NotSupported,
466
+ '126002': errors.ExchangeError,
467
+ '126003': errors.InvalidOrder,
468
+ '126004': errors.ExchangeError,
469
+ '126005': errors.PermissionDenied,
470
+ '126006': errors.ExchangeError,
471
+ '126007': errors.ExchangeError,
472
+ '126009': errors.ExchangeError,
473
+ '126010': errors.ExchangeError,
474
+ '126011': errors.ExchangeError,
475
+ '126013': errors.InsufficientFunds,
476
+ '126015': errors.ExchangeError,
477
+ '126021': errors.NotSupported,
478
+ '126022': errors.InvalidOrder,
479
+ '126027': errors.InvalidOrder,
480
+ '126028': errors.InvalidOrder,
481
+ '126029': errors.InvalidOrder,
482
+ '126030': errors.InvalidOrder,
483
+ '126033': errors.InvalidOrder,
484
+ '126034': errors.InvalidOrder,
485
+ '126036': errors.InvalidOrder,
486
+ '126037': errors.ExchangeError,
487
+ '126038': errors.ExchangeError,
488
+ '126039': errors.ExchangeError,
489
+ '126041': errors.ExchangeError,
490
+ '126042': errors.ExchangeError,
491
+ '126043': errors.OrderNotFound,
492
+ '126044': errors.InvalidOrder,
493
+ '126045': errors.NotSupported,
494
+ '126046': errors.NotSupported,
495
+ '126047': errors.PermissionDenied,
496
+ '126048': errors.PermissionDenied,
497
+ '135005': errors.ExchangeError,
498
+ '135018': errors.ExchangeError,
449
499
  '200004': errors.InsufficientFunds,
450
500
  '210014': errors.InvalidOrder,
451
501
  '210021': errors.InsufficientFunds,
@@ -467,10 +517,12 @@ class kucoin extends kucoin$1 {
467
517
  '400350': errors.InvalidOrder,
468
518
  '400370': errors.InvalidOrder,
469
519
  '400400': errors.BadRequest,
520
+ '400401': errors.AuthenticationError,
470
521
  '400500': errors.InvalidOrder,
471
522
  '400600': errors.BadSymbol,
472
523
  '400760': errors.InvalidOrder,
473
524
  '401000': errors.BadRequest,
525
+ '408000': errors.BadRequest,
474
526
  '411100': errors.AccountSuspended,
475
527
  '415000': errors.BadRequest,
476
528
  '400303': errors.PermissionDenied,
@@ -245,6 +245,16 @@ class okcoin extends okcoin$1 {
245
245
  '50026': errors.ExchangeNotAvailable,
246
246
  '50027': errors.PermissionDenied,
247
247
  '50028': errors.ExchangeError,
248
+ '50029': errors.ExchangeError,
249
+ '50030': errors.PermissionDenied,
250
+ '50032': errors.AccountSuspended,
251
+ '50033': errors.AccountSuspended,
252
+ '50035': errors.BadRequest,
253
+ '50036': errors.BadRequest,
254
+ '50037': errors.BadRequest,
255
+ '50038': errors.ExchangeError,
256
+ '50039': errors.ExchangeError,
257
+ '50041': errors.ExchangeError,
248
258
  '50044': errors.BadRequest,
249
259
  // API Class
250
260
  '50100': errors.ExchangeError,
@@ -288,9 +298,25 @@ class okcoin extends okcoin$1 {
288
298
  '51024': errors.AccountSuspended,
289
299
  '51025': errors.ExchangeError,
290
300
  '51026': errors.BadSymbol,
301
+ '51030': errors.InvalidOrder,
302
+ '51031': errors.InvalidOrder,
303
+ '51032': errors.InvalidOrder,
304
+ '51033': errors.InvalidOrder,
305
+ '51037': errors.InvalidOrder,
306
+ '51038': errors.InvalidOrder,
307
+ '51044': errors.InvalidOrder,
291
308
  '51046': errors.InvalidOrder,
292
309
  '51047': errors.InvalidOrder,
293
- '51031': errors.InvalidOrder,
310
+ '51048': errors.InvalidOrder,
311
+ '51049': errors.InvalidOrder,
312
+ '51050': errors.InvalidOrder,
313
+ '51051': errors.InvalidOrder,
314
+ '51052': errors.InvalidOrder,
315
+ '51053': errors.InvalidOrder,
316
+ '51054': errors.BadRequest,
317
+ '51056': errors.InvalidOrder,
318
+ '51058': errors.InvalidOrder,
319
+ '51059': errors.InvalidOrder,
294
320
  '51100': errors.InvalidOrder,
295
321
  '51102': errors.InvalidOrder,
296
322
  '51103': errors.InvalidOrder,
@@ -573,6 +573,7 @@ class okx extends okx$1 {
573
573
  '50027': errors.PermissionDenied,
574
574
  '50028': errors.ExchangeError,
575
575
  '50044': errors.BadRequest,
576
+ '50061': errors.ExchangeError,
576
577
  '50062': errors.ExchangeError,
577
578
  // API Class
578
579
  '50100': errors.ExchangeError,
@@ -760,6 +761,15 @@ class okx extends okx$1 {
760
761
  // SPOT/MARGIN error codes 54000-54999
761
762
  '54000': errors.ExchangeError,
762
763
  '54001': errors.ExchangeError,
764
+ // Trading bot Error Code from 55100 to 55999
765
+ '55100': errors.InvalidOrder,
766
+ '55101': errors.InvalidOrder,
767
+ '55102': errors.InvalidOrder,
768
+ '55103': errors.InvalidOrder,
769
+ '55104': errors.InvalidOrder,
770
+ '55111': errors.InvalidOrder,
771
+ '55112': errors.InvalidOrder,
772
+ '55113': errors.InvalidOrder,
763
773
  // FUNDING error codes 58000-58999
764
774
  '58000': errors.ExchangeError,
765
775
  '58001': errors.AuthenticationError,
@@ -5021,6 +5031,14 @@ class okx extends okx$1 {
5021
5031
  '3': 'pending',
5022
5032
  '4': 'pending',
5023
5033
  '5': 'pending',
5034
+ '6': 'pending',
5035
+ '7': 'pending',
5036
+ '8': 'pending',
5037
+ '9': 'pending',
5038
+ '10': 'pending',
5039
+ '12': 'pending',
5040
+ '15': 'pending',
5041
+ '16': 'pending',
5024
5042
  };
5025
5043
  return this.safeString(statuses, status, status);
5026
5044
  }
@@ -56,7 +56,7 @@ class woo extends woo$1 {
56
56
  'fetchBalance': true,
57
57
  'fetchCanceledOrders': false,
58
58
  'fetchClosedOrder': false,
59
- 'fetchClosedOrders': false,
59
+ 'fetchClosedOrders': true,
60
60
  'fetchCurrencies': true,
61
61
  'fetchDepositAddress': true,
62
62
  'fetchDeposits': true,
@@ -75,7 +75,7 @@ class woo extends woo$1 {
75
75
  'fetchOHLCV': true,
76
76
  'fetchOpenInterestHistory': false,
77
77
  'fetchOpenOrder': false,
78
- 'fetchOpenOrders': false,
78
+ 'fetchOpenOrders': true,
79
79
  'fetchOrder': true,
80
80
  'fetchOrderBook': true,
81
81
  'fetchOrders': true,
@@ -1445,7 +1445,51 @@ class woo extends woo$1 {
1445
1445
  //
1446
1446
  const data = this.safeValue(response, 'data', response);
1447
1447
  const orders = this.safeList(data, 'rows');
1448
- return this.parseOrders(orders, market, since, limit, params);
1448
+ return this.parseOrders(orders, market, since, limit);
1449
+ }
1450
+ async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
1451
+ /**
1452
+ * @method
1453
+ * @name woo#fetchOpenOrders
1454
+ * @description fetches information on multiple orders made by the user
1455
+ * @see https://docs.woo.org/#get-orders
1456
+ * @see https://docs.woo.org/#get-algo-orders
1457
+ * @param {string} symbol unified market symbol of the market orders were made in
1458
+ * @param {int} [since] the earliest time in ms to fetch orders for
1459
+ * @param {int} [limit] the maximum number of order structures to retrieve
1460
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1461
+ * @param {boolean} [params.stop] whether the order is a stop/algo order
1462
+ * @param {boolean} [params.isTriggered] whether the order has been triggered (false by default)
1463
+ * @param {string} [params.side] 'buy' or 'sell'
1464
+ * @param {boolean} [params.trailing] set to true if you want to fetch trailing orders
1465
+ * @param {boolean} [params.paginate] set to true if you want to fetch orders with pagination
1466
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
1467
+ */
1468
+ await this.loadMarkets();
1469
+ const extendedParams = this.extend(params, { 'status': 'INCOMPLETE' });
1470
+ return await this.fetchOrders(symbol, since, limit, extendedParams);
1471
+ }
1472
+ async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
1473
+ /**
1474
+ * @method
1475
+ * @name woo#fetchClosedOrders
1476
+ * @description fetches information on multiple orders made by the user
1477
+ * @see https://docs.woo.org/#get-orders
1478
+ * @see https://docs.woo.org/#get-algo-orders
1479
+ * @param {string} symbol unified market symbol of the market orders were made in
1480
+ * @param {int} [since] the earliest time in ms to fetch orders for
1481
+ * @param {int} [limit] the maximum number of order structures to retrieve
1482
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1483
+ * @param {boolean} [params.stop] whether the order is a stop/algo order
1484
+ * @param {boolean} [params.isTriggered] whether the order has been triggered (false by default)
1485
+ * @param {string} [params.side] 'buy' or 'sell'
1486
+ * @param {boolean} [params.trailing] set to true if you want to fetch trailing orders
1487
+ * @param {boolean} [params.paginate] set to true if you want to fetch orders with pagination
1488
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
1489
+ */
1490
+ await this.loadMarkets();
1491
+ const extendedParams = this.extend(params, { 'status': 'COMPLETED' });
1492
+ return await this.fetchOrders(symbol, since, limit, extendedParams);
1449
1493
  }
1450
1494
  parseTimeInForce(timeInForce) {
1451
1495
  const timeInForces = {
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 } 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.2.76";
7
+ declare const version = "4.2.77";
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, 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.2.77';
41
+ const version = '4.2.78';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import ace from './src/ace.js';
@@ -357,8 +357,8 @@ export interface Liquidation {
357
357
  }
358
358
  export interface OrderRequest {
359
359
  symbol: string;
360
- type: Str;
361
- side: Str;
360
+ type: OrderType;
361
+ side: OrderSide;
362
362
  amount?: number;
363
363
  price?: number | undefined;
364
364
  params?: any;
package/js/src/bybit.js CHANGED
@@ -8097,11 +8097,15 @@ export default class bybit extends Exchange {
8097
8097
  const tier = info[i];
8098
8098
  const marketId = this.safeString(info, 'symbol');
8099
8099
  market = this.safeMarket(marketId);
8100
+ let minNotional = this.parseNumber('0');
8101
+ if (i !== 0) {
8102
+ minNotional = this.safeNumber(info[i - 1], 'riskLimitValue');
8103
+ }
8100
8104
  tiers.push({
8101
8105
  'tier': this.safeInteger(tier, 'id'),
8102
8106
  'currency': market['settle'],
8103
- 'minNotional': undefined,
8104
- 'maxNotional': undefined,
8107
+ 'minNotional': minNotional,
8108
+ 'maxNotional': this.safeNumber(tier, 'riskLimitValue'),
8105
8109
  'maintenanceMarginRate': this.safeNumber(tier, 'maintenanceMargin'),
8106
8110
  'maxLeverage': this.safeNumber(tier, 'maxLeverage'),
8107
8111
  'info': tier,
@@ -30,7 +30,7 @@ export default class coinbase extends Exchange {
30
30
  parseTransactionStatus(status: any): string;
31
31
  parseTransaction(transaction: any, currency?: Currency): Transaction;
32
32
  parseTrade(trade: any, market?: Market): Trade;
33
- fetchMarkets(params?: {}): Promise<any>;
33
+ fetchMarkets(params?: {}): Promise<any[]>;
34
34
  fetchMarketsV2(params?: {}): Promise<any[]>;
35
35
  fetchMarketsV3(params?: {}): Promise<any[]>;
36
36
  fetchCurrenciesFromCache(params?: {}): Promise<import("./base/types.js").Dictionary<any>>;
@@ -64,7 +64,7 @@ export default class coinbase extends Exchange {
64
64
  status: string;
65
65
  fee: any;
66
66
  };
67
- findAccountId(code: any): Promise<any>;
67
+ findAccountId(code: any, params?: {}): Promise<any>;
68
68
  prepareAccountRequest(limit?: Int, params?: {}): {
69
69
  account_id: string;
70
70
  };