ccxt 4.5.0__py2.py3-none-any.whl → 4.5.1__py2.py3-none-any.whl

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.
@@ -33,6 +33,9 @@ class tradeogre(Exchange, ImplicitAPI):
33
33
  'future': False,
34
34
  'option': False,
35
35
  'addMargin': False,
36
+ 'borrowCrossMargin': False,
37
+ 'borrowIsolatedMargin': False,
38
+ 'borrowMargin': False,
36
39
  'cancelAllOrders': True,
37
40
  'cancelOrder': True,
38
41
  'cancelOrders': False,
@@ -48,9 +51,14 @@ class tradeogre(Exchange, ImplicitAPI):
48
51
  'createStopMarketOrder': False,
49
52
  'createStopOrder': False,
50
53
  'fetchAccounts': False,
54
+ 'fetchAllGreeks': False,
51
55
  'fetchBalance': True,
52
56
  'fetchBorrowInterest': False,
57
+ 'fetchBorrowRate': False,
58
+ 'fetchBorrowRateHistories': False,
53
59
  'fetchBorrowRateHistory': False,
60
+ 'fetchBorrowRates': False,
61
+ 'fetchBorrowRatesPerSymbol': False,
54
62
  'fetchClosedOrders': False,
55
63
  'fetchCrossBorrowRate': False,
56
64
  'fetchCrossBorrowRates': False,
@@ -61,23 +69,42 @@ class tradeogre(Exchange, ImplicitAPI):
61
69
  'fetchDeposits': False,
62
70
  'fetchDepositsWithdrawals': False,
63
71
  'fetchFundingHistory': False,
72
+ 'fetchFundingInterval': False,
73
+ 'fetchFundingIntervals': False,
64
74
  'fetchFundingRate': False,
65
75
  'fetchFundingRateHistory': False,
66
76
  'fetchFundingRates': False,
77
+ 'fetchGreeks': False,
67
78
  'fetchIndexOHLCV': False,
68
79
  'fetchIsolatedBorrowRate': False,
69
80
  'fetchIsolatedBorrowRates': False,
81
+ 'fetchIsolatedPositions': False,
70
82
  'fetchLedger': False,
71
83
  'fetchLedgerEntry': False,
84
+ 'fetchLeverage': False,
85
+ 'fetchLeverages': False,
72
86
  'fetchLeverageTiers': False,
87
+ 'fetchLiquidations': False,
88
+ 'fetchLongShortRatio': False,
89
+ 'fetchLongShortRatioHistory': False,
90
+ 'fetchMarginAdjustmentHistory': False,
91
+ 'fetchMarginMode': False,
92
+ 'fetchMarginModes': False,
73
93
  'fetchMarketLeverageTiers': False,
74
94
  'fetchMarkets': True,
75
95
  'fetchMarkOHLCV': False,
96
+ 'fetchMarkPrice': False,
97
+ 'fetchMarkPrices': False,
98
+ 'fetchMyLiquidations': False,
99
+ 'fetchMySettlementHistory': False,
76
100
  'fetchMyTrades': False,
77
101
  'fetchOHLCV': True,
78
102
  'fetchOpenInterest': False,
79
103
  'fetchOpenInterestHistory': False,
104
+ 'fetchOpenInterests': False,
80
105
  'fetchOpenOrders': True,
106
+ 'fetchOption': False,
107
+ 'fetchOptionChain': False,
81
108
  'fetchOrder': True,
82
109
  'fetchOrderBook': True,
83
110
  'fetchOrderBooks': False,
@@ -91,6 +118,7 @@ class tradeogre(Exchange, ImplicitAPI):
91
118
  'fetchPositionsHistory': False,
92
119
  'fetchPositionsRisk': False,
93
120
  'fetchPremiumIndexOHLCV': False,
121
+ 'fetchSettlementHistory': False,
94
122
  'fetchTicker': True,
95
123
  'fetchTickers': True,
96
124
  'fetchTrades': True,
@@ -99,10 +127,14 @@ class tradeogre(Exchange, ImplicitAPI):
99
127
  'fetchTransactionFees': False,
100
128
  'fetchTransactions': False,
