ccxt 4.3.66__py2.py3-none-any.whl → 4.3.68__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.
- ccxt/__init__.py +1 -1
- ccxt/abstract/bingx.py +7 -0
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/bingx.py +462 -159
- ccxt/async_support/bitget.py +3 -2
- ccxt/async_support/bithumb.py +60 -17
- ccxt/async_support/whitebit.py +1 -1
- ccxt/async_support/zonda.py +1 -1
- ccxt/base/exchange.py +14 -13
- ccxt/bingx.py +462 -159
- ccxt/bitget.py +3 -2
- ccxt/bithumb.py +59 -17
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/bitget.py +1 -1
- ccxt/pro/bybit.py +1 -1
- ccxt/pro/coinone.py +1 -1
- ccxt/pro/currencycom.py +1 -1
- ccxt/pro/hollaex.py +1 -1
- ccxt/pro/hyperliquid.py +1 -1
- ccxt/pro/krakenfutures.py +7 -6
- ccxt/pro/kucoin.py +1 -1
- ccxt/pro/kucoinfutures.py +1 -1
- ccxt/pro/mexc.py +1 -1
- ccxt/pro/okcoin.py +1 -1
- ccxt/pro/okx.py +16 -4
- ccxt/pro/oxfun.py +1 -1
- ccxt/pro/p2b.py +1 -1
- ccxt/pro/poloniex.py +1 -1
- ccxt/pro/whitebit.py +1 -1
- ccxt/test/tests_async.py +58 -28
- ccxt/test/tests_helpers.py +8 -1
- ccxt/test/tests_sync.py +58 -28
- ccxt/whitebit.py +1 -1
- ccxt/zonda.py +1 -1
- {ccxt-4.3.66.dist-info → ccxt-4.3.68.dist-info}/METADATA +4 -4
- {ccxt-4.3.66.dist-info → ccxt-4.3.68.dist-info}/RECORD +40 -40
- {ccxt-4.3.66.dist-info → ccxt-4.3.68.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.3.66.dist-info → ccxt-4.3.68.dist-info}/WHEEL +0 -0
- {ccxt-4.3.66.dist-info → ccxt-4.3.68.dist-info}/top_level.txt +0 -0
ccxt/async_support/bitget.py
CHANGED
@@ -4868,8 +4868,9 @@ class bitget(Exchange, ImplicitAPI):
|
|
4868
4868
|
if isinstance(response, str):
|
4869
4869
|
response = json.loads(response)
|
4870
4870
|
data = self.safe_dict(response, 'data')
|
4871
|
-
if (data is not None)
|
4872
|
-
|
4871
|
+
if (data is not None):
|
4872
|
+
if not isinstance(data, list):
|
4873
|
+
return self.parse_order(data, market)
|
4873
4874
|
dataList = self.safe_list(response, 'data', [])
|
4874
4875
|
first = self.safe_dict(dataList, 0, {})
|
4875
4876
|
return self.parse_order(first, market)
|
ccxt/async_support/bithumb.py
CHANGED
@@ -5,6 +5,7 @@
|
|
5
5
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.bithumb import ImplicitAPI
|
8
|
+
import asyncio
|
8
9
|
import hashlib
|
9
10
|
from ccxt.base.types import Balances, Currency, Int, Market, MarketInterface, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
10
11
|
from typing import List
|
@@ -212,17 +213,56 @@ class bithumb(Exchange, ImplicitAPI):
|
|
212
213
|
:returns dict[]: an array of objects representing market data
|
213
214
|
"""
|
214
215
|
result = []
|
215
|
-
quoteCurrencies = self.
|
216
|
+
quoteCurrencies = self.safe_dict(self.options, 'quoteCurrencies', {})
|
216
217
|
quotes = list(quoteCurrencies.keys())
|
218
|
+
promises = []
|
219
|
+
for i in range(0, len(quotes)):
|
220
|
+
request = {
|
221
|
+
'quoteId': quotes[i],
|
222
|
+
}
|
223
|
+
promises.append(self.publicGetTickerALLQuoteId(self.extend(request, params)))
|
224
|
+
#
|
225
|
+
# {
|
226
|
+
# "status": "0000",
|
227
|
+
# "data": {
|
228
|
+
# "ETH": {
|
229
|
+
# "opening_price": "0.05153399",
|
230
|
+
# "closing_price": "0.05145144",
|
231
|
+
# "min_price": "0.05145144",
|
232
|
+
# "max_price": "0.05160781",
|
233
|
+
# "units_traded": "6.541124172077830855",
|
234
|
+
# "acc_trade_value": "0.33705472498492329997697755",
|
235
|
+
# "prev_closing_price": "0.0515943",
|
236
|
+
# "units_traded_24H": "43.368879902677400513",
|
237
|
+
# "acc_trade_value_24H": "2.24165339555398079994373342",
|
238
|
+
# "fluctate_24H": "-0.00018203",
|
239
|
+
# "fluctate_rate_24H": "-0.35"
|
240
|
+
# },
|
241
|
+
# "XRP": {
|
242
|
+
# "opening_price": "0.00000918",
|
243
|
+
# "closing_price": "0.0000092",
|
244
|
+
# "min_price": "0.00000918",
|
245
|
+
# "max_price": "0.0000092",
|
246
|
+
# "units_traded": "6516.949363",
|
247
|
+
# "acc_trade_value": "0.0598792533602796",
|
248
|
+
# "prev_closing_price": "0.00000916",
|
249
|
+
# "units_traded_24H": "229161.50354738",
|
250
|
+
# "acc_trade_value_24H": "2.0446589371637117",
|
251
|
+
# "fluctate_24H": "0.00000049",
|
252
|
+
# "fluctate_rate_24H": "5.63"
|
253
|
+
# },
|
254
|
+
# ...
|
255
|
+
# "date": "1721675913145"
|
256
|
+
# }
|
257
|
+
# }
|
258
|
+
#
|
259
|
+
results = await asyncio.gather(*promises)
|
217
260
|
for i in range(0, len(quotes)):
|
218
261
|
quote = quotes[i]
|
219
262
|
quoteId = quote
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
}
|
224
|
-
response = await self.publicGetTickerALLQuoteId(self.extend(request, params))
|
225
|
-
data = self.safe_value(response, 'data')
|
263
|
+
response = results[i]
|
264
|
+
data = self.safe_dict(response, 'data')
|
265
|
+
extension = self.safe_dict(quoteCurrencies, quote, {})
|
226
266
|
currencyIds = list(data.keys())
|
227
267
|
for j in range(0, len(currencyIds)):
|
228
268
|
currencyId = currencyIds[j]
|
@@ -286,7 +326,7 @@ class bithumb(Exchange, ImplicitAPI):
|
|
286
326
|
|
287
327
|
def parse_balance(self, response) -> Balances:
|
288
328
|
result: dict = {'info': response}
|
289
|
-
balances = self.
|
329
|
+
balances = self.safe_dict(response, 'data')
|
290
330
|
codes = list(self.currencies.keys())
|
291
331
|
for i in range(0, len(codes)):
|
292
332
|
code = codes[i]
|
@@ -351,7 +391,7 @@ class bithumb(Exchange, ImplicitAPI):
|
|
351
391
|
# }
|
352
392
|
# }
|
353
393
|
#
|
354
|
-
data = self.
|
394
|
+
data = self.safe_dict(response, 'data', {})
|
355
395
|
timestamp = self.safe_integer(data, 'timestamp')
|
356
396
|
return self.parse_order_book(data, symbol, timestamp, 'bids', 'asks', 'price', 'quantity')
|
357
397
|
|
@@ -413,15 +453,18 @@ class bithumb(Exchange, ImplicitAPI):
|
|
413
453
|
"""
|
414
454
|
await self.load_markets()
|
415
455
|
result: dict = {}
|
416
|
-
quoteCurrencies = self.
|
456
|
+
quoteCurrencies = self.safe_dict(self.options, 'quoteCurrencies', {})
|
417
457
|
quotes = list(quoteCurrencies.keys())
|
458
|
+
promises = []
|
418
459
|
for i in range(0, len(quotes)):
|
419
|
-
quote = quotes[i]
|
420
|
-
quoteId = quote
|
421
460
|
request: dict = {
|
422
|
-
'quoteId':
|
461
|
+
'quoteId': quotes[i],
|
423
462
|
}
|
424
|
-
|
463
|
+
promises.append(self.publicGetTickerALLQuoteId(self.extend(request, params)))
|
464
|
+
responses = await asyncio.gather(*promises)
|
465
|
+
for i in range(0, len(quotes)):
|
466
|
+
quote = quotes[i]
|
467
|
+
response = responses[i]
|
425
468
|
#
|
426
469
|
# {
|
427
470
|
# "status":"0000",
|
@@ -443,7 +486,7 @@ class bithumb(Exchange, ImplicitAPI):
|
|
443
486
|
# }
|
444
487
|
# }
|
445
488
|
#
|
446
|
-
data = self.
|
489
|
+
data = self.safe_dict(response, 'data', {})
|
447
490
|
timestamp = self.safe_integer(data, 'date')
|
448
491
|
tickers = self.omit(data, 'date')
|
449
492
|
currencyIds = list(tickers.keys())
|
@@ -805,7 +848,7 @@ class bithumb(Exchange, ImplicitAPI):
|
|
805
848
|
# }
|
806
849
|
#
|
807
850
|
timestamp = self.safe_integer_product(order, 'order_date', 0.001)
|
808
|
-
sideProperty = self.
|
851
|
+
sideProperty = self.safe_string_2(order, 'type', 'side')
|
809
852
|
side = 'buy' if (sideProperty == 'bid') else 'sell'
|
810
853
|
status = self.parse_order_status(self.safe_string(order, 'order_status'))
|
811
854
|
price = self.safe_string_2(order, 'order_price', 'price')
|
@@ -830,7 +873,7 @@ class bithumb(Exchange, ImplicitAPI):
|
|
830
873
|
market = self.safe_market(None, market)
|
831
874
|
symbol = market['symbol']
|
832
875
|
id = self.safe_string(order, 'order_id')
|
833
|
-
rawTrades = self.
|
876
|
+
rawTrades = self.safe_list(order, 'contract', [])
|
834
877
|
return self.safe_order({
|
835
878
|
'info': order,
|
836
879
|
'id': id,
|
ccxt/async_support/whitebit.py
CHANGED
@@ -2404,7 +2404,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
2404
2404
|
records = self.safe_list(response, 'records')
|
2405
2405
|
return self.parse_transactions(records, currency, since, limit)
|
2406
2406
|
|
2407
|
-
def is_fiat(self, currency: str):
|
2407
|
+
def is_fiat(self, currency: str) -> bool:
|
2408
2408
|
fiatCurrencies = self.safe_value(self.options, 'fiatCurrencies', [])
|
2409
2409
|
return self.in_array(currency, fiatCurrencies)
|
2410
2410
|
|
ccxt/async_support/zonda.py
CHANGED
@@ -1467,7 +1467,7 @@ class zonda(Exchange, ImplicitAPI):
|
|
1467
1467
|
# {status: "Ok", errors: []}
|
1468
1468
|
return self.parse_order(response)
|
1469
1469
|
|
1470
|
-
def is_fiat(self, currency: str):
|
1470
|
+
def is_fiat(self, currency: str) -> bool:
|
1471
1471
|
fiatCurrencies: dict = {
|
1472
1472
|
'USD': True,
|
1473
1473
|
'EUR': True,
|
ccxt/base/exchange.py
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
__version__ = '4.3.
|
7
|
+
__version__ = '4.3.68'
|
8
8
|
|
9
9
|
# -----------------------------------------------------------------------------
|
10
10
|
|
@@ -1848,8 +1848,9 @@ class Exchange(object):
|
|
1848
1848
|
value = self.safe_value_n(dictionaryOrList, keys, defaultValue)
|
1849
1849
|
if value is None:
|
1850
1850
|
return defaultValue
|
1851
|
-
if isinstance(value, dict):
|
1852
|
-
|
1851
|
+
if (isinstance(value, dict)):
|
1852
|
+
if not isinstance(value, list):
|
1853
|
+
return value
|
1853
1854
|
return defaultValue
|
1854
1855
|
|
1855
1856
|
def safe_dict(self, dictionary, key: IndexType, defaultValue: dict = None):
|
@@ -2225,7 +2226,7 @@ class Exchange(object):
|
|
2225
2226
|
def parse_transfer(self, transfer: dict, currency: Currency = None):
|
2226
2227
|
raise NotSupported(self.id + ' parseTransfer() is not supported yet')
|
2227
2228
|
|
2228
|
-
def parse_account(self, account):
|
2229
|
+
def parse_account(self, account: dict):
|
2229
2230
|
raise NotSupported(self.id + ' parseAccount() is not supported yet')
|
2230
2231
|
|
2231
2232
|
def parse_ledger_entry(self, item: dict, currency: Currency = None):
|
@@ -2462,7 +2463,7 @@ class Exchange(object):
|
|
2462
2463
|
},
|
2463
2464
|
}, currency)
|
2464
2465
|
|
2465
|
-
def safe_market_structure(self, market=None):
|
2466
|
+
def safe_market_structure(self, market: dict = None):
|
2466
2467
|
cleanStructure = {
|
2467
2468
|
'id': None,
|
2468
2469
|
'lowercaseId': None,
|
@@ -2622,7 +2623,7 @@ class Exchange(object):
|
|
2622
2623
|
superWithRestDescribe = self.deep_extend(extendedRestDescribe, wsBaseDescribe)
|
2623
2624
|
return superWithRestDescribe
|
2624
2625
|
|
2625
|
-
def safe_balance(self, balance:
|
2626
|
+
def safe_balance(self, balance: dict):
|
2626
2627
|
balances = self.omit(balance, ['info', 'timestamp', 'datetime', 'free', 'used', 'total'])
|
2627
2628
|
codes = list(balances.keys())
|
2628
2629
|
balance['free'] = {}
|
@@ -2656,7 +2657,7 @@ class Exchange(object):
|
|
2656
2657
|
balance['debt'] = debtBalance
|
2657
2658
|
return balance
|
2658
2659
|
|
2659
|
-
def safe_order(self, order:
|
2660
|
+
def safe_order(self, order: dict, market: Market = None):
|
2660
2661
|
# parses numbers
|
2661
2662
|
# * it is important pass the trades rawTrades
|
2662
2663
|
amount = self.omit_zero(self.safe_string(order, 'amount'))
|
@@ -2961,7 +2962,7 @@ class Exchange(object):
|
|
2961
2962
|
'cost': self.parse_number(cost),
|
2962
2963
|
}
|
2963
2964
|
|
2964
|
-
def safe_liquidation(self, liquidation:
|
2965
|
+
def safe_liquidation(self, liquidation: dict, market: Market = None):
|
2965
2966
|
contracts = self.safe_string(liquidation, 'contracts')
|
2966
2967
|
contractSize = self.safe_string(market, 'contractSize')
|
2967
2968
|
price = self.safe_string(liquidation, 'price')
|
@@ -2978,7 +2979,7 @@ class Exchange(object):
|
|
2978
2979
|
liquidation['quoteValue'] = self.parse_number(quoteValue)
|
2979
2980
|
return liquidation
|
2980
2981
|
|
2981
|
-
def safe_trade(self, trade:
|
2982
|
+
def safe_trade(self, trade: dict, market: Market = None):
|
2982
2983
|
amount = self.safe_string(trade, 'amount')
|
2983
2984
|
price = self.safe_string(trade, 'price')
|
2984
2985
|
cost = self.safe_string(trade, 'cost')
|
@@ -3120,7 +3121,7 @@ class Exchange(object):
|
|
3120
3121
|
result = self.array_concat(result, reducedFeeValues)
|
3121
3122
|
return result
|
3122
3123
|
|
3123
|
-
def safe_ticker(self, ticker:
|
3124
|
+
def safe_ticker(self, ticker: dict, market: Market = None):
|
3124
3125
|
open = self.omit_zero(self.safe_string(ticker, 'open'))
|
3125
3126
|
close = self.omit_zero(self.safe_string(ticker, 'close'))
|
3126
3127
|
last = self.omit_zero(self.safe_string(ticker, 'last'))
|
@@ -3455,7 +3456,7 @@ class Exchange(object):
|
|
3455
3456
|
defaultNetworkCode = defaultNetworks[currencyCode]
|
3456
3457
|
else:
|
3457
3458
|
# otherwise, try to use the global-scope 'defaultNetwork' value(even if that network is not supported by currency, it doesn't make any problem, self will be just used "at first" if currency supports self network at all)
|
3458
|
-
defaultNetwork = self.
|
3459
|
+
defaultNetwork = self.safe_string(self.options, 'defaultNetwork')
|
3459
3460
|
if defaultNetwork is not None:
|
3460
3461
|
defaultNetworkCode = defaultNetwork
|
3461
3462
|
return defaultNetworkCode
|
@@ -3553,7 +3554,7 @@ class Exchange(object):
|
|
3553
3554
|
self.options['limitsLoaded'] = self.milliseconds()
|
3554
3555
|
return self.markets
|
3555
3556
|
|
3556
|
-
def safe_position(self, position):
|
3557
|
+
def safe_position(self, position: dict):
|
3557
3558
|
# simplified version of: /pull/12765/
|
3558
3559
|
unrealizedPnlString = self.safe_string(position, 'unrealisedPnl')
|
3559
3560
|
initialMarginString = self.safe_string(position, 'initialMargin')
|
@@ -5721,7 +5722,7 @@ class Exchange(object):
|
|
5721
5722
|
params = self.omit(params, ['until', 'till'])
|
5722
5723
|
return [request, params]
|
5723
5724
|
|
5724
|
-
def safe_open_interest(self, interest, market: Market = None):
|
5725
|
+
def safe_open_interest(self, interest: dict, market: Market = None):
|
5725
5726
|
symbol = self.safe_string(interest, 'symbol')
|
5726
5727
|
if symbol is None:
|
5727
5728
|
symbol = self.safe_string(market, 'symbol')
|