MCPcopy Create free account
hub / github.com/ccxt/ccxt / is_unified_enabled

Method is_unified_enabled

python/ccxt/bybit.py:1443–1530  ·  view source on GitHub ↗

https://bybit-exchange.github.io/docs/v5/user/apikey-info#http-request https://bybit-exchange.github.io/docs/v5/account/account-info returns [enableUnifiedMargin, enableUnifiedAccount] so the user can check if unified account is enabled :param dict [params]: extra

(self, params={})

Source from the content-addressed store, hash-verified

1441 return data
1442
1443 def is_unified_enabled(self, params={}):
1444 """
1445
1446 https://bybit-exchange.github.io/docs/v5/user/apikey-info#http-request
1447 https://bybit-exchange.github.io/docs/v5/account/account-info
1448
1449 returns [enableUnifiedMargin, enableUnifiedAccount] so the user can check if unified account is enabled
1450 :param dict [params]: extra parameters specific to the exchange API endpoint
1451 :returns any: [enableUnifiedMargin, enableUnifiedAccount]
1452 """
1453 # The API key of user id must own one of permissions will be allowed to call following API endpoints:
1454 # SUB UID: "Account Transfer"
1455 # MASTER UID: "Account Transfer", "Subaccount Transfer", "Withdrawal"
1456 enableUnifiedMargin = self.safe_bool(self.options, 'enableUnifiedMargin')
1457 enableUnifiedAccount = self.safe_bool(self.options, 'enableUnifiedAccount')
1458 if enableUnifiedMargin is None or enableUnifiedAccount is None:
1459 if self.options['enableDemoTrading']:
1460 # info endpoint is not available in demo trading
1461 # so we're assuming UTA is enabled
1462 self.options['enableUnifiedMargin'] = False
1463 self.options['enableUnifiedAccount'] = True
1464 self.options['unifiedMarginStatus'] = 6
1465 return [self.options['enableUnifiedMargin'], self.options['enableUnifiedAccount']]
1466 rawPromises = [self.privateGetV5UserQueryApi(params), self.privateGetV5AccountInfo(params)]
1467 promises = rawPromises
1468 response = promises[0]
1469 accountInfo = promises[1]
1470 #
1471 # {
1472 # "retCode": 0,
1473 # "retMsg": "",
1474 # "result": {
1475 # "id": "13770661",
1476 # "note": "XXXXXX",
1477 # "apiKey": "XXXXXX",
1478 # "readOnly": 0,
1479 # "secret": "",
1480 # "permissions": {
1481 # "ContractTrade": [...],
1482 # "Spot": [...],
1483 # "Wallet": [...],
1484 # "Options": [...],
1485 # "Derivatives": [...],
1486 # "CopyTrading": [...],
1487 # "BlockTrade": [...],
1488 # "Exchange": [...],
1489 # "NFT": [...],
1490 # },
1491 # "ips": [...],
1492 # "type": 1,
1493 # "deadlineDay": 83,
1494 # "expiredAt": "2023-05-15T03:21:05Z",
1495 # "createdAt": "2022-10-16T02:24:40Z",
1496 # "unified": 0,
1497 # "uta": 0,
1498 # "userID": 24600000,
1499 # "inviterID": 0,
1500 # "vipLevel": "No VIP",

Callers 15

fetch_balanceMethod · 0.95
create_orderMethod · 0.95
create_ordersMethod · 0.95
cancel_ordersMethod · 0.95
cancel_all_ordersMethod · 0.95
fetch_orderMethod · 0.95
fetch_ordersMethod · 0.95
fetch_ledgerMethod · 0.95
withdrawMethod · 0.95
set_margin_modeMethod · 0.95

Calls 5

safe_boolMethod · 0.80
safe_dictMethod · 0.80
safe_integerMethod · 0.80

Tested by

no test coverage detected