Accounts

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

ledgereth.accounts.find_account(address: str, dongle: Optional[ledgerblue.Dongle.Dongle] = None, count: int = 5) Optional[ledgereth.objects.LedgerAccount][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: Optional[ledgerblue.Dongle.Dongle] = None) ledgereth.objects.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: Optional[ledgerblue.Dongle.Dongle] = None, count: int = 3) List[ledgereth.objects.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