cfx_utils.types#

cfx_utils.types.AddressParam#

alias of str

cfx_utils.types.EpochNumberParam#

Epoch param could be either EpochLiteral, or Epoch Number

alias of Literal[‘earliest’, ‘latest_checkpoint’, ‘latest_finalized’, ‘latest_confirmed’, ‘latest_state’, ‘latest_mined’, ‘pending’] | EpochNumber | int

class cfx_utils.types.GDrip(value: int | decimal.Decimal | str | float | cfx_utils.token_unit.AbstractTokenUnit[cfx_utils.token_unit.BaseTokenUnit])[source]#

A derived token unit from Drip in Conflux, which corresponds to Ethereum’s GWei. 1 GDrip = 10**9 Drip

class cfx_utils.types.HexBytes(val: bool | bytearray | bytes | int | str | memoryview)[source]#

Thin wrapper around the python built-in bytes class.

It has these changes:
  1. Accepts more initializing values: bool, bytearray, bytes, (non-negative) int, str, and memoryview

  2. The representation at console (__repr__) is 0x-prefixed

  3. to_0x_hex returns a 0x-prefixed hex string

to_0x_hex() str[source]#

Convert the bytes to a 0x-prefixed hex string

Return type:

str

cfx_utils.types.EpochLiteral#

alias of Literal[‘earliest’, ‘latest_checkpoint’, ‘latest_finalized’, ‘latest_confirmed’, ‘latest_state’, ‘latest_mined’, ‘pending’]