@doc_metadata(categories=['<STR_LIT>'])<EOL><INDENT>def ledger(<EOL>self,<EOL>account,<EOL>count=None,<EOL>representative=False,<EOL>weight=False,<EOL>pending=False,<EOL>sorting=False,<EOL>):<DEDENT>
account = self._process_value(account, '<STR_LIT>')<EOL>payload = {"<STR_LIT>": account}<EOL>if count is not None:<EOL><INDENT>payload['<STR_LIT:count>'] = self._process_value(count, '<STR_LIT:int>')<EOL><DEDENT>if sorting:<EOL><INDENT>payload['<STR_LIT>'] = self._process_value(sorting, '<STR_LIT>')<EOL><DEDENT>if representative:<EOL><INDENT>payload['<STR_LIT>'] = self._process_value(representative, '<STR_LIT>')<EOL><DEDENT>if weight:<EOL><INDENT>payload['<STR_LIT>'] = self._process_value(weight, '<STR_LIT>')<EOL><DEDENT>if pending:<EOL><INDENT>payload['<STR_LIT>'] = self._process_value(pending, '<STR_LIT>')<EOL><DEDENT>resp = self.call('<STR_LIT>', payload)<EOL>accounts = resp.get('<STR_LIT>') or {}<EOL>int_keys = ('<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>')<EOL>for account, frontier in accounts.items():<EOL><INDENT>for key in int_keys:<EOL><INDENT>if key in frontier:<EOL><INDENT>frontier[key] = int(frontier[key])<EOL><DEDENT><DEDENT><DEDENT>return accounts<EOL>
Returns frontier, open block, change representative block, balance,
last modified timestamp from local database & block count starting at
**account** up to **count**

.. enable_control required
.. version 8.0 required

:param account: Account to return blocks for
:type account: str

:param count: Max number of blocks to return
:type count: int

:param representative: If true, returns the representative as well
:type representative: bool

:param weight: If true, returns the voting weight as well
:type weight: bool

:param pending: If true, returns the pending amount as well
:type pending: bool

:param sorting: If true, sorts the response by balance
:type sorting: bool

:raises: :py:exc:`nano.rpc.RPCException`

>>> rpc.ledger(
...     account="xrb_1111111111111111111111111111111111111111111111111111hifc8npp",
...     count=1
... )
{
    "xrb_11119gbh8hb4hj1duf7fdtfyf5s75okzxdgupgpgm1bj78ex3kgy7frt3s9n": {
        "frontier": "E71AF3E9DD86BBD8B4620EFA63E065B34D358CFC091ACB4E103B965F95783321",
        "open_block": "643B77F1ECEFBDBE1CC909872964C1DBBE23A6149BD3CEF2B50B76044659B60F",
        "representative_block": "643B77F1ECEFBDBE1CC909872964C1DBBE23A6149BD3CEF2B50B76044659B60F",
        "balance": 0,
        "modified_timestamp": 1511476234,
        "block_count": 2
    }
}