mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-02 04:42:33 +00:00
24 lines
506 B
Python
24 lines
506 B
Python
from trezor.utils import chunks
|
|
|
|
from apps.common import HARDENED
|
|
|
|
if False:
|
|
from typing import Iterable, Iterator
|
|
|
|
|
|
def split_address(address: str) -> Iterator[str]:
|
|
return chunks(address, 17)
|
|
|
|
|
|
def address_n_to_str(address_n: Iterable[int]) -> str:
|
|
def path_item(i: int) -> str:
|
|
if i & HARDENED:
|
|
return str(i ^ HARDENED) + "'"
|
|
else:
|
|
return str(i)
|
|
|
|
if not address_n:
|
|
return "m"
|
|
|
|
return "m/" + "/".join([path_item(i) for i in address_n])
|