Skip to content

plugins.aea-ledger-ethereum-hwi.aea_ledger_ethereum_hwi.account

Custom implementation of eth_account.Account for hardware wallets.

chunk

def chunk(seq: bytes, size: int) -> List[bytes]

Converts a byte sequence to a list of chunks

HWIAccountData Objects

class HWIAccountData(NamedTuple)

Hardware wallet account data

HWISignedTransaction Objects

class HWISignedTransaction(NamedTuple)

Hardware wallet signed transaction

UnsignedDynamicTransaction Objects

class UnsignedDynamicTransaction(HashableRLP)

Unsigned dynamic transaction.

UnsignedType1Transaction Objects

class UnsignedType1Transaction(HashableRLP)

Unsigned typ1 transaction

SignTransactionAPDU Objects

class SignTransactionAPDU()

Sign transaction APDU codes

GetAccountAPDU Objects

class GetAccountAPDU()

Get account APDU codes

HWIErrorCodes Objects

class HWIErrorCodes()

HWI com errors.

reraise_from_hwi_com_error

@contextmanager
def reraise_from_hwi_com_error() -> Generator

Reraise ledger communication exception as HWIError

HWIAccount Objects

class HWIAccount()

Hardware wallet interface as ethereum account similar to eth_account.Account to represent Crypto.entity

__init__

def __init__(default_device_index: int = 0,
             default_account_index: int = 0,
             default_key_index: int = 0) -> None

Initialize object.

devices

@property
def devices() -> List[Any]

Returns the list of available devices.

get_client

def get_client(device_index: Optional[int] = None) -> LedgerClient

Get ledger client.

get_account

def get_account(key_index: Optional[int] = None,
                account_index: Optional[int] = None,
                device_index: Optional[int] = None) -> HWIAccountData

Get hardware wallet account.

address

@property
def address() -> ChecksumAddress

Address

public_key

@property
def public_key() -> ChecksumAddress

Public key

sign_message

def sign_message(signable_message: SignableMessage,
                 **kwargs: Any) -> SignedMessage

Sign a EIP191 message

encode_transaction

@staticmethod
def encode_transaction(transaction: TypedTransaction,
                       is_eip1559_tx: bool = False,
                       key_index: Optional[int] = None,
                       account_index: Optional[int] = None) -> bytes

Build and encode transaction

sign_transaction

def sign_transaction(transaction_dict: JSONLike,
                     **kwargs: Any) -> SignedTransaction

Sign transaction.