ccxt 4.4.23__py2.py3-none-any.whl → 4.4.25__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/binance.py +1 -1
- ccxt/abstract/binancecoinm.py +1 -1
- ccxt/abstract/binanceus.py +1 -1
- ccxt/abstract/binanceusdm.py +1 -1
- ccxt/abstract/kucoin.py +1 -0
- ccxt/abstract/kucoinfutures.py +1 -0
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/binance.py +1 -1
- ccxt/async_support/bitmex.py +8 -7
- ccxt/async_support/bybit.py +37 -4
- ccxt/async_support/coincatch.py +1 -1
- ccxt/async_support/coinex.py +45 -21
- ccxt/async_support/gate.py +177 -59
- ccxt/async_support/hitbtc.py +5 -9
- ccxt/async_support/htx.py +16 -16
- ccxt/async_support/hyperliquid.py +1 -1
- ccxt/async_support/kucoin.py +15 -8
- ccxt/async_support/woofipro.py +1 -1
- ccxt/async_support/xt.py +4 -1
- ccxt/async_support/yobit.py +1 -1
- ccxt/base/exchange.py +5 -4
- ccxt/binance.py +1 -1
- ccxt/bitmex.py +8 -7
- ccxt/bybit.py +37 -4
- ccxt/coincatch.py +1 -1
- ccxt/coinex.py +45 -21
- ccxt/gate.py +177 -59
- ccxt/hitbtc.py +5 -9
- ccxt/htx.py +16 -16
- ccxt/hyperliquid.py +1 -1
- ccxt/kucoin.py +15 -8
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/kucoin.py +2 -1
- ccxt/pro/onetrading.py +2 -1
- ccxt/test/tests_async.py +14 -5
- ccxt/test/tests_sync.py +14 -5
- ccxt/woofipro.py +1 -1
- ccxt/xt.py +4 -1
- ccxt/yobit.py +1 -1
- ccxt-4.4.25.dist-info/METADATA +636 -0
- {ccxt-4.4.23.dist-info → ccxt-4.4.25.dist-info}/RECORD +46 -46
- ccxt-4.4.23.dist-info/METADATA +0 -636
- {ccxt-4.4.23.dist-info → ccxt-4.4.25.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.23.dist-info → ccxt-4.4.25.dist-info}/WHEEL +0 -0
- {ccxt-4.4.23.dist-info → ccxt-4.4.25.dist-info}/top_level.txt +0 -0
ccxt/__init__.py
CHANGED
ccxt/abstract/binance.py
CHANGED
@@ -697,7 +697,7 @@ class ImplicitAPI:
|
|
697
697
|
papi_get_cm_adlquantile = papiGetCmAdlQuantile = Entry('cm/adlQuantile', 'papi', 'GET', {'cost': 5})
|
698
698
|
papi_get_um_trade_asyn = papiGetUmTradeAsyn = Entry('um/trade/asyn', 'papi', 'GET', {'cost': 300})
|
699
699
|
papi_get_um_trade_asyn_id = papiGetUmTradeAsynId = Entry('um/trade/asyn/id', 'papi', 'GET', {'cost': 2})
|
700
|
-
papi_get_um_order_asyn = papiGetUmOrderAsyn = Entry('um/order/asyn
|
700
|
+
papi_get_um_order_asyn = papiGetUmOrderAsyn = Entry('um/order/asyn', 'papi', 'GET', {'cost': 300})
|
701
701
|
papi_get_um_order_asyn_id = papiGetUmOrderAsynId = Entry('um/order/asyn/id', 'papi', 'GET', {'cost': 2})
|
702
702
|
papi_get_um_income_asyn = papiGetUmIncomeAsyn = Entry('um/income/asyn', 'papi', 'GET', {'cost': 300})
|
703
703
|
papi_get_um_income_asyn_id = papiGetUmIncomeAsynId = Entry('um/income/asyn/id', 'papi', 'GET', {'cost': 2})
|
ccxt/abstract/binancecoinm.py
CHANGED
@@ -697,7 +697,7 @@ class ImplicitAPI:
|
|
697
697
|
papi_get_cm_adlquantile = papiGetCmAdlQuantile = Entry('cm/adlQuantile', 'papi', 'GET', {'cost': 5})
|
698
698
|
papi_get_um_trade_asyn = papiGetUmTradeAsyn = Entry('um/trade/asyn', 'papi', 'GET', {'cost': 300})
|
699
699
|
papi_get_um_trade_asyn_id = papiGetUmTradeAsynId = Entry('um/trade/asyn/id', 'papi', 'GET', {'cost': 2})
|
700
|
-
papi_get_um_order_asyn = papiGetUmOrderAsyn = Entry('um/order/asyn
|
700
|
+
papi_get_um_order_asyn = papiGetUmOrderAsyn = Entry('um/order/asyn', 'papi', 'GET', {'cost': 300})
|
701
701
|
papi_get_um_order_asyn_id = papiGetUmOrderAsynId = Entry('um/order/asyn/id', 'papi', 'GET', {'cost': 2})
|
702
702
|
papi_get_um_income_asyn = papiGetUmIncomeAsyn = Entry('um/income/asyn', 'papi', 'GET', {'cost': 300})
|
703
703
|
papi_get_um_income_asyn_id = papiGetUmIncomeAsynId = Entry('um/income/asyn/id', 'papi', 'GET', {'cost': 2})
|
ccxt/abstract/binanceus.py
CHANGED
@@ -749,7 +749,7 @@ class ImplicitAPI:
|
|
749
749
|
papi_get_cm_adlquantile = papiGetCmAdlQuantile = Entry('cm/adlQuantile', 'papi', 'GET', {'cost': 5})
|
750
750
|
papi_get_um_trade_asyn = papiGetUmTradeAsyn = Entry('um/trade/asyn', 'papi', 'GET', {'cost': 300})
|
751
751
|
papi_get_um_trade_asyn_id = papiGetUmTradeAsynId = Entry('um/trade/asyn/id', 'papi', 'GET', {'cost': 2})
|
752
|
-
papi_get_um_order_asyn = papiGetUmOrderAsyn = Entry('um/order/asyn
|
752
|
+
papi_get_um_order_asyn = papiGetUmOrderAsyn = Entry('um/order/asyn', 'papi', 'GET', {'cost': 300})
|
753
753
|
papi_get_um_order_asyn_id = papiGetUmOrderAsynId = Entry('um/order/asyn/id', 'papi', 'GET', {'cost': 2})
|
754
754
|
papi_get_um_income_asyn = papiGetUmIncomeAsyn = Entry('um/income/asyn', 'papi', 'GET', {'cost': 300})
|
755
755
|
papi_get_um_income_asyn_id = papiGetUmIncomeAsynId = Entry('um/income/asyn/id', 'papi', 'GET', {'cost': 2})
|
ccxt/abstract/binanceusdm.py
CHANGED
@@ -697,7 +697,7 @@ class ImplicitAPI:
|
|
697
697
|
papi_get_cm_adlquantile = papiGetCmAdlQuantile = Entry('cm/adlQuantile', 'papi', 'GET', {'cost': 5})
|
698
698
|
papi_get_um_trade_asyn = papiGetUmTradeAsyn = Entry('um/trade/asyn', 'papi', 'GET', {'cost': 300})
|
699
699
|
papi_get_um_trade_asyn_id = papiGetUmTradeAsynId = Entry('um/trade/asyn/id', 'papi', 'GET', {'cost': 2})
|
700
|
-
papi_get_um_order_asyn = papiGetUmOrderAsyn = Entry('um/order/asyn
|
700
|
+
papi_get_um_order_asyn = papiGetUmOrderAsyn = Entry('um/order/asyn', 'papi', 'GET', {'cost': 300})
|
701
701
|
papi_get_um_order_asyn_id = papiGetUmOrderAsynId = Entry('um/order/asyn/id', 'papi', 'GET', {'cost': 2})
|
702
702
|
papi_get_um_income_asyn = papiGetUmIncomeAsyn = Entry('um/income/asyn', 'papi', 'GET', {'cost': 300})
|
703
703
|
papi_get_um_income_asyn_id = papiGetUmIncomeAsynId = Entry('um/income/asyn/id', 'papi', 'GET', {'cost': 2})
|
ccxt/abstract/kucoin.py
CHANGED
@@ -49,6 +49,7 @@ class ImplicitAPI:
|
|
49
49
|
private_get_market_orderbook_level_level = privateGetMarketOrderbookLevelLevel = Entry('market/orderbook/level{level}', 'private', 'GET', {'cost': 3})
|
50
50
|
private_get_market_orderbook_level2 = privateGetMarketOrderbookLevel2 = Entry('market/orderbook/level2', 'private', 'GET', {'cost': 3})
|
51
51
|
private_get_market_orderbook_level3 = privateGetMarketOrderbookLevel3 = Entry('market/orderbook/level3', 'private', 'GET', {'cost': 3})
|
52
|
+
private_get_hf_accounts_opened = privateGetHfAccountsOpened = Entry('hf/accounts/opened', 'private', 'GET', {'cost': 2})
|
52
53
|
private_get_hf_orders_active = privateGetHfOrdersActive = Entry('hf/orders/active', 'private', 'GET', {'cost': 2})
|
53
54
|
private_get_hf_orders_active_symbols = privateGetHfOrdersActiveSymbols = Entry('hf/orders/active/symbols', 'private', 'GET', {'cost': 2})
|
54
55
|
private_get_hf_margin_order_active_symbols = privateGetHfMarginOrderActiveSymbols = Entry('hf/margin/order/active/symbols', 'private', 'GET', {'cost': 2})
|
ccxt/abstract/kucoinfutures.py
CHANGED
@@ -49,6 +49,7 @@ class ImplicitAPI:
|
|
49
49
|
private_get_market_orderbook_level_level = privateGetMarketOrderbookLevelLevel = Entry('market/orderbook/level{level}', 'private', 'GET', {'cost': 3})
|
50
50
|
private_get_market_orderbook_level2 = privateGetMarketOrderbookLevel2 = Entry('market/orderbook/level2', 'private', 'GET', {'cost': 3})
|
51
51
|
private_get_market_orderbook_level3 = privateGetMarketOrderbookLevel3 = Entry('market/orderbook/level3', 'private', 'GET', {'cost': 3})
|
52
|
+
private_get_hf_accounts_opened = privateGetHfAccountsOpened = Entry('hf/accounts/opened', 'private', 'GET', {'cost': 2})
|
52
53
|
private_get_hf_orders_active = privateGetHfOrdersActive = Entry('hf/orders/active', 'private', 'GET', {'cost': 2})
|
53
54
|
private_get_hf_orders_active_symbols = privateGetHfOrdersActiveSymbols = Entry('hf/orders/active/symbols', 'private', 'GET', {'cost': 2})
|
54
55
|
private_get_hf_margin_order_active_symbols = privateGetHfMarginOrderActiveSymbols = Entry('hf/margin/order/active/symbols', 'private', 'GET', {'cost': 2})
|
ccxt/async_support/__init__.py
CHANGED
ccxt/async_support/binance.py
CHANGED
@@ -1118,7 +1118,7 @@ class binance(Exchange, ImplicitAPI):
|
|
1118
1118
|
'cm/adlQuantile': 5,
|
1119
1119
|
'um/trade/asyn': 300,
|
1120
1120
|
'um/trade/asyn/id': 2,
|
1121
|
-
'um/order/asyn
|
1121
|
+
'um/order/asyn': 300,
|
1122
1122
|
'um/order/asyn/id': 2,
|
1123
1123
|
'um/income/asyn': 300,
|
1124
1124
|
'um/income/asyn/id': 2,
|
ccxt/async_support/bitmex.py
CHANGED
@@ -1108,17 +1108,18 @@ class bitmex(Exchange, ImplicitAPI):
|
|
1108
1108
|
# set the timestamp to zero, 1970 Jan 1 00:00:00
|
1109
1109
|
# for unrealized pnl and other transactions without a timestamp
|
1110
1110
|
timestamp = 0 # see comments above
|
1111
|
+
fee = None
|
1111
1112
|
feeCost = self.safe_string(item, 'fee')
|
1112
1113
|
if feeCost is not None:
|
1113
1114
|
feeCost = self.convert_to_real_amount(code, feeCost)
|
1114
|
-
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
1115
|
+
fee = {
|
1116
|
+
'cost': self.parse_number(feeCost),
|
1117
|
+
'currency': code,
|
1118
|
+
}
|
1118
1119
|
after = self.safe_string(item, 'walletBalance')
|
1119
1120
|
if after is not None:
|
1120
1121
|
after = self.convert_to_real_amount(code, after)
|
1121
|
-
before = self.
|
1122
|
+
before = self.parse_number(Precise.string_sub(self.number_to_string(after), self.number_to_string(amount)))
|
1122
1123
|
direction = None
|
1123
1124
|
if Precise.string_lt(amountString, '0'):
|
1124
1125
|
direction = 'out'
|
@@ -1137,9 +1138,9 @@ class bitmex(Exchange, ImplicitAPI):
|
|
1137
1138
|
'referenceAccount': referenceAccount,
|
1138
1139
|
'type': type,
|
1139
1140
|
'currency': code,
|
1140
|
-
'amount': self.
|
1141
|
+
'amount': self.parse_number(amount),
|
1141
1142
|
'before': before,
|
1142
|
-
'after': self.
|
1143
|
+
'after': self.parse_number(after),
|
1143
1144
|
'status': status,
|
1144
1145
|
'fee': fee,
|
1145
1146
|
}, currency)
|
ccxt/async_support/bybit.py
CHANGED
@@ -1027,6 +1027,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
1027
1027
|
},
|
1028
1028
|
'enableUnifiedMargin': None,
|
1029
1029
|
'enableUnifiedAccount': None,
|
1030
|
+
'unifiedMarginStatus': None,
|
1030
1031
|
'createMarketBuyOrderRequiresPrice': True, # only True for classic accounts
|
1031
1032
|
'createUnifiedMarginAccount': False,
|
1032
1033
|
'defaultType': 'swap', # 'swap', 'future', 'option', 'spot'
|
@@ -1146,6 +1147,8 @@ class bybit(Exchange, ImplicitAPI):
|
|
1146
1147
|
|
1147
1148
|
async def is_unified_enabled(self, params={}):
|
1148
1149
|
"""
|
1150
|
+
:see: https://bybit-exchange.github.io/docs/v5/user/apikey-info#http-request
|
1151
|
+
:see: https://bybit-exchange.github.io/docs/v5/account/account-info
|
1149
1152
|
returns [enableUnifiedMargin, enableUnifiedAccount] so the user can check if unified account is enabled
|
1150
1153
|
"""
|
1151
1154
|
# The API key of user id must own one of permissions will be allowed to call following API endpoints.
|
@@ -1159,8 +1162,12 @@ class bybit(Exchange, ImplicitAPI):
|
|
1159
1162
|
# so we're assuming UTA is enabled
|
1160
1163
|
self.options['enableUnifiedMargin'] = False
|
1161
1164
|
self.options['enableUnifiedAccount'] = True
|
1165
|
+
self.options['unifiedMarginStatus'] = 3
|
1162
1166
|
return [self.options['enableUnifiedMargin'], self.options['enableUnifiedAccount']]
|
1163
|
-
|
1167
|
+
rawPromises = [self.privateGetV5UserQueryApi(params), self.privateGetV5AccountInfo(params)]
|
1168
|
+
promises = await asyncio.gather(*rawPromises)
|
1169
|
+
response = promises[0]
|
1170
|
+
accountInfo = promises[1]
|
1164
1171
|
#
|
1165
1172
|
# {
|
1166
1173
|
# "retCode": 0,
|
@@ -1200,13 +1207,34 @@ class bybit(Exchange, ImplicitAPI):
|
|
1200
1207
|
# "retExtInfo": {},
|
1201
1208
|
# "time": 1676891757649
|
1202
1209
|
# }
|
1210
|
+
# account info
|
1211
|
+
# {
|
1212
|
+
# "retCode": 0,
|
1213
|
+
# "retMsg": "OK",
|
1214
|
+
# "result": {
|
1215
|
+
# "marginMode": "REGULAR_MARGIN",
|
1216
|
+
# "updatedTime": "1697078946000",
|
1217
|
+
# "unifiedMarginStatus": 4,
|
1218
|
+
# "dcpStatus": "OFF",
|
1219
|
+
# "timeWindow": 10,
|
1220
|
+
# "smpGroup": 0,
|
1221
|
+
# "isMasterTrader": False,
|
1222
|
+
# "spotHedgingStatus": "OFF"
|
1223
|
+
# }
|
1224
|
+
# }
|
1203
1225
|
#
|
1204
1226
|
result = self.safe_dict(response, 'result', {})
|
1227
|
+
accountResult = self.safe_dict(accountInfo, 'result', {})
|
1205
1228
|
self.options['enableUnifiedMargin'] = self.safe_integer(result, 'unified') == 1
|
1206
1229
|
self.options['enableUnifiedAccount'] = self.safe_integer(result, 'uta') == 1
|
1230
|
+
self.options['unifiedMarginStatus'] = self.safe_integer(accountResult, 'unifiedMarginStatus', 3) # default to uta.1 if not found
|
1207
1231
|
return [self.options['enableUnifiedMargin'], self.options['enableUnifiedAccount']]
|
1208
1232
|
|
1209
1233
|
async def upgrade_unified_trade_account(self, params={}):
|
1234
|
+
"""
|
1235
|
+
:see: https://bybit-exchange.github.io/docs/v5/account/upgrade-unified-account
|
1236
|
+
upgrades the account to unified trade account *warning* self is irreversible
|
1237
|
+
"""
|
1210
1238
|
return await self.privatePostV5AccountUpgradeToUta(params)
|
1211
1239
|
|
1212
1240
|
def create_expired_option_market(self, symbol: str):
|
@@ -3019,10 +3047,15 @@ class bybit(Exchange, ImplicitAPI):
|
|
3019
3047
|
isInverse = (type == 'inverse')
|
3020
3048
|
isFunding = (lowercaseRawType == 'fund') or (lowercaseRawType == 'funding')
|
3021
3049
|
if isUnifiedAccount:
|
3022
|
-
|
3023
|
-
|
3050
|
+
unifiedMarginStatus = self.safe_integer(self.options, 'unifiedMarginStatus', 3)
|
3051
|
+
if unifiedMarginStatus < 5:
|
3052
|
+
# it's not uta.20 where inverse are unified
|
3053
|
+
if isInverse:
|
3054
|
+
type = 'contract'
|
3055
|
+
else:
|
3056
|
+
type = 'unified'
|
3024
3057
|
else:
|
3025
|
-
type = 'unified'
|
3058
|
+
type = 'unified' # uta.20 where inverse are unified
|
3026
3059
|
else:
|
3027
3060
|
if isLinear or isInverse:
|
3028
3061
|
type = 'contract'
|
ccxt/async_support/coincatch.py
CHANGED
@@ -154,7 +154,7 @@ class coincatch(Exchange, ImplicitAPI):
|
|
154
154
|
'1M': '1M',
|
155
155
|
},
|
156
156
|
'urls': {
|
157
|
-
'logo': 'https://
|
157
|
+
'logo': 'https://github.com/user-attachments/assets/3d49065f-f05d-4573-88a2-1b5201ec6ff3',
|
158
158
|
'api': {
|
159
159
|
'public': 'https://api.coincatch.com',
|
160
160
|
'private': 'https://api.coincatch.com',
|
ccxt/async_support/coinex.py
CHANGED
@@ -474,9 +474,43 @@ class coinex(Exchange, ImplicitAPI):
|
|
474
474
|
'FUTURES': 'swap',
|
475
475
|
},
|
476
476
|
'networks': {
|
477
|
+
'BTC': 'BTC',
|
477
478
|
'BEP20': 'BSC',
|
478
|
-
'
|
479
|
-
'
|
479
|
+
'TRC20': 'TRC20',
|
480
|
+
'ERC20': 'ERC20',
|
481
|
+
'BRC20': 'BRC20',
|
482
|
+
'SOL': 'SOL',
|
483
|
+
'TON': 'SOL',
|
484
|
+
'BSV': 'BSV',
|
485
|
+
'AVAXC': 'AVA_C',
|
486
|
+
'AVAXX': 'AVA',
|
487
|
+
'SUI': 'SUI',
|
488
|
+
'ACA': 'ACA',
|
489
|
+
'CHZ': 'CHILIZ',
|
490
|
+
'ADA': 'ADA',
|
491
|
+
'ARB': 'ARBITRUM',
|
492
|
+
'ARBNOVA': 'ARBITRUM_NOVA',
|
493
|
+
'OP': 'OPTIMISM',
|
494
|
+
'APT': 'APTOS',
|
495
|
+
'ATOM': 'ATOM',
|
496
|
+
'FTM': 'FTM',
|
497
|
+
'BCH': 'BCH',
|
498
|
+
'ASTR': 'ASTR',
|
499
|
+
'LTC': 'LTC',
|
500
|
+
'MATIC': 'MATIC',
|
501
|
+
'CRONOS': 'CRONOS',
|
502
|
+
'DASH': 'DASH',
|
503
|
+
'DOT': 'DOT',
|
504
|
+
'ETC': 'ETC',
|
505
|
+
'ETHW': 'ETHPOW',
|
506
|
+
'FIL': 'FIL',
|
507
|
+
'ZIL': 'ZIL',
|
508
|
+
'DOGE': 'DOGE',
|
509
|
+
'TIA': 'CELESTIA',
|
510
|
+
'SEI': 'SEI',
|
511
|
+
'XRP': 'XRP',
|
512
|
+
'XMR': 'XMR',
|
513
|
+
# CSC, AE, BASE, AIPG, AKASH, POLKADOTASSETHUB ?, ALEO, STX, ALGO, ALPH, BLAST, AR, ARCH, ARDR, ARK, ARRR, MANTA, NTRN, LUNA, AURORA, AVAIL, ASC20, AVA, AYA, AZERO, BAN, BAND, BB, RUNES, BEAM, BELLSCOIN, BITCI, NEAR, AGORIC, BLOCX, BNC, BOBA, BRISE, KRC20, CANTO, CAPS, CCD, CELO, CFX, CHI, CKB, CLORE, CLV, CORE, CSPR, CTXC, DAG, DCR, DERO, DESO, DEFI, DGB, DNX, DOCK, DOGECHAIN, DYDX, DYMENSION, EGLD, ELA, ELF, ENJIN, EOSIO, ERG, ETN_SC, EVMOS, EWC, SGB, FACT, FB, FET, FIO, FIRO, NEO3, FLOW, FLARE, FLUX, LINEA, FREN, FSN, FB_BRC20, GLMR, GRIN, GRS, HACASH, HBAR, HERB, HIVE, MAPO, HMND, HNS, ZKSYNC, HTR, HUAHUA, MERLIN, ICP, ICX, INJ, IOST, IOTA, IOTX, IRIS, IRON, ONE, JOYSTREAM, KAI, KAR, KAS, KAVA, KCN, KDA, KLAY, KLY, KMD, KSM, KUB, KUJIRA, LAT, LBC, LUNC, LUKSO, MARS, METIS, MINA, MANTLE, MOB, MODE, MONA, MOVR, MTL, NEOX, NEXA, NIBI, NIMIQ, NMC, ONOMY, NRG, WAVES, NULS, OAS, OCTA, OLT, ONT, OORT, ORAI, OSMO, P3D, COMPOSABLE, PIVX, RON, POKT, POLYMESH, PRE_MARKET, PYI, QKC, QTUM, QUBIC, RSK, ROSE, ROUTE, RTM, THORCHAIN, RVN, RADIANT, SAGA, SALVIUM, SATOX, SC, SCP, _NULL, SCRT, SDN, RGBPP, SELF, SMH, SPACE, STARGAZE, STC, STEEM, STRATISEVM, STRD, STARKNET, SXP, SYS, TAIKO, TAO, TARA, TENET, THETA, TT, VENOM, VECHAIN, TOMO, VITE, VLX, VSYS, VTC, WAN, WAXP, WEMIX, XCH, XDC, XEC, XELIS, NEM, XHV, XLM, XNA, NANO, XPLA, XPR, XPRT, XRD, XTZ, XVG, XYM, ZANO, ZEC, ZEN, ZEPH, ZETA
|
480
514
|
},
|
481
515
|
},
|
482
516
|
'commonCurrencies': {
|
@@ -3547,20 +3581,14 @@ class coinex(Exchange, ImplicitAPI):
|
|
3547
3581
|
"""
|
3548
3582
|
await self.load_markets()
|
3549
3583
|
currency = self.currency(code)
|
3550
|
-
networks = self.safe_dict(currency, 'networks', {})
|
3551
|
-
network = self.safe_string_2(params, 'network', 'chain')
|
3552
|
-
params = self.omit(params, 'network')
|
3553
|
-
networksKeys = list(networks.keys())
|
3554
|
-
numOfNetworks = len(networksKeys)
|
3555
|
-
if networks is not None and numOfNetworks > 1:
|
3556
|
-
if network is None:
|
3557
|
-
raise ArgumentsRequired(self.id + ' fetchDepositAddress() ' + code + ' requires a network parameter')
|
3558
|
-
if not (network in networks):
|
3559
|
-
raise ExchangeError(self.id + ' fetchDepositAddress() ' + network + ' network not supported for ' + code)
|
3560
3584
|
request: dict = {
|
3561
3585
|
'ccy': currency['id'],
|
3562
|
-
'chain': network,
|
3563
3586
|
}
|
3587
|
+
networkCode = None
|
3588
|
+
networkCode, params = self.handle_network_code_and_params(params)
|
3589
|
+
if networkCode is None:
|
3590
|
+
raise ArgumentsRequired(self.id + ' fetchDepositAddress() requires a "network" parameter')
|
3591
|
+
request['chain'] = self.network_code_to_id(networkCode) # required for on-chain, not required for inter-user transfer
|
3564
3592
|
response = await self.v2PrivateGetAssetsDepositAddress(self.extend(request, params))
|
3565
3593
|
#
|
3566
3594
|
# {
|
@@ -3573,12 +3601,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3573
3601
|
# }
|
3574
3602
|
#
|
3575
3603
|
data = self.safe_dict(response, 'data', {})
|
3576
|
-
|
3577
|
-
options = self.safe_dict(self.options, 'fetchDepositAddress', {})
|
3578
|
-
fillResponseFromRequest = self.safe_bool(options, 'fillResponseFromRequest', True)
|
3579
|
-
if fillResponseFromRequest:
|
3580
|
-
depositAddress['network'] = self.network_id_to_code(network, currency).upper()
|
3581
|
-
return depositAddress
|
3604
|
+
return self.parse_deposit_address(data, currency)
|
3582
3605
|
|
3583
3606
|
def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
|
3584
3607
|
#
|
@@ -4418,8 +4441,6 @@ class coinex(Exchange, ImplicitAPI):
|
|
4418
4441
|
self.check_address(address)
|
4419
4442
|
await self.load_markets()
|
4420
4443
|
currency = self.currency(code)
|
4421
|
-
networkCode = self.safe_string_upper_2(params, 'network', 'chain')
|
4422
|
-
params = self.omit(params, 'network')
|
4423
4444
|
if tag:
|
4424
4445
|
address = address + ':' + tag
|
4425
4446
|
request: dict = {
|
@@ -4427,6 +4448,8 @@ class coinex(Exchange, ImplicitAPI):
|
|
4427
4448
|
'to_address': address, # must be authorized, inter-user transfer by a registered mobile phone number or an email address is supported
|
4428
4449
|
'amount': self.number_to_string(amount), # the actual amount without fees, https://www.coinex.com/fees
|
4429
4450
|
}
|
4451
|
+
networkCode = None
|
4452
|
+
networkCode, params = self.handle_network_code_and_params(params)
|
4430
4453
|
if networkCode is not None:
|
4431
4454
|
request['chain'] = self.network_code_to_id(networkCode) # required for on-chain, not required for inter-user transfer
|
4432
4455
|
response = await self.v2PrivatePostAssetsWithdraw(self.extend(request, params))
|
@@ -4463,6 +4486,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4463
4486
|
statuses: dict = {
|
4464
4487
|
'audit': 'pending',
|
4465
4488
|
'pass': 'pending',
|
4489
|
+
'audit_required': 'pending',
|
4466
4490
|
'processing': 'pending',
|
4467
4491
|
'confirming': 'pending',
|
4468
4492
|
'not_pass': 'failed',
|