ccxt 4.3.42__py2.py3-none-any.whl → 4.3.43__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/coinex.py +2 -1
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/binance.py +163 -42
- ccxt/async_support/btcmarkets.py +31 -2
- ccxt/async_support/coinex.py +103 -103
- ccxt/async_support/phemex.py +4 -4
- ccxt/async_support/tradeogre.py +10 -4
- ccxt/async_support/wavesexchange.py +2 -2
- ccxt/async_support/wazirx.py +38 -15
- ccxt/async_support/zonda.py +9 -1
- ccxt/base/exchange.py +1 -1
- ccxt/binance.py +163 -42
- ccxt/btcmarkets.py +31 -2
- ccxt/coinex.py +103 -103
- ccxt/phemex.py +4 -4
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/bitget.py +27 -20
- ccxt/pro/bybit.py +1 -1
- ccxt/pro/mexc.py +1 -1
- ccxt/tradeogre.py +10 -4
- ccxt/wavesexchange.py +2 -2
- ccxt/wazirx.py +38 -15
- ccxt/zonda.py +9 -1
- {ccxt-4.3.42.dist-info → ccxt-4.3.43.dist-info}/METADATA +6 -6
- {ccxt-4.3.42.dist-info → ccxt-4.3.43.dist-info}/RECORD +29 -29
- {ccxt-4.3.42.dist-info → ccxt-4.3.43.dist-info}/WHEEL +0 -0
- {ccxt-4.3.42.dist-info → ccxt-4.3.43.dist-info}/top_level.txt +0 -0
ccxt/__init__.py
CHANGED
ccxt/abstract/coinex.py
CHANGED
@@ -145,6 +145,8 @@ class ImplicitAPI:
|
|
145
145
|
v2_public_get_futures_position_level = v2PublicGetFuturesPositionLevel = Entry('futures/position-level', ['v2', 'public'], 'GET', {'cost': 1})
|
146
146
|
v2_public_get_futures_liquidation_history = v2PublicGetFuturesLiquidationHistory = Entry('futures/liquidation-history', ['v2', 'public'], 'GET', {'cost': 1})
|
147
147
|
v2_public_get_futures_basis_history = v2PublicGetFuturesBasisHistory = Entry('futures/basis-history', ['v2', 'public'], 'GET', {'cost': 1})
|
148
|
+
v2_public_get_assets_deposit_withdraw_config = v2PublicGetAssetsDepositWithdrawConfig = Entry('assets/deposit-withdraw-config', ['v2', 'public'], 'GET', {'cost': 1})
|
149
|
+
v2_public_get_assets_all_deposit_withdraw_config = v2PublicGetAssetsAllDepositWithdrawConfig = Entry('assets/all-deposit-withdraw-config', ['v2', 'public'], 'GET', {'cost': 1})
|
148
150
|
v2_private_get_account_subs = v2PrivateGetAccountSubs = Entry('account/subs', ['v2', 'private'], 'GET', {'cost': 1})
|
149
151
|
v2_private_get_account_subs_api_detail = v2PrivateGetAccountSubsApiDetail = Entry('account/subs/api-detail', ['v2', 'private'], 'GET', {'cost': 40})
|
150
152
|
v2_private_get_account_subs_info = v2PrivateGetAccountSubsInfo = Entry('account/subs/info', ['v2', 'private'], 'GET', {'cost': 1})
|
@@ -163,7 +165,6 @@ class ImplicitAPI:
|
|
163
165
|
v2_private_get_assets_deposit_address = v2PrivateGetAssetsDepositAddress = Entry('assets/deposit-address', ['v2', 'private'], 'GET', {'cost': 40})
|
164
166
|
v2_private_get_assets_deposit_history = v2PrivateGetAssetsDepositHistory = Entry('assets/deposit-history', ['v2', 'private'], 'GET', {'cost': 40})
|
165
167
|
v2_private_get_assets_withdraw = v2PrivateGetAssetsWithdraw = Entry('assets/withdraw', ['v2', 'private'], 'GET', {'cost': 40})
|
166
|
-
v2_private_get_assets_deposit_withdraw_config = v2PrivateGetAssetsDepositWithdrawConfig = Entry('assets/deposit-withdraw-config', ['v2', 'private'], 'GET', {'cost': 1})
|
167
168
|
v2_private_get_assets_transfer_history = v2PrivateGetAssetsTransferHistory = Entry('assets/transfer-history', ['v2', 'private'], 'GET', {'cost': 40})
|
168
169
|
v2_private_get_spot_order_status = v2PrivateGetSpotOrderStatus = Entry('spot/order-status', ['v2', 'private'], 'GET', {'cost': 8})
|
169
170
|
v2_private_get_spot_batch_order_status = v2PrivateGetSpotBatchOrderStatus = Entry('spot/batch-order-status', ['v2', 'private'], 'GET', {'cost': 8})
|
ccxt/async_support/__init__.py
CHANGED
ccxt/async_support/binance.py
CHANGED
@@ -7557,8 +7557,56 @@ class binance(Exchange, ImplicitAPI):
|
|
7557
7557
|
# "tranId": 43000126248
|
7558
7558
|
# }
|
7559
7559
|
#
|
7560
|
-
|
7561
|
-
|
7560
|
+
# {
|
7561
|
+
# "orderType": "C2C", # Enum:PAY(C2B Merchant Acquiring Payment), PAY_REFUND(C2B Merchant Acquiring Payment,refund), C2C(C2C Transfer Payment),CRYPTO_BOX(Crypto box), CRYPTO_BOX_RF(Crypto Box, refund), C2C_HOLDING(Transfer to new Binance user), C2C_HOLDING_RF(Transfer to new Binance user,refund), PAYOUT(B2C Disbursement Payment), REMITTANCE(Send cash)
|
7562
|
+
# "transactionId": "M_P_71505104267788288",
|
7563
|
+
# "transactionTime": 1610090460133, #trade timestamp
|
7564
|
+
# "amount": "23.72469206", #order amount(up to 8 decimal places), positive is income, negative is expenditure
|
7565
|
+
# "currency": "BNB",
|
7566
|
+
# "walletType": 1, #main wallet type, 1 for funding wallet, 2 for spot wallet, 3 for fiat wallet, 4 or 6 for card payment, 5 for earn wallet
|
7567
|
+
# "walletTypes": [1,2], #array format,there are multiple values when using combination payment
|
7568
|
+
# "fundsDetail": [ # details
|
7569
|
+
# {
|
7570
|
+
# "currency": "USDT", #asset
|
7571
|
+
# "amount": "1.2",
|
7572
|
+
# "walletAssetCost":[ #details of asset cost per wallet
|
7573
|
+
# {"1":"0.6"},
|
7574
|
+
# {"2":"0.6"}
|
7575
|
+
# ]
|
7576
|
+
# },
|
7577
|
+
# {
|
7578
|
+
# "currency": "ETH",
|
7579
|
+
# "amount": "0.0001",
|
7580
|
+
# "walletAssetCost":[
|
7581
|
+
# {"1":"0.00005"},
|
7582
|
+
# {"2":"0.00005"}
|
7583
|
+
# ]
|
7584
|
+
# }
|
7585
|
+
# ],
|
7586
|
+
# "payerInfo":{
|
7587
|
+
# "name":"Jack", #nickname or merchant name
|
7588
|
+
# "type":"USER", #account type,USER for personal,MERCHANT for merchant
|
7589
|
+
# "binanceId":"12345678", #binance uid
|
7590
|
+
# "accountId":"67736251" #binance pay id
|
7591
|
+
# },
|
7592
|
+
# "receiverInfo":{
|
7593
|
+
# "name":"Alan", #nickname or merchant name
|
7594
|
+
# "type":"MERCHANT", #account type,USER for personal,MERCHANT for merchant
|
7595
|
+
# "email":"alan@binance.com", #email
|
7596
|
+
# "binanceId":"34355667", #binance uid
|
7597
|
+
# "accountId":"21326891", #binance pay id
|
7598
|
+
# "countryCode":"1", #International area code
|
7599
|
+
# "phoneNumber":"8057651210",
|
7600
|
+
# "mobileCode":"US", #country code
|
7601
|
+
# "extend":[ #extension field
|
7602
|
+
# "institutionName": "",
|
7603
|
+
# "cardNumber": "",
|
7604
|
+
# "digitalWalletId": ""
|
7605
|
+
# ]
|
7606
|
+
# }
|
7607
|
+
# }
|
7608
|
+
id = self.safe_string_2(transfer, 'tranId', 'transactionId')
|
7609
|
+
currencyId = self.safe_string_2(transfer, 'asset', 'currency')
|
7562
7610
|
code = self.safe_currency_code(currencyId, currency)
|
7563
7611
|
amount = self.safe_number(transfer, 'amount')
|
7564
7612
|
type = self.safe_string(transfer, 'type')
|
@@ -7571,7 +7619,13 @@ class binance(Exchange, ImplicitAPI):
|
|
7571
7619
|
toAccount = self.safe_value(parts, 1)
|
7572
7620
|
fromAccount = self.safe_string(accountsById, fromAccount, fromAccount)
|
7573
7621
|
toAccount = self.safe_string(accountsById, toAccount, toAccount)
|
7574
|
-
|
7622
|
+
walletType = self.safe_integer(transfer, 'walletType')
|
7623
|
+
if walletType is not None:
|
7624
|
+
payer = self.safe_dict(transfer, 'payerInfo', {})
|
7625
|
+
receiver = self.safe_dict(transfer, 'receiverInfo', {})
|
7626
|
+
fromAccount = self.safe_string(payer, 'accountId')
|
7627
|
+
toAccount = self.safe_string(receiver, 'accountId')
|
7628
|
+
timestamp = self.safe_integer_2(transfer, 'timestamp', 'transactionTime')
|
7575
7629
|
status = self.parse_transfer_status(self.safe_string(transfer, 'status'))
|
7576
7630
|
return {
|
7577
7631
|
'info': transfer,
|
@@ -7700,66 +7754,133 @@ class binance(Exchange, ImplicitAPI):
|
|
7700
7754
|
"""
|
7701
7755
|
fetch a history of internal transfers made on an account
|
7702
7756
|
:see: https://binance-docs.github.io/apidocs/spot/en/#query-user-universal-transfer-history-user_data
|
7757
|
+
:see: https://binance-docs.github.io/apidocs/spot/en/#pay-endpoints
|
7703
7758
|
:param str code: unified currency code of the currency transferred
|
7704
7759
|
:param int [since]: the earliest time in ms to fetch transfers for
|
7705
7760
|
:param int [limit]: the maximum number of transfers structures to retrieve
|
7706
7761
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
7707
7762
|
:param int [params.until]: the latest time in ms to fetch transfers for
|
7708
7763
|
:param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
7764
|
+
:param boolean [params.internal]: default False, when True will fetch pay trade history
|
7709
7765
|
:returns dict[]: a list of `transfer structures <https://docs.ccxt.com/#/?id=transfer-structure>`
|
7710
7766
|
"""
|
7711
7767
|
await self.load_markets()
|
7768
|
+
internal = self.safe_bool(params, 'internal')
|
7769
|
+
params = self.omit(params, 'internal')
|
7712
7770
|
paginate = False
|
7713
7771
|
paginate, params = self.handle_option_and_params(params, 'fetchTransfers', 'paginate')
|
7714
|
-
if paginate:
|
7772
|
+
if paginate and not internal:
|
7715
7773
|
return await self.fetch_paginated_call_dynamic('fetchTransfers', code, since, limit, params)
|
7716
7774
|
currency = None
|
7717
7775
|
if code is not None:
|
7718
7776
|
currency = self.currency(code)
|
7719
|
-
|
7720
|
-
|
7721
|
-
|
7722
|
-
|
7723
|
-
|
7724
|
-
|
7725
|
-
|
7726
|
-
|
7727
|
-
|
7728
|
-
|
7729
|
-
|
7730
|
-
|
7731
|
-
|
7732
|
-
|
7733
|
-
|
7734
|
-
|
7735
|
-
|
7736
|
-
|
7737
|
-
|
7777
|
+
request: dict = {}
|
7778
|
+
limitKey = 'limit'
|
7779
|
+
if not internal:
|
7780
|
+
defaultType = self.safe_string_2(self.options, 'fetchTransfers', 'defaultType', 'spot')
|
7781
|
+
fromAccount = self.safe_string(params, 'fromAccount', defaultType)
|
7782
|
+
defaultTo = 'spot' if (fromAccount == 'future') else 'future'
|
7783
|
+
toAccount = self.safe_string(params, 'toAccount', defaultTo)
|
7784
|
+
type = self.safe_string(params, 'type')
|
7785
|
+
accountsByType = self.safe_dict(self.options, 'accountsByType', {})
|
7786
|
+
fromId = self.safe_string(accountsByType, fromAccount)
|
7787
|
+
toId = self.safe_string(accountsByType, toAccount)
|
7788
|
+
if type is None:
|
7789
|
+
if fromId is None:
|
7790
|
+
keys = list(accountsByType.keys())
|
7791
|
+
raise ExchangeError(self.id + ' fromAccount parameter must be one of ' + ', '.join(keys))
|
7792
|
+
if toId is None:
|
7793
|
+
keys = list(accountsByType.keys())
|
7794
|
+
raise ExchangeError(self.id + ' toAccount parameter must be one of ' + ', '.join(keys))
|
7795
|
+
type = fromId + '_' + toId
|
7796
|
+
request['type'] = type
|
7797
|
+
limitKey = 'size'
|
7798
|
+
if limit is not None:
|
7799
|
+
request[limitKey] = limit
|
7738
7800
|
if since is not None:
|
7739
7801
|
request['startTime'] = since
|
7740
|
-
if limit is not None:
|
7741
|
-
request['size'] = limit
|
7742
7802
|
until = self.safe_integer(params, 'until')
|
7743
7803
|
if until is not None:
|
7744
7804
|
params = self.omit(params, 'until')
|
7745
7805
|
request['endTime'] = until
|
7746
|
-
response =
|
7747
|
-
|
7748
|
-
|
7749
|
-
|
7750
|
-
|
7751
|
-
|
7752
|
-
|
7753
|
-
|
7754
|
-
|
7755
|
-
|
7756
|
-
|
7757
|
-
|
7758
|
-
|
7759
|
-
|
7760
|
-
|
7761
|
-
|
7762
|
-
|
7806
|
+
response = None
|
7807
|
+
if internal:
|
7808
|
+
response = await self.sapiGetPayTransactions(self.extend(request, params))
|
7809
|
+
#
|
7810
|
+
# {
|
7811
|
+
# "code": "000000",
|
7812
|
+
# "message": "success",
|
7813
|
+
# "data": [
|
7814
|
+
# {
|
7815
|
+
# "orderType": "C2C", # Enum:PAY(C2B Merchant Acquiring Payment), PAY_REFUND(C2B Merchant Acquiring Payment,refund), C2C(C2C Transfer Payment),CRYPTO_BOX(Crypto box), CRYPTO_BOX_RF(Crypto Box, refund), C2C_HOLDING(Transfer to new Binance user), C2C_HOLDING_RF(Transfer to new Binance user,refund), PAYOUT(B2C Disbursement Payment), REMITTANCE(Send cash)
|
7816
|
+
# "transactionId": "M_P_71505104267788288",
|
7817
|
+
# "transactionTime": 1610090460133, #trade timestamp
|
7818
|
+
# "amount": "23.72469206", #order amount(up to 8 decimal places), positive is income, negative is expenditure
|
7819
|
+
# "currency": "BNB",
|
7820
|
+
# "walletType": 1, #main wallet type, 1 for funding wallet, 2 for spot wallet, 3 for fiat wallet, 4 or 6 for card payment, 5 for earn wallet
|
7821
|
+
# "walletTypes": [1,2], #array format,there are multiple values when using combination payment
|
7822
|
+
# "fundsDetail": [ # details
|
7823
|
+
# {
|
7824
|
+
# "currency": "USDT", #asset
|
7825
|
+
# "amount": "1.2",
|
7826
|
+
# "walletAssetCost":[ #details of asset cost per wallet
|
7827
|
+
# {"1":"0.6"},
|
7828
|
+
# {"2":"0.6"}
|
7829
|
+
# ]
|
7830
|
+
# },
|
7831
|
+
# {
|
7832
|
+
# "currency": "ETH",
|
7833
|
+
# "amount": "0.0001",
|
7834
|
+
# "walletAssetCost":[
|
7835
|
+
# {"1":"0.00005"},
|
7836
|
+
# {"2":"0.00005"}
|
7837
|
+
# ]
|
7838
|
+
# }
|
7839
|
+
# ],
|
7840
|
+
# "payerInfo":{
|
7841
|
+
# "name":"Jack", #nickname or merchant name
|
7842
|
+
# "type":"USER", #account type,USER for personal,MERCHANT for merchant
|
7843
|
+
# "binanceId":"12345678", #binance uid
|
7844
|
+
# "accountId":"67736251" #binance pay id
|
7845
|
+
# },
|
7846
|
+
# "receiverInfo":{
|
7847
|
+
# "name":"Alan", #nickname or merchant name
|
7848
|
+
# "type":"MERCHANT", #account type,USER for personal,MERCHANT for merchant
|
7849
|
+
# "email":"alan@binance.com", #email
|
7850
|
+
# "binanceId":"34355667", #binance uid
|
7851
|
+
# "accountId":"21326891", #binance pay id
|
7852
|
+
# "countryCode":"1", #International area code
|
7853
|
+
# "phoneNumber":"8057651210",
|
7854
|
+
# "mobileCode":"US", #country code
|
7855
|
+
# "extend":[ #extension field
|
7856
|
+
# "institutionName": "",
|
7857
|
+
# "cardNumber": "",
|
7858
|
+
# "digitalWalletId": ""
|
7859
|
+
# ]
|
7860
|
+
# }
|
7861
|
+
# }
|
7862
|
+
# ],
|
7863
|
+
# "success": True
|
7864
|
+
# }
|
7865
|
+
#
|
7866
|
+
else:
|
7867
|
+
response = await self.sapiGetAssetTransfer(self.extend(request, params))
|
7868
|
+
#
|
7869
|
+
# {
|
7870
|
+
# "total": 3,
|
7871
|
+
# "rows": [
|
7872
|
+
# {
|
7873
|
+
# "timestamp": 1614640878000,
|
7874
|
+
# "asset": "USDT",
|
7875
|
+
# "amount": "25",
|
7876
|
+
# "type": "MAIN_UMFUTURE",
|
7877
|
+
# "status": "CONFIRMED",
|
7878
|
+
# "tranId": 43000126248
|
7879
|
+
# },
|
7880
|
+
# ]
|
7881
|
+
# }
|
7882
|
+
#
|
7883
|
+
rows = self.safe_list_2(response, 'rows', 'data', [])
|
7763
7884
|
return self.parse_transfers(rows, currency, since, limit)
|
7764
7885
|
|
7765
7886
|
async def fetch_deposit_address(self, code: str, params={}):
|
ccxt/async_support/btcmarkets.py
CHANGED
@@ -855,7 +855,29 @@ class btcmarkets(Exchange, ImplicitAPI):
|
|
855
855
|
request: dict = {
|
856
856
|
'ids': ids,
|
857
857
|
}
|
858
|
-
|
858
|
+
response = await self.privateDeleteBatchordersIds(self.extend(request, params))
|
859
|
+
#
|
860
|
+
# {
|
861
|
+
# "cancelOrders": [
|
862
|
+
# {
|
863
|
+
# "orderId": "414186",
|
864
|
+
# "clientOrderId": "6"
|
865
|
+
# },
|
866
|
+
# ...
|
867
|
+
# ],
|
868
|
+
# "unprocessedRequests": [
|
869
|
+
# {
|
870
|
+
# "code": "OrderAlreadyCancelled",
|
871
|
+
# "message": "order is already cancelled.",
|
872
|
+
# "requestId": "1"
|
873
|
+
# }
|
874
|
+
# ]
|
875
|
+
# }
|
876
|
+
#
|
877
|
+
cancelOrders = self.safe_list(response, 'cancelOrders', [])
|
878
|
+
unprocessedRequests = self.safe_list(response, 'unprocessedRequests', [])
|
879
|
+
orders = self.array_concat(cancelOrders, unprocessedRequests)
|
880
|
+
return self.parse_orders(orders)
|
859
881
|
|
860
882
|
async def cancel_order(self, id: str, symbol: Str = None, params={}):
|
861
883
|
"""
|
@@ -870,7 +892,14 @@ class btcmarkets(Exchange, ImplicitAPI):
|
|
870
892
|
request: dict = {
|
871
893
|
'id': id,
|
872
894
|
}
|
873
|
-
|
895
|
+
response = await self.privateDeleteOrdersId(self.extend(request, params))
|
896
|
+
#
|
897
|
+
# {
|
898
|
+
# "orderId": "7524",
|
899
|
+
# "clientOrderId": "123-456"
|
900
|
+
# }
|
901
|
+
#
|
902
|
+
return self.parse_order(response)
|
874
903
|
|
875
904
|
def calculate_fee(self, symbol, type, side, amount, price, takerOrMaker='taker', params={}):
|
876
905
|
"""
|
ccxt/async_support/coinex.py
CHANGED
@@ -32,7 +32,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
32
32
|
return self.deep_extend(super(coinex, self).describe(), {
|
33
33
|
'id': 'coinex',
|
34
34
|
'name': 'CoinEx',
|
35
|
-
'version': '
|
35
|
+
'version': 'v2',
|
36
36
|
'countries': ['CN'],
|
37
37
|
# IP ratelimit is 400 requests per second
|
38
38
|
# rateLimit = 1000ms / 400 = 2.5
|
@@ -329,6 +329,8 @@ class coinex(Exchange, ImplicitAPI):
|
|
329
329
|
'futures/position-level': 1,
|
330
330
|
'futures/liquidation-history': 1,
|
331
331
|
'futures/basis-history': 1,
|
332
|
+
'assets/deposit-withdraw-config': 1,
|
333
|
+
'assets/all-deposit-withdraw-config': 1,
|
332
334
|
},
|
333
335
|
},
|
334
336
|
'private': {
|
@@ -351,7 +353,6 @@ class coinex(Exchange, ImplicitAPI):
|
|
351
353
|
'assets/deposit-address': 40,
|
352
354
|
'assets/deposit-history': 40,
|
353
355
|
'assets/withdraw': 40,
|
354
|
-
'assets/deposit-withdraw-config': 1,
|
355
356
|
'assets/transfer-history': 40,
|
356
357
|
'spot/order-status': 8,
|
357
358
|
'spot/batch-order-status': 8,
|
@@ -545,126 +546,125 @@ class coinex(Exchange, ImplicitAPI):
|
|
545
546
|
})
|
546
547
|
|
547
548
|
async def fetch_currencies(self, params={}) -> Currencies:
|
548
|
-
|
549
|
+
"""
|
550
|
+
fetches all available currencies on an exchange
|
551
|
+
:see: https://docs.coinex.com/api/v2/assets/deposit-withdrawal/http/list-all-deposit-withdrawal-config
|
552
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
553
|
+
:returns dict: an associative dictionary of currencies
|
554
|
+
"""
|
555
|
+
response = await self.v2PublicGetAssetsAllDepositWithdrawConfig(params)
|
556
|
+
#
|
549
557
|
# {
|
550
558
|
# "code": 0,
|
551
|
-
# "data":
|
552
|
-
#
|
553
|
-
#
|
554
|
-
#
|
555
|
-
#
|
556
|
-
#
|
557
|
-
#
|
558
|
-
#
|
559
|
-
#
|
560
|
-
#
|
561
|
-
#
|
562
|
-
#
|
563
|
-
#
|
564
|
-
#
|
565
|
-
#
|
559
|
+
# "data": [
|
560
|
+
# {
|
561
|
+
# "asset": {
|
562
|
+
# "ccy": "CET",
|
563
|
+
# "deposit_enabled": True,
|
564
|
+
# "withdraw_enabled": True,
|
565
|
+
# "inter_transfer_enabled": True,
|
566
|
+
# "is_st": False
|
567
|
+
# },
|
568
|
+
# "chains": [
|
569
|
+
# {
|
570
|
+
# "chain": "CSC",
|
571
|
+
# "min_deposit_amount": "0.8",
|
572
|
+
# "min_withdraw_amount": "8",
|
573
|
+
# "deposit_enabled": True,
|
574
|
+
# "withdraw_enabled": True,
|
575
|
+
# "deposit_delay_minutes": 0,
|
576
|
+
# "safe_confirmations": 10,
|
577
|
+
# "irreversible_confirmations": 20,
|
578
|
+
# "deflation_rate": "0",
|
579
|
+
# "withdrawal_fee": "0.026",
|
580
|
+
# "withdrawal_precision": 8,
|
581
|
+
# "memo": "",
|
582
|
+
# "is_memo_required_for_deposit": False,
|
583
|
+
# "explorer_asset_url": ""
|
584
|
+
# },
|
585
|
+
# ]
|
586
|
+
# }
|
587
|
+
# ],
|
588
|
+
# "message": "OK"
|
566
589
|
# }
|
567
590
|
#
|
568
|
-
data = self.
|
569
|
-
coins = list(data.keys())
|
591
|
+
data = self.safe_list(response, 'data', [])
|
570
592
|
result: dict = {}
|
571
|
-
for i in range(0, len(
|
572
|
-
coin =
|
573
|
-
|
574
|
-
|
575
|
-
|
593
|
+
for i in range(0, len(data)):
|
594
|
+
coin = data[i]
|
595
|
+
asset = self.safe_dict(coin, 'asset', {})
|
596
|
+
chains = self.safe_list(coin, 'chains', [])
|
597
|
+
currencyId = self.safe_string(asset, 'ccy')
|
598
|
+
if currencyId is None:
|
599
|
+
continue # coinex returns empty structures for some reason
|
576
600
|
code = self.safe_currency_code(currencyId)
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
minNetworkDeposit = self.parse_number(minNetworkDepositString)
|
585
|
-
minNetworkWithdrawString = self.safe_string(currency, 'withdraw_least_amount')
|
586
|
-
minNetworkWithdraw = self.parse_number(minNetworkWithdrawString)
|
587
|
-
if self.safe_value(result, code) is None:
|
588
|
-
result[code] = {
|
589
|
-
'id': currencyId,
|
590
|
-
'numericId': None,
|
591
|
-
'code': code,
|
592
|
-
'info': None,
|
593
|
-
'name': None,
|
594
|
-
'active': canDeposit and canWithdraw,
|
595
|
-
'deposit': canDeposit,
|
596
|
-
'withdraw': canWithdraw,
|
597
|
-
'fee': fee,
|
598
|
-
'precision': precision,
|
599
|
-
'limits': {
|
600
|
-
'amount': {
|
601
|
-
'min': None,
|
602
|
-
'max': None,
|
603
|
-
},
|
604
|
-
'deposit': {
|
605
|
-
'min': minNetworkDeposit,
|
606
|
-
'max': None,
|
607
|
-
},
|
608
|
-
'withdraw': {
|
609
|
-
'min': minNetworkWithdraw,
|
610
|
-
'max': None,
|
611
|
-
},
|
612
|
-
},
|
613
|
-
}
|
614
|
-
minFeeString = self.safe_string(result[code], 'fee')
|
615
|
-
if feeString is not None:
|
616
|
-
minFeeString = feeString if (minFeeString is None) else Precise.string_min(feeString, minFeeString)
|
617
|
-
depositAvailable = self.safe_value(result[code], 'deposit')
|
618
|
-
depositAvailable = canDeposit if (canDeposit) else depositAvailable
|
619
|
-
withdrawAvailable = self.safe_value(result[code], 'withdraw')
|
620
|
-
withdrawAvailable = canWithdraw if (canWithdraw) else withdrawAvailable
|
621
|
-
minDepositString = self.safe_string(result[code]['limits']['deposit'], 'min')
|
622
|
-
if minNetworkDepositString is not None:
|
623
|
-
minDepositString = minNetworkDepositString if (minDepositString is None) else Precise.string_min(minNetworkDepositString, minDepositString)
|
624
|
-
minWithdrawString = self.safe_string(result[code]['limits']['withdraw'], 'min')
|
625
|
-
if minNetworkWithdrawString is not None:
|
626
|
-
minWithdrawString = minNetworkWithdrawString if (minWithdrawString is None) else Precise.string_min(minNetworkWithdrawString, minWithdrawString)
|
627
|
-
minPrecisionString = self.safe_string(result[code], 'precision')
|
628
|
-
if precisionString is not None:
|
629
|
-
minPrecisionString = precisionString if (minPrecisionString is None) else Precise.string_min(precisionString, minPrecisionString)
|
630
|
-
networks = self.safe_value(result[code], 'networks', {})
|
631
|
-
network: dict = {
|
632
|
-
'info': currency,
|
633
|
-
'id': networkId,
|
634
|
-
'network': networkId,
|
601
|
+
canDeposit = self.safe_bool(asset, 'deposit_enabled')
|
602
|
+
canWithdraw = self.safe_bool(asset, 'withdraw_enabled')
|
603
|
+
firstChain = self.safe_dict(chains, 0, {})
|
604
|
+
firstPrecisionString = self.parse_precision(self.safe_string(firstChain, 'withdrawal_precision'))
|
605
|
+
result[code] = {
|
606
|
+
'id': currencyId,
|
607
|
+
'code': code,
|
635
608
|
'name': None,
|
609
|
+
'active': canDeposit and canWithdraw,
|
610
|
+
'deposit': canDeposit,
|
611
|
+
'withdraw': canWithdraw,
|
612
|
+
'fee': None,
|
613
|
+
'precision': self.parse_number(firstPrecisionString),
|
636
614
|
'limits': {
|
637
615
|
'amount': {
|
638
616
|
'min': None,
|
639
617
|
'max': None,
|
640
618
|
},
|
641
619
|
'deposit': {
|
642
|
-
'min':
|
620
|
+
'min': None,
|
643
621
|
'max': None,
|
644
622
|
},
|
645
623
|
'withdraw': {
|
646
|
-
'min':
|
624
|
+
'min': None,
|
647
625
|
'max': None,
|
648
626
|
},
|
649
627
|
},
|
650
|
-
'
|
651
|
-
'
|
652
|
-
'withdraw': canWithdraw,
|
653
|
-
'fee': fee,
|
654
|
-
'precision': precision,
|
628
|
+
'networks': {},
|
629
|
+
'info': coin,
|
655
630
|
}
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
631
|
+
for j in range(0, len(chains)):
|
632
|
+
chain = chains[j]
|
633
|
+
networkId = self.safe_string(chain, 'chain')
|
634
|
+
precisionString = self.parse_precision(self.safe_string(chain, 'withdrawal_precision'))
|
635
|
+
feeString = self.safe_string(chain, 'withdrawal_fee')
|
636
|
+
minNetworkDepositString = self.safe_string(chain, 'min_deposit_amount')
|
637
|
+
minNetworkWithdrawString = self.safe_string(chain, 'min_withdraw_amount')
|
638
|
+
canDepositChain = self.safe_bool(chain, 'deposit_enabled')
|
639
|
+
canWithdrawChain = self.safe_bool(chain, 'withdraw_enabled')
|
640
|
+
network: dict = {
|
641
|
+
'id': networkId,
|
642
|
+
'network': networkId,
|
643
|
+
'name': None,
|
644
|
+
'active': canDepositChain and canWithdrawChain,
|
645
|
+
'deposit': canDepositChain,
|
646
|
+
'withdraw': canWithdrawChain,
|
647
|
+
'fee': self.parse_number(feeString),
|
648
|
+
'precision': self.parse_number(precisionString),
|
649
|
+
'limits': {
|
650
|
+
'amount': {
|
651
|
+
'min': None,
|
652
|
+
'max': None,
|
653
|
+
},
|
654
|
+
'deposit': {
|
655
|
+
'min': self.parse_number(minNetworkDepositString),
|
656
|
+
'max': None,
|
657
|
+
},
|
658
|
+
'withdraw': {
|
659
|
+
'min': self.parse_number(minNetworkWithdrawString),
|
660
|
+
'max': None,
|
661
|
+
},
|
662
|
+
},
|
663
|
+
'info': chain,
|
664
|
+
}
|
665
|
+
networks = self.safe_dict(result[code], 'networks', {})
|
666
|
+
networks[networkId] = network
|
667
|
+
result[code]['networks'] = networks
|
668
668
|
return result
|
669
669
|
|
670
670
|
async def fetch_markets(self, params={}) -> List[Market]:
|
@@ -5108,7 +5108,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
5108
5108
|
request: dict = {
|
5109
5109
|
'ccy': currency['id'],
|
5110
5110
|
}
|
5111
|
-
response = await self.
|
5111
|
+
response = await self.v2PublicGetAssetsDepositWithdrawConfig(self.extend(request, params))
|
5112
5112
|
#
|
5113
5113
|
# {
|
5114
5114
|
# "code": 0,
|