mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-02-06 04:40:56 +00:00
32 lines
752 B
Python
32 lines
752 B
Python
|
from typing import TYPE_CHECKING
|
||
|
|
||
|
import click
|
||
|
|
||
|
from .. import messages, solana, tools
|
||
|
from . import with_client
|
||
|
|
||
|
if TYPE_CHECKING:
|
||
|
from ..client import TrezorClient
|
||
|
|
||
|
PATH_HELP = "BIP-32 path to key, e.g. m/44h/501h/0h/0h"
|
||
|
DEFAULT_PATH = "m/44h/501h/0h/0h"
|
||
|
|
||
|
|
||
|
@click.group(name="solana")
|
||
|
def cli() -> None:
|
||
|
"""Solana commands."""
|
||
|
|
||
|
|
||
|
@cli.command()
|
||
|
@click.option("-n", "--address", default=DEFAULT_PATH, help=PATH_HELP)
|
||
|
@click.option("-d", "--show-display", is_flag=True)
|
||
|
@with_client
|
||
|
def get_public_key(
|
||
|
client: "TrezorClient",
|
||
|
address: str,
|
||
|
show_display: bool,
|
||
|
) -> messages.SolanaPublicKey:
|
||
|
"""Get Solana public key."""
|
||
|
address_n = tools.parse_path(address)
|
||
|
return solana.get_public_key(client, address_n, show_display)
|