graphenecommon.aio.block module

class graphenecommon.aio.block.Block(*args, use_cache=False, **kwargs)

Bases: graphenecommon.aio.blockchainobject.BlockchainObject, graphenecommon.block.Block

Read a single block from the chain

Parameters:
  • block (int) – block number
  • blockchain_instance (instance) – instance to use when accesing a RPC
  • lazy (bool) – Use lazy loading
  • loop – asyncio event loop

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 aio.block import Block
block = await Block(1)
print(block)
refresh()

Even though blocks never change, you freshly obtain its contents from an API with this method

class graphenecommon.aio.block.BlockHeader(*args, use_cache=False, **kwargs)

Bases: graphenecommon.aio.blockchainobject.BlockchainObject, graphenecommon.block.BlockHeader

refresh()

Even though blocks never change, you freshly obtain its contents from an API with this method