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.BlockchainObject

Read 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.

Additionally to the block data, the block number is stored as self[“id”] or self.identifier.

from beem.block import Block
block = Block(1)
print(block)

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_num

Returns the block number

ops()

Returns all block operations

ops_statistics(add_to_ops_stat=None)

Retuns a statistic with the occurance of the different operation types

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

block_num

Retuns the block number

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