From bb620456e80e7b6e5993dd2e7d50fc7bf9d8575d Mon Sep 17 00:00:00 2001 From: Tomas Martykan Date: Thu, 12 Dec 2024 12:00:13 +0100 Subject: [PATCH] =?UTF-8?q?feat(trezorctl):=20view=20signature=20for=20btc?= =?UTF-8?q?=20get=E2=80=93address?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- python/src/trezorlib/cli/btc.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/python/src/trezorlib/cli/btc.py b/python/src/trezorlib/cli/btc.py index d6a9867215..56acf5897c 100644 --- a/python/src/trezorlib/cli/btc.py +++ b/python/src/trezorlib/cli/btc.py @@ -174,6 +174,7 @@ def cli() -> None: help="Sort pubkeys lexicographically using BIP-67", ) @click.option("-C", "--chunkify", is_flag=True) +@click.option("-S", "--with-signature", is_flag=True) @with_client def get_address( client: "TrezorClient", @@ -186,6 +187,7 @@ def get_address( multisig_suffix_length: int, multisig_sort_pubkeys: bool, chunkify: bool, + with_signature: bool = False, ) -> str: """Get address for specified path. @@ -234,7 +236,7 @@ def get_address( else: multisig = None - return btc.get_address( + response = btc.get_authenticated_address( client, coin, address_n, @@ -245,6 +247,10 @@ def get_address( chunkify=chunkify, ) + if with_signature: + return "Address: " + response.address + "\n" + "Signature: " + response.signature.hex() + else: + return response.address @cli.command() @click.option("-c", "--coin", default=DEFAULT_COIN)