101
129
  'fetchTransfers': False,
130
+ 'fetchUnderlyingAssets': False,
131
+ 'fetchVolatilityHistory': False,
102
132
  'fetchWithdrawAddresses': False,
103
133
  'fetchWithdrawal': False,
104
134
  'fetchWithdrawals': False,
105
135
  'reduceMargin': False,
136
+ 'repayCrossMargin': False,
137
+ 'repayIsolatedMargin': False,
106
138
  'setLeverage': False,
107
139
  'setMargin': False,
108
140
  'setMarginMode': False,
@@ -42,6 +42,9 @@ class wavesexchange(Exchange, ImplicitAPI):
42
42
  'future': False,
43
43
  'option': False,
44
44
  'addMargin': False,
45
+ 'borrowCrossMargin': False,
46
+ 'borrowIsolatedMargin': False,
47
+ 'borrowMargin': False,
45
48
  'cancelOrder': True,
46
49
  'closeAllPositions': False,
47
50
  'closePosition': False,
@@ -51,9 +54,14 @@ class wavesexchange(Exchange, ImplicitAPI):
51
54
  'createStopLimitOrder': False,
52
55
  'createStopMarketOrder': False,
53
56
  'createStopOrder': False,
57
+ 'fetchAllGreeks': False,
54
58
  'fetchBalance': True,
59
+ 'fetchBorrowInterest': False,
60
+ 'fetchBorrowRate': False,
55
61
  'fetchBorrowRateHistories': False,
56
62
  'fetchBorrowRateHistory': False,
63
+ 'fetchBorrowRates': False,
64
+ 'fetchBorrowRatesPerSymbol': False,
57
65
  'fetchClosedOrders': True,
58
66
  'fetchCrossBorrowRate': False,
59
67
  'fetchCrossBorrowRates': False,
@@ -63,21 +71,40 @@ class wavesexchange(Exchange, ImplicitAPI):
63
71
  'fetchDepositWithdrawFee': 'emulated',
64
72
  'fetchDepositWithdrawFees': True,
65
73
  'fetchFundingHistory': False,
74
+ 'fetchFundingInterval': False,
75
+ 'fetchFundingIntervals': False,
66
76
  'fetchFundingRate': False,
67
77
  'fetchFundingRateHistory': False,
68
78
  'fetchFundingRates': False,
79
+ 'fetchGreeks': False,
69
80
  'fetchIndexOHLCV': False,
70
81
  'fetchIsolatedBorrowRate': False,
71
82
  'fetchIsolatedBorrowRates': False,
83
+ 'fetchIsolatedPositions': False,
72
84
  'fetchLeverage': False,
85
+ 'fetchLeverages': False,
73
86
  'fetchLeverageTiers': False,
87
+ 'fetchLiquidations': False,
88
+ 'fetchLongShortRatio': False,
89
+ 'fetchLongShortRatioHistory': False,
90
+ 'fetchMarginAdjustmentHistory': False,
74
91
  'fetchMarginMode': False,
92
+ 'fetchMarginModes': False,
93
+ 'fetchMarketLeverageTiers': False,
75
94
  'fetchMarkets': True,
76
95
  'fetchMarkOHLCV': False,
96
+ 'fetchMarkPrice': False,
97
+ 'fetchMarkPrices': False,
98
+ 'fetchMyLiquidations': False,
99
+ 'fetchMySettlementHistory': False,
77
100
  'fetchMyTrades': True,
78
101
  'fetchOHLCV': True,
102
+ 'fetchOpenInterest': False,
79
103
  'fetchOpenInterestHistory': False,
104
+ 'fetchOpenInterests': False,
80
105
  'fetchOpenOrders': True,
106
+ 'fetchOption': False,
107
+ 'fetchOptionChain': False,
81
108
  'fetchOrder': True,
82
109
  'fetchOrderBook': True,
83
110
  'fetchOrders': True,
@@ -89,14 +116,20 @@ class wavesexchange(Exchange, ImplicitAPI):
89
116
  'fetchPositionsHistory': False,
90
117
  'fetchPositionsRisk': False,
91
118
  'fetchPremiumIndexOHLCV': False,
