ccxt 4.3.44__py2.py3-none-any.whl → 4.3.46__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 +3 -1
- ccxt/abstract/binance.py +2 -0
- ccxt/abstract/binancecoinm.py +2 -0
- ccxt/abstract/binanceus.py +2 -0
- ccxt/abstract/binanceusdm.py +2 -0
- ccxt/abstract/bitstamp.py +18 -2
- ccxt/abstract/kucoin.py +14 -0
- ccxt/abstract/kucoinfutures.py +14 -0
- ccxt/abstract/mexc.py +2 -0
- ccxt/abstract/oxfun.py +34 -0
- ccxt/async_support/__init__.py +3 -1
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/binance.py +2 -0
- ccxt/async_support/bingx.py +26 -18
- ccxt/async_support/bitmart.py +4 -0
- ccxt/async_support/bitstamp.py +18 -2
- ccxt/async_support/bitteam.py +6 -8
- ccxt/async_support/coinmetro.py +9 -18
- ccxt/async_support/hyperliquid.py +31 -23
- ccxt/async_support/idex.py +1 -0
- ccxt/async_support/kucoin.py +27 -1
- ccxt/async_support/luno.py +9 -1
- ccxt/async_support/mexc.py +8 -6
- ccxt/async_support/okx.py +1 -0
- ccxt/async_support/oxfun.py +2773 -0
- ccxt/async_support/tokocrypto.py +9 -11
- ccxt/async_support/wavesexchange.py +119 -105
- ccxt/async_support/woofipro.py +1 -0
- ccxt/async_support/xt.py +1 -1
- ccxt/base/exchange.py +1 -1
- ccxt/binance.py +2 -0
- ccxt/bingx.py +26 -18
- ccxt/bitmart.py +4 -0
- ccxt/bitstamp.py +18 -2
- ccxt/bitteam.py +6 -8
- ccxt/coinmetro.py +9 -18
- ccxt/hyperliquid.py +31 -23
- ccxt/idex.py +1 -0
- ccxt/kucoin.py +27 -1
- ccxt/luno.py +9 -1
- ccxt/mexc.py +8 -6
- ccxt/okx.py +1 -0
- ccxt/oxfun.py +2772 -0
- ccxt/pro/__init__.py +3 -1
- ccxt/pro/binanceus.py +0 -8
- ccxt/pro/oxfun.py +950 -0
- ccxt/test/test_async.py +17 -1
- ccxt/test/test_sync.py +17 -1
- ccxt/tokocrypto.py +9 -11
- ccxt/wavesexchange.py +119 -105
- ccxt/woofipro.py +1 -0
- ccxt/xt.py +1 -1
- {ccxt-4.3.44.dist-info → ccxt-4.3.46.dist-info}/METADATA +131 -131
- {ccxt-4.3.44.dist-info → ccxt-4.3.46.dist-info}/RECORD +56 -52
- {ccxt-4.3.44.dist-info → ccxt-4.3.46.dist-info}/WHEEL +0 -0
- {ccxt-4.3.44.dist-info → ccxt-4.3.46.dist-info}/top_level.txt +0 -0
ccxt/bitteam.py
CHANGED
@@ -15,7 +15,7 @@ from ccxt.base.errors import BadSymbol
|
|
15
15
|
from ccxt.base.errors import InsufficientFunds
|
16
16
|
from ccxt.base.errors import OrderNotFound
|
17
17
|
from ccxt.base.errors import ExchangeNotAvailable
|
18
|
-
from ccxt.base.decimal_to_precision import
|
18
|
+
from ccxt.base.decimal_to_precision import TICK_SIZE
|
19
19
|
from ccxt.base.precise import Precise
|
20
20
|
|
21
21
|
|
@@ -199,7 +199,7 @@ class bitteam(Exchange, ImplicitAPI):
|
|
199
199
|
'maker': self.parse_number('0.002'),
|
200
200
|
},
|
201
201
|
},
|
202
|
-
'precisionMode':
|
202
|
+
'precisionMode': TICK_SIZE,
|
203
203
|
# exchange-specific options
|
204
204
|
'options': {
|
205
205
|
'networksById': {
|
@@ -358,8 +358,6 @@ class bitteam(Exchange, ImplicitAPI):
|
|
358
358
|
base = self.safe_currency_code(baseId)
|
359
359
|
quote = self.safe_currency_code(quoteId)
|
360
360
|
active = self.safe_value(market, 'active')
|
361
|
-
amountPrecision = self.safe_integer(market, 'baseStep')
|
362
|
-
pricePrecision = self.safe_integer(market, 'quoteStep')
|
363
361
|
timeStart = self.safe_string(market, 'timeStart')
|
364
362
|
created = self.parse8601(timeStart)
|
365
363
|
minCost = None
|
@@ -394,8 +392,8 @@ class bitteam(Exchange, ImplicitAPI):
|
|
394
392
|
'strike': None,
|
395
393
|
'optionType': None,
|
396
394
|
'precision': {
|
397
|
-
'amount':
|
398
|
-
'price':
|
395
|
+
'amount': self.parse_number(self.parse_precision(self.safe_string(market, 'baseStep'))),
|
396
|
+
'price': self.parse_number(self.parse_precision(self.safe_string(market, 'quoteStep'))),
|
399
397
|
},
|
400
398
|
'limits': {
|
401
399
|
'leverage': {
|
@@ -549,7 +547,7 @@ class bitteam(Exchange, ImplicitAPI):
|
|
549
547
|
numericId = self.safe_integer(currency, 'id')
|
550
548
|
code = self.safe_currency_code(id)
|
551
549
|
active = self.safe_bool(currency, 'active', False)
|
552
|
-
precision = self.
|
550
|
+
precision = self.parse_number(self.parse_precision(self.safe_string(currency, 'precision')))
|
553
551
|
txLimits = self.safe_value(currency, 'txLimits', {})
|
554
552
|
minWithdraw = self.safe_string(txLimits, 'minWithdraw')
|
555
553
|
maxWithdraw = self.safe_string(txLimits, 'maxWithdraw')
|
@@ -569,7 +567,7 @@ class bitteam(Exchange, ImplicitAPI):
|
|
569
567
|
withdraw = self.safe_value(statuses, 'withdrawStatus')
|
570
568
|
networkIds = list(feesByNetworkId.keys())
|
571
569
|
networks: dict = {}
|
572
|
-
networkPrecision = self.
|
570
|
+
networkPrecision = self.parse_number(self.parse_precision(self.safe_string(currency, 'decimals')))
|
573
571
|
for j in range(0, len(networkIds)):
|
574
572
|
networkId = networkIds[j]
|
575
573
|
networkCode = self.network_id_to_code(networkId, code)
|
ccxt/coinmetro.py
CHANGED
@@ -16,7 +16,7 @@ from ccxt.base.errors import InsufficientFunds
|
|
16
16
|
from ccxt.base.errors import InvalidOrder
|
17
17
|
from ccxt.base.errors import OrderNotFound
|
18
18
|
from ccxt.base.errors import RateLimitExceeded
|
19
|
-
from ccxt.base.decimal_to_precision import
|
19
|
+
from ccxt.base.decimal_to_precision import TICK_SIZE
|
20
20
|
from ccxt.base.precise import Precise
|
21
21
|
|
22
22
|
|
@@ -215,7 +215,7 @@ class coinmetro(Exchange, ImplicitAPI):
|
|
215
215
|
'maker': self.parse_number('0'),
|
216
216
|
},
|
217
217
|
},
|
218
|
-
'precisionMode':
|
218
|
+
'precisionMode': TICK_SIZE,
|
219
219
|
# exchange-specific options
|
220
220
|
'options': {
|
221
221
|
'currenciesByIdForParseMarket': None,
|
@@ -317,7 +317,6 @@ class coinmetro(Exchange, ImplicitAPI):
|
|
317
317
|
deposit = self.safe_value(currency, 'canDeposit')
|
318
318
|
canTrade = self.safe_value(currency, 'canTrade')
|
319
319
|
active = withdraw if canTrade else True
|
320
|
-
precision = self.safe_integer(currency, 'digits')
|
321
320
|
minAmount = self.safe_number(currency, 'minQty')
|
322
321
|
result[code] = self.safe_currency_structure({
|
323
322
|
'id': id,
|
@@ -328,7 +327,7 @@ class coinmetro(Exchange, ImplicitAPI):
|
|
328
327
|
'deposit': deposit,
|
329
328
|
'withdraw': withdraw,
|
330
329
|
'fee': None,
|
331
|
-
'precision':
|
330
|
+
'precision': self.parse_number(self.parse_precision(self.safe_string(currency, 'digits'))),
|
332
331
|
'limits': {
|
333
332
|
'amount': {'min': minAmount, 'max': None},
|
334
333
|
'withdraw': {'min': None, 'max': None},
|
@@ -354,19 +353,14 @@ class coinmetro(Exchange, ImplicitAPI):
|
|
354
353
|
#
|
355
354
|
# [
|
356
355
|
# {
|
357
|
-
# "pair": "
|
358
|
-
# "precision": 5,
|
359
|
-
# "margin": False
|
360
|
-
# },
|
361
|
-
# {
|
362
|
-
# "pair": "PERPUSD",
|
356
|
+
# "pair": "YFIEUR",
|
363
357
|
# "precision": 5,
|
364
358
|
# "margin": False
|
365
359
|
# },
|
366
360
|
# {
|
367
|
-
# "pair": "
|
368
|
-
# "precision":
|
369
|
-
# "margin":
|
361
|
+
# "pair": "BTCEUR",
|
362
|
+
# "precision": 2,
|
363
|
+
# "margin": True
|
370
364
|
# },
|
371
365
|
# ...
|
372
366
|
# ]
|
@@ -412,9 +406,7 @@ class coinmetro(Exchange, ImplicitAPI):
|
|
412
406
|
'optionType': None,
|
413
407
|
'precision': {
|
414
408
|
'amount': basePrecisionAndLimits['precision'],
|
415
|
-
'price':
|
416
|
-
'base': basePrecisionAndLimits['precision'],
|
417
|
-
'quote': quotePrecisionAndLimits['precision'],
|
409
|
+
'price': self.parse_number(self.parse_precision(self.safe_string(market, 'precision'))),
|
418
410
|
},
|
419
411
|
'limits': {
|
420
412
|
'leverage': {
|
@@ -464,12 +456,11 @@ class coinmetro(Exchange, ImplicitAPI):
|
|
464
456
|
def parse_market_precision_and_limits(self, currencyId):
|
465
457
|
currencies = self.safe_value(self.options, 'currenciesByIdForParseMarket', {})
|
466
458
|
currency = self.safe_value(currencies, currencyId, {})
|
467
|
-
precision = self.safe_integer(currency, 'precision')
|
468
459
|
limits = self.safe_value(currency, 'limits', {})
|
469
460
|
amountLimits = self.safe_value(limits, 'amount', {})
|
470
461
|
minLimit = self.safe_number(amountLimits, 'min')
|
471
462
|
result: dict = {
|
472
|
-
'precision': precision,
|
463
|
+
'precision': self.safe_number(currency, 'precision'),
|
473
464
|
'minLimit': minLimit,
|
474
465
|
}
|
475
466
|
return result
|
ccxt/hyperliquid.py
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.hyperliquid import ImplicitAPI
|
8
|
-
from ccxt.base.types import Balances, Currencies, Int, MarginModification, Market, Num, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Str, Strings, Trade, TransferEntry
|
8
|
+
from ccxt.base.types import Balances, Currencies, Int, MarginModification, Market, Num, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Str, Strings, Trade, Transaction, TransferEntry
|
9
9
|
from typing import List
|
10
10
|
from ccxt.base.errors import ExchangeError
|
11
11
|
from ccxt.base.errors import ArgumentsRequired
|
@@ -31,6 +31,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
31
31
|
'rateLimit': 50, # 1200 requests per minute, 20 request per second
|
32
32
|
'certified': False,
|
33
33
|
'pro': True,
|
34
|
+
'dex': True,
|
34
35
|
'has': {
|
35
36
|
'CORS': None,
|
36
37
|
'spot': True,
|
@@ -948,11 +949,12 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
948
949
|
signature = self.sign_message(msg, self.privateKey)
|
949
950
|
return signature
|
950
951
|
|
951
|
-
def
|
952
|
+
def sign_user_signed_action(self, messageTypes, message):
|
952
953
|
zeroAddress = self.safe_string(self.options, 'zeroAddress')
|
954
|
+
chainId = 421614 # check self out
|
953
955
|
domain: dict = {
|
954
956
|
'chainId': chainId,
|
955
|
-
'name': '
|
957
|
+
'name': 'HyperliquidSignTransaction',
|
956
958
|
'verifyingContract': zeroAddress,
|
957
959
|
'version': '1',
|
958
960
|
}
|
@@ -961,28 +963,26 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
961
963
|
return signature
|
962
964
|
|
963
965
|
def build_transfer_sig(self, message):
|
964
|
-
isSandboxMode = self.safe_bool(self.options, 'sandboxMode')
|
965
|
-
chainId = 421614 if (isSandboxMode) else 42161
|
966
966
|
messageTypes: dict = {
|
967
|
-
'
|
967
|
+
'HyperliquidTransaction:UsdSend': [
|
968
|
+
{'name': 'hyperliquidChain', 'type': 'string'},
|
968
969
|
{'name': 'destination', 'type': 'string'},
|
969
970
|
{'name': 'amount', 'type': 'string'},
|
970
971
|
{'name': 'time', 'type': 'uint64'},
|
971
972
|
],
|
972
973
|
}
|
973
|
-
return self.
|
974
|
+
return self.sign_user_signed_action(messageTypes, message)
|
974
975
|
|
975
976
|
def build_withdraw_sig(self, message):
|
976
|
-
isSandboxMode = self.safe_bool(self.options, 'sandboxMode')
|
977
|
-
chainId = 421614 if (isSandboxMode) else 42161
|
978
977
|
messageTypes: dict = {
|
979
|
-
'
|
978
|
+
'HyperliquidTransaction:Withdraw': [
|
979
|
+
{'name': 'hyperliquidChain', 'type': 'string'},
|
980
980
|
{'name': 'destination', 'type': 'string'},
|
981
|
-
{'name': '
|
981
|
+
{'name': 'amount', 'type': 'string'},
|
982
982
|
{'name': 'time', 'type': 'uint64'},
|
983
983
|
],
|
984
984
|
}
|
985
|
-
return self.
|
985
|
+
return self.sign_user_signed_action(messageTypes, message)
|
986
986
|
|
987
987
|
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
988
988
|
"""
|
@@ -2276,8 +2276,9 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2276
2276
|
if code is not None:
|
2277
2277
|
code = code.upper()
|
2278
2278
|
if code != 'USDC':
|
2279
|
-
raise NotSupported(self.id + '
|
2279
|
+
raise NotSupported(self.id + 'transfer() only support USDC')
|
2280
2280
|
payload: dict = {
|
2281
|
+
'hyperliquidChain': 'Testnet' if isSandboxMode else 'Mainnet',
|
2281
2282
|
'destination': toAccount,
|
2282
2283
|
'amount': self.number_to_string(amount),
|
2283
2284
|
'time': nonce,
|
@@ -2285,9 +2286,12 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2285
2286
|
sig = self.build_transfer_sig(payload)
|
2286
2287
|
request: dict = {
|
2287
2288
|
'action': {
|
2288
|
-
'
|
2289
|
-
'
|
2290
|
-
'
|
2289
|
+
'hyperliquidChain': payload['hyperliquidChain'],
|
2290
|
+
'signatureChainId': '0x66eee', # check self out
|
2291
|
+
'destination': toAccount,
|
2292
|
+
'amount': str(amount),
|
2293
|
+
'time': nonce,
|
2294
|
+
'type': 'usdSend',
|
2291
2295
|
},
|
2292
2296
|
'nonce': nonce,
|
2293
2297
|
'signature': sig,
|
@@ -2295,7 +2299,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2295
2299
|
response = self.privatePostExchange(self.extend(request, params))
|
2296
2300
|
return response
|
2297
2301
|
|
2298
|
-
def withdraw(self, code: str, amount, address, tag=None, params={}):
|
2302
|
+
def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
2299
2303
|
"""
|
2300
2304
|
make a withdrawal(only support USDC)
|
2301
2305
|
:see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#initiate-a-withdrawal-request
|
@@ -2313,25 +2317,29 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2313
2317
|
code = code.upper()
|
2314
2318
|
if code != 'USDC':
|
2315
2319
|
raise NotSupported(self.id + 'withdraw() only support USDC')
|
2316
|
-
isSandboxMode = self.safe_bool(self.options, 'sandboxMode')
|
2320
|
+
isSandboxMode = self.safe_bool(self.options, 'sandboxMode', False)
|
2317
2321
|
nonce = self.milliseconds()
|
2318
2322
|
payload: dict = {
|
2323
|
+
'hyperliquidChain': 'Testnet' if isSandboxMode else 'Mainnet',
|
2319
2324
|
'destination': address,
|
2320
|
-
'
|
2325
|
+
'amount': str(amount),
|
2321
2326
|
'time': nonce,
|
2322
2327
|
}
|
2323
2328
|
sig = self.build_withdraw_sig(payload)
|
2324
2329
|
request: dict = {
|
2325
2330
|
'action': {
|
2326
|
-
'
|
2327
|
-
'
|
2328
|
-
'
|
2331
|
+
'hyperliquidChain': payload['hyperliquidChain'],
|
2332
|
+
'signatureChainId': '0x66eee', # check self out
|
2333
|
+
'destination': address,
|
2334
|
+
'amount': str(amount),
|
2335
|
+
'time': nonce,
|
2336
|
+
'type': 'withdraw3',
|
2329
2337
|
},
|
2330
2338
|
'nonce': nonce,
|
2331
2339
|
'signature': sig,
|
2332
2340
|
}
|
2333
2341
|
response = self.privatePostExchange(self.extend(request, params))
|
2334
|
-
return response
|
2342
|
+
return self.parse_transaction(response)
|
2335
2343
|
|
2336
2344
|
def format_vault_address(self, address: Str = None):
|
2337
2345
|
if address is None:
|
ccxt/idex.py
CHANGED
ccxt/kucoin.py
CHANGED
@@ -140,6 +140,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
140
140
|
'futuresPublic': 'https://api-futures.kucoin.com',
|
141
141
|
'webExchange': 'https://kucoin.com/_api',
|
142
142
|
'broker': 'https://api-broker.kucoin.com',
|
143
|
+
'earn': 'https://api.kucoin.com',
|
143
144
|
},
|
144
145
|
'www': 'https://www.kucoin.com',
|
145
146
|
'doc': [
|
@@ -407,6 +408,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
407
408
|
'broker/nd/account': 2,
|
408
409
|
'broker/nd/account/apikey': 2,
|
409
410
|
'broker/nd/rebase/download': 3,
|
411
|
+
'broker/nd/transfer/detail': 1,
|
412
|
+
'broker/nd/deposit/detail': 1,
|
413
|
+
'broker/nd/withdraw/detail': 1,
|
410
414
|
},
|
411
415
|
'post': {
|
412
416
|
'broker/nd/transfer': 1,
|
@@ -418,6 +422,25 @@ class kucoin(Exchange, ImplicitAPI):
|
|
418
422
|
'broker/nd/account/apikey': 3,
|
419
423
|
},
|
420
424
|
},
|
425
|
+
'earn': {
|
426
|
+
'get': {
|
427
|
+
'otc-loan/loan': 1,
|
428
|
+
'otc-loan/accounts': 1,
|
429
|
+
'earn/redeem-preview': 7.5, # 5EW
|
430
|
+
'earn/saving/products': 7.5, # 5EW
|
431
|
+
'earn/hold-assets': 7.5, # 5EW
|
432
|
+
'earn/promotion/products': 7.5, # 5EW
|
433
|
+
'earn/kcs-staking/products': 7.5, # 5EW
|
434
|
+
'earn/staking/products': 7.5, # 5EW
|
435
|
+
'earn/eth-staking/products': 7.5, # 5EW
|
436
|
+
},
|
437
|
+
'post': {
|
438
|
+
'earn/orders': 7.5, # 5EW
|
439
|
+
},
|
440
|
+
'delete': {
|
441
|
+
'earn/orders': 7.5, # 5EW
|
442
|
+
},
|
443
|
+
},
|
421
444
|
},
|
422
445
|
'timeframes': {
|
423
446
|
'1m': '1min',
|
@@ -4506,6 +4529,8 @@ class kucoin(Exchange, ImplicitAPI):
|
|
4506
4529
|
endpoint = '/api/' + version + '/' + self.implode_params(path, params)
|
4507
4530
|
if api == 'webExchange':
|
4508
4531
|
endpoint = '/' + self.implode_params(path, params)
|
4532
|
+
if api == 'earn':
|
4533
|
+
endpoint = '/api/v1/' + self.implode_params(path, params)
|
4509
4534
|
query = self.omit(params, self.extract_params(path))
|
4510
4535
|
endpart = ''
|
4511
4536
|
headers = headers if (headers is not None) else {}
|
@@ -4521,7 +4546,8 @@ class kucoin(Exchange, ImplicitAPI):
|
|
4521
4546
|
isFuturePrivate = (api == 'futuresPrivate')
|
4522
4547
|
isPrivate = (api == 'private')
|
4523
4548
|
isBroker = (api == 'broker')
|
4524
|
-
|
4549
|
+
isEarn = (api == 'earn')
|
4550
|
+
if isPrivate or isFuturePrivate or isBroker or isEarn:
|
4525
4551
|
self.check_required_credentials()
|
4526
4552
|
timestamp = str(self.nonce())
|
4527
4553
|
headers = self.extend({
|
ccxt/luno.py
CHANGED
@@ -897,7 +897,15 @@ class luno(Exchange, ImplicitAPI):
|
|
897
897
|
request: dict = {
|
898
898
|
'order_id': id,
|
899
899
|
}
|
900
|
-
|
900
|
+
response = self.privatePostStoporder(self.extend(request, params))
|
901
|
+
#
|
902
|
+
# {
|
903
|
+
# "success": True
|
904
|
+
# }
|
905
|
+
#
|
906
|
+
return self.safe_order({
|
907
|
+
'info': response,
|
908
|
+
})
|
901
909
|
|
902
910
|
def fetch_ledger_by_entries(self, code: Str = None, entry=None, limit=None, params={}):
|
903
911
|
# by default without entry number or limit number, return most recent entry
|
ccxt/mexc.py
CHANGED
@@ -235,6 +235,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
235
235
|
'sub-account/margin': 1,
|
236
236
|
'batchOrders': 10,
|
237
237
|
'capital/withdraw/apply': 1,
|
238
|
+
'capital/withdraw': 1,
|
238
239
|
'capital/transfer': 1,
|
239
240
|
'capital/transfer/internal': 1,
|
240
241
|
'capital/deposit/address': 1,
|
@@ -253,6 +254,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
253
254
|
'margin/order': 1,
|
254
255
|
'margin/openOrders': 1,
|
255
256
|
'userDataStream': 1,
|
257
|
+
'capital/withdraw': 1,
|
256
258
|
},
|
257
259
|
},
|
258
260
|
},
|
@@ -1069,7 +1071,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
1069
1071
|
chains = self.safe_value(currency, 'networkList', [])
|
1070
1072
|
for j in range(0, len(chains)):
|
1071
1073
|
chain = chains[j]
|
1072
|
-
networkId = self.
|
1074
|
+
networkId = self.safe_string_2(chain, 'network', 'netWork')
|
1073
1075
|
network = self.network_id_to_code(networkId)
|
1074
1076
|
isDepositEnabled = self.safe_bool(chain, 'depositEnable', False)
|
1075
1077
|
isWithdrawEnabled = self.safe_bool(chain, 'withdrawEnable', False)
|
@@ -4894,7 +4896,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
4894
4896
|
def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
|
4895
4897
|
"""
|
4896
4898
|
make a withdrawal
|
4897
|
-
:see: https://mexcdevelop.github.io/apidocs/spot_v3_en/#withdraw
|
4899
|
+
:see: https://mexcdevelop.github.io/apidocs/spot_v3_en/#withdraw-new
|
4898
4900
|
:param str code: unified currency code
|
4899
4901
|
:param float amount: the amount to withdraw
|
4900
4902
|
:param str address: the address to withdraw to
|
@@ -4904,7 +4906,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
4904
4906
|
"""
|
4905
4907
|
tag, params = self.handle_withdraw_tag_and_params(tag, params)
|
4906
4908
|
networks = self.safe_value(self.options, 'networks', {})
|
4907
|
-
network = self.safe_string_2(params, 'network', '
|
4909
|
+
network = self.safe_string_2(params, 'network', 'netWork') # self line allows the user to specify either ERC20 or ETH
|
4908
4910
|
network = self.safe_string(networks, network, network) # handle ETH > ERC-20 alias
|
4909
4911
|
self.check_address(address)
|
4910
4912
|
self.load_markets()
|
@@ -4917,9 +4919,9 @@ class mexc(Exchange, ImplicitAPI):
|
|
4917
4919
|
if tag is not None:
|
4918
4920
|
request['memo'] = tag
|
4919
4921
|
if network is not None:
|
4920
|
-
request['
|
4921
|
-
params = self.omit(params, ['network', '
|
4922
|
-
response = self.
|
4922
|
+
request['netWork'] = network
|
4923
|
+
params = self.omit(params, ['network', 'netWork'])
|
4924
|
+
response = self.spotPrivatePostCapitalWithdraw(self.extend(request, params))
|
4923
4925
|
#
|
4924
4926
|
# {
|
4925
4927
|
# "id":"7213fea8e94b4a5593d507237e5a555b"
|
ccxt/okx.py
CHANGED
@@ -2385,6 +2385,7 @@ class okx(Exchange, ImplicitAPI):
|
|
2385
2385
|
:see: https://www.okx.com/docs-v5/en/#funding-account-rest-api-get-balance
|
2386
2386
|
:see: https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-balance
|
2387
2387
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2388
|
+
:param str [params.type]: wallet type, ['funding' or 'trading'] default is 'trading'
|
2388
2389
|
:returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
|
2389
2390
|
"""
|
2390
2391
|
self.load_markets()
|