Account

TBD

class cheb3.account.Account(private_key: Optional[str] = None)

Please use cheb3.Connection.account() interface to create an account instance associated with the connection.

call(to: HexStr, data: HexStr = '0x', **kwargs) HexBytes

Interact with a smart contract without creating a new transaction on the blockchain.

Parameters:
  • to (HexStr) – The address of the contract.

  • data (HexStr) – The transaction data, defaults to 0x.

Keyword Arguments:

state_override (dict) – Specify the state override set. View Geth documentation for more details.

Return type:

HexBytes

get_balance() int

Returns the balance of the account instance.

send_transaction(to: Optional[HexStr], value: int = 0, data: HexStr = '0x', **kwargs) TxReceipt

Transfer ETH or interact with a smart contract.

Parameters:
  • to (Union[HexStr, None]) – The address of the receiver.

  • value (int) – The amount to transfer, defaults to 0 (wei).

  • data (HexStr) – The transaction data, defaults to 0x.

Keyword Arguments:
  • gas_price (int) – Specify the gas price for the transaction.

  • gas_limit (int) – Specify the maximum gas the transaction can use.

  • access_list (List[Dict]) – Specify a list of addresses and storage keys that the transaction plans to access (EIP-2930).

Return type:

TxReceipt