Account

Obtaining data of an account.

from peerplays.account import Account
account = Account("xeroc")
print(account)
print(account.balances)
class peerplays.account.Account(account, full=False, lazy=False, peerplays_instance=None)

This class allows to easily access Account data

Parameters:
  • account_name (str) – Name of the account
  • peerplays_instance (peerplays.peerplays.PeerPlays) – PeerPlays instance
  • full (bool) – Obtain all account data including orders, positions, etc.
  • lazy (bool) – Use lazy loading
  • full – Obtain all account data including orders, positions, etc.
Returns:

Account data

Return type:

dictionary

Raises:

peerplays.exceptions.AccountDoesNotExistsException – if account does not exist

Instances of this class are dictionaries that come with additional methods (see below) that allow dealing with an account and it’s corresponding functions.

from peerplays.account import Account
account = Account("init0")
print(account)

Note

This class comes with its own caching function to reduce the load on the API server. Instances of this class can be refreshed with Account.refresh().

balance(symbol)

Obtain the balance of a specific Asset. This call returns instances of peerplays.amount.Amount.

balances

List balances of an account. This call returns instances of peerplays.amount.Amount.

history(first=None, last=0, limit=100, only_ops=[], exclude_ops=[])

Returns a generator for individual account transactions. The latest operation will be first. This call can be used in a for loop.

Parameters:
  • first (int) – sequence number of the first transaction to return (optional)
  • limit (int) – limit number of transactions to return (optional)
  • only_ops (array) – Limit generator by these operations (optional)
  • exclude_ops (array) – Exclude thse operations from generator (optional)
refresh()

Refresh/Obtain an account’s data from the API server

class peerplays.account.AccountUpdate(data, peerplays_instance=None)

This purpose of this class is to keep track of account updates as they are pushed through by peerplays.notify.Notify.

Instances of this class are dictionaries and take the following form:

... code-block: js

{‘id’: ‘2.6.29’,
‘lifetime_fees_paid’: ‘44261516129’, ‘most_recent_op’: ‘2.9.0’, ‘owner’: ‘1.2.29’, ‘pending_fees’: 0, ‘pending_vested_fees’: 16310, ‘total_core_in_orders’: ‘6788845277634’, ‘total_ops’: 0}
account

In oder to obtain the actual peerplays.account.Account from this class, you can use the account attribute.