Accounts

Functions to get details on the accounts derived from the Ledger’s private key.

Account management functions for Ledger devices.

ledgereth.accounts.find_account(address: str, dongle: Dongle | None = None, count: int = 5) LedgerAccount | None[source]

Find an account by address.

Parameters:
  • address – (str) - An address to look up

  • dongle – (ledgerblue.Dongle.Dongle) - The Dongle instance to use to communicate with the Ledger device

  • count – (int) - How deep in the derivation sequence to look

Returns:

ledgereth.objects.LedgerAccount instance if found on the Ledger

ledgereth.accounts.get_account_by_path(path_string: str, dongle: Dongle | None = None) LedgerAccount[source]

Return an account for a specific BIP-44 derivation path.

Parameters:
  • path_string – (str) - HID derivation path for the account to sign with.

  • dongle – (ledgerblue.Dongle.Dongle) - The Dongle instance to use to communicate with the Ledger device

Returns:

ledgereth.objects.LedgerAccount instance for the given account

ledgereth.accounts.get_accounts(dongle: Dongle | None = None, count: int = 3) list[LedgerAccount][source]

Return available accounts.

Parameters:
  • dongle – (ledgerblue.Dongle.Dongle) - The Dongle instance to use to communicate with the Ledger device

  • count – (int) - Amount of accounts to return

Returns:

list of ledgereth.objects.LedgerAccount instances found on the ledger