cfx_utils.types

cfx_utils.types

cfx_utils.types.BlockNumber(x)
cfx_utils.types.ChecksumAddress(x)
cfx_utils.types.EpochNumber(x)
cfx_utils.types.EpochNumberParam

Epoch param could be either EpochLiteral, or Epoch Number

alias of Union[typing_extensions.Literal[earliest, latest_checkpoint, latest_finalized, latest_confirmed, latest_state, latest_mined, pending], EpochNumber, int]

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

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

cfx_utils.types.Hash32(x)
cfx_utils.types.HexAddress(x)
class cfx_utils.types.HexBytes(val: Union[bool, bytearray, bytes, int, str, memoryview])[source]

HexBytes is a very thin wrapper around the python built-in bytes class.

It has these three changes:
  1. Accepts more initializing values, like hex strings, non-negative integers, and booleans

  2. Returns hex with prefix ‘0x’ from HexBytes.hex()

  3. The representation at console is in hex

hex(sep: Union[str, bytes] = None, bytes_per_sep: SupportsIndex = 1)str[source]

Output hex-encoded bytes, with an “0x” prefix.

Everything following the “0x” is output exactly like bytes.hex().

cfx_utils.types.HexStr(x)
cfx_utils.types.Nonce(x)
cfx_utils.types.Storage(x)
class cfx_utils.types.TxDict
chainId: int
data: Union[bytes, HexStr]
epochHeight: int
from: Union[Base32Address, str]
gas: int
gasPrice: Union[cfx_utils.token_unit.Drip, cfx_utils.token_unit.AbstractDerivedTokenUnit[cfx_utils.token_unit.Drip], int]
nonce: Nonce
storageLimit: Storage
to: Union[Base32Address, str]
value: Union[cfx_utils.token_unit.Drip, cfx_utils.token_unit.AbstractDerivedTokenUnit[cfx_utils.token_unit.Drip], int]
cfx_utils.types.EpochLiteral

alias of typing_extensions.Literal[earliest, latest_checkpoint, latest_finalized, latest_confirmed, latest_state, latest_mined, pending]