ccxt 4.4.4 → 4.4.6

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 (48) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.min.js +2 -2
  3. package/dist/cjs/ccxt.js +1 -1
  4. package/dist/cjs/src/binance.js +3 -3
  5. package/dist/cjs/src/binanceus.js +1 -0
  6. package/dist/cjs/src/bitflyer.js +2 -2
  7. package/dist/cjs/src/bitget.js +56 -95
  8. package/dist/cjs/src/bitmart.js +186 -127
  9. package/dist/cjs/src/bybit.js +90 -7
  10. package/dist/cjs/src/coinbase.js +6 -8
  11. package/dist/cjs/src/kraken.js +6 -1
  12. package/dist/cjs/src/lykke.js +2 -2
  13. package/dist/cjs/src/mexc.js +37 -7
  14. package/dist/cjs/src/paradex.js +1 -1
  15. package/dist/cjs/src/pro/binance.js +6 -2
  16. package/dist/cjs/src/pro/binanceus.js +2 -1
  17. package/dist/cjs/src/pro/htx.js +14 -0
  18. package/dist/cjs/src/pro/hyperliquid.js +16 -1
  19. package/dist/cjs/src/pro/kraken.js +60 -0
  20. package/dist/cjs/src/pro/paradex.js +1 -0
  21. package/js/ccxt.d.ts +1 -1
  22. package/js/ccxt.js +1 -1
  23. package/js/src/abstract/bitmart.d.ts +4 -0
  24. package/js/src/binance.js +3 -3
  25. package/js/src/binanceus.js +1 -0
  26. package/js/src/bitflyer.js +2 -2
  27. package/js/src/bitget.d.ts +1 -1
  28. package/js/src/bitget.js +56 -95
  29. package/js/src/bitmart.js +186 -127
  30. package/js/src/bybit.js +90 -7
  31. package/js/src/coinbase.js +6 -8
  32. package/js/src/kraken.js +6 -1
  33. package/js/src/lykke.js +2 -2
  34. package/js/src/mexc.d.ts +1 -0
  35. package/js/src/mexc.js +37 -7
  36. package/js/src/paradex.js +1 -1
  37. package/js/src/pro/binance.d.ts +140 -0
  38. package/js/src/pro/binance.js +6 -2
  39. package/js/src/pro/binanceus.js +2 -1
  40. package/js/src/pro/htx.js +14 -0
  41. package/js/src/pro/hyperliquid.d.ts +1 -0
  42. package/js/src/pro/hyperliquid.js +16 -1
  43. package/js/src/pro/kraken.d.ts +3 -0
  44. package/js/src/pro/kraken.js +60 -0
  45. package/js/src/pro/paradex.js +1 -0
  46. package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +1 -1
  47. package/js/src/static_dependencies/starknet/utils/calldata/parser/index.d.ts +1 -1
  48. package/package.json +1 -1
@@ -231,6 +231,8 @@ class kraken extends kraken$1 {
231
231
  'XDG': 'DOGE',
232
232
  },
