peerplays.notify module¶
-
class
peerplays.notify.
Notify
(accounts=[], objects=[], on_tx=None, on_object=None, on_block=None, on_account=None, peerplays_instance=None)¶ Bases:
events.events.Events
Notifications on Blockchain events.
Parameters: - accounts (list) – Account names/ids to be notified about when changing
- objects (list) – Object ids to be notified about when changed
- on_tx (fnt) – Callback that will be called for each transaction received
- on_block (fnt) – Callback that will be called for each block received
- on_account (fnt) – Callback that will be called for changes of the listed accounts
- peerplays_instance (peerplays.peerplays.PeerPlays) – PeerPlays instance
Example
from pprint import pprint from peerplays.notify import Notify notify = Notify( accounts=["xeroc"], on_account=print, on_block=print, on_tx=print ) notify.listen()
-
listen
()¶ This call initiates the listening/notification process. It behaves similar to
run_forever()
.
-
process_account
(message)¶ This is used for processing of account Updates. It will return instances of :class:peerplays.account.AccountUpdate`