ccxt 4.2.38__py2.py3-none-any.whl → 4.2.40__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/bingx.py +4 -0
- ccxt/abstract/coinbase.py +1 -0
- ccxt/abstract/coinbasepro.py +1 -0
- ccxt/abstract/okx.py +1 -0
- ccxt/ascendex.py +31 -27
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ascendex.py +31 -27
- ccxt/async_support/base/exchange.py +19 -7
- ccxt/async_support/bigone.py +2 -2
- ccxt/async_support/binance.py +478 -188
- ccxt/async_support/bingx.py +250 -28
- ccxt/async_support/bitfinex.py +3 -3
- ccxt/async_support/bitfinex2.py +2 -2
- ccxt/async_support/bitget.py +16 -7
- ccxt/async_support/bitmart.py +2 -2
- ccxt/async_support/bitmex.py +2 -2
- ccxt/async_support/bitrue.py +2 -2
- ccxt/async_support/bitso.py +19 -3
- ccxt/async_support/bitstamp.py +25 -3
- ccxt/async_support/bitvavo.py +1 -1
- ccxt/async_support/bl3p.py +6 -0
- ccxt/async_support/blockchaincom.py +21 -0
- ccxt/async_support/blofin.py +2 -2
- ccxt/async_support/btcalpha.py +9 -0
- ccxt/async_support/btcbox.py +9 -0
- ccxt/async_support/btcmarkets.py +19 -0
- ccxt/async_support/bybit.py +9 -7
- ccxt/async_support/cex.py +1 -1
- ccxt/async_support/coinbase.py +20 -9
- ccxt/async_support/coinbasepro.py +1 -0
- ccxt/async_support/coinex.py +4 -4
- ccxt/async_support/coinlist.py +11 -9
- ccxt/async_support/coinmetro.py +2 -1
- ccxt/async_support/coinone.py +1 -1
- ccxt/async_support/delta.py +2 -2
- ccxt/async_support/deribit.py +3 -3
- ccxt/async_support/digifinex.py +3 -3
- ccxt/async_support/exmo.py +2 -2
- ccxt/async_support/gate.py +6 -6
- ccxt/async_support/hitbtc.py +2 -2
- ccxt/async_support/hollaex.py +1 -1
- ccxt/async_support/htx.py +3 -3
- ccxt/async_support/huobijp.py +1 -1
- ccxt/async_support/kraken.py +2 -2
- ccxt/async_support/krakenfutures.py +117 -16
- ccxt/async_support/kucoin.py +5 -5
- ccxt/async_support/kucoinfutures.py +2 -2
- ccxt/async_support/latoken.py +1 -1
- ccxt/async_support/lbank.py +2 -2
- ccxt/async_support/luno.py +2 -2
- ccxt/async_support/mexc.py +5 -5
- ccxt/async_support/ndax.py +1 -1
- ccxt/async_support/novadax.py +1 -1
- ccxt/async_support/okcoin.py +2 -2
- ccxt/async_support/okx.py +18 -21
- ccxt/async_support/paymium.py +2 -2
- ccxt/async_support/phemex.py +5 -4
- ccxt/async_support/poloniex.py +2 -2
- ccxt/async_support/poloniexfutures.py +10 -6
- ccxt/async_support/probit.py +1 -1
- ccxt/async_support/timex.py +1 -1
- ccxt/async_support/upbit.py +1 -1
- ccxt/async_support/wavesexchange.py +1 -1
- ccxt/async_support/whitebit.py +2 -2
- ccxt/async_support/woo.py +4 -4
- ccxt/async_support/zonda.py +3 -3
- ccxt/base/exchange.py +37 -25
- ccxt/bigone.py +2 -2
- ccxt/binance.py +478 -188
- ccxt/bingx.py +250 -28
- ccxt/bitfinex.py +3 -3
- ccxt/bitfinex2.py +2 -2
- ccxt/bitget.py +16 -7
- ccxt/bitmart.py +2 -2
- ccxt/bitmex.py +2 -2
- ccxt/bitrue.py +2 -2
- ccxt/bitso.py +19 -3
- ccxt/bitstamp.py +25 -3
- ccxt/bitvavo.py +1 -1
- ccxt/bl3p.py +6 -0
- ccxt/blockchaincom.py +21 -0
- ccxt/blofin.py +2 -2
- ccxt/btcalpha.py +9 -0
- ccxt/btcbox.py +9 -0
- ccxt/btcmarkets.py +19 -0
- ccxt/bybit.py +9 -7
- ccxt/cex.py +1 -1
- ccxt/coinbase.py +20 -9
- ccxt/coinbasepro.py +1 -0
- ccxt/coinex.py +4 -4
- ccxt/coinlist.py +11 -9
- ccxt/coinmetro.py +2 -1
- ccxt/coinone.py +1 -1
- ccxt/delta.py +2 -2
- ccxt/deribit.py +3 -3
- ccxt/digifinex.py +3 -3
- ccxt/exmo.py +2 -2
- ccxt/gate.py +6 -6
- ccxt/hitbtc.py +2 -2
- ccxt/hollaex.py +1 -1
- ccxt/htx.py +3 -3
- ccxt/huobijp.py +1 -1
- ccxt/kraken.py +2 -2
- ccxt/krakenfutures.py +117 -16
- ccxt/kucoin.py +5 -5
- ccxt/kucoinfutures.py +2 -2
- ccxt/latoken.py +1 -1
- ccxt/lbank.py +2 -2
- ccxt/luno.py +2 -2
- ccxt/mexc.py +5 -5
- ccxt/ndax.py +1 -1
- ccxt/novadax.py +1 -1
- ccxt/okcoin.py +2 -2
- ccxt/okx.py +18 -21
- ccxt/paymium.py +2 -2
- ccxt/phemex.py +5 -4
- ccxt/poloniex.py +2 -2
- ccxt/poloniexfutures.py +10 -6
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/bitmart.py +129 -46
- ccxt/pro/bitvavo.py +1 -1
- ccxt/pro/bybit.py +6 -6
- ccxt/pro/cex.py +2 -2
- ccxt/pro/coinbase.py +2 -2
- ccxt/pro/coinex.py +1 -1
- ccxt/pro/lbank.py +1 -1
- ccxt/pro/mexc.py +1 -1
- ccxt/probit.py +1 -1
- ccxt/test/test_async.py +3 -1
- ccxt/test/test_sync.py +3 -1
- ccxt/timex.py +1 -1
- ccxt/upbit.py +1 -1
- ccxt/wavesexchange.py +1 -1
- ccxt/whitebit.py +2 -2
- ccxt/woo.py +4 -4
- ccxt/zonda.py +3 -3
- {ccxt-4.2.38.dist-info → ccxt-4.2.40.dist-info}/METADATA +4 -4
- {ccxt-4.2.38.dist-info → ccxt-4.2.40.dist-info}/RECORD +141 -141
- {ccxt-4.2.38.dist-info → ccxt-4.2.40.dist-info}/WHEEL +0 -0
- {ccxt-4.2.38.dist-info → ccxt-4.2.40.dist-info}/top_level.txt +0 -0
ccxt/__init__.py
CHANGED
ccxt/abstract/bingx.py
CHANGED
@@ -16,6 +16,7 @@ class ImplicitAPI:
|
|
16
16
|
spot_v1_private_post_trade_order = spotV1PrivatePostTradeOrder = Entry('trade/order', ['spot', 'v1', 'private'], 'POST', {'cost': 3})
|
17
17
|
spot_v1_private_post_trade_cancel = spotV1PrivatePostTradeCancel = Entry('trade/cancel', ['spot', 'v1', 'private'], 'POST', {'cost': 3})
|
18
18
|
spot_v1_private_post_trade_batchorders = spotV1PrivatePostTradeBatchOrders = Entry('trade/batchOrders', ['spot', 'v1', 'private'], 'POST', {'cost': 3})
|
19
|
+
spot_v1_private_post_trade_order_cancelreplace = spotV1PrivatePostTradeOrderCancelReplace = Entry('trade/order/cancelReplace', ['spot', 'v1', 'private'], 'POST', {'cost': 3})
|
19
20
|
spot_v1_private_post_trade_cancelorders = spotV1PrivatePostTradeCancelOrders = Entry('trade/cancelOrders', ['spot', 'v1', 'private'], 'POST', {'cost': 3})
|
20
21
|
spot_v1_private_post_trade_cancelopenorders = spotV1PrivatePostTradeCancelOpenOrders = Entry('trade/cancelOpenOrders', ['spot', 'v1', 'private'], 'POST', {'cost': 3})
|
21
22
|
spot_v3_private_get_get_asset_transfer = spotV3PrivateGetGetAssetTransfer = Entry('get/asset/transfer', ['spot', 'v3', 'private'], 'GET', {'cost': 3})
|
@@ -23,8 +24,11 @@ class ImplicitAPI:
|
|
23
24
|
spot_v3_private_get_capital_deposit_hisrec = spotV3PrivateGetCapitalDepositHisrec = Entry('capital/deposit/hisrec', ['spot', 'v3', 'private'], 'GET', {'cost': 3})
|
24
25
|
spot_v3_private_get_capital_withdraw_history = spotV3PrivateGetCapitalWithdrawHistory = Entry('capital/withdraw/history', ['spot', 'v3', 'private'], 'GET', {'cost': 3})
|
25
26
|
spot_v3_private_post_post_asset_transfer = spotV3PrivatePostPostAssetTransfer = Entry('post/asset/transfer', ['spot', 'v3', 'private'], 'POST', {'cost': 3})
|
27
|
+
swap_v1_public_get_ticker_price = swapV1PublicGetTickerPrice = Entry('ticker/price', ['swap', 'v1', 'public'], 'GET', {'cost': 1})
|
26
28
|
swap_v1_private_get_positionside_dual = swapV1PrivateGetPositionSideDual = Entry('positionSide/dual', ['swap', 'v1', 'private'], 'GET', {'cost': 1})
|
27
29
|
swap_v1_private_get_market_markpriceklines = swapV1PrivateGetMarketMarkPriceKlines = Entry('market/markPriceKlines', ['swap', 'v1', 'private'], 'GET', {'cost': 1})
|
30
|
+
swap_v1_private_get_trade_batchcancelreplace = swapV1PrivateGetTradeBatchCancelReplace = Entry('trade/batchCancelReplace', ['swap', 'v1', 'private'], 'GET', {'cost': 1})
|
31
|
+
swap_v1_private_post_trade_cancelreplace = swapV1PrivatePostTradeCancelReplace = Entry('trade/cancelReplace', ['swap', 'v1', 'private'], 'POST', {'cost': 1})
|
28
32
|
swap_v1_private_post_positionside_dual = swapV1PrivatePostPositionSideDual = Entry('positionSide/dual', ['swap', 'v1', 'private'], 'POST', {'cost': 1})
|
29
33
|
swap_v2_public_get_server_time = swapV2PublicGetServerTime = Entry('server/time', ['swap', 'v2', 'public'], 'GET', {'cost': 3})
|
30
34
|
swap_v2_public_get_quote_contracts = swapV2PublicGetQuoteContracts = Entry('quote/contracts', ['swap', 'v2', 'public'], 'GET', {'cost': 1})
|
ccxt/abstract/coinbase.py
CHANGED
@@ -73,6 +73,7 @@ class ImplicitAPI:
|
|
73
73
|
v3_private_post_brokerage_orders_batch_cancel = v3PrivatePostBrokerageOrdersBatchCancel = Entry('brokerage/orders/batch_cancel', ['v3', 'private'], 'POST', {})
|
74
74
|
v3_private_post_brokerage_orders_edit = v3PrivatePostBrokerageOrdersEdit = Entry('brokerage/orders/edit', ['v3', 'private'], 'POST', {})
|
75
75
|
v3_private_post_brokerage_orders_edit_preview = v3PrivatePostBrokerageOrdersEditPreview = Entry('brokerage/orders/edit_preview', ['v3', 'private'], 'POST', {})
|
76
|
+
v3_private_post_brokerage_orders_preview = v3PrivatePostBrokerageOrdersPreview = Entry('brokerage/orders/preview', ['v3', 'private'], 'POST', {})
|
76
77
|
v3_private_post_brokerage_portfolios = v3PrivatePostBrokeragePortfolios = Entry('brokerage/portfolios', ['v3', 'private'], 'POST', {})
|
77
78
|
v3_private_post_brokerage_portfolios_move_funds = v3PrivatePostBrokeragePortfoliosMoveFunds = Entry('brokerage/portfolios/move_funds', ['v3', 'private'], 'POST', {})
|
78
79
|
v3_private_post_brokerage_convert_quote = v3PrivatePostBrokerageConvertQuote = Entry('brokerage/convert/quote', ['v3', 'private'], 'POST', {})
|
ccxt/abstract/coinbasepro.py
CHANGED
@@ -47,6 +47,7 @@ class ImplicitAPI:
|
|
47
47
|
private_get_users_self_trailing_volume = privateGetUsersSelfTrailingVolume = Entry('users/self/trailing-volume', 'private', 'GET', {})
|
48
48
|
private_get_withdrawals_fee_estimate = privateGetWithdrawalsFeeEstimate = Entry('withdrawals/fee-estimate', 'private', 'GET', {})
|
49
49
|
private_get_conversions_conversion_id = privateGetConversionsConversionId = Entry('conversions/{conversion_id}', 'private', 'GET', {})
|
50
|
+
private_get_conversions_fees = privateGetConversionsFees = Entry('conversions/fees', 'private', 'GET', {})
|
50
51
|
private_post_conversions = privatePostConversions = Entry('conversions', 'private', 'POST', {})
|
51
52
|
private_post_deposits_coinbase_account = privatePostDepositsCoinbaseAccount = Entry('deposits/coinbase-account', 'private', 'POST', {})
|
52
53
|
private_post_deposits_payment_method = privatePostDepositsPaymentMethod = Entry('deposits/payment-method', 'private', 'POST', {})
|
ccxt/abstract/okx.py
CHANGED
@@ -99,6 +99,7 @@ class ImplicitAPI:
|
|
99
99
|
private_get_trade_easy_convert_history = privateGetTradeEasyConvertHistory = Entry('trade/easy-convert-history', 'private', 'GET', {'cost': 20})
|
100
100
|
private_get_trade_one_click_repay_currency_list = privateGetTradeOneClickRepayCurrencyList = Entry('trade/one-click-repay-currency-list', 'private', 'GET', {'cost': 20})
|
101
101
|
private_get_trade_one_click_repay_history = privateGetTradeOneClickRepayHistory = Entry('trade/one-click-repay-history', 'private', 'GET', {'cost': 20})
|
102
|
+
private_get_trade_account_rate_limit = privateGetTradeAccountRateLimit = Entry('trade/account-rate-limit', 'private', 'GET', {'cost': 1})
|
102
103
|
private_get_asset_currencies = privateGetAssetCurrencies = Entry('asset/currencies', 'private', 'GET', {'cost': 1.6666666666666667})
|
103
104
|
private_get_asset_balances = privateGetAssetBalances = Entry('asset/balances', 'private', 'GET', {'cost': 1.6666666666666667})
|
104
105
|
private_get_asset_non_tradable_assets = privateGetAssetNonTradableAssets = Entry('asset/non-tradable-assets', 'private', 'GET', {'cost': 1.6666666666666667})
|
ccxt/ascendex.py
CHANGED
@@ -165,7 +165,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
165
165
|
'get': {
|
166
166
|
'info': 1,
|
167
167
|
'wallet/transactions': 1,
|
168
|
-
'wallet/deposit/address': 1,
|
168
|
+
'wallet/deposit/address': 1,
|
169
169
|
'data/balance/snapshot': 1,
|
170
170
|
'data/balance/history': 1,
|
171
171
|
},
|
@@ -284,11 +284,14 @@ class ascendex(Exchange, ImplicitAPI):
|
|
284
284
|
'fillResponseFromRequest': True,
|
285
285
|
},
|
286
286
|
'networks': {
|
287
|
-
'BSC': 'BEP20(BSC)',
|
287
|
+
'BSC': 'BEP20 ' + '(BSC)',
|
288
288
|
'ARB': 'arbitrum',
|
289
289
|
'SOL': 'Solana',
|
290
290
|
'AVAX': 'avalanche C chain',
|
291
291
|
'OMNI': 'Omni',
|
292
|
+
'TRC': 'TRC20',
|
293
|
+
'TRX': 'TRC20',
|
294
|
+
'ERC': 'ERC20',
|
292
295
|
},
|
293
296
|
'networksById': {
|
294
297
|
'BEP20(BSC)': 'BSC',
|
@@ -296,6 +299,16 @@ class ascendex(Exchange, ImplicitAPI):
|
|
296
299
|
'Solana': 'SOL',
|
297
300
|
'avalanche C chain': 'AVAX',
|
298
301
|
'Omni': 'OMNI',
|
302
|
+
'TRC20': 'TRC20',
|
303
|
+
'ERC20': 'ERC20',
|
304
|
+
'GO20': 'GO20',
|
305
|
+
'BEP2': 'BEP2',
|
306
|
+
'Bitcoin': 'BTC',
|
307
|
+
'Bitcoin ABC': 'BCH',
|
308
|
+
'Litecoin': 'LTC',
|
309
|
+
'Matic Network': 'MATIC',
|
310
|
+
'xDai': 'STAKE',
|
311
|
+
'Akash': 'AKT',
|
299
312
|
},
|
300
313
|
},
|
301
314
|
'exceptions': {
|
@@ -2253,8 +2266,8 @@ class ascendex(Exchange, ImplicitAPI):
|
|
2253
2266
|
tag = self.safe_string(depositAddress, tagId)
|
2254
2267
|
self.check_address(address)
|
2255
2268
|
code = None if (currency is None) else currency['code']
|
2256
|
-
chainName = self.safe_string(depositAddress, '
|
2257
|
-
network = self.
|
2269
|
+
chainName = self.safe_string(depositAddress, 'blockchain')
|
2270
|
+
network = self.network_id_to_code(chainName, code)
|
2258
2271
|
return {
|
2259
2272
|
'currency': code,
|
2260
2273
|
'address': address,
|
@@ -2264,35 +2277,26 @@ class ascendex(Exchange, ImplicitAPI):
|
|
2264
2277
|
}
|
2265
2278
|
|
2266
2279
|
def safe_network(self, networkId):
|
2267
|
-
networksById =
|
2268
|
-
'TRC20': 'TRC20',
|
2269
|
-
'ERC20': 'ERC20',
|
2270
|
-
'GO20': 'GO20',
|
2271
|
-
'BEP2': 'BEP2',
|
2272
|
-
'BEP20(BSC)': 'BEP20',
|
2273
|
-
'Bitcoin': 'BTC',
|
2274
|
-
'Bitcoin ABC': 'BCH',
|
2275
|
-
'Litecoin': 'LTC',
|
2276
|
-
'Matic Network': 'MATIC',
|
2277
|
-
'Solana': 'SOL',
|
2278
|
-
'xDai': 'STAKE',
|
2279
|
-
'Akash': 'AKT',
|
2280
|
-
}
|
2280
|
+
networksById = self.safe_dict(self.options, 'networksById')
|
2281
2281
|
return self.safe_string(networksById, networkId, networkId)
|
2282
2282
|
|
2283
2283
|
def fetch_deposit_address(self, code: str, params={}):
|
2284
2284
|
"""
|
2285
2285
|
fetch the deposit address for a currency associated with self account
|
2286
|
+
:see: https://ascendex.github.io/ascendex-pro-api/#query-deposit-addresses
|
2286
2287
|
:param str code: unified currency code
|
2287
2288
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2289
|
+
:param str [params.network]: unified network code for deposit chain
|
2288
2290
|
:returns dict: an `address structure <https://docs.ccxt.com/#/?id=address-structure>`
|
2289
2291
|
"""
|
2290
2292
|
self.load_markets()
|
2291
2293
|
currency = self.currency(code)
|
2292
|
-
|
2293
|
-
|
2294
|
+
networkCode = self.safe_string_2(params, 'network', 'chainName')
|
2295
|
+
networkId = self.network_code_to_id(networkCode)
|
2296
|
+
params = self.omit(params, ['chainName'])
|
2294
2297
|
request = {
|
2295
2298
|
'asset': currency['id'],
|
2299
|
+
'blockchain': networkId,
|
2296
2300
|
}
|
2297
2301
|
response = self.v1PrivateGetWalletDepositAddress(self.extend(request, params))
|
2298
2302
|
#
|
@@ -2328,20 +2332,20 @@ class ascendex(Exchange, ImplicitAPI):
|
|
2328
2332
|
# }
|
2329
2333
|
# }
|
2330
2334
|
#
|
2331
|
-
data = self.
|
2332
|
-
addresses = self.
|
2335
|
+
data = self.safe_dict(response, 'data', {})
|
2336
|
+
addresses = self.safe_list(data, 'address', [])
|
2333
2337
|
numAddresses = len(addresses)
|
2334
2338
|
address = None
|
2335
2339
|
if numAddresses > 1:
|
2336
2340
|
addressesByChainName = self.index_by(addresses, 'chainName')
|
2337
|
-
if
|
2341
|
+
if networkId is None:
|
2338
2342
|
chainNames = list(addressesByChainName.keys())
|
2339
2343
|
chains = ', '.join(chainNames)
|
2340
2344
|
raise ArgumentsRequired(self.id + ' fetchDepositAddress() returned more than one address, a chainName parameter is required, one of ' + chains)
|
2341
|
-
address = self.
|
2345
|
+
address = self.safe_dict(addressesByChainName, networkId, {})
|
2342
2346
|
else:
|
2343
2347
|
# first address
|
2344
|
-
address = self.
|
2348
|
+
address = self.safe_dict(addresses, 0, {})
|
2345
2349
|
result = self.parse_deposit_address(address, currency)
|
2346
2350
|
return self.extend(result, {
|
2347
2351
|
'info': response,
|
@@ -2781,7 +2785,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
2781
2785
|
}
|
2782
2786
|
return self.v2PrivateAccountGroupPostFuturesLeverage(self.extend(request, params))
|
2783
2787
|
|
2784
|
-
def set_margin_mode(self, marginMode, symbol: Str = None, params={}):
|
2788
|
+
def set_margin_mode(self, marginMode: str, symbol: Str = None, params={}):
|
2785
2789
|
"""
|
2786
2790
|
set margin mode to 'cross' or 'isolated'
|
2787
2791
|
:see: https://ascendex.github.io/ascendex-futures-pro-api-v2/#change-margin-type
|
@@ -2959,7 +2963,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
2959
2963
|
data = self.safe_value(response, 'data')
|
2960
2964
|
return self.parse_deposit_withdraw_fees(data, codes, 'assetCode')
|
2961
2965
|
|
2962
|
-
def transfer(self, code: str, amount: float, fromAccount, toAccount, params={}) -> TransferEntry:
|
2966
|
+
def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
|
2963
2967
|
"""
|
2964
2968
|
transfer currency internally between wallets on the same account
|
2965
2969
|
:param str code: unified currency codeåå
|
ccxt/async_support/__init__.py
CHANGED
ccxt/async_support/ascendex.py
CHANGED
@@ -165,7 +165,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
165
165
|
'get': {
|
166
166
|
'info': 1,
|
167
167
|
'wallet/transactions': 1,
|
168
|
-
'wallet/deposit/address': 1,
|
168
|
+
'wallet/deposit/address': 1,
|
169
169
|
'data/balance/snapshot': 1,
|
170
170
|
'data/balance/history': 1,
|
171
171
|
},
|
@@ -284,11 +284,14 @@ class ascendex(Exchange, ImplicitAPI):
|
|
284
284
|
'fillResponseFromRequest': True,
|
285
285
|
},
|
286
286
|
'networks': {
|
287
|
-
'BSC': 'BEP20(BSC)',
|
287
|
+
'BSC': 'BEP20 ' + '(BSC)',
|
288
288
|
'ARB': 'arbitrum',
|
289
289
|
'SOL': 'Solana',
|
290
290
|
'AVAX': 'avalanche C chain',
|
291
291
|
'OMNI': 'Omni',
|
292
|
+
'TRC': 'TRC20',
|
293
|
+
'TRX': 'TRC20',
|
294
|
+
'ERC': 'ERC20',
|
292
295
|
},
|
293
296
|
'networksById': {
|
294
297
|
'BEP20(BSC)': 'BSC',
|
@@ -296,6 +299,16 @@ class ascendex(Exchange, ImplicitAPI):
|
|
296
299
|
'Solana': 'SOL',
|
297
300
|
'avalanche C chain': 'AVAX',
|
298
301
|
'Omni': 'OMNI',
|
302
|
+
'TRC20': 'TRC20',
|
303
|
+
'ERC20': 'ERC20',
|
304
|
+
'GO20': 'GO20',
|
305
|
+
'BEP2': 'BEP2',
|
306
|
+
'Bitcoin': 'BTC',
|
307
|
+
'Bitcoin ABC': 'BCH',
|
308
|
+
'Litecoin': 'LTC',
|
309
|
+
'Matic Network': 'MATIC',
|
310
|
+
'xDai': 'STAKE',
|
311
|
+
'Akash': 'AKT',
|
299
312
|
},
|
300
313
|
},
|
301
314
|
'exceptions': {
|
@@ -2253,8 +2266,8 @@ class ascendex(Exchange, ImplicitAPI):
|
|
2253
2266
|
tag = self.safe_string(depositAddress, tagId)
|
2254
2267
|
self.check_address(address)
|
2255
2268
|
code = None if (currency is None) else currency['code']
|
2256
|
-
chainName = self.safe_string(depositAddress, '
|
2257
|
-
network = self.
|
2269
|
+
chainName = self.safe_string(depositAddress, 'blockchain')
|
2270
|
+
network = self.network_id_to_code(chainName, code)
|
2258
2271
|
return {
|
2259
2272
|
'currency': code,
|
2260
2273
|
'address': address,
|
@@ -2264,35 +2277,26 @@ class ascendex(Exchange, ImplicitAPI):
|
|
2264
2277
|
}
|
2265
2278
|
|
2266
2279
|
def safe_network(self, networkId):
|
2267
|
-
networksById =
|
2268
|
-
'TRC20': 'TRC20',
|
2269
|
-
'ERC20': 'ERC20',
|
2270
|
-
'GO20': 'GO20',
|
2271
|
-
'BEP2': 'BEP2',
|
2272
|
-
'BEP20(BSC)': 'BEP20',
|
2273
|
-
'Bitcoin': 'BTC',
|
2274
|
-
'Bitcoin ABC': 'BCH',
|
2275
|
-
'Litecoin': 'LTC',
|
2276
|
-
'Matic Network': 'MATIC',
|
2277
|
-
'Solana': 'SOL',
|
2278
|
-
'xDai': 'STAKE',
|
2279
|
-
'Akash': 'AKT',
|
2280
|
-
}
|
2280
|
+
networksById = self.safe_dict(self.options, 'networksById')
|
2281
2281
|
return self.safe_string(networksById, networkId, networkId)
|
2282
2282
|
|
2283
2283
|
async def fetch_deposit_address(self, code: str, params={}):
|
2284
2284
|
"""
|
2285
2285
|
fetch the deposit address for a currency associated with self account
|
2286
|
+
:see: https://ascendex.github.io/ascendex-pro-api/#query-deposit-addresses
|
2286
2287
|
:param str code: unified currency code
|
2287
2288
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2289
|
+
:param str [params.network]: unified network code for deposit chain
|
2288
2290
|
:returns dict: an `address structure <https://docs.ccxt.com/#/?id=address-structure>`
|
2289
2291
|
"""
|
2290
2292
|
await self.load_markets()
|
2291
2293
|
currency = self.currency(code)
|
2292
|
-
|
2293
|
-
|
2294
|
+
networkCode = self.safe_string_2(params, 'network', 'chainName')
|
2295
|
+
networkId = self.network_code_to_id(networkCode)
|
2296
|
+
params = self.omit(params, ['chainName'])
|
2294
2297
|
request = {
|
2295
2298
|
'asset': currency['id'],
|
2299
|
+
'blockchain': networkId,
|
2296
2300
|
}
|
2297
2301
|
response = await self.v1PrivateGetWalletDepositAddress(self.extend(request, params))
|
2298
2302
|
#
|
@@ -2328,20 +2332,20 @@ class ascendex(Exchange, ImplicitAPI):
|
|
2328
2332
|
# }
|
2329
2333
|
# }
|
2330
2334
|
#
|
2331
|
-
data = self.
|
2332
|
-
addresses = self.
|
2335
|
+
data = self.safe_dict(response, 'data', {})
|
2336
|
+
addresses = self.safe_list(data, 'address', [])
|
2333
2337
|
numAddresses = len(addresses)
|
2334
2338
|
address = None
|
2335
2339
|
if numAddresses > 1:
|
2336
2340
|
addressesByChainName = self.index_by(addresses, 'chainName')
|
2337
|
-
if
|
2341
|
+
if networkId is None:
|
2338
2342
|
chainNames = list(addressesByChainName.keys())
|
2339
2343
|
chains = ', '.join(chainNames)
|
2340
2344
|
raise ArgumentsRequired(self.id + ' fetchDepositAddress() returned more than one address, a chainName parameter is required, one of ' + chains)
|
2341
|
-
address = self.
|
2345
|
+
address = self.safe_dict(addressesByChainName, networkId, {})
|
2342
2346
|
else:
|
2343
2347
|
# first address
|
2344
|
-
address = self.
|
2348
|
+
address = self.safe_dict(addresses, 0, {})
|
2345
2349
|
result = self.parse_deposit_address(address, currency)
|
2346
2350
|
return self.extend(result, {
|
2347
2351
|
'info': response,
|
@@ -2781,7 +2785,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
2781
2785
|
}
|
2782
2786
|
return await self.v2PrivateAccountGroupPostFuturesLeverage(self.extend(request, params))
|
2783
2787
|
|
2784
|
-
async def set_margin_mode(self, marginMode, symbol: Str = None, params={}):
|
2788
|
+
async def set_margin_mode(self, marginMode: str, symbol: Str = None, params={}):
|
2785
2789
|
"""
|
2786
2790
|
set margin mode to 'cross' or 'isolated'
|
2787
2791
|
:see: https://ascendex.github.io/ascendex-futures-pro-api-v2/#change-margin-type
|
@@ -2959,7 +2963,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
2959
2963
|
data = self.safe_value(response, 'data')
|
2960
2964
|
return self.parse_deposit_withdraw_fees(data, codes, 'assetCode')
|
2961
2965
|
|
2962
|
-
async def transfer(self, code: str, amount: float, fromAccount, toAccount, params={}) -> TransferEntry:
|
2966
|
+
async def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
|
2963
2967
|
"""
|
2964
2968
|
transfer currency internally between wallets on the same account
|
2965
2969
|
:param str code: unified currency codeåå
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# -----------------------------------------------------------------------------
|
4
4
|
|
5
|
-
__version__ = '4.2.
|
5
|
+
__version__ = '4.2.40'
|
6
6
|
|
7
7
|
# -----------------------------------------------------------------------------
|
8
8
|
|
@@ -651,6 +651,18 @@ class Exchange(BaseExchange):
|
|
651
651
|
async def set_leverage(self, leverage: Int, symbol: str = None, params={}):
|
652
652
|
raise NotSupported(self.id + ' setLeverage() is not supported yet')
|
653
653
|
|
654
|
+
async def fetch_leverage(self, symbol: str, params={}):
|
655
|
+
raise NotSupported(self.id + ' fetchLeverage() is not supported yet')
|
656
|
+
|
657
|
+
async def set_position_mode(self, hedged: bool, symbol: Str = None, params={}):
|
658
|
+
raise NotSupported(self.id + ' setPositionMode() is not supported yet')
|
659
|
+
|
660
|
+
async def set_margin_mode(self, marginMode: str, symbol: Str = None, params={}):
|
661
|
+
raise NotSupported(self.id + ' setMarginMode() is not supported yet')
|
662
|
+
|
663
|
+
async def fetch_deposit_addresses_by_network(self, code: str, params={}):
|
664
|
+
raise NotSupported(self.id + ' fetchDepositAddressesByNetwork() is not supported yet')
|
665
|
+
|
654
666
|
async def fetch_open_interest_history(self, symbol: str, timeframe='1h', since: Int = None, limit: Int = None, params={}):
|
655
667
|
raise NotSupported(self.id + ' fetchOpenInterestHistory() is not supported yet')
|
656
668
|
|
@@ -867,13 +879,13 @@ class Exchange(BaseExchange):
|
|
867
879
|
raise NotSupported(self.id + ' fetchStatus() is not supported yet')
|
868
880
|
|
869
881
|
async def fetch_funding_fee(self, code: str, params={}):
|
870
|
-
warnOnFetchFundingFee = self.
|
882
|
+
warnOnFetchFundingFee = self.safe_bool(self.options, 'warnOnFetchFundingFee', True)
|
871
883
|
if warnOnFetchFundingFee:
|
872
884
|
raise NotSupported(self.id + ' fetchFundingFee() method is deprecated, it will be removed in July 2022, please, use fetchTransactionFee() or set exchange.options["warnOnFetchFundingFee"] = False to suppress self warning')
|
873
885
|
return await self.fetch_transaction_fee(code, params)
|
874
886
|
|
875
887
|
async def fetch_funding_fees(self, codes: List[str] = None, params={}):
|
876
|
-
warnOnFetchFundingFees = self.
|
888
|
+
warnOnFetchFundingFees = self.safe_bool(self.options, 'warnOnFetchFundingFees', True)
|
877
889
|
if warnOnFetchFundingFees:
|
878
890
|
raise NotSupported(self.id + ' fetchFundingFees() method is deprecated, it will be removed in July 2022. Please, use fetchTransactionFees() or set exchange.options["warnOnFetchFundingFees"] = False to suppress self warning')
|
879
891
|
return await self.fetch_transaction_fees(codes, params)
|
@@ -910,7 +922,7 @@ class Exchange(BaseExchange):
|
|
910
922
|
if not self.has['fetchBorrowRates']:
|
911
923
|
raise NotSupported(self.id + ' fetchIsolatedBorrowRate() is not supported yet')
|
912
924
|
borrowRates = await self.fetchIsolatedBorrowRates(params)
|
913
|
-
rate = self.
|
925
|
+
rate = self.safe_dict(borrowRates, symbol)
|
914
926
|
if rate is None:
|
915
927
|
raise ExchangeError(self.id + ' fetchIsolatedBorrowRate() could not find the borrow rate for market symbol ' + symbol)
|
916
928
|
return rate
|
@@ -921,7 +933,7 @@ class Exchange(BaseExchange):
|
|
921
933
|
market = self.market(symbol)
|
922
934
|
symbol = market['symbol']
|
923
935
|
tickers = await self.fetch_tickers([symbol], params)
|
924
|
-
ticker = self.
|
936
|
+
ticker = self.safe_dict(tickers, symbol)
|
925
937
|
if ticker is None:
|
926
938
|
raise NullResponse(self.id + ' fetchTickers() could not find a ticker for ' + symbol)
|
927
939
|
else:
|
@@ -954,7 +966,7 @@ class Exchange(BaseExchange):
|
|
954
966
|
return order['status']
|
955
967
|
|
956
968
|
async def fetch_unified_order(self, order, params={}):
|
957
|
-
return await self.fetch_order(self.
|
969
|
+
return await self.fetch_order(self.safe_string(order, 'id'), self.safe_string(order, 'symbol'), params)
|
958
970
|
|
959
971
|
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
960
972
|
raise NotSupported(self.id + ' createOrder() is not supported yet')
|
@@ -1179,7 +1191,7 @@ class Exchange(BaseExchange):
|
|
1179
1191
|
raise NotSupported(self.id + ' cancelAllOrdersWs() is not supported yet')
|
1180
1192
|
|
1181
1193
|
async def cancel_unified_order(self, order, params={}):
|
1182
|
-
return self.cancelOrder(self.
|
1194
|
+
return self.cancelOrder(self.safe_string(order, 'id'), self.safe_string(order, 'symbol'), params)
|
1183
1195
|
|
1184
1196
|
async def fetch_orders(self, symbol: str = None, since: Int = None, limit: Int = None, params={}):
|
1185
1197
|
if self.has['fetchOpenOrders'] and self.has['fetchClosedOrders']:
|
ccxt/async_support/bigone.py
CHANGED
@@ -1374,7 +1374,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
1374
1374
|
'trades': None,
|
1375
1375
|
}, market)
|
1376
1376
|
|
1377
|
-
async def create_market_buy_order_with_cost(self, symbol: str, cost, params={}):
|
1377
|
+
async def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}):
|
1378
1378
|
"""
|
1379
1379
|
create a market buy order by providing the symbol and cost
|
1380
1380
|
:see: https://open.big.one/docs/spot_orders.html#create-order
|
@@ -1972,7 +1972,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
1972
1972
|
withdrawals = self.safe_value(response, 'data', [])
|
1973
1973
|
return self.parse_transactions(withdrawals, currency, since, limit)
|
1974
1974
|
|
1975
|
-
async def transfer(self, code: str, amount: float, fromAccount, toAccount, params={}) -> TransferEntry:
|
1975
|
+
async def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
|
1976
1976
|
"""
|
1977
1977
|
transfer currency internally between wallets on the same account
|
1978
1978
|
:see: https://open.big.one/docs/spot_transfer.html#transfer-of-user
|