233
233
  'options': {
234
+ 'timeDifference': 0,
235
+ 'adjustForTimeDifference': false,
234
236
  'marketsByAltname': {},
235
237
  'delistedMarketsById': {},
236
238
  // cannot withdraw/deposit these
@@ -461,6 +463,9 @@ class kraken extends kraken$1 {
461
463
  * @param {object} [params] extra parameters specific to the exchange API endpoint
462
464
  * @returns {object[]} an array of objects representing market data
463
465
  */
466
+ if (this.options['adjustForTimeDifference']) {
467
+ await this.loadTimeDifference();
468
+ }
464
469
  const response = await this.publicGetAssetPairs(params);
465
470
  //
466
471
  // {
@@ -3145,7 +3150,7 @@ class kraken extends kraken$1 {
3145
3150
  return { 'url': url, 'method': method, 'body': body, 'headers': headers };
3146
3151
  }
3147
3152
  nonce() {
3148
- return this.milliseconds();
3153
+ return this.milliseconds() - this.options['timeDifference'];
3149
3154
  }
3150
3155
  handleErrors(code, reason, url, method, headers, body, response, requestHeaders, requestBody) {
3151
3156
  if (code === 520) {
@@ -678,9 +678,9 @@ class lykke extends lykke$1 {
678
678
  const currencyId = this.safeString(balance, 'assetId');
679
679
  const code = this.safeCurrencyCode(currencyId);
680
680
  const account = this.account();
681
- const free = this.safeString(balance, 'available');
681
+ const total = this.safeString(balance, 'available');
682
682
  const used = this.safeString(balance, 'reserved');
683
- account['free'] = free;
683
+ account['total'] = total;
684
684
  account['used'] = used;
685
685
  result[code] = account;
686
686
  }
@@ -30,6 +30,9 @@ class mexc extends mexc$1 {
30
30
  'future': false,
31
31
  'option': false,
32
32
  'addMargin': true,
33
+ 'borrowCrossMargin': false,
34
+ 'borrowIsolatedMargin': false,
35
+ 'borrowMargin': false,
33
36
  'cancelAllOrders': true,
34
37
  'cancelOrder': true,
35
38
  'cancelOrders': undefined,
@@ -43,12 +46,21 @@ class mexc extends mexc$1 {
43
46
  'createOrders': true,
44
47
  'createPostOnlyOrder': true,
45
48
  'createReduceOnlyOrder': true,
49
+ 'createStopLimitOrder': true,
50
+ 'createStopMarketOrder': true,
51
+ 'createStopOrder': true,
52
+ 'createTriggerOrder': true,
46
53
  'deposit': undefined,
47
54
  'editOrder': undefined,
48
55
  'fetchAccounts': true,
49
56
  'fetchBalance': true,
50
57
  'fetchBidsAsks': true,
51
- 'fetchBorrowRateHistory': undefined,
58
+ 'fetchBorrowInterest': false,
59
+ 'fetchBorrowRate': false,
60
+ 'fetchBorrowRateHistories': false,
61
+ 'fetchBorrowRateHistory': false,
62
+ 'fetchBorrowRates': false,
63
+ 'fetchBorrowRatesPerSymbol': false,
52
64
  'fetchCanceledOrders': true,
53
65
  'fetchClosedOrder': undefined,
54
66
  'fetchClosedOrders': true,
@@ -69,6 +81,7 @@ class mexc extends mexc$1 {
69
81
  'fetchIndexOHLCV': true,
70
82
  'fetchIsolatedBorrowRate': false,
71
83
  'fetchIsolatedBorrowRates': false,
84
+ 'fetchIsolatedPositions': false,
72
85
  'fetchL2OrderBook': true,
73
86
  'fetchLedger': undefined,
74
87
  'fetchLedgerEntry': undefined,
@@ -77,11 +90,13 @@ class mexc extends mexc$1 {
77
90
  'fetchLeverageTiers': true,
78
91
  'fetchMarginAdjustmentHistory': false,
79
92
  'fetchMarginMode': false,
80
- 'fetchMarketLeverageTiers': undefined,
93
+ 'fetchMarketLeverageTiers': 'emulated',
81
94
  'fetchMarkets': true,
82
95
  'fetchMarkOHLCV': true,
83
96
  'fetchMyTrades': true,
84
97
  'fetchOHLCV': true,
98
+ 'fetchOpenInterest': false,
99
+ 'fetchOpenInterestHistory': false,
85
100
  'fetchOpenOrder': undefined,
86
101
  'fetchOpenOrders': true,
87
102
  'fetchOrder': true,
@@ -89,7 +104,7 @@ class mexc extends mexc$1 {
89
104
  'fetchOrderBooks': undefined,
90
105
  'fetchOrders': true,
91
106
  'fetchOrderTrades': true,
92
- 'fetchPosition': true,
107
+ 'fetchPosition': 'emulated',
93
108
  'fetchPositionHistory': 'emulated',
94
109
  'fetchPositionMode': true,
95
110
  'fetchPositions': true,
@@ -399,6 +414,8 @@ class mexc extends mexc$1 {
399
414
  },
400
415
  },
401
416
  'options': {
417
+ 'adjustForTimeDifference': false,
418
+ 'timeDifference': 0,
402
419
  'createMarketBuyOrderRequiresPrice': true,
403
420
  'unavailableContracts': {
404
421
  'BTC/USDT:USDT': true,
@@ -453,6 +470,7 @@ class mexc extends mexc$1 {
453
470
  'AVAXC': 'AVAX_CCHAIN',
454
471
  'ERC20': 'ETH',
455
472
  'ACA': 'ACALA',
473
+ 'BEP20': 'BSC',
456
474
  // 'ADA': 'Cardano(ADA)',
457
475
  // 'AE': 'AE',
458
476
  // 'ALGO': 'Algorand(ALGO)',
@@ -1014,6 +1032,9 @@ class mexc extends mexc$1 {
1014
1032
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1015
1033
  * @returns {object[]} an array of objects representing market data
1016
1034
  */
1035
+ if (this.options['adjustForTimeDifference']) {
1036
+ await this.loadTimeDifference();
1037
+ }
1017
1038
  const spotMarketPromise = this.fetchSpotMarkets(params);
1018
1039
  const swapMarketPromise = this.fetchSwapMarkets(params);
1019
1040
  const [spotMarket, swapMarket] = await Promise.all([spotMarketPromise, swapMarketPromise]);
@@ -2914,6 +2935,9 @@ class mexc extends mexc$1 {
2914
2935
  * @method
2915
2936
  * @name mexc#cancelOrder
2916
2937
  * @description cancels an open order
2938
+ * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#cancel-order
2939
+ * @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#cancel-the-order-under-maintenance
2940
+ * @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#cancel-the-stop-limit-trigger-order-under-maintenance
2917
2941
  * @param {string} id order id
2918
2942
  * @param {string} symbol unified symbol of the market the order was made in
2919
2943
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -3030,6 +3054,7 @@ class mexc extends mexc$1 {
3030
3054
  * @method
3031
3055
  * @name mexc#cancelOrders
3032
3056
  * @description cancel multiple orders
3057
+ * @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#cancel-the-order-under-maintenance
3033
3058
  * @param {string[]} ids order ids
3034
3059
  * @param {string} symbol unified market symbol, default is undefined
3035
3060
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -4538,7 +4563,7 @@ class mexc extends mexc$1 {
4538
4563
  // 'coin': currency['id'] + network example: USDT-TRX,
4539
4564
  // 'status': 'status',
4540
4565
  // 'startTime': since, // default 90 days
4541
- // 'endTime': this.milliseconds (),
4566
+ // 'endTime': this.nonce(),
4542
4567
  // 'limit': limit, // default 1000, maximum 1000
4543
4568
  };
4544
4569
  let currency = undefined;
@@ -4598,7 +4623,7 @@ class mexc extends mexc$1 {
4598
4623
  // 'coin': currency['id'],
4599
4624
  // 'status': 'status',
4600
4625
  // 'startTime': since, // default 90 days
4601
- // 'endTime': this.milliseconds (),
4626
+ // 'endTime': this.nonce(),
4602
4627
  // 'limit': limit, // default 1000, maximum 1000
4603
4628
  };
4604
4629
  let currency = undefined;
@@ -4763,6 +4788,7 @@ class mexc extends mexc$1 {
4763
4788
  * @method
4764
4789
  * @name mexc#fetchPosition
4765
4790
  * @description fetch data on a single open contract trade position
4791
+ * @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-s-history-position-information
4766
4792
  * @param {string} symbol unified market symbol of the market the position is held in, default is undefined
4767
4793
  * @param {object} [params] extra parameters specific to the exchange API endpoint
4768
4794
  * @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
@@ -4780,6 +4806,7 @@ class mexc extends mexc$1 {
4780
4806
  * @method
4781
4807
  * @name mexc#fetchPositions
4782
4808
  * @description fetch all open positions
4809
+ * @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-s-history-position-information
4783
4810
  * @param {string[]|undefined} symbols list of unified market symbols
4784
4811
  * @param {object} [params] extra parameters specific to the exchange API endpoint
4785
4812
  * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
@@ -5622,6 +5649,9 @@ class mexc extends mexc$1 {
5622
5649
  const positions = this.parsePositions(data, symbols, params);
5623
5650
  return this.filterBySinceLimit(positions, since, limit);
5624
5651
  }
5652
+ nonce() {
5653
+ return this.milliseconds() - this.safeInteger(this.options, 'timeDifference', 0);
5654
+ }
5625
5655
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
5626
5656
  const section = this.safeString(api, 0);
5627
5657
  const access = this.safeString(api, 1);
@@ -5636,7 +5666,7 @@ class mexc extends mexc$1 {
5636
5666
  }
5637
5667
  let paramsEncoded = '';
5638
5668
  if (access === 'private') {
5639
- params['timestamp'] = this.milliseconds();
5669
+ params['timestamp'] = this.nonce();
5640
5670
  params['recvWindow'] = this.safeInteger(this.options, 'recvWindow', 5000);
5641
5671
  }
5642
5672
  if (Object.keys(params).length) {
@@ -5666,7 +5696,7 @@ class mexc extends mexc$1 {
5666
5696
  }
5667
5697
  else {
5668
5698
  this.checkRequiredCredentials();
5669
- const timestamp = this.milliseconds().toString();
5699
+ const timestamp = this.nonce().toString();
5670
5700
  let auth = '';
5671
5701
  headers = {
5672
5702
  'ApiKey': this.apiKey,
@@ -657,7 +657,7 @@ class paradex extends paradex$1 {
657
657
  'low': undefined,
658
658
  'bid': this.safeString(ticker, 'bid'),
659
659
  'bidVolume': undefined,
660
- 'ask': this.safeString(ticker, 'sdk'),
660
+ 'ask': this.safeString(ticker, 'ask'),
661
661
  'askVolume': undefined,
662
662
  'vwap': undefined,
663
663
  'open': undefined,
@@ -13,7 +13,11 @@ var ed25519 = require('../static_dependencies/noble-curves/ed25519.js');
13
13
  // -----------------------------------------------------------------------------
14
14
  class binance extends binance$1 {
15
15
  describe() {
16
- return this.deepExtend(super.describe(), {
16
+ const superDescribe = super.describe();
17
+ return this.deepExtend(superDescribe, this.describeData());
18
+ }
19
+ describeData() {
20
+ return {
17
21
  'has': {
18
22
  'ws': true,
19
23
  'watchBalance': true,
@@ -155,7 +159,7 @@ class binance extends binance$1 {
155
159
  'bookTicker': 'bookTicker',
156
160
  },
157
161
  },
158
- });
162
+ };
159
163
  }
160
164
  requestId(url) {
161
165
  const options = this.safeDict(this.options, 'requestId', this.createSafeDictionary());
@@ -10,7 +10,8 @@ class binanceus extends binance {
10
10
  // eslint-disable-next-line new-cap
11
11
  const restInstance = new binanceus$1();
12
12
  const restDescribe = restInstance.describe();
13
- const extended = this.deepExtend(restDescribe, super.describe());
13
+ const parentWsDescribe = super.describeData();
14
+ const extended = this.deepExtend(restDescribe, parentWsDescribe);
14
15
  return this.deepExtend(extended, {
15
16
  'id': 'binanceus',
16
17
  'name': 'Binance US',
@@ -132,6 +132,8 @@ class htx extends htx$1 {
132
132
  * @method
133
133
  * @name huobi#watchTicker
134
134
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
135
+ * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec53561-7773-11ed-9966-0242ac110003
136
+ * @see https://www.htx.com/en-us/opend/newApiPages/?id=28c33ab2-77ae-11ed-9966-0242ac110003
135
137
  * @param {string} symbol unified symbol of the market to fetch the ticker for
136
138
  * @param {object} [params] extra parameters specific to the exchange API endpoint
137
139
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -200,6 +202,9 @@ class htx extends htx$1 {
200
202
  * @method
201
203
  * @name huobi#watchTrades
202
204
  * @description get the list of most recent trades for a particular symbol
205
+ * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec53b69-7773-11ed-9966-0242ac110003
206
+ * @see https://www.htx.com/en-us/opend/newApiPages/?id=28c33c21-77ae-11ed-9966-0242ac110003
207
+ * @see https://www.htx.com/en-us/opend/newApiPages/?id=28c33cfe-77ae-11ed-9966-0242ac110003
203
208
  * @param {string} symbol unified symbol of the market to fetch trades for
204
209
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
205
210
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -263,6 +268,9 @@ class htx extends htx$1 {
263
268
  * @method
264
269
  * @name huobi#watchOHLCV
265
270
  * @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
271
+ * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec53241-7773-11ed-9966-0242ac110003
272
+ * @see https://www.htx.com/en-us/opend/newApiPages/?id=28c3346a-77ae-11ed-9966-0242ac110003
273
+ * @see https://www.htx.com/en-us/opend/newApiPages/?id=28c33563-77ae-11ed-9966-0242ac110003
266
274
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
267
275
  * @param {string} timeframe the length of time each candle represents
268
276
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
@@ -669,6 +677,7 @@ class htx extends htx$1 {
669
677
  * @method
670
678
  * @name huobi#watchMyTrades
671
679
  * @description watches information on multiple trades made by the user
680
+ * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec53dd5-7773-11ed-9966-0242ac110003
672
681
  * @param {string} symbol unified market symbol of the market trades were made in
673
682
  * @param {int} [since] the earliest time in ms to fetch trades for
674
683
  * @param {int} [limit] the maximum number of trade structures to retrieve
@@ -772,6 +781,7 @@ class htx extends htx$1 {
772
781
  * @method
773
782
  * @name huobi#watchOrders
774
783
  * @description watches information on multiple orders made by the user
784
+ * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec53c8f-7773-11ed-9966-0242ac110003
775
785
  * @param {string} symbol unified market symbol of the market orders were made in
776
786
  * @param {int} [since] the earliest time in ms to fetch orders for
777
787
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -1346,6 +1356,10 @@ class htx extends htx$1 {
1346
1356
  * @method
1347
1357
  * @name huobi#watchBalance
1348
1358
  * @description watch balance and get the amount of funds available for trading or funds locked in orders
1359
+ * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec52e28-7773-11ed-9966-0242ac110003
1360
+ * @see https://www.htx.com/en-us/opend/newApiPages/?id=10000084-77b7-11ed-9966-0242ac110003
1361
+ * @see https://www.htx.com/en-us/opend/newApiPages/?id=8cb7dcca-77b5-11ed-9966-0242ac110003
1362
+ * @see https://www.htx.com/en-us/opend/newApiPages/?id=28c34995-77ae-11ed-9966-0242ac110003
1349
1363
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1350
1364
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
1351
1365
  */
@@ -19,7 +19,7 @@ class hyperliquid extends hyperliquid$1 {
19
19
  'watchOHLCV': true,
20
20
  'watchOrderBook': true,
21
21
  'watchOrders': true,
22
- 'watchTicker': false,
22
+ 'watchTicker': true,
23
23
  'watchTickers': true,
24
24
  'watchTrades': true,
25
25
  'watchTradesForSymbols': false,
@@ -235,6 +235,21 @@ class hyperliquid extends hyperliquid$1 {
235
235
  const messageHash = 'orderbook:' + symbol;
236
236
  client.resolve(orderbook, messageHash);
237
237
  }
238
+ async watchTicker(symbol, params = {}) {
239
+ /**
240
+ * @method
241
+ * @name hyperliquid#watchTicker
242
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
243
+ * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
244
+ * @param {string} symbol unified symbol of the market to fetch the ticker for
245
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
246
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
247
+ */
248
+ const market = this.market(symbol);
249
+ symbol = market['symbol'];
250
+ const tickers = await this.watchTickers([symbol], params);
251
+ return tickers[symbol];
252
+ }
238
253
  async watchTickers(symbols = undefined, params = {}) {
239
254
  /**
240
255
  * @method
@@ -20,6 +20,7 @@ class kraken extends kraken$1 {
20
20
  'watchOrders': true,
21
21
  'watchTicker': true,
22
22
  'watchTickers': true,
23
+ 'watchBidsAsks': true,
23
24
  'watchTrades': true,
24
25
  'watchTradesForSymbols': true,
25
26
  'createOrderWs': true,
@@ -496,6 +497,64 @@ class kraken extends kraken$1 {
496
497
  }
497
498
  return this.filterByArray(this.tickers, 'symbol', symbols);
498
499
  }
500
+ async watchBidsAsks(symbols = undefined, params = {}) {
501
+ /**
502
+ * @method
503
+ * @name kraken#watchBidsAsks
504
+ * @see https://docs.kraken.com/api/docs/websocket-v1/spread
505
+ * @description watches best bid & ask for symbols
506
+ * @param {string[]} symbols unified symbol of the market to fetch the ticker for
507
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
508
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
509
+ */
510
+ await this.loadMarkets();
511
+ symbols = this.marketSymbols(symbols, undefined, false);
512
+ const ticker = await this.watchMultiHelper('bidask', 'spread', symbols, undefined, params);
513
+ if (this.newUpdates) {
514
+ const result = {};
515
+ result[ticker['symbol']] = ticker;
516
+ return result;
517
+ }
518
+ return this.filterByArray(this.bidsasks, 'symbol', symbols);
519
+ }
520
+ handleBidAsk(client, message, subscription) {
521
+ //
522
+ // [
523
+ // 7208974, // channelID
524
+ // [
525
+ // "63758.60000", // bid
526
+ // "63759.10000", // ask
527
+ // "1726814731.089778", // timestamp
528
+ // "0.00057917", // bid_volume
529
+ // "0.15681688" // ask_volume
530
+ // ],
531
+ // "spread",
532
+ // "XBT/USDT"
533
+ // ]
534
+ //
535
+ const parsedTicker = this.parseWsBidAsk(message);
536
+ const symbol = parsedTicker['symbol'];
537
+ this.bidsasks[symbol] = parsedTicker;
538
+ const messageHash = this.getMessageHash('bidask', undefined, symbol);
539
+ client.resolve(parsedTicker, messageHash);
540
+ }
541
+ parseWsBidAsk(ticker, market = undefined) {
542
+ const data = this.safeList(ticker, 1, []);
543
+ const marketId = this.safeString(ticker, 3);
544
+ market = this.safeValue(this.options['marketsByWsName'], marketId);
545
+ const symbol = this.safeString(market, 'symbol');
546
+ const timestamp = this.parseToInt(this.safeInteger(data, 2)) * 1000;
547
+ return this.safeTicker({
548
+ 'symbol': symbol,
549
+ 'timestamp': timestamp,
550
+ 'datetime': this.iso8601(timestamp),
551
+ 'ask': this.safeString(data, 1),
552
+ 'askVolume': this.safeString(data, 4),
553
+ 'bid': this.safeString(data, 0),
554
+ 'bidVolume': this.safeString(data, 3),
555
+ 'info': ticker,
556
+ }, market);
557
+ }
499
558
  async watchTrades(symbol, since = undefined, limit = undefined, params = {}) {
500
559
  /**
501
560
  * @method
@@ -1490,6 +1549,7 @@ class kraken extends kraken$1 {
1490
1549
  'book': this.handleOrderBook,
1491
1550
  'ohlc': this.handleOHLCV,
1492
1551
  'ticker': this.handleTicker,
1552
+ 'spread': this.handleBidAsk,
1493
1553
  'trade': this.handleTrades,
1494
1554
  // private
1495
1555
  'openOrders': this.handleOrders,
@@ -221,6 +221,7 @@ class paradex extends paradex$1 {
221
221
  * @method
222
222
  * @name paradex#watchTickers
223
223
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
224
+ * @see https://docs.api.testnet.paradex.trade/#sub-markets_summary-operation
224
225
  * @param {string[]} symbols unified symbol of the market to fetch the ticker for
225
226
  * @param {object} [params] extra parameters specific to the exchange API endpoint
226
227
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
package/js/ccxt.d.ts CHANGED
@@ -4,7 +4,7 @@ import * as functions from './src/base/functions.js';
4
4
  import * as errors from './src/base/errors.js';
5
5
  import type { Int, int, Str, Strings, Num, Bool, IndexType, OrderSide, OrderType, MarketType, SubType, Dict, NullableDict, List, NullableList, Fee, OHLCV, OHLCVC, implicitReturnType, Market, Currency, Dictionary, MinMax, FeeInterface, TradingFeeInterface, MarketInterface, Trade, Order, OrderBook, Ticker, Transaction, Tickers, CurrencyInterface, Balance, BalanceAccount, Account, PartialBalances, Balances, DepositAddress, WithdrawalResponse, DepositAddressResponse, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarketMarginModes, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, LeverageTiers } from './src/base/types.js';
6
6
  import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError } from './src/base/errors.js';
7
- declare const version = "4.4.3";
7
+ declare const version = "4.4.5";
8
8
  import ace from './src/ace.js';
9
9
  import alpaca from './src/alpaca.js';
10
10
  import ascendex from './src/ascendex.js';
package/js/ccxt.js CHANGED
@@ -38,7 +38,7 @@ import * as errors from './src/base/errors.js';
38
38
  import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError } from './src/base/errors.js';
39
39
  //-----------------------------------------------------------------------------
40
40
  // this is updated by vss.js when building
41
- const version = '4.4.4';
41
+ const version = '4.4.6';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import ace from './src/ace.js';
@@ -100,6 +100,10 @@ interface Exchange {
100
100
  privatePostContractPrivateSubmitPlanOrder(params?: {}): Promise<implicitReturnType>;
101
101
  privatePostContractPrivateCancelPlanOrder(params?: {}): Promise<implicitReturnType>;
102
102
  privatePostContractPrivateSubmitLeverage(params?: {}): Promise<implicitReturnType>;
103
+ privatePostContractPrivateSubmitTpSlOrder(params?: {}): Promise<implicitReturnType>;
104
+ privatePostContractPrivateModifyPlanOrder(params?: {}): Promise<implicitReturnType>;
105
+ privatePostContractPrivateModifyPresetPlanOrder(params?: {}): Promise<implicitReturnType>;
106
+ privatePostContractPrivateModifyTpSlOrder(params?: {}): Promise<implicitReturnType>;
103
107
  }
104
108
  declare abstract class Exchange extends _Exchange {
105
109
  }
package/js/src/binance.js CHANGED
@@ -1202,6 +1202,7 @@ export default class binance extends Exchange {
1202
1202
  // exchange-specific options
1203
1203
  'options': {
1204
1204
  'sandboxMode': false,
1205
+ 'fetchMargins': true,
1205
1206
  'fetchMarkets': [
1206
1207
  'spot',
1207
1208
  'linear',
@@ -2875,13 +2876,12 @@ export default class binance extends Exchange {
2875
2876
  }
2876
2877
  fetchMarkets.push(type);
2877
2878
  }
2878
- let fetchMargins = false;
2879
+ const fetchMargins = this.safeBool(this.options, 'fetchMargins', false);
2879
2880
  for (let i = 0; i < fetchMarkets.length; i++) {
2880
2881
  const marketType = fetchMarkets[i];
2881
2882
  if (marketType === 'spot') {
2882
2883
  promisesRaw.push(this.publicGetExchangeInfo(params));
2883
- if (this.checkRequiredCredentials(false) && !sandboxMode) {
2884
- fetchMargins = true;
2884
+ if (fetchMargins && this.checkRequiredCredentials(false) && !sandboxMode) {
2885
2885
  promisesRaw.push(this.sapiGetMarginAllPairs(params));
2886
2886
  promisesRaw.push(this.sapiGetMarginIsolatedAllPairs(params));
2887
2887
  }
@@ -43,6 +43,7 @@ export default class binanceus extends binance {
43
43
  'options': {
44
44
  'fetchMarkets': ['spot'],
45
45
  'defaultType': 'spot',
46
+ 'fetchMargins': false,
46
47
  'quoteOrderQty': false,
47
48
  },
48
49
  'has': {
@@ -1065,10 +1065,10 @@ export default class bitflyer extends Exchange {
1065
1065
  const feedback = this.id + ' ' + body;
1066
1066
  // i.e. {"status":-2,"error_message":"Under maintenance","data":null}
1067
1067
  const errorMessage = this.safeString(response, 'error_message');
1068
- const statusCode = this.safeNumber(response, 'status');
1068
+ const statusCode = this.safeInteger(response, 'status');
1069
1069
  if (errorMessage !== undefined) {
1070
1070
  this.throwExactlyMatchedException(this.exceptions['exact'], statusCode, feedback);
1071
- this.throwBroadlyMatchedException(this.exceptions['broad'], errorMessage, feedback);
1071
+ throw new ExchangeError(feedback);
1072
1072
  }
1073
1073
  return undefined;
1074
1074
  }
@@ -12,7 +12,6 @@ export default class bitget extends Exchange {
12
12
  fetchTime(params?: {}): Promise<number>;
13
13
  fetchMarkets(params?: {}): Promise<Market[]>;
14
14
  parseMarket(market: Dict): Market;
15
- fetchMarketsByType(type: any, params?: {}): Promise<import("./base/types.js").MarketInterface[]>;
16
15
  fetchCurrencies(params?: {}): Promise<Currencies>;
17
16
  fetchMarketLeverageTiers(symbol: string, params?: {}): Promise<LeverageTier[]>;
18
17
  parseMarketLeverageTiers(info: any, market?: Market): LeverageTier[];
@@ -225,6 +224,7 @@ export default class bitget extends Exchange {
225
224
  parseConversion(conversion: Dict, fromCurrency?: Currency, toCurrency?: Currency): Conversion;
226
225
  fetchConvertCurrencies(params?: {}): Promise<Currencies>;
227
226
  handleErrors(code: int, reason: string, url: string, method: string, headers: Dict, body: string, response: any, requestHeaders: any, requestBody: any): any;
227
+ nonce(): number;
228
228
  sign(path: any, api?: any[], method?: string, params?: {}, headers?: any, body?: any): {
229
229
  url: string;
230
230
  method: string;