Ejemplo n.º 1
0
def process_list_accounts(author: AccountId, message: str, server: Server,
                          **kwargs):
    """Processes a message requesting a list of all accounts."""
    return '\n'.join(['| Account | Balance |', '| --- | --- |'] + [
        '| %s%s | %s |' %
        ('' if account.get_authorization() == Authorization.
         CITIZEN else '**%s** ' % account.get_authorization().name.lower(),
         ' aka '.join(str(x) for x in server.get_account_ids(account)),
         fraction_to_str(account.get_balance()))
        for account in server.list_accounts()
    ])
Ejemplo n.º 2
0
def list_public_accounts(author: Union[AccountId, str],
                         server: Server) -> List[Account]:
    """returns a list of all accounts marked as public"""
    return [account for account in server.list_accounts() if account.public]
Ejemplo n.º 3
0
def list_accounts(author: Union[AccountId, str],
                  server: Server) -> List[Account]:
    """List all accounts"""
    author = _get_account(author, server)
    _assert_authorized(author, None)
    return server.list_accounts()
Ejemplo n.º 4
0
def process_list_accounts(author: AccountId, message: str, server: Server, **kwargs):
    """Processes a message requesting a list of all accounts."""
    return '\n'.join(['| Account | Balance |', '| --- | --- |'] + [
        '| %s | %s |' % (' aka '.join(str(x) for x in server.get_account_ids(account)), account.get_balance())
        for account in server.list_accounts()
    ])