ccxt 4.3.85 → 4.3.86

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 (44) hide show
  1. package/README.md +7 -5
  2. package/dist/ccxt.browser.min.js +15 -15
  3. package/dist/cjs/ccxt.js +6 -1
  4. package/dist/cjs/src/abstract/hashkey.js +9 -0
  5. package/dist/cjs/src/base/Exchange.js +1 -1
  6. package/dist/cjs/src/binance.js +4 -2
  7. package/dist/cjs/src/bitfinex.js +2 -2
  8. package/dist/cjs/src/hashkey.js +4328 -0
  9. package/dist/cjs/src/hyperliquid.js +85 -65
  10. package/dist/cjs/src/indodax.js +37 -9
  11. package/dist/cjs/src/krakenfutures.js +12 -10
  12. package/dist/cjs/src/pro/ascendex.js +45 -5
  13. package/dist/cjs/src/pro/bingx.js +13 -12
  14. package/dist/cjs/src/pro/hashkey.js +839 -0
  15. package/dist/cjs/src/pro/hyperliquid.js +123 -0
  16. package/dist/cjs/src/pro/mexc.js +13 -7
  17. package/dist/cjs/src/pro/woo.js +1 -0
  18. package/dist/cjs/src/pro/woofipro.js +1 -0
  19. package/dist/cjs/src/pro/xt.js +1 -0
  20. package/js/ccxt.d.ts +8 -2
  21. package/js/ccxt.js +6 -2
  22. package/js/src/abstract/hashkey.d.ts +70 -0
  23. package/js/src/abstract/hashkey.js +11 -0
  24. package/js/src/base/Exchange.js +1 -1
  25. package/js/src/binance.js +4 -2
  26. package/js/src/bitfinex.js +2 -2
  27. package/js/src/hashkey.d.ts +178 -0
  28. package/js/src/hashkey.js +4329 -0
  29. package/js/src/hyperliquid.d.ts +3 -0
  30. package/js/src/hyperliquid.js +85 -65
  31. package/js/src/indodax.js +37 -9
  32. package/js/src/krakenfutures.js +12 -10
  33. package/js/src/pro/ascendex.d.ts +2 -0
  34. package/js/src/pro/ascendex.js +45 -5
  35. package/js/src/pro/bingx.js +13 -12
  36. package/js/src/pro/hashkey.d.ts +34 -0
  37. package/js/src/pro/hashkey.js +840 -0
  38. package/js/src/pro/hyperliquid.d.ts +7 -1
  39. package/js/src/pro/hyperliquid.js +123 -0
  40. package/js/src/pro/mexc.js +13 -7
  41. package/js/src/pro/woo.js +1 -0
  42. package/js/src/pro/woofipro.js +1 -0
  43. package/js/src/pro/xt.js +1 -0
  44. package/package.json +1 -1
