ccxt 4.4.69__py2.py3-none-any.whl → 4.4.71__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 -3
- ccxt/abstract/bingx.py +1 -0
- ccxt/abstract/bitmart.py +1 -0
- ccxt/abstract/bybit.py +4 -0
- ccxt/abstract/myokx.py +3 -0
- ccxt/abstract/okx.py +3 -0
- ccxt/abstract/poloniex.py +36 -0
- ccxt/abstract/tradeogre.py +1 -1
- ccxt/async_support/__init__.py +1 -3
- ccxt/async_support/base/exchange.py +3 -3
- ccxt/async_support/binance.py +107 -102
- ccxt/async_support/bingx.py +64 -42
- ccxt/async_support/bitget.py +47 -265
- ccxt/async_support/bitmart.py +12 -1
- ccxt/async_support/bitopro.py +1 -0
- ccxt/async_support/bitrue.py +1 -0
- ccxt/async_support/bybit.py +7 -0
- ccxt/async_support/cex.py +1 -0
- ccxt/async_support/coinbase.py +23 -4
- ccxt/async_support/coinbaseexchange.py +1 -0
- ccxt/async_support/deribit.py +1 -0
- ccxt/async_support/hashkey.py +4 -2
- ccxt/async_support/hyperliquid.py +16 -7
- ccxt/async_support/kraken.py +77 -5
- ccxt/async_support/kucoin.py +4 -2
- ccxt/async_support/mexc.py +8 -4
- ccxt/async_support/okx.py +62 -46
- ccxt/async_support/poloniex.py +1263 -85
- ccxt/async_support/tradeogre.py +20 -4
- ccxt/async_support/whitebit.py +4 -2
- ccxt/base/exchange.py +23 -4
- ccxt/base/types.py +28 -0
- ccxt/binance.py +107 -102
- ccxt/bingx.py +64 -42
- ccxt/bitget.py +47 -265
- ccxt/bitmart.py +12 -1
- ccxt/bitopro.py +1 -0
- ccxt/bitrue.py +1 -0
- ccxt/bybit.py +7 -0
- ccxt/cex.py +1 -0
- ccxt/coinbase.py +23 -4
- ccxt/coinbaseexchange.py +1 -0
- ccxt/deribit.py +1 -0
- ccxt/hashkey.py +4 -2
- ccxt/hyperliquid.py +16 -7
- ccxt/kraken.py +77 -5
- ccxt/kucoin.py +4 -2
- ccxt/mexc.py +8 -4
- ccxt/okx.py +62 -46
- ccxt/poloniex.py +1262 -85
- ccxt/pro/__init__.py +1 -3
- ccxt/pro/binance.py +102 -102
- ccxt/pro/bingx.py +62 -51
- ccxt/pro/bitget.py +28 -3
- ccxt/pro/bybit.py +81 -37
- ccxt/test/tests_async.py +4 -3
- ccxt/test/tests_sync.py +4 -3
- ccxt/tradeogre.py +20 -4
- ccxt/whitebit.py +4 -2
- {ccxt-4.4.69.dist-info → ccxt-4.4.71.dist-info}/METADATA +6 -9
- {ccxt-4.4.69.dist-info → ccxt-4.4.71.dist-info}/RECORD +64 -65
- ccxt/abstract/poloniexfutures.py +0 -48
- {ccxt-4.4.69.dist-info → ccxt-4.4.71.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.69.dist-info → ccxt-4.4.71.dist-info}/WHEEL +0 -0
- {ccxt-4.4.69.dist-info → ccxt-4.4.71.dist-info}/top_level.txt +0 -0
ccxt/async_support/tradeogre.py
CHANGED
@@ -140,7 +140,6 @@ class tradeogre(Exchange, ImplicitAPI):
|
|
140
140
|
},
|
141
141
|
'private': {
|
142
142
|
'get': {
|
143
|
-
'account/balance': 1,
|
144
143
|
'account/balances': 1,
|
145
144
|
'account/order/{uuid}': 1,
|
146
145
|
},
|
@@ -150,6 +149,7 @@ class tradeogre(Exchange, ImplicitAPI):
|
|
150
149
|
'order/cancel': 1,
|
151
150
|
'orders': 1,
|
152
151
|
'account/orders': 1,
|
152
|
+
'account/balance': 1,
|
153
153
|
},
|
154
154
|
},
|
155
155
|
},
|
@@ -588,10 +588,26 @@ class tradeogre(Exchange, ImplicitAPI):
|
|
588
588
|
"""
|
589
589
|
query for balance and get the amount of funds available for trading or funds locked in orders
|
590
590
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
591
|
+
:param str [params.currency]: currency to fetch the balance for
|
591
592
|
:returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
|
592
593
|
"""
|
593
594
|
await self.load_markets()
|
594
|
-
response =
|
595
|
+
response = None
|
596
|
+
currency = self.safe_string(params, 'currency')
|
597
|
+
if currency is not None:
|
598
|
+
response = await self.privatePostAccountBalance(params)
|
599
|
+
singleCurrencyresult: dict = {
|
600
|
+
'info': response,
|
601
|
+
}
|
602
|
+
code = self.safe_currency_code(currency)
|
603
|
+
account = {
|
604
|
+
'total': self.safe_number(response, 'balance'),
|
605
|
+
'free': self.safe_number(response, 'available'),
|
606
|
+
}
|
607
|
+
singleCurrencyresult[code] = account
|
608
|
+
return self.safe_balance(singleCurrencyresult)
|
609
|
+
else:
|
610
|
+
response = await self.privateGetAccountBalances(params)
|
595
611
|
result = self.safe_dict(response, 'balances', {})
|
596
612
|
return self.parse_balance(result)
|
597
613
|
|
@@ -744,11 +760,11 @@ class tradeogre(Exchange, ImplicitAPI):
|
|
744
760
|
'side': self.safe_string(order, 'type'),
|
745
761
|
'price': self.safe_string(order, 'price'),
|
746
762
|
'triggerPrice': None,
|
747
|
-
'amount':
|
763
|
+
'amount': None,
|
748
764
|
'cost': None,
|
749
765
|
'average': None,
|
750
766
|
'filled': self.safe_string(order, 'fulfilled'),
|
751
|
-
'remaining':
|
767
|
+
'remaining': self.safe_string(order, 'quantity'),
|
752
768
|
'status': None,
|
753
769
|
'fee': {
|
754
770
|
'currency': None,
|
ccxt/async_support/whitebit.py
CHANGED
@@ -1342,9 +1342,11 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1342
1342
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1343
1343
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1344
1344
|
"""
|
1345
|
-
|
1345
|
+
req = {
|
1346
|
+
'cost': cost,
|
1347
|
+
}
|
1346
1348
|
# only buy side is supported
|
1347
|
-
return await self.create_order(symbol, 'market', side, 0, None, params)
|
1349
|
+
return await self.create_order(symbol, 'market', side, 0, None, self.extend(req, params))
|
1348
1350
|
|
1349
1351
|
async def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}) -> Order:
|
1350
1352
|
"""
|
ccxt/base/exchange.py
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
__version__ = '4.4.
|
7
|
+
__version__ = '4.4.71'
|
8
8
|
|
9
9
|
# -----------------------------------------------------------------------------
|
10
10
|
|
@@ -33,7 +33,7 @@ from ccxt.base.decimal_to_precision import decimal_to_precision
|
|
33
33
|
from ccxt.base.decimal_to_precision import DECIMAL_PLACES, TICK_SIZE, NO_PADDING, TRUNCATE, ROUND, ROUND_UP, ROUND_DOWN, SIGNIFICANT_DIGITS
|
34
34
|
from ccxt.base.decimal_to_precision import number_to_string
|
35
35
|
from ccxt.base.precise import Precise
|
36
|
-
from ccxt.base.types import BalanceAccount, Currency, IndexType, OrderSide, OrderType, Trade, OrderRequest, Market, MarketType, Str, Num, Strings, CancellationRequest, Bool
|
36
|
+
from ccxt.base.types import ConstructorArgs, BalanceAccount, Currency, IndexType, OrderSide, OrderType, Trade, OrderRequest, Market, MarketType, Str, Num, Strings, CancellationRequest, Bool
|
37
37
|
|
38
38
|
# -----------------------------------------------------------------------------
|
39
39
|
|
@@ -369,7 +369,7 @@ class Exchange(object):
|
|
369
369
|
}
|
370
370
|
synchronous = True
|
371
371
|
|
372
|
-
def __init__(self, config={}):
|
372
|
+
def __init__(self, config: ConstructorArgs = {}):
|
373
373
|
self.aiohttp_trust_env = self.aiohttp_trust_env or self.trust_env
|
374
374
|
self.requests_trust_env = self.requests_trust_env or self.trust_env
|
375
375
|
|
@@ -410,6 +410,9 @@ class Exchange(object):
|
|
410
410
|
|
411
411
|
self.after_construct()
|
412
412
|
|
413
|
+
if self.safe_bool(config, 'sandbox') or self.safe_bool(config, 'testnet'):
|
414
|
+
self.set_sandbox_mode(True)
|
415
|
+
|
413
416
|
# convert all properties from underscore notation foo_bar to camelcase notation fooBar
|
414
417
|
cls = type(self)
|
415
418
|
for name in dir(self):
|
@@ -2099,7 +2102,6 @@ class Exchange(object):
|
|
2099
2102
|
},
|
2100
2103
|
'commonCurrencies': {
|
2101
2104
|
'XBT': 'BTC',
|
2102
|
-
'BCC': 'BCH',
|
2103
2105
|
'BCHSV': 'BSV',
|
2104
2106
|
},
|
2105
2107
|
'precisionMode': TICK_SIZE,
|
@@ -4287,6 +4289,23 @@ class Exchange(object):
|
|
4287
4289
|
params = self.omit(params, [paramName1, paramName2])
|
4288
4290
|
return [value, params]
|
4289
4291
|
|
4292
|
+
def handle_request_network(self, params: dict, request: dict, exchangeSpecificKey: str, currencyCode: Str = None, isRequired: bool = False):
|
4293
|
+
"""
|
4294
|
+
:param dict params: - extra parameters
|
4295
|
+
:param dict request: - existing dictionary of request
|
4296
|
+
:param str exchangeSpecificKey: - the key for chain id to be set in request
|
4297
|
+
:param dict currencyCode: - (optional) existing dictionary of request
|
4298
|
+
:param boolean isRequired: - (optional) whether that param is required to be present
|
4299
|
+
:returns dict[]: - returns [request, params] where request is the modified request object and params is the modified params object
|
4300
|
+
"""
|
4301
|
+
networkCode = None
|
4302
|
+
networkCode, params = self.handle_network_code_and_params(params)
|
4303
|
+
if networkCode is not None:
|
4304
|
+
request[exchangeSpecificKey] = self.network_code_to_id(networkCode, currencyCode)
|
4305
|
+
elif isRequired:
|
4306
|
+
raise ArgumentsRequired(self.id + ' - "network" param is required for self request')
|
4307
|
+
return [request, params]
|
4308
|
+
|
4290
4309
|
def resolve_path(self, path, params):
|
4291
4310
|
return [
|
4292
4311
|
self.implode_params(path, params),
|
ccxt/base/types.py
CHANGED
@@ -575,3 +575,31 @@ LeverageTiers = Dict[Str, List[LeverageTier]]
|
|
575
575
|
|
576
576
|
Market = Optional[MarketInterface]
|
577
577
|
Currency = Optional[CurrencyInterface]
|
578
|
+
|
579
|
+
class ConstructorArgs(TypedDict, total=False):
|
580
|
+
apiKey: str
|
581
|
+
secret: str
|
582
|
+
passphrase: str
|
583
|
+
password: str
|
584
|
+
privateKey: str
|
585
|
+
walletAddress: str
|
586
|
+
uid: str
|
587
|
+
verbose: bool
|
588
|
+
testnet: bool
|
589
|
+
sandbox: bool # redudant but kept for backwards compatibility
|
590
|
+
options: Dict[str, Any]
|
591
|
+
enableRateLimit: bool
|
592
|
+
httpsProxy: str
|
593
|
+
socksProxy: str
|
594
|
+
wssProxy: str
|
595
|
+
proxy: str
|
596
|
+
rateLimit: Num
|
597
|
+
commonCurrencies: Dict[str, Any]
|
598
|
+
userAgent: str
|
599
|
+
userAgents: Dict[str, Any]
|
600
|
+
timeout: Num
|
601
|
+
markets: Dict[str, Any]
|
602
|
+
currencies: Dict[str, Any]
|
603
|
+
hostname: str
|
604
|
+
urls: Dict[str, Any]
|
605
|
+
headers: Dict[str, Any]
|