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

Method fetch_accounts

python/ccxt/deribit.py:722–768  ·  view source on GitHub ↗

fetch all the accounts associated with a profile https://docs.deribit.com/#private-get_subaccounts :param dict [params]: extra parameters specific to the exchange API endpoint :returns dict: a dictionary of `account structures <https://docs.ccxt.com/?id=account-str

(self, params={})

Source from the content-addressed store, hash-verified

720 }
721
722 def fetch_accounts(self, params={}) -> List[Account]:
723 """
724 fetch all the accounts associated with a profile
725
726 https://docs.deribit.com/#private-get_subaccounts
727
728 :param dict [params]: extra parameters specific to the exchange API endpoint
729 :returns dict: a dictionary of `account structures <https://docs.ccxt.com/?id=account-structure>` indexed by the account type
730 """
731 self.load_markets()
732 response = self.privateGetGetSubaccounts(params)
733 #
734 # {
735 # "jsonrpc": "2.0",
736 # "result": [{
737 # "username": "someusername",
738 # "type": "main",
739 # "system_name": "someusername",
740 # "security_keys_enabled": False,
741 # "security_keys_assignments": [],
742 # "receive_notifications": False,
743 # "login_enabled": True,
744 # "is_password": True,
745 # "id": "238216",
746 # "email": "pablo@abcdef.com"
747 # },
748 # {
749 # "username": "someusername_1",
750 # "type": "subaccount",
751 # "system_name": "someusername_1",
752 # "security_keys_enabled": False,
753 # "security_keys_assignments": [],
754 # "receive_notifications": False,
755 # "login_enabled": False,
756 # "is_password": False,
757 # "id": "245499",
758 # "email": "pablo@abcdef.com"
759 # }
760 # ],
761 # "usIn": "1652736468292006",
762 # "usOut": "1652736468292377",
763 # "usDiff": "371",
764 # "testnet": False
765 # }
766 #
767 result = self.safe_value(response, 'result', [])
768 return self.parse_accounts(result)
769
770 def parse_account(self, account):
771 #

Callers

nothing calls this directly

Calls 4

safe_valueMethod · 0.80
parse_accountsMethod · 0.80
load_marketsMethod · 0.45

Tested by

no test coverage detected