119
+ 'fetchSettlementHistory': False,
92
120
  'fetchTicker': True,
93
121
  'fetchTickers': True,
94
122
  'fetchTrades': True,
95
123
  'fetchTransfer': False,
96
124
  'fetchTransfers': False,
125
+ 'fetchUnderlyingAssets': False,
126
+ 'fetchVolatilityHistory': False,
97
127
  'reduceMargin': False,
128
+ 'repayCrossMargin': False,
129
+ 'repayIsolatedMargin': False,
98
130
  'sandbox': True,
99
131
  'setLeverage': False,
132
+ 'setMargin': False,
100
133
  'setMarginMode': False,
101
134
  'setPositionMode': False,
102
135
  'signIn': True,
ccxt/base/exchange.py CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.5.0'
7
+ __version__ = '4.5.1'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -2337,6 +2337,12 @@ class Exchange(object):
2337
2337
  # return the first index of the cache that can be applied to the orderbook or -1 if not possible
2338
2338
  return -1
2339
2339
 
2340
+ def arrays_concat(self, arraysOfArrays: List[Any]):
2341
+ result = []
2342
+ for i in range(0, len(arraysOfArrays)):
2343
+ result = self.array_concat(result, arraysOfArrays[i])
2344
+ return result
2345
+
2340
2346
  def find_timeframe(self, timeframe, timeframes=None):
2341
2347
  if timeframes is None:
2342
2348
  timeframes = self.timeframes
ccxt/coinbase.py CHANGED
@@ -2192,34 +2192,44 @@ class coinbase(Exchange, ImplicitAPI):
2192
2192
  # fetchTickersV3
2193
2193
  #
2194
2194
  # [
2195
- # {
2196
- # "product_id": "TONE-USD",
2197
- # "price": "0.01523",
2198
- # "price_percentage_change_24h": "1.94109772423025",
2199
- # "volume_24h": "19773129",
2200
- # "volume_percentage_change_24h": "437.0170530929949",
2201
- # "base_increment": "1",
2202
- # "quote_increment": "0.00001",
2203
- # "quote_min_size": "1",
2204
- # "quote_max_size": "10000000",
2205
- # "base_min_size": "26.7187147229469674",
2206
- # "base_max_size": "267187147.2294696735908216",
2207
- # "base_name": "TE-FOOD",
2208
- # "quote_name": "US Dollar",
2209
- # "watched": False,
2210
- # "is_disabled": False,
2211
- # "new": False,
2212
- # "status": "online",
2213
- # "cancel_only": False,
2214
- # "limit_only": False,
2215
- # "post_only": False,
2216
- # "trading_disabled": False,
2217
- # "auction_mode": False,
2218
- # "product_type": "SPOT",
2219
- # "quote_currency_id": "USD",
2220
- # "base_currency_id": "TONE",
2221
- # "fcm_trading_session_details": null,
2222
- # "mid_market_price": ""
2195
+ # {
2196
+ # "product_id": "ETH-USD",
2197
+ # "price": "4471.59",
2198
+ # "price_percentage_change_24h": "0.14243387238731",
2199
+ # "volume_24h": "87329.92990204",
2200
+ # "volume_percentage_change_24h": "-60.7789801794578",
2201
+ # "base_increment": "0.00000001",
2202
+ # "quote_increment": "0.01",
2203
+ # "quote_min_size": "1",
2204
+ # "quote_max_size": "150000000",
2205
+ # "base_min_size": "0.00000001",
2206
+ # "base_max_size": "42000",
2207
+ # "base_name": "Ethereum",
2208
+ # "quote_name": "US Dollar",
2209
+ # "watched": False,
2210
+ # "is_disabled": False,
2211
+ # "new": False,
2212
+ # "status": "online",
2213
+ # "cancel_only": False,
2214
+ # "limit_only": False,
2215
+ # "post_only": False,
2216
+ # "trading_disabled": False,
2217
+ # "auction_mode": False,
2218
+ # "product_type": "SPOT",
2219
+ # "quote_currency_id": "USD",
2220
+ # "base_currency_id": "ETH",
2221
+ # "fcm_trading_session_details": null,
2222
+ # "mid_market_price": "",
2223
+ # "alias": "",
2224
+ # "alias_to": ["ETH-USDC"],
2225
+ # "base_display_symbol": "ETH",
2226
+ # "quote_display_symbol": "USD",
2227
+ # "view_only": False,
2228
+ # "price_increment": "0.01",
2229
+ # "display_name": "ETH-USD",
2230
+ # "product_venue": "CBE",
2231
+ # "approximate_quote_24h_volume": "390503641.25",
2232
+ # "new_at": "2023-01-01T00:00:00Z"
2223
2233
  # },
