ccxt 4.2.76 → 4.2.77

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 (65) hide show
  1. package/README.md +3 -3
  2. package/build.sh +1 -1
  3. package/dist/ccxt.browser.js +966 -597
  4. package/dist/ccxt.browser.min.js +7 -7
  5. package/dist/cjs/ccxt.js +1 -1
  6. package/dist/cjs/src/base/Exchange.js +6 -0
  7. package/dist/cjs/src/binance.js +502 -443
  8. package/dist/cjs/src/bingx.js +1 -1
  9. package/dist/cjs/src/blofin.js +14 -2
  10. package/dist/cjs/src/bybit.js +100 -58
  11. package/dist/cjs/src/coinbase.js +1 -1
  12. package/dist/cjs/src/delta.js +66 -49
  13. package/dist/cjs/src/hyperliquid.js +1 -1
  14. package/dist/cjs/src/kraken.js +8 -8
  15. package/dist/cjs/src/kucoin.js +152 -5
  16. package/dist/cjs/src/pro/ascendex.js +1 -1
  17. package/dist/cjs/src/pro/bitvavo.js +1 -1
  18. package/dist/cjs/src/pro/coinex.js +20 -14
  19. package/dist/cjs/src/pro/deribit.js +1 -1
  20. package/dist/cjs/src/pro/exmo.js +1 -1
  21. package/dist/cjs/src/pro/krakenfutures.js +1 -1
  22. package/dist/cjs/src/pro/phemex.js +1 -1
  23. package/dist/cjs/src/pro/poloniex.js +1 -1
  24. package/dist/cjs/src/pro/probit.js +1 -1
  25. package/dist/cjs/src/pro/woo.js +61 -6
  26. package/dist/cjs/src/woo.js +25 -0
  27. package/js/ccxt.d.ts +1 -1
  28. package/js/ccxt.js +1 -1
  29. package/js/src/abstract/kucoin.d.ts +1 -0
  30. package/js/src/abstract/kucoinfutures.d.ts +1 -0
  31. package/js/src/base/Exchange.d.ts +3 -3
  32. package/js/src/base/Exchange.js +6 -0
  33. package/js/src/base/types.d.ts +1 -1
  34. package/js/src/binance.d.ts +2 -2
  35. package/js/src/binance.js +502 -443
  36. package/js/src/bingx.js +1 -1
  37. package/js/src/bitflyer.d.ts +2 -2
  38. package/js/src/bithumb.d.ts +2 -2
  39. package/js/src/blofin.js +14 -2
  40. package/js/src/bybit.d.ts +1 -1
  41. package/js/src/bybit.js +100 -58
  42. package/js/src/coinbase.js +1 -1
  43. package/js/src/delta.d.ts +2 -1
  44. package/js/src/delta.js +66 -49
  45. package/js/src/deribit.d.ts +1 -1
  46. package/js/src/gate.d.ts +1 -1
  47. package/js/src/hyperliquid.js +1 -1
  48. package/js/src/kraken.js +8 -8
  49. package/js/src/kucoin.d.ts +4 -1
  50. package/js/src/kucoin.js +152 -5
  51. package/js/src/okx.d.ts +1 -1
  52. package/js/src/pro/ascendex.js +1 -1
  53. package/js/src/pro/bitvavo.js +1 -1
  54. package/js/src/pro/coinex.js +20 -14
  55. package/js/src/pro/deribit.js +1 -1
  56. package/js/src/pro/exmo.js +1 -1
  57. package/js/src/pro/krakenfutures.js +1 -1
  58. package/js/src/pro/phemex.js +1 -1
  59. package/js/src/pro/poloniex.js +1 -1
  60. package/js/src/pro/probit.js +1 -1
  61. package/js/src/pro/woo.d.ts +1 -0
  62. package/js/src/pro/woo.js +61 -6
  63. package/js/src/woo.js +25 -0
  64. package/package.json +1 -1
  65. package/skip-tests.json +1 -2
