ccxt 4.4.5__py2.py3-none-any.whl → 4.4.7__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/bitmart.py +4 -0
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/base/exchange.py +12 -3
- ccxt/async_support/bingx.py +3 -0
- ccxt/async_support/bitflyer.py +2 -2
- ccxt/async_support/bitget.py +16 -5
- ccxt/async_support/bitmart.py +288 -128
- ccxt/async_support/bybit.py +25 -11
- ccxt/async_support/coinbase.py +6 -8
- ccxt/async_support/gate.py +3 -0
- ccxt/async_support/kraken.py +5 -1
- ccxt/async_support/kucoin.py +2 -2
- ccxt/async_support/mexc.py +114 -19
- ccxt/base/exchange.py +16 -3
- ccxt/bingx.py +3 -0
- ccxt/bitflyer.py +2 -2
- ccxt/bitget.py +16 -5
- ccxt/bitmart.py +288 -128
- ccxt/bybit.py +25 -11
- ccxt/coinbase.py +6 -8
- ccxt/gate.py +3 -0
- ccxt/kraken.py +5 -1
- ccxt/kucoin.py +2 -2
- ccxt/mexc.py +114 -19
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/bitget.py +62 -0
- ccxt/pro/htx.py +14 -0
- ccxt/pro/kraken.py +57 -0
- ccxt/pro/okx.py +11 -5
- {ccxt-4.4.5.dist-info → ccxt-4.4.7.dist-info}/METADATA +4 -4
- {ccxt-4.4.5.dist-info → ccxt-4.4.7.dist-info}/RECORD +35 -35
- {ccxt-4.4.5.dist-info → ccxt-4.4.7.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.5.dist-info → ccxt-4.4.7.dist-info}/WHEEL +0 -0
- {ccxt-4.4.5.dist-info → ccxt-4.4.7.dist-info}/top_level.txt +0 -0
ccxt/__init__.py
CHANGED
ccxt/abstract/bitmart.py
CHANGED
@@ -101,3 +101,7 @@ class ImplicitAPI:
|
|
101
101
|
private_post_contract_private_submit_plan_order = privatePostContractPrivateSubmitPlanOrder = Entry('contract/private/submit-plan-order', 'private', 'POST', {'cost': 2.5})
|
102
102
|
private_post_contract_private_cancel_plan_order = privatePostContractPrivateCancelPlanOrder = Entry('contract/private/cancel-plan-order', 'private', 'POST', {'cost': 1.5})
|
103
103
|
private_post_contract_private_submit_leverage = privatePostContractPrivateSubmitLeverage = Entry('contract/private/submit-leverage', 'private', 'POST', {'cost': 2.5})
|
104
|
+
private_post_contract_private_submit_tp_sl_order = privatePostContractPrivateSubmitTpSlOrder = Entry('contract/private/submit-tp-sl-order', 'private', 'POST', {'cost': 2.5})
|
105
|
+
private_post_contract_private_modify_plan_order = privatePostContractPrivateModifyPlanOrder = Entry('contract/private/modify-plan-order', 'private', 'POST', {'cost': 2.5})
|
106
|
+
private_post_contract_private_modify_preset_plan_order = privatePostContractPrivateModifyPresetPlanOrder = Entry('contract/private/modify-preset-plan-order', 'private', 'POST', {'cost': 2.5})
|
107
|
+
private_post_contract_private_modify_tp_sl_order = privatePostContractPrivateModifyTpSlOrder = Entry('contract/private/modify-tp-sl-order', 'private', 'POST', {'cost': 2.5})
|
ccxt/async_support/__init__.py
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# -----------------------------------------------------------------------------
|
4
4
|
|
5
|
-
__version__ = '4.4.
|
5
|
+
__version__ = '4.4.7'
|
6
6
|
|
7
7
|
# -----------------------------------------------------------------------------
|
8
8
|
|
@@ -1895,8 +1895,17 @@ class Exchange(BaseExchange):
|
|
1895
1895
|
if responseLength == 0:
|
1896
1896
|
break
|
1897
1897
|
result = self.array_concat(result, response)
|
1898
|
-
last = self.
|
1899
|
-
cursorValue = self.safe_value(last['info'], cursorReceived)
|
1898
|
+
last = self.safe_dict(response, responseLength - 1)
|
1899
|
+
# cursorValue = self.safe_value(last['info'], cursorReceived)
|
1900
|
+
cursorValue = None # search for the cursor
|
1901
|
+
for j in range(0, responseLength):
|
1902
|
+
index = responseLength - j - 1
|
1903
|
+
entry = self.safe_dict(response, index)
|
1904
|
+
info = self.safe_dict(entry, 'info')
|
1905
|
+
cursor = self.safe_value(info, cursorReceived)
|
1906
|
+
if cursor is not None:
|
1907
|
+
cursorValue = cursor
|
1908
|
+
break
|
1900
1909
|
if cursorValue is None:
|
1901
1910
|
break
|
1902
1911
|
lastTimestamp = self.safe_integer(last, 'timestamp')
|
ccxt/async_support/bingx.py
CHANGED
ccxt/async_support/bitflyer.py
CHANGED
@@ -995,8 +995,8 @@ class bitflyer(Exchange, ImplicitAPI):
|
|
995
995
|
feedback = self.id + ' ' + body
|
996
996
|
# i.e. {"status":-2,"error_message":"Under maintenance","data":null}
|
997
997
|
errorMessage = self.safe_string(response, 'error_message')
|
998
|
-
statusCode = self.
|
998
|
+
statusCode = self.safe_integer(response, 'status')
|
999
999
|
if errorMessage is not None:
|
1000
1000
|
self.throw_exactly_matched_exception(self.exceptions['exact'], statusCode, feedback)
|
1001
|
-
|
1001
|
+
raise ExchangeError(feedback)
|
1002
1002
|
return None
|
ccxt/async_support/bitget.py
CHANGED
@@ -1337,6 +1337,8 @@ class bitget(Exchange, ImplicitAPI):
|
|
1337
1337
|
'TONCOIN': 'TON',
|
1338
1338
|
},
|
1339
1339
|
'options': {
|
1340
|
+
'timeDifference': 0, # the difference between system clock and Binance clock
|
1341
|
+
'adjustForTimeDifference': False, # controls the adjustment logic upon instantiation
|
1340
1342
|
'timeframes': {
|
1341
1343
|
'spot': {
|
1342
1344
|
'1m': '1min',
|
@@ -1435,11 +1437,13 @@ class bitget(Exchange, ImplicitAPI):
|
|
1435
1437
|
'networks': {
|
1436
1438
|
'TRX': 'TRC20',
|
1437
1439
|
'ETH': 'ERC20',
|
1438
|
-
'
|
1440
|
+
'BEP20': 'BSC',
|
1441
|
+
'ZKSYNC': 'zkSyncEra',
|
1442
|
+
'STARKNET': 'Starknet',
|
1443
|
+
'OPTIMISM': 'Optimism',
|
1444
|
+
'ARBITRUM': 'Arbitrum',
|
1439
1445
|
},
|
1440
1446
|
'networksById': {
|
1441
|
-
'TRC20': 'TRX',
|
1442
|
-
'BSC': 'BEP20',
|
1443
1447
|
},
|
1444
1448
|
'fetchPositions': {
|
1445
1449
|
'method': 'privateMixGetV2MixPositionAllPosition', # or privateMixGetV2MixPositionHistoryPosition
|
@@ -1539,6 +1543,8 @@ class bitget(Exchange, ImplicitAPI):
|
|
1539
1543
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1540
1544
|
:returns dict[]: an array of objects representing market data
|
1541
1545
|
"""
|
1546
|
+
if self.options['adjustForTimeDifference']:
|
1547
|
+
await self.load_time_difference()
|
1542
1548
|
sandboxMode = self.safe_bool(self.options, 'sandboxMode', False)
|
1543
1549
|
types = self.safe_value(self.options, 'fetchMarkets', ['spot', 'swap'])
|
1544
1550
|
if sandboxMode:
|
@@ -1836,7 +1842,9 @@ class bitget(Exchange, ImplicitAPI):
|
|
1836
1842
|
for j in range(0, len(chains)):
|
1837
1843
|
chain = chains[j]
|
1838
1844
|
networkId = self.safe_string(chain, 'chain')
|
1839
|
-
network = self.
|
1845
|
+
network = self.network_id_to_code(networkId, code)
|
1846
|
+
if network is not None:
|
1847
|
+
network = network.upper()
|
1840
1848
|
withdrawEnabled = self.safe_string(chain, 'withdrawable')
|
1841
1849
|
canWithdraw = withdrawEnabled == 'true'
|
1842
1850
|
withdraw = canWithdraw if (canWithdraw) else withdraw
|
@@ -8203,6 +8211,9 @@ class bitget(Exchange, ImplicitAPI):
|
|
8203
8211
|
raise ExchangeError(feedback) # unknown message
|
8204
8212
|
return None
|
8205
8213
|
|
8214
|
+
def nonce(self):
|
8215
|
+
return self.milliseconds() - self.options['timeDifference']
|
8216
|
+
|
8206
8217
|
def sign(self, path, api=[], method='GET', params={}, headers=None, body=None):
|
8207
8218
|
signed = api[0] == 'private'
|
8208
8219
|
endpoint = api[1]
|
@@ -8218,7 +8229,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
8218
8229
|
url = url + '?' + self.urlencode(query)
|
8219
8230
|
if signed:
|
8220
8231
|
self.check_required_credentials()
|
8221
|
-
timestamp = str(self.
|
8232
|
+
timestamp = str(self.nonce())
|
8222
8233
|
auth = timestamp + method + payload
|
8223
8234
|
if method == 'POST':
|
8224
8235
|
body = self.json(params)
|