# Path: trezorlib/client.py
# def get_default_client(path=None, ui=None, **kwargs):
#     """Get a client for a connected Trezor device.
# 
#     Returns a TrezorClient instance with minimum fuss.
# 
#     If no path is specified, finds first connected Trezor. Otherwise performs
#     a prefix-search for the specified device. If no UI is supplied, instantiates
#     the default CLI UI.
#     """
#     from .transport import get_transport
#     from .ui import ClickUI
# 
#     transport = get_transport(path, prefix_search=True)
#     if ui is None:
#         ui = ClickUI()
# 
#     return TrezorClient(transport, ui, **kwargs)
# 
# Path: trezorlib/btc.py
# def get_public_node(
#     client,
#     n,
#     ecdsa_curve_name=None,
#     show_display=False,
#     coin_name=None,
#     script_type=messages.InputScriptType.SPENDADDRESS,
# ):
# def get_address(
#     client,
#     coin_name,
#     n,
#     show_display=False,
#     multisig=None,
#     script_type=messages.InputScriptType.SPENDADDRESS,
# ):
# def sign_message(
#     client, coin_name, n, message, script_type=messages.InputScriptType.SPENDADDRESS
# ):
# def verify_message(client, coin_name, address, signature, message):
# def sign_tx(client, coin_name, inputs, outputs, details=None, prev_txes=None):
#     def copy_tx_meta(tx):
#     R = messages.RequestType


from trezorlib.client import get_default_client
from trezorlib.tools import parse_path
from trezorlib import btc
#!/usr/bin/env python3


def main():
    # Use first connected device
    client = get_default_client()

    # Print out TREZOR's features and settings
    print(client.features)

    # Get the first address of first BIP44 account
    # (should be the same address as shown in wallet.trezor.io)
    bip32_path = parse_path("44'/0'/0'/0/0")

# Path: trezorlib/client.py
# def get_default_client(path=None, ui=None, **kwargs):
#     """Get a client for a connected Trezor device.
# 
#     Returns a TrezorClient instance with minimum fuss.
# 
#     If no path is specified, finds first connected Trezor. Otherwise performs
#     a prefix-search for the specified device. If no UI is supplied, instantiates
#     the default CLI UI.
#     """
#     from .transport import get_transport
#     from .ui import ClickUI
# 
#     transport = get_transport(path, prefix_search=True)
#     if ui is None:
#         ui = ClickUI()
# 
#     return TrezorClient(transport, ui, **kwargs)
# 
# Path: trezorlib/btc.py
# def get_public_node(
#     client,
#     n,
#     ecdsa_curve_name=None,
#     show_display=False,
#     coin_name=None,
#     script_type=messages.InputScriptType.SPENDADDRESS,
# ):
# def get_address(
#     client,
#     coin_name,
#     n,
#     show_display=False,
#     multisig=None,
#     script_type=messages.InputScriptType.SPENDADDRESS,
# ):
# def sign_message(
#     client, coin_name, n, message, script_type=messages.InputScriptType.SPENDADDRESS
# ):
# def verify_message(client, coin_name, address, signature, message):
# def sign_tx(client, coin_name, inputs, outputs, details=None, prev_txes=None):
#     def copy_tx_meta(tx):
#     R = messages.RequestType


# Path: tools/helloworld.py
from trezorlib.client import get_default_client
from trezorlib.tools import parse_path
from trezorlib import btc

#!/usr/bin/env python3


def main():
    # Use first connected device
    client = get_default_client()

    # Print out TREZOR's features and settings
    print(client.features)

    # Get the first address of first BIP44 account
    # (should be the same address as shown in wallet.trezor.io)
    bip32_path = parse_path("44'/0'/0'/0/0")

    address = btc.get_address(client, "Bitcoin", bip32_path, True)