@@ -961,7 +961,7 @@ class ascendex extends ascendex$1 {
961
961
  'key': this.apiKey,
962
962
  'sig': signature,
963
963
  };
964
- future = this.watch(url, messageHash, this.extend(request, params));
964
+ future = await this.watch(url, messageHash, this.extend(request, params), messageHash);
965
965
  client.subscriptions[messageHash] = future;
966
966
  }
967
967
  return future;
@@ -1212,7 +1212,7 @@ class bitvavo extends bitvavo$1 {
1212
1212
  'timestamp': timestamp,
1213
1213
  };
1214
1214
  const message = this.extend(request, params);
1215
- future = this.watch(url, messageHash, message);
1215
+ future = await this.watch(url, messageHash, message, messageHash);
1216
1216
  client.subscriptions[messageHash] = future;
1217
1217
  }
1218
1218
  return future;
@@ -1016,8 +1016,12 @@ class coinex extends coinex$1 {
1016
1016
  //
1017
1017
  const messageHashSpot = 'authenticated:spot';
1018
1018
  const messageHashSwap = 'authenticated:swap';
1019
- client.resolve(message, messageHashSpot);
1020
- client.resolve(message, messageHashSwap);
1019
+ // client.resolve (message, messageHashSpot);
1020
+ // client.resolve (message, messageHashSwap);
1021
+ const spotFuture = this.safeValue(client.futures, messageHashSpot);
1022
+ spotFuture.resolve(true);
1023
+ const swapFutures = this.safeValue(client.futures, messageHashSwap);
1024
+ swapFutures.resolve(true);
1021
1025
  return message;
1022
1026
  }
1023
1027
  handleSubscriptionStatus(client, message) {
@@ -1042,16 +1046,20 @@ class coinex extends coinex$1 {
1042
1046
  const url = this.urls['api']['ws'][type];
1043
1047
  const client = this.client(url);
1044
1048
  const time = this.milliseconds();
1049
+ const isSpot = (type === 'spot');
1050
+ const spotMessageHash = 'authenticated:spot';
1051
+ const swapMessageHash = 'authenticated:swap';
1052
+ const messageHash = isSpot ? spotMessageHash : swapMessageHash;
1053
+ const future = client.future(messageHash);
1054
+ const authenticated = this.safeValue(client.subscriptions, messageHash);
1045
1055
  if (type === 'spot') {
1046
- const messageHash = 'authenticated:spot';
1047
- let future = this.safeValue(client.subscriptions, messageHash);
1048
- if (future !== undefined) {
1056
+ if (authenticated !== undefined) {
1049
1057
  return await future;
1050
1058
  }
1051
1059
  const requestId = this.requestId();
1052
1060
  const subscribe = {
1053
1061
  'id': requestId,
1054
- 'future': 'authenticated:spot',
1062
+ 'future': spotMessageHash,
1055
1063
  };
1056
1064
  const signData = 'access_id=' + this.apiKey + '&tonce=' + this.numberToString(time) + '&secret_key=' + this.secret;
1057
1065
  const hash = this.hash(this.encode(signData), md5.md5);
@@ -1064,20 +1072,18 @@ class coinex extends coinex$1 {
1064
1072
  ],
1065
1073
  'id': requestId,
1066
1074
  };
1067
- future = this.watch(url, messageHash, request, requestId, subscribe);
1068
- client.subscriptions[messageHash] = future;
1075
+ this.watch(url, messageHash, request, requestId, subscribe);
1076
+ client.subscriptions[messageHash] = true;
1069
1077
  return await future;
1070
1078
  }
1071
1079
  else {
1072
- const messageHash = 'authenticated:swap';
1073
- let future = this.safeValue(client.subscriptions, messageHash);
1074
- if (future !== undefined) {
1080
+ if (authenticated !== undefined) {
1075
1081
  return await future;
1076
1082
  }
1077
1083
  const requestId = this.requestId();
1078
1084
  const subscribe = {
1079
1085
  'id': requestId,
1080
- 'future': 'authenticated:swap',
1086
+ 'future': swapMessageHash,
1081
1087
  };
1082
1088
  const signData = 'access_id=' + this.apiKey + '&timestamp=' + this.numberToString(time) + '&secret_key=' + this.secret;
1083
1089
  const hash = this.hash(this.encode(signData), sha256.sha256, 'hex');
@@ -1090,8 +1096,8 @@ class coinex extends coinex$1 {
1090
1096
  ],
1091
1097
  'id': requestId,
1092
1098
  };
1093
- future = this.watch(url, messageHash, request, requestId, subscribe);
1094
- client.subscriptions[messageHash] = future;
1099
+ this.watch(url, messageHash, request, requestId, subscribe);
1100
+ client.subscriptions[messageHash] = true;
1095
1101
  return await future;
1096
1102
  }
1097
1103
  }
@@ -932,7 +932,7 @@ class deribit extends deribit$1 {
932
932
  'data': '',
933
933
  },
934
934
  };
