ccxt 4.3.1 → 4.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/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, Option, OptionChain, Conversion } from './src/base/types.js';
6
6
  import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout } from './src/base/errors.js';
7
- declare const version = "4.3.0";
7
+ declare const version = "4.3.1";
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, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout } from './src/base/errors.js';
39
39
  //-----------------------------------------------------------------------------
40
40
  // this is updated by vss.js when building
41
- const version = '4.3.1';
41
+ const version = '4.3.2';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import ace from './src/ace.js';
@@ -3,7 +3,7 @@ import { // eslint-disable-line object-curly-newline
3
3
  ExchangeError, AuthenticationError, DDoSProtection, RequestTimeout, ExchangeNotAvailable, RateLimitExceeded } from "./errors.js";
4
4
  import WsClient from './ws/WsClient.js';
5
5
  import { OrderBook as WsOrderBook, IndexedOrderBook, CountedOrderBook } from './ws/OrderBook.js';
6
- import type { Market, Trade, Ticker, OHLCV, OHLCVC, Order, OrderBook, Balance, Balances, Dictionary, Transaction, DepositAddressResponse, Currency, MinMax, IndexType, Int, OrderType, OrderSide, Position, FundingRate, DepositWithdrawFeeNetwork, LedgerEntry, BorrowInterest, OpenInterest, LeverageTier, TransferEntry, FundingRateHistory, Liquidation, FundingHistory, OrderRequest, MarginMode, Tickers, Greeks, Option, OptionChain, Str, Num, MarketInterface, CurrencyInterface, BalanceAccount, MarginModes, MarketType, Leverage, Leverages, LastPrice, LastPrices, Account, Strings, MarginModification, TradingFeeInterface, Currencies, TradingFees, Conversion } from './types.js';
6
+ import type { Market, Trade, Ticker, OHLCV, OHLCVC, Order, OrderBook, Balance, Balances, Dictionary, Transaction, DepositAddressResponse, Currency, MinMax, IndexType, Int, OrderType, OrderSide, Position, FundingRate, DepositWithdrawFeeNetwork, LedgerEntry, BorrowInterest, OpenInterest, LeverageTier, TransferEntry, FundingRateHistory, Liquidation, FundingHistory, OrderRequest, MarginMode, Tickers, Greeks, Option, OptionChain, Str, Num, MarketInterface, CurrencyInterface, BalanceAccount, MarginModes, MarketType, Leverage, Leverages, LastPrice, LastPrices, Account, Strings, MarginModification, TradingFeeInterface, Currencies, TradingFees, Conversion, CancellationRequest } from './types.js';
7
7
  export type { Market, Trade, Fee, Ticker, OHLCV, OHLCVC, Order, OrderBook, Balance, Balances, Dictionary, Transaction, DepositAddressResponse, Currency, MinMax, IndexType, Int, OrderType, OrderSide, Position, LedgerEntry, BorrowInterest, OpenInterest, LeverageTier, TransferEntry, BorrowRate, FundingRateHistory, Liquidation, FundingHistory, OrderRequest, MarginMode, Tickers, Greeks, Option, OptionChain, Str, Num, MarketInterface, CurrencyInterface, BalanceAccount, MarginModes, MarketType, Leverage, Leverages, LastPrice, LastPrices, Account, Strings, Conversion } from './types.js';
8
8
  import { ArrayCache, ArrayCacheByTimestamp } from './ws/Cache.js';
9
9
  import { OrderBook as Ob } from './ws/OrderBook.js';
