graphenecommon.account module¶
-
class
graphenecommon.account.
Account
(*args, **kwargs)¶ Bases:
graphenecommon.blockchainobject.BlockchainObject
,graphenecommon.instance.AbstractBlockchainInstanceProvider
This class allows to easily access Account data
Parameters: - account_name (str) – Name of the account
- blockchain_instance (instance) – instance to use when accesing a RPC
- 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: 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 .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
amount.Amount
.
-
balances
¶ List balances of an account. This call returns instances of
amount.Amount
.
-
blacklist
(account)¶ Add an other account to the blacklist of this account
-
ensure_full
()¶
-
history
(first=0, last=0, limit=-1, 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)
- last (int) – sequence number of the last 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 these operations from generator (optional).
- … note::
- only_ops and exclude_ops takes an array of strings: The full list of operation ID’s can be found in operationids.py. Example: [‘transfer’, ‘fill_order’]
-
is_fully_loaded
¶ Is this instance fully loaded / e.g. all data available?
-
is_ltm
¶ Is the account a lifetime member (LTM)?
-
name
¶
-
nolist
(account)¶ Remove an other account from any list of this account
-
refresh
()¶ Refresh/Obtain an account’s data from the API server
-
upgrade
()¶ Upgrade account to life time member
-
whitelist
(account)¶ Add an other account to the whitelist of this account
-
class
graphenecommon.account.
AccountUpdate
(data, *args, **kwargs)¶ Bases:
dict
,graphenecommon.instance.AbstractBlockchainInstanceProvider
This purpose of this class is to keep track of account updates as they are pushed through by
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
account.Account
from this class, you can use theaccount
attribute.