935
- future = this.watch(url, messageHash, this.extend(request, params));
935
+ future = await this.watch(url, messageHash, this.extend(request, params), messageHash);
936
936
  client.subscriptions[messageHash] = future;
937
937
  }
938
938
  return future;
@@ -650,7 +650,7 @@ class exmo extends exmo$1 {
650
650
  'nonce': time,
651
651
  };
652
652
  const message = this.extend(request, query);
653
- future = this.watch(url, messageHash, message);
653
+ future = await this.watch(url, messageHash, message, messageHash);
654
654
  client.subscriptions[messageHash] = future;
655
655
  }
656
656
  return future;
@@ -86,7 +86,7 @@ class krakenfutures extends krakenfutures$1 {
86
86
  'api_key': this.apiKey,
87
87
  };
88
88
  const message = this.extend(request, params);
89
- future = await this.watch(url, messageHash, message);
89
+ future = await this.watch(url, messageHash, message, messageHash);
90
90
  client.subscriptions[messageHash] = future;
91
91
  }
92
92
  return future;
@@ -1506,7 +1506,7 @@ class phemex extends phemex$1 {
1506
1506
  if (!(messageHash in client.subscriptions)) {
1507
1507
  client.subscriptions[subscriptionHash] = this.handleAuthenticate;
1508
1508
  }
1509
- future = this.watch(url, messageHash, message);
1509
+ future = await this.watch(url, messageHash, message, messageHash);
1510
1510
  client.subscriptions[messageHash] = future;
1511
1511
  }
1512
1512
  return future;
@@ -103,7 +103,7 @@ class poloniex extends poloniex$1 {
103
103
  },
104
104
  };
105
105
  const message = this.extend(request, params);
106
- future = await this.watch(url, messageHash, message);
106
+ future = await this.watch(url, messageHash, message, messageHash);
107
107
  //
108
108
  // {
109
109
  // "data": {
@@ -580,7 +580,7 @@ class probit extends probit$1 {
580
580
  'type': 'authorization',
581
581
  'token': accessToken,
582
582
  };
583
- future = this.watch(url, messageHash, this.extend(request, params));
583
+ future = await this.watch(url, messageHash, this.extend(request, params), messageHash);
584
584
  client.subscriptions[messageHash] = future;
585
585
  }
586
586
  return future;
@@ -55,6 +55,13 @@ class woo extends woo$1 {
55
55
  'ping': this.ping,
56
56
  'keepAlive': 10000,
57
57
  },
58
+ 'exceptions': {
59
+ 'ws': {
60
+ 'exact': {
61
+ 'Auth is needed.': errors.AuthenticationError,
62
+ },
63
+ },
64
+ },
58
65
  });
59
66
  }