@@ -894,6 +894,7 @@ export default class Exchange {
894
894
  cancelOrderWs(id: string, symbol?: Str, params?: {}): Promise<{}>;
895
895
  cancelOrdersWs(ids: string[], symbol?: Str, params?: {}): Promise<{}>;
896
896
  cancelAllOrders(symbol?: Str, params?: {}): Promise<{}>;
897
+ cancelOrdersForSymbols(orders: CancellationRequest[], params?: {}): Promise<{}>;
897
898
  cancelAllOrdersWs(symbol?: Str, params?: {}): Promise<{}>;
898
899
  cancelUnifiedOrder(order: any, params?: {}): Promise<{}>;
899
900
  fetchOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
@@ -4464,6 +4464,9 @@ export default class Exchange {
4464
4464
  async cancelAllOrders(symbol = undefined, params = {}) {
4465
4465
  throw new NotSupported(this.id + ' cancelAllOrders() is not supported yet');
4466
4466
  }
4467
+ async cancelOrdersForSymbols(orders, params = {}) {
4468
+ throw new NotSupported(this.id + ' cancelOrdersForSymbols() is not supported yet');
4469
+ }
4467
4470
  async cancelAllOrdersWs(symbol = undefined, params = {}) {
4468
4471
  throw new NotSupported(this.id + ' cancelAllOrdersWs() is not supported yet');
4469
4472
  }
@@ -393,6 +393,11 @@ export interface OrderRequest {
393
393
  price?: number | undefined;
394
394
  params?: any;
395
395
  }
396
+ export interface CancellationRequest {
397
+ id: string;
398
+ clientOrderId?: string;
399
+ symbol: string;
400
+ }
396
401
  export interface FundingHistory {
397
402
  info: any;
398
403
  symbol: string;
package/js/src/bitget.js CHANGED
@@ -8653,6 +8653,8 @@ export default class bitget extends Exchange {
8653
8653
  //
8654
8654
  // spot
8655
8655
  //
8656
+ // {"code":"00000","msg":"success","requestTime":1713294492511,"data":[...]}"
8657
+ //
8656
8658
  // {"status":"fail","err_code":"01001","err_msg":"系统异常,请稍后重试"}
8657
8659
  // {"status":"error","ts":1595594160149,"err_code":"invalid-parameter","err_msg":"invalid size, valid range: [1,2000]"}
8658
8660
  // {"status":"error","ts":1595684716042,"err_code":"invalid-parameter","err_msg":"illegal sign invalid"}
@@ -8674,14 +8676,14 @@ export default class bitget extends Exchange {
8674
8676
  // {"code":"40108","msg":"","requestTime":1595885064600,"data":null}
8675
8677
  // {"order_id":"513468410013679613","client_oid":null,"symbol":"ethusd","result":false,"err_code":"order_no_exist_error","err_msg":"订单不存在!"}
8676
8678
  //
8677
- const message = this.safeString(response, 'err_msg');
8678
- const errorCode = this.safeString2(response, 'code', 'err_code');
8679
+ const message = this.safeString2(response, 'err_msg', 'msg');
8679
8680
  const feedback = this.id + ' ' + body;
8680
- const nonEmptyMessage = ((message !== undefined) && (message !== ''));
8681
+ const nonEmptyMessage = ((message !== undefined) && (message !== '') && (message !== 'success'));
8681
8682
  if (nonEmptyMessage) {
8682
8683
  this.throwExactlyMatchedException(this.exceptions['exact'], message, feedback);
8683
8684
  this.throwBroadlyMatchedException(this.exceptions['broad'], message, feedback);
8684
8685
  }
8686
+ const errorCode = this.safeString2(response, 'code', 'err_code');
8685
8687
  const nonZeroErrorCode = (errorCode !== undefined) && (errorCode !== '00000');
8686
8688
  if (nonZeroErrorCode) {
8687
8689
  this.throwExactlyMatchedException(this.exceptions['exact'], errorCode, feedback);
@@ -20,9 +20,10 @@ export default class coinbase extends Exchange {
20
20
  describe() {
21
21
  return this.deepExtend(super.describe(), {
22
22
  'id': 'coinbase',
23
- 'name': 'Coinbase',
23
+ 'name': 'Coinbase Advanced',
24
24
  'countries': ['US'],
25
25
  'pro': true,
26
+ 'certified': true,
26
27
  // rate-limits:
27
28
  // ADVANCED API: https://docs.cloud.coinbase.com/advanced-trade-api/docs/rest-api-rate-limits
28
29
  // - max 30 req/second for private data, 10 req/s for public data
@@ -62,7 +62,7 @@ export default class coinbasepro extends Exchange {
62
62
  fetchDepositsWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
63
63
  fetchDeposits(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
64
64
  fetchWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
65
- parseTransactionStatus(transaction: any): "ok" | "canceled" | "failed" | "pending";
65
+ parseTransactionStatus(transaction: any): "ok" | "failed" | "canceled" | "pending";
66
66
  parseTransaction(transaction: any, currency?: Currency): Transaction;
67
67
  createDepositAddress(code: string, params?: {}): Promise<{
68
68
  currency: string;
@@ -19,7 +19,7 @@ export default class coinbasepro extends Exchange {
19
19
  describe() {
20
20
  return this.deepExtend(super.describe(), {
21
21
  'id': 'coinbasepro',
22
- 'name': 'Coinbase Pro',
22
+ 'name': 'Coinbase Pro(Deprecated)',
23
23
  'countries': ['US'],
24
24
  'rateLimit': 100,
25
25
  'userAgent': this.userAgents['chrome'],
package/js/src/coinex.js CHANGED
@@ -815,65 +815,59 @@ export default class coinex extends Exchange {
815
815
  // Spot fetchTicker, fetchTickers
816
816
  //
817
817
  // {
818
- // "vol": "293.19415130",
819
- // "low": "38200.00",
820
- // "open": "39514.99",
821
- // "high": "39530.00",
822
- // "last": "38649.57",
823
- // "buy": "38640.20",
824
- // "buy_amount": "0.22800000",
825
- // "sell": "38640.21",
826
- // "sell_amount": "0.02828439"
818
+ // "close": "62393.47",
819
+ // "high": "64106.41",
820
+ // "last": "62393.47",
821
+ // "low": "59650.01",
822
+ // "market": "BTCUSDT",
823
+ // "open": "61616.15",
824
+ // "period": 86400,
825
+ // "value": "28711273.4065667262",
826
+ // "volume": "461.76557205",
827
+ // "volume_buy": "11.41506354",
828
+ // "volume_sell": "7.3240169"
827
829
  // }
828
830
  //
829
831
  // Swap fetchTicker, fetchTickers
830
832
  //
831
833
  // {
832
- // "vol": "7714.2175",
833
- // "low": "38200.00",
834
- // "open": "39569.23",
835
- // "high": "39569.23",
836
- // "last": "38681.37",
837
- // "buy": "38681.36",
834
+ // "close": "62480.08",
835
+ // "high": "64100",
836
+ // "index_price": "62443.05",
837
+ // "last": "62480.08",
838
+ // "low": "59600",
839
+ // "mark_price": "62443.05",
840
+ // "market": "BTCUSDT",
841
+ // "open": "61679.98",
838
842
  // "period": 86400,
839
- // "funding_time": 462,
840
- // "position_amount": "296.7552",
841
- // "funding_rate_last": "0.00009395",
842
- // "funding_rate_next": "0.00000649",
843
- // "funding_rate_predict": "-0.00007176",
844
- // "insurance": "16464465.09431942163278132918",
845
- // "sign_price": "38681.93",
846
- // "index_price": "38681.69500000",
847
- // "sell_total": "16.6039",
848
- // "buy_total": "19.8481",
849
- // "buy_amount": "4.6315",
850
- // "sell": "38681.37",
851
- // "sell_amount": "11.4044"
843
+ // "value": "180226025.69791713065326633165",
844
+ // "volume": "2900.2218",
845
+ // "volume_buy": "7.3847",
846
+ // "volume_sell": "6.1249"
852
847
  // }
853
848
  //
854
- const timestamp = this.safeInteger(ticker, 'date');
855
- const symbol = this.safeSymbol(undefined, market);
856
- ticker = this.safeValue(ticker, 'ticker', {});
857
- const last = this.safeString(ticker, 'last');
849
+ const marketType = ('mark_price' in ticker) ? 'swap' : 'spot';
850
+ const marketId = this.safeString(ticker, 'market');
851
+ const symbol = this.safeSymbol(marketId, market, undefined, marketType);
858
852
  return this.safeTicker({
859
853
  'symbol': symbol,
860
- 'timestamp': timestamp,
861
- 'datetime': this.iso8601(timestamp),
854
+ 'timestamp': undefined,
855
+ 'datetime': undefined,
862
856
  'high': this.safeString(ticker, 'high'),
863
857
  'low': this.safeString(ticker, 'low'),
864
- 'bid': this.safeString(ticker, 'buy'),
865
- 'bidVolume': this.safeString(ticker, 'buy_amount'),
866
- 'ask': this.safeString(ticker, 'sell'),
867
- 'askVolume': this.safeString(ticker, 'sell_amount'),
858
+ 'bid': undefined,
859
+ 'bidVolume': this.safeString(ticker, 'volume_buy'),
860
+ 'ask': undefined,
861
+ 'askVolume': this.safeString(ticker, 'volume_sell'),
868
862
  'vwap': undefined,
869
863
  'open': this.safeString(ticker, 'open'),
870
- 'close': last,
871
- 'last': last,
864
+ 'close': this.safeString(ticker, 'close'),
865
+ 'last': this.safeString(ticker, 'last'),
872
866
  'previousClose': undefined,
873
867
  'change': undefined,
874
868
  'percentage': undefined,
875
869
  'average': undefined,
876
- 'baseVolume': this.safeString2(ticker, 'vol', 'volume'),
870
+ 'baseVolume': this.safeString(ticker, 'volume'),
877
871
  'quoteVolume': undefined,
878
872
  'info': ticker,
879
873
  }, market);
@@ -883,8 +877,8 @@ export default class coinex extends Exchange {
883
877
  * @method
884
878
  * @name coinex#fetchTicker
885
879
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
886
- * @see https://viabtc.github.io/coinex_api_en_doc/spot/#docsspot001_market007_single_market_ticker
887
- * @see https://viabtc.github.io/coinex_api_en_doc/futures/#docsfutures001_http008_market_ticker
880
+ * @see https://docs.coinex.com/api/v2/spot/market/http/list-market-ticker
881
+ * @see https://docs.coinex.com/api/v2/futures/market/http/list-market-ticker
888
882
  * @param {string} symbol unified symbol of the market to fetch the ticker for
889
883
  * @param {object} [params] extra parameters specific to the exchange API endpoint
890
884
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -896,30 +890,31 @@ export default class coinex extends Exchange {
896
890
  };
897
891
  let response = undefined;
898
892
  if (market['swap']) {
899
- response = await this.v1PerpetualPublicGetMarketTicker(this.extend(request, params));
893
+ response = await this.v2PublicGetFuturesTicker(this.extend(request, params));
900
894
  }
901
895
  else {
902
- response = await this.v1PublicGetMarketTicker(this.extend(request, params));
896
+ response = await this.v2PublicGetSpotTicker(this.extend(request, params));
903
897
  }
904
898
  //
905
899
  // Spot
906
900
  //
907
901
  // {
908
902
  // "code": 0,
909
- // "data": {
910
- // "date": 1651306913414,
911
- // "ticker": {
912
- // "vol": "293.19415130",
913
- // "low": "38200.00",
914
- // "open": "39514.99",
915
- // "high": "39530.00",
916
- // "last": "38649.57",
917
- // "buy": "38640.20",
918
- // "buy_amount": "0.22800000",
919
- // "sell": "38640.21",
920
- // "sell_amount": "0.02828439"
903
+ // "data": [
904
+ // {
905
+ // "close": "62393.47",
906
+ // "high": "64106.41",
907
+ // "last": "62393.47",
908
+ // "low": "59650.01",
909
+ // "market": "BTCUSDT",
910
+ // "open": "61616.15",
911
+ // "period": 86400,
912
+ // "value": "28711273.4065667262",
913
+ // "volume": "461.76557205",
914
+ // "volume_buy": "11.41506354",
915
+ // "volume_sell": "7.3240169"
921
916
  // }
922
- // },
917
+ // ],
923
918
  // "message": "OK"
924
919
  // }
925
920
  //
@@ -927,43 +922,37 @@ export default class coinex extends Exchange {
927
922
  //
928
923
  // {
929
924
  // "code": 0,
930
- // "data": {
931
- // "date": 1651306641500,
932
- // "ticker": {
933
- // "vol": "7714.2175",
934
- // "low": "38200.00",
935
- // "open": "39569.23",
936
- // "high": "39569.23",
937
- // "last": "38681.37",
938
- // "buy": "38681.36",
925
+ // "data": [
926
+ // {
927
+ // "close": "62480.08",
928
+ // "high": "64100",
929
+ // "index_price": "62443.05",
930
+ // "last": "62480.08",
931
+ // "low": "59600",
932
+ // "mark_price": "62443.05",
933
+ // "market": "BTCUSDT",
934
+ // "open": "61679.98",
939
935
  // "period": 86400,
940
- // "funding_time": 462,
941
- // "position_amount": "296.7552",
942
- // "funding_rate_last": "0.00009395",
943
- // "funding_rate_next": "0.00000649",
944
- // "funding_rate_predict": "-0.00007176",
945
- // "insurance": "16464465.09431942163278132918",
946
- // "sign_price": "38681.93",
947
- // "index_price": "38681.69500000",
948
- // "sell_total": "16.6039",
949
- // "buy_total": "19.8481",
950
- // "buy_amount": "4.6315",
951
- // "sell": "38681.37",
952
- // "sell_amount": "11.4044"
936
+ // "value": "180226025.69791713065326633165",
937
+ // "volume": "2900.2218",
938
+ // "volume_buy": "7.3847",
939
+ // "volume_sell": "6.1249"
953
940
  // }
954
- // },
941
+ // ],
955
942
  // "message": "OK"
956
943
  // }
957
944
  //
958
- return this.parseTicker(response['data'], market);
945
+ const data = this.safeList(response, 'data', []);
946
+ const result = this.safeDict(data, 0, {});
947
+ return this.parseTicker(result, market);
959
948
  }
960
949
  async fetchTickers(symbols = undefined, params = {}) {
961
950
  /**
962
951
  * @method
963
952
  * @name coinex#fetchTickers
964
953
  * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
965
- * @see https://viabtc.github.io/coinex_api_en_doc/spot/#docsspot001_market008_all_market_ticker
966
- * @see https://viabtc.github.io/coinex_api_en_doc/futures/#docsfutures001_http009_market_ticker_all
954
+ * @see https://docs.coinex.com/api/v2/spot/market/http/list-market-ticker
955
+ * @see https://docs.coinex.com/api/v2/futures/market/http/list-market-ticker
967
956
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
968
957
  * @param {object} [params] extra parameters specific to the exchange API endpoint
969
958
  * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -978,86 +967,60 @@ export default class coinex extends Exchange {
978
967
  const [marketType, query] = this.handleMarketTypeAndParams('fetchTickers', market, params);
979
968
  let response = undefined;
980
969
  if (marketType === 'swap') {
981
- response = await this.v1PerpetualPublicGetMarketTickerAll(query);
970
+ response = await this.v2PublicGetFuturesTicker(query);
982
971
  }
983
972
  else {
984
- response = await this.v1PublicGetMarketTickerAll();
973
+ response = await this.v2PublicGetSpotTicker(query);
985
974
  }
986
975
  //
987
976
  // Spot
988
977
  //
989
978
  // {
990
979
  // "code": 0,
991
- // "data": {
992
- // "date": 1651519857284,
993
- // "ticker": {
994
- // "PSPUSDT": {
995
- // "vol": "127131.55227034",
996
- // "low": "0.0669",
997
- // "open": "0.0688",
998
- // "high": "0.0747",
999
- // "last": "0.0685",
1000
- // "buy": "0.0676",
1001
- // "buy_amount": "702.70117866",
1002
- // "sell": "0.0690",
1003
- // "sell_amount": "686.76861562"
1004
- // },
980
+ // "data": [
981
+ // {
982
+ // "close": "62393.47",
983
+ // "high": "64106.41",
984
+ // "last": "62393.47",
985
+ // "low": "59650.01",
986
+ // "market": "BTCUSDT",
987
+ // "open": "61616.15",
988
+ // "period": 86400,
989
+ // "value": "28711273.4065667262",
990
+ // "volume": "461.76557205",
991
+ // "volume_buy": "11.41506354",
992
+ // "volume_sell": "7.3240169"
1005
993
  // }
1006
- // },
1007
- // "message": "Ok"
994
+ // ],
995
+ // "message": "OK"
1008
996
  // }
1009
997
  //
1010
998
  // Swap
1011
999
  //
1012
1000
  // {
1013
1001
  // "code": 0,
1014
- // "data": {
1015
- // "date": 1651520268644,
1016
- // "ticker": {
1017
- // "KAVAUSDT": {
1018
- // "vol": "834924",
1019
- // "low": "3.9418",
1020
- // "open": "4.1834",
1021
- // "high": "4.4328",
1022
- // "last": "4.0516",
1023
- // "buy": "4.0443",
1024
- // "period": 86400,
1025
- // "funding_time": 262,
1026
- // "position_amount": "16111",
1027
- // "funding_rate_last": "-0.00069514",
1028
- // "funding_rate_next": "-0.00061009",
1029
- // "funding_rate_predict": "-0.00055812",
1030
- // "insurance": "16532425.53026084124483989548",
1031
- // "sign_price": "4.0516",
1032
- // "index_price": "4.0530",
1033
- // "sell_total": "59446",
1034
- // "buy_total": "62423",
1035
- // "buy_amount": "959",
1036
- // "sell": "4.0466",
1037
- // "sell_amount": "141"
1038
- // },
1002
+ // "data": [
1003
+ // {
1004
+ // "close": "62480.08",
1005
+ // "high": "64100",
1006
+ // "index_price": "62443.05",
1007
+ // "last": "62480.08",
1008
+ // "low": "59600",
1009
+ // "mark_price": "62443.05",
1010
+ // "market": "BTCUSDT",
1011
+ // "open": "61679.98",
1012
+ // "period": 86400,
1013
+ // "value": "180226025.69791713065326633165",
1014
+ // "volume": "2900.2218",
1015
+ // "volume_buy": "7.3847",
1016
+ // "volume_sell": "6.1249"
1039
1017
  // }
1040
- // },
1041
- // "message": "Ok"
1018
+ // ],
1019
+ // "message": "OK"
1042
1020
  // }
1043
1021
  //
1044
- const data = this.safeValue(response, 'data');
1045
- const timestamp = this.safeInteger(data, 'date');
1046
- const tickers = this.safeValue(data, 'ticker', {});
1047
- const marketIds = Object.keys(tickers);
1048
- const result = {};
1049
- for (let i = 0; i < marketIds.length; i++) {
1050
- const marketId = marketIds[i];
1051
- const marketInner = this.safeMarket(marketId, undefined, undefined, marketType);
1052
- const symbol = marketInner['symbol'];
1053
- const ticker = this.parseTicker({
1054
- 'date': timestamp,
1055
- 'ticker': tickers[marketId],
1056
- }, marketInner);
1057
- ticker['symbol'] = symbol;
1058
- result[symbol] = ticker;
1059
- }
1060
- return this.filterByArrayTickers(result, 'symbol', symbols);
1022
+ const data = this.safeList(response, 'data', []);
1023
+ return this.parseTickers(data, symbols);
1061
1024
  }
1062
1025
  async fetchTime(params = {}) {
1063
1026
  /**
@@ -1628,7 +1628,7 @@ export default class cryptocom extends Exchange {
1628
1628
  */
1629
1629
  [tag, params] = this.handleWithdrawTagAndParams(tag, params);
1630
1630
  await this.loadMarkets();
1631
- const currency = this.currency(code);
1631
+ const currency = this.safeCurrency(code); // for instance, USDC is not inferred from markets but it's still available
1632
1632
  const request = {
1633
1633
  'currency': currency['id'],
1634
1634
  'amount': amount,
@@ -1674,7 +1674,7 @@ export default class cryptocom extends Exchange {
1674
1674
  * @returns {object} a dictionary of [address structures]{@link https://docs.ccxt.com/#/?id=address-structure} indexed by the network
1675
1675
  */
1676
1676
  await this.loadMarkets();
1677
- const currency = this.currency(code);
1677
+ const currency = this.safeCurrency(code);
1678
1678
  const request = {
1679
1679
  'currency': currency['id'],
1680
1680
  };
@@ -1773,7 +1773,7 @@ export default class cryptocom extends Exchange {
1773
1773
  let currency = undefined;
1774
1774
  const request = {};
1775
1775
  if (code !== undefined) {
1776
- currency = this.currency(code);
1776
+ currency = this.safeCurrency(code);
1777
1777
  request['currency'] = currency['id'];
1778
1778
  }
1779
1779
  if (since !== undefined) {
@@ -1832,7 +1832,7 @@ export default class cryptocom extends Exchange {
1832
1832
  let currency = undefined;
1833
1833
  const request = {};
1834
1834
  if (code !== undefined) {
1835
- currency = this.currency(code);
1835
+ currency = this.safeCurrency(code);
1836
1836
  request['currency'] = currency['id'];
1837
1837
  }
1838
1838
  if (since !== undefined) {
@@ -2348,7 +2348,7 @@ export default class cryptocom extends Exchange {
2348
2348
  const request = {};
2349
2349
  let currency = undefined;
2350
2350
  if (code !== undefined) {
2351
- currency = this.currency(code);
2351
+ currency = this.safeCurrency(code);
2352
2352
  }
2353
2353
  if (since !== undefined) {
2354
2354
  request['start_time'] = since;
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/hyperliquid.js';
2
- import type { Market, TransferEntry, Balances, Int, OrderBook, OHLCV, Str, FundingRateHistory, Order, OrderType, OrderSide, Trade, Strings, Position, OrderRequest, Dict, Num, MarginModification, Currencies } from './base/types.js';
2
+ import type { Market, TransferEntry, Balances, Int, OrderBook, OHLCV, Str, FundingRateHistory, Order, OrderType, OrderSide, Trade, Strings, Position, OrderRequest, Dict, Num, MarginModification, Currencies, CancellationRequest } from './base/types.js';
3
3
  /**
4
4
  * @class hyperliquid
5
5
  * @augments Exchange
@@ -55,6 +55,7 @@ export default class hyperliquid extends Exchange {
55
55
  createOrders(orders: OrderRequest[], params?: {}): Promise<Order[]>;
56
56
  cancelOrder(id: string, symbol?: Str, params?: {}): Promise<any>;
57
57
  cancelOrders(ids: string[], symbol?: Str, params?: {}): Promise<any>;
58
+ cancelOrdersForSymbols(orders: CancellationRequest[], params?: {}): Promise<any>;
58
59
  editOrder(id: string, symbol: string, type: string, side: string, amount?: Num, price?: Num, params?: {}): Promise<Order>;
59
60
  fetchFundingRateHistory(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<FundingRateHistory[]>;
60
61
  fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;