ccxt 4.4.85__py2.py3-none-any.whl → 4.4.86__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 -5
- ccxt/abstract/myokx.py +2 -0
- ccxt/abstract/okx.py +2 -0
- ccxt/ascendex.py +187 -151
- ccxt/async_support/__init__.py +3 -5
- ccxt/async_support/ascendex.py +187 -151
- ccxt/async_support/base/exchange.py +26 -22
- ccxt/async_support/bequant.py +1 -1
- ccxt/async_support/bitget.py +4 -4
- ccxt/async_support/bitmart.py +1 -1
- ccxt/async_support/{huobijp.py → bittrade.py} +11 -11
- ccxt/async_support/coinbase.py +2 -5
- ccxt/async_support/deribit.py +4 -5
- ccxt/async_support/hollaex.py +106 -49
- ccxt/async_support/htx.py +20 -43
- ccxt/async_support/hyperliquid.py +4 -4
- ccxt/async_support/mexc.py +2 -2
- ccxt/async_support/ndax.py +25 -24
- ccxt/async_support/okcoin.py +12 -29
- ccxt/async_support/okx.py +9 -0
- ccxt/async_support/onetrading.py +10 -7
- ccxt/async_support/oxfun.py +40 -110
- ccxt/async_support/paradex.py +3 -0
- ccxt/base/exchange.py +1 -1
- ccxt/bequant.py +1 -1
- ccxt/bitget.py +4 -4
- ccxt/bitmart.py +1 -1
- ccxt/{huobijp.py → bittrade.py} +11 -11
- ccxt/coinbase.py +2 -5
- ccxt/deribit.py +4 -5
- ccxt/hollaex.py +106 -49
- ccxt/htx.py +20 -43
- ccxt/hyperliquid.py +4 -4
- ccxt/mexc.py +2 -2
- ccxt/ndax.py +25 -24
- ccxt/okcoin.py +12 -29
- ccxt/okx.py +9 -0
- ccxt/onetrading.py +10 -7
- ccxt/oxfun.py +40 -110
- ccxt/paradex.py +3 -0
- ccxt/pro/__init__.py +41 -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-4.4.85.dist-info → ccxt-4.4.86.dist-info}/METADATA +7 -8
- {ccxt-4.4.85.dist-info → ccxt-4.4.86.dist-info}/RECORD +51 -54
- 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.86.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.85.dist-info → ccxt-4.4.86.dist-info}/WHEEL +0 -0
- {ccxt-4.4.85.dist-info → ccxt-4.4.86.dist-info}/top_level.txt +0 -0
ccxt/async_support/deribit.py
CHANGED
@@ -640,18 +640,17 @@ class deribit(Exchange, ImplicitAPI):
|
|
640
640
|
# "testnet": True
|
641
641
|
# }
|
642
642
|
#
|
643
|
-
data = self.
|
643
|
+
data = self.safe_list(response, 'result', [])
|
644
644
|
result: dict = {}
|
645
645
|
for i in range(0, len(data)):
|
646
646
|
currency = data[i]
|
647
647
|
currencyId = self.safe_string(currency, 'currency')
|
648
648
|
code = self.safe_currency_code(currencyId)
|
649
|
-
|
650
|
-
result[code] = {
|
649
|
+
result[code] = self.safe_currency_structure({
|
651
650
|
'info': currency,
|
652
651
|
'code': code,
|
653
652
|
'id': currencyId,
|
654
|
-
'name':
|
653
|
+
'name': self.safe_string(currency, 'currency_long'),
|
655
654
|
'active': None,
|
656
655
|
'deposit': None,
|
657
656
|
'withdraw': None,
|
@@ -673,7 +672,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
673
672
|
},
|
674
673
|
},
|
675
674
|
'networks': None,
|
676
|
-
}
|
675
|
+
})
|
677
676
|
return result
|
678
677
|
|
679
678
|
def code_from_options(self, methodName, params={}):
|
ccxt/async_support/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 = await 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
|
async def fetch_order_books(self, symbols: Strings = None, limit: Int = None, params={}) -> OrderBooks:
|
ccxt/async_support/htx.py
CHANGED
@@ -3281,9 +3281,8 @@ class htx(Exchange, ImplicitAPI):
|
|
3281
3281
|
# }
|
3282
3282
|
# ]
|
3283
3283
|
# }
|
3284
|
-
# }
|
3285
3284
|
#
|
3286
|
-
data = self.
|
3285
|
+
data = self.safe_list(response, 'data', [])
|
3287
3286
|
result: dict = {}
|
3288
3287
|
self.options['networkChainIdsByNames'] = {}
|
3289
3288
|
self.options['networkNamesByChainIds'] = {}
|
@@ -3291,19 +3290,11 @@ class htx(Exchange, ImplicitAPI):
|
|
3291
3290
|
entry = data[i]
|
3292
3291
|
currencyId = self.safe_string(entry, 'currency')
|
3293
3292
|
code = self.safe_currency_code(currencyId)
|
3294
|
-
self.options['networkChainIdsByNames'][code] = {}
|
3295
|
-
chains = self.safe_value(entry, 'chains', [])
|
3296
|
-
networks: dict = {}
|
3297
|
-
instStatus = self.safe_string(entry, 'instStatus')
|
3298
3293
|
assetType = self.safe_string(entry, 'assetType')
|
3299
3294
|
type = assetType == 'crypto' if '1' else 'fiat'
|
3300
|
-
|
3301
|
-
|
3302
|
-
|
3303
|
-
minWithdraw = None
|
3304
|
-
maxWithdraw = None
|
3305
|
-
deposit = False
|
3306
|
-
withdraw = False
|
3295
|
+
self.options['networkChainIdsByNames'][code] = {}
|
3296
|
+
chains = self.safe_list(entry, 'chains', [])
|
3297
|
+
networks: dict = {}
|
3307
3298
|
for j in range(0, len(chains)):
|
3308
3299
|
chainEntry = chains[j]
|
3309
3300
|
uniqueChainId = self.safe_string(chainEntry, 'chain') # i.e. usdterc20, trc20usdt ...
|
@@ -3311,47 +3302,33 @@ class htx(Exchange, ImplicitAPI):
|
|
3311
3302
|
self.options['networkChainIdsByNames'][code][title] = uniqueChainId
|
3312
3303
|
self.options['networkNamesByChainIds'][uniqueChainId] = title
|
3313
3304
|
networkCode = self.network_id_to_code(uniqueChainId)
|
3314
|
-
minDeposit = self.safe_number(chainEntry, 'minDepositAmt')
|
3315
|
-
minWithdraw = self.safe_number(chainEntry, 'minWithdrawAmt')
|
3316
|
-
maxWithdraw = self.safe_number(chainEntry, 'maxWithdrawAmt')
|
3317
|
-
withdrawStatus = self.safe_string(chainEntry, 'withdrawStatus')
|
3318
|
-
depositStatus = self.safe_string(chainEntry, 'depositStatus')
|
3319
|
-
withdrawEnabled = (withdrawStatus == 'allowed')
|
3320
|
-
depositEnabled = (depositStatus == 'allowed')
|
3321
|
-
withdraw = withdrawEnabled if (withdrawEnabled) else withdraw
|
3322
|
-
deposit = depositEnabled if (depositEnabled) else deposit
|
3323
|
-
active = withdrawEnabled and depositEnabled
|
3324
|
-
precision = self.parse_precision(self.safe_string(chainEntry, 'withdrawPrecision'))
|
3325
|
-
if precision is not None:
|
3326
|
-
minPrecision = precision if (minPrecision is None) else Precise.string_min(precision, minPrecision)
|
3327
|
-
fee = self.safe_number(chainEntry, 'transactFeeWithdraw')
|
3328
3305
|
networks[networkCode] = {
|
3329
3306
|
'info': chainEntry,
|
3330
3307
|
'id': uniqueChainId,
|
3331
3308
|
'network': networkCode,
|
3332
3309
|
'limits': {
|
3333
3310
|
'deposit': {
|
3334
|
-
'min':
|
3311
|
+
'min': self.safe_number(chainEntry, 'minDepositAmt'),
|
3335
3312
|
'max': None,
|
3336
3313
|
},
|
3337
3314
|
'withdraw': {
|
3338
|
-
'min':
|
3339
|
-
'max':
|
3315
|
+
'min': self.safe_number(chainEntry, 'minWithdrawAmt'),
|
3316
|
+
'max': self.safe_number(chainEntry, 'maxWithdrawAmt'),
|
3340
3317
|
},
|
3341
3318
|
},
|
3342
|
-
'active':
|
3343
|
-
'deposit':
|
3344
|
-
'withdraw':
|
3345
|
-
'fee':
|
3346
|
-
'precision': self.parse_number(
|
3319
|
+
'active': None,
|
3320
|
+
'deposit': self.safe_string(chainEntry, 'depositStatus') == 'allowed',
|
3321
|
+
'withdraw': self.safe_string(chainEntry, 'withdrawStatus') == 'allowed',
|
3322
|
+
'fee': self.safe_number(chainEntry, 'transactFeeWithdraw'),
|
3323
|
+
'precision': self.parse_number(self.parse_precision(self.safe_string(chainEntry, 'withdrawPrecision'))),
|
3347
3324
|
}
|
3348
|
-
result[code] = {
|
3325
|
+
result[code] = self.safe_currency_structure({
|
3349
3326
|
'info': entry,
|
3350
3327
|
'code': code,
|
3351
3328
|
'id': currencyId,
|
3352
|
-
'active':
|
3353
|
-
'deposit':
|
3354
|
-
'withdraw':
|
3329
|
+
'active': self.safe_string(entry, 'instStatus') == 'normal',
|
3330
|
+
'deposit': None,
|
3331
|
+
'withdraw': None,
|
3355
3332
|
'fee': None,
|
3356
3333
|
'name': None,
|
3357
3334
|
'type': type,
|
@@ -3361,17 +3338,17 @@ class htx(Exchange, ImplicitAPI):
|
|
3361
3338
|
'max': None,
|
3362
3339
|
},
|
3363
3340
|
'withdraw': {
|
3364
|
-
'min':
|
3365
|
-
'max':
|
3341
|
+
'min': None,
|
3342
|
+
'max': None,
|
3366
3343
|
},
|
3367
3344
|
'deposit': {
|
3368
3345
|
'min': None,
|
3369
3346
|
'max': None,
|
3370
3347
|
},
|
3371
3348
|
},
|
3372
|
-
'precision':
|
3349
|
+
'precision': None,
|
3373
3350
|
'networks': networks,
|
3374
|
-
}
|
3351
|
+
})
|
3375
3352
|
return result
|
3376
3353
|
|
3377
3354
|
def network_id_to_code(self, networkId: Str = None, currencyCode: Str = None):
|
@@ -185,12 +185,12 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
185
185
|
},
|
186
186
|
'fees': {
|
187
187
|
'swap': {
|
188
|
-
'taker': self.parse_number('0.
|
189
|
-
'maker': self.parse_number('0.
|
188
|
+
'taker': self.parse_number('0.00045'),
|
189
|
+
'maker': self.parse_number('0.00015'),
|
190
190
|
},
|
191
191
|
'spot': {
|
192
|
-
'taker': self.parse_number('0.
|
193
|
-
'maker': self.parse_number('0.
|
192
|
+
'taker': self.parse_number('0.0007'),
|
193
|
+
'maker': self.parse_number('0.0004'),
|
194
194
|
},
|
195
195
|
},
|
196
196
|
'requiredCredentials': {
|
ccxt/async_support/mexc.py
CHANGED
@@ -1097,7 +1097,6 @@ class mexc(Exchange, ImplicitAPI):
|
|
1097
1097
|
currency = response[i]
|
1098
1098
|
id = self.safe_string(currency, 'coin')
|
1099
1099
|
code = self.safe_currency_code(id)
|
1100
|
-
name = self.safe_string(currency, 'name')
|
1101
1100
|
networks: dict = {}
|
1102
1101
|
chains = self.safe_value(currency, 'networkList', [])
|
1103
1102
|
for j in range(0, len(chains)):
|
@@ -1119,12 +1118,13 @@ class mexc(Exchange, ImplicitAPI):
|
|
1119
1118
|
'max': self.safe_string(chain, 'withdrawMax'),
|
1120
1119
|
},
|
1121
1120
|
},
|
1121
|
+
'contract': self.safe_string(chain, 'contract'),
|
1122
1122
|
}
|
1123
1123
|
result[code] = self.safe_currency_structure({
|
1124
1124
|
'info': currency,
|
1125
1125
|
'id': id,
|
1126
1126
|
'code': code,
|
1127
|
-
'name': name,
|
1127
|
+
'name': self.safe_string(currency, 'name'),
|
1128
1128
|
'active': None,
|
1129
1129
|
'deposit': None,
|
1130
1130
|
'withdraw': None,
|
ccxt/async_support/ndax.py
CHANGED
@@ -454,44 +454,44 @@ class ndax(Exchange, ImplicitAPI):
|
|
454
454
|
}
|
455
455
|
response = await self.publicGetGetProducts(self.extend(request, params))
|
456
456
|
#
|
457
|
-
#
|
458
|
-
#
|
459
|
-
#
|
460
|
-
#
|
461
|
-
#
|
462
|
-
#
|
463
|
-
#
|
464
|
-
#
|
465
|
-
#
|
466
|
-
#
|
467
|
-
#
|
468
|
-
#
|
469
|
-
#
|
470
|
-
#
|
457
|
+
# [
|
458
|
+
# {
|
459
|
+
# "OMSId": "1",
|
460
|
+
# "ProductId": "1",
|
461
|
+
# "Product": "BTC",
|
462
|
+
# "ProductFullName": "Bitcoin",
|
463
|
+
# "MasterDataUniqueProductSymbol": "",
|
464
|
+
# "ProductType": "CryptoCurrency",
|
465
|
+
# "DecimalPlaces": "8",
|
466
|
+
# "TickSize": "0.0000000100000000000000000000",
|
467
|
+
# "DepositEnabled": True,
|
468
|
+
# "WithdrawEnabled": True,
|
469
|
+
# "NoFees": False,
|
470
|
+
# "IsDisabled": False,
|
471
|
+
# "MarginEnabled": False
|
472
|
+
# },
|
473
|
+
# ...
|
471
474
|
#
|
472
475
|
result: dict = {}
|
473
476
|
for i in range(0, len(response)):
|
474
477
|
currency = response[i]
|
475
478
|
id = self.safe_string(currency, 'ProductId')
|
476
|
-
|
479
|
+
code = self.safe_currency_code(self.safe_string(currency, 'Product'))
|
477
480
|
ProductType = self.safe_string(currency, 'ProductType')
|
478
481
|
type = 'fiat' if (ProductType == 'NationalCurrency') else 'crypto'
|
479
482
|
if ProductType == 'Unknown':
|
480
483
|
# such currency is just a blanket entry
|
481
484
|
type = 'other'
|
482
|
-
code = self.
|
483
|
-
isDisabled = self.safe_value(currency, 'IsDisabled')
|
484
|
-
active = not isDisabled
|
485
|
-
result[code] = {
|
485
|
+
result[code] = self.safe_currency_structure({
|
486
486
|
'id': id,
|
487
|
-
'name':
|
487
|
+
'name': self.safe_string(currency, 'ProductFullName'),
|
488
488
|
'code': code,
|
489
489
|
'type': type,
|
490
490
|
'precision': self.safe_number(currency, 'TickSize'),
|
491
491
|
'info': currency,
|
492
|
-
'active':
|
493
|
-
'deposit':
|
494
|
-
'withdraw':
|
492
|
+
'active': not self.safe_bool(currency, 'IsDisabled'),
|
493
|
+
'deposit': self.safe_bool(currency, 'DepositEnabled'),
|
494
|
+
'withdraw': self.safe_bool(currency, 'WithdrawEnabled'),
|
495
495
|
'fee': None,
|
496
496
|
'limits': {
|
497
497
|
'amount': {
|
@@ -504,7 +504,8 @@ class ndax(Exchange, ImplicitAPI):
|
|
504
504
|
},
|
505
505
|
},
|
506
506
|
'networks': {},
|
507
|
-
|
507
|
+
'margin': self.safe_bool(currency, 'MarginEnabled'),
|
508
|
+
})
|
508
509
|
return result
|
509
510
|
|
510
511
|
async def fetch_markets(self, params={}) -> List[Market]:
|
ccxt/async_support/okcoin.py
CHANGED
@@ -840,47 +840,30 @@ class okcoin(Exchange, ImplicitAPI):
|
|
840
840
|
return None
|
841
841
|
else:
|
842
842
|
response = await self.privateGetAssetCurrencies(params)
|
843
|
-
data = self.
|
843
|
+
data = self.safe_list(response, 'data', [])
|
844
844
|
result: dict = {}
|
845
845
|
dataByCurrencyId = self.group_by(data, 'ccy')
|
846
846
|
currencyIds = list(dataByCurrencyId.keys())
|
847
847
|
for i in range(0, len(currencyIds)):
|
848
848
|
currencyId = currencyIds[i]
|
849
|
-
|
850
|
-
code = currency['code']
|
849
|
+
code = self.safe_currency_code(currencyId)
|
851
850
|
chains = dataByCurrencyId[currencyId]
|
852
851
|
networks: dict = {}
|
853
|
-
currencyActive = False
|
854
|
-
depositEnabled = False
|
855
|
-
withdrawEnabled = False
|
856
|
-
maxPrecision = None
|
857
852
|
for j in range(0, len(chains)):
|
858
853
|
chain = chains[j]
|
859
|
-
canDeposit = self.safe_value(chain, 'canDep')
|
860
|
-
depositEnabled = canDeposit if (canDeposit) else depositEnabled
|
861
|
-
canWithdraw = self.safe_value(chain, 'canWd')
|
862
|
-
withdrawEnabled = canWithdraw if (canWithdraw) else withdrawEnabled
|
863
|
-
canInternal = self.safe_value(chain, 'canInternal')
|
864
|
-
active = True if (canDeposit and canWithdraw and canInternal) else False
|
865
|
-
currencyActive = active if (active) else currencyActive
|
866
854
|
networkId = self.safe_string(chain, 'chain')
|
867
855
|
if (networkId is not None) and (networkId.find('-') >= 0):
|
868
856
|
parts = networkId.split('-')
|
869
857
|
chainPart = self.safe_string(parts, 1, networkId)
|
870
858
|
networkCode = self.network_id_to_code(chainPart)
|
871
|
-
precision = self.parse_precision(self.safe_string(chain, 'wdTickSz'))
|
872
|
-
if maxPrecision is None:
|
873
|
-
maxPrecision = precision
|
874
|
-
else:
|
875
|
-
maxPrecision = Precise.string_min(maxPrecision, precision)
|
876
859
|
networks[networkCode] = {
|
877
860
|
'id': networkId,
|
878
861
|
'network': networkCode,
|
879
|
-
'active':
|
880
|
-
'deposit':
|
881
|
-
'withdraw':
|
862
|
+
'active': None,
|
863
|
+
'deposit': self.safe_bool(chain, 'canDep'),
|
864
|
+
'withdraw': self.safe_bool(chain, 'canWd'),
|
882
865
|
'fee': self.safe_number(chain, 'minFee'),
|
883
|
-
'precision': self.parse_number(
|
866
|
+
'precision': self.parse_number(self.parse_precision(self.safe_string(chain, 'wdTickSz'))),
|
884
867
|
'limits': {
|
885
868
|
'withdraw': {
|
886
869
|
'min': self.safe_number(chain, 'minWd'),
|
@@ -890,16 +873,16 @@ class okcoin(Exchange, ImplicitAPI):
|
|
890
873
|
'info': chain,
|
891
874
|
}
|
892
875
|
firstChain = self.safe_value(chains, 0)
|
893
|
-
result[code] = {
|
876
|
+
result[code] = self.safe_currency_structure({
|
894
877
|
'info': chains,
|
895
878
|
'code': code,
|
896
879
|
'id': currencyId,
|
897
880
|
'name': self.safe_string(firstChain, 'name'),
|
898
|
-
'active':
|
899
|
-
'deposit':
|
900
|
-
'withdraw':
|
881
|
+
'active': None,
|
882
|
+
'deposit': None,
|
883
|
+
'withdraw': None,
|
901
884
|
'fee': None,
|
902
|
-
'precision':
|
885
|
+
'precision': None,
|
903
886
|
'limits': {
|
904
887
|
'amount': {
|
905
888
|
'min': None,
|
@@ -907,7 +890,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
907
890
|
},
|
908
891
|
},
|
909
892
|
'networks': networks,
|
910
|
-
}
|
893
|
+
})
|
911
894
|
return result
|
912
895
|
|
913
896
|
async def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
|
ccxt/async_support/okx.py
CHANGED
@@ -389,6 +389,7 @@ class okx(Exchange, ImplicitAPI):
|
|
389
389
|
'account/spot-manual-borrow-repay': 10,
|
390
390
|
'account/set-auto-repay': 4,
|
391
391
|
'account/spot-borrow-repay-history': 4,
|
392
|
+
'account/move-positions-history': 10,
|
392
393
|
# subaccount
|
393
394
|
'users/subaccount/list': 10,
|
394
395
|
'account/subaccount/balances': 10 / 3,
|
@@ -526,6 +527,7 @@ class okx(Exchange, ImplicitAPI):
|
|
526
527
|
'account/fixed-loan/manual-reborrow': 5,
|
527
528
|
'account/fixed-loan/repay-borrowing-order': 5,
|
528
529
|
'account/bills-history-archive': 72000, # 12 req/day
|
530
|
+
'account/move-positions': 10,
|
529
531
|
# subaccount
|
530
532
|
'users/subaccount/modify-apikey': 10,
|
531
533
|
'asset/subaccount/transfer': 10,
|
@@ -992,6 +994,13 @@ class okx(Exchange, ImplicitAPI):
|
|
992
994
|
'70010': BadRequest, # Timestamp parameters need to be in Unix timestamp format in milliseconds.
|
993
995
|
'70013': BadRequest, # endTs needs to be bigger than or equal to beginTs.
|
994
996
|
'70016': BadRequest, # Please specify your instrument settings for at least one instType.
|
997
|
+
'70060': BadRequest, # The account doesn’t exist or the position side is incorrect. To and from accounts must be under the same main account.
|
998
|
+
'70061': BadRequest, # To move position, please enter a position that’s opposite to your current side and is smaller than or equal to your current size.
|
999
|
+
'70062': BadRequest, # account has reached the maximum number of position transfers allowed per day.
|
1000
|
+
'70064': BadRequest, # Position does not exist.
|
1001
|
+
'70065': BadRequest, # Couldn’t move position. Execution price cannot be determined
|
1002
|
+
'70066': BadRequest, # Moving positions isn't supported in spot mode. Switch to any other account mode and try again.
|
1003
|
+
'70067': BadRequest, # Moving positions isn't supported in margin trading.
|
995
1004
|
'1009': BadRequest, # Request message exceeds the maximum frame length
|
996
1005
|
'4001': AuthenticationError, # Login Failed
|
997
1006
|
'4002': BadRequest, # Invalid Request
|
ccxt/async_support/onetrading.py
CHANGED
@@ -405,9 +405,12 @@ class onetrading(Exchange, ImplicitAPI):
|
|
405
405
|
#
|
406
406
|
# [
|
407
407
|
# {
|
408
|
-
# "code":"
|
409
|
-
# "precision":
|
410
|
-
#
|
408
|
+
# "code": "USDT",
|
409
|
+
# "precision": 6,
|
410
|
+
# "unified_cryptoasset_id": 825,
|
411
|
+
# "name": "Tether USDt",
|
412
|
+
# "collateral_percentage": 0
|
413
|
+
# },
|
411
414
|
# ]
|
412
415
|
#
|
413
416
|
result: dict = {}
|
@@ -415,11 +418,11 @@ class onetrading(Exchange, ImplicitAPI):
|
|
415
418
|
currency = response[i]
|
416
419
|
id = self.safe_string(currency, 'code')
|
417
420
|
code = self.safe_currency_code(id)
|
418
|
-
result[code] = {
|
421
|
+
result[code] = self.safe_currency_structure({
|
419
422
|
'id': id,
|
420
423
|
'code': code,
|
421
|
-
'name':
|
422
|
-
'info': currency,
|
424
|
+
'name': self.safe_string(currency, 'name'),
|
425
|
+
'info': currency,
|
423
426
|
'active': None,
|
424
427
|
'fee': None,
|
425
428
|
'precision': self.parse_number(self.parse_precision(self.safe_string(currency, 'precision'))),
|
@@ -430,7 +433,7 @@ class onetrading(Exchange, ImplicitAPI):
|
|
430
433
|
'withdraw': {'min': None, 'max': None},
|
431
434
|
},
|
432
435
|
'networks': {},
|
433
|
-
}
|
436
|
+
})
|
434
437
|
return result
|
435
438
|
|
436
439
|
async def fetch_markets(self, params={}) -> List[Market]:
|