ccxt 4.4.85__py2.py3-none-any.whl → 4.4.87__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 +7 -5
- ccxt/abstract/modetrade.py +119 -0
- ccxt/abstract/myokx.py +2 -0
- ccxt/abstract/okx.py +2 -0
- ccxt/abstract/okxus.py +349 -0
- ccxt/ascendex.py +187 -151
- ccxt/async_support/__init__.py +7 -5
- ccxt/async_support/ascendex.py +187 -151
- ccxt/async_support/base/exchange.py +30 -26
- ccxt/async_support/bequant.py +1 -1
- ccxt/async_support/binance.py +1 -1
- ccxt/async_support/bitget.py +4 -4
- ccxt/async_support/bitmart.py +1 -1
- ccxt/async_support/bitteam.py +31 -0
- ccxt/async_support/{huobijp.py → bittrade.py} +11 -11
- ccxt/async_support/coinbase.py +2 -5
- ccxt/async_support/coinmetro.py +3 -0
- ccxt/async_support/deribit.py +4 -5
- ccxt/async_support/gate.py +91 -73
- ccxt/async_support/hollaex.py +106 -49
- ccxt/async_support/htx.py +30 -51
- ccxt/async_support/hyperliquid.py +36 -20
- ccxt/async_support/kraken.py +5 -8
- ccxt/async_support/mexc.py +2 -2
- ccxt/async_support/modetrade.py +2727 -0
- ccxt/async_support/ndax.py +25 -24
- ccxt/async_support/okcoin.py +12 -29
- ccxt/async_support/okx.py +99 -3
- ccxt/async_support/okxus.py +54 -0
- ccxt/async_support/onetrading.py +10 -7
- ccxt/async_support/oxfun.py +40 -110
- ccxt/async_support/paradex.py +6 -0
- ccxt/async_support/phemex.py +4 -6
- ccxt/async_support/poloniex.py +172 -159
- ccxt/async_support/probit.py +18 -47
- ccxt/async_support/timex.py +5 -10
- ccxt/async_support/vertex.py +3 -4
- ccxt/async_support/whitebit.py +41 -11
- ccxt/async_support/woo.py +101 -75
- ccxt/async_support/woofipro.py +25 -20
- ccxt/async_support/xt.py +31 -41
- ccxt/base/exchange.py +12 -9
- ccxt/bequant.py +1 -1
- ccxt/binance.py +1 -1
- ccxt/bitget.py +4 -4
- ccxt/bitmart.py +1 -1
- ccxt/bitteam.py +31 -0
- ccxt/{huobijp.py → bittrade.py} +11 -11
- ccxt/coinbase.py +2 -5
- ccxt/coinmetro.py +3 -0
- ccxt/deribit.py +4 -5
- ccxt/gate.py +91 -73
- ccxt/hollaex.py +106 -49
- ccxt/htx.py +30 -51
- ccxt/hyperliquid.py +36 -20
- ccxt/kraken.py +5 -8
- ccxt/mexc.py +2 -2
- ccxt/modetrade.py +2727 -0
- ccxt/ndax.py +25 -24
- ccxt/okcoin.py +12 -29
- ccxt/okx.py +99 -3
- ccxt/okxus.py +54 -0
- ccxt/onetrading.py +10 -7
- ccxt/oxfun.py +40 -110
- ccxt/paradex.py +6 -0
- ccxt/phemex.py +4 -6
- ccxt/poloniex.py +172 -159
- ccxt/pro/__init__.py +101 -3
- ccxt/pro/binance.py +1 -0
- ccxt/pro/{huobijp.py → bittrade.py} +3 -3
- ccxt/pro/luno.py +6 -5
- ccxt/pro/mexc.py +2 -0
- ccxt/pro/modetrade.py +1271 -0
- ccxt/pro/okxus.py +38 -0
- ccxt/probit.py +18 -47
- ccxt/test/tests_async.py +17 -1
- ccxt/test/tests_sync.py +17 -1
- ccxt/timex.py +5 -10
- ccxt/vertex.py +3 -4
- ccxt/whitebit.py +41 -11
- ccxt/woo.py +100 -75
- ccxt/woofipro.py +24 -20
- ccxt/xt.py +31 -41
- {ccxt-4.4.85.dist-info → ccxt-4.4.87.dist-info}/METADATA +19 -8
- {ccxt-4.4.85.dist-info → ccxt-4.4.87.dist-info}/RECORD +89 -84
- ccxt/abstract/kuna.py +0 -182
- ccxt/async_support/kuna.py +0 -1935
- ccxt/kuna.py +0 -1935
- /ccxt/abstract/{huobijp.py → bittrade.py} +0 -0
- {ccxt-4.4.85.dist-info → ccxt-4.4.87.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.85.dist-info → ccxt-4.4.87.dist-info}/WHEEL +0 -0
- {ccxt-4.4.85.dist-info → ccxt-4.4.87.dist-info}/top_level.txt +0 -0
ccxt/hollaex.py
CHANGED
@@ -292,6 +292,14 @@ class hollaex(Exchange, ImplicitAPI):
|
|
292
292
|
'BNB': 'bnb',
|
293
293
|
'MATIC': 'matic',
|
294
294
|
},
|
295
|
+
'networksById': {
|
296
|
+
'eth': 'ERC20',
|
297
|
+
'ETH': 'ERC20',
|
298
|
+
'ERC20': 'ERC20',
|
299
|
+
'trx': 'TRC20',
|
300
|
+
'TRX': 'TRC20',
|
301
|
+
'TRC20': 'TRC20',
|
302
|
+
},
|
295
303
|
},
|
296
304
|
})
|
297
305
|
|
@@ -421,66 +429,115 @@ class hollaex(Exchange, ImplicitAPI):
|
|
421
429
|
"""
|
422
430
|
response = self.publicGetConstants(params)
|
423
431
|
#
|
424
|
-
#
|
425
|
-
#
|
426
|
-
#
|
427
|
-
#
|
428
|
-
#
|
429
|
-
#
|
430
|
-
#
|
431
|
-
#
|
432
|
-
#
|
433
|
-
#
|
434
|
-
#
|
435
|
-
#
|
436
|
-
#
|
437
|
-
#
|
438
|
-
#
|
439
|
-
#
|
440
|
-
#
|
441
|
-
#
|
442
|
-
#
|
443
|
-
#
|
444
|
-
#
|
445
|
-
#
|
446
|
-
#
|
447
|
-
#
|
448
|
-
#
|
449
|
-
#
|
450
|
-
#
|
451
|
-
#
|
452
|
-
#
|
453
|
-
#
|
432
|
+
# {
|
433
|
+
# "coins": {
|
434
|
+
# "usdt": {
|
435
|
+
# "id": "6",
|
436
|
+
# "fullname": "USD Tether",
|
437
|
+
# "symbol": "usdt",
|
438
|
+
# "active": True,
|
439
|
+
# "verified": True,
|
440
|
+
# "allow_deposit": True,
|
441
|
+
# "allow_withdrawal": True,
|
442
|
+
# "withdrawal_fee": "20",
|
443
|
+
# "min": "1",
|
444
|
+
# "max": "10000000",
|
445
|
+
# "increment_unit": "0.0001",
|
446
|
+
# "logo": "https://hollaex-resources.s3.ap-southeast-1.amazonaws.com/icons/usdt.svg",
|
447
|
+
# "code": "usdt",
|
448
|
+
# "is_public": True,
|
449
|
+
# "meta": {
|
450
|
+
# "color": "#27a17a",
|
451
|
+
# "website": "https://tether.to",
|
452
|
+
# "explorer": "https://blockchair.com/tether",
|
453
|
+
# "decimal_points": "6"
|
454
|
+
# },
|
455
|
+
# "estimated_price": "1",
|
456
|
+
# "description": "<p>Tether(USDT) is a stablecoin pegged 1:1 to the US dollar. It is a digital currency that aims to maintain its value while allowing for fast and secure transfer of funds. It was the first stablecoin, and is the most widely used due stablecoin due to its stability and low volatility compared to other cryptocurrencies. It was launched in 2014 by Tether Limited.</p>",
|
457
|
+
# "type": "blockchain",
|
458
|
+
# "network": "eth,trx,bnb,matic",
|
459
|
+
# "standard": "",
|
460
|
+
# "issuer": "HollaEx",
|
461
|
+
# "withdrawal_fees": {
|
462
|
+
# "bnb": {
|
463
|
+
# "value": "0.8",
|
464
|
+
# "active": True,
|
465
|
+
# "symbol": "usdt"
|
466
|
+
# },
|
467
|
+
# "eth": {
|
468
|
+
# "value": "1.5",
|
469
|
+
# "active": True,
|
470
|
+
# "symbol": "usdt"
|
471
|
+
# },
|
472
|
+
# "trx": {
|
473
|
+
# "value": "4",
|
474
|
+
# "active": True,
|
475
|
+
# "symbol": "usdt"
|
476
|
+
# },
|
477
|
+
# "matic": {
|
478
|
+
# "value": "0.3",
|
479
|
+
# "active": True,
|
480
|
+
# "symbol": "usdt"
|
481
|
+
# }
|
482
|
+
# },
|
483
|
+
# "display_name": null,
|
484
|
+
# "deposit_fees": null,
|
485
|
+
# "is_risky": False,
|
486
|
+
# "market_cap": "144568098696.29",
|
487
|
+
# "category": "stable",
|
488
|
+
# "created_at": "2019-08-09T10:45:43.367Z",
|
489
|
+
# "updated_at": "2025-03-25T17:12:37.970Z",
|
490
|
+
# "created_by": "168",
|
491
|
+
# "owner_id": "1"
|
492
|
+
# },
|
454
493
|
# },
|
455
494
|
# "network":"https://api.hollaex.network"
|
456
495
|
# }
|
457
496
|
#
|
458
|
-
coins = self.
|
497
|
+
coins = self.safe_dict(response, 'coins', {})
|
459
498
|
keys = list(coins.keys())
|
460
499
|
result: dict = {}
|
461
500
|
for i in range(0, len(keys)):
|
462
501
|
key = keys[i]
|
463
502
|
currency = coins[key]
|
464
503
|
id = self.safe_string(currency, 'symbol')
|
465
|
-
numericId = self.safe_integer(currency, 'id')
|
466
504
|
code = self.safe_currency_code(id)
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
505
|
+
withdrawalLimits = self.safe_list(currency, 'withdrawal_limits', [])
|
506
|
+
rawType = self.safe_string(currency, 'type')
|
507
|
+
type = 'crypto' if (rawType == 'blockchain') else 'other'
|
508
|
+
rawNetworks = self.safe_dict(currency, 'withdrawal_fees', {})
|
509
|
+
networks = {}
|
510
|
+
networkIds = list(rawNetworks.keys())
|
511
|
+
for j in range(0, len(networkIds)):
|
512
|
+
networkId = networkIds[j]
|
513
|
+
networkEntry = self.safe_dict(rawNetworks, networkId)
|
514
|
+
networkCode = self.network_id_to_code(networkId)
|
515
|
+
networks[networkCode] = {
|
516
|
+
'id': networkId,
|
517
|
+
'network': networkCode,
|
518
|
+
'active': self.safe_bool(networkEntry, 'active'),
|
519
|
+
'deposit': None,
|
520
|
+
'withdraw': None,
|
521
|
+
'fee': self.safe_number(networkEntry, 'value'),
|
522
|
+
'precision': None,
|
523
|
+
'limits': {
|
524
|
+
'withdraw': {
|
525
|
+
'min': None,
|
526
|
+
'max': None,
|
527
|
+
},
|
528
|
+
},
|
529
|
+
'info': networkEntry,
|
530
|
+
}
|
531
|
+
result[code] = self.safe_currency_structure({
|
475
532
|
'id': id,
|
476
|
-
'numericId':
|
533
|
+
'numericId': self.safe_integer(currency, 'id'),
|
477
534
|
'code': code,
|
478
535
|
'info': currency,
|
479
|
-
'name':
|
480
|
-
'active': active,
|
481
|
-
'deposit':
|
482
|
-
'withdraw':
|
483
|
-
'fee':
|
536
|
+
'name': self.safe_string(currency, 'fullname'),
|
537
|
+
'active': self.safe_bool(currency, 'active'),
|
538
|
+
'deposit': self.safe_bool(currency, 'allow_deposit'),
|
539
|
+
'withdraw': self.safe_bool(currency, 'allow_withdrawal'),
|
540
|
+
'fee': self.safe_number(currency, 'withdrawal_fee'),
|
484
541
|
'precision': self.safe_number(currency, 'increment_unit'),
|
485
542
|
'limits': {
|
486
543
|
'amount': {
|
@@ -492,9 +549,9 @@ class hollaex(Exchange, ImplicitAPI):
|
|
492
549
|
'max': self.safe_value(withdrawalLimits, 0),
|
493
550
|
},
|
494
551
|
},
|
495
|
-
'networks':
|
496
|
-
'type':
|
497
|
-
}
|
552
|
+
'networks': networks,
|
553
|
+
'type': type,
|
554
|
+
})
|
498
555
|
return result
|
499
556
|
|
500
557
|
def fetch_order_books(self, symbols: Strings = None, limit: Int = None, params={}) -> OrderBooks:
|
ccxt/htx.py
CHANGED
@@ -3280,9 +3280,8 @@ class htx(Exchange, ImplicitAPI):
|
|
3280
3280
|
# }
|
3281
3281
|
# ]
|
3282
3282
|
# }
|
3283
|
-
# }
|
3284
3283
|
#
|
3285
|
-
data = self.
|
3284
|
+
data = self.safe_list(response, 'data', [])
|
3286
3285
|
result: dict = {}
|
3287
3286
|
self.options['networkChainIdsByNames'] = {}
|
3288
3287
|
self.options['networkNamesByChainIds'] = {}
|
@@ -3290,19 +3289,11 @@ class htx(Exchange, ImplicitAPI):
|
|
3290
3289
|
entry = data[i]
|
3291
3290
|
currencyId = self.safe_string(entry, 'currency')
|
3292
3291
|
code = self.safe_currency_code(currencyId)
|
3293
|
-
self.options['networkChainIdsByNames'][code] = {}
|
3294
|
-
chains = self.safe_value(entry, 'chains', [])
|
3295
|
-
networks: dict = {}
|
3296
|
-
instStatus = self.safe_string(entry, 'instStatus')
|
3297
3292
|
assetType = self.safe_string(entry, 'assetType')
|
3298
3293
|
type = assetType == 'crypto' if '1' else 'fiat'
|
3299
|
-
|
3300
|
-
|
3301
|
-
|
3302
|
-
minWithdraw = None
|
3303
|
-
maxWithdraw = None
|
3304
|
-
deposit = False
|
3305
|
-
withdraw = False
|
3294
|
+
self.options['networkChainIdsByNames'][code] = {}
|
3295
|
+
chains = self.safe_list(entry, 'chains', [])
|
3296
|
+
networks: dict = {}
|
3306
3297
|
for j in range(0, len(chains)):
|
3307
3298
|
chainEntry = chains[j]
|
3308
3299
|
uniqueChainId = self.safe_string(chainEntry, 'chain') # i.e. usdterc20, trc20usdt ...
|
@@ -3310,47 +3301,33 @@ class htx(Exchange, ImplicitAPI):
|
|
3310
3301
|
self.options['networkChainIdsByNames'][code][title] = uniqueChainId
|
3311
3302
|
self.options['networkNamesByChainIds'][uniqueChainId] = title
|
3312
3303
|
networkCode = self.network_id_to_code(uniqueChainId)
|
3313
|
-
minDeposit = self.safe_number(chainEntry, 'minDepositAmt')
|
3314
|
-
minWithdraw = self.safe_number(chainEntry, 'minWithdrawAmt')
|
3315
|
-
maxWithdraw = self.safe_number(chainEntry, 'maxWithdrawAmt')
|
3316
|
-
withdrawStatus = self.safe_string(chainEntry, 'withdrawStatus')
|
3317
|
-
depositStatus = self.safe_string(chainEntry, 'depositStatus')
|
3318
|
-
withdrawEnabled = (withdrawStatus == 'allowed')
|
3319
|
-
depositEnabled = (depositStatus == 'allowed')
|
3320
|
-
withdraw = withdrawEnabled if (withdrawEnabled) else withdraw
|
3321
|
-
deposit = depositEnabled if (depositEnabled) else deposit
|
3322
|
-
active = withdrawEnabled and depositEnabled
|
3323
|
-
precision = self.parse_precision(self.safe_string(chainEntry, 'withdrawPrecision'))
|
3324
|
-
if precision is not None:
|
3325
|
-
minPrecision = precision if (minPrecision is None) else Precise.string_min(precision, minPrecision)
|
3326
|
-
fee = self.safe_number(chainEntry, 'transactFeeWithdraw')
|
3327
3304
|
networks[networkCode] = {
|
3328
3305
|
'info': chainEntry,
|
3329
3306
|
'id': uniqueChainId,
|
3330
3307
|
'network': networkCode,
|
3331
3308
|
'limits': {
|
3332
3309
|
'deposit': {
|
3333
|
-
'min':
|
3310
|
+
'min': self.safe_number(chainEntry, 'minDepositAmt'),
|
3334
3311
|
'max': None,
|
3335
3312
|
},
|
3336
3313
|
'withdraw': {
|
3337
|
-
'min':
|
3338
|
-
'max':
|
3314
|
+
'min': self.safe_number(chainEntry, 'minWithdrawAmt'),
|
3315
|
+
'max': self.safe_number(chainEntry, 'maxWithdrawAmt'),
|
3339
3316
|
},
|
3340
3317
|
},
|
3341
|
-
'active':
|
3342
|
-
'deposit':
|
3343
|
-
'withdraw':
|
3344
|
-
'fee':
|
3345
|
-
'precision': self.parse_number(
|
3318
|
+
'active': None,
|
3319
|
+
'deposit': self.safe_string(chainEntry, 'depositStatus') == 'allowed',
|
3320
|
+
'withdraw': self.safe_string(chainEntry, 'withdrawStatus') == 'allowed',
|
3321
|
+
'fee': self.safe_number(chainEntry, 'transactFeeWithdraw'),
|
3322
|
+
'precision': self.parse_number(self.parse_precision(self.safe_string(chainEntry, 'withdrawPrecision'))),
|
3346
3323
|
}
|
3347
|
-
result[code] = {
|
3324
|
+
result[code] = self.safe_currency_structure({
|
3348
3325
|
'info': entry,
|
3349
3326
|
'code': code,
|
3350
3327
|
'id': currencyId,
|
3351
|
-
'active':
|
3352
|
-
'deposit':
|
3353
|
-
'withdraw':
|
3328
|
+
'active': self.safe_string(entry, 'instStatus') == 'normal',
|
3329
|
+
'deposit': None,
|
3330
|
+
'withdraw': None,
|
3354
3331
|
'fee': None,
|
3355
3332
|
'name': None,
|
3356
3333
|
'type': type,
|
@@ -3360,17 +3337,17 @@ class htx(Exchange, ImplicitAPI):
|
|
3360
3337
|
'max': None,
|
3361
3338
|
},
|
3362
3339
|
'withdraw': {
|
3363
|
-
'min':
|
3364
|
-
'max':
|
3340
|
+
'min': None,
|
3341
|
+
'max': None,
|
3365
3342
|
},
|
3366
3343
|
'deposit': {
|
3367
3344
|
'min': None,
|
3368
3345
|
'max': None,
|
3369
3346
|
},
|
3370
3347
|
},
|
3371
|
-
'precision':
|
3348
|
+
'precision': None,
|
3372
3349
|
'networks': networks,
|
3373
|
-
}
|
3350
|
+
})
|
3374
3351
|
return result
|
3375
3352
|
|
3376
3353
|
def network_id_to_code(self, networkId: Str = None, currencyCode: Str = None):
|
@@ -4309,6 +4286,8 @@ class htx(Exchange, ImplicitAPI):
|
|
4309
4286
|
request: dict = {}
|
4310
4287
|
marketType = None
|
4311
4288
|
marketType, params = self.handle_market_type_and_params('fetchOpenOrders', market, params)
|
4289
|
+
subType = None
|
4290
|
+
subType, params = self.handle_sub_type_and_params('fetchOpenOrders', market, params, 'linear')
|
4312
4291
|
response = None
|
4313
4292
|
if marketType == 'spot':
|
4314
4293
|
if symbol is not None:
|
@@ -4330,16 +4309,16 @@ class htx(Exchange, ImplicitAPI):
|
|
4330
4309
|
params = self.omit(params, 'account-id')
|
4331
4310
|
response = self.spotPrivateGetV1OrderOpenOrders(self.extend(request, params))
|
4332
4311
|
else:
|
4333
|
-
if symbol is None:
|
4334
|
-
raise ArgumentsRequired(self.id + ' fetchOpenOrders() requires a symbol argument')
|
4312
|
+
if symbol is not None:
|
4313
|
+
# raise ArgumentsRequired(self.id + ' fetchOpenOrders() requires a symbol argument')
|
4314
|
+
request['contract_code'] = market['id']
|
4335
4315
|
if limit is not None:
|
4336
4316
|
request['page_size'] = limit
|
4337
|
-
request['contract_code'] = market['id']
|
4338
4317
|
trigger = self.safe_bool_2(params, 'stop', 'trigger')
|
4339
4318
|
stopLossTakeProfit = self.safe_value(params, 'stopLossTakeProfit')
|
4340
4319
|
trailing = self.safe_bool(params, 'trailing', False)
|
4341
4320
|
params = self.omit(params, ['stop', 'stopLossTakeProfit', 'trailing', 'trigger'])
|
4342
|
-
if
|
4321
|
+
if subType == 'linear':
|
4343
4322
|
marginMode = None
|
4344
4323
|
marginMode, params = self.handle_margin_mode_and_params('fetchOpenOrders', params)
|
4345
4324
|
marginMode = 'cross' if (marginMode is None) else marginMode
|
@@ -4361,8 +4340,8 @@ class htx(Exchange, ImplicitAPI):
|
|
4361
4340
|
response = self.contractPrivatePostLinearSwapApiV1SwapCrossTrackOpenorders(self.extend(request, params))
|
4362
4341
|
else:
|
4363
4342
|
response = self.contractPrivatePostLinearSwapApiV1SwapCrossOpenorders(self.extend(request, params))
|
4364
|
-
elif
|
4365
|
-
if
|
4343
|
+
elif subType == 'inverse':
|
4344
|
+
if marketType == 'swap':
|
4366
4345
|
if trigger:
|
4367
4346
|
response = self.contractPrivatePostSwapApiV1SwapTriggerOpenorders(self.extend(request, params))
|
4368
4347
|
elif stopLossTakeProfit:
|
@@ -4371,8 +4350,8 @@ class htx(Exchange, ImplicitAPI):
|
|
4371
4350
|
response = self.contractPrivatePostSwapApiV1SwapTrackOpenorders(self.extend(request, params))
|
4372
4351
|
else:
|
4373
4352
|
response = self.contractPrivatePostSwapApiV1SwapOpenorders(self.extend(request, params))
|
4374
|
-
elif
|
4375
|
-
request['symbol'] = market
|
4353
|
+
elif marketType == 'future':
|
4354
|
+
request['symbol'] = self.safe_string(market, 'settleId', 'usdt')
|
4376
4355
|
if trigger:
|
4377
4356
|
response = self.contractPrivatePostApiV1ContractTriggerOpenorders(self.extend(request, params))
|
4378
4357
|
elif stopLossTakeProfit:
|
ccxt/hyperliquid.py
CHANGED
@@ -184,12 +184,12 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
184
184
|
},
|
185
185
|
'fees': {
|
186
186
|
'swap': {
|
187
|
-
'taker': self.parse_number('0.
|
188
|
-
'maker': self.parse_number('0.
|
187
|
+
'taker': self.parse_number('0.00045'),
|
188
|
+
'maker': self.parse_number('0.00015'),
|
189
189
|
},
|
190
190
|
'spot': {
|
191
|
-
'taker': self.parse_number('0.
|
192
|
-
'maker': self.parse_number('0.
|
191
|
+
'taker': self.parse_number('0.0007'),
|
192
|
+
'maker': self.parse_number('0.0004'),
|
193
193
|
},
|
194
194
|
},
|
195
195
|
'requiredCredentials': {
|
@@ -1494,7 +1494,9 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1494
1494
|
if clientOrderId is not None:
|
1495
1495
|
orderObj['c'] = clientOrderId
|
1496
1496
|
orderReq.append(orderObj)
|
1497
|
-
vaultAddress =
|
1497
|
+
vaultAddress = None
|
1498
|
+
vaultAddress, params = self.handle_option_and_params(params, 'createOrder', 'vaultAddress')
|
1499
|
+
vaultAddress = self.format_vault_address(vaultAddress)
|
1498
1500
|
orderAction: dict = {
|
1499
1501
|
'type': 'order',
|
1500
1502
|
'orders': orderReq,
|
@@ -1581,7 +1583,9 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1581
1583
|
'o': self.parse_to_numeric(ids[i]),
|
1582
1584
|
})
|
1583
1585
|
cancelAction['cancels'] = cancelReq
|
1584
|
-
vaultAddress =
|
1586
|
+
vaultAddress = None
|
1587
|
+
vaultAddress, params = self.handle_option_and_params(params, 'cancelOrders', 'vaultAddress')
|
1588
|
+
vaultAddress = self.format_vault_address(vaultAddress)
|
1585
1589
|
signature = self.sign_l1_action(cancelAction, nonce, vaultAddress)
|
1586
1590
|
request['action'] = cancelAction
|
1587
1591
|
request['signature'] = signature
|
@@ -1659,7 +1663,9 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1659
1663
|
cancelReq.append(cancelObj)
|
1660
1664
|
cancelAction['type'] = 'cancelByCloid' if cancelByCloid else 'cancel'
|
1661
1665
|
cancelAction['cancels'] = cancelReq
|
1662
|
-
vaultAddress =
|
1666
|
+
vaultAddress = None
|
1667
|
+
vaultAddress, params = self.handle_option_and_params(params, 'cancelOrdersForSymbols', 'vaultAddress')
|
1668
|
+
vaultAddress = self.format_vault_address(vaultAddress)
|
1663
1669
|
signature = self.sign_l1_action(cancelAction, nonce, vaultAddress)
|
1664
1670
|
request['action'] = cancelAction
|
1665
1671
|
request['signature'] = signature
|
@@ -1702,7 +1708,9 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1702
1708
|
'type': 'scheduleCancel',
|
1703
1709
|
'time': nonce + timeout,
|
1704
1710
|
}
|
1705
|
-
vaultAddress =
|
1711
|
+
vaultAddress = None
|
1712
|
+
vaultAddress, params = self.handle_option_and_params(params, 'cancelAllOrdersAfter', 'vaultAddress')
|
1713
|
+
vaultAddress = self.format_vault_address(vaultAddress)
|
1706
1714
|
signature = self.sign_l1_action(cancelAction, nonce, vaultAddress)
|
1707
1715
|
request['action'] = cancelAction
|
1708
1716
|
request['signature'] = signature
|
@@ -1811,7 +1819,9 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1811
1819
|
'type': 'batchModify',
|
1812
1820
|
'modifies': modifies,
|
1813
1821
|
}
|
1814
|
-
vaultAddress =
|
1822
|
+
vaultAddress = None
|
1823
|
+
vaultAddress, params = self.handle_option_and_params(params, 'editOrder', 'vaultAddress')
|
1824
|
+
vaultAddress = self.format_vault_address(vaultAddress)
|
1815
1825
|
signature = self.sign_l1_action(modifyAction, nonce, vaultAddress)
|
1816
1826
|
request: dict = {
|
1817
1827
|
'action': modifyAction,
|
@@ -1820,7 +1830,6 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1820
1830
|
# 'vaultAddress': vaultAddress,
|
1821
1831
|
}
|
1822
1832
|
if vaultAddress is not None:
|
1823
|
-
params = self.omit(params, 'vaultAddress')
|
1824
1833
|
request['vaultAddress'] = vaultAddress
|
1825
1834
|
return request
|
1826
1835
|
|
@@ -2638,9 +2647,9 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2638
2647
|
'isCross': isCross,
|
2639
2648
|
'leverage': leverage,
|
2640
2649
|
}
|
2641
|
-
vaultAddress =
|
2650
|
+
vaultAddress = None
|
2651
|
+
vaultAddress, params = self.handle_option_and_params(params, 'setMarginMode', 'vaultAddress')
|
2642
2652
|
if vaultAddress is not None:
|
2643
|
-
params = self.omit(params, 'vaultAddress')
|
2644
2653
|
if vaultAddress.startswith('0x'):
|
2645
2654
|
vaultAddress = vaultAddress.replace('0x', '')
|
2646
2655
|
signature = self.sign_l1_action(updateAction, nonce, vaultAddress)
|
@@ -2687,7 +2696,9 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2687
2696
|
'isCross': isCross,
|
2688
2697
|
'leverage': leverage,
|
2689
2698
|
}
|
2690
|
-
vaultAddress =
|
2699
|
+
vaultAddress = None
|
2700
|
+
vaultAddress, params = self.handle_option_and_params(params, 'setLeverage', 'vaultAddress')
|
2701
|
+
vaultAddress = self.format_vault_address(vaultAddress)
|
2691
2702
|
signature = self.sign_l1_action(updateAction, nonce, vaultAddress)
|
2692
2703
|
request: dict = {
|
2693
2704
|
'action': updateAction,
|
@@ -2749,7 +2760,9 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2749
2760
|
'isBuy': True,
|
2750
2761
|
'ntli': sz,
|
2751
2762
|
}
|
2752
|
-
vaultAddress =
|
2763
|
+
vaultAddress = None
|
2764
|
+
vaultAddress, params = self.handle_option_and_params(params, 'modifyMargin', 'vaultAddress')
|
2765
|
+
vaultAddress = self.format_vault_address(vaultAddress)
|
2753
2766
|
signature = self.sign_l1_action(updateAction, nonce, vaultAddress)
|
2754
2767
|
request: dict = {
|
2755
2768
|
'action': updateAction,
|
@@ -2758,7 +2771,6 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2758
2771
|
# 'vaultAddress': vaultAddress,
|
2759
2772
|
}
|
2760
2773
|
if vaultAddress is not None:
|
2761
|
-
params = self.omit(params, 'vaultAddress')
|
2762
2774
|
request['vaultAddress'] = vaultAddress
|
2763
2775
|
response = self.privatePostExchange(request)
|
2764
2776
|
#
|
@@ -2815,8 +2827,9 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2815
2827
|
if not self.in_array(toAccount, ['spot', 'swap', 'perp']):
|
2816
2828
|
raise NotSupported(self.id + ' transfer() only support spot <> swap transfer')
|
2817
2829
|
strAmount = self.number_to_string(amount)
|
2818
|
-
vaultAddress =
|
2819
|
-
params = self.
|
2830
|
+
vaultAddress = None
|
2831
|
+
vaultAddress, params = self.handle_option_and_params(params, 'transfer', 'vaultAddress')
|
2832
|
+
vaultAddress = self.format_vault_address(vaultAddress)
|
2820
2833
|
if vaultAddress is not None:
|
2821
2834
|
strAmount = strAmount + ' subaccount:' + vaultAddress
|
2822
2835
|
toPerp = (toAccount == 'perp') or (toAccount == 'swap')
|
@@ -2912,7 +2925,9 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2912
2925
|
code = code.upper()
|
2913
2926
|
if code != 'USDC':
|
2914
2927
|
raise NotSupported(self.id + ' withdraw() only support USDC')
|
2915
|
-
vaultAddress =
|
2928
|
+
vaultAddress = None
|
2929
|
+
vaultAddress, params = self.handle_option_and_params(params, 'withdraw', 'vaultAddress')
|
2930
|
+
vaultAddress = self.format_vault_address(vaultAddress)
|
2916
2931
|
params = self.omit(params, 'vaultAddress')
|
2917
2932
|
nonce = self.milliseconds()
|
2918
2933
|
action: dict = {}
|
@@ -3494,8 +3509,9 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
3494
3509
|
|
3495
3510
|
def parse_create_edit_order_args(self, id: Str, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
3496
3511
|
market = self.market(symbol)
|
3497
|
-
vaultAddress =
|
3498
|
-
params = self.
|
3512
|
+
vaultAddress = None
|
3513
|
+
vaultAddress, params = self.handle_option_and_params(params, 'createOrder', 'vaultAddress')
|
3514
|
+
vaultAddress = self.format_vault_address(vaultAddress)
|
3499
3515
|
symbol = market['symbol']
|
3500
3516
|
order = {
|
3501
3517
|
'symbol': symbol,
|
ccxt/kraken.py
CHANGED
@@ -861,24 +861,21 @@ class kraken(Exchange, ImplicitAPI):
|
|
861
861
|
self.commonCurrencies[id] = code
|
862
862
|
else:
|
863
863
|
code = self.safe_currency_code(id)
|
864
|
-
precision = self.parse_number(self.parse_precision(self.safe_string(currency, 'decimals')))
|
865
|
-
# assumes all currencies are active except those listed above
|
866
|
-
active = self.safe_string(currency, 'status') == 'enabled'
|
867
864
|
isFiat = code.find('.HOLD') >= 0
|
868
|
-
result[code] = {
|
865
|
+
result[code] = self.safe_currency_structure({
|
869
866
|
'id': id,
|
870
867
|
'code': code,
|
871
868
|
'info': currency,
|
872
869
|
'name': self.safe_string(currency, 'altname'),
|
873
|
-
'active':
|
870
|
+
'active': self.safe_string(currency, 'status') == 'enabled',
|
874
871
|
'type': 'fiat' if isFiat else 'crypto',
|
875
872
|
'deposit': None,
|
876
873
|
'withdraw': None,
|
877
874
|
'fee': None,
|
878
|
-
'precision':
|
875
|
+
'precision': self.parse_number(self.parse_precision(self.safe_string(currency, 'decimals'))),
|
879
876
|
'limits': {
|
880
877
|
'amount': {
|
881
|
-
'min':
|
878
|
+
'min': None,
|
882
879
|
'max': None,
|
883
880
|
},
|
884
881
|
'withdraw': {
|
@@ -887,7 +884,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
887
884
|
},
|
888
885
|
},
|
889
886
|
'networks': {},
|
890
|
-
}
|
887
|
+
})
|
891
888
|
return result
|
892
889
|
|
893
890
|
def safe_currency_code(self, currencyId: Str, currency: Currency = None) -> Str:
|
ccxt/mexc.py
CHANGED
@@ -1096,7 +1096,6 @@ class mexc(Exchange, ImplicitAPI):
|
|
1096
1096
|
currency = response[i]
|
1097
1097
|
id = self.safe_string(currency, 'coin')
|
1098
1098
|
code = self.safe_currency_code(id)
|
1099
|
-
name = self.safe_string(currency, 'name')
|
1100
1099
|
networks: dict = {}
|
1101
1100
|
chains = self.safe_value(currency, 'networkList', [])
|
1102
1101
|
for j in range(0, len(chains)):
|
@@ -1118,12 +1117,13 @@ class mexc(Exchange, ImplicitAPI):
|
|
1118
1117
|
'max': self.safe_string(chain, 'withdrawMax'),
|
1119
1118
|
},
|
1120
1119
|
},
|
1120
|
+
'contract': self.safe_string(chain, 'contract'),
|
1121
1121
|
}
|
1122
1122
|
result[code] = self.safe_currency_structure({
|
1123
1123
|
'info': currency,
|
1124
1124
|
'id': id,
|
1125
1125
|
'code': code,
|
1126
|
-
'name': name,
|
1126
|
+
'name': self.safe_string(currency, 'name'),
|
1127
1127
|
'active': None,
|
1128
1128
|
'deposit': None,
|
1129
1129
|
'withdraw': None,
|