2224
2234
  # ...
2225
2235
  # ]
@@ -2250,10 +2260,12 @@ class coinbase(Exchange, ImplicitAPI):
2250
2260
  if ('bids' in ticker):
2251
2261
  bids = self.safe_list(ticker, 'bids', [])
2252
2262
  asks = self.safe_list(ticker, 'asks', [])
2253
- bid = self.safe_number(bids[0], 'price')
2254
- bidVolume = self.safe_number(bids[0], 'size')
2255
- ask = self.safe_number(asks[0], 'price')
2256
- askVolume = self.safe_number(asks[0], 'size')
2263
+ firstBid = self.safe_dict(bids, 0, {})
2264
+ firstAsk = self.safe_dict(asks, 0, {})
2265
+ bid = self.safe_number(firstBid, 'price')
2266
+ bidVolume = self.safe_number(firstBid, 'size')
2267
+ ask = self.safe_number(firstAsk, 'price')
2268
+ askVolume = self.safe_number(firstAsk, 'size')
2257
2269
  marketId = self.safe_string(ticker, 'product_id')
2258
2270
  market = self.safe_market(marketId, market)
2259
2271
  last = self.safe_number(ticker, 'price')
@@ -2276,8 +2288,8 @@ class coinbase(Exchange, ImplicitAPI):
2276
2288
  'change': None,
2277
2289
  'percentage': self.safe_number(ticker, 'price_percentage_change_24h'),
2278
2290
  'average': None,
2279
- 'baseVolume': None,
2280
- 'quoteVolume': None,
2291
+ 'baseVolume': self.safe_number(ticker, 'volume_24h'),
2292
+ 'quoteVolume': self.safe_number(ticker, 'approximate_quote_24h_volume'),
2281
2293
  'info': ticker,
2282
2294
  }, market)
2283
2295
 
ccxt/gate.py CHANGED
@@ -764,6 +764,9 @@ class gate(Exchange, ImplicitAPI):
764
764
  'option': 'options',
765
765
  'options': 'options',
766
766
  },
767
+ 'fetchMarkets': {
768
+ 'types': ['spot', 'swap', 'future', 'option'],
769
+ },
767
770
  'swap': {
768
771
  'fetchMarkets': {
769
772
  'settlementCurrencies': ['usdt', 'btc'],
@@ -1233,21 +1236,24 @@ class gate(Exchange, ImplicitAPI):
1233
1236
  self.load_time_difference()
1234
1237
  if self.check_required_credentials(False):
1235
1238
  self.load_unified_status()
1239
+ rawPromises = []
1236
1240
  sandboxMode = self.safe_bool(self.options, 'sandboxMode', False)
1237
- rawPromises = [
1238
- self.fetch_contract_markets(params),
1239
- self.fetch_option_markets(params),
1240
- ]
1241
- if not sandboxMode:
1242
- # gate doesn't have a sandbox for spot markets
1243
- mainnetOnly = [self.fetch_spot_markets(params)]
1244
- rawPromises = self.array_concat(rawPromises, mainnetOnly)
1245
- promises = rawPromises
1246
- spotMarkets = self.safe_value(promises, 0, [])
1247
- contractMarkets = self.safe_value(promises, 1, [])
1248
- optionMarkets = self.safe_value(promises, 2, [])
1249
- markets = self.array_concat(spotMarkets, contractMarkets)
1250
- return self.array_concat(markets, optionMarkets)
1241
+ fetchMarketsOptions = self.safe_dict(self.options, 'fetchMarkets')
1242
+ types = self.safe_list(fetchMarketsOptions, 'types', ['spot', 'swap', 'future', 'option'])
1243
+ for i in range(0, len(types)):
1244
+ marketType = types[i]
1245
+ if marketType == 'spot':
1246
+ if not sandboxMode:
1247
+ # gate doesn't have a sandbox for spot markets
1248
+ rawPromises.append(self.fetch_spot_markets(params))
1249
+ elif marketType == 'swap':
1250
+ rawPromises.append(self.fetch_swap_markets(params))
1251
+ elif marketType == 'future':
1252
+ rawPromises.append(self.fetch_future_markets(params))
1253
+ elif marketType == 'option':
1254
+ rawPromises.append(self.fetch_option_markets(params))
1255
+ results = rawPromises
1256
+ return self.arrays_concat(results)
1251
1257
 
1252
1258
  def fetch_spot_markets(self, params={}):
1253
1259
  marginPromise = self.publicMarginGetCurrencyPairs(params)
@@ -1362,10 +1368,9 @@ class gate(Exchange, ImplicitAPI):
1362
1368
  })
