Block

Easily read data in a Block

from peerplays.block import Block
from pprint import pprint
pprint(Block(1))
class peerplays.block.Block(data, *args, klass=None, space_id=1, object_id=None, lazy=False, use_cache=True, peerplays_instance=None, **kwargs)

Read a single block from the chain

Parameters:

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 peerplays.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().

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