diff --git a/trezorctl b/trezorctl index 6cdf9cf2d..f1c844372 100755 --- a/trezorctl +++ b/trezorctl @@ -671,6 +671,16 @@ def ethereum_sign_tx(client, host, chain_id, address, value, gas_limit, gas_pric return 'Signed raw transaction: %s' % tx_hex +@cli.command(help='Get NEM address for specified path.') +@click.option('-n', '--address', required=True, help="BIP-32 path, e.g. m/44'/0'/43'/0/0") +@click.option('-N', '--network', type=int, default=0x68) +@click.option('-d', '--show-display', is_flag=True) +@click.pass_obj +def nem_get_address(client, address, network, show_display): + address_n = client.expand_path(address) + return client.nem_get_address(address_n, network, show_display) + + @cli.command(help='Sign (and optionally broadcast) NEM transaction') @click.option('-n', '--address', help='BIP-32 path to signing key') @click.option('-f', '--file', type=click.File('r'), default='-', help='Transaction in NIS (RequestPrepareAnnounce) format') diff --git a/trezorlib/client.py b/trezorlib/client.py index 13ad08778..e5fd9a124 100644 --- a/trezorlib/client.py +++ b/trezorlib/client.py @@ -667,6 +667,12 @@ class ProtocolMixin(object): ret = self.call(proto.SetU2FCounter(u2f_counter=u2f_counter)) return ret + @field("address") + @expect(proto.NEMAddress) + def nem_get_address(self, n, network, show_display=False): + n = self._convert_prime(n) + return self.call(proto.NEMGetAddress(address_n=n, network=network, show_display=show_display)) + @expect(proto.NEMSignedTx) def nem_sign_tx(self, n, transaction): n = self._convert_prime(n)