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

Method fetch_accounts

python/ccxt/extended.py:1491–1526  ·  view source on GitHub ↗

fetch the current authenticated sub-account, extended private endpoints only return records for the authenticated sub-account https://api.docs.extended.exchange/#get-sub-accounts :param dict [params]: extra parameters specific to the exchange API endpoint :returns

(self, params={})

Source from the content-addressed store, hash-verified

1489 return self.parse_account(data)
1490
1491 def fetch_accounts(self, params={}) -> List[Account]:
1492 """
1493 fetch the current authenticated sub-account, extended private endpoints only return records for the authenticated sub-account
1494
1495 https://api.docs.extended.exchange/#get-sub-accounts
1496
1497 :param dict [params]: extra parameters specific to the exchange API endpoint
1498 :returns dict[]: a list of `account structures <https://docs.ccxt.com/?id=account-structure>`
1499 """
1500 response = self.v1PrivateGetUserAccounts(params)
1501 #
1502 # {
1503 # "status": "OK",
1504 # "data": [{
1505 # "accountId": 123,
1506 # "description": "Main",
1507 # "accountIndex": 0,
1508 # "status": "ACTIVE",
1509 # "l2Key": "0x123",
1510 # "l2Vault": "321",
1511 # "bridgeStarknetAddress": "0xabc",
1512 # "accountIndexForKeyGeneration": 0
1513 # }, {
1514 # "accountId": 999,
1515 # "description": "Vault Balance",
1516 # "accountIndex": 1001,
1517 # "status": "ACTIVE",
1518 # "l2Key": "0x123",
1519 # "l2Vault": "999",
1520 # "bridgeStarknetAddress": "0xabc",
1521 # "accountIndexForKeyGeneration": 0
1522 # }
1523 # ]}
1524 #
1525 data = self.safe_list(response, 'data', [])
1526 return self.parse_accounts(data)
1527
1528 def parse_account(self, account: dict) -> Account:
1529 accountIndex = self.safe_integer(account, 'accountIndex')

Callers

nothing calls this directly

Calls 3

safe_listMethod · 0.80
parse_accountsMethod · 0.80

Tested by

no test coverage detected