|
|
@ -7,6 +7,11 @@ def main():
|
|
|
|
# List all connected TREZORs on USB
|
|
|
|
# List all connected TREZORs on USB
|
|
|
|
devices = HidTransport.enumerate()
|
|
|
|
devices = HidTransport.enumerate()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Check whether we found any
|
|
|
|
|
|
|
|
if len(devices) == 0:
|
|
|
|
|
|
|
|
print 'No TREZOR found'
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
# Use first connected device
|
|
|
|
# Use first connected device
|
|
|
|
transport = HidTransport(devices[0])
|
|
|
|
transport = HidTransport(devices[0])
|
|
|
|
|
|
|
|
|
|
|
@ -16,10 +21,10 @@ def main():
|
|
|
|
# Print out TREZOR's features and settings
|
|
|
|
# Print out TREZOR's features and settings
|
|
|
|
print client.features
|
|
|
|
print client.features
|
|
|
|
|
|
|
|
|
|
|
|
# Get first address of first BIP44 account
|
|
|
|
# Get the first address of first BIP44 account
|
|
|
|
# (should be the same address as in mytrezor.com)
|
|
|
|
# (should be the same address as shown in mytrezor.com)
|
|
|
|
bip32_path = client.expand_path("44'/0'/0'/0/0")
|
|
|
|
bip32_path = client.expand_path("44'/0'/0'/0/0")
|
|
|
|
address = client.get_address('Bitcoin', bip32_path, True)
|
|
|
|
address = client.get_address('Bitcoin', bip32_path)
|
|
|
|
print 'Bitcoin address:', address
|
|
|
|
print 'Bitcoin address:', address
|
|
|
|
|
|
|
|
|
|
|
|
client.close()
|
|
|
|
client.close()
|
|
|
|