Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions src/aleph/sdk/wallets/ledger/ethereum.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,24 @@ def from_address(
a known wallet address.
"""
device = device or init_dongle()
account = find_account(address=address, dongle=device, count=5)
return LedgerETHAccount(
account=account,
device=device,
account: Optional[LedgerAccount] = find_account(
address=address, dongle=device, count=5
)
return (
LedgerETHAccount(
account=account,
device=device,
)
if account
else None
)

@staticmethod
def from_path(path: str, device: Optional[Dongle] = None) -> LedgerETHAccount:
"""Initialize an aleph.im account from a LedgerHQ device from
a known wallet account path."""
device = device or init_dongle()
account = get_account_by_path(path_string=path, dongle=device)
account: LedgerAccount = get_account_by_path(path_string=path, dongle=device)
return LedgerETHAccount(
account=account,
device=device,
Expand Down