ccxt 4.5.0 → 4.5.1

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 (52) hide show
  1. package/README.md +4 -4
  2. package/dist/ccxt.browser.min.js +5 -5
  3. package/dist/cjs/ccxt.js +1 -1
  4. package/dist/cjs/src/base/Exchange.js +13 -0
  5. package/dist/cjs/src/coinbase.js +46 -34
  6. package/dist/cjs/src/gate.js +39 -18
  7. package/dist/cjs/src/gemini.js +1 -1
  8. package/dist/cjs/src/hibachi.js +1 -1
  9. package/dist/cjs/src/hyperliquid.js +16 -2
  10. package/dist/cjs/src/kraken.js +1 -12
  11. package/dist/cjs/src/krakenfutures.js +25 -25
  12. package/dist/cjs/src/mexc.js +2 -1
  13. package/dist/cjs/src/pro/bitget.js +193 -51
  14. package/dist/cjs/src/pro/bybit.js +8 -15
  15. package/dist/cjs/src/pro/gate.js +6 -1
  16. package/dist/cjs/src/pro/hyperliquid.js +4 -1
  17. package/dist/cjs/src/pro/kraken.js +1 -0
  18. package/dist/cjs/src/pro/lbank.js +55 -1
  19. package/dist/cjs/src/pro/mexc.js +1 -1
  20. package/dist/cjs/src/timex.js +35 -0
  21. package/dist/cjs/src/tradeogre.js +32 -0
  22. package/dist/cjs/src/wavesexchange.js +33 -0
  23. package/js/ccxt.d.ts +1 -1
  24. package/js/ccxt.js +1 -1
  25. package/js/src/base/Exchange.d.ts +1 -0
  26. package/js/src/base/Exchange.js +14 -1
  27. package/js/src/coinbase.js +46 -34
  28. package/js/src/gate.d.ts +2 -1
  29. package/js/src/gate.js +39 -18
  30. package/js/src/gemini.js +1 -1
  31. package/js/src/hibachi.js +1 -1
  32. package/js/src/hyperliquid.d.ts +1 -0
  33. package/js/src/hyperliquid.js +16 -2
  34. package/js/src/kraken.d.ts +0 -1
  35. package/js/src/kraken.js +1 -12
  36. package/js/src/krakenfutures.d.ts +24 -24
  37. package/js/src/krakenfutures.js +25 -25
  38. package/js/src/mexc.js +2 -1
  39. package/js/src/pro/bitget.d.ts +8 -2
  40. package/js/src/pro/bitget.js +193 -51
  41. package/js/src/pro/bybit.js +8 -15
  42. package/js/src/pro/gate.d.ts +5 -0
  43. package/js/src/pro/gate.js +6 -1
  44. package/js/src/pro/hyperliquid.js +4 -1
  45. package/js/src/pro/kraken.js +1 -0
  46. package/js/src/pro/lbank.d.ts +11 -1
  47. package/js/src/pro/lbank.js +55 -1
  48. package/js/src/pro/mexc.js +1 -1
  49. package/js/src/timex.js +35 -0
  50. package/js/src/tradeogre.js +32 -0
  51. package/js/src/wavesexchange.js +33 -0
  52. package/package.json +1 -1