1363
1369
  return result
1364
1370
 
1365
- def fetch_contract_markets(self, params={}):
1371
+ def fetch_swap_markets(self, params={}):
1366
1372
  result = []
1367
1373
  swapSettlementCurrencies = self.get_settlement_currencies('swap', 'fetchMarkets')
1368
- futureSettlementCurrencies = self.get_settlement_currencies('future', 'fetchMarkets')
1369
1374
  for c in range(0, len(swapSettlementCurrencies)):
1370
1375
  settleId = swapSettlementCurrencies[c]
1371
1376
  request: dict = {
@@ -1375,6 +1380,11 @@ class gate(Exchange, ImplicitAPI):
1375
1380
  for i in range(0, len(response)):
1376
1381
  parsedMarket = self.parse_contract_market(response[i], settleId)
1377
1382
  result.append(parsedMarket)
1383
+ return result
1384
+
1385
+ def fetch_future_markets(self, params={}):
1386
+ result = []
1387
+ futureSettlementCurrencies = self.get_settlement_currencies('future', 'fetchMarkets')
1378
1388
  for c in range(0, len(futureSettlementCurrencies)):
1379
1389
  settleId = futureSettlementCurrencies[c]
1380
1390
  request: dict = {
@@ -2542,7 +2552,11 @@ class gate(Exchange, ImplicitAPI):
2542
2552
  #
2543
2553
  request, query = self.prepare_request(market, market['type'], params)
2544
2554
  if limit is not None:
2545
- request['limit'] = limit # default 10, max 100
2555
+ if market['spot']:
2556
+ limit = min(limit, 1000)
2557
+ else:
2558
+ limit = min(limit, 300)
2559
+ request['limit'] = limit
2546
2560
  request['with_id'] = True
2547
2561
  response = None
2548
2562
  if market['spot'] or market['margin']:
ccxt/gemini.py CHANGED
@@ -275,7 +275,7 @@ class gemini(Exchange, ImplicitAPI):
275
275
  'fetchMarketFromWebRetries': 10,
276
276
  'fetchMarketsFromAPI': {
277
277
  'fetchDetailsForAllSymbols': False,
278
- 'quoteCurrencies': ['USDT', 'GUSD', 'USD', 'DAI', 'EUR', 'GBP', 'SGD', 'BTC', 'ETH', 'LTC', 'BCH', 'SOL'],
278
+ 'quoteCurrencies': ['USDT', 'GUSD', 'USD', 'DAI', 'EUR', 'GBP', 'SGD', 'BTC', 'ETH', 'LTC', 'BCH', 'SOL', 'USDC'],
279
279
  },
280
280
  'fetchMarkets': {
281
281
  'webApiEnable': True, # fetches from WEB
ccxt/hibachi.py CHANGED
@@ -1561,7 +1561,7 @@ class hibachi(Exchange, ImplicitAPI):
1561
1561
  def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
1562
1562
  endpoint = '/' + self.implode_params(path, params)
1563
1563
  url = self.urls['api'][api] + endpoint
1564
- headers = {}
1564
+ headers = {'Hibachi-Client': 'HibachiCCXT/unversioned'}
1565
1565
  if method == 'GET':
1566
1566
  request = self.omit(params, self.extract_params(path))
1567
1567
  query = self.urlencode(request)
ccxt/hyperliquid.py CHANGED
@@ -2283,6 +2283,7 @@ class hyperliquid(Exchange, ImplicitAPI):
2283
2283
  :param str id: order id
2284
2284
  :param str symbol: unified symbol of the market the order was made in
2285
2285
  :param dict [params]: extra parameters specific to the exchange API endpoint
2286
+ :param str [params.clientOrderId]: client order id,(optional 128 bit hex string e.g. 0x1234567890abcdef1234567890abcdef)
2286
2287
  :param str [params.user]: user address, will default to self.walletAddress if not provided
2287
2288
  :param str [params.subAccountAddress]: sub account user address
2288
2289
  :returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
@@ -2291,12 +2292,18 @@ class hyperliquid(Exchange, ImplicitAPI):
2291
2292
  userAddress, params = self.handle_public_address('fetchOrder', params)
2292
2293
  self.load_markets()
2293
2294
  market = self.safe_market(symbol)
2294
- isClientOrderId = len(id) >= 34
2295
+ clientOrderId = self.safe_string(params, 'clientOrderId')
2295
2296
  request: dict = {
2296
2297
  'type': 'orderStatus',
2297
- 'oid': id if isClientOrderId else self.parse_to_numeric(id),
2298
+ # 'oid': id if isClientOrderId else self.parse_to_numeric(id),
2298
2299
  'user': userAddress,
2299
2300
  }
2301
+ if clientOrderId is not None:
2302
+ params = self.omit(params, 'clientOrderId')
2303
+ request['oid'] = clientOrderId
2304
+ else:
2305
+ isClientOrderId = len(id) >= 34
2306
+ request['oid'] = id if isClientOrderId else self.parse_to_numeric(id)
2300
2307
  response = self.publicPostInfo(self.extend(request, params))
2301
2308
  #
2302
2309
  # {
@@ -3668,11 +3675,15 @@ class hyperliquid(Exchange, ImplicitAPI):
3668
3675
  # }
3669
3676
  # {"status":"ok","response":{"type":"order","data":{"statuses":[{"error":"Insufficient margin to place order. asset=84"}]}}}
3670
3677
  #
3678
+ # {"status":"unknownOid"}
3679
+ #
3671
3680
  status = self.safe_string(response, 'status', '')
3672
3681
  error = self.safe_string(response, 'error')
3673
3682
  message = None
3674
3683
  if status == 'err':
3675
3684
  message = self.safe_string(response, 'response')
3685
+ elif status == 'unknownOid':
3686
+ raise OrderNotFound(self.id + ' ' + body) # {"status":"unknownOid"}
3676
3687
  elif error is not None:
3677
3688
  message = error
3678
3689
  else:
ccxt/kraken.py CHANGED
@@ -251,6 +251,7 @@ class kraken(Exchange, ImplicitAPI):
251
251
  'UST': 'USTC',
252
252
  'XBT': 'BTC',
253
253
  'XDG': 'DOGE',
254
+ 'FEE': 'KFEE',
254
255
  },
255
256
  'options': {
256
257
  'timeDifference': 0, # the difference between system clock and Binance clock
@@ -715,14 +716,6 @@ class kraken(Exchange, ImplicitAPI):
715
716
  self.options['marketsByAltname'] = self.index_by(result, 'altname')
716
717
  return result
717
718
 
718
- def safe_currency(self, currencyId, currency: Currency = None):
719
- if currencyId is not None:
720
- if len(currencyId) > 3:
721
- if (currencyId.find('X') == 0) or (currencyId.find('Z') == 0):
722
- if not (currencyId.find('.') > 0) and (currencyId != 'ZEUS'):
723
- currencyId = currencyId[1:]
724
- return super(kraken, self).safe_currency(currencyId, currency)
725
-
726
719
  def fetch_status(self, params={}):
727
720
  """
728
721
  the latest known information on the availability of the exchange API