@@ -11,6 +11,9 @@ class hyperliquid extends hyperliquid$1 {
11
11
  return this.deepExtend(super.describe(), {
12
12
  'has': {
13
13
  'ws': true,
14
+ 'createOrderWs': true,
15
+ 'createOrdersWs': true,
16
+ 'editOrderWs': true,
14
17
  'watchBalance': false,
15
18
  'watchMyTrades': true,
16
19
  'watchOHLCV': true,
@@ -45,6 +48,90 @@ class hyperliquid extends hyperliquid$1 {
45
48
  },
46
49
  });
47
50
  }
51
+ async createOrdersWs(orders, params = {}) {
52
+ /**
53
+ * @method
54
+ * @name hyperliquid#createOrdersWs
55
+ * @description create a list of trade orders using WebSocket post request
56
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#place-an-order
57
+ * @param {Array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
58
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
59
+ */
60
+ await this.loadMarkets();
61
+ const url = this.urls['api']['ws']['public'];
62
+ const ordersRequest = this.createOrdersRequest(orders, params);
63
+ const wrapped = this.wrapAsPostAction(ordersRequest);
64
+ const request = this.safeDict(wrapped, 'request', {});
65
+ const requestId = this.safeString(wrapped, 'requestId');
66
+ const response = await this.watch(url, requestId, request, requestId);
67
+ const responseOjb = this.safeDict(response, 'response', {});
68
+ const data = this.safeDict(responseOjb, 'data', {});
69
+ const statuses = this.safeList(data, 'statuses', []);
70
+ return this.parseOrders(statuses, undefined);
71
+ }
72
+ async createOrderWs(symbol, type, side, amount, price = undefined, params = {}) {
73
+ /**
74
+ * @method
75
+ * @name hyperliquid#createOrder
76
+ * @description create a trade order using WebSocket post request
77
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#place-an-order
78
+ * @param {string} symbol unified symbol of the market to create an order in
79
+ * @param {string} type 'market' or 'limit'
80
+ * @param {string} side 'buy' or 'sell'
81
+ * @param {float} amount how much of currency you want to trade in units of base currency
82
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
83
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
84
+ * @param {string} [params.timeInForce] 'Gtc', 'Ioc', 'Alo'
85
+ * @param {bool} [params.postOnly] true or false whether the order is post-only
86
+ * @param {bool} [params.reduceOnly] true or false whether the order is reduce-only
87
+ * @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
88
+ * @param {string} [params.clientOrderId] client order id, (optional 128 bit hex string e.g. 0x1234567890abcdef1234567890abcdef)
89
+ * @param {string} [params.slippage] the slippage for market order
90
+ * @param {string} [params.vaultAddress] the vault address for order
91
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
92
+ */
93
+ await this.loadMarkets();
94
+ const [order, globalParams] = this.parseCreateOrderArgs(symbol, type, side, amount, price, params);
95
+ const orders = await this.createOrdersWs([order], globalParams);
96
+ return orders[0];
97
+ }
98
+ async editOrderWs(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
99
+ /**
100
+ * @method
101
+ * @name hyperliquid#editOrder
102
+ * @description edit a trade order
103
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#modify-an-order
104
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#modify-multiple-orders
105
+ * @param {string} id cancel order id
106
+ * @param {string} symbol unified symbol of the market to create an order in
107
+ * @param {string} type 'market' or 'limit'
108
+ * @param {string} side 'buy' or 'sell'
109
+ * @param {float} amount how much of currency you want to trade in units of base currency
110
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
111
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
112
+ * @param {string} [params.timeInForce] 'Gtc', 'Ioc', 'Alo'
113
+ * @param {bool} [params.postOnly] true or false whether the order is post-only
114
+ * @param {bool} [params.reduceOnly] true or false whether the order is reduce-only
115
+ * @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
116
+ * @param {string} [params.clientOrderId] client order id, (optional 128 bit hex string e.g. 0x1234567890abcdef1234567890abcdef)
117
+ * @param {string} [params.vaultAddress] the vault address for order
118
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
119
+ */
120
+ await this.loadMarkets();
121
+ const market = this.market(symbol);
122
+ const url = this.urls['api']['ws']['public'];
123
+ const postRequest = this.editOrderRequest(id, symbol, type, side, amount, price, params);
124
+ const wrapped = this.wrapAsPostAction(postRequest);
125
+ const request = this.safeDict(wrapped, 'request', {});
126
+ const requestId = this.safeString(wrapped, 'requestId');
127
+ const response = await this.watch(url, requestId, request, requestId);
128
+ // response is the same as in this.editOrder
129
+ const responseObject = this.safeDict(response, 'response', {});
130
+ const dataObject = this.safeDict(responseObject, 'data', {});
131
+ const statuses = this.safeList(dataObject, 'statuses', []);
132
+ const first = this.safeDict(statuses, 0, {});
133
+ return this.parseOrder(first, market);
134
+ }
48
135
  async watchOrderBook(symbol, limit = undefined, params = {}) {
49
136
  /**
50
137
  * @method
@@ -510,6 +597,22 @@ class hyperliquid extends hyperliquid$1 {
510
597
  const messageHash = 'candles:' + timeframe + ':' + symbol;
511
598
  client.resolve(ohlcv, messageHash);
512
599
  }
600
+ handleWsPost(client, message) {
601
+ // {
602
+ // channel: "post",
603
+ // data: {
604
+ // id: <number>,
605
+ // response: {
606
+ // type: "info" | "action" | "error",
607
+ // payload: { ... }
608
+ // }
609
+ // }
610
+ const data = this.safeDict(message, 'data');
611
+ const id = this.safeString(data, 'id');
612
+ const response = this.safeDict(data, 'response');
613
+ const payload = this.safeDict(response, 'payload');
614
+ client.resolve(payload, id);
615
+ }
513
616
  async watchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
514
617
  /**
515
618
  * @method
@@ -624,6 +727,7 @@ class hyperliquid extends hyperliquid$1 {
624
727
  'orderUpdates': this.handleOrder,
625
728
  'userFills': this.handleMyTrades,
626
729
  'webData2': this.handleWsTickers,
730
+ 'post': this.handleWsPost,
627
731
  };
628
732
  const exacMethod = this.safeValue(methods, topic);
629
733
  if (exacMethod !== undefined) {
@@ -654,6 +758,25 @@ class hyperliquid extends hyperliquid$1 {
654
758
  client.lastPong = this.safeInteger(message, 'pong');
655
759
  return message;
656
760
  }
761
+ requestId() {
762
+ const requestId = this.sum(this.safeInteger(this.options, 'requestId', 0), 1);
763
+ this.options['requestId'] = requestId;
764
+ return requestId;
765
+ }
766
+ wrapAsPostAction(request) {
767
+ const requestId = this.requestId();
768
+ return {
769
+ 'requestId': requestId,
770
+ 'request': {
771
+ 'method': 'post',
772
+ 'id': requestId,
773
+ 'request': {
774
+ 'type': 'action',
775
+ 'payload': request,
776
+ },
777
+ },
778
+ };
779
+ }
657
780
  }
658
781
 
659
782
  module.exports = hyperliquid;
@@ -29,6 +29,7 @@ class mexc extends mexc$1 {
29
29
  'watchTicker': true,
30
30
  'watchTickers': false,
31
31
  'watchTrades': true,
32
+ 'watchTradesForSymbols': false,
32
33
  },
33
34
  'urls': {
34
35
  'api': {
@@ -71,6 +72,8 @@ class mexc extends mexc$1 {
71
72
  * @method
72
73
  * @name mexc#watchTicker
73
74
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
75
+ * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#individual-symbol-book-ticker-streams
76
+ * @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#public-channels
74
77
  * @param {string} symbol unified symbol of the market to fetch the ticker for
75
78
  * @param {object} [params] extra parameters specific to the exchange API endpoint
76
79
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -203,7 +206,7 @@ class mexc extends mexc$1 {
203
206
  /**
204
207
  * @method
205
208
  * @name mexc#watchOHLCV
206
- * @see https://mxcdevelop.github.io/apidocs/spot_v3_en/#kline-streams
209
+ * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#kline-streams
207
210
  * @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
208
211
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
209
212
  * @param {string} timeframe the length of time each candle represents
@@ -349,7 +352,8 @@ class mexc extends mexc$1 {
349
352
  /**
350
353
  * @method
351
354
  * @name mexc#watchOrderBook
352
- * @see https://mxcdevelop.github.io/apidocs/spot_v3_en/#diff-depth-stream
355
+ * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#diff-depth-stream
356
+ * @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#public-channels
353
357
  * @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
354
358
  * @param {string} symbol unified symbol of the market to fetch the order book for
355
359
  * @param {int} [limit] the maximum amount of order book entries to return
@@ -519,7 +523,8 @@ class mexc extends mexc$1 {
519
523
  /**
520
524
  * @method
521
525
  * @name mexc#watchTrades
522
- * @see https://mxcdevelop.github.io/apidocs/spot_v3_en/#trade-streams
526
+ * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#trade-streams
527
+ * @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#public-channels
523
528
  * @description get the list of most recent trades for a particular symbol
524
529
  * @param {string} symbol unified symbol of the market to fetch trades for
525
530
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
@@ -608,7 +613,8 @@ class mexc extends mexc$1 {
608
613
  /**
609
614
  * @method
610
615
  * @name mexc#watchMyTrades
611
- * @see https://mxcdevelop.github.io/apidocs/spot_v3_en/#spot-account-deals
616
+ * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#spot-account-deals
617
+ * @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#private-channels
612
618
  * @description watches information on multiple trades made by the user
613
619
  * @param {string} symbol unified market symbol of the market trades were made in
614
620
  * @param {int} [since] the earliest time in ms to fetch trades for
@@ -755,8 +761,8 @@ class mexc extends mexc$1 {
755
761
  /**
756
762
  * @method
757
763
  * @name mexc#watchOrders
758
- * @see https://mxcdevelop.github.io/apidocs/spot_v3_en/#spot-account-orders
759
- * @see https://mxcdevelop.github.io/apidocs/spot_v3_en/#margin-account-orders
764
+ * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#spot-account-orders
765
+ * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#margin-account-orders
760
766
  * @description watches information on multiple orders made by the user
761
767
  * @param {string} symbol unified market symbol of the market orders were made in
762
768
  * @param {int} [since] the earliest time in ms to fetch orders for
@@ -1007,7 +1013,7 @@ class mexc extends mexc$1 {
1007
1013
  /**
1008
1014
  * @method
1009
1015
  * @name mexc#watchBalance
1010
- * @see https://mxcdevelop.github.io/apidocs/spot_v3_en/#spot-account-upadte
1016
+ * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#spot-account-upadte
1011
1017
  * @description watch balance and get the amount of funds available for trading or funds locked in orders
1012
1018
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1013
1019
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
@@ -21,6 +21,7 @@ class woo extends woo$1 {
21
21
  'watchTicker': true,
22
22
  'watchTickers': true,
23
23
  'watchTrades': true,
24
+ 'watchTradesForSymbols': false,
24
25
  'watchPositions': true,
25
26
  },
26
27
  'urls': {
@@ -22,6 +22,7 @@ class woofipro extends woofipro$1 {
22
22
  'watchTicker': true,
23
23
  'watchTickers': true,
24
24
  'watchTrades': true,
25
+ 'watchTradesForSymbols': false,
25
26
  'watchPositions': true,
26
27
  },
27
28
  'urls': {
@@ -15,6 +15,7 @@ class xt extends xt$1 {
15
15
  'watchTicker': true,
16
16
  'watchTickers': true,
17
17
  'watchTrades': true,
18
+ 'watchTradesForSymbols': false,
18
19
  'watchBalance': true,
19
20
  'watchOrders': true,
20
21
  'watchMyTrades': 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 { Int, int, Str, Strings, Num, Bool, IndexType, OrderSide, OrderType, MarketType, SubType, Dict, NullableDict, List, NullableList, Fee, OHLCV, OHLCVC, implicitReturnType, Market, Currency, Dictionary, MinMax, FeeInterface, TradingFeeInterface, MarketInterface, Trade, Order, OrderBook, Ticker, Transaction, Tickers, CurrencyInterface, Balance, BalanceAccount, Account, PartialBalances, Balances, DepositAddress, WithdrawalResponse, DepositAddressResponse, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, 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 } from './src/base/errors.js';
7
- declare const version = "4.3.84";
7
+ declare const version = "4.3.85";
8
8
  import ace from './src/ace.js';
9
9
  import alpaca from './src/alpaca.js';
10
10
  import ascendex from './src/ascendex.js';
@@ -65,6 +65,7 @@ import fmfwio from './src/fmfwio.js';
65
65
  import gate from './src/gate.js';
66
66
  import gateio from './src/gateio.js';
67
67
  import gemini from './src/gemini.js';
68
+ import hashkey from './src/hashkey.js';
68
69
  import hitbtc from './src/hitbtc.js';
69
70
  import hitbtc3 from './src/hitbtc3.js';
70
71
  import hollaex from './src/hollaex.js';
@@ -151,6 +152,7 @@ import exmoPro from './src/pro/exmo.js';
151
152
  import gatePro from './src/pro/gate.js';
152
153
  import gateioPro from './src/pro/gateio.js';
153
154
  import geminiPro from './src/pro/gemini.js';
155
+ import hashkeyPro from './src/pro/hashkey.js';
154
156
  import hitbtcPro from './src/pro/hitbtc.js';
155
157
  import hollaexPro from './src/pro/hollaex.js';
156
158
  import htxPro from './src/pro/htx.js';
@@ -245,6 +247,7 @@ declare const exchanges: {
245
247
  gate: typeof gate;
246
248
  gateio: typeof gateio;
247
249
  gemini: typeof gemini;
250
+ hashkey: typeof hashkey;
248
251
  hitbtc: typeof hitbtc;
249
252
  hitbtc3: typeof hitbtc3;
250
253
  hollaex: typeof hollaex;
@@ -333,6 +336,7 @@ declare const pro: {
333
336
  gate: typeof gatePro;
334
337
  gateio: typeof gateioPro;
335
338
  gemini: typeof geminiPro;
339
+ hashkey: typeof hashkeyPro;
336
340
  hitbtc: typeof hitbtcPro;
337
341
  hollaex: typeof hollaexPro;
338
342
  htx: typeof htxPro;
@@ -410,6 +414,7 @@ declare const ccxt: {
410
414
  gate: typeof gatePro;
411
415
  gateio: typeof gateioPro;
412
416
  gemini: typeof geminiPro;
417
+ hashkey: typeof hashkeyPro;
413
418
  hitbtc: typeof hitbtcPro;
414
419
  hollaex: typeof hollaexPro;
415
420
  htx: typeof htxPro;
@@ -505,6 +510,7 @@ declare const ccxt: {
505
510
  gate: typeof gate;
506
511
  gateio: typeof gateio;
507
512
  gemini: typeof gemini;
513
+ hashkey: typeof hashkey;
508
514
  hitbtc: typeof hitbtc;
509
515
  hitbtc3: typeof hitbtc3;
510
516
  hollaex: typeof hollaex;
@@ -555,5 +561,5 @@ declare const ccxt: {
555
561
  zaif: typeof zaif;
556
562
  zonda: typeof zonda;
557
563
  } & typeof functions & typeof errors;
558
- export { version, Exchange, exchanges, pro, Precise, functions, errors, 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, Int, int, Str, Strings, Num, Bool, IndexType, OrderSide, OrderType, MarketType, SubType, Dict, NullableDict, List, NullableList, Fee, OHLCV, OHLCVC, implicitReturnType, Market, Currency, Dictionary, MinMax, FeeInterface, TradingFeeInterface, MarketInterface, Trade, Order, OrderBook, Ticker, Transaction, Tickers, CurrencyInterface, Balance, BalanceAccount, Account, PartialBalances, Balances, DepositAddress, WithdrawalResponse, DepositAddressResponse, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, LeverageTiers, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseadvanced, coinbaseexchange, coinbaseinternational, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, hyperliquid, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, oxfun, p2b, paradex, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, tradeogre, upbit, vertex, wavesexchange, wazirx, whitebit, woo, woofipro, xt, yobit, zaif, zonda, };
564
+ export { version, Exchange, exchanges, pro, Precise, functions, errors, 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, Int, int, Str, Strings, Num, Bool, IndexType, OrderSide, OrderType, MarketType, SubType, Dict, NullableDict, List, NullableList, Fee, OHLCV, OHLCVC, implicitReturnType, Market, Currency, Dictionary, MinMax, FeeInterface, TradingFeeInterface, MarketInterface, Trade, Order, OrderBook, Ticker, Transaction, Tickers, CurrencyInterface, Balance, BalanceAccount, Account, PartialBalances, Balances, DepositAddress, WithdrawalResponse, DepositAddressResponse, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, LeverageTiers, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseadvanced, coinbaseexchange, coinbaseinternational, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hashkey, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, hyperliquid, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, oxfun, p2b, paradex, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, tradeogre, upbit, vertex, wavesexchange, wazirx, whitebit, woo, woofipro, xt, yobit, zaif, zonda, };
559
565
  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, 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 } from './src/base/errors.js';
39
39
  //-----------------------------------------------------------------------------
40
40
  // this is updated by vss.js when building
41
- const version = '4.3.85';
41
+ const version = '4.3.86';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import ace from './src/ace.js';
@@ -101,6 +101,7 @@ import fmfwio from './src/fmfwio.js';
101
101
  import gate from './src/gate.js';
102
102
  import gateio from './src/gateio.js';
103
103
  import gemini from './src/gemini.js';
104
+ import hashkey from './src/hashkey.js';
104
105
  import hitbtc from './src/hitbtc.js';
105
106
  import hitbtc3 from './src/hitbtc3.js';
106
107
  import hollaex from './src/hollaex.js';
@@ -188,6 +189,7 @@ import exmoPro from './src/pro/exmo.js';
188
189
  import gatePro from './src/pro/gate.js';
189
190
  import gateioPro from './src/pro/gateio.js';
190
191
  import geminiPro from './src/pro/gemini.js';
192
+ import hashkeyPro from './src/pro/hashkey.js';
191
193
  import hitbtcPro from './src/pro/hitbtc.js';
192
194
  import hollaexPro from './src/pro/hollaex.js';
193
195
  import htxPro from './src/pro/htx.js';
@@ -282,6 +284,7 @@ const exchanges = {
282
284
  'gate': gate,
283
285
  'gateio': gateio,
284
286
  'gemini': gemini,
287
+ 'hashkey': hashkey,
285
288
  'hitbtc': hitbtc,
286
289
  'hitbtc3': hitbtc3,
287
290
  'hollaex': hollaex,
@@ -370,6 +373,7 @@ const pro = {
370
373
  'gate': gatePro,
371
374
  'gateio': gateioPro,
372
375
  'gemini': geminiPro,
376
+ 'hashkey': hashkeyPro,
373
377
  'hitbtc': hitbtcPro,
374
378
  'hollaex': hollaexPro,
375
379
  'htx': htxPro,
@@ -416,6 +420,6 @@ pro.exchanges = Object.keys(pro);
416
420
  pro['Exchange'] = Exchange; // now the same for rest and ts
417
421
  //-----------------------------------------------------------------------------
418
422
  const ccxt = Object.assign({ version, Exchange, Precise, 'exchanges': Object.keys(exchanges), 'pro': pro }, exchanges, functions, errors);
419
- export { version, Exchange, exchanges, pro, Precise, functions, errors, 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, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseadvanced, coinbaseexchange, coinbaseinternational, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, hyperliquid, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, oxfun, p2b, paradex, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, tradeogre, upbit, vertex, wavesexchange, wazirx, whitebit, woo, woofipro, xt, yobit, zaif, zonda, };
423
+ export { version, Exchange, exchanges, pro, Precise, functions, errors, 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, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseadvanced, coinbaseexchange, coinbaseinternational, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hashkey, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, hyperliquid, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, oxfun, p2b, paradex, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, tradeogre, upbit, vertex, wavesexchange, wazirx, whitebit, woo, woofipro, xt, yobit, zaif, zonda, };
420
424
  export default ccxt;
421
425
  //-----------------------------------------------------------------------------
@@ -0,0 +1,70 @@
1
+ import { implicitReturnType } from '../base/types.js';
2
+ import { Exchange as _Exchange } from '../base/Exchange.js';
3
+ interface Exchange {
4
+ publicGetApiV1ExchangeInfo(params?: {}): Promise<implicitReturnType>;
5
+ publicGetQuoteV1Depth(params?: {}): Promise<implicitReturnType>;
6
+ publicGetQuoteV1Trades(params?: {}): Promise<implicitReturnType>;
7
+ publicGetQuoteV1Klines(params?: {}): Promise<implicitReturnType>;
8
+ publicGetQuoteV1Ticker24hr(params?: {}): Promise<implicitReturnType>;
9
+ publicGetQuoteV1TickerPrice(params?: {}): Promise<implicitReturnType>;
10
+ publicGetQuoteV1TickerBookTicker(params?: {}): Promise<implicitReturnType>;
11
+ publicGetQuoteV1DepthMerged(params?: {}): Promise<implicitReturnType>;
12
+ publicGetQuoteV1MarkPrice(params?: {}): Promise<implicitReturnType>;
13
+ publicGetQuoteV1Index(params?: {}): Promise<implicitReturnType>;
14
+ publicGetApiV1FuturesFundingRate(params?: {}): Promise<implicitReturnType>;
15
+ publicGetApiV1FuturesHistoryFundingRate(params?: {}): Promise<implicitReturnType>;
16
+ publicGetApiV1Ping(params?: {}): Promise<implicitReturnType>;
17
+ publicGetApiV1Time(params?: {}): Promise<implicitReturnType>;
18
+ privateGetApiV1SpotOrder(params?: {}): Promise<implicitReturnType>;
19
+ privateGetApiV1SpotOpenOrders(params?: {}): Promise<implicitReturnType>;
20
+ privateGetApiV1SpotTradeOrders(params?: {}): Promise<implicitReturnType>;
21
+ privateGetApiV1FuturesLeverage(params?: {}): Promise<implicitReturnType>;
22
+ privateGetApiV1FuturesOrder(params?: {}): Promise<implicitReturnType>;
23
+ privateGetApiV1FuturesOpenOrders(params?: {}): Promise<implicitReturnType>;
24
+ privateGetApiV1FuturesUserTrades(params?: {}): Promise<implicitReturnType>;
25
+ privateGetApiV1FuturesPositions(params?: {}): Promise<implicitReturnType>;
26
+ privateGetApiV1FuturesHistoryOrders(params?: {}): Promise<implicitReturnType>;
27
+ privateGetApiV1FuturesBalance(params?: {}): Promise<implicitReturnType>;
28
+ privateGetApiV1FuturesLiquidationAssignStatus(params?: {}): Promise<implicitReturnType>;
29
+ privateGetApiV1FuturesRiskLimit(params?: {}): Promise<implicitReturnType>;
30
+ privateGetApiV1FuturesCommissionRate(params?: {}): Promise<implicitReturnType>;
31
+ privateGetApiV1FuturesGetBestOrder(params?: {}): Promise<implicitReturnType>;
32
+ privateGetApiV1AccountVipInfo(params?: {}): Promise<implicitReturnType>;
33
+ privateGetApiV1Account(params?: {}): Promise<implicitReturnType>;
34
+ privateGetApiV1AccountTrades(params?: {}): Promise<implicitReturnType>;
35
+ privateGetApiV1AccountType(params?: {}): Promise<implicitReturnType>;
36
+ privateGetApiV1AccountCheckApiKey(params?: {}): Promise<implicitReturnType>;
37
+ privateGetApiV1AccountBalanceFlow(params?: {}): Promise<implicitReturnType>;
38
+ privateGetApiV1SpotSubAccountOpenOrders(params?: {}): Promise<implicitReturnType>;
39
+ privateGetApiV1SpotSubAccountTradeOrders(params?: {}): Promise<implicitReturnType>;
40
+ privateGetApiV1SubAccountTrades(params?: {}): Promise<implicitReturnType>;
41
+ privateGetApiV1FuturesSubAccountOpenOrders(params?: {}): Promise<implicitReturnType>;
42
+ privateGetApiV1FuturesSubAccountHistoryOrders(params?: {}): Promise<implicitReturnType>;
43
+ privateGetApiV1FuturesSubAccountUserTrades(params?: {}): Promise<implicitReturnType>;
44
+ privateGetApiV1AccountDepositAddress(params?: {}): Promise<implicitReturnType>;
45
+ privateGetApiV1AccountDepositOrders(params?: {}): Promise<implicitReturnType>;
46
+ privateGetApiV1AccountWithdrawOrders(params?: {}): Promise<implicitReturnType>;
47
+ privatePostApiV1UserDataStream(params?: {}): Promise<implicitReturnType>;
48
+ privatePostApiV1SpotOrderTest(params?: {}): Promise<implicitReturnType>;
49
+ privatePostApiV1SpotOrder(params?: {}): Promise<implicitReturnType>;
50
+ privatePostApiV11SpotOrder(params?: {}): Promise<implicitReturnType>;
51
+ privatePostApiV1SpotBatchOrders(params?: {}): Promise<implicitReturnType>;
52
+ privatePostApiV1FuturesLeverage(params?: {}): Promise<implicitReturnType>;
53
+ privatePostApiV1FuturesOrder(params?: {}): Promise<implicitReturnType>;
54
+ privatePostApiV1FuturesPositionTradingStop(params?: {}): Promise<implicitReturnType>;
55
+ privatePostApiV1FuturesBatchOrders(params?: {}): Promise<implicitReturnType>;
56
+ privatePostApiV1AccountAssetTransfer(params?: {}): Promise<implicitReturnType>;
57
+ privatePostApiV1AccountAuthAddress(params?: {}): Promise<implicitReturnType>;
58
+ privatePostApiV1AccountWithdraw(params?: {}): Promise<implicitReturnType>;
59
+ privatePutApiV1UserDataStream(params?: {}): Promise<implicitReturnType>;
60
+ privateDeleteApiV1SpotOrder(params?: {}): Promise<implicitReturnType>;
61
+ privateDeleteApiV1SpotOpenOrders(params?: {}): Promise<implicitReturnType>;
62
+ privateDeleteApiV1SpotCancelOrderByIds(params?: {}): Promise<implicitReturnType>;
63
+ privateDeleteApiV1FuturesOrder(params?: {}): Promise<implicitReturnType>;
64
+ privateDeleteApiV1FuturesBatchOrders(params?: {}): Promise<implicitReturnType>;
65
+ privateDeleteApiV1FuturesCancelOrderByIds(params?: {}): Promise<implicitReturnType>;
66
+ privateDeleteApiV1UserDataStream(params?: {}): Promise<implicitReturnType>;
67
+ }
68
+ declare abstract class Exchange extends _Exchange {
69
+ }
70
+ export default Exchange;
@@ -0,0 +1,11 @@
1
+ // ----------------------------------------------------------------------------
2
+
3
+ // PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
4
+ // https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
5
+ // EDIT THE CORRESPONDENT .ts FILE INSTEAD
6
+
7
+ // -------------------------------------------------------------------------------
8
+ import { Exchange as _Exchange } from '../base/Exchange.js';
9
+ class Exchange extends _Exchange {
10
+ }
11
+ export default Exchange;
@@ -6087,7 +6087,7 @@ export default class Exchange {
6087
6087
  if (method === 'fetchAccounts') {
6088
6088
  response = await this[method](params);
6089
6089
  }
6090
- else if (method === 'getLeverageTiersPaginated') {
6090
+ else if (method === 'getLeverageTiersPaginated' || method === 'fetchPositions') {
6091
6091
  response = await this[method](symbol, params);
6092
6092
  }
6093
6093
  else {
package/js/src/binance.js CHANGED
@@ -3855,12 +3855,14 @@ export default class binance extends Exchange {
3855
3855
  const marketId = this.safeString(ticker, 'symbol');
3856
3856
  const symbol = this.safeSymbol(marketId, market, undefined, marketType);
3857
3857
  const last = this.safeString(ticker, 'lastPrice');
3858
+ const wAvg = this.safeString(ticker, 'weightedAvgPrice');
3858
3859
  const isCoinm = ('baseVolume' in ticker);
3859
3860
  let baseVolume = undefined;
3860
3861
  let quoteVolume = undefined;
3861
3862
  if (isCoinm) {
3862
3863
  baseVolume = this.safeString(ticker, 'baseVolume');
3863
- quoteVolume = this.safeString(ticker, 'volume');
3864
+ // 'volume' field in inverse markets is not quoteVolume, but traded amount (per contracts)
3865
+ quoteVolume = Precise.stringMul(baseVolume, wAvg);
3864
3866
  }
3865
3867
  else {
3866
3868
  baseVolume = this.safeString(ticker, 'volume');
@@ -3876,7 +3878,7 @@ export default class binance extends Exchange {
3876
3878
  'bidVolume': this.safeString(ticker, 'bidQty'),
3877
3879
  'ask': this.safeString(ticker, 'askPrice'),
3878
3880
  'askVolume': this.safeString(ticker, 'askQty'),
3879
- 'vwap': this.safeString(ticker, 'weightedAvgPrice'),
3881
+ 'vwap': wAvg,
3880
3882
  'open': this.safeString2(ticker, 'openPrice', 'open'),
3881
3883
  'close': last,
3882
3884
  'last': last,
@@ -854,7 +854,7 @@ export default class bitfinex extends Exchange {
854
854
  * @method
855
855
  * @name bitfinex#fetchTickers
856
856
  * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
857
- * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
857
+ * @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
858
858
  * @param {object} [params] extra parameters specific to the exchange API endpoint
859
859
  * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
860
860
  */
@@ -863,7 +863,7 @@ export default class bitfinex extends Exchange {
863
863
  const response = await this.publicGetTickers(params);
864
864
  const result = {};
865
865
  for (let i = 0; i < response.length; i++) {
866
- const ticker = this.parseTicker({ 'result': response[i] });
866
+ const ticker = this.parseTicker(response[i]);
867
867
  const symbol = ticker['symbol'];
868
868
  result[symbol] = ticker;
869
869
  }