ccxt 4.2.58__py2.py3-none-any.whl → 4.2.60__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.
Potentially problematic release.
This version of ccxt might be problematic. Click here for more details.
- ccxt/__init__.py +1 -1
- ccxt/abstract/blofin.py +1 -0
- ccxt/abstract/kraken.py +37 -37
- ccxt/abstract/wazirx.py +6 -1
- ccxt/ascendex.py +10 -12
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ascendex.py +10 -12
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/binance.py +2 -2
- ccxt/async_support/bingx.py +40 -4
- ccxt/async_support/bitfinex2.py +20 -3
- ccxt/async_support/bitget.py +8 -3
- ccxt/async_support/bitmart.py +40 -23
- ccxt/async_support/bitmex.py +1 -1
- ccxt/async_support/blofin.py +53 -3
- ccxt/async_support/coinbase.py +21 -12
- ccxt/async_support/hitbtc.py +1 -1
- ccxt/async_support/htx.py +3 -1
- ccxt/async_support/kraken.py +42 -39
- ccxt/async_support/kucoinfutures.py +1 -0
- ccxt/async_support/lbank.py +1 -1
- ccxt/async_support/mexc.py +1 -1
- ccxt/async_support/okx.py +1 -1
- ccxt/async_support/phemex.py +1 -1
- ccxt/async_support/wazirx.py +6 -1
- ccxt/async_support/woo.py +148 -76
- ccxt/base/exchange.py +3 -1
- ccxt/binance.py +2 -2
- ccxt/bingx.py +40 -4
- ccxt/bitfinex2.py +20 -3
- ccxt/bitget.py +8 -3
- ccxt/bitmart.py +40 -23
- ccxt/bitmex.py +1 -1
- ccxt/blofin.py +53 -3
- ccxt/coinbase.py +21 -12
- ccxt/hitbtc.py +1 -1
- ccxt/htx.py +3 -1
- ccxt/kraken.py +42 -39
- ccxt/kucoinfutures.py +1 -0
- ccxt/lbank.py +1 -1
- ccxt/mexc.py +1 -1
- ccxt/okx.py +1 -1
- ccxt/phemex.py +1 -1
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/binance.py +12 -3
- ccxt/pro/bitfinex2.py +1 -1
- ccxt/pro/bitget.py +1 -1
- ccxt/pro/bitmart.py +44 -78
- ccxt/pro/bitvavo.py +1 -1
- ccxt/pro/bybit.py +1 -1
- ccxt/pro/coinex.py +1 -1
- ccxt/pro/cryptocom.py +1 -1
- ccxt/pro/deribit.py +188 -84
- ccxt/pro/gate.py +1 -1
- ccxt/pro/independentreserve.py +1 -1
- ccxt/pro/kraken.py +1 -1
- ccxt/pro/kucoinfutures.py +1 -1
- ccxt/pro/mexc.py +5 -4
- ccxt/pro/okx.py +1 -1
- ccxt/pro/woo.py +1 -1
- ccxt/test/test_async.py +4 -4
- ccxt/test/test_sync.py +4 -4
- ccxt/wazirx.py +6 -1
- ccxt/woo.py +148 -76
- {ccxt-4.2.58.dist-info → ccxt-4.2.60.dist-info}/METADATA +4 -4
- {ccxt-4.2.58.dist-info → ccxt-4.2.60.dist-info}/RECORD +68 -68
- {ccxt-4.2.58.dist-info → ccxt-4.2.60.dist-info}/WHEEL +0 -0
- {ccxt-4.2.58.dist-info → ccxt-4.2.60.dist-info}/top_level.txt +0 -0
ccxt/__init__.py
CHANGED
ccxt/abstract/blofin.py
CHANGED
@@ -19,6 +19,7 @@ class ImplicitAPI:
|
|
19
19
|
private_get_account_balance = privateGetAccountBalance = Entry('account/balance', 'private', 'GET', {'cost': 1})
|
20
20
|
private_get_account_positions = privateGetAccountPositions = Entry('account/positions', 'private', 'GET', {'cost': 1})
|
21
21
|
private_get_account_leverage_info = privateGetAccountLeverageInfo = Entry('account/leverage-info', 'private', 'GET', {'cost': 1})
|
22
|
+
private_get_account_batch_leverage_info = privateGetAccountBatchLeverageInfo = Entry('account/batch-leverage-info', 'private', 'GET', {'cost': 1})
|
22
23
|
private_get_trade_orders_tpsl_pending = privateGetTradeOrdersTpslPending = Entry('trade/orders-tpsl-pending', 'private', 'GET', {'cost': 1})
|
23
24
|
private_get_trade_orders_history = privateGetTradeOrdersHistory = Entry('trade/orders-history', 'private', 'GET', {'cost': 1})
|
24
25
|
private_get_trade_orders_tpsl_history = privateGetTradeOrdersTpslHistory = Entry('trade/orders-tpsl-history', 'private', 'GET', {'cost': 1})
|
ccxt/abstract/kraken.py
CHANGED
@@ -15,43 +15,43 @@ class ImplicitAPI:
|
|
15
15
|
public_get_trades = publicGetTrades = Entry('Trades', 'public', 'GET', {'cost': 1})
|
16
16
|
private_post_addorder = privatePostAddOrder = Entry('AddOrder', 'private', 'POST', {'cost': 0})
|
17
17
|
private_post_addorderbatch = privatePostAddOrderBatch = Entry('AddOrderBatch', 'private', 'POST', {'cost': 0})
|
18
|
-
private_post_addexport = privatePostAddExport = Entry('AddExport', 'private', 'POST', {'cost':
|
19
|
-
private_post_balance = privatePostBalance = Entry('Balance', 'private', 'POST', {'cost':
|
20
|
-
private_post_cancelall = privatePostCancelAll = Entry('CancelAll', 'private', 'POST', {'cost':
|
21
|
-
private_post_cancelallordersafter = privatePostCancelAllOrdersAfter = Entry('CancelAllOrdersAfter', 'private', 'POST', {'cost':
|
18
|
+
private_post_addexport = privatePostAddExport = Entry('AddExport', 'private', 'POST', {'cost': 3})
|
19
|
+
private_post_balance = privatePostBalance = Entry('Balance', 'private', 'POST', {'cost': 3})
|
20
|
+
private_post_cancelall = privatePostCancelAll = Entry('CancelAll', 'private', 'POST', {'cost': 3})
|
21
|
+
private_post_cancelallordersafter = privatePostCancelAllOrdersAfter = Entry('CancelAllOrdersAfter', 'private', 'POST', {'cost': 3})
|
22
22
|
private_post_cancelorder = privatePostCancelOrder = Entry('CancelOrder', 'private', 'POST', {'cost': 0})
|
23
23
|
private_post_cancelorderbatch = privatePostCancelOrderBatch = Entry('CancelOrderBatch', 'private', 'POST', {'cost': 0})
|
24
|
-
private_post_closedorders = privatePostClosedOrders = Entry('ClosedOrders', 'private', 'POST', {'cost':
|
25
|
-
private_post_depositaddresses = privatePostDepositAddresses = Entry('DepositAddresses', 'private', 'POST', {'cost':
|
26
|
-
private_post_depositmethods = privatePostDepositMethods = Entry('DepositMethods', 'private', 'POST', {'cost':
|
27
|
-
private_post_depositstatus = privatePostDepositStatus = Entry('DepositStatus', 'private', 'POST', {'cost':
|
24
|
+
private_post_closedorders = privatePostClosedOrders = Entry('ClosedOrders', 'private', 'POST', {'cost': 3})
|
25
|
+
private_post_depositaddresses = privatePostDepositAddresses = Entry('DepositAddresses', 'private', 'POST', {'cost': 3})
|
26
|
+
private_post_depositmethods = privatePostDepositMethods = Entry('DepositMethods', 'private', 'POST', {'cost': 3})
|
27
|
+
private_post_depositstatus = privatePostDepositStatus = Entry('DepositStatus', 'private', 'POST', {'cost': 3})
|
28
28
|
private_post_editorder = privatePostEditOrder = Entry('EditOrder', 'private', 'POST', {'cost': 0})
|
29
|
-
private_post_exportstatus = privatePostExportStatus = Entry('ExportStatus', 'private', 'POST', {'cost':
|
30
|
-
private_post_getwebsocketstoken = privatePostGetWebSocketsToken = Entry('GetWebSocketsToken', 'private', 'POST', {'cost':
|
31
|
-
private_post_ledgers = privatePostLedgers = Entry('Ledgers', 'private', 'POST', {'cost':
|
32
|
-
private_post_openorders = privatePostOpenOrders = Entry('OpenOrders', 'private', 'POST', {'cost':
|
33
|
-
private_post_openpositions = privatePostOpenPositions = Entry('OpenPositions', 'private', 'POST', {'cost':
|
34
|
-
private_post_queryledgers = privatePostQueryLedgers = Entry('QueryLedgers', 'private', 'POST', {'cost':
|
35
|
-
private_post_queryorders = privatePostQueryOrders = Entry('QueryOrders', 'private', 'POST', {'cost':
|
36
|
-
private_post_querytrades = privatePostQueryTrades = Entry('QueryTrades', 'private', 'POST', {'cost':
|
37
|
-
private_post_retrieveexport = privatePostRetrieveExport = Entry('RetrieveExport', 'private', 'POST', {'cost':
|
38
|
-
private_post_removeexport = privatePostRemoveExport = Entry('RemoveExport', 'private', 'POST', {'cost':
|
39
|
-
private_post_balanceex = privatePostBalanceEx = Entry('BalanceEx', 'private', 'POST', {'cost':
|
40
|
-
private_post_tradebalance = privatePostTradeBalance = Entry('TradeBalance', 'private', 'POST', {'cost':
|
41
|
-
private_post_tradeshistory = privatePostTradesHistory = Entry('TradesHistory', 'private', 'POST', {'cost':
|
42
|
-
private_post_tradevolume = privatePostTradeVolume = Entry('TradeVolume', 'private', 'POST', {'cost':
|
43
|
-
private_post_withdraw = privatePostWithdraw = Entry('Withdraw', 'private', 'POST', {'cost':
|
44
|
-
private_post_withdrawcancel = privatePostWithdrawCancel = Entry('WithdrawCancel', 'private', 'POST', {'cost':
|
45
|
-
private_post_withdrawinfo = privatePostWithdrawInfo = Entry('WithdrawInfo', 'private', 'POST', {'cost':
|
46
|
-
private_post_withdrawmethods = privatePostWithdrawMethods = Entry('WithdrawMethods', 'private', 'POST', {'cost':
|
47
|
-
private_post_withdrawaddresses = privatePostWithdrawAddresses = Entry('WithdrawAddresses', 'private', 'POST', {'cost':
|
48
|
-
private_post_withdrawstatus = privatePostWithdrawStatus = Entry('WithdrawStatus', 'private', 'POST', {'cost':
|
49
|
-
private_post_wallettransfer = privatePostWalletTransfer = Entry('WalletTransfer', 'private', 'POST', {'cost':
|
50
|
-
private_post_createsubaccount = privatePostCreateSubaccount = Entry('CreateSubaccount', 'private', 'POST', {'cost':
|
51
|
-
private_post_accounttransfer = privatePostAccountTransfer = Entry('AccountTransfer', 'private', 'POST', {'cost':
|
52
|
-
private_post_earn_allocate = privatePostEarnAllocate = Entry('Earn/Allocate', 'private', 'POST', {'cost':
|
53
|
-
private_post_earn_deallocate = privatePostEarnDeallocate = Entry('Earn/Deallocate', 'private', 'POST', {'cost':
|
54
|
-
private_post_earn_allocatestatus = privatePostEarnAllocateStatus = Entry('Earn/AllocateStatus', 'private', 'POST', {'cost':
|
55
|
-
private_post_earn_deallocatestatus = privatePostEarnDeallocateStatus = Entry('Earn/DeallocateStatus', 'private', 'POST', {'cost':
|
56
|
-
private_post_earn_strategies = privatePostEarnStrategies = Entry('Earn/Strategies', 'private', 'POST', {'cost':
|
57
|
-
private_post_earn_allocations = privatePostEarnAllocations = Entry('Earn/Allocations', 'private', 'POST', {'cost':
|
29
|
+
private_post_exportstatus = privatePostExportStatus = Entry('ExportStatus', 'private', 'POST', {'cost': 3})
|
30
|
+
private_post_getwebsocketstoken = privatePostGetWebSocketsToken = Entry('GetWebSocketsToken', 'private', 'POST', {'cost': 3})
|
31
|
+
private_post_ledgers = privatePostLedgers = Entry('Ledgers', 'private', 'POST', {'cost': 6})
|
32
|
+
private_post_openorders = privatePostOpenOrders = Entry('OpenOrders', 'private', 'POST', {'cost': 3})
|
33
|
+
private_post_openpositions = privatePostOpenPositions = Entry('OpenPositions', 'private', 'POST', {'cost': 3})
|
34
|
+
private_post_queryledgers = privatePostQueryLedgers = Entry('QueryLedgers', 'private', 'POST', {'cost': 3})
|
35
|
+
private_post_queryorders = privatePostQueryOrders = Entry('QueryOrders', 'private', 'POST', {'cost': 3})
|
36
|
+
private_post_querytrades = privatePostQueryTrades = Entry('QueryTrades', 'private', 'POST', {'cost': 3})
|
37
|
+
private_post_retrieveexport = privatePostRetrieveExport = Entry('RetrieveExport', 'private', 'POST', {'cost': 3})
|
38
|
+
private_post_removeexport = privatePostRemoveExport = Entry('RemoveExport', 'private', 'POST', {'cost': 3})
|
39
|
+
private_post_balanceex = privatePostBalanceEx = Entry('BalanceEx', 'private', 'POST', {'cost': 3})
|
40
|
+
private_post_tradebalance = privatePostTradeBalance = Entry('TradeBalance', 'private', 'POST', {'cost': 3})
|
41
|
+
private_post_tradeshistory = privatePostTradesHistory = Entry('TradesHistory', 'private', 'POST', {'cost': 6})
|
42
|
+
private_post_tradevolume = privatePostTradeVolume = Entry('TradeVolume', 'private', 'POST', {'cost': 3})
|
43
|
+
private_post_withdraw = privatePostWithdraw = Entry('Withdraw', 'private', 'POST', {'cost': 3})
|
44
|
+
private_post_withdrawcancel = privatePostWithdrawCancel = Entry('WithdrawCancel', 'private', 'POST', {'cost': 3})
|
45
|
+
private_post_withdrawinfo = privatePostWithdrawInfo = Entry('WithdrawInfo', 'private', 'POST', {'cost': 3})
|
46
|
+
private_post_withdrawmethods = privatePostWithdrawMethods = Entry('WithdrawMethods', 'private', 'POST', {'cost': 3})
|
47
|
+
private_post_withdrawaddresses = privatePostWithdrawAddresses = Entry('WithdrawAddresses', 'private', 'POST', {'cost': 3})
|
48
|
+
private_post_withdrawstatus = privatePostWithdrawStatus = Entry('WithdrawStatus', 'private', 'POST', {'cost': 3})
|
49
|
+
private_post_wallettransfer = privatePostWalletTransfer = Entry('WalletTransfer', 'private', 'POST', {'cost': 3})
|
50
|
+
private_post_createsubaccount = privatePostCreateSubaccount = Entry('CreateSubaccount', 'private', 'POST', {'cost': 3})
|
51
|
+
private_post_accounttransfer = privatePostAccountTransfer = Entry('AccountTransfer', 'private', 'POST', {'cost': 3})
|
52
|
+
private_post_earn_allocate = privatePostEarnAllocate = Entry('Earn/Allocate', 'private', 'POST', {'cost': 3})
|
53
|
+
private_post_earn_deallocate = privatePostEarnDeallocate = Entry('Earn/Deallocate', 'private', 'POST', {'cost': 3})
|
54
|
+
private_post_earn_allocatestatus = privatePostEarnAllocateStatus = Entry('Earn/AllocateStatus', 'private', 'POST', {'cost': 3})
|
55
|
+
private_post_earn_deallocatestatus = privatePostEarnDeallocateStatus = Entry('Earn/DeallocateStatus', 'private', 'POST', {'cost': 3})
|
56
|
+
private_post_earn_strategies = privatePostEarnStrategies = Entry('Earn/Strategies', 'private', 'POST', {'cost': 3})
|
57
|
+
private_post_earn_allocations = privatePostEarnAllocations = Entry('Earn/Allocations', 'private', 'POST', {'cost': 3})
|
ccxt/abstract/wazirx.py
CHANGED
@@ -3,7 +3,7 @@ from ccxt.base.types import Entry
|
|
3
3
|
|
4
4
|
class ImplicitAPI:
|
5
5
|
public_get_exchangeinfo = publicGetExchangeInfo = Entry('exchangeInfo', 'public', 'GET', {'cost': 1})
|
6
|
-
public_get_depth = publicGetDepth = Entry('depth', 'public', 'GET', {'cost':
|
6
|
+
public_get_depth = publicGetDepth = Entry('depth', 'public', 'GET', {'cost': 0.5})
|
7
7
|
public_get_ping = publicGetPing = Entry('ping', 'public', 'GET', {'cost': 1})
|
8
8
|
public_get_systemstatus = publicGetSystemStatus = Entry('systemStatus', 'public', 'GET', {'cost': 1})
|
9
9
|
public_get_tickers_24hr = publicGetTickers24hr = Entry('tickers/24hr', 'public', 'GET', {'cost': 1})
|
@@ -18,6 +18,11 @@ class ImplicitAPI:
|
|
18
18
|
private_get_openorders = privateGetOpenOrders = Entry('openOrders', 'private', 'GET', {'cost': 1})
|
19
19
|
private_get_order = privateGetOrder = Entry('order', 'private', 'GET', {'cost': 0.5})
|
20
20
|
private_get_mytrades = privateGetMyTrades = Entry('myTrades', 'private', 'GET', {'cost': 0.5})
|
21
|
+
private_get_coins = privateGetCoins = Entry('coins', 'private', 'GET', {'cost': 12})
|
22
|
+
private_get_crypto_withdraws = privateGetCryptoWithdraws = Entry('crypto/withdraws', 'private', 'GET', {'cost': 12})
|
23
|
+
private_get_crypto_deposits_address = privateGetCryptoDepositsAddress = Entry('crypto/deposits/address', 'private', 'GET', {'cost': 60})
|
24
|
+
private_get_sub_account_fund_transfer_history = privateGetSubAccountFundTransferHistory = Entry('sub_account/fund_transfer/history', 'private', 'GET', {'cost': 1})
|
25
|
+
private_get_sub_account_accounts = privateGetSubAccountAccounts = Entry('sub_account/accounts', 'private', 'GET', {'cost': 1})
|
21
26
|
private_post_order = privatePostOrder = Entry('order', 'private', 'POST', {'cost': 0.1})
|
22
27
|
private_post_order_test = privatePostOrderTest = Entry('order/test', 'private', 'POST', {'cost': 0.5})
|
23
28
|
private_post_create_auth_token = privatePostCreateAuthToken = Entry('create_auth_token', 'private', 'POST', {'cost': 1})
|
ccxt/ascendex.py
CHANGED
@@ -751,11 +751,10 @@ class ascendex(Exchange, ImplicitAPI):
|
|
751
751
|
]
|
752
752
|
|
753
753
|
def parse_balance(self, response) -> Balances:
|
754
|
-
timestamp = self.milliseconds()
|
755
754
|
result = {
|
756
755
|
'info': response,
|
757
|
-
'timestamp':
|
758
|
-
'datetime':
|
756
|
+
'timestamp': None,
|
757
|
+
'datetime': None,
|
759
758
|
}
|
760
759
|
balances = self.safe_value(response, 'data', [])
|
761
760
|
for i in range(0, len(balances)):
|
@@ -768,11 +767,10 @@ class ascendex(Exchange, ImplicitAPI):
|
|
768
767
|
return self.safe_balance(result)
|
769
768
|
|
770
769
|
def parse_margin_balance(self, response):
|
771
|
-
timestamp = self.milliseconds()
|
772
770
|
result = {
|
773
771
|
'info': response,
|
774
|
-
'timestamp':
|
775
|
-
'datetime':
|
772
|
+
'timestamp': None,
|
773
|
+
'datetime': None,
|
776
774
|
}
|
777
775
|
balances = self.safe_value(response, 'data', [])
|
778
776
|
for i in range(0, len(balances)):
|
@@ -788,11 +786,10 @@ class ascendex(Exchange, ImplicitAPI):
|
|
788
786
|
return self.safe_balance(result)
|
789
787
|
|
790
788
|
def parse_swap_balance(self, response):
|
791
|
-
timestamp = self.milliseconds()
|
792
789
|
result = {
|
793
790
|
'info': response,
|
794
|
-
'timestamp':
|
795
|
-
'datetime':
|
791
|
+
'timestamp': None,
|
792
|
+
'datetime': None,
|
796
793
|
}
|
797
794
|
data = self.safe_value(response, 'data', {})
|
798
795
|
collaterals = self.safe_value(data, 'collaterals', [])
|
@@ -811,6 +808,8 @@ class ascendex(Exchange, ImplicitAPI):
|
|
811
808
|
:see: https://ascendex.github.io/ascendex-pro-api/#margin-account-balance
|
812
809
|
:see: https://ascendex.github.io/ascendex-futures-pro-api-v2/#position
|
813
810
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
811
|
+
:param str [params.type]: wallet type, 'spot', 'margin', or 'swap'
|
812
|
+
:param str [params.marginMode]: 'cross' or None, for spot margin trading, value of 'isolated' is invalid
|
814
813
|
:returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
|
815
814
|
"""
|
816
815
|
self.load_markets()
|
@@ -3011,12 +3010,11 @@ class ascendex(Exchange, ImplicitAPI):
|
|
3011
3010
|
#
|
3012
3011
|
status = self.safe_integer(transfer, 'code')
|
3013
3012
|
currencyCode = self.safe_currency_code(None, currency)
|
3014
|
-
timestamp = self.milliseconds()
|
3015
3013
|
return {
|
3016
3014
|
'info': transfer,
|
3017
3015
|
'id': None,
|
3018
|
-
'timestamp':
|
3019
|
-
'datetime':
|
3016
|
+
'timestamp': None,
|
3017
|
+
'datetime': None,
|
3020
3018
|
'currency': currencyCode,
|
3021
3019
|
'amount': None,
|
3022
3020
|
'fromAccount': None,
|
ccxt/async_support/__init__.py
CHANGED
ccxt/async_support/ascendex.py
CHANGED
@@ -751,11 +751,10 @@ class ascendex(Exchange, ImplicitAPI):
|
|
751
751
|
]
|
752
752
|
|
753
753
|
def parse_balance(self, response) -> Balances:
|
754
|
-
timestamp = self.milliseconds()
|
755
754
|
result = {
|
756
755
|
'info': response,
|
757
|
-
'timestamp':
|
758
|
-
'datetime':
|
756
|
+
'timestamp': None,
|
757
|
+
'datetime': None,
|
759
758
|
}
|
760
759
|
balances = self.safe_value(response, 'data', [])
|
761
760
|
for i in range(0, len(balances)):
|
@@ -768,11 +767,10 @@ class ascendex(Exchange, ImplicitAPI):
|
|
768
767
|
return self.safe_balance(result)
|
769
768
|
|
770
769
|
def parse_margin_balance(self, response):
|
771
|
-
timestamp = self.milliseconds()
|
772
770
|
result = {
|
773
771
|
'info': response,
|
774
|
-
'timestamp':
|
775
|
-
'datetime':
|
772
|
+
'timestamp': None,
|
773
|
+
'datetime': None,
|
776
774
|
}
|
777
775
|
balances = self.safe_value(response, 'data', [])
|
778
776
|
for i in range(0, len(balances)):
|
@@ -788,11 +786,10 @@ class ascendex(Exchange, ImplicitAPI):
|
|
788
786
|
return self.safe_balance(result)
|
789
787
|
|
790
788
|
def parse_swap_balance(self, response):
|
791
|
-
timestamp = self.milliseconds()
|
792
789
|
result = {
|
793
790
|
'info': response,
|
794
|
-
'timestamp':
|
795
|
-
'datetime':
|
791
|
+
'timestamp': None,
|
792
|
+
'datetime': None,
|
796
793
|
}
|
797
794
|
data = self.safe_value(response, 'data', {})
|
798
795
|
collaterals = self.safe_value(data, 'collaterals', [])
|
@@ -811,6 +808,8 @@ class ascendex(Exchange, ImplicitAPI):
|
|
811
808
|
:see: https://ascendex.github.io/ascendex-pro-api/#margin-account-balance
|
812
809
|
:see: https://ascendex.github.io/ascendex-futures-pro-api-v2/#position
|
813
810
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
811
|
+
:param str [params.type]: wallet type, 'spot', 'margin', or 'swap'
|
812
|
+
:param str [params.marginMode]: 'cross' or None, for spot margin trading, value of 'isolated' is invalid
|
814
813
|
:returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
|
815
814
|
"""
|
816
815
|
await self.load_markets()
|
@@ -3011,12 +3010,11 @@ class ascendex(Exchange, ImplicitAPI):
|
|
3011
3010
|
#
|
3012
3011
|
status = self.safe_integer(transfer, 'code')
|
3013
3012
|
currencyCode = self.safe_currency_code(None, currency)
|
3014
|
-
timestamp = self.milliseconds()
|
3015
3013
|
return {
|
3016
3014
|
'info': transfer,
|
3017
3015
|
'id': None,
|
3018
|
-
'timestamp':
|
3019
|
-
'datetime':
|
3016
|
+
'timestamp': None,
|
3017
|
+
'datetime': None,
|
3020
3018
|
'currency': currencyCode,
|
3021
3019
|
'amount': None,
|
3022
3020
|
'fromAccount': None,
|
ccxt/async_support/binance.py
CHANGED
@@ -4627,7 +4627,7 @@ class binance(Exchange, ImplicitAPI):
|
|
4627
4627
|
stopPriceIsRequired = False
|
4628
4628
|
quantityIsRequired = False
|
4629
4629
|
if uppercaseType == 'MARKET':
|
4630
|
-
quoteOrderQty = self.
|
4630
|
+
quoteOrderQty = self.safe_bool(self.options, 'quoteOrderQty', True)
|
4631
4631
|
if quoteOrderQty:
|
4632
4632
|
quoteOrderQtyNew = self.safe_value_2(params, 'quoteOrderQty', 'cost')
|
4633
4633
|
precision = market['precision']['price']
|
@@ -9547,7 +9547,7 @@ class binance(Exchange, ImplicitAPI):
|
|
9547
9547
|
# POST https://fapi.binance.com/fapi/v1/marginType 400 Bad Request
|
9548
9548
|
# binanceusdm
|
9549
9549
|
if isinstance(e, MarginModeAlreadySet):
|
9550
|
-
throwMarginModeAlreadySet = self.
|
9550
|
+
throwMarginModeAlreadySet = self.safe_bool(self.options, 'throwMarginModeAlreadySet', False)
|
9551
9551
|
if throwMarginModeAlreadySet:
|
9552
9552
|
raise e
|
9553
9553
|
else:
|
ccxt/async_support/bingx.py
CHANGED
@@ -8,7 +8,7 @@ from ccxt.abstract.bingx import ImplicitAPI
|
|
8
8
|
import asyncio
|
9
9
|
import hashlib
|
10
10
|
import numbers
|
11
|
-
from ccxt.base.types import Balances, Currency, Int, Leverage, Market, Order, TransferEntry, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, Transaction
|
11
|
+
from ccxt.base.types import Balances, Currency, Int, Leverage, MarginMode, Market, Order, TransferEntry, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, Transaction
|
12
12
|
from typing import List
|
13
13
|
from ccxt.base.errors import ExchangeError
|
14
14
|
from ccxt.base.errors import PermissionDenied
|
@@ -73,6 +73,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
73
73
|
'fetchFundingRates': True,
|
74
74
|
'fetchLeverage': True,
|
75
75
|
'fetchLiquidations': False,
|
76
|
+
'fetchMarginMode': True,
|
76
77
|
'fetchMarkets': True,
|
77
78
|
'fetchMarkOHLCV': True,
|
78
79
|
'fetchMyLiquidations': True,
|
@@ -458,7 +459,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
458
459
|
"""
|
459
460
|
if not self.check_required_credentials(False):
|
460
461
|
return None
|
461
|
-
isSandbox = self.
|
462
|
+
isSandbox = self.safe_bool(self.options, 'sandboxMode', False)
|
462
463
|
if isSandbox:
|
463
464
|
return None
|
464
465
|
response = await self.walletsV1PrivateGetCapitalConfigGetall(params)
|
@@ -693,7 +694,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
693
694
|
:returns dict[]: an array of objects representing market data
|
694
695
|
"""
|
695
696
|
requests = [self.fetch_swap_markets(params)]
|
696
|
-
isSandbox = self.
|
697
|
+
isSandbox = self.safe_bool(self.options, 'sandboxMode', False)
|
697
698
|
if not isSandbox:
|
698
699
|
requests.append(self.fetch_spot_markets(params)) # sandbox is swap only
|
699
700
|
promises = await asyncio.gather(*requests)
|
@@ -3899,11 +3900,46 @@ class bingx(Exchange, ImplicitAPI):
|
|
3899
3900
|
data = self.safe_dict(response, 'data')
|
3900
3901
|
return self.parse_order(data, market)
|
3901
3902
|
|
3903
|
+
async def fetch_margin_mode(self, symbol: str, params={}) -> MarginMode:
|
3904
|
+
"""
|
3905
|
+
fetches the margin mode of the trading pair
|
3906
|
+
:see: https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Query%20Margin%20Mode
|
3907
|
+
:param str symbol: unified symbol of the market to fetch the margin mode for
|
3908
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
3909
|
+
:returns dict: Struct of MarginMode
|
3910
|
+
"""
|
3911
|
+
await self.load_markets()
|
3912
|
+
market = self.market(symbol)
|
3913
|
+
request: dict = {
|
3914
|
+
'symbol': market['id'],
|
3915
|
+
}
|
3916
|
+
response = await self.swapV2PrivateGetTradeMarginType(self.extend(request, params))
|
3917
|
+
#
|
3918
|
+
# {
|
3919
|
+
# "code": 0,
|
3920
|
+
# "msg": "",
|
3921
|
+
# "data": {
|
3922
|
+
# "marginType": "CROSSED"
|
3923
|
+
# }
|
3924
|
+
# }
|
3925
|
+
#
|
3926
|
+
data = self.safe_dict(response, 'data', {})
|
3927
|
+
return self.parse_margin_mode(data, market)
|
3928
|
+
|
3929
|
+
def parse_margin_mode(self, marginMode, market=None) -> MarginMode:
|
3930
|
+
marginType = self.safe_string_lower(marginMode, 'marginType')
|
3931
|
+
marginType = 'cross' if (marginType == 'crossed') else marginType
|
3932
|
+
return {
|
3933
|
+
'info': marginMode,
|
3934
|
+
'symbol': market['symbol'],
|
3935
|
+
'marginMode': marginType,
|
3936
|
+
}
|
3937
|
+
|
3902
3938
|
def sign(self, path, section='public', method='GET', params={}, headers=None, body=None):
|
3903
3939
|
type = section[0]
|
3904
3940
|
version = section[1]
|
3905
3941
|
access = section[2]
|
3906
|
-
isSandbox = self.
|
3942
|
+
isSandbox = self.safe_bool(self.options, 'sandboxMode', False)
|
3907
3943
|
if isSandbox and (type != 'swap'):
|
3908
3944
|
raise NotSupported(self.id + ' does not have a testnet/sandbox URL for ' + type + ' endpoints')
|
3909
3945
|
url = self.implode_hostname(self.urls['api'][type])
|
ccxt/async_support/bitfinex2.py
CHANGED
@@ -46,8 +46,8 @@ class bitfinex2(Exchange, ImplicitAPI):
|
|
46
46
|
'spot': True,
|
47
47
|
'margin': True,
|
48
48
|
'swap': True,
|
49
|
-
'future':
|
50
|
-
'option':
|
49
|
+
'future': False,
|
50
|
+
'option': False,
|
51
51
|
'addMargin': False,
|
52
52
|
'borrowCrossMargin': False,
|
53
53
|
'borrowIsolatedMargin': False,
|
@@ -58,6 +58,7 @@ class bitfinex2(Exchange, ImplicitAPI):
|
|
58
58
|
'createLimitOrder': True,
|
59
59
|
'createMarketOrder': True,
|
60
60
|
'createOrder': True,
|
61
|
+
'createPostOnlyOrder': True,
|
61
62
|
'createReduceOnlyOrder': True,
|
62
63
|
'createStopLimitOrder': True,
|
63
64
|
'createStopMarketOrder': True,
|
@@ -68,8 +69,11 @@ class bitfinex2(Exchange, ImplicitAPI):
|
|
68
69
|
'editOrder': True,
|
69
70
|
'fetchBalance': True,
|
70
71
|
'fetchBorrowInterest': False,
|
72
|
+
'fetchBorrowRate': False,
|
71
73
|
'fetchBorrowRateHistories': False,
|
72
74
|
'fetchBorrowRateHistory': False,
|
75
|
+
'fetchBorrowRates': False,
|
76
|
+
'fetchBorrowRatesPerSymbol': False,
|
73
77
|
'fetchClosedOrder': True,
|
74
78
|
'fetchClosedOrders': True,
|
75
79
|
'fetchCrossBorrowRate': False,
|
@@ -98,6 +102,8 @@ class bitfinex2(Exchange, ImplicitAPI):
|
|
98
102
|
'fetchOpenOrder': True,
|
99
103
|
'fetchOpenOrders': True,
|
100
104
|
'fetchOrder': True,
|
105
|
+
'fetchOrderBook': True,
|
106
|
+
'fetchOrderBooks': False,
|
101
107
|
'fetchOrderTrades': True,
|
102
108
|
'fetchPosition': False,
|
103
109
|
'fetchPositionMode': False,
|
@@ -117,6 +123,8 @@ class bitfinex2(Exchange, ImplicitAPI):
|
|
117
123
|
'setMargin': True,
|
118
124
|
'setMarginMode': False,
|
119
125
|
'setPositionMode': False,
|
126
|
+
'signIn': False,
|
127
|
+
'transfer': True,
|
120
128
|
'withdraw': True,
|
121
129
|
},
|
122
130
|
'timeframes': {
|
@@ -1484,7 +1492,16 @@ class bitfinex2(Exchange, ImplicitAPI):
|
|
1484
1492
|
:param float amount: how much you want to trade in units of the base currency
|
1485
1493
|
:param float [price]: the price of the order, in units of the quote currency, ignored in market orders
|
1486
1494
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1487
|
-
:
|
1495
|
+
:param float [params.stopPrice]: The price at which a trigger order is triggered at
|
1496
|
+
:param str [params.timeInForce]: "GTC", "IOC", "FOK", or "PO"
|
1497
|
+
:param bool [params.postOnly]:
|
1498
|
+
:param bool [params.reduceOnly]: Ensures that the executed order does not flip the opened position.
|
1499
|
+
:param int [params.flags]: additional order parameters: 4096(Post Only), 1024(Reduce Only), 16384(OCO), 64(Hidden), 512(Close), 524288(No Var Rates)
|
1500
|
+
:param int [params.lev]: leverage for a derivative order, supported by derivative symbol orders only. The value should be between 1 and 100 inclusive.
|
1501
|
+
:param str [params.price_traling]: The trailing price for a trailing stop order
|
1502
|
+
:param str [params.price_aux_limit]: Order price for stop limit orders
|
1503
|
+
:param str [params.price_oco_stop]: OCO stop price
|
1504
|
+
:returns dict: an `order structure <https://github.com/ccxt/ccxt/wiki/Manual#order-structure>`
|
1488
1505
|
"""
|
1489
1506
|
market = self.market(symbol)
|
1490
1507
|
amountString = self.amount_to_precision(symbol, amount)
|
ccxt/async_support/bitget.py
CHANGED
@@ -2847,8 +2847,13 @@ class bitget(Exchange, ImplicitAPI):
|
|
2847
2847
|
currencyCode = self.safe_currency_code(self.safe_string(feeStructure, 'feeCoin'))
|
2848
2848
|
fee = {
|
2849
2849
|
'currency': currencyCode,
|
2850
|
-
'cost': Precise.string_abs(self.safe_string(feeStructure, 'totalFee')),
|
2851
2850
|
}
|
2851
|
+
feeCostString = self.safe_string(feeStructure, 'totalFee')
|
2852
|
+
deduction = self.safe_string(feeStructure, 'deduction') is True if 'yes' else False
|
2853
|
+
if deduction:
|
2854
|
+
fee['cost'] = feeCostString
|
2855
|
+
else:
|
2856
|
+
fee['cost'] = Precise.string_neg(feeCostString)
|
2852
2857
|
return self.safe_trade({
|
2853
2858
|
'info': trade,
|
2854
2859
|
'id': self.safe_string(trade, 'tradeId'),
|
@@ -3866,7 +3871,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
3866
3871
|
:see: https://www.bitget.com/api-doc/margin/isolated/trade/Isolated-Place-Order
|
3867
3872
|
:param str symbol: unified symbol of the market to create an order in
|
3868
3873
|
:param str type: 'market' or 'limit'
|
3869
|
-
:param str side: 'buy' or 'sell'
|
3874
|
+
:param str side: 'buy' or 'sell'
|
3870
3875
|
:param float amount: how much you want to trade in units of the base currency
|
3871
3876
|
:param float [price]: the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
|
3872
3877
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -4269,7 +4274,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
4269
4274
|
params = self.omit(params, ['stopPrice', 'triggerType', 'stopLossPrice', 'takeProfitPrice', 'stopLoss', 'takeProfit', 'clientOrderId', 'trailingTriggerPrice', 'trailingPercent'])
|
4270
4275
|
response = None
|
4271
4276
|
if market['spot']:
|
4272
|
-
editMarketBuyOrderRequiresPrice = self.
|
4277
|
+
editMarketBuyOrderRequiresPrice = self.safe_bool(self.options, 'editMarketBuyOrderRequiresPrice', True)
|
4273
4278
|
if editMarketBuyOrderRequiresPrice and isMarketOrder and (side == 'buy'):
|
4274
4279
|
if price is None:
|
4275
4280
|
raise InvalidOrder(self.id + ' editOrder() requires price argument for market buy orders on spot markets to calculate the total amount to spend(amount * price), alternatively set the editMarketBuyOrderRequiresPrice option to False and pass in the cost to spend into the amount parameter')
|
ccxt/async_support/bitmart.py
CHANGED
@@ -530,6 +530,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
530
530
|
},
|
531
531
|
'networks': {
|
532
532
|
'ERC20': 'ERC20',
|
533
|
+
'SOL': 'SOL',
|
533
534
|
'BTC': 'BTC',
|
534
535
|
'TRC20': 'TRC20',
|
535
536
|
# todo: should be TRX after unification
|
@@ -552,7 +553,6 @@ class bitmart(Exchange, ImplicitAPI):
|
|
552
553
|
'FIO': 'FIO',
|
553
554
|
'SCRT': 'SCRT',
|
554
555
|
'IOTX': 'IOTX',
|
555
|
-
'SOL': 'SOL',
|
556
556
|
'ALGO': 'ALGO',
|
557
557
|
'ATOM': 'ATOM',
|
558
558
|
'DOT': 'DOT',
|
@@ -2886,6 +2886,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
2886
2886
|
async def fetch_deposit_address(self, code: str, params={}):
|
2887
2887
|
"""
|
2888
2888
|
fetch the deposit address for a currency associated with self account
|
2889
|
+
:see: https://developer-pro.bitmart.com/en/spot/#deposit-address-keyed
|
2889
2890
|
:param str code: unified currency code
|
2890
2891
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2891
2892
|
:returns dict: an `address structure <https://docs.ccxt.com/#/?id=address-structure>`
|
@@ -2906,39 +2907,55 @@ class bitmart(Exchange, ImplicitAPI):
|
|
2906
2907
|
params = self.omit(params, 'network')
|
2907
2908
|
response = await self.privateGetAccountV1DepositAddress(self.extend(request, params))
|
2908
2909
|
#
|
2909
|
-
#
|
2910
|
-
#
|
2911
|
-
#
|
2912
|
-
#
|
2913
|
-
#
|
2914
|
-
#
|
2915
|
-
#
|
2916
|
-
#
|
2917
|
-
#
|
2918
|
-
#
|
2919
|
-
#
|
2910
|
+
# {
|
2911
|
+
# "message": "OK",
|
2912
|
+
# "code": 1000,
|
2913
|
+
# "trace": "0e6edd79-f77f-4251-abe5-83ba75d06c1a",
|
2914
|
+
# "data": {
|
2915
|
+
# currency: 'ETH',
|
2916
|
+
# chain: 'Ethereum',
|
2917
|
+
# address: '0x99B5EEc2C520f86F0F62F05820d28D05D36EccCf',
|
2918
|
+
# address_memo: ''
|
2919
|
+
# }
|
2920
|
+
# }
|
2920
2921
|
#
|
2921
2922
|
data = self.safe_value(response, 'data', {})
|
2922
|
-
|
2923
|
-
|
2924
|
-
|
2923
|
+
return self.parse_deposit_address(data, currency)
|
2924
|
+
|
2925
|
+
def parse_deposit_address(self, depositAddress, currency=None):
|
2926
|
+
#
|
2927
|
+
# {
|
2928
|
+
# currency: 'ETH',
|
2929
|
+
# chain: 'Ethereum',
|
2930
|
+
# address: '0x99B5EEc2C520f86F0F62F05820d28D05D36EccCf',
|
2931
|
+
# address_memo: ''
|
2932
|
+
# }
|
2933
|
+
#
|
2934
|
+
currencyId = self.safe_string(depositAddress, 'currency')
|
2935
|
+
address = self.safe_string(depositAddress, 'address')
|
2936
|
+
chain = self.safe_string(depositAddress, 'chain')
|
2925
2937
|
network = None
|
2938
|
+
currency = self.safe_currency(currencyId, currency)
|
2926
2939
|
if chain is not None:
|
2927
2940
|
parts = chain.split('-')
|
2928
|
-
|
2929
|
-
|
2941
|
+
partsLength = len(parts)
|
2942
|
+
networkId = self.safe_string(parts, partsLength - 1)
|
2943
|
+
network = self.safe_network_code(networkId, currency)
|
2930
2944
|
self.check_address(address)
|
2931
2945
|
return {
|
2932
|
-
'
|
2946
|
+
'info': depositAddress,
|
2947
|
+
'currency': self.safe_string(currency, 'code'),
|
2933
2948
|
'address': address,
|
2934
|
-
'tag':
|
2949
|
+
'tag': self.safe_string(depositAddress, 'address_memo'),
|
2935
2950
|
'network': network,
|
2936
|
-
'info': response,
|
2937
2951
|
}
|
2938
2952
|
|
2939
|
-
def
|
2940
|
-
|
2941
|
-
|
2953
|
+
def safe_network_code(self, networkId, currency=None):
|
2954
|
+
name = self.safe_string(currency, 'name')
|
2955
|
+
if networkId == name:
|
2956
|
+
code = self.safe_string(currency, 'code')
|
2957
|
+
return code
|
2958
|
+
return self.network_id_to_code(networkId)
|
2942
2959
|
|
2943
2960
|
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
2944
2961
|
"""
|
ccxt/async_support/bitmex.py
CHANGED
@@ -1436,7 +1436,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
1436
1436
|
params = self.omit(params, ['until'])
|
1437
1437
|
request['endTime'] = self.iso8601(until)
|
1438
1438
|
duration = self.parse_timeframe(timeframe) * 1000
|
1439
|
-
fetchOHLCVOpenTimestamp = self.
|
1439
|
+
fetchOHLCVOpenTimestamp = self.safe_bool(self.options, 'fetchOHLCVOpenTimestamp', True)
|
1440
1440
|
# if since is not set, they will return candles starting from 2017-01-01
|
1441
1441
|
if since is not None:
|
1442
1442
|
timestamp = since
|