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

Method load_unified_status

python/ccxt/gate.py:1186–1217  ·  view source on GitHub ↗

:param dict [params]: extra parameters specific to the exchange API endpoint returns unifiedAccount so the user can check if the unified account is enabled https://www.gate.com/docs/developers/apiv4/#retrieve-user-account-information :returns boolean: True or False

(self, params={})

Source from the content-addressed store, hash-verified

1184 self.options['sandboxMode'] = enable
1185
1186 def load_unified_status(self, params={}):
1187 """
1188 :param dict [params]: extra parameters specific to the exchange API endpoint
1189 returns unifiedAccount so the user can check if the unified account is enabled
1190
1191 https://www.gate.com/docs/developers/apiv4/#retrieve-user-account-information
1192
1193 :returns boolean: True or False if the enabled unified account is enabled or not and sets the unifiedAccount option if it is None
1194 """
1195 unifiedAccount = self.safe_bool(self.options, 'unifiedAccount')
1196 if unifiedAccount is None:
1197 try:
1198 #
1199 # {
1200 # "user_id": 10406147,
1201 # "ip_whitelist": [],
1202 # "currency_pairs": [],
1203 # "key": {
1204 # "mode": 1
1205 # },
1206 # "tier": 0,
1207 # "tier_expire_time": "0001-01-01T00:00:00Z",
1208 # "copy_trading_role": 0
1209 # }
1210 #
1211 response = self.privateAccountGetDetail(params)
1212 result = self.safe_dict(response, 'key', {})
1213 self.options['unifiedAccount'] = self.safe_integer(result, 'mode') == 2
1214 except Exception as e:
1215 # if the request fails, the unifiedAccount is disabled
1216 self.options['unifiedAccount'] = False
1217 return self.options['unifiedAccount']
1218
1219 def upgrade_unified_trade_account(self, params={}):
1220 return self.privateUnifiedPutUnifiedMode(params)

Callers 15

fetch_marketsMethod · 0.95
fetch_balanceMethod · 0.95
fetch_my_tradesMethod · 0.95
create_orderMethod · 0.95
create_ordersMethod · 0.95
edit_orderMethod · 0.95
fetch_orderMethod · 0.95
fetch_closed_ordersMethod · 0.95
cancel_orderMethod · 0.95
cancel_ordersMethod · 0.95

Calls 4

safe_boolMethod · 0.80
safe_dictMethod · 0.80
safe_integerMethod · 0.80

Tested by

no test coverage detected