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

Method fetch_accounts

python/ccxt/ndax.py:1094–1125  ·  view source on GitHub ↗

fetch all the accounts associated with a profile https://apidoc.ndax.io/#getuseraccounts :param dict [params]: extra parameters specific to the exchange API endpoint :returns dict: a dictionary of `account structures ` i

(self, params={})

Source from the content-addressed store, hash-verified

1092 return self.parse_trades(response, market, since, limit)
1093
1094 def fetch_accounts(self, params={}) -> List[Account]:
1095 """
1096 fetch all the accounts associated with a profile
1097
1098 https://apidoc.ndax.io/#getuseraccounts
1099
1100 :param dict [params]: extra parameters specific to the exchange API endpoint
1101 :returns dict: a dictionary of `account structures <https://docs.ccxt.com/?id=account-structure>` indexed by the account type
1102 """
1103 if not self.login:
1104 raise AuthenticationError(self.id + ' fetchAccounts() requires exchange.login email credential')
1105 omsId = self.safe_integer(self.options, 'omsId', 1)
1106 self.check_required_credentials()
1107 request = {
1108 'omsId': omsId,
1109 'UserId': self.uid,
1110 'UserName': self.login,
1111 }
1112 response = self.privateGetGetUserAccounts(self.extend(request, params))
1113 #
1114 # [449] # comma-separated list of account ids
1115 #
1116 result = []
1117 for i in range(0, len(response)):
1118 accountId = self.safe_string(response, i)
1119 result.append({
1120 'id': accountId,
1121 'type': None,
1122 'currency': None,
1123 'info': accountId,
1124 })
1125 return result
1126
1127 def parse_balance(self, response) -> Balances:
1128 result = {

Callers

nothing calls this directly

Calls 8

AuthenticationErrorClass · 0.90
safe_integerMethod · 0.80
safe_stringMethod · 0.80
rangeFunction · 0.50
extendMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected