beem.block module¶
-
class
beem.block.Block(data, klass=None, space_id=1, object_id=None, lazy=False, use_cache=True, id_item=None, steem_instance=None, *args, **kwargs)¶ Bases:
beem.blockchainobject.BlockchainObjectRead a single block from the chain
Parameters: - block (int) – block number
- steem_instance (beem.steem.Steem) – Steem instance
- lazy (bool) – Use lazy loading
Instances of this class are dictionaries that come with additional methods (see below) that allow dealing with a block and it’s corresponding functions.
from beem.block import Block block = Block(1) print(block["block"]) print(block["id])
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().-
block¶ Returns the block data
-
id¶ Returns the block id
-
ops()¶
-
ops_statistics(add_to_ops_stat=None)¶
-
refresh()¶ Even though blocks never change, you freshly obtain its contents from an API with this method
-
time()¶ Return a datatime instance for the timestamp of this block
-
class
beem.block.BlockHeader(data, klass=None, space_id=1, object_id=None, lazy=False, use_cache=True, id_item=None, steem_instance=None, *args, **kwargs)¶ Bases:
beem.blockchainobject.BlockchainObject-
header¶ Returns the block header
-
id¶ Returns the block id
-
refresh()¶ Even though blocks never change, you freshly obtain its contents from an API with this method
-
time()¶ Return a datatime instance for the timestamp of this block
-