Blocks

The class for creating block.

class pybgl.Block(raw_block=None, format='decoded', version=536870912, testnet=False, keep_raw_tx=False)[source]

The class for Block object

Parameters
  • raw_block – (optional) raw_block in bytes or HEX encoded string, if no raw raw_block provided well be created new empty block template.

  • format – (optional) “raw” or “decoded” format. Raw format is mean that it represented in bytes for best performance. Decoded block is represented in human readable format using base68, hex, bech32, asm and opcodes. By default “decoded” format using.

  • version – (optional) block version for new template, by default is 536870912.

  • testnet – (optional) flag for testnet network, by default is False.

  • keep_raw_tx – (optional) boolean, by default is False.

decode(testnet=None)[source]

Decoded block is represented in human readable format

Parameters

testnet – (optional) flag for testnet network, by default is False.