@@ -28,17 +28,27 @@ class timex extends timex$1["default"] {
28
28
  'future': false,
29
29
  'option': false,
30
30
  'addMargin': false,
31
+ 'borrowCrossMargin': false,
32
+ 'borrowIsolatedMargin': false,
33
+ 'borrowMargin': false,
31
34
  'cancelOrder': true,
32
35
  'cancelOrders': true,
36
+ 'closeAllPositions': false,
37
+ 'closePosition': false,
33
38
  'createOrder': true,
34
39
  'createReduceOnlyOrder': false,
35
40
  'createStopLimitOrder': false,
36
41
  'createStopMarketOrder': false,
37
42
  'createStopOrder': false,
38
43
  'editOrder': true,
44
+ 'fetchAllGreeks': false,
39
45
  'fetchBalance': true,
46
+ 'fetchBorrowInterest': false,
47
+ 'fetchBorrowRate': false,
40
48
  'fetchBorrowRateHistories': false,
41
49
  'fetchBorrowRateHistory': false,
50
+ 'fetchBorrowRates': false,
51
+ 'fetchBorrowRatesPerSymbol': false,
42
52
  'fetchClosedOrders': true,
43
53
  'fetchCrossBorrowRate': false,
44
54
  'fetchCrossBorrowRates': false,
@@ -49,21 +59,40 @@ class timex extends timex$1["default"] {
49
59
  'fetchDepositAddressesByNetwork': false,
50
60
  'fetchDeposits': true,
51
61
  'fetchFundingHistory': false,
62
+ 'fetchFundingInterval': false,
63
+ 'fetchFundingIntervals': false,
52
64
  'fetchFundingRate': false,
53
65
  'fetchFundingRateHistory': false,
54
66
  'fetchFundingRates': false,
67
+ 'fetchGreeks': false,
55
68
  'fetchIndexOHLCV': false,
56
69
  'fetchIsolatedBorrowRate': false,
57
70
  'fetchIsolatedBorrowRates': false,
71
+ 'fetchIsolatedPositions': false,
58
72
  'fetchLeverage': false,
73
+ 'fetchLeverages': false,
59
74
  'fetchLeverageTiers': false,
75
+ 'fetchLiquidations': false,
76
+ 'fetchLongShortRatio': false,
77
+ 'fetchLongShortRatioHistory': false,
78
+ 'fetchMarginAdjustmentHistory': false,
60
79
  'fetchMarginMode': false,
80
+ 'fetchMarginModes': false,
81
+ 'fetchMarketLeverageTiers': false,
61
82
  'fetchMarkets': true,
62
83
  'fetchMarkOHLCV': false,
84
+ 'fetchMarkPrice': false,
85
+ 'fetchMarkPrices': false,
86
+ 'fetchMyLiquidations': false,
87
+ 'fetchMySettlementHistory': false,
63
88
  'fetchMyTrades': true,
64
89
  'fetchOHLCV': true,
90
+ 'fetchOpenInterest': false,
65
91
  'fetchOpenInterestHistory': false,
92
+ 'fetchOpenInterests': false,
66
93
  'fetchOpenOrders': true,
94
+ 'fetchOption': false,
95
+ 'fetchOptionChain': false,
67
96
  'fetchOrder': true,
68
97
  'fetchOrderBook': true,
69
98
  'fetchPosition': false,
@@ -74,15 +103,21 @@ class timex extends timex$1["default"] {
74
103
  'fetchPositionsHistory': false,
75
104
  'fetchPositionsRisk': false,
76
105
  'fetchPremiumIndexOHLCV': false,
106
+ 'fetchSettlementHistory': false,
77
107
  'fetchTicker': true,
78
108
  'fetchTickers': true,
79
109
  'fetchTime': true,
80
110
  'fetchTrades': true,
81
111
  'fetchTradingFee': true,
112
+ 'fetchUnderlyingAssets': false,
113
+ 'fetchVolatilityHistory': false,
82
114
  'fetchWithdrawal': false,
83
115
  'fetchWithdrawals': true,
84
116
  'reduceMargin': false,
117
+ 'repayCrossMargin': false,
118
+ 'repayIsolatedMargin': false,
85
119
  'setLeverage': false,
120
+ 'setMargin': false,
86
121
  'setMarginMode': false,
87
122
  'setPositionMode': false,
88
123
  },
@@ -29,6 +29,9 @@ class tradeogre extends tradeogre$1["default"] {
29
29
  'future': false,
30
30
  'option': false,
31
31
  'addMargin': false,
32
+ 'borrowCrossMargin': false,
33
+ 'borrowIsolatedMargin': false,
34
+ 'borrowMargin': false,
32
35
  'cancelAllOrders': true,
33
36
  'cancelOrder': true,
34
37
  'cancelOrders': false,
@@ -44,9 +47,14 @@ class tradeogre extends tradeogre$1["default"] {
44
47
  'createStopMarketOrder': false,
45
48
  'createStopOrder': false,
46
49
  'fetchAccounts': false,
50
+ 'fetchAllGreeks': false,
47
51
  'fetchBalance': true,
48
52
  'fetchBorrowInterest': false,
53
+ 'fetchBorrowRate': false,
54
+ 'fetchBorrowRateHistories': false,
49
55
  'fetchBorrowRateHistory': false,
56
+ 'fetchBorrowRates': false,
57
+ 'fetchBorrowRatesPerSymbol': false,
50
58
  'fetchClosedOrders': false,
51
59
  'fetchCrossBorrowRate': false,
52
60
  'fetchCrossBorrowRates': false,
@@ -57,23 +65,42 @@ class tradeogre extends tradeogre$1["default"] {
57
65
  'fetchDeposits': false,
58
66
  'fetchDepositsWithdrawals': false,
59
67
  'fetchFundingHistory': false,
68
+ 'fetchFundingInterval': false,
69
+ 'fetchFundingIntervals': false,
60
70
  'fetchFundingRate': false,
61
71
  'fetchFundingRateHistory': false,
62
72
  'fetchFundingRates': false,
73
+ 'fetchGreeks': false,
63
74
  'fetchIndexOHLCV': false,
64
75
  'fetchIsolatedBorrowRate': false,
65
76
  'fetchIsolatedBorrowRates': false,
77
+ 'fetchIsolatedPositions': false,
66
78
  'fetchLedger': false,
67
79
  'fetchLedgerEntry': false,
80
+ 'fetchLeverage': false,
81
+ 'fetchLeverages': false,
68
82
  'fetchLeverageTiers': false,
83
+ 'fetchLiquidations': false,
84
+ 'fetchLongShortRatio': false,
85
+ 'fetchLongShortRatioHistory': false,
86
+ 'fetchMarginAdjustmentHistory': false,
87
+ 'fetchMarginMode': false,
88
+ 'fetchMarginModes': false,
69
89
  'fetchMarketLeverageTiers': false,
70
90
  'fetchMarkets': true,
71
91
  'fetchMarkOHLCV': false,
92
+ 'fetchMarkPrice': false,
93
+ 'fetchMarkPrices': false,
94
+ 'fetchMyLiquidations': false,
95
+ 'fetchMySettlementHistory': false,
72
96
  'fetchMyTrades': false,
73
97
  'fetchOHLCV': true,
74
98
  'fetchOpenInterest': false,
75
99
  'fetchOpenInterestHistory': false,
100
+ 'fetchOpenInterests': false,
76
101
  'fetchOpenOrders': true,
102
+ 'fetchOption': false,
103
+ 'fetchOptionChain': false,
77
104
  'fetchOrder': true,
78
105
  'fetchOrderBook': true,
79
106
  'fetchOrderBooks': false,
@@ -87,6 +114,7 @@ class tradeogre extends tradeogre$1["default"] {
87
114
  'fetchPositionsHistory': false,
88
115
  'fetchPositionsRisk': false,
89
116
  'fetchPremiumIndexOHLCV': false,
117
+ 'fetchSettlementHistory': false,
90
118
  'fetchTicker': true,
91
119
  'fetchTickers': true,
92
120
  'fetchTrades': true,
@@ -95,10 +123,14 @@ class tradeogre extends tradeogre$1["default"] {
95
123
  'fetchTransactionFees': false,
96
124
  'fetchTransactions': false,
97
125
  'fetchTransfers': false,
126
+ 'fetchUnderlyingAssets': false,
127
+ 'fetchVolatilityHistory': false,
98
128
  'fetchWithdrawAddresses': false,
99
129
  'fetchWithdrawal': false,
100
130
  'fetchWithdrawals': false,
101
131
  'reduceMargin': false,
132
+ 'repayCrossMargin': false,
133
+ 'repayIsolatedMargin': false,
102
134
  'setLeverage': false,
103
135
  'setMargin': false,
104
136
  'setMarginMode': false,
@@ -31,6 +31,9 @@ class wavesexchange extends wavesexchange$1["default"] {
31
31
  'future': false,
32
32
  'option': false,
33
33
  'addMargin': false,
34
+ 'borrowCrossMargin': false,
35
+ 'borrowIsolatedMargin': false,
36
+ 'borrowMargin': false,
34
37
  'cancelOrder': true,
35
38
  'closeAllPositions': false,
36
39
  'closePosition': false,
@@ -40,9 +43,14 @@ class wavesexchange extends wavesexchange$1["default"] {
40
43
  'createStopLimitOrder': false,
41
44
  'createStopMarketOrder': false,
42
45
  'createStopOrder': false,
46
+ 'fetchAllGreeks': false,
43
47
  'fetchBalance': true,
48
+ 'fetchBorrowInterest': false,
49
+ 'fetchBorrowRate': false,
44
50
  'fetchBorrowRateHistories': false,
45
51
  'fetchBorrowRateHistory': false,
52
+ 'fetchBorrowRates': false,
53
+ 'fetchBorrowRatesPerSymbol': false,
46
54
  'fetchClosedOrders': true,
47
55
  'fetchCrossBorrowRate': false,
48
56
  'fetchCrossBorrowRates': false,
@@ -52,21 +60,40 @@ class wavesexchange extends wavesexchange$1["default"] {
52
60
  'fetchDepositWithdrawFee': 'emulated',
53
61
  'fetchDepositWithdrawFees': true,
54
62
  'fetchFundingHistory': false,
63
+ 'fetchFundingInterval': false,
64
+ 'fetchFundingIntervals': false,
55
65
  'fetchFundingRate': false,
56
66
  'fetchFundingRateHistory': false,
57
67
  'fetchFundingRates': false,
68
+ 'fetchGreeks': false,
58
69
  'fetchIndexOHLCV': false,
59
70
  'fetchIsolatedBorrowRate': false,
60
71
  'fetchIsolatedBorrowRates': false,
72
+ 'fetchIsolatedPositions': false,
61
73
  'fetchLeverage': false,
74
+ 'fetchLeverages': false,
62
75
  'fetchLeverageTiers': false,
76
+ 'fetchLiquidations': false,
77
+ 'fetchLongShortRatio': false,
78
+ 'fetchLongShortRatioHistory': false,
79
+ 'fetchMarginAdjustmentHistory': false,
63
80
  'fetchMarginMode': false,
81
+ 'fetchMarginModes': false,
82
+ 'fetchMarketLeverageTiers': false,
64
83
  'fetchMarkets': true,
65
84
  'fetchMarkOHLCV': false,
85
+ 'fetchMarkPrice': false,
86
+ 'fetchMarkPrices': false,
87
+ 'fetchMyLiquidations': false,
88
+ 'fetchMySettlementHistory': false,
66
89
  'fetchMyTrades': true,
67
90
  'fetchOHLCV': true,
91
+ 'fetchOpenInterest': false,
68
92
  'fetchOpenInterestHistory': false,
93
+ 'fetchOpenInterests': false,
69
94
  'fetchOpenOrders': true,
95
+ 'fetchOption': false,
96
+ 'fetchOptionChain': false,
70
97
  'fetchOrder': true,
71
98
  'fetchOrderBook': true,
72
99
  'fetchOrders': true,
@@ -78,14 +105,20 @@ class wavesexchange extends wavesexchange$1["default"] {
78
105
  'fetchPositionsHistory': false,
79
106
  'fetchPositionsRisk': false,
80
107
  'fetchPremiumIndexOHLCV': false,
108
+ 'fetchSettlementHistory': false,
81
109
  'fetchTicker': true,
82
110
  'fetchTickers': true,
83
111
  'fetchTrades': true,
84
112
  'fetchTransfer': false,
85
113
  'fetchTransfers': false,
114
+ 'fetchUnderlyingAssets': false,
115
+ 'fetchVolatilityHistory': false,
86
116
  'reduceMargin': false,
117
+ 'repayCrossMargin': false,
118
+ 'repayIsolatedMargin': false,
87
119
  'sandbox': true,
88
120
  'setLeverage': false,
121
+ 'setMargin': false,
89
122
  'setMarginMode': false,
90
123
  'setPositionMode': false,
91
124
  'signIn': 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, 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, LongShortRatio, OrderBooks, OpenInterests, ConstructorArgs } from './src/base/types.js';
6
6
  import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, RestrictedLocation, 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.100";
7
+ declare const version = "4.5.0";
8
8
  import alpaca from './src/alpaca.js';
9
9
  import apex from './src/apex.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, RestrictedLocation, 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.100';
41
+ const version = '4.5.0';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import alpaca from './src/alpaca.js';
@@ -422,6 +422,7 @@ export default class Exchange {
422
422
  handleDelta(bookside: any, delta: any): void;
423
423
  handleDeltasWithKeys(bookSide: any, deltas: any, priceKey?: IndexType, amountKey?: IndexType, countOrIdKey?: IndexType): void;
424
424
  getCacheIndex(orderbook: any, deltas: any): number;
425
+ arraysConcat(arraysOfArrays: any[]): any[];
425
426
  findTimeframe(timeframe: any, timeframes?: any): string;
426
427
  checkProxyUrlSettings(url?: Str, method?: Str, headers?: any, body?: any): any;
427
428
  urlEncoderForProxyUrl(targetUrl: string): string;
@@ -11,7 +11,7 @@ const { isNode, selfIsDefined, deepExtend, extend, clone, flatten, unique, index
11
11
  import { keys as keysFunc, values as valuesFunc, vwap as vwapFunc } from './functions.js';
12
12
  // import exceptions from "./errors.js"
13
13
  import { // eslint-disable-line object-curly-newline
14
- ExchangeError, BadSymbol, NullResponse, InvalidAddress, InvalidOrder, NotSupported, OperationFailed, BadResponse, AuthenticationError, DDoSProtection, RequestTimeout, NetworkError, InvalidProxySettings, ExchangeNotAvailable, ArgumentsRequired, RateLimitExceeded, BadRequest, UnsubscribeError } from "./errors.js";
14
+ ExchangeError, BadSymbol, NullResponse, InvalidAddress, InvalidOrder, NotSupported, OperationFailed, BadResponse, AuthenticationError, DDoSProtection, RequestTimeout, NetworkError, InvalidProxySettings, ExchangeNotAvailable, ArgumentsRequired, RateLimitExceeded, BadRequest, UnsubscribeError, ExchangeClosedByUser } from "./errors.js";
15
15
  import { Precise } from './Precise.js';
16
16
  //-----------------------------------------------------------------------------
17
17
  import WsClient from './ws/WsClient.js';
@@ -1144,8 +1144,14 @@ export default class Exchange {
1144
1144
  }
1145
1145
  }
1146
1146
  async close() {
1147
+ // test by running ts/src/pro/test/base/test.close.ts
1147
1148
  const clients = Object.values(this.clients || {});
1148
1149
  const closedClients = [];
1150
+ for (let i = 0; i < clients.length; i++) {
1151
+ const client = clients[i];
1152
+ client.error = new ExchangeClosedByUser(this.id + ' closedByUser');
1153
+ closedClients.push(client.close());
1154
+ }
1149
1155
  for (let i = 0; i < clients.length; i++) {
1150
1156
  const client = clients[i];
1151
1157
  delete this.clients[client.url];
@@ -1825,6 +1831,13 @@ export default class Exchange {
1825
1831
  // return the first index of the cache that can be applied to the orderbook or -1 if not possible
1826
1832
  return -1;
1827
1833
  }
1834
+ arraysConcat(arraysOfArrays) {
1835
+ let result = [];
1836
+ for (let i = 0; i < arraysOfArrays.length; i++) {
1837
+ result = this.arrayConcat(result, arraysOfArrays[i]);
1838
+ }
1839
+ return result;
1840
+ }
1828
1841
  findTimeframe(timeframe, timeframes = undefined) {
1829
1842
  if (timeframes === undefined) {
1830
1843
  timeframes = this.timeframes;
@@ -2249,34 +2249,44 @@ export default class coinbase extends Exchange {
2249
2249
  // fetchTickersV3
2250
2250
  //
2251
2251
  // [
2252
- // {
2253
- // "product_id": "TONE-USD",
2254
- // "price": "0.01523",
2255
- // "price_percentage_change_24h": "1.94109772423025",
2256
- // "volume_24h": "19773129",
2257
- // "volume_percentage_change_24h": "437.0170530929949",
2258
- // "base_increment": "1",
2259
- // "quote_increment": "0.00001",
2260
- // "quote_min_size": "1",
2261
- // "quote_max_size": "10000000",
2262
- // "base_min_size": "26.7187147229469674",
2263
- // "base_max_size": "267187147.2294696735908216",
2264
- // "base_name": "TE-FOOD",
2265
- // "quote_name": "US Dollar",
2266
- // "watched": false,
2267
- // "is_disabled": false,
2268
- // "new": false,
2269
- // "status": "online",
2270
- // "cancel_only": false,
2271
- // "limit_only": false,
2272
- // "post_only": false,
2273
- // "trading_disabled": false,
2274
- // "auction_mode": false,
2275
- // "product_type": "SPOT",
2276
- // "quote_currency_id": "USD",
2277
- // "base_currency_id": "TONE",
2278
- // "fcm_trading_session_details": null,
2279
- // "mid_market_price": ""
2252
+ // {
2253
+ // "product_id": "ETH-USD",
2254
+ // "price": "4471.59",
2255
+ // "price_percentage_change_24h": "0.14243387238731",
2256
+ // "volume_24h": "87329.92990204",
2257
+ // "volume_percentage_change_24h": "-60.7789801794578",
2258
+ // "base_increment": "0.00000001",
2259
+ // "quote_increment": "0.01",
2260
+ // "quote_min_size": "1",
2261
+ // "quote_max_size": "150000000",
2262
+ // "base_min_size": "0.00000001",
2263
+ // "base_max_size": "42000",
2264
+ // "base_name": "Ethereum",
2265
+ // "quote_name": "US Dollar",
2266
+ // "watched": false,
2267
+ // "is_disabled": false,
2268
+ // "new": false,
2269
+ // "status": "online",
2270
+ // "cancel_only": false,
2271
+ // "limit_only": false,
2272
+ // "post_only": false,
2273
+ // "trading_disabled": false,
2274
+ // "auction_mode": false,
2275
+ // "product_type": "SPOT",
2276
+ // "quote_currency_id": "USD",
2277
+ // "base_currency_id": "ETH",
2278
+ // "fcm_trading_session_details": null,
2279
+ // "mid_market_price": "",
2280
+ // "alias": "",
2281
+ // "alias_to": [ "ETH-USDC" ],
2282
+ // "base_display_symbol": "ETH",
2283
+ // "quote_display_symbol": "USD",
2284
+ // "view_only": false,
2285
+ // "price_increment": "0.01",
2286
+ // "display_name": "ETH-USD",
2287
+ // "product_venue": "CBE",
2288
+ // "approximate_quote_24h_volume": "390503641.25",
2289
+ // "new_at": "2023-01-01T00:00:00Z"
2280
2290
  // },
2281
2291
  // ...
2282
2292
  // ]
@@ -2307,10 +2317,12 @@ export default class coinbase extends Exchange {
2307
2317
  if (('bids' in ticker)) {
2308
2318
  const bids = this.safeList(ticker, 'bids', []);
2309
2319
  const asks = this.safeList(ticker, 'asks', []);
2310
- bid = this.safeNumber(bids[0], 'price');
2311
- bidVolume = this.safeNumber(bids[0], 'size');
2312
- ask = this.safeNumber(asks[0], 'price');
2313
- askVolume = this.safeNumber(asks[0], 'size');
2320
+ const firstBid = this.safeDict(bids, 0, {});
2321
+ const firstAsk = this.safeDict(asks, 0, {});
2322
+ bid = this.safeNumber(firstBid, 'price');
2323
+ bidVolume = this.safeNumber(firstBid, 'size');
2324
+ ask = this.safeNumber(firstAsk, 'price');
2325
+ askVolume = this.safeNumber(firstAsk, 'size');
2314
2326
  }
2315
2327
  const marketId = this.safeString(ticker, 'product_id');
2316
2328
  market = this.safeMarket(marketId, market);
@@ -2334,8 +2346,8 @@ export default class coinbase extends Exchange {
2334
2346
  'change': undefined,
2335
2347
  'percentage': this.safeNumber(ticker, 'price_percentage_change_24h'),
2336
2348
  'average': undefined,
2337
- 'baseVolume': undefined,
2338
- 'quoteVolume': undefined,
2349
+ 'baseVolume': this.safeNumber(ticker, 'volume_24h'),
2350
+ 'quoteVolume': this.safeNumber(ticker, 'approximate_quote_24h_volume'),
2339
2351
  'info': ticker,
2340
2352
  }, market);
2341
2353
  }
package/js/src/gate.d.ts CHANGED
@@ -42,7 +42,8 @@ export default class gate extends Exchange {
42
42
  */
43
43
  fetchMarkets(params?: {}): Promise<Market[]>;
44
44
  fetchSpotMarkets(params?: {}): Promise<any[]>;
45
- fetchContractMarkets(params?: {}): Promise<any[]>;
45
+ fetchSwapMarkets(params?: {}): Promise<any[]>;
46
+ fetchFutureMarkets(params?: {}): Promise<any[]>;
46
47
  parseContractMarket(market: any, settleId: any): {
47
48
  id: string;
48
49
  symbol: string;
package/js/src/gate.js CHANGED
@@ -750,6 +750,9 @@ export default class gate extends Exchange {
750
750
  'option': 'options',
751
751
  'options': 'options',
752
752
  },
753
+ 'fetchMarkets': {
754
+ 'types': ['spot', 'swap', 'future', 'option'],
755
+ },
753
756
  'swap': {
754
757
  'fetchMarkets': {
755
758
  'settlementCurrencies': ['usdt', 'btc'],
@@ -1227,22 +1230,30 @@ export default class gate extends Exchange {
1227
1230
  if (this.checkRequiredCredentials(false)) {
1228
1231
  await this.loadUnifiedStatus();
1229
1232
  }
1233
+ const rawPromises = [];
1230
1234
  const sandboxMode = this.safeBool(this.options, 'sandboxMode', false);
1231
- let rawPromises = [
1232
- this.fetchContractMarkets(params),
1233
- this.fetchOptionMarkets(params),
1234
- ];
1235
- if (!sandboxMode) {
1236
- // gate doesn't have a sandbox for spot markets
1237
- const mainnetOnly = [this.fetchSpotMarkets(params)];
1238
- rawPromises = this.arrayConcat(rawPromises, mainnetOnly);
1239
- }
1240
- const promises = await Promise.all(rawPromises);
1241
- const spotMarkets = this.safeValue(promises, 0, []);
1242
- const contractMarkets = this.safeValue(promises, 1, []);
1243
- const optionMarkets = this.safeValue(promises, 2, []);
1244
- const markets = this.arrayConcat(spotMarkets, contractMarkets);
1245
- return this.arrayConcat(markets, optionMarkets);
1235
+ const fetchMarketsOptions = this.safeDict(this.options, 'fetchMarkets');
1236
+ const types = this.safeList(fetchMarketsOptions, 'types', ['spot', 'swap', 'future', 'option']);
1237
+ for (let i = 0; i < types.length; i++) {
1238
+ const marketType = types[i];
1239
+ if (marketType === 'spot') {
1240
+ if (!sandboxMode) {
1241
+ // gate doesn't have a sandbox for spot markets
1242
+ rawPromises.push(this.fetchSpotMarkets(params));
1243
+ }
1244
+ }
1245
+ else if (marketType === 'swap') {
1246
+ rawPromises.push(this.fetchSwapMarkets(params));
1247
+ }
1248
+ else if (marketType === 'future') {
1249
+ rawPromises.push(this.fetchFutureMarkets(params));
1250
+ }
1251
+ else if (marketType === 'option') {
1252
+ rawPromises.push(this.fetchOptionMarkets(params));
1253
+ }
1254
+ }
1255
+ const results = await Promise.all(rawPromises);
1256
+ return this.arraysConcat(results);
1246
1257
  }
1247
1258
  async fetchSpotMarkets(params = {}) {
1248
1259
  const marginPromise = this.publicMarginGetCurrencyPairs(params);
@@ -1358,10 +1369,9 @@ export default class gate extends Exchange {
1358
1369
  }
1359
1370
  return result;
1360
1371
  }
1361
- async fetchContractMarkets(params = {}) {
1372
+ async fetchSwapMarkets(params = {}) {
1362
1373
  const result = [];
1363
1374
  const swapSettlementCurrencies = this.getSettlementCurrencies('swap', 'fetchMarkets');
1364
- const futureSettlementCurrencies = this.getSettlementCurrencies('future', 'fetchMarkets');
1365
1375
  for (let c = 0; c < swapSettlementCurrencies.length; c++) {
1366
1376
  const settleId = swapSettlementCurrencies[c];
1367
1377
  const request = {
@@ -1373,6 +1383,11 @@ export default class gate extends Exchange {
1373
1383
  result.push(parsedMarket);
1374
1384
  }
1375
1385
  }
1386
+ return result;
1387
+ }
1388
+ async fetchFutureMarkets(params = {}) {
1389
+ const result = [];
1390
+ const futureSettlementCurrencies = this.getSettlementCurrencies('future', 'fetchMarkets');
1376
1391
  for (let c = 0; c < futureSettlementCurrencies.length; c++) {
1377
1392
  const settleId = futureSettlementCurrencies[c];
1378
1393
  const request = {
@@ -2599,7 +2614,13 @@ export default class gate extends Exchange {
2599
2614
  //
2600
2615
  const [request, query] = this.prepareRequest(market, market['type'], params);
2601
2616
  if (limit !== undefined) {
2602
- request['limit'] = limit; // default 10, max 100
2617
+ if (market['spot']) {
2618
+ limit = Math.min(limit, 1000);
2619
+ }
2620
+ else {
2621
+ limit = Math.min(limit, 300);
2622
+ }
2623
+ request['limit'] = limit;
2603
2624
  }
2604
2625
  request['with_id'] = true;
2605
2626
  let response = undefined;
package/js/src/gemini.js CHANGED
@@ -264,7 +264,7 @@ export default class gemini extends Exchange {
264
264
  'fetchMarketFromWebRetries': 10,
265
265
  'fetchMarketsFromAPI': {
266
266
  'fetchDetailsForAllSymbols': false,
267
- 'quoteCurrencies': ['USDT', 'GUSD', 'USD', 'DAI', 'EUR', 'GBP', 'SGD', 'BTC', 'ETH', 'LTC', 'BCH', 'SOL'],
267
+ 'quoteCurrencies': ['USDT', 'GUSD', 'USD', 'DAI', 'EUR', 'GBP', 'SGD', 'BTC', 'ETH', 'LTC', 'BCH', 'SOL', 'USDC'],
268
268
  },
269
269
  'fetchMarkets': {
270
270
  'webApiEnable': true,
package/js/src/hibachi.js CHANGED
@@ -1596,7 +1596,7 @@ export default class hibachi extends Exchange {
1596
1596
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
1597
1597
  const endpoint = '/' + this.implodeParams(path, params);
1598
1598
  let url = this.urls['api'][api] + endpoint;
1599
- headers = {};
1599
+ headers = { 'Hibachi-Client': 'HibachiCCXT/unversioned' };
1600
1600
  if (method === 'GET') {
1601
1601
  const request = this.omit(params, this.extractParams(path));
1602
1602
  const query = this.urlencode(request);
@@ -400,6 +400,7 @@ export default class hyperliquid extends Exchange {
400
400
  * @param {string} id order id
401
401
  * @param {string} symbol unified symbol of the market the order was made in
402
402
  * @param {object} [params] extra parameters specific to the exchange API endpoint
403
+ * @param {string} [params.clientOrderId] client order id, (optional 128 bit hex string e.g. 0x1234567890abcdef1234567890abcdef)
403
404
  * @param {string} [params.user] user address, will default to this.walletAddress if not provided
404
405
  * @param {string} [params.subAccountAddress] sub account user address
405
406
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -2381,6 +2381,7 @@ export default class hyperliquid extends Exchange {
2381
2381
  * @param {string} id order id
2382
2382
  * @param {string} symbol unified symbol of the market the order was made in
2383
2383
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2384
+ * @param {string} [params.clientOrderId] client order id, (optional 128 bit hex string e.g. 0x1234567890abcdef1234567890abcdef)
2384
2385
  * @param {string} [params.user] user address, will default to this.walletAddress if not provided
2385
2386
  * @param {string} [params.subAccountAddress] sub account user address
2386
2387
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -2390,12 +2391,20 @@ export default class hyperliquid extends Exchange {
2390
2391
  [userAddress, params] = this.handlePublicAddress('fetchOrder', params);
2391
2392
  await this.loadMarkets();
2392
2393
  const market = this.safeMarket(symbol);
2393
- const isClientOrderId = id.length >= 34;
2394
+ const clientOrderId = this.safeString(params, 'clientOrderId');
2394
2395
  const request = {
2395
2396
  'type': 'orderStatus',
2396
- 'oid': isClientOrderId ? id : this.parseToNumeric(id),
2397
+ // 'oid': isClientOrderId ? id : this.parseToNumeric (id),
2397
2398
  'user': userAddress,
2398
2399
  };
2400
+ if (clientOrderId !== undefined) {
2401
+ params = this.omit(params, 'clientOrderId');
2402
+ request['oid'] = clientOrderId;
2403
+ }
2404
+ else {
2405
+ const isClientOrderId = id.length >= 34;
2406
+ request['oid'] = isClientOrderId ? id : this.parseToNumeric(id);
2407
+ }
2399
2408
  const response = await this.publicPostInfo(this.extend(request, params));
2400
2409
  //
2401
2410
  // {
@@ -3846,12 +3855,17 @@ export default class hyperliquid extends Exchange {
3846
3855
  // }
3847
3856
  // {"status":"ok","response":{"type":"order","data":{"statuses":[{"error":"Insufficient margin to place order. asset=84"}]}}}
3848
3857
  //
3858
+ // {"status":"unknownOid"}
3859
+ //
3849
3860
  const status = this.safeString(response, 'status', '');
3850
3861
  const error = this.safeString(response, 'error');
3851
3862
  let message = undefined;
3852
3863
  if (status === 'err') {
3853
3864
  message = this.safeString(response, 'response');
3854
3865
  }
3866
+ else if (status === 'unknownOid') {
3867
+ throw new OrderNotFound(this.id + ' ' + body); // {"status":"unknownOid"}
3868
+ }
3855
3869
  else if (error !== undefined) {
3856
3870
  message = error;
3857
3871
  }
@@ -17,7 +17,6 @@ export default class kraken extends Exchange {
17
17
  * @returns {object[]} an array of objects representing market data
18
18
  */
19
19
  fetchMarkets(params?: {}): Promise<Market[]>;
20
- safeCurrency(currencyId: any, currency?: Currency): import("./base/types.js").CurrencyInterface;
21
20
  /**
22
21
  * @method
23
22
  * @name kraken#fetchStatus