60
67
  requestId(url) {
@@ -416,8 +423,9 @@ class woo extends woo$1 {
416
423
  const client = this.client(url);
417
424
  const messageHash = 'authenticated';
418
425
  const event = 'auth';
419
- let future = this.safeValue(client.subscriptions, messageHash);
420
- if (future === undefined) {
426
+ const future = client.future(messageHash);
427
+ const authenticated = this.safeValue(client.subscriptions, messageHash);
428
+ if (authenticated === undefined) {
421
429
  const ts = this.nonce().toString();
422
430
  const auth = '|' + ts;
423
431
  const signature = this.hmac(this.encode(auth), this.encode(this.secret), sha256.sha256);
@@ -430,10 +438,9 @@ class woo extends woo$1 {
430
438
  },
431
439
  };
432
440
  const message = this.extend(request, params);
433
- future = this.watch(url, messageHash, message);
434
- client.subscriptions[messageHash] = future;
441
+ this.watch(url, messageHash, message, messageHash);
435
442
  }
436
- return future;
443
+ return await future;
437
444
  }
438
445
  async watchPrivate(messageHash, message, params = {}) {
439
446
  await this.authenticate(params);
@@ -446,6 +453,16 @@ class woo extends woo$1 {
446
453
  return await this.watch(url, messageHash, request, messageHash, subscribe);
447
454
  }
448
455
  async watchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
456
+ /**
457
+ * @method
458
+ * @name woo#watchOrders
459
+ * @description watches information on multiple orders made by the user
460
+ * @param {string} symbol unified market symbol of the market orders were made in
461
+ * @param {int} [since] the earliest time in ms to fetch orders for
462
+ * @param {int} [limit] the maximum number of order structures to retrieve
463
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
464
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
465
+ */
449
466
  await this.loadMarkets();
450
467
  const topic = 'executionreport';
451
468
  let messageHash = topic;
@@ -798,7 +815,43 @@ class woo extends woo$1 {
798
815
  this.balance = this.safeBalance(this.balance);
799
816
  client.resolve(this.balance, 'balance');
800
817
  }
818
+ handleErrorMessage(client, message) {
819
+ //
820
+ // {"id":"1","event":"subscribe","success":false,"ts":1710780997216,"errorMsg":"Auth is needed."}
821
+ //
822
+ if (!('success' in message)) {
823
+ return false;
824
+ }
825
+ const success = this.safeBool(message, 'success');
826
+ if (success) {
827
+ return false;
828
+ }
829
+ const errorMessage = this.safeString(message, 'errorMsg');
830
+ try {
831
+ if (errorMessage !== undefined) {
832
+ const feedback = this.id + ' ' + this.json(message);
833
+ this.throwExactlyMatchedException(this.exceptions['exact'], errorMessage, feedback);
834
+ }
835
+ return false;
836
+ }
837
+ catch (error) {
838
+ if (error instanceof errors.AuthenticationError) {
839
+ const messageHash = 'authenticated';
840
+ client.reject(error, messageHash);
841
+ if (messageHash in client.subscriptions) {
842
+ delete client.subscriptions[messageHash];
843
+ }
844
+ }
845
+ else {
846
+ client.reject(error);
847
+ }
848
+ return true;
849
+ }
850
+ }
801
851
  handleMessage(client, message) {
852
+ if (this.handleErrorMessage(client, message)) {
853
+ return;
854
+ }
802
855
  const methods = {
803
856
  'ping': this.handlePing,
804
857
  'pong': this.handlePong,
@@ -881,7 +934,9 @@ class woo extends woo$1 {
881
934
  const messageHash = 'authenticated';
882
935
  const success = this.safeValue(message, 'success');
883
936
  if (success) {
884
- client.resolve(message, messageHash);
937
+ // client.resolve (message, messageHash);
938
+ const future = this.safeValue(client.futures, 'authenticated');
939
+ future.resolve(true);
885
940
  }
886
941
  else {
887
942
  const error = new errors.AuthenticationError(this.json(message));
@@ -1367,9 +1367,15 @@ class woo extends woo$1 {
1367
1367
  * @param {boolean} [params.isTriggered] whether the order has been triggered (false by default)
1368
1368
  * @param {string} [params.side] 'buy' or 'sell'
1369
1369
  * @param {boolean} [params.trailing] set to true if you want to fetch trailing orders
1370
+ * @param {boolean} [params.paginate] set to true if you want to fetch orders with pagination
1370
1371
  * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
1371
1372
  */
1372
1373
  await this.loadMarkets();
1374
+ let paginate = false;
1375
+ [paginate, params] = this.handleOptionAndParams(params, 'fetchOrders', 'paginate');
1376
+ if (paginate) {
1377
+ return await this.fetchPaginatedCallIncremental('fetchOrders', symbol, since, limit, params, 'page', 500);
1378
+ }
1373
1379
  const request = {};
1374
1380
  let market = undefined;
1375
1381
  const stop = this.safeBool2(params, 'stop', 'trigger');
@@ -1387,6 +1393,12 @@ class woo extends woo$1 {
1387
1393
  request['start_t'] = since;
1388
1394
  }
1389
1395
  }
1396
+ if (limit !== undefined) {
1397
+ request['size'] = limit;
1398
+ }
1399
+ else {
1400
+ request['size'] = 500;
1401
+ }
1390
1402
  if (stop) {
1391
1403
  request['algoType'] = 'stop';
1392
1404
  }
@@ -1752,14 +1764,21 @@ class woo extends woo$1 {
1752
1764
  /**
1753
1765
  * @method
1754
1766
  * @name woo#fetchMyTrades
1767
+ * @see https://docs.woo.org/#get-trades
1755
1768
  * @description fetch all trades made by the user
1756
1769
  * @param {string} symbol unified market symbol
1757
1770
  * @param {int} [since] the earliest time in ms to fetch trades for
1758
1771
  * @param {int} [limit] the maximum number of trades structures to retrieve
1759
1772
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1773
+ * @param {boolean} [params.paginate] set to true if you want to fetch trades with pagination
1760
1774
  * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
1761
1775
  */
1762
1776
  await this.loadMarkets();
1777
+ let paginate = false;
1778
+ [paginate, params] = this.handleOptionAndParams(params, 'fetchMyTrades', 'paginate');
1779
+ if (paginate) {
1780
+ return await this.fetchPaginatedCallIncremental('fetchMyTrades', symbol, since, limit, params, 'page', 500);
1781
+ }
1763
1782
  const request = {};
1764
1783
  let market = undefined;
1765
1784
  if (symbol !== undefined) {
@@ -1769,6 +1788,12 @@ class woo extends woo$1 {
1769
1788
  if (since !== undefined) {
1770
1789
  request['start_t'] = since;
1771
1790
  }
1791
+ if (limit !== undefined) {
1792
+ request['size'] = limit;
1793
+ }
1794
+ else {
1795
+ request['size'] = 500;
1796
+ }
1772
1797
  const response = await this.v1PrivateGetClientTrades(this.extend(request, params));
1773
1798
  // {
1774
1799
  // "success": true,
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.75";
7
+ declare const version = "4.2.76";
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.76';
41
+ const version = '4.2.77';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import ace from './src/ace.js';
@@ -78,6 +78,7 @@ interface Exchange {
78
78
  privateGetIsolatedAccountSymbol(params?: {}): Promise<implicitReturnType>;
79
79
  privateGetMarginBorrow(params?: {}): Promise<implicitReturnType>;
80
80
  privateGetMarginRepay(params?: {}): Promise<implicitReturnType>;
81
+ privateGetMarginInterest(params?: {}): Promise<implicitReturnType>;
81
82
  privateGetProjectList(params?: {}): Promise<implicitReturnType>;
82
83
  privateGetProjectMarketInterestRate(params?: {}): Promise<implicitReturnType>;
83
84
  privateGetRedeemOrders(params?: {}): Promise<implicitReturnType>;
@@ -78,6 +78,7 @@ interface kucoin {
78
78
  privateGetIsolatedAccountSymbol(params?: {}): Promise<implicitReturnType>;
79
79
  privateGetMarginBorrow(params?: {}): Promise<implicitReturnType>;
80
80
  privateGetMarginRepay(params?: {}): Promise<implicitReturnType>;
81
+ privateGetMarginInterest(params?: {}): Promise<implicitReturnType>;
81
82
  privateGetProjectList(params?: {}): Promise<implicitReturnType>;
82
83
  privateGetProjectMarketInterestRate(params?: {}): Promise<implicitReturnType>;
83
84
  privateGetRedeemOrders(params?: {}): Promise<implicitReturnType>;
@@ -704,7 +704,7 @@ export default class Exchange {
704
704
  fetchPaymentMethods(params?: {}): Promise<{}>;
705
705
  parseToInt(number: any): number;
706
706
  parseToNumeric(number: any): number;
707
- isRoundNumber(value: any): boolean;
707
+ isRoundNumber(value: number): boolean;
708
708
  afterConstruct(): void;
709
709
  createNetworksByIdObject(): void;
710
710
  getDefaultOptions(): {
@@ -765,8 +765,8 @@ export default class Exchange {
765
765
  fetchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
766
766
  fetchOHLCVWs(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
767
767
  watchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
768
- convertTradingViewToOHLCV(ohlcvs: any, timestamp?: string, open?: string, high?: string, low?: string, close?: string, volume?: string, ms?: boolean): any[];
769
- convertOHLCVToTradingView(ohlcvs: any, timestamp?: string, open?: string, high?: string, low?: string, close?: string, volume?: string, ms?: boolean): {};
768
+ convertTradingViewToOHLCV(ohlcvs: number[][], timestamp?: string, open?: string, high?: string, low?: string, close?: string, volume?: string, ms?: boolean): any[];
769
+ convertOHLCVToTradingView(ohlcvs: number[][], timestamp?: string, open?: string, high?: string, low?: string, close?: string, volume?: string, ms?: boolean): {};
770
770
  fetchWebEndpoint(method: any, endpointMethod: any, returnAsJson: any, startRegex?: any, endRegex?: any): Promise<any>;
771
771
  marketIds(symbols: any): any;
772
772
  marketSymbols(symbols: any, type?: Str, allowEmpty?: boolean, sameTypeOnly?: boolean, sameSubTypeOnly?: boolean): any;
@@ -3824,6 +3824,12 @@ export default class Exchange {
3824
3824
  return result;
3825
3825
  }
3826
3826
  checkRequiredCredentials(error = true) {
3827
+ /**
3828
+ * @ignore
3829
+ * @method
3830
+ * @param {boolean} error throw an error that a credential is required if true
3831
+ * @returns {boolean} true if all required credentials have been set, otherwise false or an error is thrown is param error=true
3832
+ */
3827
3833
  const keys = Object.keys(this.requiredCredentials);
3828
3834
  for (let i = 0; i < keys.length; i++) {
3829
3835
  const key = keys[i];
@@ -6,7 +6,7 @@ export declare type Bool = boolean | undefined;
6
6
  export declare type IndexType = number | string;
7
7
  export declare type OrderSide = 'buy' | 'sell' | string;
8
8
  export declare type OrderType = 'limit' | 'market' | string;
9
- export declare type MarketType = 'spot' | 'margin' | 'swap' | 'future' | 'option';
9
+ export declare type MarketType = 'spot' | 'margin' | 'swap' | 'future' | 'option' | 'delivery' | 'index';
10
10
  export declare type SubType = 'linear' | 'inverse' | undefined;
11
11
  export interface Dictionary<T> {
12
12
  [key: string]: T;
@@ -11,8 +11,8 @@ export default class binance extends Exchange {
11
11
  setSandboxMode(enable: boolean): void;
12
12
  convertExpireDate(date: any): string;
13
13
  createExpiredOptionMarket(symbol: string): MarketInterface;
14
- market(symbol: any): any;
15
- safeMarket(marketId?: any, market?: any, delimiter?: any, marketType?: any): MarketInterface;
14
+ market(symbol: string): MarketInterface;
15
+ safeMarket(marketId?: Str, market?: Market, delimiter?: Str, marketType?: Str): MarketInterface;
16
16
  costToPrecision(symbol: any, cost: any): any;
17
17
  currencyToPrecision(code: any, fee: any, networkCode?: any): any;
18
18
  nonce(): number;