beem.instance

class beem.instance.SharedInstance

Bases: object

Singelton for the Steem Instance

config = {}
instance = None
beem.instance.clear_cache()

Clear Caches

beem.instance.set_shared_blockchain_instance(blockchain_instance)

This method allows us to override default steem instance for all users of SharedInstance.instance.

Parameters:blockchain_instance (Steem) – Steem instance
beem.instance.set_shared_config(config)

This allows to set a config that will be used when calling shared_steem_instance and allows to define the configuration without requiring to actually create an instance

beem.instance.set_shared_hive_instance(hive_instance)

This method allows us to override default steem instance for all users of SharedInstance.instance.

Parameters:hive_instance (Hive) – Hive instance
beem.instance.set_shared_steem_instance(steem_instance)

This method allows us to override default steem instance for all users of SharedInstance.instance.

Parameters:steem_instance (Steem) – Steem instance
beem.instance.shared_blockchain_instance()

This method will initialize SharedInstance.instance and return it. The purpose of this method is to have offer single default steem instance that can be reused by multiple classes.

from beem.account import Account
from beem.instance import shared_steem_instance

account = Account("test")
# is equivalent with
account = Account("test", blockchain_instance=shared_steem_instance())
beem.instance.shared_hive_instance()

This method will initialize SharedInstance.instance and return it. The purpose of this method is to have offer single default steem instance that can be reused by multiple classes.

from beem.account import Account
from beem.instance import shared_hive_instance

account = Account("test")
# is equivalent with
account = Account("test", blockchain_instance=shared_hive_instance())
beem.instance.shared_steem_instance()

This method will initialize SharedInstance.instance and return it. The purpose of this method is to have offer single default steem instance that can be reused by multiple classes.

from beem.account import Account
from beem.instance import shared_steem_instance

account = Account("test")
# is equivalent with
account = Account("test", blockchain_instance=shared_steem_instance())