Account

Obtaining data of an account.

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

This class allows to easily access Account data

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

Account data

Return type:

dictionary

Raises:

bitshares.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 bitshares.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 bitshares.amount.Amount.

balances

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

call_positions

Alias for :func:bitshares.account.Account.callpositions

callpositions

List call positions (collateralized positions Market Pegged Assets)

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)
is_ltm

Is the account a lifetime member (LTM)?

openorders

Returns open Orders

refresh()

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

class bitshares.account.AccountUpdate(data, bitshares_instance=None)

This purpose of this class is to keep track of account updates as they are pushed through by bitshares.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 bitshares.account.Account from this class, you can use the account attribute.