bitshares.notify module¶
-
class
bitshares.notify.
Notify
(accounts=[], markets=[], objects=[], on_tx=None, on_object=None, on_block=None, on_account=None, on_market=None, keep_alive=25, **kwargs)¶ Bases:
events.events.Events
Notifications on Blockchain events.
Parameters: - accounts (list) – Account names/ids to be notified about when changing
- markets (list) – Instances of
bitshares.market.Market
that identify markets to be monitored - 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
- on_market (fnt) – Callback that will be called for changes of the listed markets
- blockchain_instance (bitshares.bitshares.BitShares) – BitShares instance
Example
from pprint import pprint from bitshares.notify import Notify from bitshares.market import Market notify = Notify( markets=["TEST:GOLD"], accounts=["xeroc"], on_market=print, on_account=print, on_block=print, on_tx=print ) notify.listen()
-
close
()¶ Cleanly close the Notify instance
-
get_market_ids
(markets)¶
-
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:bitshares.account.AccountUpdate`
-
process_market
(data)¶ This method is used for post processing of market notifications. It will return instances of either
Also possible are limit order updates (margin calls)
-
reset_subscriptions
(accounts=[], markets=[], objects=[])¶ Change the subscriptions of a running Notify instance