pax_global_header00006660000000000000000000000064136142734030014515gustar00rootroot0000000000000052 comment=319c7fb033995c4aff82067fd978db5ff3a8921f python-trezor-0.11.6/000077500000000000000000000000001361427340300144465ustar00rootroot00000000000000python-trezor-0.11.6/AUTHORS000066400000000000000000000013621361427340300155200ustar00rootroot00000000000000python-trezor is free software, created in 2012 and maintained by SatoshiLabs as part of the Trezor project. Over the years, many people have contributed to the project. Here is an incomplete list of credits: alepop Jan 'matejcik' Matějek Jan Pochyla Jochen Hoenicke Karel Bílek Marek Palatinus mruddy Pavol Rusnak Peter van Mourik Roman Zeyde Saleem Rashid Tomáš Sušánka ZuluCrypto python-trezor-0.11.6/CHANGELOG.md000066400000000000000000000362161361427340300162670ustar00rootroot00000000000000# Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). _At the moment, the project does **not** adhere to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). That is expected to change with version 1.0._ ## [0.11.6] - 2019-12-30 [0.11.6]: https://github.com/trezor/trezor-firmware/compare/python/v0.11.5...python/v0.11.6 ### Added - support for get-and-increase FIDO counter operation - support for setting wipe code - `trezorctl device recover` supports `--u2f-counter` option to set the FIDO counter to a custom value ### Changed - `trezorctl` command was reworked for ease of use and maintenance. See `trezorctl --help` and `OPTIONS.rst` for details. [f#510] - updated EOS transaction parser to match `cleos` in `delegatebw` and `undelegatebw` actions [f#680] [f#681] - `RecoveryDevice` does not set fields when doing dry-run recovery [f#666] ### Fixed - fixed "expand words" functionality in `trezorctl device recover` [f#778] ### Removed - trezorctl no longer interactively signs Bitcoin-like transactions, the only allowed input format is JSON. See [`docs/transaction-format.md`](docs/transaction-format.md) for details. - support for "load device by xprv" was removed from firmware and trezorlib ## [0.11.5] - 2019-09-26 [0.11.5]: https://github.com/trezor/trezor-firmware/compare/python/v0.11.4...python/v0.11.5 ### Added - trezorctl can dump raw protobuf bytes in debug output [f#117] - trezorctl shows a warning when activating Shamir Backup if the device does not support it [f#445] - warnings are emitted when encountering unknown value for a protobuf enum [f#363] - debug messages show enum value names instead of raw numbers - support for packed repeated encoding in the protobuf decoder - in `trezorctl firmware-update`, the new `--beta` switch enables downloading beta firmwares. By default, only stable firmware is used. [f#411], [f#420] - in `trezorctl firmware-update`, the new `--bitcoin-only` switch enables downloading Bitcoin-only firmware - support for FIDO2 resident credential management - support for SD-protect features ### Changed - package directory structure was changed: `src` subdirectory contains sources and `tests` subdirectory contains tests, so that cwd is not cluttered - `trezorctl` script was moved into a module `trezorlib.cli.trezorctl` and is launched through the `entry_points` mechanism. This makes it usable on Windows - `pyblake2` is no longer required on Python 3.6 and up - input flows can only be used in with-block (only relevant for unit tests) - if not specified, trezorctl will set label to "SLIP-0014" in SLIP-0014 mode - in `clear_session` the client also forgets the passphrase state for TT [f#525] ### Fixed - trezorctl will properly check if a firmware is present on a new T1 [f#224] ### Removed - device test suite was moved out of trezor package ## [0.11.4] - 2019-07-31 [0.11.4]: https://github.com/trezor/trezor-firmware/compare/python/v0.11.3...python/v0.11.4 ### Added - trezorctl support for SLIP-39 Shamir Backup - support for Binance Chain ## [0.11.3] - 2019-05-29 [0.11.3]: https://github.com/trezor/trezor-firmware/compare/python/v0.11.2...python/v0.11.3 ### Added - trezorctl can now send ERC20 tokens - trezorctl usb-reset will perform USB reset on devices in inconsistent state - set-display-rotation command added for TT firmware 2.1.1 - EOS support [f#87] - Tezos: add voting support [f#41] - `dict_to_proto` now allows enum values as strings ### Changed - Minimum firmware versions bumped to 1.8.0 and 2.1.0 - Cleaner errors when UI object is not supplied - Generated files are now part of the source tarball again. That means that `protoc` is no longer required. ### Fixed - Ethereum commands in trezorctl now work - Memory debugging tools now work again ### Removed - Tron and Ontology support removed until implementations exist in Trezor firmware ## [0.11.2] - 2019-02-27 [0.11.2]: https://github.com/trezor/python-trezor/compare/v0.11.1...v0.11.2 ### Added - full support for bootloader 1.8.0 and relevant firmware upgrade functionality - trezorctl: support fully offline signing JSON-encoded transaction data - trezorctl: dry-run for firmware upgrade command - client: new convenience function `get_default_client` for simple script usage - Dash: support DIP-2 special inputs [#351] - Ethereum: add get_public_key methods ### Changed - coins with BIP-143 fork id (BCH, BTG) won't require prev_tx [#352] - device recovery will restore U2F counter - Cardano: change `network` to `protocol_magic` - tests can run interactively when `INTERACT=1` environment variable is set - protobuf: improved `to_dict` function ### Deprecated - trezorctl: interactive signing with `sign-tx` is considered deprecated ## [0.11.1] - 2018-12-28 [0.11.1]: https://github.com/trezor/python-trezor/compare/v0.11.0...v0.11.1 ### Fixed - crash when entering passphrase on device with Trezor T - Qt widgets should only import QtCore [#349] ## [0.11.0] - 2018-12-06 [0.11.0]: https://github.com/trezor/python-trezor/compare/v0.10.2...v0.11.0 ### Incompatible changes - removed support for Python 3.3 and 3.4 - major refactor of `TrezorClient` and UI handling. Implementers must now provide a "UI" object instead of overriding callbacks [#307], [#314] - protobuf classes now use a `get_fields()` method instead of `FIELDS` field [#312] - all methods on `TrezorClient` class are now in separate modules and take a `TrezorClient` instance as argument [#276] - mixin classes are also removed, you are not supposed to extend `TrezorClient` anymore - `TrezorClientDebugLink` was moved to `debuglink` module - changed signature of `trezorlib.btc.sign_tx` - `@field` decorator was replaced by an argument to `@expect` ### Added - trezorlib now has a hardcoded check preventing use of outdated firmware versions [#283] - Ripple support [#286] - Zencash support [#287] - Cardano support [#300] - Ontology support [#301] - Tezos support [#302] - Capricoin support [#325] - limited Monero support (can only get address/watch key, monerowallet is required for signing) - support for input flow in tests makes it easier to control complex UI workflows [#314] - `protobuf.dict_to_proto` can create a protobuf instance from a plain dict - support for smarter methods in trezord 2.0.25 and up - support for seedless setup - trezorctl: firmware handling is greatly improved [#304], [#308] - trezorctl: Bitcoin-like signing flow is more user-friendly - `tx_api` now supports Blockbook backend servers ### Changed - better reporting for debuglink expected messages - replaced Ed25519 module with a cleaner, optimized version - further reorganization of transports makes them more robust when dependencies are missing - codebase now follows [Black](https://github.com/ambv/black) code style - in Qt modules, Qt5 is imported first [#315] - `TxApiInsight` is just `TxApi` - `device.reset` and `device.recover` now have reasonable defaults for all arguments - protobuf classes are no longer part of the source distribution and must be compiled locally [#284] - Stellar: addresses are always strings ### Removed - `set_tx_api` method on `TrezorClient` is replaced by an argument for `sign_tx` - caching functionality of `TxApi` was moved to a separate test-support class - Stellar: public key methods removed - `EncryptMessage` and `DecryptMessage` actions are gone ### Fixed: - `TrezorClient` can now detect when a HID device is removed and a different one is plugged in on the same path - trezorctl now works with Click 7.0 and considers "`_`" and "`-`" as same in command names [#314] - bash completion fixed - Stellar: several bugs in the XDR parser were fixed ## [0.10.2] - 2018-06-21 [0.10.2]: https://github.com/trezor/python-trezor/compare/v0.10.1...v0.10.2 ### Added - `stellar_get_address` and `_public_key` functions support `show_display` parameter - trezorctl: `stellar_get_address` and `_public_key` commands for the respective functionality ### Removed - trezorctl: `list_coins` is removed because we no longer parse the relevant protobuf field (and newer Trezor firmwares don't send it) [#277] ### Fixed - test support module was not included in the release, so code relying on the deprecated `ckd_public` module would fail [#280] ## [0.10.1] - 2018-06-11 [0.10.1]: https://github.com/trezor/python-trezor/compare/v0.10.0...v0.10.1 ### Fixed - previous release fails to build on Windows [#274] ## [0.10.0] - 2018-06-08 [0.10.0]: https://github.com/trezor/python-trezor/compare/v0.9.1...v0.10.0 ### Added - Lisk support [#197] - Stellar support [#167], [#268] - Wanchain support [#230] - support for "auto lock delay" feature - `TrezorClient` takes an additional argument `state` that allows reusing the previously entered passphrase [#241] - USB transports mention udev rules in exception messages [#245] - `log.enable_debug_output` function turns on wire logging, instead of having to use `TrezorClientVerbose` - BIP32 paths now support `123h` in addition to `123'` to indicate hardening - trezorctl: `-p` now supports prefix search for device path [#226] - trezorctl: smarter handling of firmware updates [#242], [#269] ### Changed - reorganized transports and moved into their own `transport` submodule - protobuf messages and coins info is now regenerated at build time from the `trezor-common` repository [#248] - renamed `ed25519raw` to `_ed25519` to indicate its privateness - renamed `ed25519cosi` to `cosi` and expanded its API - protobuf messages are now logged through Python's `logging` facility instead of custom printing through `VerboseWireMixin` - `client.format_protobuf` is moved to `protobuf.format_message` - `tools.Hash` is renamed to `tools.btc_hash` - `coins` module `coins_txapi` is renamed to `tx_api`. `coins_slip44` is renamed to `slip44`. - build: stricter flake8 checks - build: split requirements to separate files - tests: unified finding test device, while respecting `TREZOR_PATH` env variable. - tests: auto-skip appropriately marked tests based on Trezor device version - tests: only show wire output when run with `-v` - tests: allow running `xfail`ed tests selectively based on `pytest.ini` - docs: updated README with clearer install instructions [#185] - docs: switched changelog to Keep a Changelog format [#94] ### Deprecated - `ckd_public` is only maintained in `tests.support` submodule and considered private - `TrezorClient.expand_path` is moved to plain function `tools.parse_path` - `TrezorDevice` is deprecated in favor of `transport.enumerate_devices` and `transport.get_transport` - XPUB-related handling in `tools` is slated for removal ### Removed - most Python 2 compatibility constructs are gone [#229] - `TrezorClientVerbose` and `VerboseWireMixin` is removed - specific `tx_api.TxApi*` classes removed in favor of `coins.tx_api` - `client.PRIME_DERIVATION_FLAG` is removed in favor of `tools.HARDENED_FLAG` and `tools.H_()` - hard dependency on Ethereum libraries and HIDAPI is changed into extras that need to be specified explicitly. Require `trezor[hidapi]` or `trezor[ethereum]` to get them. ### Fixed - WebUSB enumeration returning bad devices on Windows 10 [#223] - `sign_tx` operation sending empty address string [#237] - Wrongly formatted Ethereum signatures [#236] - protobuf layer would wrongly encode signed integers [#249], [#250] - protobuf pretty-printing broken on Python 3.4 [#256] - trezorctl: Matrix recovery on Windows wouldn't allow backspace [#207] - aes_encfs_getpass.py: fixed Python 3 bug [#169] ## [0.9.1] - 2018-03-05 [0.9.1]: https://github.com/trezor/python-trezor/compare/v0.9.0...v0.9.1 ### Added - proper support for Trezor model T - support for Monacoin - improvements to `trezorctl`: - add pretty-printing of features and protobuf debug dumps (fixes [#199]) - support `TREZOR_PATH` environment variable to preselect a Trezor device. ### Removed - gradually dropping Python 2 compatibility (pypi package will now be marked as Python 3 only) [#94]: https://github.com/trezor/python-trezor/issues/94 [#167]: https://github.com/trezor/python-trezor/issues/167 [#169]: https://github.com/trezor/python-trezor/issues/169 [#185]: https://github.com/trezor/python-trezor/issues/185 [#197]: https://github.com/trezor/python-trezor/issues/197 [#199]: https://github.com/trezor/python-trezor/issues/199 [#207]: https://github.com/trezor/python-trezor/issues/207 [#223]: https://github.com/trezor/python-trezor/issues/223 [#226]: https://github.com/trezor/python-trezor/issues/226 [#229]: https://github.com/trezor/python-trezor/issues/229 [#230]: https://github.com/trezor/python-trezor/issues/230 [#236]: https://github.com/trezor/python-trezor/issues/236 [#237]: https://github.com/trezor/python-trezor/issues/237 [#241]: https://github.com/trezor/python-trezor/issues/241 [#242]: https://github.com/trezor/python-trezor/issues/242 [#245]: https://github.com/trezor/python-trezor/issues/245 [#248]: https://github.com/trezor/python-trezor/issues/248 [#249]: https://github.com/trezor/python-trezor/issues/249 [#250]: https://github.com/trezor/python-trezor/issues/250 [#256]: https://github.com/trezor/python-trezor/issues/256 [#268]: https://github.com/trezor/python-trezor/issues/268 [#269]: https://github.com/trezor/python-trezor/issues/269 [#274]: https://github.com/trezor/python-trezor/issues/274 [#276]: https://github.com/trezor/python-trezor/issues/276 [#277]: https://github.com/trezor/python-trezor/issues/277 [#280]: https://github.com/trezor/python-trezor/issues/280 [#283]: https://github.com/trezor/python-trezor/issues/283 [#284]: https://github.com/trezor/python-trezor/issues/284 [#286]: https://github.com/trezor/python-trezor/issues/286 [#287]: https://github.com/trezor/python-trezor/issues/287 [#300]: https://github.com/trezor/python-trezor/issues/300 [#301]: https://github.com/trezor/python-trezor/issues/301 [#302]: https://github.com/trezor/python-trezor/issues/302 [#304]: https://github.com/trezor/python-trezor/issues/304 [#307]: https://github.com/trezor/python-trezor/issues/307 [#308]: https://github.com/trezor/python-trezor/issues/308 [#312]: https://github.com/trezor/python-trezor/issues/312 [#314]: https://github.com/trezor/python-trezor/issues/314 [#315]: https://github.com/trezor/python-trezor/issues/315 [#325]: https://github.com/trezor/python-trezor/issues/325 [#349]: https://github.com/trezor/python-trezor/issues/349 [#351]: https://github.com/trezor/python-trezor/issues/351 [#352]: https://github.com/trezor/python-trezor/issues/352 [f#41]: https://github.com/trezor/trezor-firmware/issues/41 [f#87]: https://github.com/trezor/trezor-firmware/issues/87 [f#117]: https://github.com/trezor/trezor-firmware/issues/117 [f#224]: https://github.com/trezor/trezor-firmware/issues/224 [f#363]: https://github.com/trezor/trezor-firmware/issues/363 [f#411]: https://github.com/trezor/trezor-firmware/issues/411 [f#420]: https://github.com/trezor/trezor-firmware/issues/420 [f#445]: https://github.com/trezor/trezor-firmware/issues/445 [f#510]: https://github.com/trezor/trezor-firmware/issues/510 [f#525]: https://github.com/trezor/trezor-firmware/issues/525 [f#666]: https://github.com/trezor/trezor-firmware/issues/666 [f#680]: https://github.com/trezor/trezor-firmware/issues/680 [f#681]: https://github.com/trezor/trezor-firmware/issues/681 [f#778]: https://github.com/trezor/trezor-firmware/issues/778 python-trezor-0.11.6/COPYING000066400000000000000000000167431361427340300155140ustar00rootroot00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. 0. Additional Definitions. As used herein, "this License" refers to version 3 of the GNU Lesser General Public License, and the "GNU GPL" refers to version 3 of the GNU General Public License. "The Library" refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. An "Application" is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. A "Combined Work" is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the "Linked Version". The "Minimal Corresponding Source" for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. The "Corresponding Application Code" for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. 1. Exception to Section 3 of the GNU GPL. You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. 2. Conveying Modified Versions. If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. 3. Object Code Incorporating Material from Library Header Files. The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the object code with a copy of the GNU GPL and this license document. 4. Combined Works. You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the Combined Work with a copy of the GNU GPL and this license document. c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. d) Do one of the following: 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) 5. Combined Libraries. You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 6. Revised Versions of the GNU Lesser General Public License. The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. python-trezor-0.11.6/MANIFEST.in000066400000000000000000000002311361427340300162000ustar00rootroot00000000000000recursive-include bash_completion.d *.sh include tools/* graft src graft tests include AUTHORS README.md COPYING CHANGELOG.md include requirements*.txt python-trezor-0.11.6/PKG-INFO000066400000000000000000000607641361427340300155600ustar00rootroot00000000000000Metadata-Version: 2.1 Name: trezor Version: 0.11.6 Summary: Python library for communicating with Trezor Hardware Wallet Home-page: https://github.com/trezor/python-trezor Author: Trezor Author-email: info@trezor.io License: LGPLv3 Description: # python-trezor [![image](https://travis-ci.org/trezor/python-trezor.svg?branch=master)](https://travis-ci.org/trezor/python-trezor) [![repology](https://repology.org/badge/tiny-repos/python:trezor.svg)](https://repology.org/metapackage/python:trezor) [![image](https://badges.gitter.im/trezor/community.svg)](https://gitter.im/trezor/community) Python library and commandline client for communicating with Trezor Hardware Wallet See for more information ## Install Python-trezor requires Python 3.5 or higher, and libusb 1.0. The easiest way to install it is with `pip`. The rest of this guide assumes you have a working `pip`; if not, you can refer to [this guide](https://packaging.python.org/tutorials/installing-packages/). ### Quick installation On a typical Linux / Mac / BSD system, you already have all you need. Install `trezor` with: ```sh pip3 install --upgrade setuptools pip3 install trezor ``` On Windows, you also need to install [libusb](https://github.com/libusb/libusb/wiki/Windows) and the appropriate [drivers](https://zadig.akeo.ie/). This is, unfortunately, a topic bigger than this README. ### Older Trezor One support If your Trezor One is on firmware **1.6.3** or older, you will need HIDAPI support for it to be recognized. That requires additional packages. #### Debian / Ubuntu On a Debian or Ubuntu based system, you can install these: ```sh sudo apt-get install python3-dev python3-pip cython3 libusb-1.0-0-dev libudev-dev ``` #### Windows On a Windows based system, you can install these (for more info on choco, refer to [this](https://chocolatey.org/install)): ```sh choco install vcbuildtools python3 protoc refreshenv pip3 install protobuf ``` When installing the trezor library, you need to specify that you want `hidapi`: ```sh pip3 install --upgrade setuptools pip3 install trezor[hidapi] ``` ### Ethereum support Ethereum requires additional python packages. Instead of `pip3 install trezor`, specify `pip3 install trezor[ethereum]`. You can combine it with the above, to get both HIDAPI and Ethereum support: ```sh pip3 install trezor[ethereum,hidapi] ``` ### FreeBSD On FreeBSD you can install the packages: ```sh pkg install security/py-trezor ``` or build via ports: ```sh cd /usr/ports/security/py-trezor make install clean ``` ### Building from source Sometimes you might need to install the latest-and-greatest unreleased version straight from GitHub. You will need some prerequisites first: ```sh sudo apt-get install protobuf-compiler protobuf-dev pip3 install protobuf ``` If you just need to install the package, you can use pip again: ```sh pip3 install git+https://github.com/trezor/python-trezor ``` If you want to work on the sources, make a local clone: ```sh git clone https://github.com/trezor/python-trezor cd python-trezor python3 setup.py prebuild python3 setup.py develop ``` ## Command line client (trezorctl) The included `trezorctl` python script can perform various tasks such as changing setting in the Trezor, signing transactions, retrieving account info and addresses. See the [docs/](docs/) sub folder for detailed examples and options. NOTE: An older version of the `trezorctl` command is [available for Debian Stretch](https://packages.debian.org/en/stretch/python-trezor) (and comes pre-installed on [Tails OS](https://tails.boum.org/)). ## Python Library You can use this python library to interact with a Bitcoin Trezor and use its capabilities in your application. See examples here in the [tools/](tools/) sub folder. ## PIN Entering When you are asked for PIN, you have to enter scrambled PIN. Follow the numbers shown on Trezor display and enter the their positions using the numeric keyboard mapping: | | | | |---|---|---| | 7 | 8 | 9 | | 4 | 5 | 6 | | 1 | 2 | 3 | Example: your PIN is **1234** and Trezor is displaying the following: | | | | |---|---|---| | 2 | 8 | 3 | | 5 | 4 | 6 | | 7 | 9 | 1 | You have to enter: **3795** ## Contributing Python-trezor pulls coins info and protobuf messages from [trezor-common](https://github.com/trezor/trezor-common) repository. If you are developing new features for Trezor, you will want to start there. Once your changes are accepted to `trezor-common`, you can make a PR against this repository. Don't forget to update the submodule with: ```sh git submodule update --init --remote ``` Then, rebuild the protobuf messages and get `coins.json` by running: ```sh python3 setup.py prebuild ``` To get support for BTC-like coins, these steps are enough and no further changes to the library are necessary. # Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). _At the moment, the project does **not** adhere to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). That is expected to change with version 1.0._ ## [0.11.6] - 2019-12-30 [0.11.6]: https://github.com/trezor/trezor-firmware/compare/python/v0.11.5...python/v0.11.6 ### Added - support for get-and-increase FIDO counter operation - support for setting wipe code - `trezorctl device recover` supports `--u2f-counter` option to set the FIDO counter to a custom value ### Changed - `trezorctl` command was reworked for ease of use and maintenance. See `trezorctl --help` and `OPTIONS.rst` for details. [f#510] - updated EOS transaction parser to match `cleos` in `delegatebw` and `undelegatebw` actions [f#680] [f#681] - `RecoveryDevice` does not set fields when doing dry-run recovery [f#666] ### Fixed - fixed "expand words" functionality in `trezorctl device recover` [f#778] ### Removed - trezorctl no longer interactively signs Bitcoin-like transactions, the only allowed input format is JSON. See [`docs/transaction-format.md`](docs/transaction-format.md) for details. - support for "load device by xprv" was removed from firmware and trezorlib ## [0.11.5] - 2019-09-26 [0.11.5]: https://github.com/trezor/trezor-firmware/compare/python/v0.11.4...python/v0.11.5 ### Added - trezorctl can dump raw protobuf bytes in debug output [f#117] - trezorctl shows a warning when activating Shamir Backup if the device does not support it [f#445] - warnings are emitted when encountering unknown value for a protobuf enum [f#363] - debug messages show enum value names instead of raw numbers - support for packed repeated encoding in the protobuf decoder - in `trezorctl firmware-update`, the new `--beta` switch enables downloading beta firmwares. By default, only stable firmware is used. [f#411], [f#420] - in `trezorctl firmware-update`, the new `--bitcoin-only` switch enables downloading Bitcoin-only firmware - support for FIDO2 resident credential management - support for SD-protect features ### Changed - package directory structure was changed: `src` subdirectory contains sources and `tests` subdirectory contains tests, so that cwd is not cluttered - `trezorctl` script was moved into a module `trezorlib.cli.trezorctl` and is launched through the `entry_points` mechanism. This makes it usable on Windows - `pyblake2` is no longer required on Python 3.6 and up - input flows can only be used in with-block (only relevant for unit tests) - if not specified, trezorctl will set label to "SLIP-0014" in SLIP-0014 mode - in `clear_session` the client also forgets the passphrase state for TT [f#525] ### Fixed - trezorctl will properly check if a firmware is present on a new T1 [f#224] ### Removed - device test suite was moved out of trezor package ## [0.11.4] - 2019-07-31 [0.11.4]: https://github.com/trezor/trezor-firmware/compare/python/v0.11.3...python/v0.11.4 ### Added - trezorctl support for SLIP-39 Shamir Backup - support for Binance Chain ## [0.11.3] - 2019-05-29 [0.11.3]: https://github.com/trezor/trezor-firmware/compare/python/v0.11.2...python/v0.11.3 ### Added - trezorctl can now send ERC20 tokens - trezorctl usb-reset will perform USB reset on devices in inconsistent state - set-display-rotation command added for TT firmware 2.1.1 - EOS support [f#87] - Tezos: add voting support [f#41] - `dict_to_proto` now allows enum values as strings ### Changed - Minimum firmware versions bumped to 1.8.0 and 2.1.0 - Cleaner errors when UI object is not supplied - Generated files are now part of the source tarball again. That means that `protoc` is no longer required. ### Fixed - Ethereum commands in trezorctl now work - Memory debugging tools now work again ### Removed - Tron and Ontology support removed until implementations exist in Trezor firmware ## [0.11.2] - 2019-02-27 [0.11.2]: https://github.com/trezor/python-trezor/compare/v0.11.1...v0.11.2 ### Added - full support for bootloader 1.8.0 and relevant firmware upgrade functionality - trezorctl: support fully offline signing JSON-encoded transaction data - trezorctl: dry-run for firmware upgrade command - client: new convenience function `get_default_client` for simple script usage - Dash: support DIP-2 special inputs [#351] - Ethereum: add get_public_key methods ### Changed - coins with BIP-143 fork id (BCH, BTG) won't require prev_tx [#352] - device recovery will restore U2F counter - Cardano: change `network` to `protocol_magic` - tests can run interactively when `INTERACT=1` environment variable is set - protobuf: improved `to_dict` function ### Deprecated - trezorctl: interactive signing with `sign-tx` is considered deprecated ## [0.11.1] - 2018-12-28 [0.11.1]: https://github.com/trezor/python-trezor/compare/v0.11.0...v0.11.1 ### Fixed - crash when entering passphrase on device with Trezor T - Qt widgets should only import QtCore [#349] ## [0.11.0] - 2018-12-06 [0.11.0]: https://github.com/trezor/python-trezor/compare/v0.10.2...v0.11.0 ### Incompatible changes - removed support for Python 3.3 and 3.4 - major refactor of `TrezorClient` and UI handling. Implementers must now provide a "UI" object instead of overriding callbacks [#307], [#314] - protobuf classes now use a `get_fields()` method instead of `FIELDS` field [#312] - all methods on `TrezorClient` class are now in separate modules and take a `TrezorClient` instance as argument [#276] - mixin classes are also removed, you are not supposed to extend `TrezorClient` anymore - `TrezorClientDebugLink` was moved to `debuglink` module - changed signature of `trezorlib.btc.sign_tx` - `@field` decorator was replaced by an argument to `@expect` ### Added - trezorlib now has a hardcoded check preventing use of outdated firmware versions [#283] - Ripple support [#286] - Zencash support [#287] - Cardano support [#300] - Ontology support [#301] - Tezos support [#302] - Capricoin support [#325] - limited Monero support (can only get address/watch key, monerowallet is required for signing) - support for input flow in tests makes it easier to control complex UI workflows [#314] - `protobuf.dict_to_proto` can create a protobuf instance from a plain dict - support for smarter methods in trezord 2.0.25 and up - support for seedless setup - trezorctl: firmware handling is greatly improved [#304], [#308] - trezorctl: Bitcoin-like signing flow is more user-friendly - `tx_api` now supports Blockbook backend servers ### Changed - better reporting for debuglink expected messages - replaced Ed25519 module with a cleaner, optimized version - further reorganization of transports makes them more robust when dependencies are missing - codebase now follows [Black](https://github.com/ambv/black) code style - in Qt modules, Qt5 is imported first [#315] - `TxApiInsight` is just `TxApi` - `device.reset` and `device.recover` now have reasonable defaults for all arguments - protobuf classes are no longer part of the source distribution and must be compiled locally [#284] - Stellar: addresses are always strings ### Removed - `set_tx_api` method on `TrezorClient` is replaced by an argument for `sign_tx` - caching functionality of `TxApi` was moved to a separate test-support class - Stellar: public key methods removed - `EncryptMessage` and `DecryptMessage` actions are gone ### Fixed: - `TrezorClient` can now detect when a HID device is removed and a different one is plugged in on the same path - trezorctl now works with Click 7.0 and considers "`_`" and "`-`" as same in command names [#314] - bash completion fixed - Stellar: several bugs in the XDR parser were fixed ## [0.10.2] - 2018-06-21 [0.10.2]: https://github.com/trezor/python-trezor/compare/v0.10.1...v0.10.2 ### Added - `stellar_get_address` and `_public_key` functions support `show_display` parameter - trezorctl: `stellar_get_address` and `_public_key` commands for the respective functionality ### Removed - trezorctl: `list_coins` is removed because we no longer parse the relevant protobuf field (and newer Trezor firmwares don't send it) [#277] ### Fixed - test support module was not included in the release, so code relying on the deprecated `ckd_public` module would fail [#280] ## [0.10.1] - 2018-06-11 [0.10.1]: https://github.com/trezor/python-trezor/compare/v0.10.0...v0.10.1 ### Fixed - previous release fails to build on Windows [#274] ## [0.10.0] - 2018-06-08 [0.10.0]: https://github.com/trezor/python-trezor/compare/v0.9.1...v0.10.0 ### Added - Lisk support [#197] - Stellar support [#167], [#268] - Wanchain support [#230] - support for "auto lock delay" feature - `TrezorClient` takes an additional argument `state` that allows reusing the previously entered passphrase [#241] - USB transports mention udev rules in exception messages [#245] - `log.enable_debug_output` function turns on wire logging, instead of having to use `TrezorClientVerbose` - BIP32 paths now support `123h` in addition to `123'` to indicate hardening - trezorctl: `-p` now supports prefix search for device path [#226] - trezorctl: smarter handling of firmware updates [#242], [#269] ### Changed - reorganized transports and moved into their own `transport` submodule - protobuf messages and coins info is now regenerated at build time from the `trezor-common` repository [#248] - renamed `ed25519raw` to `_ed25519` to indicate its privateness - renamed `ed25519cosi` to `cosi` and expanded its API - protobuf messages are now logged through Python's `logging` facility instead of custom printing through `VerboseWireMixin` - `client.format_protobuf` is moved to `protobuf.format_message` - `tools.Hash` is renamed to `tools.btc_hash` - `coins` module `coins_txapi` is renamed to `tx_api`. `coins_slip44` is renamed to `slip44`. - build: stricter flake8 checks - build: split requirements to separate files - tests: unified finding test device, while respecting `TREZOR_PATH` env variable. - tests: auto-skip appropriately marked tests based on Trezor device version - tests: only show wire output when run with `-v` - tests: allow running `xfail`ed tests selectively based on `pytest.ini` - docs: updated README with clearer install instructions [#185] - docs: switched changelog to Keep a Changelog format [#94] ### Deprecated - `ckd_public` is only maintained in `tests.support` submodule and considered private - `TrezorClient.expand_path` is moved to plain function `tools.parse_path` - `TrezorDevice` is deprecated in favor of `transport.enumerate_devices` and `transport.get_transport` - XPUB-related handling in `tools` is slated for removal ### Removed - most Python 2 compatibility constructs are gone [#229] - `TrezorClientVerbose` and `VerboseWireMixin` is removed - specific `tx_api.TxApi*` classes removed in favor of `coins.tx_api` - `client.PRIME_DERIVATION_FLAG` is removed in favor of `tools.HARDENED_FLAG` and `tools.H_()` - hard dependency on Ethereum libraries and HIDAPI is changed into extras that need to be specified explicitly. Require `trezor[hidapi]` or `trezor[ethereum]` to get them. ### Fixed - WebUSB enumeration returning bad devices on Windows 10 [#223] - `sign_tx` operation sending empty address string [#237] - Wrongly formatted Ethereum signatures [#236] - protobuf layer would wrongly encode signed integers [#249], [#250] - protobuf pretty-printing broken on Python 3.4 [#256] - trezorctl: Matrix recovery on Windows wouldn't allow backspace [#207] - aes_encfs_getpass.py: fixed Python 3 bug [#169] ## [0.9.1] - 2018-03-05 [0.9.1]: https://github.com/trezor/python-trezor/compare/v0.9.0...v0.9.1 ### Added - proper support for Trezor model T - support for Monacoin - improvements to `trezorctl`: - add pretty-printing of features and protobuf debug dumps (fixes [#199]) - support `TREZOR_PATH` environment variable to preselect a Trezor device. ### Removed - gradually dropping Python 2 compatibility (pypi package will now be marked as Python 3 only) [#94]: https://github.com/trezor/python-trezor/issues/94 [#167]: https://github.com/trezor/python-trezor/issues/167 [#169]: https://github.com/trezor/python-trezor/issues/169 [#185]: https://github.com/trezor/python-trezor/issues/185 [#197]: https://github.com/trezor/python-trezor/issues/197 [#199]: https://github.com/trezor/python-trezor/issues/199 [#207]: https://github.com/trezor/python-trezor/issues/207 [#223]: https://github.com/trezor/python-trezor/issues/223 [#226]: https://github.com/trezor/python-trezor/issues/226 [#229]: https://github.com/trezor/python-trezor/issues/229 [#230]: https://github.com/trezor/python-trezor/issues/230 [#236]: https://github.com/trezor/python-trezor/issues/236 [#237]: https://github.com/trezor/python-trezor/issues/237 [#241]: https://github.com/trezor/python-trezor/issues/241 [#242]: https://github.com/trezor/python-trezor/issues/242 [#245]: https://github.com/trezor/python-trezor/issues/245 [#248]: https://github.com/trezor/python-trezor/issues/248 [#249]: https://github.com/trezor/python-trezor/issues/249 [#250]: https://github.com/trezor/python-trezor/issues/250 [#256]: https://github.com/trezor/python-trezor/issues/256 [#268]: https://github.com/trezor/python-trezor/issues/268 [#269]: https://github.com/trezor/python-trezor/issues/269 [#274]: https://github.com/trezor/python-trezor/issues/274 [#276]: https://github.com/trezor/python-trezor/issues/276 [#277]: https://github.com/trezor/python-trezor/issues/277 [#280]: https://github.com/trezor/python-trezor/issues/280 [#283]: https://github.com/trezor/python-trezor/issues/283 [#284]: https://github.com/trezor/python-trezor/issues/284 [#286]: https://github.com/trezor/python-trezor/issues/286 [#287]: https://github.com/trezor/python-trezor/issues/287 [#300]: https://github.com/trezor/python-trezor/issues/300 [#301]: https://github.com/trezor/python-trezor/issues/301 [#302]: https://github.com/trezor/python-trezor/issues/302 [#304]: https://github.com/trezor/python-trezor/issues/304 [#307]: https://github.com/trezor/python-trezor/issues/307 [#308]: https://github.com/trezor/python-trezor/issues/308 [#312]: https://github.com/trezor/python-trezor/issues/312 [#314]: https://github.com/trezor/python-trezor/issues/314 [#315]: https://github.com/trezor/python-trezor/issues/315 [#325]: https://github.com/trezor/python-trezor/issues/325 [#349]: https://github.com/trezor/python-trezor/issues/349 [#351]: https://github.com/trezor/python-trezor/issues/351 [#352]: https://github.com/trezor/python-trezor/issues/352 [f#41]: https://github.com/trezor/trezor-firmware/issues/41 [f#87]: https://github.com/trezor/trezor-firmware/issues/87 [f#117]: https://github.com/trezor/trezor-firmware/issues/117 [f#224]: https://github.com/trezor/trezor-firmware/issues/224 [f#363]: https://github.com/trezor/trezor-firmware/issues/363 [f#411]: https://github.com/trezor/trezor-firmware/issues/411 [f#420]: https://github.com/trezor/trezor-firmware/issues/420 [f#445]: https://github.com/trezor/trezor-firmware/issues/445 [f#510]: https://github.com/trezor/trezor-firmware/issues/510 [f#525]: https://github.com/trezor/trezor-firmware/issues/525 [f#666]: https://github.com/trezor/trezor-firmware/issues/666 [f#680]: https://github.com/trezor/trezor-firmware/issues/680 [f#681]: https://github.com/trezor/trezor-firmware/issues/681 [f#778]: https://github.com/trezor/trezor-firmware/issues/778 Platform: UNKNOWN Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3) Classifier: Operating System :: POSIX :: Linux Classifier: Operating System :: Microsoft :: Windows Classifier: Operating System :: MacOS :: MacOS X Classifier: Programming Language :: Python :: 3 :: Only Requires-Python: >=3.5 Description-Content-Type: text/markdown Provides-Extra: ethereum Provides-Extra: hidapi python-trezor-0.11.6/README.md000066400000000000000000000110031361427340300157200ustar00rootroot00000000000000# python-trezor [![image](https://travis-ci.org/trezor/python-trezor.svg?branch=master)](https://travis-ci.org/trezor/python-trezor) [![repology](https://repology.org/badge/tiny-repos/python:trezor.svg)](https://repology.org/metapackage/python:trezor) [![image](https://badges.gitter.im/trezor/community.svg)](https://gitter.im/trezor/community) Python library and commandline client for communicating with Trezor Hardware Wallet See for more information ## Install Python-trezor requires Python 3.5 or higher, and libusb 1.0. The easiest way to install it is with `pip`. The rest of this guide assumes you have a working `pip`; if not, you can refer to [this guide](https://packaging.python.org/tutorials/installing-packages/). ### Quick installation On a typical Linux / Mac / BSD system, you already have all you need. Install `trezor` with: ```sh pip3 install --upgrade setuptools pip3 install trezor ``` On Windows, you also need to install [libusb](https://github.com/libusb/libusb/wiki/Windows) and the appropriate [drivers](https://zadig.akeo.ie/). This is, unfortunately, a topic bigger than this README. ### Older Trezor One support If your Trezor One is on firmware **1.6.3** or older, you will need HIDAPI support for it to be recognized. That requires additional packages. #### Debian / Ubuntu On a Debian or Ubuntu based system, you can install these: ```sh sudo apt-get install python3-dev python3-pip cython3 libusb-1.0-0-dev libudev-dev ``` #### Windows On a Windows based system, you can install these (for more info on choco, refer to [this](https://chocolatey.org/install)): ```sh choco install vcbuildtools python3 protoc refreshenv pip3 install protobuf ``` When installing the trezor library, you need to specify that you want `hidapi`: ```sh pip3 install --upgrade setuptools pip3 install trezor[hidapi] ``` ### Ethereum support Ethereum requires additional python packages. Instead of `pip3 install trezor`, specify `pip3 install trezor[ethereum]`. You can combine it with the above, to get both HIDAPI and Ethereum support: ```sh pip3 install trezor[ethereum,hidapi] ``` ### FreeBSD On FreeBSD you can install the packages: ```sh pkg install security/py-trezor ``` or build via ports: ```sh cd /usr/ports/security/py-trezor make install clean ``` ### Building from source Sometimes you might need to install the latest-and-greatest unreleased version straight from GitHub. You will need some prerequisites first: ```sh sudo apt-get install protobuf-compiler protobuf-dev pip3 install protobuf ``` If you just need to install the package, you can use pip again: ```sh pip3 install git+https://github.com/trezor/python-trezor ``` If you want to work on the sources, make a local clone: ```sh git clone https://github.com/trezor/python-trezor cd python-trezor python3 setup.py prebuild python3 setup.py develop ``` ## Command line client (trezorctl) The included `trezorctl` python script can perform various tasks such as changing setting in the Trezor, signing transactions, retrieving account info and addresses. See the [docs/](docs/) sub folder for detailed examples and options. NOTE: An older version of the `trezorctl` command is [available for Debian Stretch](https://packages.debian.org/en/stretch/python-trezor) (and comes pre-installed on [Tails OS](https://tails.boum.org/)). ## Python Library You can use this python library to interact with a Bitcoin Trezor and use its capabilities in your application. See examples here in the [tools/](tools/) sub folder. ## PIN Entering When you are asked for PIN, you have to enter scrambled PIN. Follow the numbers shown on Trezor display and enter the their positions using the numeric keyboard mapping: | | | | |---|---|---| | 7 | 8 | 9 | | 4 | 5 | 6 | | 1 | 2 | 3 | Example: your PIN is **1234** and Trezor is displaying the following: | | | | |---|---|---| | 2 | 8 | 3 | | 5 | 4 | 6 | | 7 | 9 | 1 | You have to enter: **3795** ## Contributing Python-trezor pulls coins info and protobuf messages from [trezor-common](https://github.com/trezor/trezor-common) repository. If you are developing new features for Trezor, you will want to start there. Once your changes are accepted to `trezor-common`, you can make a PR against this repository. Don't forget to update the submodule with: ```sh git submodule update --init --remote ``` Then, rebuild the protobuf messages and get `coins.json` by running: ```sh python3 setup.py prebuild ``` To get support for BTC-like coins, these steps are enough and no further changes to the library are necessary. python-trezor-0.11.6/bash_completion.d/000077500000000000000000000000001361427340300200365ustar00rootroot00000000000000python-trezor-0.11.6/bash_completion.d/trezorctl.sh000066400000000000000000000007751361427340300224330ustar00rootroot00000000000000_trezorctl() { export TREZORCTL_COMPLETION_CACHE local cur prev cmds base COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" if [ -z "$TREZORCTL_COMPLETION_CACHE" ]; then help_output=$(trezorctl --help | grep '^ [a-z]' | awk '{ print $1 }') export TREZORCTL_COMPLETION_CACHE="$help_output" fi cmds="$TREZORCTL_COMPLETION_CACHE" COMPREPLY=($(compgen -W "${cmds}" -- ${cur})) return 0 } complete -F _trezorctl trezorctl python-trezor-0.11.6/requirements-optional.txt000066400000000000000000000000611361427340300215520ustar00rootroot00000000000000hidapi >= 0.7.99.post20 rlp >= 1.1.0 web3 >= 4.8 python-trezor-0.11.6/requirements.txt000066400000000000000000000002241361427340300177300ustar00rootroot00000000000000ecdsa>=0.9 mnemonic>=0.17 requests>=2.4.0 click>=7,<8 libusb1>=1.6.4 construct>=2.9 typing_extensions>=3.7.4 pyblake2>=0.9.3 ; python_version<'3.6' python-trezor-0.11.6/setup.cfg000066400000000000000000000010011361427340300162570ustar00rootroot00000000000000[flake8] filename = *.py exclude = .tox/, build/, dist/, vendor/, src/trezorlib/messages/__init__.py ignore = E203, E221, E241, E402, E501, E741, W503 [isort] multi_line_output = 3 include_trailing_comma = True force_grid_wrap = 0 combine_as_imports = True line_length = 88 not_skip = __init__.py known_first_party = trezorlib known_third_party = hidapi, rlp, ethjsonrpc, ecdsa, mnemonic, shamir_mnemonic, requests, click, pyblake2, \ usb, construct, pytest [egg_info] tag_build = tag_date = 0 python-trezor-0.11.6/setup.py000077500000000000000000000044101361427340300161620ustar00rootroot00000000000000#!/usr/bin/env python3 import os.path import re from distutils.errors import DistutilsError from setuptools import Command, find_packages, setup install_requires = [ "setuptools>=19.0", "ecdsa>=0.9", "mnemonic>=0.17", "requests>=2.4.0", "click>=7,<8", "libusb1>=1.6.4", "construct>=2.9", "typing_extensions>=3.7.4", "pyblake2>=0.9.3 ; python_version<'3.6'", ] CWD = os.path.dirname(os.path.realpath(__file__)) def read(*path): filename = os.path.join(CWD, *path) with open(filename, "r") as f: return f.read() def find_version(): version_file = read("src", "trezorlib", "__init__.py") version_match = re.search(r"^__version__ = \"(.*)\"$", version_file, re.M) if version_match: return version_match.group(1) else: raise RuntimeError("Version string not found") class PrebuildCommand(Command): description = "Deprecated. Run 'make gen' instead." user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): raise DistutilsError(self.description) setup( name="trezor", version=find_version(), author="Trezor", author_email="info@trezor.io", license="LGPLv3", description="Python library for communicating with Trezor Hardware Wallet", long_description="{}\n\n{}".format(read("README.md"), read("CHANGELOG.md")), long_description_content_type="text/markdown", url="https://github.com/trezor/python-trezor", packages=find_packages("src"), package_dir={"": "src"}, package_data={"trezorlib": ["coins.json"]}, entry_points={"console_scripts": ["trezorctl=trezorlib.cli.trezorctl:cli"]}, install_requires=install_requires, extras_require={ "hidapi": ["hidapi>=0.7.99.post20"], "ethereum": ["rlp>=1.1.0", "web3>=4.8"], }, python_requires=">=3.5", include_package_data=True, zip_safe=False, classifiers=[ "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)", "Operating System :: POSIX :: Linux", "Operating System :: Microsoft :: Windows", "Operating System :: MacOS :: MacOS X", "Programming Language :: Python :: 3 :: Only", ], cmdclass={"prebuild": PrebuildCommand}, ) python-trezor-0.11.6/src/000077500000000000000000000000001361427340300152355ustar00rootroot00000000000000python-trezor-0.11.6/src/trezor.egg-info/000077500000000000000000000000001361427340300202545ustar00rootroot00000000000000python-trezor-0.11.6/src/trezor.egg-info/PKG-INFO000066400000000000000000000607641361427340300213660ustar00rootroot00000000000000Metadata-Version: 2.1 Name: trezor Version: 0.11.6 Summary: Python library for communicating with Trezor Hardware Wallet Home-page: https://github.com/trezor/python-trezor Author: Trezor Author-email: info@trezor.io License: LGPLv3 Description: # python-trezor [![image](https://travis-ci.org/trezor/python-trezor.svg?branch=master)](https://travis-ci.org/trezor/python-trezor) [![repology](https://repology.org/badge/tiny-repos/python:trezor.svg)](https://repology.org/metapackage/python:trezor) [![image](https://badges.gitter.im/trezor/community.svg)](https://gitter.im/trezor/community) Python library and commandline client for communicating with Trezor Hardware Wallet See for more information ## Install Python-trezor requires Python 3.5 or higher, and libusb 1.0. The easiest way to install it is with `pip`. The rest of this guide assumes you have a working `pip`; if not, you can refer to [this guide](https://packaging.python.org/tutorials/installing-packages/). ### Quick installation On a typical Linux / Mac / BSD system, you already have all you need. Install `trezor` with: ```sh pip3 install --upgrade setuptools pip3 install trezor ``` On Windows, you also need to install [libusb](https://github.com/libusb/libusb/wiki/Windows) and the appropriate [drivers](https://zadig.akeo.ie/). This is, unfortunately, a topic bigger than this README. ### Older Trezor One support If your Trezor One is on firmware **1.6.3** or older, you will need HIDAPI support for it to be recognized. That requires additional packages. #### Debian / Ubuntu On a Debian or Ubuntu based system, you can install these: ```sh sudo apt-get install python3-dev python3-pip cython3 libusb-1.0-0-dev libudev-dev ``` #### Windows On a Windows based system, you can install these (for more info on choco, refer to [this](https://chocolatey.org/install)): ```sh choco install vcbuildtools python3 protoc refreshenv pip3 install protobuf ``` When installing the trezor library, you need to specify that you want `hidapi`: ```sh pip3 install --upgrade setuptools pip3 install trezor[hidapi] ``` ### Ethereum support Ethereum requires additional python packages. Instead of `pip3 install trezor`, specify `pip3 install trezor[ethereum]`. You can combine it with the above, to get both HIDAPI and Ethereum support: ```sh pip3 install trezor[ethereum,hidapi] ``` ### FreeBSD On FreeBSD you can install the packages: ```sh pkg install security/py-trezor ``` or build via ports: ```sh cd /usr/ports/security/py-trezor make install clean ``` ### Building from source Sometimes you might need to install the latest-and-greatest unreleased version straight from GitHub. You will need some prerequisites first: ```sh sudo apt-get install protobuf-compiler protobuf-dev pip3 install protobuf ``` If you just need to install the package, you can use pip again: ```sh pip3 install git+https://github.com/trezor/python-trezor ``` If you want to work on the sources, make a local clone: ```sh git clone https://github.com/trezor/python-trezor cd python-trezor python3 setup.py prebuild python3 setup.py develop ``` ## Command line client (trezorctl) The included `trezorctl` python script can perform various tasks such as changing setting in the Trezor, signing transactions, retrieving account info and addresses. See the [docs/](docs/) sub folder for detailed examples and options. NOTE: An older version of the `trezorctl` command is [available for Debian Stretch](https://packages.debian.org/en/stretch/python-trezor) (and comes pre-installed on [Tails OS](https://tails.boum.org/)). ## Python Library You can use this python library to interact with a Bitcoin Trezor and use its capabilities in your application. See examples here in the [tools/](tools/) sub folder. ## PIN Entering When you are asked for PIN, you have to enter scrambled PIN. Follow the numbers shown on Trezor display and enter the their positions using the numeric keyboard mapping: | | | | |---|---|---| | 7 | 8 | 9 | | 4 | 5 | 6 | | 1 | 2 | 3 | Example: your PIN is **1234** and Trezor is displaying the following: | | | | |---|---|---| | 2 | 8 | 3 | | 5 | 4 | 6 | | 7 | 9 | 1 | You have to enter: **3795** ## Contributing Python-trezor pulls coins info and protobuf messages from [trezor-common](https://github.com/trezor/trezor-common) repository. If you are developing new features for Trezor, you will want to start there. Once your changes are accepted to `trezor-common`, you can make a PR against this repository. Don't forget to update the submodule with: ```sh git submodule update --init --remote ``` Then, rebuild the protobuf messages and get `coins.json` by running: ```sh python3 setup.py prebuild ``` To get support for BTC-like coins, these steps are enough and no further changes to the library are necessary. # Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). _At the moment, the project does **not** adhere to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). That is expected to change with version 1.0._ ## [0.11.6] - 2019-12-30 [0.11.6]: https://github.com/trezor/trezor-firmware/compare/python/v0.11.5...python/v0.11.6 ### Added - support for get-and-increase FIDO counter operation - support for setting wipe code - `trezorctl device recover` supports `--u2f-counter` option to set the FIDO counter to a custom value ### Changed - `trezorctl` command was reworked for ease of use and maintenance. See `trezorctl --help` and `OPTIONS.rst` for details. [f#510] - updated EOS transaction parser to match `cleos` in `delegatebw` and `undelegatebw` actions [f#680] [f#681] - `RecoveryDevice` does not set fields when doing dry-run recovery [f#666] ### Fixed - fixed "expand words" functionality in `trezorctl device recover` [f#778] ### Removed - trezorctl no longer interactively signs Bitcoin-like transactions, the only allowed input format is JSON. See [`docs/transaction-format.md`](docs/transaction-format.md) for details. - support for "load device by xprv" was removed from firmware and trezorlib ## [0.11.5] - 2019-09-26 [0.11.5]: https://github.com/trezor/trezor-firmware/compare/python/v0.11.4...python/v0.11.5 ### Added - trezorctl can dump raw protobuf bytes in debug output [f#117] - trezorctl shows a warning when activating Shamir Backup if the device does not support it [f#445] - warnings are emitted when encountering unknown value for a protobuf enum [f#363] - debug messages show enum value names instead of raw numbers - support for packed repeated encoding in the protobuf decoder - in `trezorctl firmware-update`, the new `--beta` switch enables downloading beta firmwares. By default, only stable firmware is used. [f#411], [f#420] - in `trezorctl firmware-update`, the new `--bitcoin-only` switch enables downloading Bitcoin-only firmware - support for FIDO2 resident credential management - support for SD-protect features ### Changed - package directory structure was changed: `src` subdirectory contains sources and `tests` subdirectory contains tests, so that cwd is not cluttered - `trezorctl` script was moved into a module `trezorlib.cli.trezorctl` and is launched through the `entry_points` mechanism. This makes it usable on Windows - `pyblake2` is no longer required on Python 3.6 and up - input flows can only be used in with-block (only relevant for unit tests) - if not specified, trezorctl will set label to "SLIP-0014" in SLIP-0014 mode - in `clear_session` the client also forgets the passphrase state for TT [f#525] ### Fixed - trezorctl will properly check if a firmware is present on a new T1 [f#224] ### Removed - device test suite was moved out of trezor package ## [0.11.4] - 2019-07-31 [0.11.4]: https://github.com/trezor/trezor-firmware/compare/python/v0.11.3...python/v0.11.4 ### Added - trezorctl support for SLIP-39 Shamir Backup - support for Binance Chain ## [0.11.3] - 2019-05-29 [0.11.3]: https://github.com/trezor/trezor-firmware/compare/python/v0.11.2...python/v0.11.3 ### Added - trezorctl can now send ERC20 tokens - trezorctl usb-reset will perform USB reset on devices in inconsistent state - set-display-rotation command added for TT firmware 2.1.1 - EOS support [f#87] - Tezos: add voting support [f#41] - `dict_to_proto` now allows enum values as strings ### Changed - Minimum firmware versions bumped to 1.8.0 and 2.1.0 - Cleaner errors when UI object is not supplied - Generated files are now part of the source tarball again. That means that `protoc` is no longer required. ### Fixed - Ethereum commands in trezorctl now work - Memory debugging tools now work again ### Removed - Tron and Ontology support removed until implementations exist in Trezor firmware ## [0.11.2] - 2019-02-27 [0.11.2]: https://github.com/trezor/python-trezor/compare/v0.11.1...v0.11.2 ### Added - full support for bootloader 1.8.0 and relevant firmware upgrade functionality - trezorctl: support fully offline signing JSON-encoded transaction data - trezorctl: dry-run for firmware upgrade command - client: new convenience function `get_default_client` for simple script usage - Dash: support DIP-2 special inputs [#351] - Ethereum: add get_public_key methods ### Changed - coins with BIP-143 fork id (BCH, BTG) won't require prev_tx [#352] - device recovery will restore U2F counter - Cardano: change `network` to `protocol_magic` - tests can run interactively when `INTERACT=1` environment variable is set - protobuf: improved `to_dict` function ### Deprecated - trezorctl: interactive signing with `sign-tx` is considered deprecated ## [0.11.1] - 2018-12-28 [0.11.1]: https://github.com/trezor/python-trezor/compare/v0.11.0...v0.11.1 ### Fixed - crash when entering passphrase on device with Trezor T - Qt widgets should only import QtCore [#349] ## [0.11.0] - 2018-12-06 [0.11.0]: https://github.com/trezor/python-trezor/compare/v0.10.2...v0.11.0 ### Incompatible changes - removed support for Python 3.3 and 3.4 - major refactor of `TrezorClient` and UI handling. Implementers must now provide a "UI" object instead of overriding callbacks [#307], [#314] - protobuf classes now use a `get_fields()` method instead of `FIELDS` field [#312] - all methods on `TrezorClient` class are now in separate modules and take a `TrezorClient` instance as argument [#276] - mixin classes are also removed, you are not supposed to extend `TrezorClient` anymore - `TrezorClientDebugLink` was moved to `debuglink` module - changed signature of `trezorlib.btc.sign_tx` - `@field` decorator was replaced by an argument to `@expect` ### Added - trezorlib now has a hardcoded check preventing use of outdated firmware versions [#283] - Ripple support [#286] - Zencash support [#287] - Cardano support [#300] - Ontology support [#301] - Tezos support [#302] - Capricoin support [#325] - limited Monero support (can only get address/watch key, monerowallet is required for signing) - support for input flow in tests makes it easier to control complex UI workflows [#314] - `protobuf.dict_to_proto` can create a protobuf instance from a plain dict - support for smarter methods in trezord 2.0.25 and up - support for seedless setup - trezorctl: firmware handling is greatly improved [#304], [#308] - trezorctl: Bitcoin-like signing flow is more user-friendly - `tx_api` now supports Blockbook backend servers ### Changed - better reporting for debuglink expected messages - replaced Ed25519 module with a cleaner, optimized version - further reorganization of transports makes them more robust when dependencies are missing - codebase now follows [Black](https://github.com/ambv/black) code style - in Qt modules, Qt5 is imported first [#315] - `TxApiInsight` is just `TxApi` - `device.reset` and `device.recover` now have reasonable defaults for all arguments - protobuf classes are no longer part of the source distribution and must be compiled locally [#284] - Stellar: addresses are always strings ### Removed - `set_tx_api` method on `TrezorClient` is replaced by an argument for `sign_tx` - caching functionality of `TxApi` was moved to a separate test-support class - Stellar: public key methods removed - `EncryptMessage` and `DecryptMessage` actions are gone ### Fixed: - `TrezorClient` can now detect when a HID device is removed and a different one is plugged in on the same path - trezorctl now works with Click 7.0 and considers "`_`" and "`-`" as same in command names [#314] - bash completion fixed - Stellar: several bugs in the XDR parser were fixed ## [0.10.2] - 2018-06-21 [0.10.2]: https://github.com/trezor/python-trezor/compare/v0.10.1...v0.10.2 ### Added - `stellar_get_address` and `_public_key` functions support `show_display` parameter - trezorctl: `stellar_get_address` and `_public_key` commands for the respective functionality ### Removed - trezorctl: `list_coins` is removed because we no longer parse the relevant protobuf field (and newer Trezor firmwares don't send it) [#277] ### Fixed - test support module was not included in the release, so code relying on the deprecated `ckd_public` module would fail [#280] ## [0.10.1] - 2018-06-11 [0.10.1]: https://github.com/trezor/python-trezor/compare/v0.10.0...v0.10.1 ### Fixed - previous release fails to build on Windows [#274] ## [0.10.0] - 2018-06-08 [0.10.0]: https://github.com/trezor/python-trezor/compare/v0.9.1...v0.10.0 ### Added - Lisk support [#197] - Stellar support [#167], [#268] - Wanchain support [#230] - support for "auto lock delay" feature - `TrezorClient` takes an additional argument `state` that allows reusing the previously entered passphrase [#241] - USB transports mention udev rules in exception messages [#245] - `log.enable_debug_output` function turns on wire logging, instead of having to use `TrezorClientVerbose` - BIP32 paths now support `123h` in addition to `123'` to indicate hardening - trezorctl: `-p` now supports prefix search for device path [#226] - trezorctl: smarter handling of firmware updates [#242], [#269] ### Changed - reorganized transports and moved into their own `transport` submodule - protobuf messages and coins info is now regenerated at build time from the `trezor-common` repository [#248] - renamed `ed25519raw` to `_ed25519` to indicate its privateness - renamed `ed25519cosi` to `cosi` and expanded its API - protobuf messages are now logged through Python's `logging` facility instead of custom printing through `VerboseWireMixin` - `client.format_protobuf` is moved to `protobuf.format_message` - `tools.Hash` is renamed to `tools.btc_hash` - `coins` module `coins_txapi` is renamed to `tx_api`. `coins_slip44` is renamed to `slip44`. - build: stricter flake8 checks - build: split requirements to separate files - tests: unified finding test device, while respecting `TREZOR_PATH` env variable. - tests: auto-skip appropriately marked tests based on Trezor device version - tests: only show wire output when run with `-v` - tests: allow running `xfail`ed tests selectively based on `pytest.ini` - docs: updated README with clearer install instructions [#185] - docs: switched changelog to Keep a Changelog format [#94] ### Deprecated - `ckd_public` is only maintained in `tests.support` submodule and considered private - `TrezorClient.expand_path` is moved to plain function `tools.parse_path` - `TrezorDevice` is deprecated in favor of `transport.enumerate_devices` and `transport.get_transport` - XPUB-related handling in `tools` is slated for removal ### Removed - most Python 2 compatibility constructs are gone [#229] - `TrezorClientVerbose` and `VerboseWireMixin` is removed - specific `tx_api.TxApi*` classes removed in favor of `coins.tx_api` - `client.PRIME_DERIVATION_FLAG` is removed in favor of `tools.HARDENED_FLAG` and `tools.H_()` - hard dependency on Ethereum libraries and HIDAPI is changed into extras that need to be specified explicitly. Require `trezor[hidapi]` or `trezor[ethereum]` to get them. ### Fixed - WebUSB enumeration returning bad devices on Windows 10 [#223] - `sign_tx` operation sending empty address string [#237] - Wrongly formatted Ethereum signatures [#236] - protobuf layer would wrongly encode signed integers [#249], [#250] - protobuf pretty-printing broken on Python 3.4 [#256] - trezorctl: Matrix recovery on Windows wouldn't allow backspace [#207] - aes_encfs_getpass.py: fixed Python 3 bug [#169] ## [0.9.1] - 2018-03-05 [0.9.1]: https://github.com/trezor/python-trezor/compare/v0.9.0...v0.9.1 ### Added - proper support for Trezor model T - support for Monacoin - improvements to `trezorctl`: - add pretty-printing of features and protobuf debug dumps (fixes [#199]) - support `TREZOR_PATH` environment variable to preselect a Trezor device. ### Removed - gradually dropping Python 2 compatibility (pypi package will now be marked as Python 3 only) [#94]: https://github.com/trezor/python-trezor/issues/94 [#167]: https://github.com/trezor/python-trezor/issues/167 [#169]: https://github.com/trezor/python-trezor/issues/169 [#185]: https://github.com/trezor/python-trezor/issues/185 [#197]: https://github.com/trezor/python-trezor/issues/197 [#199]: https://github.com/trezor/python-trezor/issues/199 [#207]: https://github.com/trezor/python-trezor/issues/207 [#223]: https://github.com/trezor/python-trezor/issues/223 [#226]: https://github.com/trezor/python-trezor/issues/226 [#229]: https://github.com/trezor/python-trezor/issues/229 [#230]: https://github.com/trezor/python-trezor/issues/230 [#236]: https://github.com/trezor/python-trezor/issues/236 [#237]: https://github.com/trezor/python-trezor/issues/237 [#241]: https://github.com/trezor/python-trezor/issues/241 [#242]: https://github.com/trezor/python-trezor/issues/242 [#245]: https://github.com/trezor/python-trezor/issues/245 [#248]: https://github.com/trezor/python-trezor/issues/248 [#249]: https://github.com/trezor/python-trezor/issues/249 [#250]: https://github.com/trezor/python-trezor/issues/250 [#256]: https://github.com/trezor/python-trezor/issues/256 [#268]: https://github.com/trezor/python-trezor/issues/268 [#269]: https://github.com/trezor/python-trezor/issues/269 [#274]: https://github.com/trezor/python-trezor/issues/274 [#276]: https://github.com/trezor/python-trezor/issues/276 [#277]: https://github.com/trezor/python-trezor/issues/277 [#280]: https://github.com/trezor/python-trezor/issues/280 [#283]: https://github.com/trezor/python-trezor/issues/283 [#284]: https://github.com/trezor/python-trezor/issues/284 [#286]: https://github.com/trezor/python-trezor/issues/286 [#287]: https://github.com/trezor/python-trezor/issues/287 [#300]: https://github.com/trezor/python-trezor/issues/300 [#301]: https://github.com/trezor/python-trezor/issues/301 [#302]: https://github.com/trezor/python-trezor/issues/302 [#304]: https://github.com/trezor/python-trezor/issues/304 [#307]: https://github.com/trezor/python-trezor/issues/307 [#308]: https://github.com/trezor/python-trezor/issues/308 [#312]: https://github.com/trezor/python-trezor/issues/312 [#314]: https://github.com/trezor/python-trezor/issues/314 [#315]: https://github.com/trezor/python-trezor/issues/315 [#325]: https://github.com/trezor/python-trezor/issues/325 [#349]: https://github.com/trezor/python-trezor/issues/349 [#351]: https://github.com/trezor/python-trezor/issues/351 [#352]: https://github.com/trezor/python-trezor/issues/352 [f#41]: https://github.com/trezor/trezor-firmware/issues/41 [f#87]: https://github.com/trezor/trezor-firmware/issues/87 [f#117]: https://github.com/trezor/trezor-firmware/issues/117 [f#224]: https://github.com/trezor/trezor-firmware/issues/224 [f#363]: https://github.com/trezor/trezor-firmware/issues/363 [f#411]: https://github.com/trezor/trezor-firmware/issues/411 [f#420]: https://github.com/trezor/trezor-firmware/issues/420 [f#445]: https://github.com/trezor/trezor-firmware/issues/445 [f#510]: https://github.com/trezor/trezor-firmware/issues/510 [f#525]: https://github.com/trezor/trezor-firmware/issues/525 [f#666]: https://github.com/trezor/trezor-firmware/issues/666 [f#680]: https://github.com/trezor/trezor-firmware/issues/680 [f#681]: https://github.com/trezor/trezor-firmware/issues/681 [f#778]: https://github.com/trezor/trezor-firmware/issues/778 Platform: UNKNOWN Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3) Classifier: Operating System :: POSIX :: Linux Classifier: Operating System :: Microsoft :: Windows Classifier: Operating System :: MacOS :: MacOS X Classifier: Programming Language :: Python :: 3 :: Only Requires-Python: >=3.5 Description-Content-Type: text/markdown Provides-Extra: ethereum Provides-Extra: hidapi python-trezor-0.11.6/src/trezor.egg-info/SOURCES.txt000066400000000000000000001100001361427340300221300ustar00rootroot00000000000000AUTHORS CHANGELOG.md COPYING MANIFEST.in README.md requirements-optional.txt requirements.txt setup.cfg setup.py bash_completion.d/trezorctl.sh src/trezor.egg-info/PKG-INFO src/trezor.egg-info/SOURCES.txt src/trezor.egg-info/dependency_links.txt src/trezor.egg-info/entry_points.txt src/trezor.egg-info/not-zip-safe src/trezor.egg-info/requires.txt src/trezor.egg-info/top_level.txt src/trezorlib/__init__.py src/trezorlib/_ed25519.py src/trezorlib/binance.py src/trezorlib/btc.py src/trezorlib/cardano.py src/trezorlib/ckd_public.py src/trezorlib/client.py src/trezorlib/coins.json src/trezorlib/coins.py src/trezorlib/cosi.py src/trezorlib/debuglink.py src/trezorlib/device.py src/trezorlib/eos.py src/trezorlib/ethereum.py src/trezorlib/exceptions.py src/trezorlib/fido.py src/trezorlib/firmware.py src/trezorlib/lisk.py src/trezorlib/log.py src/trezorlib/mapping.py src/trezorlib/misc.py src/trezorlib/monero.py src/trezorlib/nem.py src/trezorlib/protobuf.py src/trezorlib/ripple.py src/trezorlib/stellar.py src/trezorlib/tezos.py src/trezorlib/tools.py src/trezorlib/tx_api.py src/trezorlib/ui.py src/trezorlib/__pycache__/__init__.cpython-36.pyc src/trezorlib/__pycache__/_ed25519.cpython-36.pyc src/trezorlib/__pycache__/binance.cpython-36.pyc src/trezorlib/__pycache__/btc.cpython-36.pyc src/trezorlib/__pycache__/cardano.cpython-36.pyc src/trezorlib/__pycache__/client.cpython-36.pyc src/trezorlib/__pycache__/coins.cpython-36.pyc src/trezorlib/__pycache__/cosi.cpython-36.pyc src/trezorlib/__pycache__/debuglink.cpython-36.pyc src/trezorlib/__pycache__/device.cpython-36.pyc src/trezorlib/__pycache__/eos.cpython-36.pyc src/trezorlib/__pycache__/ethereum.cpython-36.pyc src/trezorlib/__pycache__/exceptions.cpython-36.pyc src/trezorlib/__pycache__/fido.cpython-36.pyc src/trezorlib/__pycache__/firmware.cpython-36.pyc src/trezorlib/__pycache__/lisk.cpython-36.pyc src/trezorlib/__pycache__/log.cpython-36.pyc src/trezorlib/__pycache__/misc.cpython-36.pyc src/trezorlib/__pycache__/monero.cpython-36.pyc src/trezorlib/__pycache__/nem.cpython-36.pyc src/trezorlib/__pycache__/protobuf.cpython-36.pyc src/trezorlib/__pycache__/ripple.cpython-36.pyc src/trezorlib/__pycache__/stellar.cpython-36.pyc src/trezorlib/__pycache__/tezos.cpython-36.pyc src/trezorlib/__pycache__/tools.cpython-36.pyc src/trezorlib/__pycache__/tx_api.cpython-36.pyc src/trezorlib/__pycache__/ui.cpython-36.pyc src/trezorlib/_internal/toif.py src/trezorlib/cli/__init__.py src/trezorlib/cli/binance.py src/trezorlib/cli/btc.py src/trezorlib/cli/cardano.py src/trezorlib/cli/cosi.py src/trezorlib/cli/crypto.py src/trezorlib/cli/device.py src/trezorlib/cli/eos.py src/trezorlib/cli/ethereum.py src/trezorlib/cli/fido.py src/trezorlib/cli/firmware.py src/trezorlib/cli/lisk.py src/trezorlib/cli/monero.py src/trezorlib/cli/nem.py src/trezorlib/cli/ripple.py src/trezorlib/cli/settings.py src/trezorlib/cli/stellar.py src/trezorlib/cli/tezos.py src/trezorlib/cli/trezorctl.py src/trezorlib/cli/__pycache__/__init__.cpython-36.pyc src/trezorlib/cli/__pycache__/binance.cpython-36.pyc src/trezorlib/cli/__pycache__/btc.cpython-36.pyc src/trezorlib/cli/__pycache__/cardano.cpython-36.pyc src/trezorlib/cli/__pycache__/cosi.cpython-36.pyc src/trezorlib/cli/__pycache__/crypto.cpython-36.pyc src/trezorlib/cli/__pycache__/device.cpython-36.pyc src/trezorlib/cli/__pycache__/eos.cpython-36.pyc src/trezorlib/cli/__pycache__/ethereum.cpython-36.pyc src/trezorlib/cli/__pycache__/fido.cpython-36.pyc src/trezorlib/cli/__pycache__/firmware.cpython-36.pyc src/trezorlib/cli/__pycache__/lisk.cpython-36.pyc src/trezorlib/cli/__pycache__/monero.cpython-36.pyc src/trezorlib/cli/__pycache__/nem.cpython-36.pyc src/trezorlib/cli/__pycache__/ripple.cpython-36.pyc src/trezorlib/cli/__pycache__/settings.cpython-36.pyc src/trezorlib/cli/__pycache__/stellar.cpython-36.pyc src/trezorlib/cli/__pycache__/tezos.cpython-36.pyc src/trezorlib/cli/__pycache__/trezorctl.cpython-36.pyc src/trezorlib/messages/.keep src/trezorlib/messages/Address.py src/trezorlib/messages/ApplyFlags.py src/trezorlib/messages/ApplySettings.py src/trezorlib/messages/BackupDevice.py src/trezorlib/messages/BackupType.py src/trezorlib/messages/BinanceAddress.py src/trezorlib/messages/BinanceCancelMsg.py src/trezorlib/messages/BinanceCoin.py src/trezorlib/messages/BinanceGetAddress.py src/trezorlib/messages/BinanceGetPublicKey.py src/trezorlib/messages/BinanceInputOutput.py src/trezorlib/messages/BinanceOrderMsg.py src/trezorlib/messages/BinanceOrderSide.py src/trezorlib/messages/BinanceOrderType.py src/trezorlib/messages/BinancePublicKey.py src/trezorlib/messages/BinanceSignTx.py src/trezorlib/messages/BinanceSignedTx.py src/trezorlib/messages/BinanceTimeInForce.py src/trezorlib/messages/BinanceTransferMsg.py src/trezorlib/messages/BinanceTxRequest.py src/trezorlib/messages/ButtonAck.py src/trezorlib/messages/ButtonRequest.py src/trezorlib/messages/ButtonRequestType.py src/trezorlib/messages/Cancel.py src/trezorlib/messages/Capability.py src/trezorlib/messages/CardanoAddress.py src/trezorlib/messages/CardanoGetAddress.py src/trezorlib/messages/CardanoGetPublicKey.py src/trezorlib/messages/CardanoPublicKey.py src/trezorlib/messages/CardanoSignTx.py src/trezorlib/messages/CardanoSignedTx.py src/trezorlib/messages/CardanoTxAck.py src/trezorlib/messages/CardanoTxInputType.py src/trezorlib/messages/CardanoTxOutputType.py src/trezorlib/messages/CardanoTxRequest.py src/trezorlib/messages/ChangePin.py src/trezorlib/messages/ChangeWipeCode.py src/trezorlib/messages/CipherKeyValue.py src/trezorlib/messages/CipheredKeyValue.py src/trezorlib/messages/ClearSession.py src/trezorlib/messages/CosiCommit.py src/trezorlib/messages/CosiCommitment.py src/trezorlib/messages/CosiSign.py src/trezorlib/messages/CosiSignature.py src/trezorlib/messages/DebugLinkDecision.py src/trezorlib/messages/DebugLinkFlashErase.py src/trezorlib/messages/DebugLinkGetState.py src/trezorlib/messages/DebugLinkLayout.py src/trezorlib/messages/DebugLinkLog.py src/trezorlib/messages/DebugLinkMemory.py src/trezorlib/messages/DebugLinkMemoryRead.py src/trezorlib/messages/DebugLinkMemoryWrite.py src/trezorlib/messages/DebugLinkState.py src/trezorlib/messages/DebugLinkStop.py src/trezorlib/messages/DebugMoneroDiagAck.py src/trezorlib/messages/DebugMoneroDiagRequest.py src/trezorlib/messages/DebugSwipeDirection.py src/trezorlib/messages/ECDHSessionKey.py src/trezorlib/messages/Entropy.py src/trezorlib/messages/EntropyAck.py src/trezorlib/messages/EntropyRequest.py src/trezorlib/messages/EosActionBuyRam.py src/trezorlib/messages/EosActionBuyRamBytes.py src/trezorlib/messages/EosActionCommon.py src/trezorlib/messages/EosActionDelegate.py src/trezorlib/messages/EosActionDeleteAuth.py src/trezorlib/messages/EosActionLinkAuth.py src/trezorlib/messages/EosActionNewAccount.py src/trezorlib/messages/EosActionRefund.py src/trezorlib/messages/EosActionSellRam.py src/trezorlib/messages/EosActionTransfer.py src/trezorlib/messages/EosActionUndelegate.py src/trezorlib/messages/EosActionUnknown.py src/trezorlib/messages/EosActionUnlinkAuth.py src/trezorlib/messages/EosActionUpdateAuth.py src/trezorlib/messages/EosActionVoteProducer.py src/trezorlib/messages/EosAsset.py src/trezorlib/messages/EosAuthorization.py src/trezorlib/messages/EosAuthorizationAccount.py src/trezorlib/messages/EosAuthorizationKey.py src/trezorlib/messages/EosAuthorizationWait.py src/trezorlib/messages/EosGetPublicKey.py src/trezorlib/messages/EosPermissionLevel.py src/trezorlib/messages/EosPublicKey.py src/trezorlib/messages/EosSignTx.py src/trezorlib/messages/EosSignedTx.py src/trezorlib/messages/EosTxActionAck.py src/trezorlib/messages/EosTxActionRequest.py src/trezorlib/messages/EosTxHeader.py src/trezorlib/messages/EthereumAddress.py src/trezorlib/messages/EthereumGetAddress.py src/trezorlib/messages/EthereumGetPublicKey.py src/trezorlib/messages/EthereumMessageSignature.py src/trezorlib/messages/EthereumPublicKey.py src/trezorlib/messages/EthereumSignMessage.py src/trezorlib/messages/EthereumSignTx.py src/trezorlib/messages/EthereumTxAck.py src/trezorlib/messages/EthereumTxRequest.py src/trezorlib/messages/EthereumVerifyMessage.py src/trezorlib/messages/Failure.py src/trezorlib/messages/FailureType.py src/trezorlib/messages/Features.py src/trezorlib/messages/FirmwareErase.py src/trezorlib/messages/FirmwareRequest.py src/trezorlib/messages/FirmwareUpload.py src/trezorlib/messages/GetAddress.py src/trezorlib/messages/GetECDHSessionKey.py src/trezorlib/messages/GetEntropy.py src/trezorlib/messages/GetFeatures.py src/trezorlib/messages/GetNextU2FCounter.py src/trezorlib/messages/GetPublicKey.py src/trezorlib/messages/HDNodePathType.py src/trezorlib/messages/HDNodeType.py src/trezorlib/messages/IdentityType.py src/trezorlib/messages/Initialize.py src/trezorlib/messages/InputScriptType.py src/trezorlib/messages/LiskAddress.py src/trezorlib/messages/LiskDelegateType.py src/trezorlib/messages/LiskGetAddress.py src/trezorlib/messages/LiskGetPublicKey.py src/trezorlib/messages/LiskMessageSignature.py src/trezorlib/messages/LiskMultisignatureType.py src/trezorlib/messages/LiskPublicKey.py src/trezorlib/messages/LiskSignMessage.py src/trezorlib/messages/LiskSignTx.py src/trezorlib/messages/LiskSignatureType.py src/trezorlib/messages/LiskSignedTx.py src/trezorlib/messages/LiskTransactionAsset.py src/trezorlib/messages/LiskTransactionCommon.py src/trezorlib/messages/LiskTransactionType.py src/trezorlib/messages/LiskVerifyMessage.py src/trezorlib/messages/LoadDevice.py src/trezorlib/messages/MessageSignature.py src/trezorlib/messages/MessageType.py src/trezorlib/messages/MoneroAccountPublicAddress.py src/trezorlib/messages/MoneroAddress.py src/trezorlib/messages/MoneroExportedKeyImage.py src/trezorlib/messages/MoneroGetAddress.py src/trezorlib/messages/MoneroGetTxKeyAck.py src/trezorlib/messages/MoneroGetTxKeyRequest.py src/trezorlib/messages/MoneroGetWatchKey.py src/trezorlib/messages/MoneroKeyImageExportInitAck.py src/trezorlib/messages/MoneroKeyImageExportInitRequest.py src/trezorlib/messages/MoneroKeyImageSyncFinalAck.py src/trezorlib/messages/MoneroKeyImageSyncFinalRequest.py src/trezorlib/messages/MoneroKeyImageSyncStepAck.py src/trezorlib/messages/MoneroKeyImageSyncStepRequest.py src/trezorlib/messages/MoneroLiveRefreshFinalAck.py src/trezorlib/messages/MoneroLiveRefreshFinalRequest.py src/trezorlib/messages/MoneroLiveRefreshStartAck.py src/trezorlib/messages/MoneroLiveRefreshStartRequest.py src/trezorlib/messages/MoneroLiveRefreshStepAck.py src/trezorlib/messages/MoneroLiveRefreshStepRequest.py src/trezorlib/messages/MoneroMultisigKLRki.py src/trezorlib/messages/MoneroOutputEntry.py src/trezorlib/messages/MoneroRctKeyPublic.py src/trezorlib/messages/MoneroRingCtSig.py src/trezorlib/messages/MoneroSubAddressIndicesList.py src/trezorlib/messages/MoneroTransactionAllInputsSetAck.py src/trezorlib/messages/MoneroTransactionAllInputsSetRequest.py src/trezorlib/messages/MoneroTransactionAllOutSetAck.py src/trezorlib/messages/MoneroTransactionAllOutSetRequest.py src/trezorlib/messages/MoneroTransactionData.py src/trezorlib/messages/MoneroTransactionDestinationEntry.py src/trezorlib/messages/MoneroTransactionFinalAck.py src/trezorlib/messages/MoneroTransactionFinalRequest.py src/trezorlib/messages/MoneroTransactionInitAck.py src/trezorlib/messages/MoneroTransactionInitRequest.py src/trezorlib/messages/MoneroTransactionInputViniAck.py src/trezorlib/messages/MoneroTransactionInputViniRequest.py src/trezorlib/messages/MoneroTransactionInputsPermutationAck.py src/trezorlib/messages/MoneroTransactionInputsPermutationRequest.py src/trezorlib/messages/MoneroTransactionRsigData.py src/trezorlib/messages/MoneroTransactionSetInputAck.py src/trezorlib/messages/MoneroTransactionSetInputRequest.py src/trezorlib/messages/MoneroTransactionSetOutputAck.py src/trezorlib/messages/MoneroTransactionSetOutputRequest.py src/trezorlib/messages/MoneroTransactionSignInputAck.py src/trezorlib/messages/MoneroTransactionSignInputRequest.py src/trezorlib/messages/MoneroTransactionSourceEntry.py src/trezorlib/messages/MoneroTransferDetails.py src/trezorlib/messages/MoneroWatchKey.py src/trezorlib/messages/MultisigRedeemScriptType.py src/trezorlib/messages/NEMAddress.py src/trezorlib/messages/NEMAggregateModification.py src/trezorlib/messages/NEMCosignatoryModification.py src/trezorlib/messages/NEMDecryptMessage.py src/trezorlib/messages/NEMDecryptedMessage.py src/trezorlib/messages/NEMGetAddress.py src/trezorlib/messages/NEMImportanceTransfer.py src/trezorlib/messages/NEMImportanceTransferMode.py src/trezorlib/messages/NEMModificationType.py src/trezorlib/messages/NEMMosaic.py src/trezorlib/messages/NEMMosaicCreation.py src/trezorlib/messages/NEMMosaicDefinition.py src/trezorlib/messages/NEMMosaicLevy.py src/trezorlib/messages/NEMMosaicSupplyChange.py src/trezorlib/messages/NEMProvisionNamespace.py src/trezorlib/messages/NEMSignTx.py src/trezorlib/messages/NEMSignedTx.py src/trezorlib/messages/NEMSupplyChangeType.py src/trezorlib/messages/NEMTransactionCommon.py src/trezorlib/messages/NEMTransfer.py src/trezorlib/messages/NextU2FCounter.py src/trezorlib/messages/OutputScriptType.py src/trezorlib/messages/PassphraseAck.py src/trezorlib/messages/PassphraseRequest.py src/trezorlib/messages/PassphraseSourceType.py src/trezorlib/messages/PassphraseStateAck.py src/trezorlib/messages/PassphraseStateRequest.py src/trezorlib/messages/PinMatrixAck.py src/trezorlib/messages/PinMatrixRequest.py src/trezorlib/messages/PinMatrixRequestType.py src/trezorlib/messages/Ping.py src/trezorlib/messages/PublicKey.py src/trezorlib/messages/RecoveryDevice.py src/trezorlib/messages/RecoveryDeviceType.py src/trezorlib/messages/RequestType.py src/trezorlib/messages/ResetDevice.py src/trezorlib/messages/RippleAddress.py src/trezorlib/messages/RippleGetAddress.py src/trezorlib/messages/RipplePayment.py src/trezorlib/messages/RippleSignTx.py src/trezorlib/messages/RippleSignedTx.py src/trezorlib/messages/SdProtect.py src/trezorlib/messages/SdProtectOperationType.py src/trezorlib/messages/SelfTest.py src/trezorlib/messages/SetU2FCounter.py src/trezorlib/messages/SignIdentity.py src/trezorlib/messages/SignMessage.py src/trezorlib/messages/SignTx.py src/trezorlib/messages/SignedIdentity.py src/trezorlib/messages/StellarAccountMergeOp.py src/trezorlib/messages/StellarAddress.py src/trezorlib/messages/StellarAllowTrustOp.py src/trezorlib/messages/StellarAssetType.py src/trezorlib/messages/StellarBumpSequenceOp.py src/trezorlib/messages/StellarChangeTrustOp.py src/trezorlib/messages/StellarCreateAccountOp.py src/trezorlib/messages/StellarCreatePassiveOfferOp.py src/trezorlib/messages/StellarGetAddress.py src/trezorlib/messages/StellarManageDataOp.py src/trezorlib/messages/StellarManageOfferOp.py src/trezorlib/messages/StellarPathPaymentOp.py src/trezorlib/messages/StellarPaymentOp.py src/trezorlib/messages/StellarSetOptionsOp.py src/trezorlib/messages/StellarSignTx.py src/trezorlib/messages/StellarSignedTx.py src/trezorlib/messages/StellarTxOpRequest.py src/trezorlib/messages/Success.py src/trezorlib/messages/TezosAddress.py src/trezorlib/messages/TezosBallotOp.py src/trezorlib/messages/TezosBallotType.py src/trezorlib/messages/TezosContractID.py src/trezorlib/messages/TezosContractType.py src/trezorlib/messages/TezosDelegationOp.py src/trezorlib/messages/TezosGetAddress.py src/trezorlib/messages/TezosGetPublicKey.py src/trezorlib/messages/TezosManagerTransfer.py src/trezorlib/messages/TezosOriginationOp.py src/trezorlib/messages/TezosParametersManager.py src/trezorlib/messages/TezosProposalOp.py src/trezorlib/messages/TezosPublicKey.py src/trezorlib/messages/TezosRevealOp.py src/trezorlib/messages/TezosSignTx.py src/trezorlib/messages/TezosSignedTx.py src/trezorlib/messages/TezosTransactionOp.py src/trezorlib/messages/TransactionType.py src/trezorlib/messages/TxAck.py src/trezorlib/messages/TxInputType.py src/trezorlib/messages/TxOutputBinType.py src/trezorlib/messages/TxOutputType.py src/trezorlib/messages/TxRequest.py src/trezorlib/messages/TxRequestDetailsType.py src/trezorlib/messages/TxRequestSerializedType.py src/trezorlib/messages/VerifyMessage.py src/trezorlib/messages/WebAuthnAddResidentCredential.py src/trezorlib/messages/WebAuthnCredential.py src/trezorlib/messages/WebAuthnCredentials.py src/trezorlib/messages/WebAuthnListResidentCredentials.py src/trezorlib/messages/WebAuthnRemoveResidentCredential.py src/trezorlib/messages/WipeDevice.py src/trezorlib/messages/WordAck.py src/trezorlib/messages/WordRequest.py src/trezorlib/messages/WordRequestType.py src/trezorlib/messages/__init__.py src/trezorlib/messages/__pycache__/Address.cpython-36.pyc src/trezorlib/messages/__pycache__/ApplyFlags.cpython-36.pyc src/trezorlib/messages/__pycache__/ApplySettings.cpython-36.pyc src/trezorlib/messages/__pycache__/BackupDevice.cpython-36.pyc src/trezorlib/messages/__pycache__/BackupType.cpython-36.pyc src/trezorlib/messages/__pycache__/BinanceAddress.cpython-36.pyc src/trezorlib/messages/__pycache__/BinanceCancelMsg.cpython-36.pyc src/trezorlib/messages/__pycache__/BinanceCoin.cpython-36.pyc src/trezorlib/messages/__pycache__/BinanceGetAddress.cpython-36.pyc src/trezorlib/messages/__pycache__/BinanceGetPublicKey.cpython-36.pyc src/trezorlib/messages/__pycache__/BinanceInputOutput.cpython-36.pyc src/trezorlib/messages/__pycache__/BinanceOrderMsg.cpython-36.pyc src/trezorlib/messages/__pycache__/BinanceOrderSide.cpython-36.pyc src/trezorlib/messages/__pycache__/BinanceOrderType.cpython-36.pyc src/trezorlib/messages/__pycache__/BinancePublicKey.cpython-36.pyc src/trezorlib/messages/__pycache__/BinanceSignTx.cpython-36.pyc src/trezorlib/messages/__pycache__/BinanceSignedTx.cpython-36.pyc src/trezorlib/messages/__pycache__/BinanceTimeInForce.cpython-36.pyc src/trezorlib/messages/__pycache__/BinanceTransferMsg.cpython-36.pyc src/trezorlib/messages/__pycache__/BinanceTxRequest.cpython-36.pyc src/trezorlib/messages/__pycache__/ButtonAck.cpython-36.pyc src/trezorlib/messages/__pycache__/ButtonRequest.cpython-36.pyc src/trezorlib/messages/__pycache__/ButtonRequestType.cpython-36.pyc src/trezorlib/messages/__pycache__/Cancel.cpython-36.pyc src/trezorlib/messages/__pycache__/Capability.cpython-36.pyc src/trezorlib/messages/__pycache__/CardanoAddress.cpython-36.pyc src/trezorlib/messages/__pycache__/CardanoGetAddress.cpython-36.pyc src/trezorlib/messages/__pycache__/CardanoGetPublicKey.cpython-36.pyc src/trezorlib/messages/__pycache__/CardanoPublicKey.cpython-36.pyc src/trezorlib/messages/__pycache__/CardanoSignTx.cpython-36.pyc src/trezorlib/messages/__pycache__/CardanoSignedTx.cpython-36.pyc src/trezorlib/messages/__pycache__/CardanoTxAck.cpython-36.pyc src/trezorlib/messages/__pycache__/CardanoTxInputType.cpython-36.pyc src/trezorlib/messages/__pycache__/CardanoTxOutputType.cpython-36.pyc src/trezorlib/messages/__pycache__/CardanoTxRequest.cpython-36.pyc src/trezorlib/messages/__pycache__/ChangePin.cpython-36.pyc src/trezorlib/messages/__pycache__/ChangeWipeCode.cpython-36.pyc src/trezorlib/messages/__pycache__/CipherKeyValue.cpython-36.pyc src/trezorlib/messages/__pycache__/CipheredKeyValue.cpython-36.pyc src/trezorlib/messages/__pycache__/ClearSession.cpython-36.pyc src/trezorlib/messages/__pycache__/CosiCommit.cpython-36.pyc src/trezorlib/messages/__pycache__/CosiCommitment.cpython-36.pyc src/trezorlib/messages/__pycache__/CosiSign.cpython-36.pyc src/trezorlib/messages/__pycache__/CosiSignature.cpython-36.pyc src/trezorlib/messages/__pycache__/DebugLinkDecision.cpython-36.pyc src/trezorlib/messages/__pycache__/DebugLinkFlashErase.cpython-36.pyc src/trezorlib/messages/__pycache__/DebugLinkGetState.cpython-36.pyc src/trezorlib/messages/__pycache__/DebugLinkLayout.cpython-36.pyc src/trezorlib/messages/__pycache__/DebugLinkLog.cpython-36.pyc src/trezorlib/messages/__pycache__/DebugLinkMemory.cpython-36.pyc src/trezorlib/messages/__pycache__/DebugLinkMemoryRead.cpython-36.pyc src/trezorlib/messages/__pycache__/DebugLinkMemoryWrite.cpython-36.pyc src/trezorlib/messages/__pycache__/DebugLinkState.cpython-36.pyc src/trezorlib/messages/__pycache__/DebugLinkStop.cpython-36.pyc src/trezorlib/messages/__pycache__/DebugMoneroDiagAck.cpython-36.pyc src/trezorlib/messages/__pycache__/DebugMoneroDiagRequest.cpython-36.pyc src/trezorlib/messages/__pycache__/DebugSwipeDirection.cpython-36.pyc src/trezorlib/messages/__pycache__/ECDHSessionKey.cpython-36.pyc src/trezorlib/messages/__pycache__/Entropy.cpython-36.pyc src/trezorlib/messages/__pycache__/EntropyAck.cpython-36.pyc src/trezorlib/messages/__pycache__/EntropyRequest.cpython-36.pyc src/trezorlib/messages/__pycache__/EosActionBuyRam.cpython-36.pyc src/trezorlib/messages/__pycache__/EosActionBuyRamBytes.cpython-36.pyc src/trezorlib/messages/__pycache__/EosActionCommon.cpython-36.pyc src/trezorlib/messages/__pycache__/EosActionDelegate.cpython-36.pyc src/trezorlib/messages/__pycache__/EosActionDeleteAuth.cpython-36.pyc src/trezorlib/messages/__pycache__/EosActionLinkAuth.cpython-36.pyc src/trezorlib/messages/__pycache__/EosActionNewAccount.cpython-36.pyc src/trezorlib/messages/__pycache__/EosActionRefund.cpython-36.pyc src/trezorlib/messages/__pycache__/EosActionSellRam.cpython-36.pyc src/trezorlib/messages/__pycache__/EosActionTransfer.cpython-36.pyc src/trezorlib/messages/__pycache__/EosActionUndelegate.cpython-36.pyc src/trezorlib/messages/__pycache__/EosActionUnknown.cpython-36.pyc src/trezorlib/messages/__pycache__/EosActionUnlinkAuth.cpython-36.pyc src/trezorlib/messages/__pycache__/EosActionUpdateAuth.cpython-36.pyc src/trezorlib/messages/__pycache__/EosActionVoteProducer.cpython-36.pyc src/trezorlib/messages/__pycache__/EosAsset.cpython-36.pyc src/trezorlib/messages/__pycache__/EosAuthorization.cpython-36.pyc src/trezorlib/messages/__pycache__/EosAuthorizationAccount.cpython-36.pyc src/trezorlib/messages/__pycache__/EosAuthorizationKey.cpython-36.pyc src/trezorlib/messages/__pycache__/EosAuthorizationWait.cpython-36.pyc src/trezorlib/messages/__pycache__/EosGetPublicKey.cpython-36.pyc src/trezorlib/messages/__pycache__/EosPermissionLevel.cpython-36.pyc src/trezorlib/messages/__pycache__/EosPublicKey.cpython-36.pyc src/trezorlib/messages/__pycache__/EosSignTx.cpython-36.pyc src/trezorlib/messages/__pycache__/EosSignedTx.cpython-36.pyc src/trezorlib/messages/__pycache__/EosTxActionAck.cpython-36.pyc src/trezorlib/messages/__pycache__/EosTxActionRequest.cpython-36.pyc src/trezorlib/messages/__pycache__/EosTxHeader.cpython-36.pyc src/trezorlib/messages/__pycache__/EthereumAddress.cpython-36.pyc src/trezorlib/messages/__pycache__/EthereumGetAddress.cpython-36.pyc src/trezorlib/messages/__pycache__/EthereumGetPublicKey.cpython-36.pyc src/trezorlib/messages/__pycache__/EthereumMessageSignature.cpython-36.pyc src/trezorlib/messages/__pycache__/EthereumPublicKey.cpython-36.pyc src/trezorlib/messages/__pycache__/EthereumSignMessage.cpython-36.pyc src/trezorlib/messages/__pycache__/EthereumSignTx.cpython-36.pyc src/trezorlib/messages/__pycache__/EthereumTxAck.cpython-36.pyc src/trezorlib/messages/__pycache__/EthereumTxRequest.cpython-36.pyc src/trezorlib/messages/__pycache__/EthereumVerifyMessage.cpython-36.pyc src/trezorlib/messages/__pycache__/Failure.cpython-36.pyc src/trezorlib/messages/__pycache__/FailureType.cpython-36.pyc src/trezorlib/messages/__pycache__/Features.cpython-36.pyc src/trezorlib/messages/__pycache__/FirmwareErase.cpython-36.pyc src/trezorlib/messages/__pycache__/FirmwareRequest.cpython-36.pyc src/trezorlib/messages/__pycache__/FirmwareUpload.cpython-36.pyc src/trezorlib/messages/__pycache__/GetAddress.cpython-36.pyc src/trezorlib/messages/__pycache__/GetECDHSessionKey.cpython-36.pyc src/trezorlib/messages/__pycache__/GetEntropy.cpython-36.pyc src/trezorlib/messages/__pycache__/GetFeatures.cpython-36.pyc src/trezorlib/messages/__pycache__/GetNextU2FCounter.cpython-36.pyc src/trezorlib/messages/__pycache__/GetPublicKey.cpython-36.pyc src/trezorlib/messages/__pycache__/HDNodePathType.cpython-36.pyc src/trezorlib/messages/__pycache__/HDNodeType.cpython-36.pyc src/trezorlib/messages/__pycache__/IdentityType.cpython-36.pyc src/trezorlib/messages/__pycache__/Initialize.cpython-36.pyc src/trezorlib/messages/__pycache__/InputScriptType.cpython-36.pyc src/trezorlib/messages/__pycache__/LiskAddress.cpython-36.pyc src/trezorlib/messages/__pycache__/LiskDelegateType.cpython-36.pyc src/trezorlib/messages/__pycache__/LiskGetAddress.cpython-36.pyc src/trezorlib/messages/__pycache__/LiskGetPublicKey.cpython-36.pyc src/trezorlib/messages/__pycache__/LiskMessageSignature.cpython-36.pyc src/trezorlib/messages/__pycache__/LiskMultisignatureType.cpython-36.pyc src/trezorlib/messages/__pycache__/LiskPublicKey.cpython-36.pyc src/trezorlib/messages/__pycache__/LiskSignMessage.cpython-36.pyc src/trezorlib/messages/__pycache__/LiskSignTx.cpython-36.pyc src/trezorlib/messages/__pycache__/LiskSignatureType.cpython-36.pyc src/trezorlib/messages/__pycache__/LiskSignedTx.cpython-36.pyc src/trezorlib/messages/__pycache__/LiskTransactionAsset.cpython-36.pyc src/trezorlib/messages/__pycache__/LiskTransactionCommon.cpython-36.pyc src/trezorlib/messages/__pycache__/LiskTransactionType.cpython-36.pyc src/trezorlib/messages/__pycache__/LiskVerifyMessage.cpython-36.pyc src/trezorlib/messages/__pycache__/LoadDevice.cpython-36.pyc src/trezorlib/messages/__pycache__/MessageSignature.cpython-36.pyc src/trezorlib/messages/__pycache__/MessageType.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroAccountPublicAddress.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroAddress.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroExportedKeyImage.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroGetAddress.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroGetTxKeyAck.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroGetTxKeyRequest.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroGetWatchKey.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroKeyImageExportInitAck.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroKeyImageExportInitRequest.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroKeyImageSyncFinalAck.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroKeyImageSyncFinalRequest.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroKeyImageSyncStepAck.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroKeyImageSyncStepRequest.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroLiveRefreshFinalAck.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroLiveRefreshFinalRequest.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroLiveRefreshStartAck.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroLiveRefreshStartRequest.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroLiveRefreshStepAck.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroLiveRefreshStepRequest.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroMultisigKLRki.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroOutputEntry.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroRctKeyPublic.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroRingCtSig.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroSubAddressIndicesList.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroTransactionAllInputsSetAck.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroTransactionAllInputsSetRequest.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroTransactionAllOutSetAck.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroTransactionAllOutSetRequest.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroTransactionData.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroTransactionDestinationEntry.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroTransactionFinalAck.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroTransactionFinalRequest.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroTransactionInitAck.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroTransactionInitRequest.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroTransactionInputViniAck.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroTransactionInputViniRequest.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroTransactionInputsPermutationAck.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroTransactionInputsPermutationRequest.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroTransactionRsigData.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroTransactionSetInputAck.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroTransactionSetInputRequest.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroTransactionSetOutputAck.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroTransactionSetOutputRequest.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroTransactionSignInputAck.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroTransactionSignInputRequest.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroTransactionSourceEntry.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroTransferDetails.cpython-36.pyc src/trezorlib/messages/__pycache__/MoneroWatchKey.cpython-36.pyc src/trezorlib/messages/__pycache__/MultisigRedeemScriptType.cpython-36.pyc src/trezorlib/messages/__pycache__/NEMAddress.cpython-36.pyc src/trezorlib/messages/__pycache__/NEMAggregateModification.cpython-36.pyc src/trezorlib/messages/__pycache__/NEMCosignatoryModification.cpython-36.pyc src/trezorlib/messages/__pycache__/NEMDecryptMessage.cpython-36.pyc src/trezorlib/messages/__pycache__/NEMDecryptedMessage.cpython-36.pyc src/trezorlib/messages/__pycache__/NEMGetAddress.cpython-36.pyc src/trezorlib/messages/__pycache__/NEMImportanceTransfer.cpython-36.pyc src/trezorlib/messages/__pycache__/NEMImportanceTransferMode.cpython-36.pyc src/trezorlib/messages/__pycache__/NEMModificationType.cpython-36.pyc src/trezorlib/messages/__pycache__/NEMMosaic.cpython-36.pyc src/trezorlib/messages/__pycache__/NEMMosaicCreation.cpython-36.pyc src/trezorlib/messages/__pycache__/NEMMosaicDefinition.cpython-36.pyc src/trezorlib/messages/__pycache__/NEMMosaicLevy.cpython-36.pyc src/trezorlib/messages/__pycache__/NEMMosaicSupplyChange.cpython-36.pyc src/trezorlib/messages/__pycache__/NEMProvisionNamespace.cpython-36.pyc src/trezorlib/messages/__pycache__/NEMSignTx.cpython-36.pyc src/trezorlib/messages/__pycache__/NEMSignedTx.cpython-36.pyc src/trezorlib/messages/__pycache__/NEMSupplyChangeType.cpython-36.pyc src/trezorlib/messages/__pycache__/NEMTransactionCommon.cpython-36.pyc src/trezorlib/messages/__pycache__/NEMTransfer.cpython-36.pyc src/trezorlib/messages/__pycache__/NextU2FCounter.cpython-36.pyc src/trezorlib/messages/__pycache__/OutputScriptType.cpython-36.pyc src/trezorlib/messages/__pycache__/PassphraseAck.cpython-36.pyc src/trezorlib/messages/__pycache__/PassphraseRequest.cpython-36.pyc src/trezorlib/messages/__pycache__/PassphraseSourceType.cpython-36.pyc src/trezorlib/messages/__pycache__/PassphraseStateAck.cpython-36.pyc src/trezorlib/messages/__pycache__/PassphraseStateRequest.cpython-36.pyc src/trezorlib/messages/__pycache__/PinMatrixAck.cpython-36.pyc src/trezorlib/messages/__pycache__/PinMatrixRequest.cpython-36.pyc src/trezorlib/messages/__pycache__/PinMatrixRequestType.cpython-36.pyc src/trezorlib/messages/__pycache__/Ping.cpython-36.pyc src/trezorlib/messages/__pycache__/PublicKey.cpython-36.pyc src/trezorlib/messages/__pycache__/RecoveryDevice.cpython-36.pyc src/trezorlib/messages/__pycache__/RecoveryDeviceType.cpython-36.pyc src/trezorlib/messages/__pycache__/RequestType.cpython-36.pyc src/trezorlib/messages/__pycache__/ResetDevice.cpython-36.pyc src/trezorlib/messages/__pycache__/RippleAddress.cpython-36.pyc src/trezorlib/messages/__pycache__/RippleGetAddress.cpython-36.pyc src/trezorlib/messages/__pycache__/RipplePayment.cpython-36.pyc src/trezorlib/messages/__pycache__/RippleSignTx.cpython-36.pyc src/trezorlib/messages/__pycache__/RippleSignedTx.cpython-36.pyc src/trezorlib/messages/__pycache__/SdProtect.cpython-36.pyc src/trezorlib/messages/__pycache__/SdProtectOperationType.cpython-36.pyc src/trezorlib/messages/__pycache__/SelfTest.cpython-36.pyc src/trezorlib/messages/__pycache__/SetU2FCounter.cpython-36.pyc src/trezorlib/messages/__pycache__/SignIdentity.cpython-36.pyc src/trezorlib/messages/__pycache__/SignMessage.cpython-36.pyc src/trezorlib/messages/__pycache__/SignTx.cpython-36.pyc src/trezorlib/messages/__pycache__/SignedIdentity.cpython-36.pyc src/trezorlib/messages/__pycache__/StellarAccountMergeOp.cpython-36.pyc src/trezorlib/messages/__pycache__/StellarAddress.cpython-36.pyc src/trezorlib/messages/__pycache__/StellarAllowTrustOp.cpython-36.pyc src/trezorlib/messages/__pycache__/StellarAssetType.cpython-36.pyc src/trezorlib/messages/__pycache__/StellarBumpSequenceOp.cpython-36.pyc src/trezorlib/messages/__pycache__/StellarChangeTrustOp.cpython-36.pyc src/trezorlib/messages/__pycache__/StellarCreateAccountOp.cpython-36.pyc src/trezorlib/messages/__pycache__/StellarCreatePassiveOfferOp.cpython-36.pyc src/trezorlib/messages/__pycache__/StellarGetAddress.cpython-36.pyc src/trezorlib/messages/__pycache__/StellarManageDataOp.cpython-36.pyc src/trezorlib/messages/__pycache__/StellarManageOfferOp.cpython-36.pyc src/trezorlib/messages/__pycache__/StellarPathPaymentOp.cpython-36.pyc src/trezorlib/messages/__pycache__/StellarPaymentOp.cpython-36.pyc src/trezorlib/messages/__pycache__/StellarSetOptionsOp.cpython-36.pyc src/trezorlib/messages/__pycache__/StellarSignTx.cpython-36.pyc src/trezorlib/messages/__pycache__/StellarSignedTx.cpython-36.pyc src/trezorlib/messages/__pycache__/StellarTxOpRequest.cpython-36.pyc src/trezorlib/messages/__pycache__/Success.cpython-36.pyc src/trezorlib/messages/__pycache__/TezosAddress.cpython-36.pyc src/trezorlib/messages/__pycache__/TezosBallotOp.cpython-36.pyc src/trezorlib/messages/__pycache__/TezosBallotType.cpython-36.pyc src/trezorlib/messages/__pycache__/TezosContractID.cpython-36.pyc src/trezorlib/messages/__pycache__/TezosContractType.cpython-36.pyc src/trezorlib/messages/__pycache__/TezosDelegationOp.cpython-36.pyc src/trezorlib/messages/__pycache__/TezosGetAddress.cpython-36.pyc src/trezorlib/messages/__pycache__/TezosGetPublicKey.cpython-36.pyc src/trezorlib/messages/__pycache__/TezosManagerTransfer.cpython-36.pyc src/trezorlib/messages/__pycache__/TezosOriginationOp.cpython-36.pyc src/trezorlib/messages/__pycache__/TezosParametersManager.cpython-36.pyc src/trezorlib/messages/__pycache__/TezosProposalOp.cpython-36.pyc src/trezorlib/messages/__pycache__/TezosPublicKey.cpython-36.pyc src/trezorlib/messages/__pycache__/TezosRevealOp.cpython-36.pyc src/trezorlib/messages/__pycache__/TezosSignTx.cpython-36.pyc src/trezorlib/messages/__pycache__/TezosSignedTx.cpython-36.pyc src/trezorlib/messages/__pycache__/TezosTransactionOp.cpython-36.pyc src/trezorlib/messages/__pycache__/TransactionType.cpython-36.pyc src/trezorlib/messages/__pycache__/TxAck.cpython-36.pyc src/trezorlib/messages/__pycache__/TxInputType.cpython-36.pyc src/trezorlib/messages/__pycache__/TxOutputBinType.cpython-36.pyc src/trezorlib/messages/__pycache__/TxOutputType.cpython-36.pyc src/trezorlib/messages/__pycache__/TxRequest.cpython-36.pyc src/trezorlib/messages/__pycache__/TxRequestDetailsType.cpython-36.pyc src/trezorlib/messages/__pycache__/TxRequestSerializedType.cpython-36.pyc src/trezorlib/messages/__pycache__/VerifyMessage.cpython-36.pyc src/trezorlib/messages/__pycache__/WebAuthnAddResidentCredential.cpython-36.pyc src/trezorlib/messages/__pycache__/WebAuthnCredential.cpython-36.pyc src/trezorlib/messages/__pycache__/WebAuthnCredentials.cpython-36.pyc src/trezorlib/messages/__pycache__/WebAuthnListResidentCredentials.cpython-36.pyc src/trezorlib/messages/__pycache__/WebAuthnRemoveResidentCredential.cpython-36.pyc src/trezorlib/messages/__pycache__/WipeDevice.cpython-36.pyc src/trezorlib/messages/__pycache__/WordAck.cpython-36.pyc src/trezorlib/messages/__pycache__/WordRequest.cpython-36.pyc src/trezorlib/messages/__pycache__/WordRequestType.cpython-36.pyc src/trezorlib/messages/__pycache__/__init__.cpython-36.pyc src/trezorlib/qt/__init__.py src/trezorlib/qt/pinmatrix.py src/trezorlib/transport/__init__.py src/trezorlib/transport/bridge.py src/trezorlib/transport/hid.py src/trezorlib/transport/protocol.py src/trezorlib/transport/udp.py src/trezorlib/transport/webusb.py src/trezorlib/transport/__pycache__/__init__.cpython-36.pyc tests/test_ckd_public.py tests/test_cosi.py tests/test_nem.py tests/test_protobuf_encoding.py tests/test_protobuf_misc.py tests/test_stellar.py tests/test_transport.py tests/test_tx_api.py tools/build_tx.py tools/deserialize_tx.py tools/encfs_aes_getpass.py tools/helloworld.py tools/mem_flashblock.py tools/mem_read.py tools/mem_write.py tools/mnemonic_check.py tools/pwd_reader.py tools/rng_entropy_collector.py tools/trezor-otp.pypython-trezor-0.11.6/src/trezor.egg-info/dependency_links.txt000066400000000000000000000000011361427340300243220ustar00rootroot00000000000000 python-trezor-0.11.6/src/trezor.egg-info/entry_points.txt000066400000000000000000000000731361427340300235520ustar00rootroot00000000000000[console_scripts] trezorctl = trezorlib.cli.trezorctl:cli python-trezor-0.11.6/src/trezor.egg-info/not-zip-safe000066400000000000000000000000011361427340300225020ustar00rootroot00000000000000 python-trezor-0.11.6/src/trezor.egg-info/requires.txt000066400000000000000000000003521361427340300226540ustar00rootroot00000000000000setuptools>=19.0 ecdsa>=0.9 mnemonic>=0.17 requests>=2.4.0 click<8,>=7 libusb1>=1.6.4 construct>=2.9 typing_extensions>=3.7.4 [:python_version < "3.6"] pyblake2>=0.9.3 [ethereum] rlp>=1.1.0 web3>=4.8 [hidapi] hidapi>=0.7.99.post20 python-trezor-0.11.6/src/trezor.egg-info/top_level.txt000066400000000000000000000000121361427340300227770ustar00rootroot00000000000000trezorlib python-trezor-0.11.6/src/trezorlib/000077500000000000000000000000001361427340300172515ustar00rootroot00000000000000python-trezor-0.11.6/src/trezorlib/__init__.py000066400000000000000000000001641361427340300213630ustar00rootroot00000000000000__version__ = "0.11.6" # fmt: off MINIMUM_FIRMWARE_VERSION = { "1": (1, 8, 0), "T": (2, 1, 0), } # fmt: on python-trezor-0.11.6/src/trezorlib/__pycache__/000077500000000000000000000000001361427340300214615ustar00rootroot00000000000000python-trezor-0.11.6/src/trezorlib/__pycache__/__init__.cpython-36.pyc000066400000000000000000000004351361427340300256500ustar00rootroot000000000000003 ^t@sdZdddZdS) z0.11.6)1TN)rrr)rrr) __version__ZMINIMUM_FIRMWARE_VERSIONrrN/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/__init__.pyspython-trezor-0.11.6/src/trezorlib/__pycache__/_ed25519.cpython-36.pyc000066400000000000000000000167161361427340300252570ustar00rootroot000000000000003 ]@s@dZddlZddlmZmZmZedeeeeefZdZdZ ddd Z dd d Z dJd e d >Z d e d>Z eedddZeeedddZeedddZdKede Zede d d e ZeedddZd edZeeZeee ee d eee fZedLZeeedddZeed d!d"Zeeed#d$d%ZgZdd&d'd(Zeeed)d*d+Zeedd,d-Z eed d.d/Z!eed0d1d2Z"eed0d3d4Z#eed0d5d6Z$eeed7d8d9Z%eed:d;d<Z&eedd=d>Z'eeeed?d@dAZ(ee)d dBdCZ*GdDdEdEe+Z,eeeddFdGdHZ-dS)Ma NB: This code is not safe for use with secret keys or secret data. The only safe use of this code is for verifying signatures on public messages. Functions for computing the public key of a secret key and for signing a message are included, namely publickey_unsafe and signature_unsafe, for testing purposes only. The root of the problem is that Python's long-integer arithmetic is not designed for use in cryptography. Specifically, it may take more or less time to execute an operation depending on the values of the inputs, and its memory access patterns may also depend on the inputs. This opens it to timing and cache side-channel attacks which can disclose data to an attacker. We rely on Python's long-integer arithmetic, so we cannot handle secrets without risking their disclosure. N)ListNewTypeTuplePointz1.0.dev1l S9i @eM^w|o)mreturncCstj|jS)N)hashlibsha512digest)r rN/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/_ed25519.pyH3sr)xprcCs&x |dkr ||t}|d8}qW|S)z== pow(x, 2**p, q)rr )q)rrrrrpow27s   r)zrc Cs||t}t|d|t}||t}||t|t}t|d|t}t|d|t}t|d|t}t|d|t}t|d|t} t| d| t} t| d|t} t| d|tS)z$= z^{-1} mod q$, for z != 0r 2d)rr) rz2Zz9Zz11Zz2_5_0Zz2_10_0Zz2_20_0Zz2_40_0Zz2_50_0Zz2_100_0Zz2_200_0Zz2_250_0rrrinv?s  r iAiB)yrcCsl||dtt||d}t|tddt}|||tdkrT|tt}|ddkrht|}|S)Nr rr)r dpowrI)r!ZxxrrrrxrecoverTs   r'r)PQrcCs|\}}}}|\}}}} ||||t} ||||t} |dt| t} |d|t} | | }| | }| | }| | }||}||}||}||}t|t|t|t|tfS)Nr)rr$r)r(r)x1y1z1t1x2y2rt2abcddefghx3y3t3z3rrr edwards_addgs  r=)r(rcCs|\}}}}||t}||t}d||t}||||||t}| |} | |} | |} || } | | } || }| | }t| t| t|t|tfS)Nr)rr)r(r*r+r,_r1r2r3r5r7r6r8r9r:r;r<rrredwards_double}s     r?)r(r5rcCs8|dkr tSt||d}t|}|d@r4t||}|S)Nrrr )ident scalarmultr?r=)r(r5r)rrrrAs rA)rcCs,t}x"tdD]}tj|t|}qWdS)N)BrangeBpowappendr?)r(r>rrr make_Bpows rG)r5rcCsP|t}t}x.tdD]"}|d@r0t|t|}|d}qW|dksLt||S)z7 Implements scalarmult(B, e) more efficiently. rBr rr)lr@rDr=rEAssertionError)r5r(irrr scalarmult_Bs rKcCs|jtddS)Nr#little)to_bytesr2)r!rrr encodeintsrNcCsV|\}}}}t|}||t}||t}|d@td>}||@}||O}t|S)Nr )r rr2rN)r(rr!rr>ZziZxbitZy_resultrrr encodepoints    rO)srcCs tj|dS)NrL)int from_bytes)rPrrr decodeintsrScCsht|dtd>@}t|}|d@t|tdkrr(r.r/rr)rrr checkvalids  rjr"i$)rr r r).__doc__rtypingrrrrQr __version__r2rrHrXrYbytesrrr r$r%r&r'ZByZBxrCr@r=r?rArErGrKrNrOrSrWrZrTr]r^rcboolrU Exceptionrerjrrrr sL           python-trezor-0.11.6/src/trezorlib/__pycache__/binance.cpython-36.pyc000066400000000000000000000027431361427340300255140ustar00rootroot000000000000003 ʵ]@shddlmZddlmZddlmZmZeejdddddZeej d ddd d Z ed d Z dS))messages) dict_to_proto)expectsessionaddress)fieldFcCs|jtj||dS)N) address_n show_display)callrBinanceGetAddress)clientrr r M/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/binance.py get_addresssr public_keycCs|jtj||dS)N)rr )r rBinanceGetPublicKey)r rr r r rget_public_keysrcCs|dd}ttj|}d|_||_|j|}t|tjsLtdt |j d|krbttj |}n4d|krxttj |}nd|krttj |}ntd|j|}t|tjstd t |j |S) NZmsgsrz6Invalid response, expected BinanceTxRequest, received refidinputs ordertypezcan not determine msg typez5Invalid response, expected BinanceSignedTx, received )rr BinanceSignTx msg_countrr isinstanceBinanceTxRequest RuntimeErrortype__name__BinanceCancelMsgBinanceTransferMsgBinanceOrderMsg ValueErrorBinanceSignedTx)r rZtx_jsonmsgZenveloperesponser r rsign_tx$s,      r%N)F)F) rprotobufrtoolsrrBinanceAddressrBinancePublicKeyrr%r r r rs      python-trezor-0.11.6/src/trezorlib/__pycache__/btc.cpython-36.pyc000066400000000000000000000067671361427340300246770ustar00rootroot000000000000003 ^@sddlmZmZddlmZmZmZmZeejdddej j fddZ eej ddddej j fd d Z eejej j fd d Zd dZedddZdS))coinsmessages) CallExceptionexpect normalize_nfcsessionNFcCs|jtj|||||dS)N) address_necdsa_curve_name show_display coin_name script_type)callr GetPublicKey)clientnr r r r rI/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/btc.pyget_public_nodes raddress)fieldcCs|jtj|||||dS)N)rr r multisigr )r r GetAddress)rr rr rr rrr get_address)s rcCs t|}|jtj||||dS)N)r rmessager )rr r SignMessage)rr rrr rrr sign_message=srcCsXt|}y|jtj||||d}Wn&tk rJ}z |}WYdd}~XnXt|tjS)N)r signaturerr )rr r VerifyMessager isinstanceSuccess)rr rrrresperrrverify_messageIsr"cCsdtj||di}|tjkr.tj|d }nd}|rx|D]|}|jtjjtjjtjjfkr.copy_tx_metaz%Signature for index %d already filled)r-zSigning failedzUnexpected messagezSome signatures are missing!),rr&rby_namer InputScriptTypeSPENDP2SHWITNESS SPENDWITNESSEXTERNAL prev_hash Exception ValueErrorrSignTxr r' inputs_count outputs_countr RequestType TxRequest serialized serialized_txsignature_indexr request_type TXFINISHEDdetailstx_hashTXMETATxAckTXINPUTr# request_indexTXOUTPUTr)r$ TXEXTRADATAextra_data_offsetr,r+Failurer RuntimeError)rr r#r$rA prev_txesZtxesZ load_prevtxesinpZprev_txr!Zsigntxres signaturesr=r.RidxsigZ current_txmsgolrrrsign_txYs                rV)NN)rrtoolsrrrr PublicKeyr0 SPENDADDRESSrAddressrMessageSignaturerr"rVrrrrs   python-trezor-0.11.6/src/trezorlib/__pycache__/cardano.cpython-36.pyc000066400000000000000000000043601361427340300255210ustar00rootroot000000000000003 ]r @sddlmZddlmZmZddlmZmZdZdZeej d d dddZ eej ddZ eeej eejeedddZej dddZejdddZdS))List)messagestools)expectsessioninputsoutputs transactionspath prev_hash prev_indextypeaddress)fieldFcCs|jtj||dS)N) address_n show_display)callrCardanoGetAddress)clientrrrM/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/cardano.py get_addresssrcCs|jtj|dS)N)r)rrCardanoGetPublicKey)rrrrrget_public_key!sr)rr r c Cs\|jtj||t||d}x:t|tjrV|j}tj||}tj |d}|j|}qW|S)N)rr transactions_countprotocol_magic) transaction) rr CardanoSignTxlen isinstanceCardanoTxRequesttx_indexbytesfromhex CardanoTxAck) rrr r rresponser"Ztransaction_dataZ ack_messagerrrsign_tx&s  r')returncsPtfddtDstdd}tjtj|tjddddS) Nc3s|]}j|dk VqdS)N)get).0k)inputrr Bszcreate_input..z The input is missing some fieldsr r r r)rr r r) allREQUIRED_FIELDS_INPUT ValueErrorrCardanoTxInputTyper parse_pathr#r$)r,r r)r,r create_inputAs r3cCsr|jd s"|jdp|jd r*td|jdrX|d}tjtj|t|ddStj|dt|ddS)Namountrr z!The output is missing some fields)rr4)rr4)r)r0rCardanoTxOutputTyperr2int)outputr rrr create_outputOs" r8N)rr r )r r r r)F)typingrrrrrZREQUIRED_FIELDS_TRANSACTIONr/CardanoAddressrCardanoPublicKeyrr1r5r#r'r3r8rrrrs   python-trezor-0.11.6/src/trezorlib/__pycache__/client.cpython-36.pyc000066400000000000000000000273101361427340300253700ustar00rootroot000000000000003 ʵ]7@sddlZddlZddlZddlmZddlmZddlmZm Z m Z m Z ej j dkr\edejeZdZd Zd jZd jZd dZeeeedZddZdddZGdddZddZGdddeZGdddZdZ dS)N)SimpleNamespace)Mnemonic)MINIMUM_FIRMWARE_VERSION exceptionsmessagestoolsz,Trezorlib does not support Python 2 anymore.bitcointrezor.com trezor.io2z= Incompatible Trezor library detected. (Original error: {}) z Your Trezor firmware is out of date. Update it with the following command: trezorctl firmware-update Or visit https://wallet.trezor.io/ cOs tddS)NzYou did not supply a UI object. You were warned that this would crash soon. That's what happened now. You need to supply a UI object to TrezorClient constructor.) RuntimeError)argskwargsrL/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/client.py_no_ui_selected/sr)button_requestget_passphraseget_pincsfddttjDdS)Ncs g|]}ttj|kr|qSr)getattrrButtonRequestType).0k)coderr Asz+get_buttonrequest_value..r)dirrr)rr)rrget_buttonrequest_value>s  rcKs@ddlm}ddlm}||dd}|dkr2|}t||f|S)a 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. r) get_transport)ClickUIT) prefix_searchN) transportruir TrezorClient)pathr"rrrr!rrrget_default_clientGs   r%c@seZdZdZedfddZddZddZd d Zd d Z d dZ ddZ ddZ ddZ ddZejddZejddZddZd(ddZejejd d!d)d"d#Zd$d%Zejd&d'ZdS)*r#auTrezor client, a connection to a Trezor device. This class allows you to manage connection state, send and receive protobuf messages, handle user interactions, and perform some generic tasks (send a cancel message, initialize or clear a session, ping the device). You have to provide a transport, i.e., a raw connection to the device. You can use `trezorlib.transport.get_transport` to find one. You have to provide an UI implementation for the three kinds of interaction: - button request (notify the user that their interaction is needed) - PIN request (on T1, ask the user to input numbers for a PIN matrix) - passphrase request (ask the user to enter a passphrase) See `trezorlib.ui` for details. You can supply a `state` you saved in the previous session. If you do, the user might not need to enter their passphrase again. NcCsJtjdj|j||_||_||_|tkr8tj dd|_ |j dS)Nz'creating client instance for device: {}z6UI object not supplied. This will probably crash soon.r) LOGinfoformatget_pathr!r"state _NO_UI_OBJECTwarningswarnsession_counter init_device)selfr!r"r*rrr__init__ns  zTrezorClient.__init__cCs&|jdkr|jj|jd7_dS)Nrr)r.r! begin_session)r0rrropens  zTrezorClient.opencCs*t|jdd|_|jdkr&|jjdS)Nrr)maxr.r! end_session)r0rrrcloses zTrezorClient.closecCs|jtjdS)N) _raw_writerCancel)r0rrrcancelszTrezorClient.cancelcCsd}|j||jS)NT)r7 _raw_read)r0msg__tracebackhide__rrrcall_raws zTrezorClient.call_rawcCsd}|jj|dS)NT)r!write)r0r;r<rrrr7szTrezorClient._raw_writecCsd}|jjS)NT)r!read)r0r<rrrr:szTrezorClient._raw_readc Csy|jj|j}Wn&tjk r8|jtjYnX|jsX|jtjt d|jtj |d}t |tj r|j tjjtjjtjjfkrtj|j |jn|SdS)NzNon-numeric PIN provided)pin)r"rtyper Cancelledr=rr8isdigit ValueError PinMatrixAck isinstanceFailurer FailureType PinInvalid PinCancelled PinExpected PinExceptionmessage)r0r;r@resprrr _callback_pins zTrezorClient._callback_pinc Cs|jr d}nby|jj}Wn&tjk r@|jtjYnXtj |}t |t krn|jtjt d|jtj ||jd}t|tjr|j|_|jtjS|SdS)NzPassphrase too long) passphraser*) on_devicer"rrrBr=rr8rnormalize_stringlenMAX_PASSPHRASE_LENGTHrD PassphraseAckr*rFPassphraseStateRequestPassphraseStateAck)r0r;rPrNrrr_callback_passphrases"   z!TrezorClient._callback_passphrasecCs(d}|jtj|jj|j|jS)NT)r7r ButtonAckr"rrr:)r0r;r<rrr_callback_buttonszTrezorClient._callback_buttoncCs|j|j|}x|t|tjr,|j|}qt|tjrD|j|}qt|tjr\|j |}qt|tj r|j tj j kr|tjtj|q|SqWdS)N)check_firmware_versionr=rFrPinMatrixRequestrOPassphraseRequestrX ButtonRequestrZrGrrHActionCancelledrrB TrezorFailure)r0r;rNrrrcalls         zTrezorClient.callcCsn|jtj|jd}t|tjs,tjdn||_|jj t krFt d|jj |jj |jjf|_|jdddS)N)r*zUnexpected initial responsezUnsupported deviceT) warn_only)r=r Initializer*rFFeaturesrTrezorExceptionfeaturesvendorVENDORSr major_version minor_version patch_versionversionr[)r0rNrrrr/s    zTrezorClient.init_devicecCs*|jjr dS|jjpd}t|}|j|kS)NF1)rfbootloader_modemodelrrl)r0roZrequired_versionrrr is_outdateds  zTrezorClient.is_outdatedFcCs*|jr&|rtjtddn tjtdS)N) stacklevel)rpr,r-OUTDATED_FIRMWARE_ERRORrOutdatedFirmwareError)r0rbrrrr[sz#TrezorClient.check_firmware_versionrM)fieldcCsT| r8| r8| r8z|j|jtj|dS|jXtj||||d}|j|S)N)rM)rMbutton_protectionpin_protectionpassphrase_protection)r3r=rPingr6ra)r0r;rvrwrxrrrpings  zTrezorClient.pingcCs|jjS)N)rf device_id)r0rrr get_device_idszTrezorClient.get_device_idcCs6|jtj}t|tjr.d|_|j|jS|SdS)N)r=r ClearSessionrFSuccessr*r/rM)r0rNrrr clear_session"s  zTrezorClient.clear_session)F)FFF)__name__ __module__ __qualname____doc__r+r1r3r6r9r=r7r:rOrXrZrsessionrar/rpr[expectrr~rzr|rrrrrr#Zs*  r#csfdd}|S)Ncsd}ttj|dS)NzFunction has been moved to )r DEPRECATION_ERRORr()rrr;)whererrmoved_to.szMovedTo..moved_tor)rrr)rrMovedTo-s rcsLeZdZdZfddZddZeddZedZ ed Z ed Z ed Z ed Z ed ZedZedZedZedZedZedZedZedZedZedZedZedZedZedZedZedZedZedZ ed Z!ed!Z"ed"Z#ed#Z$ed$Z%ed%Z&ed&Z'ed'Z(ed(Z)ed)Z*ed*Z+Z,S)+ ProtocolMixinaFake mixin for old-style software that constructed TrezorClient class from separate mixins. Now it only simulates existence of original attributes to prevent some early crashes, and raises errors when any of the attributes are actually called. cs"tjdd|_tj||dS)Nz-TrezorClient mixins are not supported anymore)r,r-tx_apisuperr1)r0rr) __class__rrr1=s zProtocolMixin.__init__cCstjddS)Nz6set_tx_api is deprecated, use new arguments to sign_tx)r,r-)r0rrrr set_tx_apiBszProtocolMixin.set_tx_apicCstjdtddtj|S)Nz/expand_path is deprecated, use tools.parse_pathrq)rr)r,r-DeprecationWarningr parse_path)nrrr expand_pathEs zProtocolMixin.expand_pathz device.wipezdevice.recoverz device.resetz device.backupzfido.set_counterzdevice.apply_settingszdevice.apply_flagszdevice.change_pinzfirmware.updatezbtc.get_public_nodezbtc.get_addressz btc.sign_txzbtc.sign_messagezbtc.verify_messagez cosi.commitz cosi.signzethereum.get_addresszethereum.sign_txzethereum.sign_messagezethereum.verify_messagezlisk.get_addresszlisk.get_public_keyzlisk.sign_messagezlisk.verify_messagez lisk.sign_txznem.get_addressz nem.sign_txzstellar.get_addresszstellar.sign_txzmisc.get_entropyzmisc.sign_identityzmisc.get_ecdh_session_keyzmisc.encrypt_keyvaluezmisc.decrypt_keyvaluezdebuglink.load_device)-rrrrr1r staticmethodrrZ wipe_deviceZrecovery_deviceZ reset_deviceZ backup_deviceZset_u2f_counterapply_settings apply_flags change_pinfirmware_updateZget_public_nodeZ get_addressZsign_txZ sign_messageZverify_messageZ cosi_commitZ cosi_signZethereum_get_addressZethereum_sign_txZethereum_sign_messageZethereum_verify_messageZlisk_get_addressZlisk_get_public_keyZlisk_sign_messageZlisk_verify_messageZ lisk_sign_txZnem_get_addressZ nem_sign_txZstellar_get_addressZstellar_sign_transaction get_entropyZ sign_identityZget_ecdh_session_keyencrypt_keyvaluedecrypt_keyvalueZload_device_by_mnemonic __classcell__rr)rrr5sN  rc@s eZdZdZddZddZdS) BaseClientzCompatibility proxy for original BaseClient class. Prevents early crash in Electrum forks and possibly other software. cOstjdt|||_dS)Nz-TrezorClient mixins are not supported anymore)r,r-r# trezor_client)r0rrrrrr1s zBaseClient.__init__cCs t|j|S)N)rr)r0keyrrr __getattr__szBaseClient.__getattr__N)rrrrr1rrrrrrsr)r r )NN)!loggingsysr,typesrmnemonicrrrrr version_infomajor Exception getLoggerrr&rhrTstriprrsrr+rr%r#robjectrrprotorrrrs2     TSpython-trezor-0.11.6/src/trezorlib/__pycache__/coins.cpython-36.pyc000066400000000000000000000021571361427340300252270ustar00rootroot000000000000003 ]@sddlZddlZddlmZejjejjedZ ddZ ddd gZ ye Z d d e DZ Wn,ek rZzed eWYddZ[XnXd d e jDZdd e jDZdS)N)TxApiz coins.jsonc Cstt }tj|SQRXdS)N)open COINS_JSONjsonload)Z coins_jsonrK/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/coins.py_load_coins_jsons r by_nameslip44tx_apicCsi|]}||dqS) coin_namer).0coinrrr %srz3Failed to load coins.json. Check your installation.cCsi|]\}}|d|qS)r r)rnamerrrr r)scCs*i|]"\}}|ds|drt||qS)Z blockbookZbitcore)r)rrrrrr r*s)rZos.pathosr rpathjoindirname__file__rr __all__ coins_listr Exceptione ImportErroritemsr rrrr s  python-trezor-0.11.6/src/trezorlib/__pycache__/cosi.cpython-36.pyc000066400000000000000000000102431361427340300250440ustar00rootroot000000000000003 <^X@sddlmZddlmZmZmZddlmZmZddl m Z e Z e Z e Zee e dddZe eeed d d Zd e e eeee fd d dZee e ddddZee eeeee ddddZe e dddZe e e ee edddZe ejddZe ejddZdS)!)reduce)IterableListTuple)_ed25519messages)expect)pksreturncCs(dd|D}ttj|}ttj|S)z:Combine a list of Ed25519 points into a "global" CoSi key.cSsg|]}tj|qS)rZ decodepoint).0pkr r J/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/cosi.py sz combine_keys..)rrZ edwards_addEd25519PublicPoint encodepoint)r Pcombiner r r combine_keyss r)global_Rsigsr cCs2dd|D}t|tj}|tj|}t|S)z:Combine a list of signatures into a single CoSi signature.cSsg|]}tj|qSr )rZ decodeint)r sir r rr)szcombine_sig..)sumrl encodeintEd25519Signature)rrSssigr r r combine_sig%sr )skdatactrr cCsjtj|}tjd}t||dks(ttj||d||jdd}tjtj|}|t tj |fS)aCalculate CoSi nonces for given data. These differ from Ed25519 deterministic nonces in that there is a counter appended at end. Returns both the private point `r` and the partial signature `R`. `r` is returned for performance reasons: :func:`sign_with_privkey` takes it as its `nonce` argument so that it doesn't repeat the `get_nonce` call. `R` should be combined with other partial signatures through :func:`combine_keys` to obtain a "global commitment". Nbig) rHblenAssertionErrorHintto_bytesZ scalarmultBrr)r!r"r#hZbytesizerRr r r get_nonce/s   "r2N) signaturedigestpub_keyr cCstj|||dS)zFVerify Ed25519 signature. Raise exception if the signature is invalid.N)rZ checkvalid)r3r4r5r r rverifyFsr6)r3r4mnmaskkeysr cs\|dkrtdfddt|D}t||krHtdj|t|t|}t|||S)Nrz#At least 1 signer must be specifiedcs g|]}d|>@r|qS)rr )r i)r:r9r rrXsz!verify_m_of_n..z*Not enough signers ({} required, {} found)) ValueErrorranger*formatrr6)r3r4r7r8r9r:Z selected_keysZ global_pkr )r:r9r verify_m_of_nNs r?)privkeyr cCsttj|S)zsInterpret 32 bytes of data as an Ed25519 private key. Calculate and return the corresponding public key. )rrZpublickey_unsafe)r@r r rpubkey_from_privkeyasrA)r4r@ global_pubkeynonce global_commitr cCsBtj|}tj|}|tj||||tj}ttj|S)zCreate a CoSi signature of `digest` with the supplied private key. This function needs to know the global public key and global commitment. )rr(Z decodecoordr,rrr)r4r@rBrCrDr/arr r rsign_with_privkeyhs   rFcCs|jtj||dS)N) address_nr")callr CosiCommit)clientr8r"r r rcommit|srKcCs|jtj||||dS)N)rGr"global_commitmentrB)rHrCosiSign)rJr8r"rLrBr r rsigns rN)r) functoolsrtypingrrrrrtoolsr bytesZEd25519PrivateKeyrrrr intr2r6r?rArFCosiCommitmentrK CosiSignaturerNr r r rs:    python-trezor-0.11.6/src/trezorlib/__pycache__/debuglink.cpython-36.pyc000066400000000000000000000351021361427340300260540ustar00rootroot000000000000003 ʵ]@@sddlmZddlmZddlmZddlmZm Z ddl m Z ddl m Z dZed d Zd d ZGd ddZGdddeZGdddZGddde Ze ejdddddZeZe ejddddZdS)) namedtuple)deepcopy)Mnemonic)messagesprotobuf) TrezorClient)expect LayoutLinesz lines textcCst|dj|S)N )r join)linesrO/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/debuglink.py layout_lines src@seZdZd>ddZddZddZd?d d Zd d Zd dZddZ ddZ ddZ d@ddZ ddZ ddZddZddZd d!Zd"d#ZdAd$d%ZdBd&d'Zd(d)Zd*d+Zd,d-Zd.d/Zd0d1Zd2d3Zd4d5Zeejd6d7d8d9ZdCd:d;Z dKsz(DebugLink.encode_pin..)r*r )rr(r)_r)r)rr+Gs zDebugLink.encode_pincCs|jtj}|jS)N)r!r"r#mnemonic_secret)rr'rrrread_mnemonic_secretMszDebugLink.read_mnemonic_secretcCs|jtj}|j|jfS)N)r!r"r#recovery_fake_wordrecovery_word_pos)rr'rrrread_recovery_wordQszDebugLink.read_recovery_wordcCs|jtjdd}|jS)NT)wait_word_list)r!r"r# reset_word)rr'rrrread_reset_wordUszDebugLink.read_reset_wordcCs|jtjdd}|jS)NT) wait_word_pos)r!r"r#reset_word_pos)rr'rrrread_reset_word_posYszDebugLink.read_reset_word_poscCs|jtj}|jS)N)r!r"r# reset_entropy)rr'rrrread_reset_entropy]szDebugLink.read_reset_entropycCs|jtj}|jS)N)r!r"r#passphrase_protection)rr'rrrread_passphrase_protectionasz$DebugLink.read_passphrase_protectionc Csp|js dStdd||||fD}|dkr4tdtj||||||d}|j|| d} | dk rlt| jSdS)Ncss|]}|dk VqdS)Nr)r0arrr isz"DebugLink.input..rz3Invalid input - must use one of word, button, swipe)yes_noswipeinputxywait)r)rsum ValueErrorr"DebugLinkDecisionr!rr) rwordbuttonrFrHrIrJargsZdecisionr rrrrGeszDebugLink.inputcCs|\}}|j|||dS)N)rHrIrJ)rG)rclickrJrHrIrrrrQtszDebugLink.clickcCs|jdddS)NT)rO)rG)rrrr press_yesxszDebugLink.press_yescCs|jdddS)NF)rO)rG)rrrrpress_no{szDebugLink.press_nocCs|jtjjddS)N)rF)rGr"DebugSwipeDirectionUP)rrrrswipe_up~szDebugLink.swipe_upcCs|jtjjddS)N)rF)rGr"rTDOWN)rrrr swipe_downszDebugLink.swipe_downcCs|jtjjddS)N)rF)rGr"rTRIGHT)rrrr swipe_rightszDebugLink.swipe_rightcCs|jtjjddS)N)rF)rGr"rTLEFT)rrrr swipe_leftszDebugLink.swipe_leftcCs|jtjdddS)NT)r)r!r" DebugLinkStop)rrrrstopszDebugLink.stopmemory)fieldcCs|jtj||dS)N)addresslength)r!r"DebugLinkMemoryRead)rrarbrrr memory_readszDebugLink.memory_readcCs|jtj|||ddddS)N)rar_flashT)r)r!r"DebugLinkMemoryWrite)rrar_rerrr memory_writeszDebugLink.memory_writecCs|jtj|ddddS)N)sectorT)r)r!r"DebugLinkFlashErase)rrhrrr flash_eraseszDebugLink.flash_erase)T)F)N)NNNNNF)F)F)"__name__ __module__ __qualname__rrrr!r$r%r&r*r,r+r5r8r;r>r@rBrGrQrRrSrVrXrZr\r^r r"DebugLinkMemoryrdrgrjrrrrr$s8      rcs6eZdZfddZddZddZd dd ZZS) NullDebugLinkcstjddS)N)superr)r) __class__rrrszNullDebugLink.__init__cCsdS)Nr)rrrrrszNullDebugLink.opencCsdS)Nr)rrrrrszNullDebugLink.closeFcCs$|s t|tjrtjStddS)Nz#unexpected call to a fake debuglink) isinstancer"r#DebugLinkState RuntimeError)rrrrrrr!s zNullDebugLink._call)F)rkrlrmrrrr! __classcell__rr)rqrros roc@s:eZdZeZedddZddZd ddZd d Z dS) DebugUI) debuglinkcCs||_d|_d|_d|_dS)Nz$sphinx of black quartz, judge my wov)rwr( passphrase input_flow)rrwrrrrszDebugUI.__init__c Csh|jdkr |jj|jjnD|j|jkr6tdn.y|jj|Wntk rb|j|_YnXdS)Nzinput flow ended prematurely)ryrwr&rRINPUT_FLOW_DONEAssertionErrorsend StopIteration)rcoderrrbutton_requests     zDebugUI.button_requestNcCs|jr |jS|jjSdS)N)r(rwr,)rr~rrrget_pinszDebugUI.get_pincCs|jS)N)rx)rrrrget_passphraseszDebugUI.get_passphrase)N) rkrlrmobjectrzrrrrrrrrrrvs  rvcseZdZd$fdd ZfddZfddZdd Zd d Zd d ZddZ ddZ ddZ ddZ ddZ ddZfddZfddZddZd d!Zd"d#ZZS)%TrezorClientDebugLinkTc sy,|j}t|||_|jj|jjWn$tk rP|sJt|_nYnXt|j|_d|_ d|_ i|_ |j ddd|_ d|_|jdtj||jddS)NrTr-)ui)Z find_debugrdebugrr Exceptionrorvrin_with_statementZ screenshot_idfilterssetup_debuglinkexpected_responsescurrent_responseset_passphraserpr)rrrZdebug_transport)rqrrrs$      zTrezorClientDebugLink.__init__cstj|jjdS)N)rprr)r)rqrrr s zTrezorClientDebugLink.opencs|jjtjdS)N)rrrp)r)rqrrrs zTrezorClientDebugLink.closecCs||j|<dS)N)r)r message_typecallbackrrr set_filtersz TrezorClientDebugLink.set_filtercCs.|j}|jj|}t|r&|t|S|SdS)N)rqrgetcallabler)rrrrrrr_filter_messages   z%TrezorClientDebugLink._filter_messagecCsV|dkrd|j_dS|js"tdt|r0|}t|dsBtd||j_t|dS)Nz&Must be called inside 'with' statementr|z)input_flow should be a generator function)rryrrtrhasattrnext)rryrrrset_input_flows z$TrezorClientDebugLink.set_input_flowcCs|jd7_|S)Nr)r)rrrr __enter__,szTrezorClientDebugLink.__enter__cCs\|jd8_|jd|dk r$dS|jdkr2dS|jt|jkrL|jdd|_d|_dS)NrF)rrrrlen_raise_unexpected_response)rZ_typevalue tracebackrrr__exit__1s   zTrezorClientDebugLink.__exit__cCs|jstd||_d|_dS)Nz&Must be called inside 'with' statementr)rrtrr)rexpectedrrrset_expected_responsesJsz,TrezorClientDebugLink.set_expected_responsescCs|rd|j_nd|j_dS)NZ444222)rr()rrOZ pin_correctrrrrPs z%TrezorClientDebugLink.setup_debuglinkcCstj||j_dS)N)rnormalize_stringrrx)rrxrrrrWsz$TrezorClientDebugLink.set_passphrasecCstj|jd|_dS)Nr )rrsplitmnemonic)rrrrr set_mnemonicZsz"TrezorClientDebugLink.set_mnemoniccs&d}tj}|j|}|j||S)NT)rp _raw_readr_check_request)r__tracebackhide__resp)rqrrr]s    zTrezorClientDebugLink._raw_readcstj|j|S)N)rp _raw_writer)rr)rqrrrssz TrezorClientDebugLink._raw_writecCsd}t|jtd}t|jtdt|j}g}|jd|dkrT|jdj|xt||D]}|j|}||jkr|dnd}dd |j j D} d j d d | j D} t| d kr|jdj||j j | q`g} | jdj||j j x(| j D]\} } | jdj|| | qW| jdj||jdj | q`W|t|jkrht|j|}|jdj||jd|dk r|jd|jtj|n |jdtdj |dS)NTrrzExpected responses:z& (...{} previous responses omitted)z z>>> cSs&i|]\}}|dk r|gkr||qS)Nr)r0keyrrrr szDTrezorClientDebugLink._raise_unexpected_response..z, css|]}dj|VqdS)z{}={!r}N)format)r0irrrrDszCTrezorClientDebugLink._raise_unexpected_response..<z{}{}({})z{}{}(z {} {}={!r}z{}) z' (...{} following responses omitted)r-zActually received:z This message was never received.)maxr EXPECTED_RESPONSES_CONTEXT_LINESminrrappendrrange__dict__itemsr rqrkrformat_messager{)rrrZstart_atZstop_atoutputrexpprefixZ set_fieldsZ oneline_stritemrrZomittedrrrrvsB         z0TrezorClientDebugLink._raise_unexpected_responsecCsd}|jdkrdS|jt|jkr4tdtj||j|j}|j|jkrV|j|x@|jj D]2\}}|dksb|gkr|qbt |||krb|j|qbW|jd7_dS)NTz,No more messages were expected, but we got: r) rrrr{rrrqrrrgetattr)rrrrr`rrrrrs     z$TrezorClientDebugLink._check_requestcCs<|jj\}}|dkr|S|dkr0|j|dStddS)Nr-rrzUnexpected call)rr8rrt)rr3rNposrrrmnemonic_callbacks z'TrezorClientDebugLink.mnemonic_callback)T)rkrlrmrrrrrrrrrrrrrrrrrrurr)rqrrs"     ,rmessage)r`en-USFc Cs^t|ttfs|g}dd|D} |jjr2td|jtj| |||||||d} |j | S)NcSsg|]}tj|qSr)rr)r0mrrrr2szload_device..z@Device is initialized already. Call device.wipe() and try again.) mnemonicsr(rAlanguagelabel skip_checksum needs_backup no_backup) rrlisttuplefeatures initializedrtcallr" LoadDevice init_device) clientrr(rArrrrrrrrrr load_devices$  rcCs&|jjdk rtd|jtjddS)NTz!Device must be in bootloader modes5Uf3ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!Uf3)payload)rbootloader_modertrr"SelfTest)rrrr self_tests  rN)rFFF) collectionsrcopyrrrr-rr"rrrtoolsr rr rrrorvrSuccessrload_device_by_mnemonicrrrrrs(      w3e  python-trezor-0.11.6/src/trezorlib/__pycache__/device.cpython-36.pyc000066400000000000000000000111241361427340300253450ustar00rootroot000000000000003 ʵ] @sZddlZddlZddlZddlmZddlmZddlmZm Z ddl m Z m Z dZ Gdd d Zeejd d d"d d Zeejd d ddZeejd d d#ddZeejd d d$ddZeejd d ddZeejd d ddZddddddejjddf ddZeejd d e dddddddddejjf ddZeejd d d d!ZdS)%N)messages) Cancelled)expectsession)enumerate_devices get_transportc@s(eZdZdZeddZeddZdS) TrezorDevicez This class is deprecated. (There is no reason for it to exist in the first place, it is nothing but a collection of two functions.) Instead, please use functions from the ``trezorlib.transport`` module. cCstjdttS)NzTrezorDevice is deprecated.)warningswarnDeprecationWarningr)clsrL/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/device.py enumerate$s zTrezorDevice.enumeratecCstjdtt|ddS)NzTrezorDevice is deprecated.F) prefix_search)r r r r)rpathrrr find_by_path)s zTrezorDevice.find_by_pathN)__name__ __module__ __qualname____doc__ classmethodrrrrrrr s r message)fieldc Cs|tj}|dk r||_|r ||_|dk r.||_|dk r<||_|dk rJ||_|dk rX||_|dk rf||_|j |} |j | S)N) r ApplySettingslabellanguageuse_passphrase homescreenpassphrase_sourceauto_lock_delay_msdisplay_rotationcall init_device) clientrrrr r!r"r#settingsoutrrrapply_settings/s$  r)cCs|jtj|d}|j|S)N)flags)r$r ApplyFlagsr%)r&r*r(rrr apply_flagsOsr,FcCs|jtj|d}|j|S)N)remove)r$r ChangePinr%)r&r-retrrr change_pinVsr0cCs|jtj|d}|j|S)N)r-)r$rChangeWipeCoder%)r&r-r/rrrchange_wipe_code]sr2cCs|jtj|d}|j|S)N) operation)r$r SdProtectr%)r&r3r/rrr sd_protectdsr5cCs|jtj}|j|S)N)r$r WipeDevicer%)r&r/rrrwipeksr7Tzen-USc Cs|jjdkr|dkrtd|d kr,td|jjrB| rBtd| dkrVttj} tj|d||d } |s|| _ || _ || _ || _ | | _ |j| } xTt| tjry || j} |jtj| d } Wqtk r|jtj} YqXqW|j| S) N1z&Input callback required for Trezor One r8z Invalid word count. Use 12/18/24z=Device already initialized. Call device.wipe() and try again.T) word_countenforce_wordlisttypedry_run)word)r:r;r8)featuresmodel RuntimeError ValueError initializedinttimerRecoveryDevicepassphrase_protectionpin_protectionrr u2f_counterr$ isinstance WordRequestr>WordAckrCancelr%) r&r<rIrJrrZinput_callbackr>r?rKmsgresZinprrrrecoverrs4    rRc  Cs|jjrtd|dkr.|jjdkr*d}nd}tjt||t|t||||t|t| | d } |j| } t| tj s~tdt j d} |jtj | d}|j |S) Nz@Device is initialized already. Call wipe_device() and try again.r9) display_randomstrengthrIrJrrrK skip_backup no_backup backup_typez)Invalid response, expected EntropyRequest )entropy)rArErCrBr ResetDeviceboolr$rLEntropyRequestosurandom EntropyAckr%)r&rUrVrIrJrrrKrWrXrYrPrespZexternal_entropyr/rrrresets2    rccCs|jtj}|S)N)r$r BackupDevice)r&r/rrrbackupsre)NNNNNNN)F)F)r_rGr r exceptionsrZtoolsrr transportrr RECOVERY_BACKr Successr)r,r0r2r5r7RecoveryDeviceTypeScrambledWordsrR BackupTypeBip39rcrerrrrsZ          ) &python-trezor-0.11.6/src/trezorlib/__pycache__/eos.cpython-36.pyc000066400000000000000000000202601361427340300246750ustar00rootroot000000000000003 ʵ](@sddlmZddlmZddlmZmZmZmZddZddZ d d Z d d Z d dZ ddZ ddZddZddZddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Zd/d0Zeejd7d3d4Zed5d6Z d2S)8)datetime)messages) CallException b58decodeexpectsessioncCszt|}d}xhtddD]Z}d}||kr<|dkr|dD]2}t|d\}}|jtj||t|ddqWg}xN|dD]B}|jtjtjt|ddt|dddt|dd qRWg}x4|d D](}|jtjt|d t|dd qWtj t|d |||dS)Nkeyskeyweight)rirprqaccountsr:r9)r9r:)r;rqwaitswait_sec)rtrq threshold)rurorrrs) r7r<rEosAuthorizationKeyr(EosAuthorizationAccountr=rEosAuthorizationWaitEosAuthorization) rIrorpr6Z_krrr;rswaitrrrrcs( rccCs:t|d}t|d}tjt|dt|d||dS)Nr_activecreatorr)r|rr_r{)rcrEosActionNewAccountr)rIr_r{rrrparse_new_accounts    r~cCstj|}tjt||dS)N) data_size data_chunk)r*fromhexrEosActionUnknownr)rIZ data_bytesrrr parse_unknowns rcCsztj}|d}t||_|ddkrR|ddkrBt||_qv|ddkrZt||_n|ddkrrt||_ n|ddkrt ||_ n|dd krt ||_ n|dd krt||_n|dd krt||_n~|dd krt||_nf|dd krt||_nL|ddkrt||_n2|ddkr8t||_n|ddkrvt||_n$|ddkrlt||_n t||_|S)NrIr;ZeosiorZ voteproducerZbuyramZ buyrambytesZsellramZ delegatebwZ undelegatebwrefundZ updateauthZ deleteauthZlinkauthZ unlinkauthZ newaccountrW) rEosTxActionAckrAcommonrO vote_producerrRbuy_ramrT buy_ram_bytesrVsell_ramr\delegater^ undelegaterarre update_authrg delete_authrl link_authrn unlink_authr~ new_accountrJrWrunknown)r?Z tx_actionrIrrr parse_actions@                      rcCstj}ttj|ddtdddj|_t|d|_t|d|_t|d|_ t|d|_ t|d |_ d d |d D}||fS) N expirationz%Y-%m-%dT%H:%M:%Sir ref_block_numref_block_prefixmax_net_usage_wordsmax_cpu_usage_ms delay_seccSsg|] }t|qSr)r).0rrrr 3sz*parse_transaction_json..actions) r EosTxHeaderr(rstrptime total_secondsrrrrrr) transactionheaderrrrrparse_transaction_json%srFNcCs|jtj||d}|S)N) address_n show_display)callrEosGetPublicKey)clientnrmultisigresponserrrget_public_key;src Cst|\}}tj}||_tj||_||_t||_ |j |}y&x t |tj rb|j |j d}qDWWn tk rtdddYnXt |tjsttjj||S)NrzEos.UnexpectedEndOfOperationsz.Reached end of operations without a signature.)rr EosSignTxrr*rchain_idrr num_actionsr isinstanceEosTxActionRequestpop IndexErrorr EosSignedTx FailureTypeUnexpectedMessage)raddressrrrrmsgrrrrsign_txCs$      r)FN)!rr#rtoolsrrrrrrr/r7rArJrOrRrTrVr\r^rarergrlrnrcr~rrr EosPublicKeyrrrrrrs6         " ' python-trezor-0.11.6/src/trezorlib/__pycache__/ethereum.cpython-36.pyc000066400000000000000000000041371361427340300257320ustar00rootroot000000000000003 ] @sddlmZddlmZmZmZmZddZeej dddd d Z eej dd d Z edd dZ eejddZddZdS))messages) CallExceptionexpect normalize_nfcsessioncCs|j|jdddS)Nbig)to_bytes bit_length)valuer N/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/ethereum.pyint_to_big_endiansraddress)fieldFNcCs|jtj||dS)N) address_n show_display)callprotoEthereumGetAddress)clientnrmultisigr r r get_addresssrcCs|jtj||dS)N)rr)rrEthereumGetPublicKey)rrrr r rget_public_node!src  Cstj|t|t|t|t|||| d} |rXt|| _|dd|dd}} | | _|j| } x@| jdk r| j} || d|d| }} |jtj| d} qdW| jdkr| jd|d7_| j| j | j fS)N)rnonce gas_price gas_limitr tochain_idtx_typei) data_chunkr#) rEthereumSignTxrlen data_lengthdata_initial_chunkr EthereumTxAck signature_v signature_r signature_s)rrrrrr r datar!r"msgchunkresponser(r r rsign_tx(s*     r2cCst|}|jtj||dS)N)rmessage)rrrEthereumSignMessage)rrr3r r r sign_messageTsr5cCs^t|}y|jtj|||d}Wn&tk rH}z |}WYdd}~XnXt|tjrZdSdS)N)r signaturer3TF)rrrEthereumVerifyMessager isinstanceSuccess)rrr6r3resper r rverify_messageZs r<)FN)F)NNN)rrtoolsrrrrrEthereumAddressrEthereumPublicKeyrr2EthereumMessageSignaturer5r<r r r rs      !python-trezor-0.11.6/src/trezorlib/__pycache__/exceptions.cpython-36.pyc000066400000000000000000000030431361427340300262700ustar00rootroot000000000000003 ]@sTGdddeZGdddeZGdddeZGdddeZGdd d eZd S) c@s eZdZdS)TrezorExceptionN)__name__ __module__ __qualname__rrP/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/exceptions.pyrsrcs$eZdZfddZddZZS) TrezorFailurecs ||_tj|jj|jjdS)N)failuresuper__init__codemessage)selfr) __class__rrr szTrezorFailure.__init__csVddlmfddtD}|jjdk rFdj||jj|jjS||jjSdS)N) FailureTypecs"i|]}|jds|t|qS)_) startswithgetattr).0name)rrr sz)TrezorFailure.__str__..z{}: {})messagesrdirrr formatr )r typesr)rr__str__s     zTrezorFailure.__str__)rrrr r __classcell__rr)rrrs rc@s eZdZdS) PinExceptionN)rrrrrrrr*src@s eZdZdS) CancelledN)rrrrrrrr.src@s eZdZdS)OutdatedFirmwareErrorN)rrrrrrrr2srN) Exceptionrrrrrrrrrspython-trezor-0.11.6/src/trezorlib/__pycache__/fido.cpython-36.pyc000066400000000000000000000022441361427340300250320ustar00rootroot000000000000003 ʵ]@sddlmZddlmZeejddddZeejdddd Zeejddd d Zeejddd d Z eej ddddZ dS))messages)expect credentials)fieldcCs|jtjS)N)callrWebAuthnListResidentCredentials)clientr J/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/fido.pylist_credentialssr messagecCs|jtj|S)N)rrWebAuthnAddResidentCredential)r credential_idr r r add_credentialsrcCs|jtj|S)N)rr WebAuthnRemoveResidentCredential)rindexr r r remove_credentialsrcCs|jtj|dS)N) u2f_counter)rr SetU2FCounter)rrr r r set_counter$srrcCs|jtjS)N)rrGetNextU2FCounter)rr r r get_next_counter)srN) rtoolsrWebAuthnCredentialsr SuccessrrrNextU2FCounterrr r r r s  python-trezor-0.11.6/src/trezorlib/__pycache__/firmware.cpython-36.pyc000066400000000000000000000261651361427340300257350ustar00rootroot000000000000003 <^k7!@sddlZddlmZddlmZmZmZmZddlZ ddl Z ddl m Z m Z mZyddlmZWn ek rddlmZYnXdZdd d d d d ZejdejdejdgZdZdZdZdZeedddZGdddeZGdddeZGdddeZGdddeZ Gd d!d!e j!Z"e j#d"e j$d#d$e"e j%de d%e j&d&e j&d'e j'e j(e j)Z*e j+e j,d(e j-e j.d)dd*e j/d+e j/d,e j/d-e j.d.ededZ0e j#d/e j1d"e j$d0d1e j2d.d2e j(d3e j#d4e j3d5e j3d6e j3d7e j4e j3e j5e j6j7d8e0d(e j2d9d:e j%d;e j6j8de*d?e j1e j2e j6j;d@ dAdBe j<dCe j%ddDe j1dEe j=e j6j>d.e j4e j(e j6j?e j6j>Z@e j#d4e j3d5e j3dFe j3dGe j3ZAe j#d/e j1d"e j$dHdEe j(d2e j(dIe j4e j(dJdKd3eAdLeAd(e j2dMdNe j%d;dOdPe j%dedQe j3ed(e j2dRdBe j<dCe j%ddDe j1dSe jBe j6jCjDdke j=e j6j>d.e j4e j(e j6j?e j6j>ZEe j#dTe@dUeEdVe j1dWe j%e j6jFjGe jHZIe j#dUeEdVe j1dWe j%e j6jFjGe jHZJe j#d"e j$dXdIe j4e j(e j5e j6jKdYe j3edZe j,e j2d[d\e j/d(e j2d]d^e j%dedWe j%e j6jGe jHd_e jLe j6jKe jMeJ ZNGd`dadaeZOedbe jPZQeeOeQfZReeRddcddZSeQededfdgZTeeeUeeddhdidjZVefe jPe jWeedkdldmZXeQededndoZYeQededpdqZZeedfeQeeUeddrdsdtZ[deQe\ddvdwdxZ]deQe\ddvdydzZ^deQe\dd{d|d}Z_eOeQed~ddZ`deOeQe\ddddZaejbddZcdS)N)Enum)CallableListNewTypeTuple)cosimessagestools)blake2sZ04d571b7f148c5e4232c3814f777d8faeaf1a84216c78d569b71041ffc768a5b2d810fc3bb134dd026b57e65005275aedef43e155f48fc11a32ec790a93312bd58Z0463279c0c0866e50c05c799d32bd6bab0188b6de06536d1109d2ed9ce76cb335c490e55aee10cc901215132e853097d5432eda06b792073bd7740c94ce4516cb1Z0443aedbb6f7e71c563f8ed2ef64ec9981482519e7ef4f4aa98b27854e8c49126d4956d300ab45fdc34cd26bc8710de0a31dbdf6de7435fd0b492be70ac75fde58Z04877c39fd7c62237e038235e9c075dab261630f78eeb8edb92487159fffedfdf6046c6f8b881fa407c4a4ce6c28de0b19c1f4e29f1fcbc5a58ffd1432a3e0938aZ047384c51ae81add0a523adbb186c91b906ffb64c2c765802bf26dbd13bdf12c319e80c2213a136c8ee03d7874fd22b70d68e7dee469decfbbb510ee9a460cda45)rr Z@c2c87a49c5a3460977fbb2ec9dfe60f06bd694db8244bd4981fe3b7a26307f3fZ@80d036b08739b846f4cb77593078deb25dc9487aedcf52e30b4fb7cd7024178aZ@b8307a71f552c60a4cbb317ff48b82cdbf6b6bb5f04c920fec7badf017883751r i@)datareturncCstdd|DdddS)aByte-swap and bit-invert the VendorTrust field. Vendor trust is interpreted as a bitmask in a 16-bit little-endian integer, with the added twist that 0 means set and 1 means unset. We feed it to a `BitStruct` that expects a big-endian sequence where bits have the traditional meaning. We must therefore do a bitwise negation of each byte, and return them in reverse order. This is the same transformation both ways, fortunately, so we don't need two separate functions. css|]}|d@VqdS)N).0brrN/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/firmware.py ?sz*_transform_vendor_trust..Nr)bytes)rrrr_transform_vendor_trust5s rc@s eZdZdS)FirmwareIntegrityErrorN)__name__ __module__ __qualname__rrrrrBsrc@s eZdZdS)InvalidSignatureErrorN)rrr rrrrr!Fsr!c@s eZdZdS)UnsignedN)rrr rrrrr"Jsr"c@seZdZdZdZdS)ToifModefgN)rrr Z full_colorZ grayscalerrrrr#Nsr#cs,eZdZfddZddZddZZS) EnumAdaptercs||_tj|dS)N)enumsuper__init__)selfZsubconr') __class__rrr)TszEnumAdapter.__init__cCs|jS)N)value)r*objctxpathrrr_encodeXszEnumAdapter._encodec Cs$y |j|Stk r|SXdS)N)r' ValueError)r*r-r.r/rrr_decode[s zEnumAdapter._decode)rrr r)r0r2 __classcell__rr)r+rr&Ss r&magicsTOIformatwidthheightrreserved Zshow_vendor_stringZrequire_user_clickZred_backgrounddelayr _start_offsetsTRZVZ _header_lenexpiryversionmajorminorvendor_sigs_required vendor_sigs_nZ vendor_trustpubkeys vendor_stringzutf-8Z vendor_image_data_end_offsetAisigmask signature _end_offsetZ header_lenpatchbuildsTRZF code_lengthcCs d|jkrt|jjS|jpdS)Ncoder)_lenrNrM)thisrrrsrRZ fix_versionhashes v1_signaturesv1_key_indexesZ_rebuild_header_len vendor_headerfirmware_header _code_offsetrNsTRZR key_indexesflagsZrestore_storage4 signaturesembedded_onev2c@seZdZdZdZdZdS)FirmwareFormatrr r N)rrr TREZOR_ONETREZOR_T TREZOR_ONE_V2rrrrrbsrb FirmwareTypecCs|dddkrtj}t}n@|dddkr8tj}t}n$|dddkrTtj}t}ntdy|j|}Wn,t k r}zt d|WYdd}~XnX|t |fS)NrsTRZRsTRZVsTRZFz Unrecognized firmware image typezInvalid firmware image) rbrc FirmwareOnerdFirmwarere FirmwareOneV2r1parse Exceptionrrf)rr=clsfwerrrrjsrj)rmrcCstj|jjS)N)hashlibsha256rNdigest)rmrrr digest_onev1srr)rqr\r`rc Cstdd|D}|stt|t|krBtdjt|t|xtt|D]}||}||}|tkrztdj|tjt|dd}t j j |t j j d}y|j||WqPt jk r} ztdj|| WYdd} ~ XqPXqPWdS)Ncss|]}|dkr|VqdS)rNr)rirrrrszcheck_sig_v1..z2Not enough distinct signatures (found {}, need {})zUnknown key in slot {}r)curvezInvalid signature in slot {})setr"rPr!r5rangeV1_BOOTLOADER_KEYSrfromhexecdsaZ VerifyingKeyZ from_stringZcurvesZ SECP256k1Z verify_digestZBadSignatureError) rqr\r`Zdistinct_key_indexesrsZkey_idxrIpubkeyverifyrnrrr check_sig_v1s$r|)header header_type hash_functionrcCsJ|j}d|_dd|_dddg|_ddgd|_|j|}||jS)Nrrr )copyrHrIrWrVrLrq)r}r~rZstripped_header header_bytesrrr_header_digest"s   rcCst|jttS)N)rrZFirmwareHeaderr )rmrrr digest_v2.srcCst|jttjS)N)rrZrrorp)rmrrr digest_onev22sr)rmr chunk_size padding_byterc Csxt|jjD]\}}|dkr4|jd||j}n |||j}|j|||}|dk r|dkr|rt||kr||dd|t|7}| r|ddkrq||j}||krtdqWdS)NrrrrDzInvalid firmware data.) enumeraterZrTrNr[rPrqr) rmrrrrsZ expected_hashchunkptrZ chunk_hashrrrvalidate_code_hashes6s  rF)rmallow_unsignedrcCsNytt||jj|jjWntk r6|s2YnXt|tjt dddS)N)rrr) r|rrZrWrVr"rrorpONEV2_CHUNK_SIZE)rmrrrrvalidate_onev2Psrc CsJytt||j|jWntk r2|s.YnX|jrFt|j|dS)N)r|rrr\r`r"rar)rmrrrrvalidate_onev1csr)rmskip_vendor_headerrcCst|jt}t|}|sVy tj|jj|tt|jj t Wnt k rTt dYnXy,tj|j j||jj|jj|j j |jjWnt k rt dYnXt|dS)Nz Invalid vendor header signature.zInvalid firmware signature.)rrY VendorHeaderrr verify_m_of_nrIV2_BOOTLOADER_MV2_BOOTLOADER_NrHV2_BOOTLOADER_KEYSrkr!rZr@rArCr)rmrZvendor_fingerprint fingerprintrrr validate_v2ms0  r)r=rmrcCsB|tjkrt|S|tjkr$t|S|tjkr6t|StddS)NzUnrecognized firmware version)rbrcrrrerrdrr1)r=rmrrrrqs   rq)r=rmrrcCsF|tjkrt||S|tjkr(t||S|tjkr:t|StddS)NzUnrecognized firmware version)rbrcrrerrdrr1)r=rmrrrrvalidates     rcCs|jjdkrtd|jtjt|d}t|tjrd|jtj |d}t|tjrXdStd|xFt|tj r||j |j |j }t |j}|jtj ||d}qfWt|tjrdStd|dS)NFz!Device must be in bootloader mode)length)payloadzUnexpected result %s)rhashzUnexpected message %s)featuresbootloader_mode RuntimeErrorcallr FirmwareEraserP isinstanceSuccessFirmwareUploadFirmwareRequestoffsetrr rq)clientrresprrqrrrupdates      rii)F)F)F)F)dror'rtypingrrrrZ constructcryrr r r ImportErrorZpyblake2ZV1_SIGNATURE_SLOTSrwrrxrrrrZ V2_CHUNK_SIZErrkrr!r"r#ZAdapterr&StructZConstBytesZInt16ulZPrefixedZInt32ulZ GreedyBytesZToifZ TransformedZ BitStructDefaultZ BitsIntegerFlagZ VendorTrustZTellPaddingZInt8ulZRebuildZlen_rQrCrAZAlignedZ PascalStringrFZByteZPointerr;rJrZ VersionLongIfr=r>rrZrMZ TerminatedrhrirNZ RestreamDataOptionalrgrb ContainerrfZParsedFirmwarerjrrintr|Z Constructrrrrboolrrrrqrsessionrrrrrs                     "         * python-trezor-0.11.6/src/trezorlib/__pycache__/lisk.cpython-36.pyc000066400000000000000000000032031361427340300250470ustar00rootroot000000000000003 ]@sddlmZddlmZddlmZmZmZm Z eej dddddZ eej dd d Z eejd d Zd dZdddZeejddZdS))messages) dict_to_proto) CallExceptiondict_from_camelcaseexpect normalize_nfcaddress)fieldFcCs|jtj||dS)N) address_n show_display)callprotoLiskGetAddress)clientnr rJ/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/lisk.py get_addresssrcCs|jtj||dS)N)r r )r r LiskGetPublicKey)rrr rrrget_public_keysrcCst|}|jtj||dS)N)r message)rr r LiskSignMessage)rrrrrr sign_message srcCsVt|}y|jtj|||d}Wn&tk rH}z |}WYdd}~XnXt|tjS)N) signature public_keyr)rr r LiskVerifyMessager isinstanceSuccess)rpubkeyrrresperrrverify_message&sr! life_time keys_group)ZlifetimeZ keysgroupcCs,t|td}ttj|}|jtj||dS)N)renames)r transaction)rRENAMESrr LiskTransactionCommonr LiskSignTx)rrr%msgrrrsign_tx6s  r*N)F)F)rr protobufrtoolsrrrr LiskAddressr LiskPublicKeyrLiskMessageSignaturerr!r& LiskSignedTxr*rrrrs      python-trezor-0.11.6/src/trezorlib/__pycache__/log.cpython-36.pyc000066400000000000000000000027301361427340300246720ustar00rootroot000000000000003 ]@slddlZddlmZmZmZddlmZeZdZ ej e dGdddej Z d e eejd d d ZdS) N)OptionalSetType)protobufZBYTEScs&eZdZejedfdd ZZS)PrettyProtobufFormatter)recordreturncsr|j|}dj||jj|jtj|d}t|drnt|jt krZ|dj|jj 7}n|dtj |j7}|S)Nz [{time}] {source} {level}: {msg})timelevelsourcemsgrz ({} bytes) ) formatTimeformat levelnameuppernamesuperhasattrtyperOMITTED_MESSAGESByteSizeformat_message)selfr r message) __class__I/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/log.pyrs  zPrettyProtobufFormatter.format)__name__ __module__ __qualname__logging LogRecordstrr __classcell__rr)rrrsr) verbosityhandlercCs\|dkrtj}t}|j||dkr.tj}|dkr:t}tjd}|j||j|dS)Nrr trezorlib) r# StreamHandlerr setFormatterDEBUG DUMP_BYTES getLoggersetLevel addHandler)r'r( formatterr loggerrrrenable_debug_output.s   r3)rN)r#typingrrrrsetrr- addLevelName FormatterrintHandlerr3rrrrs  python-trezor-0.11.6/src/trezorlib/__pycache__/misc.cpython-36.pyc000066400000000000000000000034441361427340300250470ustar00rootroot000000000000003 ] @sddlmZddlmZmZeejdddeejdddZeejddej e e e ejd d d Z eej ddej e e ej d ddZeejddddee e eee ejdddZeejddddee e eee ejdddZd S))messages)Addressexpectentropy)field TrezorClient)clientsizereturncCs|jtj|dS)N)r )callr GetEntropy)rr r J/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/misc.py get_entropysrN)ridentitychallenge_hiddenchallenge_visualecdsa_curve_namer cCs|jtj||||dS)N)rrrr)r r SignIdentity)rrrrrr r r sign_identitys r)rrpeer_public_keyrr cCs|jtj|||dS)N)rrr)r rGetECDHSessionKey)rrrrr r rget_ecdh_session_key/s rvalueT)rnkeyrask_on_encryptask_on_decryptivr c Cs|jtj|||d|||dS)NT) address_nrrencryptrrr)r rCipherKeyValue)rrrrrrrr r rencrypt_keyvalue?s r#c Cs|jtj|||d|||dS)NF)r rrr!rrr)r rr")rrrrrrrr r rdecrypt_keyvalueVs r$)N)N)TTr)TTr)rtoolsrrEntropyintrSignedIdentity IdentityTypebytesstrrECDHSessionKeyrCipheredKeyValueboolr#r$r r r rs&      python-trezor-0.11.6/src/trezorlib/__pycache__/monero.cpython-36.pyc000066400000000000000000000013141361427340300254050ustar00rootroot000000000000003 ]@sHddlmZddlmZeejddd ddZeejd d d Zd S))messages)expectaddress)fieldFcCs|jtj|||dS)N) address_n show_display network_type)callprotoMoneroGetAddress)clientnrr rL/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/monero.py get_addresssrcCs|jtj||dS)N)rr )r r MoneroGetWatchKey)r rr rrr get_watch_key#srN)Fr)r) rr toolsr MoneroAddressrMoneroWatchKeyrrrrrs    python-trezor-0.11.6/src/trezorlib/__pycache__/nem.cpython-36.pyc000066400000000000000000000120501361427340300246640ustar00rootroot000000000000003 ]p@sddlZddlmZddlmZmZdZdZdZ dZ d Z d Z d Z d Zd dZddZddZddZddZddZddZddZddZeejdd d&d"d#Zeejd$d%ZdS)'N)messages) CallExceptionexpectiiiiii i@i@cCsTtj}|dd?d@|_|d|_|d|_|d|_d|krPtj|d|_|S)NversionZ timeStampfeedeadlinesigner) protoNEMTransactionCommonnetwork timestampr r bytesfromhexr ) transactionmsgrI/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/nem.pycreate_transaction_common s   rcCstj}|d|_|d|_d|dkr`tj|dd|_|dddkr`tj|dd|_d|kr|d d |dD|_|S) N recipientamountpayloadmessagetype publicKeymosaicscSs0g|](}tj|dd|dd|ddqS)mosaicId namespaceIdnamequantity) namespacemosaicr")r NEMMosaic).0r$rrr :sz#create_transfer..) r NEMTransferrrrrr public_keyr)rrrrrcreate_transfer-s   r*cCs6tj}dd|dD|_d|kr2|dd|_|S)NcSs(g|] }tj|dtj|ddqS)ZmodificationTypeZcosignatoryAccount)rr))r NEMCosignatoryModificationrr)r&Z modificationrrrr'Hsz1create_aggregate_modification.. modificationsZminCosignatoriesZrelativeChange)r NEMAggregateModificationr,relative_change) transactionsrrrrcreate_aggregate_modificationEs r0cCs<tj}|d|_|dr$|d|_|d|_|d|_|S)NZnewPartparentZ rentalFeeSinkZ rentalFee)r NEMProvisionNamespacer#r1sinkr )rrrrrcreate_provision_namespaceUs    r4cCs.|d}tj}tj|_|dd|j_|dd|j_|dr|dd|j_|dd|j_|dd|j_|dd d|j_ |dd d|j_ |d |j_ xn|d D]b}|d}t j |d }|d kr||j_q|dkr||j_q|dkr||j_q|dkr||j_qW|d|_|d|_|S)NZmosaicDefinitionidr r!levyrr rr descriptionZ propertiesvalue divisibilityZ initialSupplyZ supplyMutable transferableZcreationFeeSinkZ creationFee)r NEMMosaicCreationNEMMosaicDefinition definitionr#r$r6r levy_addresslevy_namespace levy_mosaicr7jsonloadsr9supplymutable_supplyr:r3)rr=rpropertyr!r8rrrcreate_mosaic_creationas4         rFcCs<tj}|dd|_|dd|_|d|_|d|_|S)Nrr r!Z supplyTypedelta)r NEMMosaicSupplyChanger#r$rrG)rrrrrcreate_supply_changes   rIcCs.tj}|dd|_tj|dd|_|S)NZimportanceTransfermoder)r NEMImportanceTransferrJrrr))rrrrrcreate_importance_transfersrLcCs|dtkrt||_n|dtkr0t||_nh|dtkrHt||_nP|dt kr`t ||_ n8|dt krxt ||_n |dtkrt||_ntddS)NrzUnknown transaction type)TYPE_TRANSACTION_TRANSFERr*transferTYPE_AGGREGATE_MODIFICATIONr0aggregate_modificationTYPE_PROVISION_NAMESPACEr4provision_namespaceTYPE_MOSAIC_CREATIONrFmosaic_creationTYPE_MOSAIC_SUPPLY_CHANGErI supply_changeTYPE_IMPORTANCE_TRANSFERrLimportance_transfer ValueError)rrrrrfill_transaction_by_types            rZcCsntj}t||_|dtk|_|dttfkrN|d}t||_t||nd|kr`t dn t|||S)NrZ otherTransz.Transaction does not support inner transaction) r NEMSignTxrrTYPE_MULTISIG_SIGNATURE cosigning TYPE_MULTISIGmultisigrZrY)rrZ other_transrrrcreate_sign_txs     r`address)fieldFcCs|jtj|||dS)N) address_nr show_display)callr NEMGetAddress)clientnrrdrrr get_addresssricCsZy t|}Wn,tk r8}zt|jWYdd}~XnX|jdk sHt||j_|j|S)N)r`rYrargsrAssertionErrorrcre)rgrhrrerrrsign_txs rm)F)rArr toolsrrrMrWrOr\r^rQrSrUrr*r0r4rFrIrLrZr` NEMAddressri NEMSignedTxrmrrrrs,   "   python-trezor-0.11.6/src/trezorlib/__pycache__/protobuf.cpython-36.pyc000066400000000000000000000343611361427340300257560ustar00rootroot000000000000003 ʵ].@ @s|dZddlZddlmZddlmZmZmZmZm Z m Z m Z m Z m Z mZmZddlmZede de de d e d e d e d fZe eeefZed ddZGdddeZGdddeZedZejeZeedddZeeddddZeedddZ eedddZ!Gd ddZ"Gd!d d Z#Gd"d d Z$Gd#ddZ%Gd$d d Z&Gd%d d Z'Gd&ddZ(Gd'd(d(Z)Gd)d*d*Z*dZ+eee ed+d,d-Z,eeeee-fd+d.d/Z.eeee/ee(fd+d0d1Z0ee eed2d3d4Z1ee(dd5d6d7Z2dJe(eee ee eed<d=d>Z3eeed?d@dAZ4e eeeefedBdCdDZ5dKe(e-eeefdFdGdHZ6dS)La3 Extremely minimal streaming codec for a subset of protobuf. Supports uint32, bytes, string, embedded message and repeated fields. For de-serializing (loading) protobuf types, object with `Reader` interface is required. For serializing (dumping) protobuf types, object with `Writer` interface is required. N)BytesIO) AnyCallableDictIterableIteratorListOptionalTupleTypeTypeVarUnion)ProtocolEnumType MessageType UVarintType SVarintTypeBoolType UnicodeType BytesTypeMT)Zboundc@seZdZeedddZdS)Reader)bufferreturncCsdS)z Reads exactly `len(buffer)` bytes into `buffer`. Returns number of bytes read, or 0 if it cannot read that much. N)selfrrrN/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/protobuf.pyreadinto9szReader.readintoN)__name__ __module__ __qualname__ bytearrayintrrrrrr8src@seZdZeedddZdS)Writer)rrcCsdS)zF Writes all bytes from `buffer`, or raises `EOFError` Nr)rrrrrwriteAsz Writer.writeN)rrr bytesr"r$rrrrr#@sr#)readerrcCsrt}d}d}d}d}xX|d@rl|j|dkrB|dkr>tdnt|d7}|d}||d@|>7}|d7}qW|S)NrzInterrupted UVarintr&)_UVARINT_BUFFERrIOErrorEOFError)r'rresultshiftbyteZ bytes_readrrr load_uvarintLs   r1)writernrcCsT|dkrtdt}d}x6|rN|d?}|d@|r4dndB|d<|j||}qWdS)Nrz7Cannot dump signed value, convert it to unsigned first.r&r*r)r() ValueErrorr+r$)r2r3rZshiftedrrr dump_uvarint_s r5)sintrcCs|d>}|dkr|}|S)Nr&rr)r6resrrr sint_to_uintsr8)uintrcCs|d@}|d?}|r|}|S)Nr&r)r9signr7rrr uint_to_sints r;c@seZdZdZdS)rrN)rrr WIRE_TYPErrrrrsc@seZdZdZdS)rrN)rrr r<rrrrrsc@seZdZdZdS)rrN)rrr r<rrrrrsc@sVeZdZdZeeeddddZeedddZeedd d Z eed d d Z dS)rrN) enum_name enum_valuesrcCs||_||_dS)N)r=r>)rr=r>rrr__init__szEnumType.__init__)fvaluercCs"||jkrtjdj||j|S)NzValue {} unknown for type {})r>LOGwarningformatr=)rr@rrrvalidates zEnumType.validatecCsTddlm}t||j}x6t|D]"}|jdr2q"t|||kr"|Sq"WtddS)Nr&)messages__zInvalid enum value)rEgetattrr=dir startswith TypeError)rr@rEmodulenamerrrto_strs   zEnumType.to_str)fstrrc Cs`y)rcitemsrbr)rdkeyvaluerrr__repr__s  zMessageType.__repr__cCs t|jS)N)iterkeys)rrrr__iter__szMessageType.__iter__cCsdd|jjDS)Ncss|]\}}}|VqdS)Nr).0rM_rrr sz#MessageType.keys..)rWrX)rrrrrkszMessageType.keys)rgrcCs t||S)N)rH)rrgrrr __getitem__szMessageType.__getitem__cCsLxF|jjD]6\}}}t||s|t@r8t||gqt||dqWdS)N)rWrXhasattr FLAG_REPEATEDr^)rrYrZfflagsrrrr_s  zMessageType._fill_missingcCst}t||t|jS)N)r dump_messagelengetvalue)rdatarrrByteSizes zMessageType.ByteSize)rrr r< classmethodrr" FieldInforWrTr FieldTyper\rr?boolrdrirrlrkrpr_rxrrrrrs c@s.eZdZeeddddZeedddZdS) LimitedReaderN)r'limitrcCs||_||_dS)N)r'r~)rr'r~rrrr?szLimitedReader.__init__)bufrcCs4|jt|krdS|jj|}|j|8_|SdS)Nr)r~rur'r)rrZnreadrrrrs  zLimitedReader.readinto)rrr rr"r?r!rrrrrr}sr}c@s*eZdZddddZeedddZdS)CountingWriterN)rcCs d|_dS)Nr)size)rrrrr?szCountingWriter.__init__)rrcCst|}|j|7_|S)N)rur)rrZnwrittenrrrr$szCountingWriter.write)rrr r?r%r"r$rrrrr sr)rZr'rc CsJt|}t||}g}yx|jt||qWWntk rDYnX|S)N)r1r}appenddecode_varint_fieldr-)rZr'lengthZ packed_readerrXrrrdecode_packed_array_fields rcCsPt|}|tkr|S|tkr$t|S|tkr4t|St|trH|j|St dS)N) r1rrr;rr|rPrrDrK)rZr'rhrrrr&s  rcCsxt|}|tkr*t|}|j|t|S|tkrLt|}|j||jSt|trpt |t rpt t |||St dS)N)r1rr!rr%rdecoderPtype issubclassr load_messager}rK)rZr'rhrrrrdecode_length_delimited_field4s  r)r'msg_typerc CsZ|j}|}xDy t|}Wntk r4PYnX|d?}|d@}|j|d}|dkr|dkrlt|q|dkrt|}|jt|qtq|\} } } |dkr| jdkr| t@rt | |} n@|| jkrt n0|dkrt | |g} n|dkrt | |g} nt | t@r&t || } | j| | }n t| dkr>tdn| d}t|| |qW|S)Nr*rrUr&z1Unexpected multiple values in non-repeating field)rWr1r-getrr!r4r<rrrrKrrrHextendrur^)r'rfieldsmsgfkeyftagZwtypefieldrRrYrZrsZfvaluesZpvaluer@rrrrFsJ          r)r2rrcCspdg}|j}|j}xT|D]J}||\}}}t||d} | dkrFq|d>|jB} |t@sh| |d<|} x| D]} t|| |tkrt|| qn|tkrt|t| qn|t krt|t | qnt |t rt||j | qn|tkrt|t| |j| qn|tkr,| j} t|t| |j| qnt|tr`t} t| | t|| jt|| qntqnWqWdS)Nrr)rbrWrHr<rrr5rrr8rr"rPrrDrrur$rencoderrrrtrrK)r2rZrepvaluemtyperrrYrZrsr@rZsvalueZ svalue_bytesZcounterrrrrtsF             rt @)pbindentseptruncate_after truncate_torcsTttdddttttdfdd djjjjdj |d S) N)r%rcSs*|sdStdd|D}|t|dkS)NTcss*|]"}d|kodknrdVqdS) ~r&Nr)rmr0rrrrosz;format_message..mostly_printable..g?)sumru)r% printablerrrmostly_printablesz(format_message..mostly_printable)rMrhrrc s}dj}t|tr4t|St|tr| sTt|tttfr\t|Sd|dg}fdd|D|dd<dj |St|t rdg}xPt |j D]@\}}|dks|gkrq|j |d||dd qW|j |d dj |St|ttfr~t|}d } rP|krPd } |dpJd }|rdt|} n d|j} dj|| | St|trt|trdj|j||St|S)Nr&[]cs$g|]}|ddqS)r&,r)rmx)rleadinrMpformatrr sz3format_message..pformat.. {z: r}rGz...r0xz {} bytes {}{}z{} ({}))r\rPrformat_messagelistrrrreprjoindictsortedrerr%r!ruhexrCr"rrN) rMrhrlevelrZlinesrgvalrsuffixoutput)rrrrrr)rrrMrrs@         *    zformat_message..pformatz{name} ({size} bytes) {content}rG)rMrcontent) r%r|rTrr"rCrbrrxrc)rrrrrr)rrrrrrrrs ",r)rZrhrcCst|trt|trtdt|trBt|tr:|j|St|S|t t fkrVt|S|t krft |S|t krvt|S|tkrt|trtj|St|tr|Stdjt|dS)Nz*value_to_proto only converts simple valueszcan't convert {} value to bytes)rPrrrrKrrTrSr"rrrr|rrr%fromhexrC)rZrhrrrvalue_to_protos$       r) message_typerfrcsi}x|jjD]v\}}|t@}|j|}|dkr8q|sB|g}ttr\ttr\tnt fdd|D}|s|d}|||<qW|f|S)Ncsg|]}|qSrr)rmv)rZfunctionrrrsz!dict_to_proto..r) rWrXrrrrPrrr dict_to_protor)rrfparamsrYrsZrepeatedrhZnewvaluer)rZrrrs   rT)r hexlify_bytesrcs^tttdfdd i}x<|jjD].\}}|dks(|gkrBq(|j||||<q(W|S)N)rZrhrcsnrt|tr|jSt|tr*t|St|trHfdd|DSt|trfttrfj|S|SdS)Ncsg|]}|qSrr)rmr) convert_valuerZrrr/sz2to_dict..convert_value..) rPr%rrto_dictrr"rrN)rZrh)rr)rZrr)s    zto_dict..convert_value)r{rrcrer\)rrr7rgrhr)rrrr(s r )rrrr)T)7__doc__loggingiortypingrrrrrrr r r r r typing_extensionsrr{rTr"rzrrr#r!r+ getLoggerrrAr1r5r8r;rrrrrrrr}rrrrr|rr%rrrtrrrrrrrrs\ 4     '6  96:python-trezor-0.11.6/src/trezorlib/__pycache__/ripple.cpython-36.pyc000066400000000000000000000030621361427340300254030ustar00rootroot000000000000003 ]=@svddlmZddlmZddlmZmZdZdZeej d d dd dZ eej ej dddZ ej dddZdS))messages) dict_to_proto)dict_from_camelcaseexpectFeeSequenceTransactionTypePaymentAmount Destinationaddress)fieldFcCs|jtj||dS)N) address_n show_display)callrRippleGetAddress)clientrrrL/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/ripple.py get_addresssr)msgcCs||_|j|S)N)rr)rrrrrrsign_tx sr)returncsdtfddtDstdtfddtDs'sz%create_sign_tx_msg..z#Some of the required fields missingc3s|]}dj|VqdS)r N)r)rr)rrrr)sz+Some of the required payment fields missingrr z*Only Payment transaction type is supported)allREQUIRED_FIELDS ValueErrorREQUIRED_PAYMENT_FIELDSrrr RippleSignTx)rZ convertedr)rrcreate_sign_tx_msg&s r#N)rrrr )r r )F)rprotobufrtoolsrrrr! RippleAddressrRippleSignedTxr"rr#rrrrs    python-trezor-0.11.6/src/trezorlib/__pycache__/stellar.cpython-36.pyc000066400000000000000000000156601361427340300255650ustar00rootroot000000000000003 ]0@sddlZddlZddlZddlmZddlmZmZdZdZ dZ dZ dZ dZ dZdZdZdZdZdZdZdZd Zd Zd Zd Zd ZdZdZdZddZddZddZ ddZ!ddZ"ddZ#ddZ$eej%dd d&d"d#Z&efd$d%Z'dS)'N)messages) CallExceptionexpect z m/44h/148h/0hz.Public Global Stellar Network ; September 2015cCs>t}|jd|j||jtjdt|tj|jS)z:Returns the base32-encoded version of pk_bytes (G...) r rztj|t||jdS|tkrdtj |t|t ||jdS|t krtj |t ||jt|t ||jgd}|j}x t |D]}|jjt |qW|S|tkrtj|t |t ||j|j|j|jdS|tkr2tj|t |t ||j|j|jdS|tkrtj|d}|jr\t||_|jrp|j|_|jr|j|_|jr|j|_|jr|j|_|jr|j|_|jr|j|_|jr|j|_|jr|j|_ |jd|_!|j|_"|S|t#kr8tj$|t ||jd S|t%krtj&|t||jd }|j't(krr|j)d |_*|j't+kr|j)d |_*|j|_,|S|t-krtj.|t|d S|t/krtj0||jd}|jr|j1|_2|S|t3krtj4||jdSt5dt6|dS)zlReturns a protobuf message representing the next operation as read from the byte stream in unpacker Nr!)r% new_accountstarting_balance)r%destination_accountassetamount)r% send_assetsend_maxrBdestination_assetdestination_amountpaths)r% selling_asset buying_assetrDprice_nprice_doffer_id)r%rJrKrDrLrM)r%)r%rClimit)r%trusted_account asset_typer )r%rB)r%key)r%bump_tozUnknown operation type: )7r*r6r&OP_CREATE_ACCOUNTrStellarCreateAccountOpr$Z unpack_hyper OP_PAYMENTStellarPaymentOp_xdr_read_assetOP_PATH_PAYMENTStellarPathPaymentOpr9rIrOP_MANAGE_OFFERStellarManageOfferOpr(OP_CREATE_PASSIVE_OFFERStellarCreatePassiveOfferOpOP_SET_OPTIONSStellarSetOptionsOpinflation_destination_account clear_flags set_flags master_weight low_thresholdmedium_thresholdhigh_thresholdr0 home_domain signer_type signer_key signer_weightOP_CHANGE_TRUSTStellarChangeTrustOpOP_ALLOW_TRUSTStellarAllowTrustOprQASSET_TYPE_ALPHA4unpack_fstring asset_codeASSET_TYPE_ALPHA12 is_authorizedOP_ACCOUNT_MERGEStellarAccountMergeOpOP_MANAGE_DATAStellarManageDataOpZ unpack_opaquevalueOP_BUMP_SEQUENCEStellarBumpSequenceOpr-str)r<r%typeopZ num_pathsr>rrrr:s                                           r:cCsTtj|jd}|jtkr0|jd|_t||_|jt krP|jd|_t||_|S)z#Reads a stellar Asset from unpacker)r~rrR) rStellarAssetTyper&r~rqrrcoder$issuerrt)r<rCrrrrY&s      rYcCs&|j}|dkrtdt|jdS)zReads a stellar address and returns the string representing the address This method assumes the encoded address is a public address (starting with G) rzUnsupported address typer!)r&r-rr6)r< address_typerrrr$5sr$cCsld}d}xZ|D]R}xLtdD]@}|d|?d@dk}|d?d@dk}|dK}||Ar||N}qWqW|d@S)zReturns the CRC-16 checksum of bytearray bytes Ported from Java implementation at: http://introcs.cs.princeton.edu/java/61data/CRC16CCITT.java.html Initial value changed to 0x0000 to match Stellar configuration. ri!r r ri)r9)bytescrcZ polynomialbyteibitZc15rrrrAs raddress)fieldFcCs|jtj||dS)N) address_n show_display)callrStellarGetAddress)clientrrrrr get_addressYsrc Cs||_||_t||_|j|}y&x t|tjrB|j|jd}q$WWn t k rft dddYnXt|tj st tj j ||rt dd|S)Nrz!Stellar.UnexpectedEndOfOperationsz.Reached end of operations without a signature.zStellar.UnprocessedOperationsz6Received a signature before processing all operations.)network_passphraserlenr8r isinstancerStellarTxOpRequestpop IndexErrorrStellarSignedTx FailureTypeUnexpectedMessage)rr;r=rrresprrrsign_tx`s&    r)F)(rrr#rtoolsrrZMEMO_TYPE_NONEr/r2r4r5ZASSET_TYPE_NATIVErqrtrUrWrZr\r^r`rmrorvZ OP_INFLATIONrxr{DEFAULT_BIP32_PATHDEFAULT_NETWORK_PASSPHRASErr r?r:rYr$rStellarAddressrrrrrrsJ  4"   python-trezor-0.11.6/src/trezorlib/__pycache__/tezos.cpython-36.pyc000066400000000000000000000015261361427340300252570ustar00rootroot000000000000003 ]/@s^ddlmZddlmZeejdddddZeejdddd d Zeejd d Z d S))messages)expectaddress)fieldFcCs|jtj||dS)N) address_n show_display)callrTezosGetAddress)clientrrr K/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/tezos.py get_addresssr public_keycCs|jtj||dS)N)rr)rrTezosGetPublicKey)r rrr r r get_public_keysrcCs||_|j|S)N)rr)r rZ sign_tx_msgr r r sign_tx#srN)F)F) rtoolsr TezosAddressr TezosPublicKeyr TezosSignedTxrr r r r s      python-trezor-0.11.6/src/trezorlib/__pycache__/tools.cpython-36.pyc000066400000000000000000000145421361427340300252550ustar00rootroot000000000000003 ]n@s(ddlZddlZddlZddlZddlZddlmZmZddlm Z ddl m Z e Z d.Z edeeZeedd d Zd d Zd dZddZddZd/ddZdZeeZddZd0ddZddZd1ddZeedd d!Zd"d#ZGd$d%d%Z d&d'Z!ej"d(Z#ej"d)Z$d*d+Z%d2d,d-Z&dS)3N)ListNewType)slip44) TrezorFailureAddress)xreturncCs|tBS)zD Shortcut function that "hardens" a number in a BIP44 path. ) HARDENED_FLAG)r r K/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/tools.pyH_"srcCstjtj|jjS)z+ Double-SHA256 hash as used in BTC )hashlibsha256digest)datar r r btc_hash)srcCs&tjd}|jtj|j|jS)NZ ripemd160)rnewupdaterr) public_keyZmdr r r hash_1600s rcCs0tjd||}t|}||dd}t|S)Nz [0, 0x80000001, 1] :param nstr: path string :return: list of integers /rmrNZ44hz{}h)r r cSsD|jdrttt|S|jdr8tt|ddSt|SdS)N-r'r)rrLr:) startswithrabsintendswith)r r r r str_to_hardens   z!parse_path..str_to_hardencsg|] }|qSr r ).0r )rQr r szparse_path..zInvalid BIP32 path)splitrformatstrrO Exceptionr%)rHnZcoin_idr )rQr parse_paths      rYcCs"t|tr|j}tjd|jS)z Normalize message to NFC and return bytes suitable for protobuf. This seems to be bitcoin-qt standard of doing things. NFC)r;r$r< unicodedata normalizeencode)txtr r r normalize_nfcs r_c@seZdZdddZddZdS)expectNcCs||_||_dS)N)expectedfield)selfrarbr r r __init__szexpect.__init__cstjfdd}|S)NcsLd}||}t|js.td|jjfjdk rDt|jS|SdS)NTzGot %s, expected %s)r;ra RuntimeError __class__rbgetattr)argskwargs__tracebackhide__ret)frcr r wrapped_fs    z"expect.__call__..wrapped_f) functoolswraps)rcrlrmr )rlrcr __call__s zexpect.__call__)N)__name__ __module__ __qualname__rdrpr r r r r`s r`cstjfdd}|S)Nc s,d}|jz|f||S|jXdS)NT)openclose)clientrhrirj)rlr r rms zsession..wrapped_f)rnro)rlrmr )rlr sessions rwz(.)([A-Z][a-z]+)z([a-z0-9])([A-Z])cCstjd|}tjd|jS)Nz\1_\2) FIRST_CAP_REsub ALL_CAP_RElower)sr r r from_camelcases r}cst|ts|Sdkrii}xh|jD]\\}}t|}j|pJj|}|rT|}t|trvfdd|D||<q(t|||<q(W|S)Ncsg|]}t|qSr )dict_from_camelcase)rRr0)renamesr r rS sz'dict_from_camelcase..)r;dictitemsr}getlistr~)drreskeyvalueZnewkeyZ renamed_keyr )rr r~s  r~l)T)N)N)N)'rnrrerr[typingrrcoinsr exceptionsrZ CallExceptionr rOrrrrr r&r)r/r?r-rrBrDrGrVrYr_r`rwcompilerxrzr}r~r r r r s<    " &   python-trezor-0.11.6/src/trezorlib/__pycache__/tx_api.cpython-36.pyc000066400000000000000000000123121361427340300253720ustar00rootroot000000000000003 ʵ]@sddlZddlZddlmZddlZddlmZdZddZddZ d d Z d d Z d dZ ddZ ddZddZGdddZdS)N)Decimal)messagescCs |dj}|jdp|jdS)N coin_nameZzcashZkomodo)lower startswith)coinZlcnr L/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/tx_api.pyis_zcashs r cCs|djjdS)NrZ capricoin)rr)rr r r is_capricoin!sr cCs|djjdS)NrZpeercoin)rr)rr r r is_peercoin%sr cCs|djjdS)NrZdash)rr)rr r r is_dash)srcCsR|dkrtjd|S|dkr*tjdd|S|dkr@tjdd|Stjdd |SdS) NzO_|S)"Nr+ZlocktimetimerexpiryZ fOverwinteredFZ nExpiryHeightZnVersionGroupIdcsg|]}t|qSr )r ).0r)rr r oszjson_to_tx..rcsg|]}t|qSr )r1)r4r)rr r r5psr vjoinsplitrrrzToo many joinsplitsrz4Raw TX data required for Zcash joinsplit transactionri r@typeZextraPayloadSizeZ extraPayloadz(Payload data missing in DIP2 transactionzlength mismatch)rZTransactionTyper+getZ lock_timer r timestampr3r Z overwinteredZversion_group_idZinputsZ bin_outputslenZ extra_data ValueErrorrrrr)rdatatZ joinsplit_cntrawtxZextra_data_lenZ dip2_typer )rr json_to_tx_sF          rCc@sDeZdZddZddZddZddZd d Zd d Zd dZ dS)TxApicCsj||_|dr2tj|d|_|jd|_d|_n4|dr^tj|d|_|jd|_d|_ntddS)N blockbookz/sendtxbitcorez/tx/sendzNo API URL in coin data) coin_datarandomchoiceurlZ pushtx_urlr9r?)selfrGr r r __init__s  zTxApi.__init__cOs0|jddjtt|}tj||djtdS)Nz/api//)params) parse_float)rJjoinmapstrrequestsr<jsonr)rKpathrNrJr r r fetch_jsonszTxApi.fetch_jsoncCs|jd|}tj|dS)Nz block-indexZ blockHash)rVrr)rKZ block_numberjr r r get_block_hashs zTxApi.get_block_hashcCs|jddd}|ddS)NstatusZ getBlockCount)qinfoZblocks)rV)rKrWr r r current_heightszTxApi.current_heightcCs|j|jS)N)get_txr)rKtxhashr r r __getitem__szTxApi.__getitem__cCsV|jdkrdnd}|j||}t|jrR|jdrRd|krR|jd|}|d|d<|S)NrEz tx-specificZtxr7rrB)r9rVr rGr<)rKr^methodr@rWr r r get_tx_datas    zTxApi.get_tx_datacCs|j|}t|j|S)N)rarCrG)rKr^r@r r r r]s z TxApi.get_txN) __name__ __module__ __qualname__rLrVrXr\r_rar]r r r r rDs rD)rHrZdecimalrrSrZ cache_dirr r r rrr r1rCrDr r r r s   8python-trezor-0.11.6/src/trezorlib/__pycache__/ui.cpython-36.pyc000066400000000000000000000103311361427340300245220ustar00rootroot000000000000003 ^s@sddlZddlZddlmZddlmZddlmZddlm Z m Z dj Z dj Z dZe jZe jZe jZe jZe jZd d Zd d ZGd ddZdddZddZdS)N)Mnemonic)device) Cancelled)PinMatrixRequestTypeWordRequestTypezc Use the numeric keypad to describe number positions. The layout is: 7 8 9 4 5 6 1 2 3 z Use the numeric keypad to describe positions. For the word list use only left and right keys. Use backspace to correct an entry. The keypad layout is: 7 8 9 7 | 9 4 5 6 4 | 6 1 2 3 1 | 3 cOstj|ddi|S)NerrT)clickecho)argskwargsr H/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/ui.pyr 4sr cOstj|ddi|S)NrT)r prompt)r r r r rr8src@s0eZdZd ddZddZd ddZd d ZdS) ClickUIFcCsd|_d|_||_dS)NF)pinmatrix_shown prompt_shown always_prompt)selfrr r r__init__=szClickUI.__init__cCs|jstd|jsd|_dS)Nz+Please confirm action on your Trezor deviceT)rr r)rcoder r rbutton_requestBszClickUI.button_requestNc Cs|tkrd}n<|tkrd}n.|tkr*d}n |tkr8d}n|tkrFd}nd}|jsdtt|jsdd|_xNyt dj |dd }Wnt j k rt dYnX|jstd qf|SqfWdS) Nz current PINznew PINz new PIN againz new wipe codeznew wipe code againZPINTzPlease enter {}) hide_inputz.Non-numerical value provided, please try again) PIN_CURRENTPIN_NEW PIN_CONFIRM WIPE_CODE_NEWWIPE_CODE_CONFIRMrr PIN_MATRIX_DESCRIPTIONrrformatr Abortrisdigit)rrZdescpinr r rget_pinHs.  zClickUI.get_pinc Cstjddk r tdtjdSxZy8tddddd}tddddd}||krP|Std Wq"tjk rvtdYq"Xq"WdS) NZ PASSPHRASEz;Passphrase required. Using PASSPHRASE environment variable.zPassphrase requiredTF)rdefault show_defaultzConfirm your passphrasez+Passphrase did not match. Please try again.)osgetenvr rr r r)r passphrasesecondr r rget_passphrasees(  zClickUI.get_passphrase)F)N)__name__ __module__ __qualname__rrr#r+r r r rr<s  rFenglishcs4rt|jntfddfdd}|S)NcsXsSkrSfddD}t|dkr:|dStddj|tdS)Ncsg|]}|jr|qSr ) startswith).0w)wordr r sz7mnemonic_words..expand_word..rrzChoose one of: z, )lenr joinKeyError)r3Zmatches)expandwordlist)r3r expand_words z#mnemonic_words..expand_wordc sX|tjkstxDytd}|Stk r4Yqtjk rNtdYqXqWdS)NzEnter one word of mnemonic)rPlainAssertionErrorrr7r r r)typer3)r:r rget_wordsz mnemonic_words..get_word)rr9set)r8languager>r )r8r:r9rmnemonic_wordss   rAc Cs|xvy tj}Wnttfk r,tdYnX|dkr:t|dkrHtjS|tjkr^|dkr^|S|tj kr|dkr|SqWdS)NzzZ147369Z 123456789) r getcharKeyboardInterruptEOFErrorrrZ RECOVERY_BACKrMatrix6Matrix9)r=chr r r matrix_wordss  rH)Fr/)r'r Zmnemonicrr$r exceptionsrmessagesrrstriprZRECOVERY_MATRIX_DESCRIPTIONZ PIN_GENERICCurrentrNewFirstr NewSecondr WipeCodeFirstrWipeCodeSecondrr rrrArHr r r rs$    D python-trezor-0.11.6/src/trezorlib/_ed25519.py000066400000000000000000000166541361427340300207740ustar00rootroot00000000000000# ed25519.py - Optimized version of the reference implementation of Ed25519 # downloaded from https://github.com/pyca/ed25519 # # Written in 2011? by Daniel J. Bernstein # 2013 by Donald Stufft # 2013 by Alex Gaynor # 2013 by Greg Price # # To the extent possible under law, the author(s) have dedicated all copyright # and related and neighboring rights to this software to the public domain # worldwide. This software is distributed without any warranty. # # You should have received a copy of the CC0 Public Domain Dedication along # with this software. If not, see # . """ NB: This code is not safe for use with secret keys or secret data. The only safe use of this code is for verifying signatures on public messages. Functions for computing the public key of a secret key and for signing a message are included, namely publickey_unsafe and signature_unsafe, for testing purposes only. The root of the problem is that Python's long-integer arithmetic is not designed for use in cryptography. Specifically, it may take more or less time to execute an operation depending on the values of the inputs, and its memory access patterns may also depend on the inputs. This opens it to timing and cache side-channel attacks which can disclose data to an attacker. We rely on Python's long-integer arithmetic, so we cannot handle secrets without risking their disclosure. """ import hashlib from typing import List, NewType, Tuple Point = NewType("Point", Tuple[int, int, int, int]) __version__ = "1.0.dev1" b = 256 q = 2 ** 255 - 19 l = 2 ** 252 + 27742317777372353535851937790883648493 COORD_MASK = ~(1 + 2 + 4 + (1 << b - 1)) COORD_HIGH_BIT = 1 << b - 2 def H(m: bytes) -> bytes: return hashlib.sha512(m).digest() def pow2(x: int, p: int) -> int: """== pow(x, 2**p, q)""" while p > 0: x = x * x % q p -= 1 return x def inv(z: int) -> int: """$= z^{-1} mod q$, for z != 0""" # Adapted from curve25519_athlon.c in djb's Curve25519. z2 = z * z % q # 2 z9 = pow2(z2, 2) * z % q # 9 z11 = z9 * z2 % q # 11 z2_5_0 = (z11 * z11) % q * z9 % q # 31 == 2^5 - 2^0 z2_10_0 = pow2(z2_5_0, 5) * z2_5_0 % q # 2^10 - 2^0 z2_20_0 = pow2(z2_10_0, 10) * z2_10_0 % q # ... z2_40_0 = pow2(z2_20_0, 20) * z2_20_0 % q z2_50_0 = pow2(z2_40_0, 10) * z2_10_0 % q z2_100_0 = pow2(z2_50_0, 50) * z2_50_0 % q z2_200_0 = pow2(z2_100_0, 100) * z2_100_0 % q z2_250_0 = pow2(z2_200_0, 50) * z2_50_0 % q # 2^250 - 2^0 return pow2(z2_250_0, 5) * z11 % q # 2^255 - 2^5 + 11 = q - 2 d = -121665 * inv(121666) % q I = pow(2, (q - 1) // 4, q) def xrecover(y: int) -> int: xx = (y * y - 1) * inv(d * y * y + 1) x = pow(xx, (q + 3) // 8, q) if (x * x - xx) % q != 0: x = (x * I) % q if x % 2 != 0: x = q - x return x By = 4 * inv(5) Bx = xrecover(By) B = Point((Bx % q, By % q, 1, (Bx * By) % q)) ident = Point((0, 1, 1, 0)) def edwards_add(P: Point, Q: Point) -> Point: # This is formula sequence 'addition-add-2008-hwcd-3' from # http://www.hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html (x1, y1, z1, t1) = P (x2, y2, z2, t2) = Q a = (y1 - x1) * (y2 - x2) % q b = (y1 + x1) * (y2 + x2) % q c = t1 * 2 * d * t2 % q dd = z1 * 2 * z2 % q e = b - a f = dd - c g = dd + c h = b + a x3 = e * f y3 = g * h t3 = e * h z3 = f * g return Point((x3 % q, y3 % q, z3 % q, t3 % q)) def edwards_double(P: Point) -> Point: # This is formula sequence 'dbl-2008-hwcd' from # http://www.hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html (x1, y1, z1, _) = P a = x1 * x1 % q b = y1 * y1 % q c = 2 * z1 * z1 % q # dd = -a e = ((x1 + y1) * (x1 + y1) - a - b) % q g = -a + b # dd + b f = g - c h = -a - b # dd - b x3 = e * f y3 = g * h t3 = e * h z3 = f * g return Point((x3 % q, y3 % q, z3 % q, t3 % q)) def scalarmult(P: Point, e: int) -> Point: if e == 0: return ident Q = scalarmult(P, e // 2) Q = edwards_double(Q) if e & 1: Q = edwards_add(Q, P) return Q # Bpow[i] == scalarmult(B, 2**i) Bpow = [] # type: List[Point] def make_Bpow() -> None: P = B for _ in range(253): Bpow.append(P) P = edwards_double(P) make_Bpow() def scalarmult_B(e: int) -> Point: """ Implements scalarmult(B, e) more efficiently. """ # scalarmult(B, l) is the identity e = e % l P = ident for i in range(253): if e & 1: P = edwards_add(P, Bpow[i]) e = e // 2 assert e == 0, e return P def encodeint(y: int) -> bytes: return y.to_bytes(b // 8, "little") def encodepoint(P: Point) -> bytes: (x, y, z, _) = P zi = inv(z) x = (x * zi) % q y = (y * zi) % q xbit = (x & 1) << (b - 1) y_result = y & ~xbit # clear x bit y_result |= xbit # set corret x bit value return encodeint(y_result) def decodeint(s: bytes) -> int: return int.from_bytes(s, "little") def decodepoint(s: bytes) -> Point: y = decodeint(s) & ~(1 << b - 1) # y without the highest bit x = xrecover(y) if x & 1 != bit(s, b - 1): x = q - x P = Point((x, y, 1, (x * y) % q)) if not isoncurve(P): raise ValueError("decoding point that is not on curve") return P def decodecoord(s: bytes) -> int: a = decodeint(s[: b // 8]) # clear mask bits a &= COORD_MASK # set high bit a |= COORD_HIGH_BIT return a def bit(h: bytes, i: int) -> int: return (h[i // 8] >> (i % 8)) & 1 def publickey_unsafe(sk: bytes) -> bytes: """ Not safe to use with secret keys or secret data. See module docstring. This function should be used for testing only. """ h = H(sk) a = decodecoord(h) A = scalarmult_B(a) return encodepoint(A) def Hint(m: bytes) -> int: return decodeint(H(m)) def signature_unsafe(m: bytes, sk: bytes, pk: bytes) -> bytes: """ Not safe to use with secret keys or secret data. See module docstring. This function should be used for testing only. """ h = H(sk) a = decodecoord(h) r = Hint(h[b // 8 : b // 4] + m) R = scalarmult_B(r) S = (r + Hint(encodepoint(R) + pk + m) * a) % l return encodepoint(R) + encodeint(S) def isoncurve(P: Point) -> bool: (x, y, z, t) = P return ( z % q != 0 and x * y % q == z * t % q and (y * y - x * x - z * z - d * t * t) % q == 0 ) class SignatureMismatch(Exception): pass def checkvalid(s: bytes, m: bytes, pk: bytes) -> None: """ Not safe to use when any argument is secret. See module docstring. This function should be used only for verifying public signatures of public messages. """ if len(s) != b // 4: raise ValueError("signature length is wrong") if len(pk) != b // 8: raise ValueError("public-key length is wrong") R = decodepoint(s[: b // 8]) A = decodepoint(pk) S = decodeint(s[b // 8 : b // 4]) h = Hint(encodepoint(R) + pk + m) (x1, y1, z1, _) = P = scalarmult_B(S) (x2, y2, z2, _) = Q = edwards_add(R, scalarmult(A, h)) if ( not isoncurve(P) or not isoncurve(Q) or (x1 * z2 - x2 * z1) % q != 0 or (y1 * z2 - y2 * z1) % q != 0 ): raise SignatureMismatch("signature does not pass verification") python-trezor-0.11.6/src/trezorlib/_internal/000077500000000000000000000000001361427340300212245ustar00rootroot00000000000000python-trezor-0.11.6/src/trezorlib/_internal/toif.py000066400000000000000000000071421361427340300225430ustar00rootroot00000000000000import struct import zlib from typing import Sequence, Tuple import attr from PIL import Image from .. import firmware RGBPixel = Tuple[int, int, int] def _compress(data: bytes) -> bytes: z = zlib.compressobj(level=9, wbits=-10) return z.compress(data) + z.flush() def _decompress(data: bytes) -> bytes: return zlib.decompress(data, wbits=-10) def _from_pil_rgb(pixels: Sequence[RGBPixel]) -> bytes: data = bytearray() for r, g, b in pixels: c = ((r & 0xF8) << 8) | ((g & 0xFC) << 3) | ((b & 0xF8) >> 3) data += struct.pack(">H", c) return bytes(data) def _to_rgb(data: bytes) -> bytes: res = bytearray() for i in range(0, len(data), 2): (c,) = struct.unpack(">H", data[i : i + 2]) r = (c & 0xF800) >> 8 g = (c & 0x07C0) >> 3 b = (c & 0x001F) << 3 res += bytes((r, g, b)) return bytes(res) def _from_pil_grayscale(pixels: Sequence[int]) -> bytes: data = bytearray() for i in range(0, len(pixels), 2): left, right = pixels[i], pixels[i + 1] c = (left & 0xF0) | ((right & 0xF0) >> 4) data += struct.pack(">B", c) return bytes(data) def _to_grayscale(data: bytes) -> bytes: res = bytearray() for pixel in data: left = pixel & 0xF0 right = (pixel & 0x0F) << 4 res += bytes((left, right)) return bytes(res) @attr.s class Toif: mode = attr.ib() # type: firmware.ToifMode size = attr.ib() # type: Tuple[int, int] data = attr.ib() # type: bytes def _expected_data_length(self) -> int: width, height = self.size if self.mode is firmware.ToifMode.grayscale: return width * height // 2 else: return width * height * 2 def to_image(self) -> Image: uncompressed = _decompress(self.data) expected_size = self._expected_data_length() if len(uncompressed) != expected_size: raise ValueError( "Uncompressed data is {} bytes, expected {}".format( len(uncompressed), expected_size ) ) if self.mode is firmware.ToifMode.grayscale: pil_mode = "L" raw_data = _to_grayscale(uncompressed) else: pil_mode = "RGB" raw_data = _to_rgb(uncompressed) return Image.frombuffer(pil_mode, self.size, raw_data, "raw", pil_mode, 0, 1) def to_bytes(self) -> bytes: width, height = self.size return firmware.Toif.build( dict(format=self.mode, width=width, height=height, data=self.data) ) def save(self, filename: str) -> None: with open(filename, "wb") as out: out.write(self.to_bytes()) def from_bytes(data: bytes) -> Toif: parsed = firmware.Toif.parse(data) return Toif(parsed.format, (parsed.width, parsed.height), parsed.data) def load(filename: str) -> Toif: with open(filename, "rb") as f: return from_bytes(f.read()) def from_image(image: Image, background=(0, 0, 0, 255)) -> Toif: if image.mode == "RGBA": background = Image.new("RGBA", image.size, background) blend = Image.alpha_composite(background, image) image = blend.convert("RGB") if image.mode == "L": toif_mode = firmware.ToifMode.grayscale toif_data = _from_pil_grayscale(image.getdata()) elif image.mode == "RGB": toif_mode = firmware.ToifMode.full_color toif_data = _from_pil_rgb(image.getdata()) else: raise ValueError("Unsupported image mode: {}".format(image.mode)) data = _compress(toif_data) return Toif(toif_mode, image.size, data) python-trezor-0.11.6/src/trezorlib/binance.py000066400000000000000000000043231361427340300212240ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . from . import messages from .protobuf import dict_to_proto from .tools import expect, session @expect(messages.BinanceAddress, field="address") def get_address(client, address_n, show_display=False): return client.call( messages.BinanceGetAddress(address_n=address_n, show_display=show_display) ) @expect(messages.BinancePublicKey, field="public_key") def get_public_key(client, address_n, show_display=False): return client.call( messages.BinanceGetPublicKey(address_n=address_n, show_display=show_display) ) @session def sign_tx(client, address_n, tx_json): msg = tx_json["msgs"][0] envelope = dict_to_proto(messages.BinanceSignTx, tx_json) envelope.msg_count = 1 envelope.address_n = address_n response = client.call(envelope) if not isinstance(response, messages.BinanceTxRequest): raise RuntimeError( "Invalid response, expected BinanceTxRequest, received " + type(response).__name__ ) if "refid" in msg: msg = dict_to_proto(messages.BinanceCancelMsg, msg) elif "inputs" in msg: msg = dict_to_proto(messages.BinanceTransferMsg, msg) elif "ordertype" in msg: msg = dict_to_proto(messages.BinanceOrderMsg, msg) else: raise ValueError("can not determine msg type") response = client.call(msg) if not isinstance(response, messages.BinanceSignedTx): raise RuntimeError( "Invalid response, expected BinanceSignedTx, received " + type(response).__name__ ) return response python-trezor-0.11.6/src/trezorlib/btc.py000066400000000000000000000143021361427340300203730ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . from . import coins, messages from .tools import CallException, expect, normalize_nfc, session @expect(messages.PublicKey) def get_public_node( client, n, ecdsa_curve_name=None, show_display=False, coin_name=None, script_type=messages.InputScriptType.SPENDADDRESS, ): return client.call( messages.GetPublicKey( address_n=n, ecdsa_curve_name=ecdsa_curve_name, show_display=show_display, coin_name=coin_name, script_type=script_type, ) ) @expect(messages.Address, field="address") def get_address( client, coin_name, n, show_display=False, multisig=None, script_type=messages.InputScriptType.SPENDADDRESS, ): return client.call( messages.GetAddress( address_n=n, coin_name=coin_name, show_display=show_display, multisig=multisig, script_type=script_type, ) ) @expect(messages.MessageSignature) def sign_message( client, coin_name, n, message, script_type=messages.InputScriptType.SPENDADDRESS ): message = normalize_nfc(message) return client.call( messages.SignMessage( coin_name=coin_name, address_n=n, message=message, script_type=script_type ) ) def verify_message(client, coin_name, address, signature, message): message = normalize_nfc(message) try: resp = client.call( messages.VerifyMessage( address=address, signature=signature, message=message, coin_name=coin_name, ) ) except CallException as e: resp = e return isinstance(resp, messages.Success) @session def sign_tx(client, coin_name, inputs, outputs, details=None, prev_txes=None): # set up a transactions dict txes = {None: messages.TransactionType(inputs=inputs, outputs=outputs)} # preload all relevant transactions ahead of time if coin_name in coins.by_name: load_prevtxes = not coins.by_name[coin_name]["force_bip143"] else: load_prevtxes = True if load_prevtxes: for inp in inputs: if inp.script_type not in ( messages.InputScriptType.SPENDP2SHWITNESS, messages.InputScriptType.SPENDWITNESS, messages.InputScriptType.EXTERNAL, ): try: prev_tx = prev_txes[inp.prev_hash] except Exception as e: raise ValueError("Could not retrieve prev_tx") from e if not isinstance(prev_tx, messages.TransactionType): raise ValueError("Invalid value for prev_tx") from None txes[inp.prev_hash] = prev_tx if details is None: signtx = messages.SignTx() else: signtx = details signtx.coin_name = coin_name signtx.inputs_count = len(inputs) signtx.outputs_count = len(outputs) res = client.call(signtx) # Prepare structure for signatures signatures = [None] * len(inputs) serialized_tx = b"" def copy_tx_meta(tx): tx_copy = messages.TransactionType(**tx) # clear fields tx_copy.inputs_cnt = len(tx.inputs) tx_copy.inputs = [] tx_copy.outputs_cnt = len(tx.bin_outputs or tx.outputs) tx_copy.outputs = [] tx_copy.bin_outputs = [] tx_copy.extra_data_len = len(tx.extra_data or b"") tx_copy.extra_data = None return tx_copy R = messages.RequestType while isinstance(res, messages.TxRequest): # If there's some part of signed transaction, let's add it if res.serialized: if res.serialized.serialized_tx: serialized_tx += res.serialized.serialized_tx if res.serialized.signature_index is not None: idx = res.serialized.signature_index sig = res.serialized.signature if signatures[idx] is not None: raise ValueError("Signature for index %d already filled" % idx) signatures[idx] = sig if res.request_type == R.TXFINISHED: break # Device asked for one more information, let's process it. current_tx = txes[res.details.tx_hash] if res.request_type == R.TXMETA: msg = copy_tx_meta(current_tx) res = client.call(messages.TxAck(tx=msg)) elif res.request_type == R.TXINPUT: msg = messages.TransactionType() msg.inputs = [current_tx.inputs[res.details.request_index]] res = client.call(messages.TxAck(tx=msg)) elif res.request_type == R.TXOUTPUT: msg = messages.TransactionType() if res.details.tx_hash: msg.bin_outputs = [current_tx.bin_outputs[res.details.request_index]] else: msg.outputs = [current_tx.outputs[res.details.request_index]] res = client.call(messages.TxAck(tx=msg)) elif res.request_type == R.TXEXTRADATA: o, l = res.details.extra_data_offset, res.details.extra_data_len msg = messages.TransactionType() msg.extra_data = current_tx.extra_data[o : o + l] res = client.call(messages.TxAck(tx=msg)) if isinstance(res, messages.Failure): raise CallException("Signing failed") if not isinstance(res, messages.TxRequest): raise CallException("Unexpected message") if None in signatures: raise RuntimeError("Some signatures are missing!") return signatures, serialized_tx python-trezor-0.11.6/src/trezorlib/cardano.py000066400000000000000000000055621361427340300212420ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . from typing import List from . import messages, tools from .tools import expect, session REQUIRED_FIELDS_TRANSACTION = ("inputs", "outputs", "transactions") REQUIRED_FIELDS_INPUT = ("path", "prev_hash", "prev_index", "type") @expect(messages.CardanoAddress, field="address") def get_address(client, address_n, show_display=False): return client.call( messages.CardanoGetAddress(address_n=address_n, show_display=show_display) ) @expect(messages.CardanoPublicKey) def get_public_key(client, address_n): return client.call(messages.CardanoGetPublicKey(address_n=address_n)) @session def sign_tx( client, inputs: List[messages.CardanoTxInputType], outputs: List[messages.CardanoTxOutputType], transactions: List[bytes], protocol_magic, ): response = client.call( messages.CardanoSignTx( inputs=inputs, outputs=outputs, transactions_count=len(transactions), protocol_magic=protocol_magic, ) ) while isinstance(response, messages.CardanoTxRequest): tx_index = response.tx_index transaction_data = bytes.fromhex(transactions[tx_index]) ack_message = messages.CardanoTxAck(transaction=transaction_data) response = client.call(ack_message) return response def create_input(input) -> messages.CardanoTxInputType: if not all(input.get(k) is not None for k in REQUIRED_FIELDS_INPUT): raise ValueError("The input is missing some fields") path = input["path"] return messages.CardanoTxInputType( address_n=tools.parse_path(path), prev_hash=bytes.fromhex(input["prev_hash"]), prev_index=input["prev_index"], type=input["type"], ) def create_output(output) -> messages.CardanoTxOutputType: if not output.get("amount") or not (output.get("address") or output.get("path")): raise ValueError("The output is missing some fields") if output.get("path"): path = output["path"] return messages.CardanoTxOutputType( address_n=tools.parse_path(path), amount=int(output["amount"]) ) return messages.CardanoTxOutputType( address=output["address"], amount=int(output["amount"]) ) python-trezor-0.11.6/src/trezorlib/ckd_public.py000066400000000000000000000105241361427340300217240ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . import hashlib import hmac import struct import warnings import ecdsa from ecdsa.curves import SECP256k1 from ecdsa.ellipticcurve import INFINITY, Point from ecdsa.util import number_to_string, string_to_number from trezorlib import messages, tools warnings.warn("ckd_public module is deprecated and will be removed", DeprecationWarning) def point_to_pubkey(point): order = SECP256k1.order x_str = number_to_string(point.x(), order) y_str = number_to_string(point.y(), order) vk = x_str + y_str return struct.pack("B", (vk[63] & 1) + 2) + vk[0:32] # To compressed key def sec_to_public_pair(pubkey): """Convert a public key in sec binary format to a public pair.""" x = string_to_number(pubkey[1:33]) sec0 = pubkey[:1] if sec0 not in (b"\2", b"\3"): raise ValueError("Compressed pubkey expected") def public_pair_for_x(generator, x, is_even): curve = generator.curve() p = curve.p() alpha = (pow(x, 3, p) + curve.a() * x + curve.b()) % p beta = ecdsa.numbertheory.square_root_mod_prime(alpha, p) if is_even == bool(beta & 1): return (x, p - beta) return (x, beta) return public_pair_for_x( ecdsa.ecdsa.generator_secp256k1, x, is_even=(sec0 == b"\2") ) def is_prime(n): return bool(n & tools.HARDENED_FLAG) def fingerprint(pubkey): return string_to_number(tools.hash_160(pubkey)[:4]) def get_address(public_node, address_type): return tools.public_key_to_bc_address(public_node.public_key, address_type) def public_ckd(public_node, n): if not isinstance(n, list): raise ValueError("Parameter must be a list") node = messages.HDNodeType(**public_node) for i in n: node = get_subnode(node, i) return node def get_subnode(node, i): # Public Child key derivation (CKD) algorithm of BIP32 i_as_bytes = struct.pack(">L", i) if is_prime(i): raise ValueError("Prime derivation not supported") # Public derivation data = node.public_key + i_as_bytes I64 = hmac.HMAC(key=node.chain_code, msg=data, digestmod=hashlib.sha512).digest() I_left_as_exponent = string_to_number(I64[:32]) node_out = messages.HDNodeType() node_out.depth = node.depth + 1 node_out.child_num = i node_out.chain_code = I64[32:] node_out.fingerprint = fingerprint(node.public_key) # BIP32 magic converts old public key to new public point x, y = sec_to_public_pair(node.public_key) point = I_left_as_exponent * SECP256k1.generator + Point( SECP256k1.curve, x, y, SECP256k1.order ) if point == INFINITY: raise ValueError("Point cannot be INFINITY") # Convert public point to compressed public key node_out.public_key = point_to_pubkey(point) return node_out def serialize(node, version=0x0488B21E): s = b"" s += struct.pack(">I", version) s += struct.pack(">B", node.depth) s += struct.pack(">I", node.fingerprint) s += struct.pack(">I", node.child_num) s += node.chain_code if node.private_key: s += b"\x00" + node.private_key else: s += node.public_key s += tools.btc_hash(s)[:4] return tools.b58encode(s) def deserialize(xpub): data = tools.b58decode(xpub, None) if tools.btc_hash(data[:-4])[:4] != data[-4:]: raise ValueError("Checksum failed") node = messages.HDNodeType() node.depth = struct.unpack(">B", data[4:5])[0] node.fingerprint = struct.unpack(">I", data[5:9])[0] node.child_num = struct.unpack(">I", data[9:13])[0] node.chain_code = data[13:45] key = data[45:-4] if key[0] == 0: node.private_key = key[1:] else: node.public_key = key return node python-trezor-0.11.6/src/trezorlib/cli/000077500000000000000000000000001361427340300200205ustar00rootroot00000000000000python-trezor-0.11.6/src/trezorlib/cli/__init__.py000066400000000000000000000017421361427340300221350ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . import click class ChoiceType(click.Choice): def __init__(self, typemap): super(ChoiceType, self).__init__(typemap.keys()) self.typemap = typemap def convert(self, value, param, ctx): value = super(ChoiceType, self).convert(value, param, ctx) return self.typemap[value] python-trezor-0.11.6/src/trezorlib/cli/__pycache__/000077500000000000000000000000001361427340300222305ustar00rootroot00000000000000python-trezor-0.11.6/src/trezorlib/cli/__pycache__/__init__.cpython-36.pyc000066400000000000000000000013461361427340300264210ustar00rootroot000000000000003 ʵ]@sddlZGdddejZdS)Ncs(eZdZfddZfddZZS) ChoiceTypecstt|j|j||_dS)N)superr__init__keystypemap)selfr) __class__R/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/cli/__init__.pyrszChoiceType.__init__cstt|j|||}|j|S)N)rrconvertr)rvalueparamctx)rr r r szChoiceType.convert)__name__ __module__ __qualname__rr __classcell__r r )rr rs r)clickChoicerr r r r spython-trezor-0.11.6/src/trezorlib/cli/__pycache__/binance.cpython-36.pyc000066400000000000000000000026661361427340300262670ustar00rootroot000000000000003 ʵ] @sddlZddlZddlmZmZdZejddddZejej d d d ed ej d dd dej ddZ ejej d d d ed ej d dd dej ddZ ejej d d d ed ej ddej dd ddej ddZdS)N)binancetoolsz*BIP-32 path to key, e.g. m/44'/714'/0'/0/0r)namecCsdS)zBinance Chain commands.NrrrQ/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/cli/binance.pyclisrz-nz --addressT)requiredhelpz-dz--show-display)is_flagcCs|}tj|}tj|||S)z'Get Binance address for specified path.)r parse_pathr get_address)connectaddress show_displayclient address_nrrrr s r cCs"|}tj|}tj|||jS)zGet Binance public key.)rr rget_public_keyhex)rrrrrrrrr+s rz-fz--filerzTransaction in JSON format)typer r cCs$|}tj|}tj||tj|S)zSign Binance transaction)rr rsign_txjsonload)rrfilerrrrrr7s  r)rclickrrZ PATH_HELPgrouprcommandoptionpass_objr rFilerrrrrs*  python-trezor-0.11.6/src/trezorlib/cli/__pycache__/btc.cpython-36.pyc000066400000000000000000000077511361427340300254400ustar00rootroot000000000000003 ʵ]  @sddlZddlZddlZddlmZmZmZmZddlmZej j ej j ej j dZ ejjejjejjdZdZejdd d d Zejejd d ejdddddejddee ddejddddejddZejejd d ejdddddejddejddee ddejddddejdd Zejejd d d!ddd"d#ejd$ejd%ejd&d'Zejejd d ejdddddejddee ddejd(ejd)d*Zejejd d ejdejd+ejd(ejd,d-ZdS).N)btcmessagesprotobuftools) ChoiceType)addressZsegwitZ p2shsegwitBitcoinr)namecCsdS)z(Bitcoin and Bitcoin-like coins commands.Nr r r M/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/cli/btc.pycli(srz-cz--coinz-nz --addressTz BIP-32 path)requiredhelpz-tz --script-typer )typedefaultz-dz--show-display)is_flagcCs(|pt}tj|}tj|||||dS)zGet address for specified path.) script_type) DEFAULT_COINr parse_pathr get_address)connectcoinr r show_display address_nr r r r2s rzBIP-32 path, e.g. m/44'/0'/0'z-ez--curvecCsb|pt}tj|}tj||||||d}|jjd|jj|jj|jj j |jj j d|j dS)zGet public node of given path.)ecdsa_curve_namer coin_namerz%08x)depth fingerprint child_num chain_code public_key)nodexpub) rrrrget_public_noder#rrr r!hexr"r$)rrr Zcurverrrresultr r r r%As    r%Z_ignoreF)rhidden expose_value json_file)rc Cs|}tj|}|jdt}tjtj|jdi}dd|jdfD}dd|jdfD}dd |jd ijD}t j ||||||\} } t j t j d t j | j d S) a)Sign transaction. Transaction data must be provided in a JSON file. See `transaction-format.md` for description. You can use `tools/build_tx.py` from the source distribution to build the required JSON file interactively: $ python3 tools/build_tx.py | trezorctl btc sign-tx - rdetailscSsg|]}tjtj|qSr )r dict_to_protor TxInputType).0ir r r xszsign_tx..inputscSsg|]}tjtj|qSr )rr,r TxOutputType)r.outputr r r r0{soutputscSs&i|]\}}tjtj|tj|qSr )rr,rTransactionTypebytesfromhex)r.txidtxr r r ~szsign_tx.. prev_txeszSigned Transaction:N)jsonloadgetrrr,rSignTxitemsrsign_txclickechor&) rr*clientdatarr+r1r4r;_ serialized_txr r r rAes    rAmessagecCs@|pt}tj|}tj|||||}||jtj|jj dS)z)Sign message using address of given path.)rHr signature) rrrr sign_messager base64 b64encoderIdecode)rrr rHrrresr r r rJs  rJrIcCs&tj|}|pt}tj|||||S)zVerify message.)rK b64decoderrverify_message)rrr rIrHr r r rPs rP) rKr<rBrrrrrInputScriptType SPENDADDRESS SPENDWITNESSSPENDP2SHWITNESSZ INPUT_SCRIPTSOutputScriptType PAYTOADDRESS PAYTOWITNESSPAYTOP2SHWITNESSZOUTPUT_SCRIPTSrgrouprcommandoptionpass_objrr%argumentFilerArJrPr r r r sR        '   python-trezor-0.11.6/src/trezorlib/cli/__pycache__/cardano.cpython-36.pyc000066400000000000000000000035521361427340300262720ustar00rootroot000000000000003 ʵ]@sddlZddlZddlmZmZdZejddddZejej d d ej d d d dej dde ddej ddZ ejej ddd edej ddd dej ddZejej ddd edej ddZdS)N)cardanotoolsz+BIP-32 path to key, e.g. m/44'/1815'/0'/0/0r)namecCsdS)zCardano commands.NrrrQ/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/cli/cardano.pyclisrz-fz--filerTzTransaction in JSON format)typerequiredhelpz-Nz --network)r defaultc Csd|}tj|}dd|dD}dd|dD}|d}tj|||||}|jj|jjdS)zSign Cardano transaction.cSsg|]}tj|qSr)rZ create_input).0inputrrr /szsign_tx..inputscSsg|]}tj|qSr)rZ create_output)routputrrrr0soutputs transactions)tx_hashtx_body)jsonloadrsign_txrhexr) connectfilenetworkclient transactionrrrZsigned_transactionrrrrs  rz-nz --address)r r z-dz--show-display)is_flagcCs|}tj|}tj|||S)zGet Cardano address.)r parse_pathr get_address)raddress show_displayr address_nrrrr#;s r#cCs|}tj|}tj||S)zGet Cardano public key.)rr"rget_public_key)rr$rr&rrrr'Gs r')rclickrr PATH_HELPgrouprcommandoptionFileintpass_objrr#r'rrrrs( python-trezor-0.11.6/src/trezorlib/cli/__pycache__/cosi.cpython-36.pyc000066400000000000000000000022351361427340300256150ustar00rootroot000000000000003 ʵ]@sddlZddlmZmZdZejddddZejejd d d ed ej d ej ddZ ejejd d d ed ej d ej dej dej ddZ dS)N)cositoolsz!BIP-32 path, e.g. m/44'/0'/0'/0/0r)namecCsdS)z/CoSi (Cothority / collective signing) commands.NrrrN/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/cli/cosi.pyclisrz-nz --addressT)requiredhelpdatacCs$|}tj|}tj||tj|S)z%Ask device to commit to CoSi signing.)r parse_pathrcommitbytesfromhex)connectaddressr client address_nrrrr s r global_commitment global_pubkeycCs4|}tj|}tj||tj|tj|tj|S)zAsk device to sign using CoSi.)rr rsignrr)rrr rrrrrrrr(s r) clickrr PATH_HELPgrouprcommandoptionargumentpass_objr rrrrrspython-trezor-0.11.6/src/trezorlib/cli/__pycache__/crypto.cpython-36.pyc000066400000000000000000000025221361427340300261770ustar00rootroot000000000000003 ʵ](@sddlZddlmZmZejddddZejejded ej d d Z ejej d d dddejdejdej ddZ ejej d d dddejdejdej ddZ dS)N)misctoolscrypto)namecCsdS)z$Miscellaneous cryptography features.NrrrP/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/cli/crypto.pyclisr size)typecCstj||jS)zGet random bytes from device.)r get_entropyhex)connectr rrrr sr z-nz --addressTzBIP-32 path, e.g. m/10016'/0)requiredhelpkeyvaluecCs,|}tj|}tj||||j}|jS)z$Encrypt value by given key and path.)r parse_pathrencrypt_keyvalueencoder )raddressrrclient address_nresrrrr#s rcCs&|}tj|}tj|||tj|S)z$Decrypt value by given key and path.)rrrdecrypt_keyvaluebytesfromhex)rrrrrrrrrr0s r)clickrrgroupr commandargumentintpass_objr optionrrrrrrs  python-trezor-0.11.6/src/trezorlib/cli/__pycache__/device.cpython-36.pyc000066400000000000000000000132221361427340300261150ustar00rootroot000000000000003 ^6@sddlZddlZddlmZmZmZmZmZddlmZej j ej j dZ ej jej jej jdZejjejjejjdZejd d d d Zejejd dZejejdddddejddZejejddddejddddejddddejd d!ddejd"d#ddejd$d%ddejdd&ddejd'd(ddejd)d*Zejejd+d,ejd-d.d/gd/d0ejd1d2ddejdd3ddejddddejd d!ejd4d5de d6ejd7d8d9ee d:d0ejd;dZ!ejejd1d?ddejd7d@ejdAdBdCgdDejddddejdd3ddejd d!ejd4d5ddejd$dEddejd'd(ddejddFeedGd0ejdHdIZ"ejejdJdKZ#ejej$dLeedDejdMdNZ%dS)ON) debuglinkdevice exceptionsmessagesui) ChoiceType) scrambledmatrix)singleZshamirZadvanced)enabledisableZrefreshr)namecCsdS)zWipe device in bootloader mode. This also erases the firmware.T)helpis_flagcCs|}|r4|jjs(tjdtjdqptjdn<|jjrftjdtjdtjdtjdn tjdy tj|Stj k r}z"tjdj |j tjd WYd d }~XnXd S) z=Reset device to factory defaults and remove all private data.z-Please switch your device to bootloader mode.rzWiping user data and firmware!zLYour device is in bootloader mode. This operation would also erase firmware.zcSpecify "--bootloader" if that is what you want, or disconnect and reconnect device in normal mode.z Aborting.zWiping user data!zAction failed: {} {}N) featuresbootloader_modeclickechosysexitrwiper TrezorFailureformatargs)rZ bootloaderclienterrrr6s&        rz-mz --mnemonic)multiplez-pz--pin)defaultz-rz--passphrase-protection)rz-lz--labelz-iz--ignore-checksumz-sz --slip0014z--needs-backupz-nz --no-backupc CsV|r|rtjd|} |r6djdgdg}|s6d}tj| t||||d|||d S)zqUpload seed and custom configuration to the device. This functionality is only available in debug mode. zCannot use -s and -m together. all z SLIP-0014zen-US)mnemonicpinpassphrase_protectionlabellanguage skip_checksum needs_backup no_backup)rClickExceptionjoinrZ load_devicelist) rr*r+r,r-Zignore_checksumZslip0014r0r1r"rrrload[s" r5z-wz--wordsZ12Z18Z24)typer&z-ez--expandz--pin-protectionz-uz --u2f-counter)r&r6z-tz--typerec_typer z-dz --dry-runc CsN|tjjkrtj|} ntj} tjtjt j |t |||||d| ||d S)zStart safe recovery workflow.zen-US) word_countr,pin_protectionr- u2f_counterr.input_callbackr6dry_run) rRecoveryDeviceTypeScrambledWordsrmnemonic_words matrix_wordsrrRECOVERY_MATRIX_DESCRIPTIONrrecoverint) rwordsexpandr9r,r-r:r7r<r;rrrrBs   rBz--show-entropyz --strengthZ128Z192Z256)r6z --skip-backupz --backup-typer c Cst|r t|}|} | tjjkr.tjj| jjksJ| tjjkrTtjj | jjkrTt j dt j | |||||d|||| d S)z+Perform device setup and generate new seed.zWARNING: Your Trezor device does not indicate support for the requested backup type. Traditional single-seed backup may be generated instead.zen-US) display_randomstrengthr,r9r-r.r: skip_backupr1 backup_type)rCr BackupType Slip39_Basic CapabilityShamirr capabilitiesSlip39_Advanced ShamirGroupsrrrreset) rZ show_entropyrGr,r9r-r:rHr1rIr"rrrsetups*  rRcCs tj|S)zPerform device seed backup.)rbackup)rrrrrSsrS operationcCs(|}|jjdkrtjdtj||S)aDSecure the device with SD card protection. When SD card protection is enabled, a randomly generated secret is stored on the SD card. During every PIN checking and unlocking operation this secret is combined with the entered PIN value to decrypt data stored on the device. The SD card will thus be needed every time you unlock the device. The options are:  enable - Generate SD card secret and use it to protect the PIN and storage. disable - Remove SD card secret protection. refresh - Replace the current SD card secret with a new one. 1z/Trezor One does not support SD card protection.)rmodelrZBadUsager sd_protect)rrTr"rrrrWs  rW)&rrr%rrrrrr r=r>MatrixZ RECOVERY_TYPErJBip39rKrOZ BACKUP_TYPESdProtectOperationTypeENABLEDISABLEREFRESHZSD_PROTECT_OPERATIONSgrouprcommandpass_objroptionrr5ChoicerCrBrRrSargumentrWrrrrst     '  ! "-python-trezor-0.11.6/src/trezorlib/cli/__pycache__/eos.cpython-36.pyc000066400000000000000000000024551361427340300254520ustar00rootroot000000000000003 ʵ] @sddlZddlZddlmZmZdZejddddZejej d d d ed ej d dd dej ddZ ejej d d d ed ej ddej dd ddej ddZ dS)N)eostoolsz#BIP-32 path, e.g. m/44'/194'/0'/0/0r)namecCsdS)z EOS commands.NrrrM/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/cli/eos.pyclisrz-nz --addressT)requiredhelpz-dz--show-display)is_flagcCs2|}tj|}tj|||}dj|j|jjS)z&Get Eos public key in base58 encoding.zWIF: {} Raw: {})r parse_pathrget_public_keyformatwif_public_keyraw_public_keyhex)connectaddress show_displayclient address_nresrrrr s r z-fz--filerzTransaction in JSON format)typer r cCs2|}tj|}tj|}tj|||d|dS)zSign EOS transaction. transactionchain_id)jsonloadrr rsign_tx)rrfilertx_jsonrrrrsign_transaction+s   r!)rclickrr PATH_HELPgrouprcommandoptionpass_objr Filer!rrrrs" python-trezor-0.11.6/src/trezorlib/cli/__pycache__/ethereum.cpython-36.pyc000066400000000000000000000154571361427340300265100ustar00rootroot000000000000003 ʵ]4$@sddlZddlZddlmZddlZddlmZmZyddlZddl Z dZ Wne k rddZ YnXdZ dd d d d d d d d d d d d d d d d dddZ ddZddZddZddZejddddZejejddde dejdd dd!ejd"d#Zejejddde dejdd dd!ejd$d%Zejejd&d'edd(d)ejddde dejd*d+ed,d-ejd.d/d0ed1ejd2d3ed4d-ejdd5d6d7ejd8d9dd:d;ejdd-ejd.d?d@d7ejdAddBdeddCejdDejdEedFejdGdHZejejddde dejdIejdJdKZejejdLejdMejdIejdNdOZdS)PN)Decimal)ethereumtoolsTFz"BIP-32 path, e.g. m/44'/60'/0'/0/0ii@Biʚ;lJ)lI5lNZo)ZweiZkweiZbabbageZ femtoetherZmweiZlovelaceZ picoetherZgweiZshannonZ nanoetherZnanoZszaboZ microethermicroZfinneyZ millietherZmilliZetherethc Csp|dkr dS|jrt|Sy0tjd|j\}}t|}t|}t||Stk rjtj dYnXdS)Nz^(\d+(?:.\d+)?)([a-z]+)zAmount not understood) isdigitintrematchgroups ETHER_UNITSr Exceptionclick BadParameter)ctxparamvaluenumberunitscaleZdecoded_numberrR/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/cli/ethereum.py_amount_to_int=s rcCsb| s |jrdStddtjDd}x*tjD]\}}tjdj|||dq4W|jdS)Ncss|]}t|VqdS)N)len).0krrr Osz_list_units..rz{:{maxlen}}: {})maxlen) resilient_parsingmaxrkeysitemsrechoformatexit)rrrrrrrrr _list_unitsLs  r'cCs4|jds|jdr&tj|ddStj|SdS)N0xZ0Xr) startswithbytesfromhex)rrrr _decode_hexUsr,cCsJdddddddddgd d dgd g}|jj||d }|jd||gS) NtransferfunctionFZ_toaddress)nametype_valueZuint256bool)r0r1Zconstantinputsoutputs)r/abi)rcontractZ encodeABI)w3Z token_address to_addressamountZmin_abir8rrr_erc20_contract\s r<r)r0cCsdS)zEthereum commands.Nrrrrrclirsr=z-nz --address)requiredhelpz-dz--show-display)is_flagcCs|}tj|}tj|||S)z%Get Ethereum address in hex encoding.)r parse_pathr get_address)connectr/ show_displayclient address_nrrrrBws rBcCsX|}tj|}tj|||d}|jjd|jj|jj|jjj |jj j d|j dS)z'Get Ethereum public node of given path.)rDz%08x)depth fingerprint child_num chain_code public_key)nodexpub) rrArget_public_noderLrGrHrIrJhexrKrM)rCr/rDrErFresultrrrrNs   rNz-cz --chain-idz$EIP-155 chain id (replay protection))r1defaultr?z-gz --gas-limitz(Gas limit (required for offline signing))r1r?z-tz --gas-pricez(Gas price (required for offline signing))r?callbackz-iz--noncez2Transaction counter (required for offline signing)z--dataz#Data as hex string, e.g. 0x12345678)r?z-pz --publishzPublish transaction via RPC)r@r?z-xz --tx-typez TX type (used only for Wanchain)z--tokenzERC20 token addressz --list-unitsz#List known currency units and exit.)r@r?is_eagerrR expose_valuer:r;)rRc  Csts4tjdtjdtjtjdtjdtj} tdd|||fDsb|r| j rtjdtjdtjd|d k r| d k rtjd tjd|} t j |}t j | |}| rt | | | |}| } d }|rt|}nd }|d kr| jj}|d kr$| jj| ||d |jd}|d kr:| jj|}t j| || |||| |||d }t| }| d krtj||||||f|}ntj| ||||||f|}d |j}|r| jj|j}d|Sd|Sd S)aSign (and optionally publish) Ethereum transaction. Use TO_ADDRESS as destination address, or set to "" for contract creation. Specify a contract address with the --token option to send an ERC20 token. You can specify AMOUNT and gas price either as a number of wei, or you can use a unit suffix. Use the --list-units option to show all known currency units. ERC20 token amounts are specified in eth/wei, custom units are not supported. If any of gas price, gas limit and nonce is not specified, this command will try to connect to an ethereum node and auto-fill these values. You can configure the connection with WEB3_PROVIDER_URI environment variable. z$Ethereum requirements not installed.z Please run:z pip install web3 rlprcss|]}|dkVqdS)Nr)rxrrrrszsign_tx..z#Failed to connect to Ethereum node.zaIf you want to sign offline, make sure you provide --gas-price, --gas-limit and --nonce argumentsNz2Can't send tokens and custom data at the same timerz0x%s)tofromrdata) ntx_typenonce gas_price gas_limitrWrrYchain_idz!Transaction published with ID: %szSigned raw transaction: %s) HAVE_SIGN_TXrr$sysr&web3ZWeb3anyZ isConnectedrrArrBr<r,rZgasPriceZ estimateGasrOZgetTransactionCountsign_txrlpencodeZsendRawTransaction)rCr_r/r;r^r]r\rYZpublishr:r[tokenr9rErFZ from_addresssigrW transactionZtx_hextx_hashrrrrdst>                 rdmessagecCs:|}tj|}tj|||}||jd|jjd}|S)z#Sign message with Ethereum address.z0x%s)rkr/ signature)rrAr sign_messager/rlrO)rCr/rkrErFretoutputrrrrm(s rmr/rlcCst|}tj||||S)z,Verify message signed with Ethereum address.)r,rverify_message)rCr/rlrkrrrrp9srp)r radecimalrrr3rrrerbr`r PATH_HELPrrr'r,r<groupr=commandoptionpass_objrBrNr argumentrdrmrprrrrs      (rpython-trezor-0.11.6/src/trezorlib/cli/__pycache__/fido.cpython-36.pyc000066400000000000000000000060571361427340300256070ustar00rootroot000000000000003 ʵ]{@sddlZddlmZejddddZejdd Zejd dejd d Zejd dej dejddZ ejddej dddej ddddejddZ ejddZejddej dedejddZejd dejd!d"ZdS)#N)fidor)namecCsdS)z,FIDO2, U2F and WebAuthN management commands.NrrrN/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/cli/fido.pyclisrcCsdS)z"Manage FIDO2 resident credentials.Nrrrrr credentialssrlistcCsJtj|}x&|D]}tjdtjdj|j|jdk rRtjdj|j|jdk rntjdj|j|jdk rtjdj|jj |j dk rtjdj|j |j dk rtjdj|j |j dk rtjd j|j |j dk rtjd j|j |jdk rtjd j|jtjd j|jj qW|sFtjd dS)z,List all resident credentials on the device.z WebAuthn credential at index {}:Nz Relying party ID: {}z Relying party name: {}z User ID: {}z User name: {}z User display name: {}z Creation time: {}z hmac-secret enabled: {}z Use signature counter: {}z Credential ID: {}z7There are no resident credentials stored on the device.)rZlist_credentialsclickechoformatindexrp_idrp_nameuser_idhex user_nameuser_display_name creation_time hmac_secretuse_sign_countid)connectcredsZcredrrrcredentials_list s.          raddhex_credential_idcCstj|tj|S)zAdd the credential with the given ID as a resident credential. HEX_CREDENTIAL_ID is the credential ID as a hexadecimal string. )rZadd_credentialbytesfromhex)rrrrrcredentials_add>sr removez-iz--indexTczCredential index.)requiredtypehelpcCstj||S)z2Remove the resident credential at the given index.)rZremove_credential)rrrrrcredentials_removeIsr&cCsdS)z&Get or set the FIDO/U2F counter value.NrrrrrcounterXsr'set)r$cCstj||S)zSet FIDO/U2F counter value.)rZ set_counter)rr'rrr counter_set]sr)zget-nextcCs tj|S)zGet-and-increase value of FIDO/U2F counter. FIDO counter value cannot be read directly. On each U2F exchange, the counter value is returned and atomically increased. This command performs the same operation and returns the counter value. )rZget_next_counter)rrrrcounter_get_nextes r*)r r rgrouprrcommandpass_objrargumentr optionIntRanger&r'intr)r*rrrrs$        python-trezor-0.11.6/src/trezorlib/cli/__pycache__/firmware.cpython-36.pyc000066400000000000000000000171701361427340300265000ustar00rootroot000000000000003 <^(@sddlZddlZddlZddlmZmZejjejjfejj fdZ ddZ d'ddZ d(d d Z ejejd d ejddejddejdddddejdddddejddddejddddejddddejd d!d"ejd#d$d"ejd%d&ZdS))N) exceptionsfirmware)rcCsdjf|}tj|dS)Nz6Firmware version {major}.{minor}.{patch} build {build})formatclickecho)versionZvstrr R/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/cli/firmware.py_print_versions r cCs|tjjkr8|jr,tjdt|jjjqtjdnp|tjj kr\tjdt|jjnL|tjj krtjd|j j }dj f|j j}tjdj ||t|jjytj||ddtjd Wntjk rZtjd dd stjd ytj||d dtjdWnDtjk rT}z$tj|tjdtjdWYdd}~XnXYnDtjk r}z$tj|tjdtjdWYdd}~XnXtj||j}tjdj ||r||krtjdj |tjdtjddS)Nz;Trezor One firmware with embedded v2 image (1.8.0 or later)zTrezor One firmware image.z'Trezor One v2 firmware (1.8.0 or later)zTrezor T firmware image.z{major}.{minor}z!Vendor header from {}, version {}F)Zallow_unsignedzSignatures are valid.zNo signatures found. Continue?)defaultrTzUnsigned firmware looking OK.z%Firmware validation failed, aborting.zFirmware fingerprint: {}zExpected fingerprint: {}z$Fingerprints do not match, aborting.)rFirmwareFormat TREZOR_ONEembedded_onev2rrr Zfirmware_headerr TREZOR_ONE_V2TREZOR_TZ vendor_headerZ vendor_stringrvalidateZUnsignedconfirmsysexitZFirmwareIntegrityErrordigesthex)r fwZexpected_fingerprintvendorZvendor_versione fingerprintr r r validate_firmware#sJ               rFc s|r d}nd}tj|j|dj}|s4tjd|rFdd|D}|jddd d d d }|dkr|dd tjdj|d}x|}ytfdd|D} Wn.t k rtjdj|t j dYnXd| ko| d|kr&|| d} tjdj| || dd }qPqW|rtdj|} |dkrRtj| n"tj | dd d} | stt j d|r| d}| d} n| d}| d} |rd|}nd|}|| fS) NzZsz.find_best_firmware_version..cSs|dS)Nr r )r"r r r [sz,find_best_firmware_version..T)keyreversecSsdjtt|S)N.)joinmapstr)r r r r version_str]sz/find_best_firmware_version..version_strr zBest available version: {}Fc3s|]}|dkr|VqdS)r Nr )r!r") want_versionr r jsz-find_best_firmware_version..zVersion {} not found.rZmin_bootloader_versionZmin_firmware_versionz.Version {} is required before upgrading to {}.zInstalling version {} instead.z Continue?)r r Zfingerprint_bitcoinonlyurlrzhttps://beta-wallet.trezor.io/zhttps://wallet.trezor.io/) requestsgetrjsonrClickExceptionsortrnext StopIterationrrr)bootloader_versionZrequested_versionbeta bitcoin_onlyr.Zreleasesr+Zconfirm_different_versionZwant_version_strreleaseZneed_version_strZinstalling_differentokrr )r,r find_best_firmware_versionNs^          r;z-fz --filenamez-uz--urlz-vz --versionz-sz --skip-checkTz"Do not validate firmware integrity)is_flaghelpz-nz --dry-runz9Perform all steps but do not actually upload the firmwarez--betazUse firmware from BETA walletz--bitcoin-onlyz'Use bitcoin-only firmware (if possible)z--rawzPush raw data to Trezorz --fingerprintz$Expected firmware fingerprint in hex)r=z--skip-vendor-headerz)Skip vendor header validation on Trezor Tc ,Cs:tdd|||fDdkr0tjdtjd|} | rZ| jj rZtjdtjd| j} | jdkor| jdk} |rt |dj }n|s| j| j| j g}|rdd |j d Dnd }t ||| | \}}|s|}y&tjd j|tj|}|jWnBtjjk r:}z tjd j|tjdWYd d }~XnX|j}| rN| rNytj|\}}Wn8tk r}ztj|tjdWYd d }~XnXt|||| r|tjjkr|j rtjdtjdn*| r|tjjkrtjdtjd| jtkr*tjdtjdn$|t| jkrNtjdtjd|s| r|d ddkr|dddkrtjd|dd }|rtjdny.| jdkr| jdk rtjdtj| |Stj k rtjdYn@tj!k r4}z tjdj|tjdWYd d }~XnXd S)aUpload new firmware to device. Device must be in bootloader mode. You can specify a filename or URL from which the firmware can be downloaded. You can also explicitly specify a firmware version that you want. Otherwise, trezorctl will attempt to find latest available version from wallet.trezor.io. If you provide a fingerprint via the --fingerprint option, it will be checked against downloaded firmware fingerprint. Otherwise fingerprint is checked against wallet.trezor.io information, if available. If you are customizing Model T bootloader and providing your own vendor header, you can use --skip-vendor-header to ignore vendor header signatures. css|]}t|VqdS)N)bool)r!xr r r r-sz"firmware_update..rz0You can use only one of: filename, url, version.z-Please switch your device to bootloader mode.rbcSsg|] }t|qSr )int)r!r?r r r r#sz#firmware_update..r'NzDownloading from {}zError downloading file: {}rz.Firmware is too old for your device. Aborting.z.You need to upgrade to bootloader 1.8.0 first.z5trezorctl doesn't know your device version. Aborting.z.Firmware does not match your device, aborting.rsTRZRsTRZFzs( , F     python-trezor-0.11.6/src/trezorlib/cli/__pycache__/lisk.cpython-36.pyc000066400000000000000000000042331361427340300256220ustar00rootroot000000000000003 ʵ] @sTddlZddlZddlmZmZdZejddddZejej d d d ed ej d dd dej ddZ ejej d d d ed ej d dd dej ddZ ejej d d d ed ej ddej ddddej ddZejej d d d ed ejdej ddZejejdejd ejdej d!d"ZdS)#N)lisktoolsz"BIP-32 path, e.g. m/44'/134'/0'/0'r)namecCsdS)zLisk commands.NrrrN/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/cli/lisk.pyclisrz-nz --addressT)requiredhelpz-dz--show-display)is_flagcCs|}tj|}tj|||S)z$Get Lisk address for specified path.)r parse_pathr get_address)connectaddress show_displayclient address_nrrrr s r cCs0|}tj|}tj|||}d|jji}|S)z'Get Lisk public key for specified path. public_key)rr rget_public_keyrhex)rrrrrresoutputrrrr*s  rz-fz--filer-zTransaction in JSON format)typedefaultr cCs6|}tj|}tj||tj|}d|jji}|S)zSign Lisk transaction. signature)rr rsign_txjsonloadrr)rrfilerr transactionpayloadrrrr7s  rmessagecCs:|}|j|}tj|||}||jj|jjd}|S)zSign message with Lisk address.)r#rr) expand_pathr sign_messagerrr)rrr#rrrrrrrr%Is r%pubkeyrcCs&tj|}tj|}tj||||S)z(Verify message signed with Lisk address.)bytesfromhexrverify_message)rr&rr#rrrr)Zs  r))rclickrr PATH_HELPgrouprcommandoptionpass_objr rFilerargumentr%r)rrrrs4  python-trezor-0.11.6/src/trezorlib/cli/__pycache__/monero.cpython-36.pyc000066400000000000000000000024521361427340300261600ustar00rootroot000000000000003 ʵ] @sddlZddlmZmZdZejddddZejejd d d ed ejd dd dejddej ddddgddej ddZ ejejd d d ed ejddej ddddgddej ddZ dS)N)monerotoolszBIP-32 path, e.g. m/44'/128'/0'r)namecCsdS)zMonero commands.NrrrP/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/cli/monero.pyclisrz-nz --addressT)requiredhelpz-dz--show-display)is_flagz-tz--network-type0123)typedefaultcCs(|}tj|}t|}tj||||S)z&Get Monero address for specified path.)r parse_pathintr get_address)connectaddress show_display network_typeclient address_nrrrrs  rcCs@|}tj|}t|}tj|||}|jj|jjd}|S)z(Get Monero watch key for specified path.)r watch_key) rrrr get_watch_keyrdecoderhex)rrrrrresoutputrrrr,s  r) clickrr PATH_HELPgrouprcommandoptionChoicepass_objrrrrrrs python-trezor-0.11.6/src/trezorlib/cli/__pycache__/nem.cpython-36.pyc000066400000000000000000000030471361427340300254410ustar00rootroot000000000000003 ʵ]I @sddlZddlZddlZddlmZmZdZejddddZej ej d d d ed ej d de ddej ddd dej ddZ ej ej d d d ed ej ddejddddej ddddej d d!ZdS)"N)nemtoolsz"BIP-32 path, e.g. m/44'/134'/0'/0'r)namecCsdS)z NEM commands.NrrrM/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/cli/nem.pyclisrz-nz --addressT)requiredhelpz-Nz --networkh)typedefaultz-dz--show-display)is_flagcCs |}tj|}tj||||S)z#Get NEM address for specified path.)r parse_pathr get_address)connectaddressnetwork show_displayclient address_nrrrr s rz-fz--filer-z2Transaction in NIS (RequestPrepareAnnounce) format)r r r z-bz --broadcastzNIS to announce transaction to)r cCs^|}tj|}tj||tj|}|jj|jjd}|rVt j dj ||djS|SdS)z0Sign (and optionally broadcast) NEM transaction.)data signaturez{}/transaction/announce)jsonN) rrrsign_txrloadrhexrrequestspostformat)rrfile broadcastrr transactionpayloadrrrr,s  r)rclickrrr PATH_HELPgrouprcommandoptionintpass_objrFilerrrrrs(python-trezor-0.11.6/src/trezorlib/cli/__pycache__/ripple.cpython-36.pyc000066400000000000000000000025471361427340300261610ustar00rootroot000000000000003 ʵ]8 @sddlZddlZddlmZmZdZejddddZejej d d d ed ej d dd dej ddZ ejej d d d ed ej ddej ddddej ddZ dS)N)rippletoolsz*BIP-32 path to key, e.g. m/44'/144'/0'/0/0r)namecCsdS)zRipple commands.NrrrP/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/cli/ripple.pyclisrz-nz --addressT)requiredhelpz-dz--show-display)is_flagcCs|}tj|}tj|||S)zGet Ripple address)r parse_pathr get_address)connectaddress show_displayclient address_nrrrr s r z-fz--filer-zTransaction in JSON format)typedefaultr cCsn|}tj|}tjtj|}tj|||}tjdtj|j j tjtjdtj|j j dS)zSign Ripple transactionz Signature:z&Serialized tx including the signature:N) rr rZcreate_sign_tx_msgjsonloadsign_txclickecho signaturehex serialized_tx)rrfilerrmsgresultrrrr*s   r)rrrr PATH_HELPgrouprcommandoptionpass_objr Filerrrrrspython-trezor-0.11.6/src/trezorlib/cli/__pycache__/settings.cpython-36.pyc000066400000000000000000000103521361427340300265170ustar00rootroot000000000000003 ʵ] @sddlZddlmZmZddlmZejjejjejjdZ dddd d Z ej d d d dZ e j ejddddejddZe j ejddddejddZe j ejdddddddejdejddZe j ejdee dejd d!Ze j ejd"edejd#d$Ze j ejd%ejd&d%Ze j ejd'd(dd)ejd*d+Ze j d,d-Zej d.d ejd/d0Zej d1d ejd2d3Zej d4d ejd4ee dejd5d6ZdS)7N)devicemessages) ChoiceType)ZaskrhostZi)ZnorthZeastZsouthZwestset)namecCsdS)zDevice settings.Nr r r R/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/cli/settings.pyclisrz-rz--removeT)is_flagcCstj||S)zSet, change or remove PIN.)r change_pin)connectremover r r pin$srcCstj||S)aSet or remove the wipe code. The wipe code functions as a "self-destruct PIN". If the wipe code is ever entered into any PIN entry dialog, then all private data will be immediately removed and the device will be reset to factory defaults. )rchange_wipe_code)rrr r r wipe_code,s rz-lz--label_ignoreF)rhidden expose_valuelabelcCstj||dS)zSet new device label.)r)rapply_settings)rrr r r r9srotation)typecCstj||dS)z~Set display rotation. Configure display rotation for Trezor Model T. The options are north, east, south or west. )display_rotation)rr)rrr r r rCs rdelaycCs`|dd|d d}}dddd}||kr@t|||}nt|}tj|t|ddS) z!Set auto-lock delay (in seconds).Nr<i)smhi)auto_lock_delay_msr$)floatrrint)rrvalueunitunitssecondsr r r auto_lock_delayOs  r+flagscCsL|j}|jdrt|d}n|jdr4t|d}nt|}tj||dS)zSet device flags.0br0x)r,)lower startswithr&r apply_flags)rr,r r r r,]s    z-fz --filename)defaultc Cs|dkrd}n|jdrBt|dj}|dddkrtjdndd lm}|j|}|jdkrltjd |jd }|j }t d}xZt d D]N}xHt d D]<}|||fr||d }||ddd|d>O<qWqWt |}t j||dS)zSet new homescreen.Nz.toifrbsTOIfz,File is not a TOIF file with size of 144x144r)Image@zWrong size of the image1ir) homescreen)r8r9)endswithopenreadclickClickExceptionZPILr7sizeconvertload bytearrayrangebytesrr) rfilenameZimgr7ZimZpixjior r r r<ls(         (r<cCsdS)z3Enable, disable or configure passphrase protection.Nr r r r r passphrasesrLenabledcCstj|ddS)zEnable passphrase.T)use_passphrase)rr)rr r r passphrase_enablesrOdisabledcCstj|ddS)zDisable passphrase.F)rN)rr)rr r r passphrase_disablesrQsourcecCstj||dS)zSet passphrase source. Configure how to enter passphrase on Trezor Model T. The options are:  ask - always ask where to enter passphrase device - always enter passphrase on device host - always enter passphrase on host )passphrase_source)rr)rrRr r r rSs rS)r@rrrPassphraseSourceTypeASKDEVICEHOSTZPASSPHRASE_SOURCEZROTATIONgrouprcommandoptionpass_objrrargumentrrstrr+r,r<rLrOrQrSr r r r sJ           python-trezor-0.11.6/src/trezorlib/cli/__pycache__/stellar.cpython-36.pyc000066400000000000000000000031211361427340300263210ustar00rootroot000000000000003 ʵ] @sddlZddlZddlmZmZdZejddddZejej d d d eej d ej d dddej ddZ ejej d d d eej d ej d dej d ddejdej ddZdS)N)stellartoolsz@BIP32 path. Always use hardened paths and the m/44'/148'/ prefixr)namecCsdS)zStellar commands.NrrrQ/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/cli/stellar.pyclisrz-nz --addressF)requiredhelpdefaultz-dz--show-displayT)is_flagcCs|}tj|}tj|||S)zGet Stellar public address.)r parse_pathr get_address)connectaddress show_displayclient address_nrrrrs  rz--network-passphrasez.Network passphrase (blank for public network).)r r r b64envelopec CsB|}tj|}tjtj|\}}tj|||||}tj|jS)zSign a base64-encoded transaction envelope. For testnet transactions, use the following network passphrase: 'Test SDF Network ; September 2015' ) rr rZparse_transaction_bytesbase64 b64decodesign_tx b64encode signature) rrrnetwork_passphraserrtxZ operationsresprrrsign_transaction0s  r)rclickrr PATH_HELPgrouprcommandoptionZDEFAULT_BIP32_PATHpass_objrZDEFAULT_NETWORK_PASSPHRASEargumentrrrrrs8python-trezor-0.11.6/src/trezorlib/cli/__pycache__/tezos.cpython-36.pyc000066400000000000000000000030341361427340300260220ustar00rootroot000000000000003 ʵ]E @sddlZddlZddlmZmZmZmZdZejddddZ e j ej d d d ed ej d dd dej ddZ e j ej d d d ed ej d dd dej ddZe j ej d d d ed ej ddejddddej ddZdS)N)messagesprotobuftezostoolsz BIP-32 path, e.g. m/44'/1729'/0'r)namecCsdS)zTezos commands.NrrrO/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/cli/tezos.pyclisr z-nz --addressT)requiredhelpz-dz--show-display)is_flagcCs|}tj|}tj|||S)z%Get Tezos address for specified path.)r parse_pathr get_address)connectaddress show_displayclient address_nrrr rs rcCs|}tj|}tj|||S)zGet Tezos public key.)rrrget_public_key)rrrrrrrr r*s rz-fz--filer-zs*python-trezor-0.11.6/src/trezorlib/cli/__pycache__/trezorctl.cpython-36.pyc000066400000000000000000000144061361427340300267130ustar00rootroot000000000000003 ʵ]@s*ddlZddlZddlZddlZddlmZmZmZmZm Z ddl m Z ddl m Z mZddlmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZej ej!ej"ej#ej$ej%ej&ej'ej(ej)ej*ej+ej,ej-ej.ej.ej.ej.ej.ej.ej.ej.dZ/Gd d d ej0Z1e2d d d Z3ej4e1ddidej5dddej6j7ddej5dddddej5ddddddej8ej9d d!Z.e.j:d"d#Z;e.j4d$d%d&d'Zd*ej5d+d,dd-ej5dd.dd-ej5d/d0dd-ej?d1d2Z@e.j4ej?d3d4ZAe.j4ej?d5d6ZBe.j4d7d8ZCe.jDej.e.jDej.e.jDej.e.jDej.e.jDej.e.jDej.e.jDej.e.jDej.e.jDej.e.jDej.e.jDej.e.jDej.e.jDej.e.jDej.e.jDej.e.jDej.e.jDejEeFd9kr&e.dS):N)coinslogmessagesprotobufui) TrezorClient)enumerate_devices get_transport)binancebtccardanocosicryptodeviceeosethereumfidofirmwareliskmoneronemripplesettingsstellartezos)z change-pinzenable-passphrasezdisable-passphrasezset-passphrase-sourcez wipe-devicez reset-devicezrecovery-devicez backup-devicez sd-protectz load-devicez self-testz get-entropyzencrypt-keyvaluezdecrypt-keyvalueZbnbZethZadaZlskZxmrZxrpZxlmZxtzcs eZdZdZfddZZS)TrezorctlGroupaCommand group that handles compatibility for trezorctl. The purpose is twofold: convert underscores to dashes, and ensure old-style commands still work with new-style groups. Click 7.0 silently switched all underscore_commands to dash-commands. This implementation of `click.Group` responds to underscore_commands by invoking the respective dash-command. With trezorctl 0.11.5, we started to convert old-style long commands (such as "binance-sign-tx") to command groups ("binance") with subcommands ("sign-tx"). The `TrezorctlGroup` can perform subcommand lookup: if a command "binance-sign-tx" does not exist in the default group, it tries to find "sign-tx" subcommand of "binance" group. c s|jdd}tj||}|r"|S|tkr2t|Stjj||}|rH|Sy(|jddd\}}tj||j||Stk rYnXx2tj D](}|j |dj kr|dt_ tjSqWdS)N_-r )maxsplitZshortcutZ coin_name) replacesuper get_commandCOMMAND_ALIASESr clisplit ExceptionrZ coins_listlowerZ DEFAULT_COIN)selfctxcmd_namecmdcommand subcommandZcoin) __class__S/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/cli/trezorctl.pyr#\s&    zTrezorctlGroup.get_command)__name__ __module__ __qualname____doc__r# __classcell__r0r0)r/r1rKsr)verbosecCs |rtj|tjjtjdS)N)rZenable_debug_outputZOMITTED_MESSAGESaddrZFeatures)r7r0r0r1configure_logging}s r9max_content_widthi)clscontext_settingsz-pz--pathzSelect device by specific path.Z TREZOR_PATH)helpdefaultz-vz --verboseTzShow communication messages.)countr=z-jz--jsonis_jsonzPrint result as JSON object)is_flagr=cst|fdd}||_dS)Ncsytdd}Wnftk rvytdd}Wn@tk rptjddk rbtjdjtjdYnXYnXt|tj dS)NF)Z prefix_searchTzFailed to find a Trezor device.zUsing path: {}r ) transportr) r r'clickechoformatsysexitrrZClickUI)r)pathr0r1 get_devices zcli..get_device)r9obj)r*rHr7r@rIr0)rHr1r%s r%c Cs|rDt|tjr,tjtj|jj|j iqtjtj|dddnt|t rhx|D]}tj|qTWnt|t rx|j D]P\}}t|t rx<|j D]\}}tjd|||fqWq|tjd||fq|Wn(t|tjrtjtj |n tj|dS)NT)Z sort_keysindentz %s.%s: %sz%s: %s) isinstancerZ MessageTyperCrDjsondumpsr/r2__dict__listdictitemsformat_message) resrHr7r@linekvZkkZvvr0r0r1 print_results       rYrQ)namecCstS)zList connected Trezor devices.)r r0r0r0r1 list_devicessr[cCsddlm}|S)z$Show version of trezorctl/trezorlib.r) __version__)Z trezorlibr\)VERSIONr0r0r1versions r^messagez-bz--button-protection)rAz--pin-protectionz-rz--passphrase-protectioncCs|j||||dS)zSend ping message.)button_protectionpin_protectionpassphrase_protection)ping)connectr_r`rarbr0r0r1rcs rccCs |jS)z4Clear session (remove cached PIN, passphrase, etc.).) clear_session)rdr0r0r1resrecCs|jS)z&Retrieve device features and settings.)Zfeatures)rdr0r0r1 get_featuressrfcCsddlm}|jdddS)zPerform USB reset on stuck devices. This can fix LIBUSB_ERROR_PIPE and similar errors when connecting to a device in a messed state. r)WebUsbTransportT) usb_resetN)Ztrezorlib.transport.webusbrg enumerate)rgr0r0r1rhs rh__main__)GrNosrFrCrrrrrZclientrrBr r r r rrrrrrrrrrrrrrrZpinZpassphrase_enableZpassphrase_disableZpassphrase_sourceZwipeZsetupZrecoverZbackupZ sd_protectloadZ self_testZ get_entropyZencrypt_keyvalueZdecrypt_keyvaluer%r$Grouprintr9r-optionenvirongetversion_option pass_contextresultcallbackrYr[r^argumentpass_objrcrerfrh add_commandZfirmware_updater2r0r0r0r1s L 2                    python-trezor-0.11.6/src/trezorlib/cli/binance.py000066400000000000000000000037771361427340300220070ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . import json import click from .. import binance, tools PATH_HELP = "BIP-32 path to key, e.g. m/44'/714'/0'/0/0" @click.group(name="binance") def cli(): """Binance Chain commands.""" @cli.command() @click.option("-n", "--address", required=True, help=PATH_HELP) @click.option("-d", "--show-display", is_flag=True) @click.pass_obj def get_address(connect, address, show_display): """Get Binance address for specified path.""" client = connect() address_n = tools.parse_path(address) return binance.get_address(client, address_n, show_display) @cli.command() @click.option("-n", "--address", required=True, help=PATH_HELP) @click.option("-d", "--show-display", is_flag=True) @click.pass_obj def get_public_key(connect, address, show_display): """Get Binance public key.""" client = connect() address_n = tools.parse_path(address) return binance.get_public_key(client, address_n, show_display).hex() @cli.command() @click.option("-n", "--address", required=True, help=PATH_HELP) @click.option( "-f", "--file", type=click.File("r"), required=True, help="Transaction in JSON format", ) @click.pass_obj def sign_tx(connect, address, file): """Sign Binance transaction""" client = connect() address_n = tools.parse_path(address) return binance.sign_tx(client, address_n, json.load(file)) python-trezor-0.11.6/src/trezorlib/cli/btc.py000066400000000000000000000124121361427340300211420ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . import base64 import json import click from .. import btc, messages, protobuf, tools from . import ChoiceType INPUT_SCRIPTS = { "address": messages.InputScriptType.SPENDADDRESS, "segwit": messages.InputScriptType.SPENDWITNESS, "p2shsegwit": messages.InputScriptType.SPENDP2SHWITNESS, } OUTPUT_SCRIPTS = { "address": messages.OutputScriptType.PAYTOADDRESS, "segwit": messages.OutputScriptType.PAYTOWITNESS, "p2shsegwit": messages.OutputScriptType.PAYTOP2SHWITNESS, } DEFAULT_COIN = "Bitcoin" @click.group(name="btc") def cli(): """Bitcoin and Bitcoin-like coins commands.""" # # Address functions # @cli.command() @click.option("-c", "--coin") @click.option("-n", "--address", required=True, help="BIP-32 path") @click.option("-t", "--script-type", type=ChoiceType(INPUT_SCRIPTS), default="address") @click.option("-d", "--show-display", is_flag=True) @click.pass_obj def get_address(connect, coin, address, script_type, show_display): """Get address for specified path.""" coin = coin or DEFAULT_COIN address_n = tools.parse_path(address) return btc.get_address( connect(), coin, address_n, show_display, script_type=script_type ) @cli.command() @click.option("-c", "--coin") @click.option("-n", "--address", required=True, help="BIP-32 path, e.g. m/44'/0'/0'") @click.option("-e", "--curve") @click.option("-t", "--script-type", type=ChoiceType(INPUT_SCRIPTS), default="address") @click.option("-d", "--show-display", is_flag=True) @click.pass_obj def get_public_node(connect, coin, address, curve, script_type, show_display): """Get public node of given path.""" coin = coin or DEFAULT_COIN address_n = tools.parse_path(address) result = btc.get_public_node( connect(), address_n, ecdsa_curve_name=curve, show_display=show_display, coin_name=coin, script_type=script_type, ) return { "node": { "depth": result.node.depth, "fingerprint": "%08x" % result.node.fingerprint, "child_num": result.node.child_num, "chain_code": result.node.chain_code.hex(), "public_key": result.node.public_key.hex(), }, "xpub": result.xpub, } # # Signing functions # @cli.command() @click.option("-c", "--coin", "_ignore", is_flag=True, hidden=True, expose_value=False) @click.argument("json_file", type=click.File()) @click.pass_obj def sign_tx(connect, json_file): """Sign transaction. Transaction data must be provided in a JSON file. See `transaction-format.md` for description. You can use `tools/build_tx.py` from the source distribution to build the required JSON file interactively: $ python3 tools/build_tx.py | trezorctl btc sign-tx - """ client = connect() data = json.load(json_file) coin = data.get("coin_name", DEFAULT_COIN) details = protobuf.dict_to_proto(messages.SignTx, data.get("details", {})) inputs = [ protobuf.dict_to_proto(messages.TxInputType, i) for i in data.get("inputs", ()) ] outputs = [ protobuf.dict_to_proto(messages.TxOutputType, output) for output in data.get("outputs", ()) ] prev_txes = { bytes.fromhex(txid): protobuf.dict_to_proto(messages.TransactionType, tx) for txid, tx in data.get("prev_txes", {}).items() } _, serialized_tx = btc.sign_tx(client, coin, inputs, outputs, details, prev_txes) click.echo() click.echo("Signed Transaction:") click.echo(serialized_tx.hex()) # # Message functions # @cli.command() @click.option("-c", "--coin") @click.option("-n", "--address", required=True, help="BIP-32 path") @click.option("-t", "--script-type", type=ChoiceType(INPUT_SCRIPTS), default="address") @click.argument("message") @click.pass_obj def sign_message(connect, coin, address, message, script_type): """Sign message using address of given path.""" coin = coin or DEFAULT_COIN address_n = tools.parse_path(address) res = btc.sign_message(connect(), coin, address_n, message, script_type) return { "message": message, "address": res.address, "signature": base64.b64encode(res.signature).decode(), } @cli.command() @click.option("-c", "--coin") @click.argument("address") @click.argument("signature") @click.argument("message") @click.pass_obj def verify_message(connect, coin, address, signature, message): """Verify message.""" signature = base64.b64decode(signature) coin = coin or DEFAULT_COIN return btc.verify_message(connect(), coin, address, signature, message) # # deprecated interactive signing # ALL BELOW is legacy code and will be dropped python-trezor-0.11.6/src/trezorlib/cli/cardano.py000066400000000000000000000043521361427340300220050ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . import json import click from .. import cardano, tools PATH_HELP = "BIP-32 path to key, e.g. m/44'/1815'/0'/0/0" @click.group(name="cardano") def cli(): """Cardano commands.""" @cli.command() @click.option( "-f", "--file", type=click.File("r"), required=True, help="Transaction in JSON format", ) @click.option("-N", "--network", type=int, default=1) @click.pass_obj def sign_tx(connect, file, network): """Sign Cardano transaction.""" client = connect() transaction = json.load(file) inputs = [cardano.create_input(input) for input in transaction["inputs"]] outputs = [cardano.create_output(output) for output in transaction["outputs"]] transactions = transaction["transactions"] signed_transaction = cardano.sign_tx(client, inputs, outputs, transactions, network) return { "tx_hash": signed_transaction.tx_hash.hex(), "tx_body": signed_transaction.tx_body.hex(), } @cli.command() @click.option("-n", "--address", required=True, help=PATH_HELP) @click.option("-d", "--show-display", is_flag=True) @click.pass_obj def get_address(connect, address, show_display): """Get Cardano address.""" client = connect() address_n = tools.parse_path(address) return cardano.get_address(client, address_n, show_display) @cli.command() @click.option("-n", "--address", required=True, help=PATH_HELP) @click.pass_obj def get_public_key(connect, address): """Get Cardano public key.""" client = connect() address_n = tools.parse_path(address) return cardano.get_public_key(client, address_n) python-trezor-0.11.6/src/trezorlib/cli/cosi.py000066400000000000000000000033121361427340300213260ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . import click from .. import cosi, tools PATH_HELP = "BIP-32 path, e.g. m/44'/0'/0'/0/0" @click.group(name="cosi") def cli(): """CoSi (Cothority / collective signing) commands.""" @cli.command() @click.option("-n", "--address", required=True, help=PATH_HELP) @click.argument("data") @click.pass_obj def commit(connect, address, data): """Ask device to commit to CoSi signing.""" client = connect() address_n = tools.parse_path(address) return cosi.commit(client, address_n, bytes.fromhex(data)) @cli.command() @click.option("-n", "--address", required=True, help=PATH_HELP) @click.argument("data") @click.argument("global_commitment") @click.argument("global_pubkey") @click.pass_obj def sign(connect, address, data, global_commitment, global_pubkey): """Ask device to sign using CoSi.""" client = connect() address_n = tools.parse_path(address) return cosi.sign( client, address_n, bytes.fromhex(data), bytes.fromhex(global_commitment), bytes.fromhex(global_pubkey), ) python-trezor-0.11.6/src/trezorlib/cli/crypto.py000066400000000000000000000034501361427340300217140ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . import click from .. import misc, tools @click.group(name="crypto") def cli(): """Miscellaneous cryptography features.""" @cli.command() @click.argument("size", type=int) @click.pass_obj def get_entropy(connect, size): """Get random bytes from device.""" return misc.get_entropy(connect(), size).hex() @cli.command() @click.option("-n", "--address", required=True, help="BIP-32 path, e.g. m/10016'/0") @click.argument("key") @click.argument("value") @click.pass_obj def encrypt_keyvalue(connect, address, key, value): """Encrypt value by given key and path.""" client = connect() address_n = tools.parse_path(address) res = misc.encrypt_keyvalue(client, address_n, key, value.encode()) return res.hex() @cli.command() @click.option("-n", "--address", required=True, help="BIP-32 path, e.g. m/10016'/0") @click.argument("key") @click.argument("value") @click.pass_obj def decrypt_keyvalue(connect, address, key, value): """Decrypt value by given key and path.""" client = connect() address_n = tools.parse_path(address) return misc.decrypt_keyvalue(client, address_n, key, bytes.fromhex(value)) python-trezor-0.11.6/src/trezorlib/cli/device.py000066400000000000000000000174661361427340300216470ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . import sys import click from .. import debuglink, device, exceptions, messages, ui from . import ChoiceType RECOVERY_TYPE = { "scrambled": messages.RecoveryDeviceType.ScrambledWords, "matrix": messages.RecoveryDeviceType.Matrix, } BACKUP_TYPE = { "single": messages.BackupType.Bip39, "shamir": messages.BackupType.Slip39_Basic, "advanced": messages.BackupType.Slip39_Advanced, } SD_PROTECT_OPERATIONS = { "enable": messages.SdProtectOperationType.ENABLE, "disable": messages.SdProtectOperationType.DISABLE, "refresh": messages.SdProtectOperationType.REFRESH, } @click.group(name="device") def cli(): """Device management commands - setup, recover seed, wipe, etc.""" @cli.command() @click.pass_obj def self_test(connect): """Perform a self-test.""" return debuglink.self_test(connect()) @cli.command() @click.option( "-b", "--bootloader", help="Wipe device in bootloader mode. This also erases the firmware.", is_flag=True, ) @click.pass_obj def wipe(connect, bootloader): """Reset device to factory defaults and remove all private data.""" client = connect() if bootloader: if not client.features.bootloader_mode: click.echo("Please switch your device to bootloader mode.") sys.exit(1) else: click.echo("Wiping user data and firmware!") else: if client.features.bootloader_mode: click.echo( "Your device is in bootloader mode. This operation would also erase firmware." ) click.echo( 'Specify "--bootloader" if that is what you want, or disconnect and reconnect device in normal mode.' ) click.echo("Aborting.") sys.exit(1) else: click.echo("Wiping user data!") try: return device.wipe(connect()) except exceptions.TrezorFailure as e: click.echo("Action failed: {} {}".format(*e.args)) sys.exit(3) @cli.command() @click.option("-m", "--mnemonic", multiple=True) @click.option("-p", "--pin", default="") @click.option("-r", "--passphrase-protection", is_flag=True) @click.option("-l", "--label", default="") @click.option("-i", "--ignore-checksum", is_flag=True) @click.option("-s", "--slip0014", is_flag=True) @click.option("-b", "--needs-backup", is_flag=True) @click.option("-n", "--no-backup", is_flag=True) @click.pass_obj def load( connect, mnemonic, pin, passphrase_protection, label, ignore_checksum, slip0014, needs_backup, no_backup, ): """Upload seed and custom configuration to the device. This functionality is only available in debug mode. """ if slip0014 and mnemonic: raise click.ClickException("Cannot use -s and -m together.") client = connect() if slip0014: mnemonic = [" ".join(["all"] * 12)] if not label: label = "SLIP-0014" return debuglink.load_device( client, mnemonic=list(mnemonic), pin=pin, passphrase_protection=passphrase_protection, label=label, language="en-US", skip_checksum=ignore_checksum, needs_backup=needs_backup, no_backup=no_backup, ) @cli.command() @click.option("-w", "--words", type=click.Choice(["12", "18", "24"]), default="24") @click.option("-e", "--expand", is_flag=True) @click.option("-p", "--pin-protection", is_flag=True) @click.option("-r", "--passphrase-protection", is_flag=True) @click.option("-l", "--label") @click.option("-u", "--u2f-counter", default=None, type=int) @click.option( "-t", "--type", "rec_type", type=ChoiceType(RECOVERY_TYPE), default="scrambled" ) @click.option("-d", "--dry-run", is_flag=True) @click.pass_obj def recover( connect, words, expand, pin_protection, passphrase_protection, label, u2f_counter, rec_type, dry_run, ): """Start safe recovery workflow.""" if rec_type == messages.RecoveryDeviceType.ScrambledWords: input_callback = ui.mnemonic_words(expand) else: input_callback = ui.matrix_words click.echo(ui.RECOVERY_MATRIX_DESCRIPTION) return device.recover( connect(), word_count=int(words), passphrase_protection=passphrase_protection, pin_protection=pin_protection, label=label, u2f_counter=u2f_counter, language="en-US", input_callback=input_callback, type=rec_type, dry_run=dry_run, ) @cli.command() @click.option("-e", "--show-entropy", is_flag=True) @click.option("-t", "--strength", type=click.Choice(["128", "192", "256"])) @click.option("-r", "--passphrase-protection", is_flag=True) @click.option("-p", "--pin-protection", is_flag=True) @click.option("-l", "--label") @click.option("-u", "--u2f-counter", default=0) @click.option("-s", "--skip-backup", is_flag=True) @click.option("-n", "--no-backup", is_flag=True) @click.option("-b", "--backup-type", type=ChoiceType(BACKUP_TYPE), default="single") @click.pass_obj def setup( connect, show_entropy, strength, passphrase_protection, pin_protection, label, u2f_counter, skip_backup, no_backup, backup_type, ): """Perform device setup and generate new seed.""" if strength: strength = int(strength) client = connect() if ( backup_type == messages.BackupType.Slip39_Basic and messages.Capability.Shamir not in client.features.capabilities ) or ( backup_type == messages.BackupType.Slip39_Advanced and messages.Capability.ShamirGroups not in client.features.capabilities ): click.echo( "WARNING: Your Trezor device does not indicate support for the requested\n" "backup type. Traditional single-seed backup may be generated instead." ) return device.reset( client, display_random=show_entropy, strength=strength, passphrase_protection=passphrase_protection, pin_protection=pin_protection, label=label, language="en-US", u2f_counter=u2f_counter, skip_backup=skip_backup, no_backup=no_backup, backup_type=backup_type, ) @cli.command() @click.pass_obj def backup(connect): """Perform device seed backup.""" return device.backup(connect()) @cli.command() @click.argument("operation", type=ChoiceType(SD_PROTECT_OPERATIONS)) @click.pass_obj def sd_protect(connect, operation): """Secure the device with SD card protection. When SD card protection is enabled, a randomly generated secret is stored on the SD card. During every PIN checking and unlocking operation this secret is combined with the entered PIN value to decrypt data stored on the device. The SD card will thus be needed every time you unlock the device. The options are: \b enable - Generate SD card secret and use it to protect the PIN and storage. disable - Remove SD card secret protection. refresh - Replace the current SD card secret with a new one. """ client = connect() if client.features.model == "1": raise click.BadUsage("Trezor One does not support SD card protection.") return device.sd_protect(client, operation) python-trezor-0.11.6/src/trezorlib/cli/eos.py000066400000000000000000000033771361427340300211720ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . import json import click from .. import eos, tools PATH_HELP = "BIP-32 path, e.g. m/44'/194'/0'/0/0" @click.group(name="eos") def cli(): """EOS commands.""" @cli.command() @click.option("-n", "--address", required=True, help=PATH_HELP) @click.option("-d", "--show-display", is_flag=True) @click.pass_obj def get_public_key(connect, address, show_display): """Get Eos public key in base58 encoding.""" client = connect() address_n = tools.parse_path(address) res = eos.get_public_key(client, address_n, show_display) return "WIF: {}\nRaw: {}".format(res.wif_public_key, res.raw_public_key.hex()) @cli.command() @click.option("-n", "--address", required=True, help=PATH_HELP) @click.option( "-f", "--file", type=click.File("r"), required=True, help="Transaction in JSON format", ) @click.pass_obj def sign_transaction(connect, address, file): """Sign EOS transaction.""" client = connect() tx_json = json.load(file) address_n = tools.parse_path(address) return eos.sign_tx(client, address_n, tx_json["transaction"], tx_json["chain_id"]) python-trezor-0.11.6/src/trezorlib/cli/ethereum.py000066400000000000000000000220641361427340300222140ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . import re import sys from decimal import Decimal import click from .. import ethereum, tools try: import rlp import web3 HAVE_SIGN_TX = True except Exception: HAVE_SIGN_TX = False PATH_HELP = "BIP-32 path, e.g. m/44'/60'/0'/0/0" # fmt: off ETHER_UNITS = { 'wei': 1, 'kwei': 1000, 'babbage': 1000, 'femtoether': 1000, 'mwei': 1000000, 'lovelace': 1000000, 'picoether': 1000000, 'gwei': 1000000000, 'shannon': 1000000000, 'nanoether': 1000000000, 'nano': 1000000000, 'szabo': 1000000000000, 'microether': 1000000000000, 'micro': 1000000000000, 'finney': 1000000000000000, 'milliether': 1000000000000000, 'milli': 1000000000000000, 'ether': 1000000000000000000, 'eth': 1000000000000000000, } # fmt: on def _amount_to_int(ctx, param, value): if value is None: return None if value.isdigit(): return int(value) try: number, unit = re.match(r"^(\d+(?:.\d+)?)([a-z]+)", value).groups() scale = ETHER_UNITS[unit] decoded_number = Decimal(number) return int(decoded_number * scale) except Exception: raise click.BadParameter("Amount not understood") def _list_units(ctx, param, value): if not value or ctx.resilient_parsing: return maxlen = max(len(k) for k in ETHER_UNITS.keys()) + 1 for unit, scale in ETHER_UNITS.items(): click.echo("{:{maxlen}}: {}".format(unit, scale, maxlen=maxlen)) ctx.exit() def _decode_hex(value): if value.startswith("0x") or value.startswith("0X"): return bytes.fromhex(value[2:]) else: return bytes.fromhex(value) def _erc20_contract(w3, token_address, to_address, amount): min_abi = [ { "name": "transfer", "type": "function", "constant": False, "inputs": [ {"name": "_to", "type": "address"}, {"name": "_value", "type": "uint256"}, ], "outputs": [{"name": "", "type": "bool"}], } ] contract = w3.eth.contract(address=token_address, abi=min_abi) return contract.encodeABI("transfer", [to_address, amount]) ##################### # # commands start here @click.group(name="ethereum") def cli(): """Ethereum commands.""" @cli.command() @click.option("-n", "--address", required=True, help=PATH_HELP) @click.option("-d", "--show-display", is_flag=True) @click.pass_obj def get_address(connect, address, show_display): """Get Ethereum address in hex encoding.""" client = connect() address_n = tools.parse_path(address) return ethereum.get_address(client, address_n, show_display) @cli.command() @click.option("-n", "--address", required=True, help=PATH_HELP) @click.option("-d", "--show-display", is_flag=True) @click.pass_obj def get_public_node(connect, address, show_display): """Get Ethereum public node of given path.""" client = connect() address_n = tools.parse_path(address) result = ethereum.get_public_node(client, address_n, show_display=show_display) return { "node": { "depth": result.node.depth, "fingerprint": "%08x" % result.node.fingerprint, "child_num": result.node.child_num, "chain_code": result.node.chain_code.hex(), "public_key": result.node.public_key.hex(), }, "xpub": result.xpub, } @cli.command() @click.option( "-c", "--chain-id", type=int, default=1, help="EIP-155 chain id (replay protection)" ) @click.option("-n", "--address", required=True, help=PATH_HELP) @click.option( "-g", "--gas-limit", type=int, help="Gas limit (required for offline signing)" ) @click.option( "-t", "--gas-price", help="Gas price (required for offline signing)", callback=_amount_to_int, ) @click.option( "-i", "--nonce", type=int, help="Transaction counter (required for offline signing)" ) @click.option("-d", "--data", help="Data as hex string, e.g. 0x12345678") @click.option("-p", "--publish", is_flag=True, help="Publish transaction via RPC") @click.option("-x", "--tx-type", type=int, help="TX type (used only for Wanchain)") @click.option("-t", "--token", help="ERC20 token address") @click.option( "--list-units", is_flag=True, help="List known currency units and exit.", is_eager=True, callback=_list_units, expose_value=False, ) @click.argument("to_address") @click.argument("amount", callback=_amount_to_int) @click.pass_obj def sign_tx( connect, chain_id, address, amount, gas_limit, gas_price, nonce, data, publish, to_address, tx_type, token, ): """Sign (and optionally publish) Ethereum transaction. Use TO_ADDRESS as destination address, or set to "" for contract creation. Specify a contract address with the --token option to send an ERC20 token. You can specify AMOUNT and gas price either as a number of wei, or you can use a unit suffix. Use the --list-units option to show all known currency units. ERC20 token amounts are specified in eth/wei, custom units are not supported. If any of gas price, gas limit and nonce is not specified, this command will try to connect to an ethereum node and auto-fill these values. You can configure the connection with WEB3_PROVIDER_URI environment variable. """ if not HAVE_SIGN_TX: click.echo("Ethereum requirements not installed.") click.echo("Please run:") click.echo() click.echo(" pip install web3 rlp") sys.exit(1) w3 = web3.Web3() if ( any(x is None for x in (gas_price, gas_limit, nonce)) or publish and not w3.isConnected() ): click.echo("Failed to connect to Ethereum node.") click.echo( "If you want to sign offline, make sure you provide --gas-price, " "--gas-limit and --nonce arguments" ) sys.exit(1) if data is not None and token is not None: click.echo("Can't send tokens and custom data at the same time") sys.exit(1) client = connect() address_n = tools.parse_path(address) from_address = ethereum.get_address(client, address_n) if token: data = _erc20_contract(w3, token, to_address, amount) to_address = token amount = 0 if data: data = _decode_hex(data) else: data = b"" if gas_price is None: gas_price = w3.eth.gasPrice if gas_limit is None: gas_limit = w3.eth.estimateGas( { "to": to_address, "from": from_address, "value": amount, "data": "0x%s" % data.hex(), } ) if nonce is None: nonce = w3.eth.getTransactionCount(from_address) sig = ethereum.sign_tx( client, n=address_n, tx_type=tx_type, nonce=nonce, gas_price=gas_price, gas_limit=gas_limit, to=to_address, value=amount, data=data, chain_id=chain_id, ) to = _decode_hex(to_address) if tx_type is None: transaction = rlp.encode((nonce, gas_price, gas_limit, to, amount, data) + sig) else: transaction = rlp.encode( (tx_type, nonce, gas_price, gas_limit, to, amount, data) + sig ) tx_hex = "0x%s" % transaction.hex() if publish: tx_hash = w3.eth.sendRawTransaction(tx_hex).hex() return "Transaction published with ID: %s" % tx_hash else: return "Signed raw transaction:\n%s" % tx_hex @cli.command() @click.option("-n", "--address", required=True, help=PATH_HELP) @click.argument("message") @click.pass_obj def sign_message(connect, address, message): """Sign message with Ethereum address.""" client = connect() address_n = tools.parse_path(address) ret = ethereum.sign_message(client, address_n, message) output = { "message": message, "address": ret.address, "signature": "0x%s" % ret.signature.hex(), } return output @cli.command() @click.argument("address") @click.argument("signature") @click.argument("message") @click.pass_obj def verify_message(connect, address, signature, message): """Verify message signed with Ethereum address.""" signature = _decode_hex(signature) return ethereum.verify_message(connect(), address, signature, message) python-trezor-0.11.6/src/trezorlib/cli/fido.py000066400000000000000000000071731361427340300213230ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . import click from .. import fido @click.group(name="fido") def cli(): """FIDO2, U2F and WebAuthN management commands.""" @cli.group() def credentials(): """Manage FIDO2 resident credentials.""" @credentials.command(name="list") @click.pass_obj def credentials_list(connect): """List all resident credentials on the device.""" creds = fido.list_credentials(connect()) for cred in creds: click.echo("") click.echo("WebAuthn credential at index {}:".format(cred.index)) if cred.rp_id is not None: click.echo(" Relying party ID: {}".format(cred.rp_id)) if cred.rp_name is not None: click.echo(" Relying party name: {}".format(cred.rp_name)) if cred.user_id is not None: click.echo(" User ID: {}".format(cred.user_id.hex())) if cred.user_name is not None: click.echo(" User name: {}".format(cred.user_name)) if cred.user_display_name is not None: click.echo(" User display name: {}".format(cred.user_display_name)) if cred.creation_time is not None: click.echo(" Creation time: {}".format(cred.creation_time)) if cred.hmac_secret is not None: click.echo(" hmac-secret enabled: {}".format(cred.hmac_secret)) if cred.use_sign_count is not None: click.echo(" Use signature counter: {}".format(cred.use_sign_count)) click.echo(" Credential ID: {}".format(cred.id.hex())) if not creds: click.echo("There are no resident credentials stored on the device.") @credentials.command(name="add") @click.argument("hex_credential_id") @click.pass_obj def credentials_add(connect, hex_credential_id): """Add the credential with the given ID as a resident credential. HEX_CREDENTIAL_ID is the credential ID as a hexadecimal string. """ return fido.add_credential(connect(), bytes.fromhex(hex_credential_id)) @credentials.command(name="remove") @click.option( "-i", "--index", required=True, type=click.IntRange(0, 99), help="Credential index." ) @click.pass_obj def credentials_remove(connect, index): """Remove the resident credential at the given index.""" return fido.remove_credential(connect(), index) # # FIDO counter operations # @cli.group() def counter(): """Get or set the FIDO/U2F counter value.""" @counter.command(name="set") @click.argument("counter", type=int) @click.pass_obj def counter_set(connect, counter): """Set FIDO/U2F counter value.""" return fido.set_counter(connect(), counter) @counter.command(name="get-next") @click.pass_obj def counter_get_next(connect): """Get-and-increase value of FIDO/U2F counter. FIDO counter value cannot be read directly. On each U2F exchange, the counter value is returned and atomically increased. This command performs the same operation and returns the counter value. """ return fido.get_next_counter(connect()) python-trezor-0.11.6/src/trezorlib/cli/firmware.py000066400000000000000000000240171361427340300222120ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . import sys import click import requests from .. import exceptions, firmware ALLOWED_FIRMWARE_FORMATS = { 1: (firmware.FirmwareFormat.TREZOR_ONE, firmware.FirmwareFormat.TREZOR_ONE_V2), 2: (firmware.FirmwareFormat.TREZOR_T,), } def _print_version(version): vstr = "Firmware version {major}.{minor}.{patch} build {build}".format(**version) click.echo(vstr) def validate_firmware(version, fw, expected_fingerprint=None): if version == firmware.FirmwareFormat.TREZOR_ONE: if fw.embedded_onev2: click.echo("Trezor One firmware with embedded v2 image (1.8.0 or later)") _print_version(fw.embedded_onev2.firmware_header.version) else: click.echo("Trezor One firmware image.") elif version == firmware.FirmwareFormat.TREZOR_ONE_V2: click.echo("Trezor One v2 firmware (1.8.0 or later)") _print_version(fw.firmware_header.version) elif version == firmware.FirmwareFormat.TREZOR_T: click.echo("Trezor T firmware image.") vendor = fw.vendor_header.vendor_string vendor_version = "{major}.{minor}".format(**fw.vendor_header.version) click.echo("Vendor header from {}, version {}".format(vendor, vendor_version)) _print_version(fw.firmware_header.version) try: firmware.validate(version, fw, allow_unsigned=False) click.echo("Signatures are valid.") except firmware.Unsigned: if not click.confirm("No signatures found. Continue?", default=False): sys.exit(1) try: firmware.validate(version, fw, allow_unsigned=True) click.echo("Unsigned firmware looking OK.") except firmware.FirmwareIntegrityError as e: click.echo(e) click.echo("Firmware validation failed, aborting.") sys.exit(4) except firmware.FirmwareIntegrityError as e: click.echo(e) click.echo("Firmware validation failed, aborting.") sys.exit(4) fingerprint = firmware.digest(version, fw).hex() click.echo("Firmware fingerprint: {}".format(fingerprint)) if expected_fingerprint and fingerprint != expected_fingerprint: click.echo("Expected fingerprint: {}".format(expected_fingerprint)) click.echo("Fingerprints do not match, aborting.") sys.exit(5) def find_best_firmware_version( bootloader_version, requested_version=None, beta=False, bitcoin_only=False ): if beta: url = "https://beta-wallet.trezor.io/data/firmware/{}/releases.json" else: url = "https://wallet.trezor.io/data/firmware/{}/releases.json" releases = requests.get(url.format(bootloader_version[0])).json() if not releases: raise click.ClickException("Failed to get list of releases") if bitcoin_only: releases = [r for r in releases if "url_bitcoinonly" in r] releases.sort(key=lambda r: r["version"], reverse=True) def version_str(version): return ".".join(map(str, version)) want_version = requested_version if want_version is None: want_version = releases[0]["version"] click.echo("Best available version: {}".format(version_str(want_version))) confirm_different_version = False while True: want_version_str = version_str(want_version) try: release = next(r for r in releases if r["version"] == want_version) except StopIteration: click.echo("Version {} not found.".format(want_version_str)) sys.exit(1) if ( "min_bootloader_version" in release and release["min_bootloader_version"] > bootloader_version ): need_version_str = version_str(release["min_firmware_version"]) click.echo( "Version {} is required before upgrading to {}.".format( need_version_str, want_version_str ) ) want_version = release["min_firmware_version"] confirm_different_version = True else: break if confirm_different_version: installing_different = "Installing version {} instead.".format(want_version_str) if requested_version is None: click.echo(installing_different) else: ok = click.confirm(installing_different + " Continue?", default=True) if not ok: sys.exit(1) if bitcoin_only: url = release["url_bitcoinonly"] fingerprint = release["fingerprint_bitcoinonly"] else: url = release["url"] fingerprint = release["fingerprint"] if beta: url = "https://beta-wallet.trezor.io/" + url else: url = "https://wallet.trezor.io/" + url return url, fingerprint @click.command() # fmt: off @click.option("-f", "--filename") @click.option("-u", "--url") @click.option("-v", "--version") @click.option("-s", "--skip-check", is_flag=True, help="Do not validate firmware integrity") @click.option("-n", "--dry-run", is_flag=True, help="Perform all steps but do not actually upload the firmware") @click.option("--beta", is_flag=True, help="Use firmware from BETA wallet") @click.option("--bitcoin-only", is_flag=True, help="Use bitcoin-only firmware (if possible)") @click.option("--raw", is_flag=True, help="Push raw data to Trezor") @click.option("--fingerprint", help="Expected firmware fingerprint in hex") @click.option("--skip-vendor-header", help="Skip vendor header validation on Trezor T") # fmt: on @click.pass_obj def firmware_update( connect, filename, url, version, skip_check, fingerprint, skip_vendor_header, raw, dry_run, beta, bitcoin_only, ): """Upload new firmware to device. Device must be in bootloader mode. You can specify a filename or URL from which the firmware can be downloaded. You can also explicitly specify a firmware version that you want. Otherwise, trezorctl will attempt to find latest available version from wallet.trezor.io. If you provide a fingerprint via the --fingerprint option, it will be checked against downloaded firmware fingerprint. Otherwise fingerprint is checked against wallet.trezor.io information, if available. If you are customizing Model T bootloader and providing your own vendor header, you can use --skip-vendor-header to ignore vendor header signatures. """ if sum(bool(x) for x in (filename, url, version)) > 1: click.echo("You can use only one of: filename, url, version.") sys.exit(1) client = connect() if not dry_run and not client.features.bootloader_mode: click.echo("Please switch your device to bootloader mode.") sys.exit(1) f = client.features bootloader_onev2 = f.major_version == 1 and f.minor_version >= 8 if filename: data = open(filename, "rb").read() else: if not url: bootloader_version = [f.major_version, f.minor_version, f.patch_version] version_list = [int(x) for x in version.split(".")] if version else None url, fp = find_best_firmware_version( bootloader_version, version_list, beta, bitcoin_only ) if not fingerprint: fingerprint = fp try: click.echo("Downloading from {}".format(url)) r = requests.get(url) r.raise_for_status() except requests.exceptions.HTTPError as err: click.echo("Error downloading file: {}".format(err)) sys.exit(3) data = r.content if not raw and not skip_check: try: version, fw = firmware.parse(data) except Exception as e: click.echo(e) sys.exit(2) validate_firmware(version, fw, fingerprint) if ( bootloader_onev2 and version == firmware.FirmwareFormat.TREZOR_ONE and not fw.embedded_onev2 ): click.echo("Firmware is too old for your device. Aborting.") sys.exit(3) elif not bootloader_onev2 and version == firmware.FirmwareFormat.TREZOR_ONE_V2: click.echo("You need to upgrade to bootloader 1.8.0 first.") sys.exit(3) if f.major_version not in ALLOWED_FIRMWARE_FORMATS: click.echo("trezorctl doesn't know your device version. Aborting.") sys.exit(3) elif version not in ALLOWED_FIRMWARE_FORMATS[f.major_version]: click.echo("Firmware does not match your device, aborting.") sys.exit(3) if not raw: # special handling for embedded-OneV2 format: # for bootloader < 1.8, keep the embedding # for bootloader 1.8.0 and up, strip the old OneV1 header if bootloader_onev2 and data[:4] == b"TRZR" and data[256 : 256 + 4] == b"TRZF": click.echo("Extracting embedded firmware image (fingerprint may change).") data = data[256:] if dry_run: click.echo("Dry run. Not uploading firmware to device.") else: try: if f.major_version == 1 and f.firmware_present is not False: # Trezor One does not send ButtonRequest click.echo("Please confirm the action on your Trezor device") return firmware.update(client, data) except exceptions.Cancelled: click.echo("Update aborted on device.") except exceptions.TrezorException as e: click.echo("Update failed: {}".format(e)) sys.exit(3) python-trezor-0.11.6/src/trezorlib/cli/lisk.py000066400000000000000000000060061361427340300213360ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . import json import click from .. import lisk, tools PATH_HELP = "BIP-32 path, e.g. m/44'/134'/0'/0'" @click.group(name="lisk") def cli(): """Lisk commands.""" @cli.command() @click.option("-n", "--address", required=True, help=PATH_HELP) @click.option("-d", "--show-display", is_flag=True) @click.pass_obj def get_address(connect, address, show_display): """Get Lisk address for specified path.""" client = connect() address_n = tools.parse_path(address) return lisk.get_address(client, address_n, show_display) @cli.command() @click.option("-n", "--address", required=True, help=PATH_HELP) @click.option("-d", "--show-display", is_flag=True) @click.pass_obj def get_public_key(connect, address, show_display): """Get Lisk public key for specified path.""" client = connect() address_n = tools.parse_path(address) res = lisk.get_public_key(client, address_n, show_display) output = {"public_key": res.public_key.hex()} return output @cli.command() @click.option("-n", "--address", required=True, help=PATH_HELP) @click.option( "-f", "--file", type=click.File("r"), default="-", help="Transaction in JSON format" ) # @click.option('-b', '--broadcast', help='Broadcast Lisk transaction') @click.pass_obj def sign_tx(connect, address, file): """Sign Lisk transaction.""" client = connect() address_n = tools.parse_path(address) transaction = lisk.sign_tx(client, address_n, json.load(file)) payload = {"signature": transaction.signature.hex()} return payload @cli.command() @click.option("-n", "--address", required=True, help=PATH_HELP) @click.argument("message") @click.pass_obj def sign_message(connect, address, message): """Sign message with Lisk address.""" client = connect() address_n = client.expand_path(address) res = lisk.sign_message(client, address_n, message) output = { "message": message, "public_key": res.public_key.hex(), "signature": res.signature.hex(), } return output @cli.command() @click.argument("pubkey") @click.argument("signature") @click.argument("message") @click.pass_obj def verify_message(connect, pubkey, signature, message): """Verify message signed with Lisk address.""" signature = bytes.fromhex(signature) pubkey = bytes.fromhex(pubkey) return lisk.verify_message(connect(), pubkey, signature, message) python-trezor-0.11.6/src/trezorlib/cli/monero.py000066400000000000000000000036231361427340300216750ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . import click from .. import monero, tools PATH_HELP = "BIP-32 path, e.g. m/44'/128'/0'" @click.group(name="monero") def cli(): """Monero commands.""" @cli.command() @click.option("-n", "--address", required=True, help=PATH_HELP) @click.option("-d", "--show-display", is_flag=True) @click.option( "-t", "--network-type", type=click.Choice(["0", "1", "2", "3"]), default="0" ) @click.pass_obj def get_address(connect, address, show_display, network_type): """Get Monero address for specified path.""" client = connect() address_n = tools.parse_path(address) network_type = int(network_type) return monero.get_address(client, address_n, show_display, network_type) @cli.command() @click.option("-n", "--address", required=True, help=PATH_HELP) @click.option( "-t", "--network-type", type=click.Choice(["0", "1", "2", "3"]), default="0" ) @click.pass_obj def get_watch_key(connect, address, network_type): """Get Monero watch key for specified path.""" client = connect() address_n = tools.parse_path(address) network_type = int(network_type) res = monero.get_watch_key(client, address_n, network_type) output = {"address": res.address.decode(), "watch_key": res.watch_key.hex()} return output python-trezor-0.11.6/src/trezorlib/cli/nem.py000066400000000000000000000041111361427340300211460ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . import json import click import requests from .. import nem, tools PATH_HELP = "BIP-32 path, e.g. m/44'/134'/0'/0'" @click.group(name="nem") def cli(): """NEM commands.""" @cli.command() @click.option("-n", "--address", required=True, help=PATH_HELP) @click.option("-N", "--network", type=int, default=0x68) @click.option("-d", "--show-display", is_flag=True) @click.pass_obj def get_address(connect, address, network, show_display): """Get NEM address for specified path.""" client = connect() address_n = tools.parse_path(address) return nem.get_address(client, address_n, network, show_display) @cli.command() @click.option("-n", "--address", required=True, help=PATH_HELP) @click.option( "-f", "--file", type=click.File("r"), default="-", help="Transaction in NIS (RequestPrepareAnnounce) format", ) @click.option("-b", "--broadcast", help="NIS to announce transaction to") @click.pass_obj def sign_tx(connect, address, file, broadcast): """Sign (and optionally broadcast) NEM transaction.""" client = connect() address_n = tools.parse_path(address) transaction = nem.sign_tx(client, address_n, json.load(file)) payload = {"data": transaction.data.hex(), "signature": transaction.signature.hex()} if broadcast: return requests.post( "{}/transaction/announce".format(broadcast), json=payload ).json() else: return payload python-trezor-0.11.6/src/trezorlib/cli/ripple.py000066400000000000000000000034701361427340300216710ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . import json import click from .. import ripple, tools PATH_HELP = "BIP-32 path to key, e.g. m/44'/144'/0'/0/0" @click.group(name="ripple") def cli(): """Ripple commands.""" @cli.command() @click.option("-n", "--address", required=True, help=PATH_HELP) @click.option("-d", "--show-display", is_flag=True) @click.pass_obj def get_address(connect, address, show_display): """Get Ripple address""" client = connect() address_n = tools.parse_path(address) return ripple.get_address(client, address_n, show_display) @cli.command() @click.option("-n", "--address", required=True, help=PATH_HELP) @click.option( "-f", "--file", type=click.File("r"), default="-", help="Transaction in JSON format" ) @click.pass_obj def sign_tx(connect, address, file): """Sign Ripple transaction""" client = connect() address_n = tools.parse_path(address) msg = ripple.create_sign_tx_msg(json.load(file)) result = ripple.sign_tx(client, address_n, msg) click.echo("Signature:") click.echo(result.signature.hex()) click.echo() click.echo("Serialized tx including the signature:") click.echo(result.serialized_tx.hex()) python-trezor-0.11.6/src/trezorlib/cli/settings.py000066400000000000000000000116751361427340300222440ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . import click from .. import device, messages from . import ChoiceType PASSPHRASE_SOURCE = { "ask": messages.PassphraseSourceType.ASK, "device": messages.PassphraseSourceType.DEVICE, "host": messages.PassphraseSourceType.HOST, } ROTATION = {"north": 0, "east": 90, "south": 180, "west": 270} @click.group(name="set") def cli(): """Device settings.""" @cli.command() @click.option("-r", "--remove", is_flag=True) @click.pass_obj def pin(connect, remove): """Set, change or remove PIN.""" return device.change_pin(connect(), remove) @cli.command() @click.option("-r", "--remove", is_flag=True) @click.pass_obj def wipe_code(connect, remove): """Set or remove the wipe code. The wipe code functions as a "self-destruct PIN". If the wipe code is ever entered into any PIN entry dialog, then all private data will be immediately removed and the device will be reset to factory defaults. """ return device.change_wipe_code(connect(), remove) @cli.command() # keep the deprecated -l/--label option, make it do nothing @click.option("-l", "--label", "_ignore", is_flag=True, hidden=True, expose_value=False) @click.argument("label") @click.pass_obj def label(connect, label): """Set new device label.""" return device.apply_settings(connect(), label=label) @cli.command() @click.argument("rotation", type=ChoiceType(ROTATION)) @click.pass_obj def display_rotation(connect, rotation): """Set display rotation. Configure display rotation for Trezor Model T. The options are north, east, south or west. """ return device.apply_settings(connect(), display_rotation=rotation) @cli.command() @click.argument("delay", type=str) @click.pass_obj def auto_lock_delay(connect, delay): """Set auto-lock delay (in seconds).""" value, unit = delay[:-1], delay[-1:] units = {"s": 1, "m": 60, "h": 3600} if unit in units: seconds = float(value) * units[unit] else: seconds = float(delay) # assume seconds if no unit is specified return device.apply_settings(connect(), auto_lock_delay_ms=int(seconds * 1000)) @cli.command() @click.argument("flags") @click.pass_obj def flags(connect, flags): """Set device flags.""" flags = flags.lower() if flags.startswith("0b"): flags = int(flags, 2) elif flags.startswith("0x"): flags = int(flags, 16) else: flags = int(flags) return device.apply_flags(connect(), flags=flags) @cli.command() @click.option("-f", "--filename", default=None) @click.pass_obj def homescreen(connect, filename): """Set new homescreen.""" if filename is None: img = b"\x00" elif filename.endswith(".toif"): img = open(filename, "rb").read() if img[:8] != b"TOIf\x90\x00\x90\x00": raise click.ClickException("File is not a TOIF file with size of 144x144") else: from PIL import Image im = Image.open(filename) if im.size != (128, 64): raise click.ClickException("Wrong size of the image") im = im.convert("1") pix = im.load() img = bytearray(1024) for j in range(64): for i in range(128): if pix[i, j]: o = i + j * 128 img[o // 8] |= 1 << (7 - o % 8) img = bytes(img) return device.apply_settings(connect(), homescreen=img) # # passphrase operations # @cli.group() def passphrase(): """Enable, disable or configure passphrase protection.""" @passphrase.command(name="enabled") @click.pass_obj def passphrase_enable(connect): """Enable passphrase.""" return device.apply_settings(connect(), use_passphrase=True) @passphrase.command(name="disabled") @click.pass_obj def passphrase_disable(connect): """Disable passphrase.""" return device.apply_settings(connect(), use_passphrase=False) @passphrase.command(name="source") @click.argument("source", type=ChoiceType(PASSPHRASE_SOURCE)) @click.pass_obj def passphrase_source(connect, source): """Set passphrase source. Configure how to enter passphrase on Trezor Model T. The options are: \b ask - always ask where to enter passphrase device - always enter passphrase on device host - always enter passphrase on host """ return device.apply_settings(connect(), passphrase_source=source) python-trezor-0.11.6/src/trezorlib/cli/stellar.py000066400000000000000000000042321361427340300220410ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . import base64 import click from .. import stellar, tools PATH_HELP = "BIP32 path. Always use hardened paths and the m/44'/148'/ prefix" @click.group(name="stellar") def cli(): """Stellar commands.""" @cli.command() @click.option( "-n", "--address", required=False, help=PATH_HELP, default=stellar.DEFAULT_BIP32_PATH, ) @click.option("-d", "--show-display", is_flag=True) @click.pass_obj def get_address(connect, address, show_display): """Get Stellar public address.""" client = connect() address_n = tools.parse_path(address) return stellar.get_address(client, address_n, show_display) @cli.command() @click.option( "-n", "--address", required=False, help=PATH_HELP, default=stellar.DEFAULT_BIP32_PATH, ) @click.option( "-n", "--network-passphrase", default=stellar.DEFAULT_NETWORK_PASSPHRASE, required=False, help="Network passphrase (blank for public network).", ) @click.argument("b64envelope") @click.pass_obj def sign_transaction(connect, b64envelope, address, network_passphrase): """Sign a base64-encoded transaction envelope. For testnet transactions, use the following network passphrase: 'Test SDF Network ; September 2015' """ client = connect() address_n = tools.parse_path(address) tx, operations = stellar.parse_transaction_bytes(base64.b64decode(b64envelope)) resp = stellar.sign_tx(client, tx, operations, address_n, network_passphrase) return base64.b64encode(resp.signature) python-trezor-0.11.6/src/trezorlib/cli/tezos.py000066400000000000000000000041051361427340300215360ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . import json import click from .. import messages, protobuf, tezos, tools PATH_HELP = "BIP-32 path, e.g. m/44'/1729'/0'" @click.group(name="tezos") def cli(): """Tezos commands.""" @cli.command() @click.option("-n", "--address", required=True, help=PATH_HELP) @click.option("-d", "--show-display", is_flag=True) @click.pass_obj def get_address(connect, address, show_display): """Get Tezos address for specified path.""" client = connect() address_n = tools.parse_path(address) return tezos.get_address(client, address_n, show_display) @cli.command() @click.option("-n", "--address", required=True, help=PATH_HELP) @click.option("-d", "--show-display", is_flag=True) @click.pass_obj def get_public_key(connect, address, show_display): """Get Tezos public key.""" client = connect() address_n = tools.parse_path(address) return tezos.get_public_key(client, address_n, show_display) @cli.command() @click.option("-n", "--address", required=True, help=PATH_HELP) @click.option( "-f", "--file", type=click.File("r"), default="-", help="Transaction in JSON format (byte fields should be hexlified)", ) @click.pass_obj def sign_tx(connect, address, file): """Sign Tezos transaction.""" client = connect() address_n = tools.parse_path(address) msg = protobuf.dict_to_proto(messages.TezosSignTx, json.load(file)) return tezos.sign_tx(client, address_n, msg) python-trezor-0.11.6/src/trezorlib/cli/trezorctl.py000077500000000000000000000173351361427340300224360ustar00rootroot00000000000000#!/usr/bin/env python3 # This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . import json import os import sys import click from .. import coins, log, messages, protobuf, ui from ..client import TrezorClient from ..transport import enumerate_devices, get_transport from . import ( binance, btc, cardano, cosi, crypto, device, eos, ethereum, fido, firmware, lisk, monero, nem, ripple, settings, stellar, tezos, ) COMMAND_ALIASES = { "change-pin": settings.pin, "enable-passphrase": settings.passphrase_enable, "disable-passphrase": settings.passphrase_disable, "set-passphrase-source": settings.passphrase_source, "wipe-device": device.wipe, "reset-device": device.setup, "recovery-device": device.recover, "backup-device": device.backup, "sd-protect": device.sd_protect, "load-device": device.load, "self-test": device.self_test, "get-entropy": crypto.get_entropy, "encrypt-keyvalue": crypto.encrypt_keyvalue, "decrypt-keyvalue": crypto.decrypt_keyvalue, # currency name aliases: "bnb": binance.cli, "eth": ethereum.cli, "ada": cardano.cli, "lsk": lisk.cli, "xmr": monero.cli, "xrp": ripple.cli, "xlm": stellar.cli, "xtz": tezos.cli, } class TrezorctlGroup(click.Group): """Command group that handles compatibility for trezorctl. The purpose is twofold: convert underscores to dashes, and ensure old-style commands still work with new-style groups. Click 7.0 silently switched all underscore_commands to dash-commands. This implementation of `click.Group` responds to underscore_commands by invoking the respective dash-command. With trezorctl 0.11.5, we started to convert old-style long commands (such as "binance-sign-tx") to command groups ("binance") with subcommands ("sign-tx"). The `TrezorctlGroup` can perform subcommand lookup: if a command "binance-sign-tx" does not exist in the default group, it tries to find "sign-tx" subcommand of "binance" group. """ def get_command(self, ctx, cmd_name): cmd_name = cmd_name.replace("_", "-") # try to look up the real name cmd = super().get_command(ctx, cmd_name) if cmd: return cmd # look for a backwards compatibility alias if cmd_name in COMMAND_ALIASES: return COMMAND_ALIASES[cmd_name] # look for subcommand in btc - "sign-tx" is now "btc sign-tx" cmd = btc.cli.get_command(ctx, cmd_name) if cmd: return cmd # Old-style top-level commands looked like this: binance-sign-tx. # We are moving to 'binance' command with 'sign-tx' subcommand. try: command, subcommand = cmd_name.split("-", maxsplit=1) return super().get_command(ctx, command).get_command(ctx, subcommand) except Exception: pass # try to find a bitcoin-like coin whose shortcut matches the command for coin in coins.coins_list: if cmd_name.lower() == coin["shortcut"].lower(): btc.DEFAULT_COIN = coin["coin_name"] return btc.cli return None def configure_logging(verbose: int): if verbose: log.enable_debug_output(verbose) log.OMITTED_MESSAGES.add(messages.Features) @click.command(cls=TrezorctlGroup, context_settings={"max_content_width": 400}) @click.option( "-p", "--path", help="Select device by specific path.", default=os.environ.get("TREZOR_PATH"), ) @click.option("-v", "--verbose", count=True, help="Show communication messages.") @click.option( "-j", "--json", "is_json", is_flag=True, help="Print result as JSON object" ) @click.version_option() @click.pass_context def cli(ctx, path, verbose, is_json): configure_logging(verbose) def get_device(): try: device = get_transport(path, prefix_search=False) except Exception: try: device = get_transport(path, prefix_search=True) except Exception: click.echo("Failed to find a Trezor device.") if path is not None: click.echo("Using path: {}".format(path)) sys.exit(1) return TrezorClient(transport=device, ui=ui.ClickUI()) ctx.obj = get_device @cli.resultcallback() def print_result(res, path, verbose, is_json): if is_json: if isinstance(res, protobuf.MessageType): click.echo(json.dumps({res.__class__.__name__: res.__dict__})) else: click.echo(json.dumps(res, sort_keys=True, indent=4)) else: if isinstance(res, list): for line in res: click.echo(line) elif isinstance(res, dict): for k, v in res.items(): if isinstance(v, dict): for kk, vv in v.items(): click.echo("%s.%s: %s" % (k, kk, vv)) else: click.echo("%s: %s" % (k, v)) elif isinstance(res, protobuf.MessageType): click.echo(protobuf.format_message(res)) else: click.echo(res) # # Common functions # @cli.command(name="list") def list_devices(): """List connected Trezor devices.""" return enumerate_devices() @cli.command() def version(): """Show version of trezorctl/trezorlib.""" from trezorlib import __version__ as VERSION return VERSION # # Basic device functions # @cli.command() @click.argument("message") @click.option("-b", "--button-protection", is_flag=True) @click.option("-p", "--pin-protection", is_flag=True) @click.option("-r", "--passphrase-protection", is_flag=True) @click.pass_obj def ping(connect, message, button_protection, pin_protection, passphrase_protection): """Send ping message.""" return connect().ping( message, button_protection=button_protection, pin_protection=pin_protection, passphrase_protection=passphrase_protection, ) @cli.command() @click.pass_obj def clear_session(connect): """Clear session (remove cached PIN, passphrase, etc.).""" return connect().clear_session() @cli.command() @click.pass_obj def get_features(connect): """Retrieve device features and settings.""" return connect().features @cli.command() def usb_reset(): """Perform USB reset on stuck devices. This can fix LIBUSB_ERROR_PIPE and similar errors when connecting to a device in a messed state. """ from trezorlib.transport.webusb import WebUsbTransport WebUsbTransport.enumerate(usb_reset=True) # # Basic coin functions # cli.add_command(binance.cli) cli.add_command(btc.cli) cli.add_command(cardano.cli) cli.add_command(cosi.cli) cli.add_command(crypto.cli) cli.add_command(device.cli) cli.add_command(eos.cli) cli.add_command(ethereum.cli) cli.add_command(fido.cli) cli.add_command(lisk.cli) cli.add_command(monero.cli) cli.add_command(nem.cli) cli.add_command(ripple.cli) cli.add_command(settings.cli) cli.add_command(stellar.cli) cli.add_command(tezos.cli) cli.add_command(firmware.firmware_update) # # Main # if __name__ == "__main__": cli() # pylint: disable=E1120 python-trezor-0.11.6/src/trezorlib/client.py000066400000000000000000000336001361427340300211030ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . import logging import sys import warnings from types import SimpleNamespace from mnemonic import Mnemonic from . import MINIMUM_FIRMWARE_VERSION, exceptions, messages, tools if sys.version_info.major < 3: raise Exception("Trezorlib does not support Python 2 anymore.") LOG = logging.getLogger(__name__) VENDORS = ("bitcointrezor.com", "trezor.io") MAX_PASSPHRASE_LENGTH = 50 DEPRECATION_ERROR = """ Incompatible Trezor library detected. (Original error: {}) """.strip() OUTDATED_FIRMWARE_ERROR = """ Your Trezor firmware is out of date. Update it with the following command: trezorctl firmware-update Or visit https://wallet.trezor.io/ """.strip() def _no_ui_selected(*args, **kwargs): raise RuntimeError( "You did not supply a UI object. You were warned that this would crash soon. " "That's what happened now.\n " "You need to supply a UI object to TrezorClient constructor." ) _NO_UI_OBJECT = SimpleNamespace( button_request=_no_ui_selected, get_passphrase=_no_ui_selected, get_pin=_no_ui_selected, ) def get_buttonrequest_value(code): # Converts integer code to its string representation of ButtonRequestType return [ k for k in dir(messages.ButtonRequestType) if getattr(messages.ButtonRequestType, k) == code ][0] 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) class TrezorClient: """Trezor client, a connection to a Trezor device. This class allows you to manage connection state, send and receive protobuf messages, handle user interactions, and perform some generic tasks (send a cancel message, initialize or clear a session, ping the device). You have to provide a transport, i.e., a raw connection to the device. You can use `trezorlib.transport.get_transport` to find one. You have to provide an UI implementation for the three kinds of interaction: - button request (notify the user that their interaction is needed) - PIN request (on T1, ask the user to input numbers for a PIN matrix) - passphrase request (ask the user to enter a passphrase) See `trezorlib.ui` for details. You can supply a `state` you saved in the previous session. If you do, the user might not need to enter their passphrase again. """ def __init__(self, transport, ui=_NO_UI_OBJECT, state=None): LOG.info("creating client instance for device: {}".format(transport.get_path())) self.transport = transport self.ui = ui self.state = state # XXX remove when old Electrum has been cycled out. # explanation: We changed the API in 0.11 and this broke older versions # of Electrum (incl. all its forks). We want to display an intelligent error # message instead of crashing for no reason (see DEPRECATION_ERROR and MovedTo), # so we are not allowed to crash in constructor. # I'd keep this until, say, end of 2019 (or version 0.12), and then drop # the default value for `ui` argument and all related functionality. if ui is _NO_UI_OBJECT: warnings.warn("UI object not supplied. This will probably crash soon.") self.session_counter = 0 self.init_device() def open(self): if self.session_counter == 0: self.transport.begin_session() self.session_counter += 1 def close(self): self.session_counter = max(self.session_counter - 1, 0) if self.session_counter == 0: self.transport.end_session() def cancel(self): self._raw_write(messages.Cancel()) def call_raw(self, msg): __tracebackhide__ = True # for pytest # pylint: disable=W0612 self._raw_write(msg) return self._raw_read() def _raw_write(self, msg): __tracebackhide__ = True # for pytest # pylint: disable=W0612 self.transport.write(msg) def _raw_read(self): __tracebackhide__ = True # for pytest # pylint: disable=W0612 return self.transport.read() def _callback_pin(self, msg): try: pin = self.ui.get_pin(msg.type) except exceptions.Cancelled: self.call_raw(messages.Cancel()) raise if not pin.isdigit(): self.call_raw(messages.Cancel()) raise ValueError("Non-numeric PIN provided") resp = self.call_raw(messages.PinMatrixAck(pin=pin)) if isinstance(resp, messages.Failure) and resp.code in ( messages.FailureType.PinInvalid, messages.FailureType.PinCancelled, messages.FailureType.PinExpected, ): raise exceptions.PinException(resp.code, resp.message) else: return resp def _callback_passphrase(self, msg): if msg.on_device: passphrase = None else: try: passphrase = self.ui.get_passphrase() except exceptions.Cancelled: self.call_raw(messages.Cancel()) raise passphrase = Mnemonic.normalize_string(passphrase) if len(passphrase) > MAX_PASSPHRASE_LENGTH: self.call_raw(messages.Cancel()) raise ValueError("Passphrase too long") resp = self.call_raw( messages.PassphraseAck(passphrase=passphrase, state=self.state) ) if isinstance(resp, messages.PassphraseStateRequest): # TODO report to the user that the passphrase has changed? self.state = resp.state return self.call_raw(messages.PassphraseStateAck()) else: return resp def _callback_button(self, msg): __tracebackhide__ = True # for pytest # pylint: disable=W0612 # do this raw - send ButtonAck first, notify UI later self._raw_write(messages.ButtonAck()) self.ui.button_request(msg.code) return self._raw_read() @tools.session def call(self, msg): self.check_firmware_version() resp = self.call_raw(msg) while True: if isinstance(resp, messages.PinMatrixRequest): resp = self._callback_pin(resp) elif isinstance(resp, messages.PassphraseRequest): resp = self._callback_passphrase(resp) elif isinstance(resp, messages.ButtonRequest): resp = self._callback_button(resp) elif isinstance(resp, messages.Failure): if resp.code == messages.FailureType.ActionCancelled: raise exceptions.Cancelled raise exceptions.TrezorFailure(resp) else: return resp @tools.session def init_device(self): resp = self.call_raw(messages.Initialize(state=self.state)) if not isinstance(resp, messages.Features): raise exceptions.TrezorException("Unexpected initial response") else: self.features = resp if self.features.vendor not in VENDORS: raise RuntimeError("Unsupported device") # A side-effect of this is a sanity check for broken protobuf definitions. # If the `vendor` field doesn't exist, you probably have a mismatched # checkout of trezor-common. self.version = ( self.features.major_version, self.features.minor_version, self.features.patch_version, ) self.check_firmware_version(warn_only=True) def is_outdated(self): if self.features.bootloader_mode: return False model = self.features.model or "1" required_version = MINIMUM_FIRMWARE_VERSION[model] return self.version < required_version def check_firmware_version(self, warn_only=False): if self.is_outdated(): if warn_only: warnings.warn(OUTDATED_FIRMWARE_ERROR, stacklevel=2) else: raise exceptions.OutdatedFirmwareError(OUTDATED_FIRMWARE_ERROR) @tools.expect(messages.Success, field="message") def ping( self, msg, button_protection=False, pin_protection=False, passphrase_protection=False, ): # We would like ping to work on any valid TrezorClient instance, but # due to the protection modes, we need to go through self.call, and that will # raise an exception if the firmware is too old. # So we short-circuit the simplest variant of ping with call_raw. if not button_protection and not pin_protection and not passphrase_protection: # XXX this should be: `with self:` try: self.open() return self.call_raw(messages.Ping(message=msg)) finally: self.close() msg = messages.Ping( message=msg, button_protection=button_protection, pin_protection=pin_protection, passphrase_protection=passphrase_protection, ) return self.call(msg) def get_device_id(self): return self.features.device_id @tools.session def clear_session(self): resp = self.call_raw(messages.ClearSession()) if isinstance(resp, messages.Success): self.state = None self.init_device() return resp.message else: return resp def MovedTo(where): def moved_to(*args, **kwargs): msg = "Function has been moved to " + where raise RuntimeError(DEPRECATION_ERROR.format(msg)) return moved_to class ProtocolMixin(object): """Fake mixin for old-style software that constructed TrezorClient class from separate mixins. Now it only simulates existence of original attributes to prevent some early crashes, and raises errors when any of the attributes are actually called. """ def __init__(self, *args, **kwargs): warnings.warn("TrezorClient mixins are not supported anymore") self.tx_api = None # Electrum checks that this attribute exists super().__init__(*args, **kwargs) def set_tx_api(self, tx_api): warnings.warn("set_tx_api is deprecated, use new arguments to sign_tx") @staticmethod def expand_path(n): warnings.warn( "expand_path is deprecated, use tools.parse_path", DeprecationWarning, stacklevel=2, ) return tools.parse_path(n) # Device functionality wipe_device = MovedTo("device.wipe") recovery_device = MovedTo("device.recover") reset_device = MovedTo("device.reset") backup_device = MovedTo("device.backup") set_u2f_counter = MovedTo("fido.set_counter") apply_settings = MovedTo("device.apply_settings") apply_flags = MovedTo("device.apply_flags") change_pin = MovedTo("device.change_pin") # Firmware functionality firmware_update = MovedTo("firmware.update") # BTC-like functionality get_public_node = MovedTo("btc.get_public_node") get_address = MovedTo("btc.get_address") sign_tx = MovedTo("btc.sign_tx") sign_message = MovedTo("btc.sign_message") verify_message = MovedTo("btc.verify_message") # CoSi functionality cosi_commit = MovedTo("cosi.commit") cosi_sign = MovedTo("cosi.sign") # Ethereum functionality ethereum_get_address = MovedTo("ethereum.get_address") ethereum_sign_tx = MovedTo("ethereum.sign_tx") ethereum_sign_message = MovedTo("ethereum.sign_message") ethereum_verify_message = MovedTo("ethereum.verify_message") # Lisk functionality lisk_get_address = MovedTo("lisk.get_address") lisk_get_public_key = MovedTo("lisk.get_public_key") lisk_sign_message = MovedTo("lisk.sign_message") lisk_verify_message = MovedTo("lisk.verify_message") lisk_sign_tx = MovedTo("lisk.sign_tx") # NEM functionality nem_get_address = MovedTo("nem.get_address") nem_sign_tx = MovedTo("nem.sign_tx") # Stellar functionality stellar_get_address = MovedTo("stellar.get_address") stellar_sign_transaction = MovedTo("stellar.sign_tx") # Miscellaneous cryptographic functionality get_entropy = MovedTo("misc.get_entropy") sign_identity = MovedTo("misc.sign_identity") get_ecdh_session_key = MovedTo("misc.get_ecdh_session_key") encrypt_keyvalue = MovedTo("misc.encrypt_keyvalue") decrypt_keyvalue = MovedTo("misc.decrypt_keyvalue") # Debug device functionality load_device_by_mnemonic = MovedTo("debuglink.load_device") class BaseClient: """Compatibility proxy for original BaseClient class. Prevents early crash in Electrum forks and possibly other software. """ def __init__(self, *args, **kwargs): warnings.warn("TrezorClient mixins are not supported anymore") self.trezor_client = TrezorClient(*args, **kwargs) def __getattr__(self, key): return getattr(self.trezor_client, key) # further Electrum compatibility proto = None python-trezor-0.11.6/src/trezorlib/coins.json000066400000000000000000002573141361427340300212730ustar00rootroot00000000000000[{"address_type": 0, "address_type_p2sh": 5, "bech32_prefix": "bc", "bip115": false, "bitcore": [], "blockbook": ["https://btc1.trezor.io", "https://btc2.trezor.io", "https://btc3.trezor.io", "https://btc4.trezor.io", "https://btc5.trezor.io"], "blocktime_seconds": 600, "cashaddr_prefix": null, "coin_label": "Bitcoin", "coin_name": "Bitcoin", "coin_shortcut": "BTC", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Economy": 70, "High": 200, "Low": 10, "Normal": 140}, "dust_limit": 546, "force_bip143": false, "fork_id": null, "github": "https://github.com/bitcoin/bitcoin", "hash_genesis_block": "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f", "key": "bitcoin:BTC", "maintainer": "Pavol Rusnak ", "max_address_length": 34, "maxfee_kb": 2000000, "min_address_length": 27, "minfee_kb": 1000, "name": "Bitcoin", "negative_fee": false, "segwit": true, "shortcut": "BTC", "signed_message_header": "Bitcoin Signed Message:\n", "slip44": 0, "support": {"connect": true, "trezor1": "1.5.2", "trezor2": "2.0.5", "webwallet": true}, "uri_prefix": "bitcoin", "website": "https://bitcoin.org", "xprv_magic": 76066276, "xpub_magic": 76067358, "xpub_magic_segwit_native": 78792518, "xpub_magic_segwit_p2sh": 77429938}, {"address_type": 111, "address_type_p2sh": 196, "bech32_prefix": "bcrt", "bip115": false, "bitcore": [], "blockbook": [], "blocktime_seconds": 600, "cashaddr_prefix": null, "coin_label": "Regtest", "coin_name": "Regtest", "coin_shortcut": "REGTEST", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 10}, "dust_limit": 546, "force_bip143": false, "fork_id": null, "github": "https://github.com/bitcoin/bitcoin", "hash_genesis_block": "0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206", "key": "bitcoin:REGTEST", "maintainer": "Thomas Kerin ", "max_address_length": 34, "maxfee_kb": 10000000, "min_address_length": 27, "minfee_kb": 1000, "name": "Regtest", "negative_fee": false, "segwit": true, "shortcut": "REGTEST", "signed_message_header": "Bitcoin Signed Message:\n", "slip44": 1, "support": {"connect": false, "trezor1": "1.8.2", "trezor2": "2.1.1", "webwallet": false}, "uri_prefix": "bitcoin", "website": "https://bitcoin.org", "xprv_magic": 70615956, "xpub_magic": 70617039, "xpub_magic_segwit_native": 73342198, "xpub_magic_segwit_p2sh": 71979618}, {"address_type": 111, "address_type_p2sh": 196, "bech32_prefix": "tb", "bip115": false, "bitcore": [], "blockbook": ["https://tbtc1.trezor.io", "https://tbtc2.trezor.io"], "blocktime_seconds": 600, "cashaddr_prefix": null, "coin_label": "Testnet", "coin_name": "Testnet", "coin_shortcut": "TEST", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 10}, "dust_limit": 546, "force_bip143": false, "fork_id": null, "github": "https://github.com/bitcoin/bitcoin", "hash_genesis_block": "000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943", "key": "bitcoin:TEST", "maintainer": "Pavol Rusnak ", "max_address_length": 34, "maxfee_kb": 10000000, "min_address_length": 27, "minfee_kb": 1000, "name": "Testnet", "negative_fee": false, "segwit": true, "shortcut": "TEST", "signed_message_header": "Bitcoin Signed Message:\n", "slip44": 1, "support": {"connect": true, "trezor1": "1.5.2", "trezor2": "2.0.5", "webwallet": true}, "uri_prefix": "bitcoin", "website": "https://bitcoin.org", "xprv_magic": 70615956, "xpub_magic": 70617039, "xpub_magic_segwit_native": 73342198, "xpub_magic_segwit_p2sh": 71979618}, {"address_type": 53, "address_type_p2sh": 55, "bech32_prefix": "acm", "bip115": false, "bitcore": [], "blockbook": [], "blocktime_seconds": 150, "cashaddr_prefix": null, "coin_label": "Actinium", "coin_name": "Actinium", "coin_shortcut": "ACM", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 1000}, "dust_limit": 546, "force_bip143": false, "fork_id": null, "github": "https://github.com/Actinium-project/Actinium", "hash_genesis_block": "28d77872e23714562f49a1be792c276623c1bbe3fdcf21b6035cfde78b00b824", "key": "bitcoin:ACM", "maintainer": "Harris Brakmic ", "max_address_length": 34, "maxfee_kb": 40000000, "min_address_length": 27, "minfee_kb": 100000, "name": "Actinium", "negative_fee": false, "segwit": true, "shortcut": "ACM", "signed_message_header": "Actinium Signed Message:\n", "slip44": 228, "support": {"connect": true, "trezor1": "1.7.2", "trezor2": "2.0.10", "webwallet": true}, "uri_prefix": "actinium", "website": "https://actinium.org", "xprv_magic": 76066276, "xpub_magic": 76067358, "xpub_magic_segwit_native": 78792518, "xpub_magic_segwit_p2sh": 77429938}, {"address_type": 55, "address_type_p2sh": 16, "bech32_prefix": null, "bip115": false, "bitcore": [], "blockbook": [], "blocktime_seconds": 150, "cashaddr_prefix": null, "coin_label": "Axe", "coin_name": "Axe", "coin_shortcut": "AXE", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 10}, "dust_limit": 5460, "force_bip143": false, "fork_id": null, "github": "https://github.com/axerunners/axe", "hash_genesis_block": "00000c33631ca6f2f61368991ce2dc03306b5bb50bf7cede5cfbba6db38e52e6", "key": "bitcoin:AXE", "maintainer": "Kirill Orlov ", "max_address_length": 34, "maxfee_kb": 100000, "min_address_length": 27, "minfee_kb": 1000, "name": "Axe", "negative_fee": false, "segwit": false, "shortcut": "AXE", "signed_message_header": "DarkCoin Signed Message:\n", "slip44": 4242, "support": {"connect": true, "trezor1": "1.7.3", "trezor2": "2.0.11", "webwallet": false}, "uri_prefix": "axe", "website": "https://axerunners.com", "xprv_magic": 50221816, "xpub_magic": 50221772, "xpub_magic_segwit_native": null, "xpub_magic_segwit_p2sh": null}, {"address_type": 25, "address_type_p2sh": 85, "bech32_prefix": "bm", "bip115": false, "bitcore": [], "blockbook": ["https://bellcoin-blockbook.ilmango.work", "https://bell.blockbook.ovh"], "blocktime_seconds": 60, "cashaddr_prefix": null, "coin_label": "Bellcoin", "coin_name": "Bellcoin", "coin_shortcut": "BELL", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 20}, "dust_limit": 546, "force_bip143": false, "fork_id": null, "github": "https://github.com/bellcoin-org/bellcoin", "hash_genesis_block": "000008f3b6bd10c2d03b06674a006b8d9731f6cb58179ef1eee008cee2209603", "key": "bitcoin:BELL", "maintainer": "ilmango-doge ", "max_address_length": 34, "maxfee_kb": 1000000, "min_address_length": 27, "minfee_kb": 1000, "name": "Bellcoin", "negative_fee": false, "segwit": true, "shortcut": "BELL", "signed_message_header": "Bellcoin Signed Message:\n", "slip44": 25252, "support": {"connect": false, "trezor1": "1.8.2", "trezor2": "2.1.1", "webwallet": false}, "uri_prefix": "bellcoin", "website": "https://bellcoin.web4u.jp", "xprv_magic": 76066276, "xpub_magic": 76067358, "xpub_magic_segwit_native": 78792518, "xpub_magic_segwit_p2sh": 77429938}, {"address_type": 81, "address_type_p2sh": 5, "bech32_prefix": "bz", "bip115": false, "bitcore": ["https://insight.bitzeny.jp", "https://zeny.insight.monaco-ex.org"], "blockbook": ["https://zny.blockbook.ovh"], "blocktime_seconds": 90, "cashaddr_prefix": null, "coin_label": "BitZeny", "coin_name": "BitZeny", "coin_shortcut": "ZNY", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 20}, "dust_limit": 546, "force_bip143": false, "fork_id": null, "github": "https://github.com/BitzenyCoreDevelopers/bitzeny", "hash_genesis_block": "000009f7e55e9e3b4781e22bd87a7cfa4acada9e4340d43ca738bf4e9fb8f5ce", "key": "bitcoin:ZNY", "maintainer": "y-chan ", "max_address_length": 34, "maxfee_kb": 1000000, "min_address_length": 27, "minfee_kb": 1000, "name": "BitZeny", "negative_fee": false, "segwit": true, "shortcut": "ZNY", "signed_message_header": "BitZeny Signed Message:\n", "slip44": 123, "support": {"connect": false, "trezor1": "1.8.2", "trezor2": "2.1.1", "webwallet": false}, "uri_prefix": "bitzeny", "website": "https://bitzeny.tech", "xprv_magic": 76066276, "xpub_magic": 76067358, "xpub_magic_segwit_native": 78792518, "xpub_magic_segwit_p2sh": 77429938}, {"address_type": 0, "address_type_p2sh": 5, "bech32_prefix": null, "bip115": false, "bitcore": [], "blockbook": ["https://bch1.trezor.io", "https://bch2.trezor.io", "https://bch3.trezor.io", "https://bch4.trezor.io", "https://bch5.trezor.io"], "blocktime_seconds": 600, "cashaddr_prefix": "bitcoincash", "coin_label": "Bitcoin Cash", "coin_name": "Bcash", "coin_shortcut": "BCH", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Economy": 70, "High": 200, "Low": 10, "Normal": 140}, "dust_limit": 546, "force_bip143": true, "fork_id": 0, "github": "https://github.com/Bitcoin-ABC/bitcoin-abc", "hash_genesis_block": "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f", "key": "bitcoin:BCH", "maintainer": "Jochen Hoenicke ", "max_address_length": 34, "maxfee_kb": 500000, "min_address_length": 27, "minfee_kb": 1000, "name": "Bitcoin Cash", "negative_fee": false, "segwit": false, "shortcut": "BCH", "signed_message_header": "Bitcoin Signed Message:\n", "slip44": 145, "support": {"connect": true, "trezor1": "1.6.2", "trezor2": "2.0.7", "webwallet": true}, "uri_prefix": "bitcoincash", "website": "https://www.bitcoincash.org", "xprv_magic": 76066276, "xpub_magic": 76067358, "xpub_magic_segwit_native": null, "xpub_magic_segwit_p2sh": null}, {"address_type": 111, "address_type_p2sh": 196, "bech32_prefix": null, "bip115": false, "bitcore": [], "blockbook": [], "blocktime_seconds": 600, "cashaddr_prefix": "bchtest", "coin_label": "Bitcoin Cash Testnet", "coin_name": "Bcash Testnet", "coin_shortcut": "TBCH", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 10}, "dust_limit": 546, "force_bip143": true, "fork_id": 0, "github": "https://github.com/Bitcoin-ABC/bitcoin-abc", "hash_genesis_block": "000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943", "key": "bitcoin:TBCH", "maintainer": "Jochen Hoenicke ", "max_address_length": 34, "maxfee_kb": 10000000, "min_address_length": 27, "minfee_kb": 1000, "name": "Bitcoin Cash Testnet", "negative_fee": false, "segwit": false, "shortcut": "TBCH", "signed_message_header": "Bitcoin Signed Message:\n", "slip44": 1, "support": {"connect": true, "trezor1": "1.6.2", "trezor2": "2.0.7", "webwallet": false}, "uri_prefix": "bitcoincash", "website": "https://www.bitcoincash.org", "xprv_magic": 70615956, "xpub_magic": 70617039, "xpub_magic_segwit_native": null, "xpub_magic_segwit_p2sh": null}, {"address_type": 38, "address_type_p2sh": 23, "bech32_prefix": "btg", "bip115": false, "bitcore": [], "blockbook": ["https://btg1.trezor.io", "https://btg2.trezor.io", "https://btg3.trezor.io", "https://btg4.trezor.io", "https://btg5.trezor.io"], "blocktime_seconds": 600, "cashaddr_prefix": null, "coin_label": "Bitcoin Gold", "coin_name": "Bgold", "coin_shortcut": "BTG", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Economy": 70, "High": 200, "Low": 10, "Normal": 140}, "dust_limit": 546, "force_bip143": true, "fork_id": 79, "github": "https://github.com/BTCGPU/BTCGPU", "hash_genesis_block": "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f", "key": "bitcoin:BTG", "maintainer": "Saleem Rashid ", "max_address_length": 34, "maxfee_kb": 500000, "min_address_length": 27, "minfee_kb": 1000, "name": "Bitcoin Gold", "negative_fee": false, "segwit": true, "shortcut": "BTG", "signed_message_header": "Bitcoin Gold Signed Message:\n", "slip44": 156, "support": {"connect": true, "trezor1": "1.6.2", "trezor2": "2.0.7", "webwallet": true}, "uri_prefix": "bitcoingold", "website": "https://bitcoingold.org", "xprv_magic": 76066276, "xpub_magic": 76067358, "xpub_magic_segwit_native": 78792518, "xpub_magic_segwit_p2sh": 77429938}, {"address_type": 111, "address_type_p2sh": 196, "bech32_prefix": "tbtg", "bip115": false, "bitcore": [], "blockbook": [], "blocktime_seconds": 600, "cashaddr_prefix": null, "coin_label": "Bitcoin Gold Testnet", "coin_name": "Bgold Testnet", "coin_shortcut": "TBTG", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Economy": 70, "High": 200, "Low": 10, "Normal": 140}, "dust_limit": 546, "force_bip143": true, "fork_id": 79, "github": "https://github.com/BTCGPU/BTCGPU", "hash_genesis_block": "00000000e0781ebe24b91eedc293adfea2f557b53ec379e78959de3853e6f9f6", "key": "bitcoin:TBTG", "maintainer": "The Bitcoin Gold Developers ", "max_address_length": 34, "maxfee_kb": 500000, "min_address_length": 27, "minfee_kb": 1000, "name": "Bitcoin Gold Testnet", "negative_fee": false, "segwit": true, "shortcut": "TBTG", "signed_message_header": "Bitcoin Gold Signed Message:\n", "slip44": 156, "support": {"connect": true, "trezor1": "1.7.1", "trezor2": "2.0.8", "webwallet": false}, "uri_prefix": "bitcoingold", "website": "https://bitcoingold.org", "xprv_magic": 70615956, "xpub_magic": 70617039, "xpub_magic_segwit_native": 73342198, "xpub_magic_segwit_p2sh": 71979618}, {"address_type": 4901, "address_type_p2sh": 5039, "bech32_prefix": null, "bip115": false, "bitcore": ["https://explorer.btcprivate.org"], "blockbook": [], "blocktime_seconds": 150, "cashaddr_prefix": null, "coin_label": "Bitcoin Private", "coin_name": "Bprivate", "coin_shortcut": "BTCP", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 10}, "dust_limit": 546, "force_bip143": false, "fork_id": 42, "github": "https://github.com/BTCPrivate/BitcoinPrivate", "hash_genesis_block": "0007104ccda289427919efc39dc9e4d499804b7bebc22df55f8b834301260602", "key": "bitcoin:BTCP", "maintainer": "Chris Sulmone ", "max_address_length": 95, "maxfee_kb": 1000000, "min_address_length": 35, "minfee_kb": 1000, "name": "Bitcoin Private", "negative_fee": false, "segwit": false, "shortcut": "BTCP", "signed_message_header": "BitcoinPrivate Signed Message:\n", "slip44": 183, "support": {"connect": true, "trezor1": "1.6.2", "trezor2": "2.0.7", "webwallet": true}, "uri_prefix": "bitcoinprivate", "website": "https://btcprivate.org", "xprv_magic": 76066276, "xpub_magic": 76067358, "xpub_magic_segwit_native": null, "xpub_magic_segwit_p2sh": null}, {"address_type": 61, "address_type_p2sh": 123, "bech32_prefix": null, "bip115": false, "bitcore": [], "blockbook": ["https://blockbook1.bitcoinrh.org", "https://blockbook2.bitcoinrh.org"], "blocktime_seconds": 600, "cashaddr_prefix": null, "coin_label": "Bitcoin Rhodium", "coin_name": "Brhodium", "coin_shortcut": "XRC", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Economy": 70, "High": 200, "Low": 10, "Normal": 140}, "dust_limit": 546, "force_bip143": false, "fork_id": null, "github": "https://gitlab.com/bitcoinrh/BRhodiumNode", "hash_genesis_block": "baff5bfd9dc43fb672d003ec20fd21428f9282ca46bfa1730d73e1f2c75f5fdd", "key": "bitcoin:XRC", "maintainer": "baff5b ", "max_address_length": 34, "maxfee_kb": 2000000, "min_address_length": 27, "minfee_kb": 1000, "name": "Bitcoin Rhodium", "negative_fee": false, "segwit": false, "shortcut": "XRC", "signed_message_header": "BitCoin Rhodium Signed Message:\n", "slip44": 10291, "support": {"connect": true, "trezor1": "1.8.2", "trezor2": "2.1.1", "webwallet": false}, "uri_prefix": "bitcoin-rhodium", "website": "https://www.bitcoinrh.org", "xprv_magic": 76066276, "xpub_magic": 76067358, "xpub_magic_segwit_native": null, "xpub_magic_segwit_p2sh": null}, {"address_type": 3, "address_type_p2sh": 125, "bech32_prefix": "btx", "bip115": false, "bitcore": ["https://insight.bitcore.cc"], "blockbook": [], "blocktime_seconds": 150, "cashaddr_prefix": null, "coin_label": "Bitcore", "coin_name": "Bitcore", "coin_shortcut": "BTX", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Low": 10}, "dust_limit": 546, "force_bip143": false, "fork_id": null, "github": "https://github.com/LIMXTEC/BitCore", "hash_genesis_block": "604148281e5c4b7f2487e5d03cd60d8e6f69411d613f6448034508cea52e9574", "key": "bitcoin:BTX", "maintainer": "limxdev ", "max_address_length": 34, "maxfee_kb": 2000000, "min_address_length": 27, "minfee_kb": 1000, "name": "Bitcore", "negative_fee": false, "segwit": true, "shortcut": "BTX", "signed_message_header": "BitCore Signed Message:\n", "slip44": 160, "support": {"connect": true, "trezor1": "1.7.1", "trezor2": "2.0.8", "webwallet": false}, "uri_prefix": "bitcore", "website": "https://bitcore.cc", "xprv_magic": 76066276, "xpub_magic": 76067358, "xpub_magic_segwit_native": 78792518, "xpub_magic_segwit_p2sh": 77429938}, {"address_type": 28, "address_type_p2sh": 30, "bech32_prefix": "cpu", "bip115": false, "bitcore": [], "blockbook": ["https://blockbook.cpuchain.org"], "blocktime_seconds": 60, "cashaddr_prefix": null, "coin_label": "CPUchain", "coin_name": "CPUchain", "coin_shortcut": "CPU", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 20}, "dust_limit": 546, "force_bip143": false, "fork_id": null, "github": "https://github.com/cpuchain/cpuchain", "hash_genesis_block": "000024d8766043ea0e1c9ad42e7ea4b5fdb459887bd80b8f9756f3d87e128f12", "key": "bitcoin:CPU", "maintainer": "Min Khang Aung ", "max_address_length": 34, "maxfee_kb": 1000000, "min_address_length": 27, "minfee_kb": 1000, "name": "CPUchain", "negative_fee": false, "segwit": true, "shortcut": "CPU", "signed_message_header": "CPUchain Signed Message:\n", "slip44": 363, "support": {"connect": false, "trezor1": "1.8.3", "trezor2": "2.1.4", "webwallet": false}, "uri_prefix": "cpuchain", "website": "https://cpuchain.org", "xprv_magic": 76066276, "xpub_magic": 76067358, "xpub_magic_segwit_native": 78792518, "xpub_magic_segwit_p2sh": 77429938}, {"address_type": 28, "address_type_p2sh": 35, "bech32_prefix": null, "bip115": false, "bitcore": [], "blockbook": ["https://blockbook.capricoin.org", "https://blockbook2.capricoin.org", "https://blockbook3.capricoin.org", "https://blockbook4.capricoin.org"], "blocktime_seconds": 60, "cashaddr_prefix": null, "coin_label": "Capricoin", "coin_name": "Capricoin", "coin_shortcut": "CPC", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Economy": 7, "High": 20, "Low": 1, "Normal": 14}, "duplicate": true, "dust_limit": 546, "force_bip143": false, "fork_id": null, "github": "https://github.com/Capricoinofficial/Capricoin", "hash_genesis_block": "00000d23fa0fc52c90893adb1181c9ddffb6c797a3e41864b9a23aa2f2981fe3", "key": "bitcoin:CPC", "maintainer": "Jozef Knaperek ", "max_address_length": 34, "maxfee_kb": 2000000, "min_address_length": 27, "minfee_kb": 1000, "name": "Capricoin", "negative_fee": false, "segwit": false, "shortcut": "CPC", "signed_message_header": "Capricoin Signed Message:\n", "slip44": 289, "support": {"connect": true, "trezor1": false, "trezor2": "2.0.10", "webwallet": false}, "uri_prefix": "capricoin", "website": "https://capricoin.org", "xprv_magic": 76066276, "xpub_magic": 76067358, "xpub_magic_segwit_native": null, "xpub_magic_segwit_p2sh": null}, {"address_type": 95495, "address_type_p2sh": 95473, "bech32_prefix": null, "bip115": false, "bitcore": ["https://insight-01.crownplatform.com", "https://insight-02.crownplatform.com", "https://insight-03.crownplatform.com"], "blockbook": [], "blocktime_seconds": 60, "cashaddr_prefix": null, "coin_label": "Crown", "coin_name": "Crown", "coin_shortcut": "CRW", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 10}, "dust_limit": 546, "force_bip143": false, "fork_id": null, "github": "https://github.com/Crowndev/crowncoin", "hash_genesis_block": "0000000085370d5e122f64f4ab19c68614ff3df78c8d13cb814fd7e69a1dc6da", "key": "bitcoin:CRW", "maintainer": "Ashot ", "max_address_length": 40, "maxfee_kb": 2000000, "min_address_length": 36, "minfee_kb": 1000, "name": "Crown", "negative_fee": false, "segwit": false, "shortcut": "CRW", "signed_message_header": "Crown Signed Message:\n", "slip44": 72, "support": {"connect": false, "trezor1": "1.8.4", "trezor2": "2.1.7", "webwallet": false}, "uri_prefix": "crown", "website": "https://crownplatform.com", "xprv_magic": 76066276, "xpub_magic": 76067358, "xpub_magic_segwit_native": null, "xpub_magic_segwit_p2sh": null}, {"address_type": 76, "address_type_p2sh": 16, "bech32_prefix": null, "bip115": false, "bitcore": [], "blockbook": ["https://dash1.trezor.io", "https://dash2.trezor.io", "https://dash3.trezor.io", "https://dash4.trezor.io", "https://dash5.trezor.io"], "blocktime_seconds": 150, "cashaddr_prefix": null, "coin_label": "Dash", "coin_name": "Dash", "coin_shortcut": "DASH", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 10}, "dust_limit": 5460, "force_bip143": false, "fork_id": null, "github": "https://github.com/dashpay/dash", "hash_genesis_block": "00000ffd590b1485b3caadc19b22e6379c733355108f107a430458cdf3407ab6", "key": "bitcoin:DASH", "maintainer": "Karel Bilek ", "max_address_length": 34, "maxfee_kb": 100000, "min_address_length": 27, "minfee_kb": 1000, "name": "Dash", "negative_fee": false, "segwit": false, "shortcut": "DASH", "signed_message_header": "DarkCoin Signed Message:\n", "slip44": 5, "support": {"connect": true, "trezor1": "1.5.2", "trezor2": "2.0.5", "webwallet": true}, "uri_prefix": "dash", "website": "https://www.dash.org", "xprv_magic": 50221816, "xpub_magic": 50221772, "xpub_magic_segwit_native": null, "xpub_magic_segwit_p2sh": null}, {"address_type": 140, "address_type_p2sh": 19, "bech32_prefix": null, "bip115": false, "bitcore": [], "blockbook": [], "blocktime_seconds": 150, "cashaddr_prefix": null, "coin_label": "Dash Testnet", "coin_name": "Dash Testnet", "coin_shortcut": "tDASH", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 10}, "dust_limit": 5460, "force_bip143": false, "fork_id": null, "github": "https://github.com/dashpay/dash", "hash_genesis_block": "00000bafbc94add76cb75e2ec92894837288a481e5c005f6563d91623bf8bc2c", "key": "bitcoin:tDASH", "maintainer": "Karel Bilek ", "max_address_length": 34, "maxfee_kb": 100000, "min_address_length": 27, "minfee_kb": 10000, "name": "Dash Testnet", "negative_fee": false, "segwit": false, "shortcut": "tDASH", "signed_message_header": "DarkCoin Signed Message:\n", "slip44": 1, "support": {"connect": true, "trezor1": "1.6.2", "trezor2": "2.0.8", "webwallet": false}, "uri_prefix": "dash", "website": "https://www.dash.org", "xprv_magic": 70615956, "xpub_magic": 70617039, "xpub_magic_segwit_native": null, "xpub_magic_segwit_p2sh": null}, {"address_type": 1855, "address_type_p2sh": 1818, "bech32_prefix": null, "bip115": false, "bitcore": ["https://mainnet.decred.org"], "blockbook": [], "blocktime_seconds": 600, "cashaddr_prefix": null, "coin_label": "Decred", "coin_name": "Decred", "coin_shortcut": "DCR", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1_decred", "decimals": 8, "decred": true, "default_fee_b": {"Normal": 10}, "dust_limit": 546, "force_bip143": false, "fork_id": null, "github": "https://github.com/decred/dcrd", "hash_genesis_block": "298e5cc3d985bfe7f81dc135f360abe089edd4396b86d2de66b0cef42b21d980", "key": "bitcoin:DCR", "maintainer": "Alex Yocom-Piatt ", "max_address_length": 35, "maxfee_kb": 1000000, "min_address_length": 35, "minfee_kb": 10000, "name": "Decred", "negative_fee": false, "segwit": false, "shortcut": "DCR", "signed_message_header": "Decred Signed Message:\n", "slip44": 42, "support": {"connect": false, "trezor1": "1.6.2", "trezor2": "2.0.8", "webwallet": true}, "uri_prefix": "bitcoin", "website": "https://www.decred.org", "xprv_magic": 50177256, "xpub_magic": 50178342, "xpub_magic_segwit_native": null, "xpub_magic_segwit_p2sh": null}, {"address_type": 3873, "address_type_p2sh": 3836, "bech32_prefix": null, "bip115": false, "bitcore": ["https://testnet.decred.org"], "blockbook": [], "blocktime_seconds": 600, "cashaddr_prefix": null, "coin_label": "Decred Testnet", "coin_name": "Decred Testnet", "coin_shortcut": "TDCR", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1_decred", "decimals": 8, "decred": true, "default_fee_b": {"Normal": 10}, "dust_limit": 546, "force_bip143": false, "fork_id": null, "github": "https://github.com/decred/dcrd", "hash_genesis_block": "a649dce53918caf422e9c711c858837e08d626ecfcd198969b24f7b634a49bac", "key": "bitcoin:TDCR", "maintainer": "Saleem Rashid ", "max_address_length": 35, "maxfee_kb": 10000000, "min_address_length": 35, "minfee_kb": 1000, "name": "Decred Testnet", "negative_fee": false, "segwit": false, "shortcut": "TDCR", "signed_message_header": "Decred Signed Message:\n", "slip44": 1, "support": {"connect": false, "trezor1": "1.6.2", "trezor2": "2.0.8", "webwallet": true}, "uri_prefix": "bitcoin", "website": "https://www.decred.org", "xprv_magic": 70615959, "xpub_magic": 70617041, "xpub_magic_segwit_native": null, "xpub_magic_segwit_p2sh": null}, {"address_type": 30, "address_type_p2sh": 63, "bech32_prefix": "dgb", "bip115": false, "bitcore": [], "blockbook": ["https://dgb1.trezor.io", "https://dgb2.trezor.io"], "blocktime_seconds": 15, "cashaddr_prefix": null, "coin_label": "DigiByte", "coin_name": "DigiByte", "coin_shortcut": "DGB", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Economy": 70, "High": 200, "Low": 10, "Normal": 140}, "dust_limit": 546, "force_bip143": false, "fork_id": null, "github": "https://github.com/digibyte/digibyte", "hash_genesis_block": "7497ea1b465eb39f1c8f507bc877078fe016d6fcb6dfad3a64c98dcc6e1e8496", "key": "bitcoin:DGB", "maintainer": "DigiByte ", "max_address_length": 34, "maxfee_kb": 500000, "min_address_length": 27, "minfee_kb": 1000, "name": "DigiByte", "negative_fee": false, "segwit": true, "shortcut": "DGB", "signed_message_header": "DigiByte Signed Message:\n", "slip44": 20, "support": {"connect": true, "trezor1": "1.6.3", "trezor2": "2.0.7", "webwallet": true}, "uri_prefix": "digibyte", "website": "https://digibyte.io", "xprv_magic": 76066276, "xpub_magic": 76067358, "xpub_magic_segwit_native": 78792518, "xpub_magic_segwit_p2sh": 77429938}, {"address_type": 30, "address_type_p2sh": 22, "bech32_prefix": null, "bip115": false, "bitcore": [], "blockbook": ["https://doge1.trezor.io", "https://doge2.trezor.io", "https://doge3.trezor.io", "https://doge4.trezor.io", "https://doge5.trezor.io"], "blocktime_seconds": 60, "cashaddr_prefix": null, "coin_label": "Dogecoin", "coin_name": "Dogecoin", "coin_shortcut": "DOGE", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 100000}, "dust_limit": 10000000, "force_bip143": false, "fork_id": null, "github": "https://github.com/dogecoin/dogecoin", "hash_genesis_block": "1a91e3dace36e2be3bf030a65679fe821aa1d6ef92e7c9902eb318182c355691", "key": "bitcoin:DOGE", "maintainer": "Karel Bilek ", "max_address_length": 34, "maxfee_kb": 1000000000, "min_address_length": 27, "minfee_kb": 1000, "name": "Dogecoin", "negative_fee": false, "segwit": false, "shortcut": "DOGE", "signed_message_header": "Dogecoin Signed Message:\n", "slip44": 3, "support": {"connect": true, "trezor1": "1.5.2", "trezor2": "2.0.5", "webwallet": true}, "uri_prefix": "dogecoin", "website": "https://dogecoin.com", "xprv_magic": 49988504, "xpub_magic": 49990397, "xpub_magic_segwit_native": null, "xpub_magic_segwit_p2sh": null}, {"address_type": 235, "address_type_p2sh": 75, "bech32_prefix": "ert", "bip115": false, "bitcore": [], "blockbook": [], "blocktime_seconds": 600, "cashaddr_prefix": null, "coin_label": "Elements", "coin_name": "Elements", "coin_shortcut": "ELEMENTS", "confidential_assets": {"address_prefix": 4, "blech32_prefix": "el"}, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 10}, "dust_limit": 546, "force_bip143": false, "fork_id": null, "github": "https://github.com/ElementsProject/elements", "hash_genesis_block": "209577bda6bf4b5804bd46f8621580dd6d4e8bfa2d190e1c50e932492baca07d", "key": "bitcoin:ELEMENTS", "maintainer": "Roman Zeyde ", "max_address_length": 34, "maxfee_kb": 10000000, "min_address_length": 27, "minfee_kb": 1000, "name": "Elements", "negative_fee": false, "segwit": true, "shortcut": "ELEMENTS", "signed_message_header": "Bitcoin Signed Message:\n", "slip44": 1, "support": {"connect": false, "trezor1": "1.8.3", "trezor2": "2.1.4", "webwallet": false}, "uri_prefix": "elements", "website": "https://elementsproject.org", "xprv_magic": 70615956, "xpub_magic": 70617039, "xpub_magic_segwit_native": 73342198, "xpub_magic_segwit_p2sh": 71979618}, {"address_type": 14, "address_type_p2sh": 5, "bech32_prefix": "fc", "bip115": false, "bitcore": ["https://bitcore.feathercoin.com"], "blockbook": [], "blocktime_seconds": 60, "cashaddr_prefix": null, "coin_label": "Feathercoin", "coin_name": "Feathercoin", "coin_shortcut": "FTC", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 1000}, "duplicate": true, "dust_limit": 54600, "force_bip143": false, "fork_id": null, "github": "https://github.com/FeatherCoin/Feathercoin", "hash_genesis_block": "12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2", "key": "bitcoin:FTC", "maintainer": "Lucas Betschart ", "max_address_length": 34, "maxfee_kb": 40000000, "min_address_length": 27, "minfee_kb": 1000, "name": "Feathercoin", "negative_fee": false, "segwit": true, "shortcut": "FTC", "signed_message_header": "Feathercoin Signed Message:\n", "slip44": 8, "support": {"connect": true, "trezor1": "1.7.1", "trezor2": "2.0.8", "webwallet": false}, "uri_prefix": "feathercoin", "website": "https://feathercoin.com", "xprv_magic": 76077806, "xpub_magic": 76069926, "xpub_magic_segwit_native": 78792518, "xpub_magic_segwit_p2sh": 77429938}, {"address_type": 35, "address_type_p2sh": 94, "bech32_prefix": "flo", "bip115": false, "bitcore": ["https://livenet.flocha.in"], "blockbook": [], "blocktime_seconds": 40, "cashaddr_prefix": null, "coin_label": "Flo", "coin_name": "Florincoin", "coin_shortcut": "FLO", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 1000}, "dust_limit": 546, "force_bip143": false, "fork_id": null, "github": "https://github.com/floblockchain/flo", "hash_genesis_block": "09c7781c9df90708e278c35d38ea5c9041d7ecfcdd1c56ba67274b7cff3e1cea", "key": "bitcoin:FLO", "maintainer": "Robert English ", "max_address_length": 34, "maxfee_kb": 40000000, "min_address_length": 27, "minfee_kb": 100000, "name": "Flo", "negative_fee": false, "segwit": true, "shortcut": "FLO", "signed_message_header": "Florincoin Signed Message:\n", "slip44": 216, "support": {"connect": true, "trezor1": "1.7.2", "trezor2": "2.0.11", "webwallet": false}, "uri_prefix": "florincoin", "website": "https://flo.cash", "xprv_magic": 15264107, "xpub_magic": 1526049, "xpub_magic_segwit_native": 78792518, "xpub_magic_segwit_p2sh": 28471030}, {"address_type": 36, "address_type_p2sh": 16, "bech32_prefix": "fc", "bip115": false, "bitcore": [], "blockbook": ["https://explorer.fujicoin.org"], "blocktime_seconds": 60, "cashaddr_prefix": null, "coin_label": "Fujicoin", "coin_name": "Fujicoin", "coin_shortcut": "FJC", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Economy": 20000, "High": 100000, "Low": 10000, "Normal": 50000}, "dust_limit": 546, "force_bip143": false, "fork_id": null, "github": "https://github.com/fujicoin/fujicoin", "hash_genesis_block": "adb6d9cfd74075e7f91608add4bd2a2ea636f70856183086842667a1597714a0", "key": "bitcoin:FJC", "maintainer": "motty ", "max_address_length": 34, "maxfee_kb": 1000000000, "min_address_length": 27, "minfee_kb": 10000000, "name": "Fujicoin", "negative_fee": false, "segwit": true, "shortcut": "FJC", "signed_message_header": "FujiCoin Signed Message:\n", "slip44": 75, "support": {"connect": true, "trezor1": "1.6.1", "trezor2": "2.0.5", "webwallet": true}, "uri_prefix": "fujicoin", "website": "https://fujicoin.org", "xprv_magic": 76066276, "xpub_magic": 76067358, "xpub_magic_segwit_native": 78792518, "xpub_magic_segwit_p2sh": 77429938}, {"address_type": 38, "address_type_p2sh": 10, "bech32_prefix": null, "bip115": false, "bitcore": [], "blockbook": ["https://blockbook.gincoin.io"], "blocktime_seconds": 120, "cashaddr_prefix": null, "coin_label": "GIN", "coin_name": "Gincoin", "coin_shortcut": "GIN", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 10}, "dust_limit": 5460, "force_bip143": false, "fork_id": null, "github": "https://github.com/gincoin-dev/gincoin-core", "hash_genesis_block": "00000cd6bde619b2c3b23ad2e384328a450a37fa28731debf748c3b17f91f97d", "key": "bitcoin:GIN", "maintainer": "Dragos Badea ", "max_address_length": 34, "maxfee_kb": 100000, "min_address_length": 27, "minfee_kb": 1000, "name": "GIN", "negative_fee": false, "segwit": false, "shortcut": "GIN", "signed_message_header": "DarkCoin Signed Message:\n", "slip44": 2000, "support": {"connect": true, "trezor1": "1.7.2", "trezor2": "2.0.11", "webwallet": false}, "uri_prefix": "gincoin", "website": "https://gincoin.io", "xprv_magic": 50221816, "xpub_magic": 50221772, "xpub_magic_segwit_native": null, "xpub_magic_segwit_p2sh": null}, {"address_type": 38, "address_type_p2sh": 62, "bech32_prefix": "game", "bip115": false, "bitcore": [], "blockbook": ["https://blockbook.gamecredits.network"], "blocktime_seconds": 90, "cashaddr_prefix": null, "coin_label": "GameCredits", "coin_name": "GameCredits", "coin_shortcut": "GAME", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 1000}, "dust_limit": 54600, "force_bip143": false, "fork_id": null, "github": "https://github.com/gamecredits-project/gamecredits", "hash_genesis_block": "91ec5f25ee9a0ffa1af7d4da4db9a552228dd2dc77cdb15b738be4e1f55f30ee", "key": "bitcoin:GAME", "maintainer": "Samad Sajanlal ", "max_address_length": 34, "maxfee_kb": 5000000, "min_address_length": 27, "minfee_kb": 100000, "name": "GameCredits", "negative_fee": false, "segwit": true, "shortcut": "GAME", "signed_message_header": "GameCredits Signed Message:\n", "slip44": 101, "support": {"connect": true, "trezor1": "1.7.1", "trezor2": "2.0.8", "webwallet": false}, "uri_prefix": "gamecredits", "website": "https://gamecredits.org", "xprv_magic": 27108450, "xpub_magic": 27106558, "xpub_magic_segwit_native": 78792518, "xpub_magic_segwit_p2sh": 28471030}, {"address_type": 36, "address_type_p2sh": 5, "bech32_prefix": "grs", "bip115": false, "bitcore": ["https://groestlsight.groestlcoin.org", "https://grsblocks.com"], "blockbook": ["https://blockbook.groestlcoin.org"], "blocktime_seconds": 60, "cashaddr_prefix": null, "coin_label": "Groestlcoin", "coin_name": "Groestlcoin", "coin_shortcut": "GRS", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1_groestl", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 10}, "dust_limit": 546, "force_bip143": false, "fork_id": null, "github": "https://github.com/Groestlcoin/groestlcoin", "hash_genesis_block": "00000ac5927c594d49cc0bdb81759d0da8297eb614683d3acb62f0703b639023", "key": "bitcoin:GRS", "maintainer": "Yura Pakhuchiy ", "max_address_length": 34, "maxfee_kb": 100000, "min_address_length": 27, "minfee_kb": 1000, "name": "Groestlcoin", "negative_fee": false, "segwit": true, "shortcut": "GRS", "signed_message_header": "GroestlCoin Signed Message:\n", "slip44": 17, "support": {"connect": false, "trezor1": "1.6.2", "trezor2": "2.0.8", "webwallet": true}, "uri_prefix": "groestlcoin", "website": "https://www.groestlcoin.org", "xprv_magic": 76066276, "xpub_magic": 76067358, "xpub_magic_segwit_native": 78792518, "xpub_magic_segwit_p2sh": 77429938}, {"address_type": 111, "address_type_p2sh": 196, "bech32_prefix": "tgrs", "bip115": false, "bitcore": ["https://groestlsight-test.groestlcoin.org"], "blockbook": ["https://blockbook-test.groestlcoin.org"], "blocktime_seconds": 60, "cashaddr_prefix": null, "coin_label": "Groestlcoin Testnet", "coin_name": "Groestlcoin Testnet", "coin_shortcut": "tGRS", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1_groestl", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 10}, "dust_limit": 546, "force_bip143": false, "fork_id": null, "github": "https://github.com/Groestlcoin/groestlcoin", "hash_genesis_block": "000000ffbb50fc9898cdd36ec163e6ba23230164c0052a28876255b7dcf2cd36", "key": "bitcoin:tGRS", "maintainer": "Yura Pakhuchiy ", "max_address_length": 34, "maxfee_kb": 100000, "min_address_length": 27, "minfee_kb": 1000, "name": "Groestlcoin Testnet", "negative_fee": false, "segwit": true, "shortcut": "tGRS", "signed_message_header": "GroestlCoin Signed Message:\n", "slip44": 1, "support": {"connect": false, "trezor1": "1.6.2", "trezor2": "2.0.8", "webwallet": true}, "uri_prefix": "groestlcoin", "website": "https://www.groestlcoin.org", "xprv_magic": 70615956, "xpub_magic": 70617039, "xpub_magic_segwit_native": 73342198, "xpub_magic_segwit_p2sh": 71979618}, {"address_type": 76, "address_type_p2sh": 16, "bech32_prefix": null, "bip115": false, "bitcore": [], "blockbook": [], "blocktime_seconds": 150, "cashaddr_prefix": null, "coin_label": "Hatch", "coin_name": "Hatch", "coin_shortcut": "HATCH", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 10}, "dust_limit": 5460, "force_bip143": false, "fork_id": null, "github": "https://github.com/hatchpay/hatch", "hash_genesis_block": "000000fa6116f5d6c6ce9b60bd431469e40b4fe55feeeda59e33cd2f0b863196", "key": "bitcoin:HATCH", "maintainer": "Hatch Support ", "max_address_length": 34, "maxfee_kb": 100000, "min_address_length": 27, "minfee_kb": 1000, "name": "Hatch", "negative_fee": false, "segwit": false, "shortcut": "HATCH", "signed_message_header": "Hatch Signed Message:\n", "slip44": 88888888, "support": {"connect": false, "trezor1": "1.8.4", "trezor2": "2.1.6", "webwallet": false}, "uri_prefix": "hatch", "website": "https://hatch.ga", "xprv_magic": 50221816, "xpub_magic": 50221772, "xpub_magic_segwit_native": null, "xpub_magic_segwit_p2sh": null}, {"address_type": 140, "address_type_p2sh": 19, "bech32_prefix": null, "bip115": false, "bitcore": [], "blockbook": [], "blocktime_seconds": 150, "cashaddr_prefix": null, "coin_label": "Hatch Testnet", "coin_name": "Hatch Testnet", "coin_shortcut": "tHATCH", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 10}, "dust_limit": 5460, "force_bip143": false, "fork_id": null, "github": "https://github.com/hatchpay/hatch", "hash_genesis_block": "00000bf8b02180fa3860e3f4fbfaab76db14fbfd1323d1d3ad06d83b828b6644", "key": "bitcoin:tHATCH", "maintainer": "Hatch Support ", "max_address_length": 34, "maxfee_kb": 100000, "min_address_length": 27, "minfee_kb": 10000, "name": "Hatch Testnet", "negative_fee": false, "segwit": false, "shortcut": "tHATCH", "signed_message_header": "Hatch Signed Message:\n", "slip44": 1, "support": {"connect": false, "trezor1": "1.8.4", "trezor2": "2.1.6", "webwallet": false}, "uri_prefix": "hatch", "website": "https://hatch.ga", "xprv_magic": 70615956, "xpub_magic": 70617039, "xpub_magic_segwit_native": null, "xpub_magic_segwit_p2sh": null}, {"address_type": 8329, "address_type_p2sh": 8342, "bech32_prefix": null, "bip115": true, "bitcore": ["https://explorer.horizen.global"], "blockbook": [], "blocktime_seconds": 150, "cashaddr_prefix": null, "coin_label": "Horizen", "coin_name": "Horizen", "coin_shortcut": "ZEN", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 10}, "dust_limit": 546, "force_bip143": false, "fork_id": null, "github": "https://github.com/ZencashOfficial/zen", "hash_genesis_block": "0007104ccda289427919efc39dc9e4d499804b7bebc22df55f8b834301260602", "key": "bitcoin:ZEN", "maintainer": "Power_VANO ", "max_address_length": 95, "maxfee_kb": 2000000, "min_address_length": 35, "minfee_kb": 1000, "name": "Horizen", "negative_fee": false, "segwit": false, "shortcut": "ZEN", "signed_message_header": "Zcash Signed Message:\n", "slip44": 121, "support": {"connect": true, "trezor1": false, "trezor2": "2.0.8", "webwallet": false}, "uri_prefix": "horizen", "website": "https://www.horizen.global", "xprv_magic": 76066276, "xpub_magic": 76067358, "xpub_magic_segwit_native": null, "xpub_magic_segwit_p2sh": null}, {"address_type": 60, "address_type_p2sh": 85, "bech32_prefix": null, "bip115": false, "bitcore": ["https://api.kmd.dev"], "blockbook": [], "blocktime_seconds": 60, "cashaddr_prefix": null, "coin_label": "Komodo", "coin_name": "Komodo", "coin_shortcut": "KMD", "confidential_assets": null, "consensus_branch_id": {"1": 0, "2": 0, "3": 1537743641, "4": 1991772603}, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 10}, "dust_limit": 546, "force_bip143": false, "fork_id": null, "github": "https://github.com/komodoplatform/komodo", "hash_genesis_block": "027e3758c3a65b12aa1046462b486d0a63bfa1beae327897f56c5cfb7daaae71", "key": "bitcoin:KMD", "maintainer": "Kadan Stadelmann ", "max_address_length": 34, "maxfee_kb": 1000000, "min_address_length": 27, "minfee_kb": 1000, "name": "Komodo", "negative_fee": true, "segwit": false, "shortcut": "KMD", "signed_message_header": "Komodo Signed Message:\n", "slip44": 141, "support": {"connect": true, "trezor1": "1.8.0", "trezor2": "2.0.11", "webwallet": false}, "uri_prefix": "komodo", "website": "https://komodoplatform.com", "xprv_magic": 76066276, "xpub_magic": 76067358, "xpub_magic_segwit_native": null, "xpub_magic_segwit_p2sh": null}, {"address_type": 6198, "address_type_p2sh": 6203, "bech32_prefix": null, "bip115": false, "bitcore": ["https://insight.kotocoin.info"], "blockbook": [], "blocktime_seconds": 60, "cashaddr_prefix": null, "coin_label": "Koto", "coin_name": "Koto", "coin_shortcut": "KOTO", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 10}, "dust_limit": 546, "force_bip143": false, "fork_id": null, "github": "https://github.com/KotoDevelopers/koto", "hash_genesis_block": "6d424c350729ae633275d51dc3496e16cd1b1d195c164da00f39c499a2e9959e", "key": "bitcoin:KOTO", "maintainer": "WO ", "max_address_length": 95, "maxfee_kb": 1000000, "min_address_length": 35, "minfee_kb": 1000, "name": "Koto", "negative_fee": false, "segwit": false, "shortcut": "KOTO", "signed_message_header": "Koto Signed Message:\n", "slip44": 510, "support": {"connect": true, "trezor1": "1.7.1", "trezor2": "2.0.8", "webwallet": true}, "uri_prefix": "koto", "website": "https://ko-to.org", "xprv_magic": 76066276, "xpub_magic": 76067358, "xpub_magic_segwit_native": null, "xpub_magic_segwit_p2sh": null}, {"address_type": 48, "address_type_p2sh": 50, "bech32_prefix": "ltc", "bip115": false, "bitcore": [], "blockbook": ["https://ltc1.trezor.io", "https://ltc2.trezor.io", "https://ltc3.trezor.io", "https://ltc4.trezor.io", "https://ltc5.trezor.io"], "blocktime_seconds": 150, "cashaddr_prefix": null, "coin_label": "Litecoin", "coin_name": "Litecoin", "coin_shortcut": "LTC", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 1000}, "dust_limit": 546, "force_bip143": false, "fork_id": null, "github": "https://github.com/litecoin-project/litecoin", "hash_genesis_block": "12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2", "key": "bitcoin:LTC", "maintainer": "Pavol Rusnak ", "max_address_length": 34, "maxfee_kb": 40000000, "min_address_length": 27, "minfee_kb": 100000, "name": "Litecoin", "negative_fee": false, "segwit": true, "shortcut": "LTC", "signed_message_header": "Litecoin Signed Message:\n", "slip44": 2, "support": {"connect": true, "trezor1": "1.5.2", "trezor2": "2.0.5", "webwallet": true}, "uri_prefix": "litecoin", "website": "https://litecoin.org", "xprv_magic": 27106558, "xpub_magic": 27108450, "xpub_magic_segwit_native": 78792518, "xpub_magic_segwit_p2sh": 28471030}, {"address_type": 111, "address_type_p2sh": 58, "bech32_prefix": "tltc", "bip115": false, "bitcore": ["https://testnet.litecore.io"], "blockbook": [], "blocktime_seconds": 150, "cashaddr_prefix": null, "coin_label": "Litecoin Testnet", "coin_name": "Litecoin Testnet", "coin_shortcut": "tLTC", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 10}, "dust_limit": 54600, "force_bip143": false, "fork_id": null, "github": "https://github.com/litecoin-project/litecoin", "hash_genesis_block": "4966625a4b2851d9fdee139e56211a0d88575f59ed816ff5e6a63deb4e3e29a0", "key": "bitcoin:tLTC", "maintainer": "Pavol Rusnak ", "max_address_length": 34, "maxfee_kb": 40000000, "min_address_length": 27, "minfee_kb": 1000, "name": "Litecoin Testnet", "negative_fee": false, "segwit": true, "shortcut": "tLTC", "signed_message_header": "Litecoin Signed Message:\n", "slip44": 1, "support": {"connect": true, "trezor1": "1.6.2", "trezor2": "2.0.7", "webwallet": true}, "uri_prefix": "litecoin", "website": "https://litecoin.org", "xprv_magic": 70615956, "xpub_magic": 70617039, "xpub_magic_segwit_native": 73342198, "xpub_magic_segwit_p2sh": 71979618}, {"address_type": 50, "address_type_p2sh": 5, "bech32_prefix": null, "bip115": false, "bitcore": [], "blockbook": [], "blocktime_seconds": 600, "cashaddr_prefix": null, "coin_label": "Metaverse ETP", "coin_name": "MetaverseETP", "coin_shortcut": "ETP", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Economy": 70, "High": 200, "Low": 10, "Normal": 140}, "dust_limit": 546, "force_bip143": false, "fork_id": null, "github": "https://github.com/mvs-org/metaverse", "hash_genesis_block": "b81848ef9ae86e84c3da26564bc6ab3a79efc628239d11471ab5cd25c0684c2d", "key": "bitcoin:ETP", "maintainer": "Sven Mutzl ", "max_address_length": 34, "maxfee_kb": 2000000, "min_address_length": 27, "minfee_kb": 100, "name": "Metaverse ETP", "negative_fee": false, "segwit": false, "shortcut": "ETP", "signed_message_header": "Metaverse Signed Message:\n", "slip44": 2302, "support": {"connect": false, "trezor1": "1.8.4", "trezor2": "2.1.8", "webwallet": false}, "uri_prefix": "etp", "website": "https://mvs.org", "xprv_magic": 76066276, "xpub_magic": 76067358, "xpub_magic_segwit_native": null, "xpub_magic_segwit_p2sh": null}, {"address_type": 50, "address_type_p2sh": 55, "bech32_prefix": "mona", "bip115": false, "bitcore": ["https://mona.chainsight.info", "https://insight.electrum-mona.org"], "blockbook": ["https://blockbook.electrum-mona.org"], "blocktime_seconds": 90, "cashaddr_prefix": null, "coin_label": "Monacoin", "coin_name": "Monacoin", "coin_shortcut": "MONA", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 1000}, "dust_limit": 54600, "force_bip143": false, "fork_id": null, "github": "https://github.com/monacoinproject/monacoin", "hash_genesis_block": "ff9f1c0116d19de7c9963845e129f9ed1bfc0b376eb54fd7afa42e0d418c8bb6", "key": "bitcoin:MONA", "maintainer": "cryptcoin-junkey ", "max_address_length": 34, "maxfee_kb": 5000000, "min_address_length": 27, "minfee_kb": 100000, "name": "Monacoin", "negative_fee": false, "segwit": true, "shortcut": "MONA", "signed_message_header": "Monacoin Signed Message:\n", "slip44": 22, "support": {"connect": true, "trezor1": "1.6.0", "trezor2": "2.0.5", "webwallet": true}, "uri_prefix": "monacoin", "website": "https://monacoin.org", "xprv_magic": 76066276, "xpub_magic": 76067358, "xpub_magic_segwit_native": 78792518, "xpub_magic_segwit_p2sh": 77429938}, {"address_type": 16, "address_type_p2sh": 76, "bech32_prefix": null, "bip115": false, "bitcore": [], "blockbook": ["https://blockbook.monetaryunit.org"], "blocktime_seconds": 40, "cashaddr_prefix": null, "coin_label": "MonetaryUnit", "coin_name": "MonetaryUnit", "coin_shortcut": "MUE", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 10}, "dust_limit": 5460, "force_bip143": false, "fork_id": null, "github": "https://github.com/muecoin/MUE", "hash_genesis_block": "0b58ed450b3819ca54ab0054c4d220ca4f887d21c9e55d2a333173adf76d987f", "key": "bitcoin:MUE", "maintainer": "Sotiris Blad ", "max_address_length": 34, "maxfee_kb": 100000, "min_address_length": 27, "minfee_kb": 1000, "name": "MonetaryUnit", "negative_fee": false, "segwit": false, "shortcut": "MUE", "signed_message_header": "MonetaryUnit Signed Message:\n", "slip44": 31, "support": {"connect": true, "trezor1": "1.7.1", "trezor2": "2.0.8", "webwallet": true}, "uri_prefix": "monetaryunit", "website": "https://www.monetaryunit.org", "xprv_magic": 76066276, "xpub_magic": 76067358, "xpub_magic_segwit_native": null, "xpub_magic_segwit_p2sh": null}, {"address_type": 38, "address_type_p2sh": 53, "bech32_prefix": "nix", "bip115": false, "bitcore": ["https://blockchain.nixplatform.io"], "blockbook": [], "blocktime_seconds": 120, "cashaddr_prefix": null, "coin_label": "NIX", "coin_name": "NIX", "coin_shortcut": "NIX", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 1000}, "dust_limit": 54600, "force_bip143": false, "fork_id": null, "github": "https://github.com/nixplatform/nixcore", "hash_genesis_block": "dd28ad86def767c3cfc34267a950d871fc7462bc57ea4a929fc3596d9b598e41", "key": "bitcoin:NIX", "maintainer": "mattt21 ", "max_address_length": 34, "maxfee_kb": 40000000, "min_address_length": 27, "minfee_kb": 0, "name": "NIX", "negative_fee": false, "segwit": true, "shortcut": "NIX", "signed_message_header": "NIX Signed Message:\n", "slip44": 400, "support": {"connect": true, "trezor1": "1.7.2", "trezor2": "2.0.11", "webwallet": false}, "uri_prefix": "nix", "website": "https://nixplatform.io", "xprv_magic": 76066276, "xpub_magic": 76067358, "xpub_magic_segwit_native": 78792518, "xpub_magic_segwit_p2sh": 77429938}, {"address_type": 52, "address_type_p2sh": 5, "bech32_prefix": null, "bip115": false, "bitcore": [], "blockbook": ["https://nmc1.trezor.io", "https://nmc2.trezor.io"], "blocktime_seconds": 600, "cashaddr_prefix": null, "coin_label": "Namecoin", "coin_name": "Namecoin", "coin_shortcut": "NMC", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 10}, "dust_limit": 2940, "force_bip143": false, "fork_id": null, "github": "https://github.com/namecoin/namecoin-core", "hash_genesis_block": "000000000062b72c5e2ceb45fbc8587e807c155b0da735e6483dfba2f0a9c770", "key": "bitcoin:NMC", "maintainer": "Pavol Rusnak ", "max_address_length": 34, "maxfee_kb": 10000000, "min_address_length": 27, "minfee_kb": 100000, "name": "Namecoin", "negative_fee": false, "segwit": false, "shortcut": "NMC", "signed_message_header": "Namecoin Signed Message:\n", "slip44": 7, "support": {"connect": true, "trezor1": "1.5.2", "trezor2": "2.0.5", "webwallet": true}, "uri_prefix": "namecoin", "website": "https://namecoin.org", "xprv_magic": 76066276, "xpub_magic": 76067358, "xpub_magic_segwit_native": null, "xpub_magic_segwit_p2sh": null}, {"address_type": 30, "address_type_p2sh": 13, "bech32_prefix": null, "bip115": false, "bitcore": [], "blockbook": ["https://blockbook.pivx.link"], "blocktime_seconds": 60, "cashaddr_prefix": null, "coin_label": "PIVX", "coin_name": "PIVX", "coin_shortcut": "PIVX", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 10}, "dust_limit": 546, "force_bip143": false, "fork_id": null, "github": "https://github.com/PIVX-Project/PIVX", "hash_genesis_block": "0000041e482b9b9691d98eefb48473405c0b8ec31b76df3797c74a78680ef818", "key": "bitcoin:PIVX", "maintainer": "Random Zebra ", "max_address_length": 34, "maxfee_kb": 100000, "min_address_length": 27, "minfee_kb": 100, "name": "PIVX", "negative_fee": false, "segwit": false, "shortcut": "PIVX", "signed_message_header": "DarkNet Signed Message:\n", "slip44": 119, "support": {"connect": true, "trezor1": "1.8.0", "trezor2": "2.0.11", "webwallet": false}, "uri_prefix": "pivx", "website": "https://pivx.org", "xprv_magic": 35729707, "xpub_magic": 36513075, "xpub_magic_segwit_native": null, "xpub_magic_segwit_p2sh": null}, {"address_type": 139, "address_type_p2sh": 19, "bech32_prefix": null, "bip115": false, "bitcore": [], "blockbook": ["https://blockbook-testnet.pivx.link"], "blocktime_seconds": 60, "cashaddr_prefix": null, "coin_label": "PIVX Testnet", "coin_name": "PIVX Testnet", "coin_shortcut": "tPIVX", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 10}, "dust_limit": 54600, "force_bip143": false, "fork_id": null, "github": "https://github.com/PIVX-Project/PIVX", "hash_genesis_block": "0000041e482b9b9691d98eefb48473405c0b8ec31b76df3797c74a78680ef818", "key": "bitcoin:tPIVX", "maintainer": "Random Zebra ", "max_address_length": 34, "maxfee_kb": 100000, "min_address_length": 27, "minfee_kb": 100, "name": "PIVX Testnet", "negative_fee": false, "segwit": false, "shortcut": "tPIVX", "signed_message_header": "DarkNet Signed Message:\n", "slip44": 1, "support": {"connect": true, "trezor1": "1.8.0", "trezor2": "2.0.11", "webwallet": false}, "uri_prefix": "pivx", "website": "https://pivx.org", "xprv_magic": 981489719, "xpub_magic": 981492128, "xpub_magic_segwit_native": null, "xpub_magic_segwit_p2sh": null}, {"address_type": 56, "address_type_p2sh": 60, "bech32_prefix": "bc", "bip115": false, "bitcore": [], "blockbook": [], "blocktime_seconds": 600, "cashaddr_prefix": null, "coin_label": "Particl", "coin_name": "Particl", "coin_shortcut": "PART", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Economy": 70, "High": 200, "Low": 10, "Normal": 140}, "dust_limit": 546, "force_bip143": false, "fork_id": null, "github": "https://github.com/particl/particl-core", "hash_genesis_block": "0000ee0784c195317ac95623e22fddb8c7b8825dc3998e0bb924d66866eccf4c", "key": "bitcoin:PART", "maintainer": "Ryno ", "max_address_length": 34, "maxfee_kb": 2000000, "min_address_length": 27, "minfee_kb": 1000, "name": "Particl", "negative_fee": false, "segwit": true, "shortcut": "PART", "signed_message_header": "Bitcoin Signed Message:\n", "slip44": 44, "support": {"connect": false, "trezor1": "1.8.3", "trezor2": "2.1.4", "webwallet": false}, "uri_prefix": "particl", "website": "https://particl.io", "xprv_magic": 1768850129, "xpub_magic": 2401087160, "xpub_magic_segwit_native": 78792518, "xpub_magic_segwit_p2sh": 28471030}, {"address_type": 118, "address_type_p2sh": 122, "bech32_prefix": "tb", "bip115": false, "bitcore": [], "blockbook": [], "blocktime_seconds": 600, "cashaddr_prefix": null, "coin_label": "Particl Testnet", "coin_name": "Particl Testnet", "coin_shortcut": "tPART", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 10}, "dust_limit": 546, "force_bip143": false, "fork_id": null, "github": "https://github.com/particl/particl-core", "hash_genesis_block": "0000594ada5310b367443ee0afd4fa3d0bbd5850ea4e33cdc7d6a904a7ec7c90", "key": "bitcoin:tPART", "maintainer": "Ryno ", "max_address_length": 34, "maxfee_kb": 10000000, "min_address_length": 27, "minfee_kb": 1000, "name": "Particl Testnet", "negative_fee": false, "segwit": true, "shortcut": "tPART", "signed_message_header": "Bitcoin Signed Message:\n", "slip44": 1, "support": {"connect": false, "trezor1": "1.8.3", "trezor2": "2.1.4", "webwallet": false}, "uri_prefix": "particl", "website": "https://particl.io", "xprv_magic": 3779229696, "xpub_magic": 76059768, "xpub_magic_segwit_native": 73342198, "xpub_magic_segwit_p2sh": 71979618}, {"address_type": 55, "address_type_p2sh": 117, "bech32_prefix": "pc", "bip115": false, "bitcore": [], "blockbook": ["https://blockbook.peercoin.net"], "blocktime_seconds": 600, "cashaddr_prefix": null, "coin_label": "Peercoin", "coin_name": "Peercoin", "coin_shortcut": "PPC", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 6, "decred": false, "default_fee_b": {"Normal": 10}, "dust_limit": 10000, "force_bip143": false, "fork_id": null, "github": "https://github.com/peercoin/peercoin", "hash_genesis_block": "0000000032fe677166d54963b62a4677d8957e87c508eaa4fd7eb1c880cd27e3", "key": "bitcoin:PPC", "maintainer": "backpacker69 ", "max_address_length": 34, "maxfee_kb": 2000000, "min_address_length": 27, "minfee_kb": 10000, "name": "Peercoin", "negative_fee": false, "segwit": true, "shortcut": "PPC", "signed_message_header": "Peercoin Signed Message:\n", "slip44": 6, "support": {"connect": true, "trezor1": "1.8.4", "trezor2": "2.1.9", "webwallet": true}, "uri_prefix": "peercoin", "website": "https://peercoin.net", "xprv_magic": 76066276, "xpub_magic": 76067358, "xpub_magic_segwit_native": 78792518, "xpub_magic_segwit_p2sh": 77429938}, {"address_type": 111, "address_type_p2sh": 196, "bech32_prefix": "tpc", "bip115": false, "bitcore": [], "blockbook": ["https://tblockbook.peercoin.net"], "blocktime_seconds": 600, "cashaddr_prefix": null, "coin_label": "Peercoin Testnet", "coin_name": "Peercoin Testnet", "coin_shortcut": "tPPC", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 6, "decred": false, "default_fee_b": {"Normal": 10}, "dust_limit": 10000, "force_bip143": false, "fork_id": null, "github": "https://github.com/peercoin/peercoin", "hash_genesis_block": "00000001f757bb737f6596503e17cd17b0658ce630cc727c0cca81aec47c9f06", "key": "bitcoin:tPPC", "maintainer": "backpacker69 ", "max_address_length": 34, "maxfee_kb": 2000000, "min_address_length": 27, "minfee_kb": 10000, "name": "Peercoin Testnet", "negative_fee": false, "segwit": true, "shortcut": "tPPC", "signed_message_header": "Peercoin Signed Message:\n", "slip44": 1, "support": {"connect": true, "trezor1": "1.8.4", "trezor2": "2.1.9", "webwallet": true}, "uri_prefix": "peercoin", "website": "https://peercoin.net", "xprv_magic": 70615956, "xpub_magic": 70617039, "xpub_magic_segwit_native": 73342198, "xpub_magic_segwit_p2sh": 71979618}, {"address_type": 47, "address_type_p2sh": 22, "bech32_prefix": null, "bip115": false, "bitcore": ["https://live.pesetacoin.info"], "blockbook": [], "blocktime_seconds": 60, "cashaddr_prefix": null, "coin_label": "Pesetacoin", "coin_name": "Pesetacoin", "coin_shortcut": "PTC", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 10}, "duplicate": true, "dust_limit": 10000000, "force_bip143": false, "fork_id": null, "github": "https://github.com/FundacionPesetacoin/PesetacoinCore", "hash_genesis_block": "edfe5830b53251bfff733600b1cd5c192e761c011b055f07924634818c906438", "key": "bitcoin:PTC", "maintainer": "Rw ", "max_address_length": 34, "maxfee_kb": 1000000000, "min_address_length": 27, "minfee_kb": 1000, "name": "Pesetacoin", "negative_fee": false, "segwit": false, "shortcut": "PTC", "signed_message_header": "Pesetacoin Signed Message:\n", "slip44": 109, "support": {"connect": true, "trezor1": "1.7.1", "trezor2": "2.0.8", "webwallet": false}, "uri_prefix": "pesetacoin", "website": "https://pesetacoin.info", "xprv_magic": 76079604, "xpub_magic": 76071982, "xpub_magic_segwit_native": null, "xpub_magic_segwit_p2sh": null}, {"address_type": 55, "address_type_p2sh": 56, "bech32_prefix": null, "bip115": false, "bitcore": [], "blockbook": ["https://blockbook.polispay.org"], "blocktime_seconds": 120, "cashaddr_prefix": null, "coin_label": "Polis", "coin_name": "Polis", "coin_shortcut": "POLIS", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 10}, "dust_limit": 5460, "force_bip143": false, "fork_id": null, "github": "https://github.com/polispay/polis", "hash_genesis_block": "000009701eb781a8113b1af1d814e2f060f6408a2c990db291bc5108a1345c1e", "key": "bitcoin:POLIS", "maintainer": "Cronos ", "max_address_length": 34, "maxfee_kb": 100000, "min_address_length": 27, "minfee_kb": 1000, "name": "Polis", "negative_fee": false, "segwit": false, "shortcut": "POLIS", "signed_message_header": "Polis Signed Message:\n", "slip44": 1997, "support": {"connect": true, "trezor1": "1.8.2", "trezor2": "2.1.1", "webwallet": false}, "uri_prefix": "polis", "website": "https://www.polispay.org", "xprv_magic": 65165637, "xpub_magic": 65166718, "xpub_magic_segwit_native": null, "xpub_magic_segwit_p2sh": null}, {"address_type": 23, "address_type_p2sh": 83, "bech32_prefix": null, "bip115": false, "bitcore": [], "blockbook": [], "blocktime_seconds": 60, "cashaddr_prefix": null, "coin_label": "Primecoin", "coin_name": "Primecoin", "coin_shortcut": "XPM", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 10}, "dust_limit": 546, "force_bip143": false, "fork_id": null, "github": "https://github.com/primecoin/primecoin", "hash_genesis_block": "963d17ba4dc753138078a2f56afb3af9674e2546822badff26837db9a0152106", "key": "bitcoin:XPM", "maintainer": "James Skrowvedeht ", "max_address_length": 35, "maxfee_kb": 1000000, "min_address_length": 26, "minfee_kb": 1000, "name": "Primecoin", "negative_fee": false, "segwit": false, "shortcut": "XPM", "signed_message_header": "Primecoin Signed Message:\n", "slip44": 24, "support": {"connect": true, "trezor1": "1.8.0", "trezor2": "2.0.11", "webwallet": false}, "uri_prefix": "primecoin", "website": "https://primecoin.io", "xprv_magic": 76066276, "xpub_magic": 76067358, "xpub_magic_segwit_native": null, "xpub_magic_segwit_p2sh": null}, {"address_type": 58, "address_type_p2sh": 50, "bech32_prefix": "qc", "bip115": false, "bitcore": [], "blockbook": [], "blocktime_seconds": 128, "cashaddr_prefix": null, "coin_label": "Qtum", "coin_name": "Qtum", "coin_shortcut": "QTUM", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Economy": 500, "High": 2000, "Low": 410, "Normal": 600}, "duplicate": true, "dust_limit": 218400, "force_bip143": false, "fork_id": null, "github": "https://github.com/qtumproject/qtum", "hash_genesis_block": "000075aef83cf2853580f8ae8ce6f8c3096cfa21d98334d6e3f95e5582ed986c", "key": "bitcoin:QTUM", "maintainer": "CodeFace ", "max_address_length": 34, "maxfee_kb": 40000000, "min_address_length": 27, "minfee_kb": 400000, "name": "Qtum", "negative_fee": false, "segwit": true, "shortcut": "QTUM", "signed_message_header": "Qtum Signed Message:\n", "slip44": 2301, "support": {"connect": false, "trezor1": "1.8.1", "trezor2": "2.1.1", "webwallet": true}, "uri_prefix": "qtum", "website": "https://qtum.org", "xprv_magic": 76066276, "xpub_magic": 76067358, "xpub_magic_segwit_native": 78792518, "xpub_magic_segwit_p2sh": 77429938}, {"address_type": 120, "address_type_p2sh": 110, "bech32_prefix": "tq", "bip115": false, "bitcore": [], "blockbook": [], "blocktime_seconds": 128, "cashaddr_prefix": null, "coin_label": "Qtum Testnet", "coin_name": "Qtum Testnet", "coin_shortcut": "tQTUM", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Economy": 500, "High": 2000, "Low": 410, "Normal": 600}, "dust_limit": 218400, "force_bip143": false, "fork_id": null, "github": "https://github.com/qtumproject/qtum", "hash_genesis_block": "0000e803ee215c0684ca0d2f9220594d3f828617972aad66feb2ba51f5e14222", "key": "bitcoin:tQTUM", "maintainer": "CodeFace ", "max_address_length": 34, "maxfee_kb": 40000000, "min_address_length": 27, "minfee_kb": 400000, "name": "Qtum Testnet", "negative_fee": false, "segwit": true, "shortcut": "tQTUM", "signed_message_header": "Qtum Signed Message:\n", "slip44": 1, "support": {"connect": false, "trezor1": "1.8.1", "trezor2": "2.1.1", "webwallet": false}, "uri_prefix": "qtum", "website": "https://qtum.org", "xprv_magic": 70615956, "xpub_magic": 70617039, "xpub_magic_segwit_native": 73342198, "xpub_magic_segwit_p2sh": 71979618}, {"address_type": 60, "address_type_p2sh": 122, "bech32_prefix": null, "bip115": false, "bitcore": ["https://ravencoin.network"], "blockbook": ["https://blockbook.ravencoin.org"], "blocktime_seconds": 60, "cashaddr_prefix": null, "coin_label": "Ravencoin", "coin_name": "Ravencoin", "coin_shortcut": "RVN", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Low": 10}, "dust_limit": 546, "force_bip143": false, "fork_id": null, "github": "https://github.com/RavenProject/Ravencoin", "hash_genesis_block": "0000006b444bc2f2ffe627be9d9e7e7a0730000870ef6eb6da46c8eae389df90", "key": "bitcoin:RVN", "maintainer": "Scotty ", "max_address_length": 34, "maxfee_kb": 2000000, "min_address_length": 27, "minfee_kb": 1000, "name": "Ravencoin", "negative_fee": false, "segwit": false, "shortcut": "RVN", "signed_message_header": "Raven Signed Message:\n", "slip44": 175, "support": {"connect": true, "trezor1": "1.7.2", "trezor2": "2.0.10", "webwallet": true}, "uri_prefix": "raven", "website": "https://ravencoin.org", "xprv_magic": 76066276, "xpub_magic": 76067358, "xpub_magic_segwit_native": null, "xpub_magic_segwit_p2sh": null}, {"address_type": 25, "address_type_p2sh": 105, "bech32_prefix": null, "bip115": false, "bitcore": ["https://insight.ritocoin.org"], "blockbook": ["https://blockbook.ritocoin.org"], "blocktime_seconds": 60, "cashaddr_prefix": null, "coin_label": "Ritocoin", "coin_name": "Ritocoin", "coin_shortcut": "RITO", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Low": 10}, "dust_limit": 546, "force_bip143": false, "fork_id": null, "github": "https://github.com/RitoProject", "hash_genesis_block": "00000075e344bdf1c0e433f453764b1830a7aa19b2a5213e707502a22b779c1b", "key": "bitcoin:RITO", "maintainer": "Scotty ", "max_address_length": 34, "maxfee_kb": 2000000, "min_address_length": 27, "minfee_kb": 1000, "name": "Ritocoin", "negative_fee": false, "segwit": false, "shortcut": "RITO", "signed_message_header": "Rito Signed Message:\n", "slip44": 19169, "support": {"connect": true, "trezor1": "1.8.2", "trezor2": "2.1.1", "webwallet": false}, "uri_prefix": "rito", "website": "https://ritocoin.org", "xprv_magic": 87326380, "xpub_magic": 87353290, "xpub_magic_segwit_native": null, "xpub_magic_segwit_p2sh": null}, {"address_type": 63, "address_type_p2sh": 18, "bech32_prefix": null, "bip115": false, "bitcore": ["https://insight.smartcash.cc"], "blockbook": [], "blocktime_seconds": 55, "cashaddr_prefix": null, "coin_label": "SmartCash", "coin_name": "SmartCash", "coin_shortcut": "SMART", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1_smart", "decimals": 8, "decred": false, "default_fee_b": {"Economy": 10, "High": 200, "Low": 1, "Normal": 100}, "duplicate": true, "dust_limit": 546, "force_bip143": false, "fork_id": null, "github": "https://github.com/SmartCash/Core-Smart", "hash_genesis_block": "000007acc6970b812948d14ea5a0a13db0fdd07d5047c7e69101fa8b361e05a4", "key": "bitcoin:SMART", "maintainer": "Leandro Reinaux ", "max_address_length": 34, "maxfee_kb": 1000000, "min_address_length": 27, "minfee_kb": 0, "name": "SmartCash", "negative_fee": false, "segwit": false, "shortcut": "SMART", "signed_message_header": "SmartCash Signed Message:\n", "slip44": 224, "support": {"connect": false, "trezor1": "1.7.1", "trezor2": "2.0.8", "webwallet": false}, "uri_prefix": "smart", "website": "https://smartcash.cc", "xprv_magic": 76066276, "xpub_magic": 76067358, "xpub_magic_segwit_native": null, "xpub_magic_segwit_p2sh": null}, {"address_type": 65, "address_type_p2sh": 21, "bech32_prefix": null, "bip115": false, "bitcore": [], "blockbook": [], "blocktime_seconds": 55, "cashaddr_prefix": null, "coin_label": "SmartCash Testnet", "coin_name": "SmartCash Testnet", "coin_shortcut": "tSMART", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1_smart", "decimals": 8, "decred": false, "default_fee_b": {"Economy": 10, "High": 200, "Low": 1, "Normal": 100}, "dust_limit": 546, "force_bip143": false, "fork_id": null, "github": "https://github.com/SmartCash/Core-Smart", "hash_genesis_block": "0000027235b5679bcd28c90d03d4bf1a9ba4c07c4efcc1c87d6c68cce25e6e5d", "key": "bitcoin:tSMART", "maintainer": "Leandro Reinaux ", "max_address_length": 35, "maxfee_kb": 1000000, "min_address_length": 27, "minfee_kb": 0, "name": "SmartCash Testnet", "negative_fee": false, "segwit": false, "shortcut": "tSMART", "signed_message_header": "SmartCash Signed Message:\n", "slip44": 224, "support": {"connect": false, "trezor1": "1.7.1", "trezor2": "2.0.8", "webwallet": false}, "uri_prefix": "testsmart", "website": "https://smartcash.cc", "xprv_magic": 70615956, "xpub_magic": 70617039, "xpub_magic_segwit_native": null, "xpub_magic_segwit_p2sh": null}, {"address_type": 76, "address_type_p2sh": 16, "bech32_prefix": "xc", "bip115": false, "bitcore": [], "blockbook": [], "blocktime_seconds": 60, "cashaddr_prefix": null, "coin_label": "Stakenet", "coin_name": "Stakenet", "coin_shortcut": "XSN", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Economy": 70, "High": 200, "Low": 10, "Normal": 140}, "dust_limit": 1000, "force_bip143": false, "fork_id": null, "github": "https://github.com/X9Developers/XSN", "hash_genesis_block": "00000c822abdbb23e28f79a49d29b41429737c6c7e15df40d1b1f1b35907ae34", "key": "bitcoin:XSN", "maintainer": "Alexis Hernandez ", "max_address_length": 47, "maxfee_kb": 2000000, "min_address_length": 27, "minfee_kb": 1000, "name": "Stakenet", "negative_fee": false, "segwit": true, "shortcut": "XSN", "signed_message_header": "DarkCoin Signed Message:\n", "slip44": 199, "support": {"connect": true, "trezor1": "1.8.0", "trezor2": "2.0.11", "webwallet": false}, "uri_prefix": "stakenet", "website": "https://stakenet.io", "xprv_magic": 76066276, "xpub_magic": 76067358, "xpub_magic_segwit_native": 78792518, "xpub_magic_segwit_p2sh": 77429938}, {"address_type": 63, "address_type_p2sh": 5, "bech32_prefix": "sys", "bip115": false, "bitcore": [], "blockbook": [], "blocktime_seconds": 60, "cashaddr_prefix": null, "coin_label": "Syscoin", "coin_name": "Syscoin", "coin_shortcut": "SYS", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Economy": 200, "High": 2000, "Low": 100, "Normal": 400}, "dust_limit": 1820, "force_bip143": false, "fork_id": null, "github": "https://github.com/syscoin/syscoin", "hash_genesis_block": "0000022642db0346b6e01c2a397471f4f12e65d4f4251ec96c1f85367a61a7ab", "key": "bitcoin:SYS", "maintainer": "Jagdeep Sidhu ", "max_address_length": 34, "maxfee_kb": 10000000, "min_address_length": 27, "minfee_kb": 1000, "name": "Syscoin", "negative_fee": false, "segwit": true, "shortcut": "SYS", "signed_message_header": "Syscoin Signed Message:\n", "slip44": 57, "support": {"connect": false, "trezor1": "1.8.4", "trezor2": "2.1.8", "webwallet": false}, "uri_prefix": "syscoin", "website": "https://syscoin.org", "xprv_magic": 76066276, "xpub_magic": 76067358, "xpub_magic_segwit_native": 78792518, "xpub_magic_segwit_p2sh": 77429938}, {"address_type": 0, "address_type_p2sh": 5, "bech32_prefix": null, "bip115": false, "bitcore": ["https://insight.terracoin.io"], "blockbook": [], "blocktime_seconds": 120, "cashaddr_prefix": null, "coin_label": "Terracoin", "coin_name": "Terracoin", "coin_shortcut": "TRC", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 10}, "duplicate": true, "dust_limit": 5460, "force_bip143": false, "fork_id": null, "github": "https://github.com/terracoin/terracoin", "hash_genesis_block": "00000000804bbc6a621a9dbb564ce469f492e1ccf2d70f8a6b241e26a277afa2", "key": "bitcoin:TRC", "maintainer": "The Terracoin Foundation ", "max_address_length": 34, "maxfee_kb": 100000, "min_address_length": 27, "minfee_kb": 10000, "name": "Terracoin", "negative_fee": false, "segwit": false, "shortcut": "TRC", "signed_message_header": "DarkCoin Signed Message:\n", "slip44": 83, "support": {"connect": false, "trezor1": false, "trezor2": false, "webwallet": false}, "uri_prefix": "terracoin", "website": "https://terracoin.io", "xprv_magic": 76066276, "xpub_magic": 76067358, "xpub_magic_segwit_native": null, "xpub_magic_segwit_p2sh": null}, {"address_type": 130, "address_type_p2sh": 30, "bech32_prefix": null, "bip115": false, "bitcore": [], "blockbook": ["https://blockbook.flurbo.xyz", "https://blockbook.unobtanium.uno"], "blocktime_seconds": 30, "cashaddr_prefix": null, "coin_label": "Unobtanium", "coin_name": "Unobtanium", "coin_shortcut": "UNO", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Economy": 50, "High": 160, "Low": 10, "Normal": 100}, "dust_limit": 546, "force_bip143": false, "fork_id": null, "github": "https://github.com/unobtanium-official/unobtanium", "hash_genesis_block": "000004c2fc5fffb810dccc197d603690099a68305232e552d96ccbe8e2c52b75", "key": "bitcoin:UNO", "maintainer": "choicesz ", "max_address_length": 34, "maxfee_kb": 2000000, "min_address_length": 27, "minfee_kb": 1000, "name": "Unobtanium", "negative_fee": false, "segwit": false, "shortcut": "UNO", "signed_message_header": "Unobtanium Signed Message:\n", "slip44": 92, "support": {"connect": true, "trezor1": "1.8.4", "trezor2": "2.1.6", "webwallet": false}, "uri_prefix": "unobtanium", "website": "https://unobtanium.uno", "xprv_magic": 76066276, "xpub_magic": 76067358, "xpub_magic_segwit_native": null, "xpub_magic_segwit_p2sh": null}, {"address_type": 70, "address_type_p2sh": 50, "bech32_prefix": "vips", "bip115": false, "bitcore": ["https://insight.vipstarco.in"], "blockbook": ["https://vips.blockbook.japanesecoin-pool.work"], "blocktime_seconds": 120, "cashaddr_prefix": null, "coin_label": "VIPSTARCOIN", "coin_name": "VIPSTARCOIN", "coin_shortcut": "VIPS", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Economy": 500, "High": 2000, "Low": 410, "Normal": 600}, "dust_limit": 218400, "force_bip143": false, "fork_id": null, "github": "https://github.com/VIPSTARCOIN/VIPSTARCOIN", "hash_genesis_block": "0000d068e1d30f79fb64446137106be9c6ee69a6a722295c131506b1ee09b77c", "key": "bitcoin:VIPS", "maintainer": "y-chan ", "max_address_length": 36, "maxfee_kb": 40000000, "min_address_length": 27, "minfee_kb": 400000, "name": "VIPSTARCOIN", "negative_fee": false, "segwit": true, "shortcut": "VIPS", "signed_message_header": "VIPSTARCOIN Signed Message:\n", "slip44": 1919, "support": {"connect": false, "trezor1": "1.8.2", "trezor2": "2.1.1", "webwallet": false}, "uri_prefix": "vipstarcoin", "website": "https://vipstarcoin.jp", "xprv_magic": 76066276, "xpub_magic": 76067358, "xpub_magic_segwit_native": 78792518, "xpub_magic_segwit_p2sh": 77429938}, {"address_type": 71, "address_type_p2sh": 5, "bech32_prefix": "vtc", "bip115": false, "bitcore": [], "blockbook": ["https://vtc1.trezor.io", "https://vtc2.trezor.io", "https://vtc3.trezor.io", "https://vtc4.trezor.io", "https://vtc5.trezor.io"], "blocktime_seconds": 150, "cashaddr_prefix": null, "coin_label": "Vertcoin", "coin_name": "Vertcoin", "coin_shortcut": "VTC", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 1000}, "dust_limit": 54600, "force_bip143": false, "fork_id": null, "github": "https://github.com/vertcoin-project/vertcoin-core", "hash_genesis_block": "4d96a915f49d40b1e5c2844d1ee2dccb90013a990ccea12c492d22110489f0c4", "key": "bitcoin:VTC", "maintainer": "Jochen Hoenicke ", "max_address_length": 34, "maxfee_kb": 40000000, "min_address_length": 27, "minfee_kb": 100000, "name": "Vertcoin", "negative_fee": false, "segwit": true, "shortcut": "VTC", "signed_message_header": "Vertcoin Signed Message:\n", "slip44": 28, "support": {"connect": true, "trezor1": "1.6.1", "trezor2": "2.0.5", "webwallet": true}, "uri_prefix": "vertcoin", "website": "https://vertcoin.org", "xprv_magic": 76066276, "xpub_magic": 76067358, "xpub_magic_segwit_native": 78792518, "xpub_magic_segwit_p2sh": 77429938}, {"address_type": 71, "address_type_p2sh": 33, "bech32_prefix": "via", "bip115": false, "bitcore": ["https://explorer.viacoin.org"], "blockbook": [], "blocktime_seconds": 24, "cashaddr_prefix": null, "coin_label": "Viacoin", "coin_name": "Viacoin", "coin_shortcut": "VIA", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Economy": 7000, "High": 20000, "Low": 1000, "Normal": 14000}, "dust_limit": 54600, "force_bip143": false, "fork_id": null, "github": "https://github.com/viacoin", "hash_genesis_block": "4e9b54001f9976049830128ec0331515eaabe35a70970d79971da1539a400ba1", "key": "bitcoin:VIA", "maintainer": "romanornr ", "max_address_length": 34, "maxfee_kb": 40000000, "min_address_length": 27, "minfee_kb": 1000, "name": "Viacoin", "negative_fee": false, "segwit": true, "shortcut": "VIA", "signed_message_header": "Viacoin Signed Message:\n", "slip44": 14, "support": {"connect": true, "trezor1": "1.6.2", "trezor2": "2.0.7", "webwallet": true}, "uri_prefix": "viacoin", "website": "https://viacoin.org", "xprv_magic": 76066276, "xpub_magic": 76067358, "xpub_magic_segwit_native": 78792518, "xpub_magic_segwit_p2sh": 77429938}, {"address_type": 142, "address_type_p2sh": 145, "bech32_prefix": null, "bip115": false, "bitcore": [], "blockbook": ["https://blockbook.zcore.cash"], "blocktime_seconds": 120, "cashaddr_prefix": null, "coin_label": "ZCore", "coin_name": "ZCore", "coin_shortcut": "ZCR", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 10}, "dust_limit": 546, "force_bip143": false, "fork_id": null, "github": "https://github.com/zcore-coin/zcore-2.0", "hash_genesis_block": "695b79c8c234b45b2eeb4722f33373e471c9b686ff78efeb39da95f824a9f81b", "key": "bitcoin:ZCR", "maintainer": "Erick Costa ", "max_address_length": 95, "maxfee_kb": 1000000, "min_address_length": 34, "minfee_kb": 1000, "name": "ZCore", "negative_fee": false, "segwit": false, "shortcut": "ZCR", "signed_message_header": "DarkNet Signed Message:\n", "slip44": 428, "support": {"connect": true, "trezor1": "1.8.4", "trezor2": "2.1.7", "webwallet": true}, "uri_prefix": "zcore", "website": "https://zcore.cash", "xprv_magic": 78791432, "xpub_magic": 78792518, "xpub_magic_segwit_native": null, "xpub_magic_segwit_p2sh": null}, {"address_type": 7352, "address_type_p2sh": 7357, "bech32_prefix": null, "bip115": false, "bitcore": [], "blockbook": ["https://zec1.trezor.io", "https://zec2.trezor.io", "https://zec3.trezor.io", "https://zec4.trezor.io", "https://zec5.trezor.io"], "blocktime_seconds": 150, "cashaddr_prefix": null, "coin_label": "Zcash", "coin_name": "Zcash", "coin_shortcut": "ZEC", "confidential_assets": null, "consensus_branch_id": {"1": 0, "2": 0, "3": 1537743641, "4": 733220448}, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 10}, "dust_limit": 546, "force_bip143": false, "fork_id": null, "github": "https://github.com/zcash/zcash", "hash_genesis_block": "00040fe8ec8471911baa1db1266ea15dd06b4a8a5c453883c000b031973dce08", "key": "bitcoin:ZEC", "maintainer": "Pavol Rusnak ", "max_address_length": 95, "maxfee_kb": 1000000, "min_address_length": 35, "minfee_kb": 1000, "name": "Zcash", "negative_fee": false, "segwit": false, "shortcut": "ZEC", "signed_message_header": "Zcash Signed Message:\n", "slip44": 133, "support": {"connect": true, "trezor1": "1.7.1", "trezor2": "2.0.8", "webwallet": true}, "uri_prefix": "zcash", "website": "https://z.cash", "xprv_magic": 76066276, "xpub_magic": 76067358, "xpub_magic_segwit_native": null, "xpub_magic_segwit_p2sh": null}, {"address_type": 7461, "address_type_p2sh": 7354, "bech32_prefix": null, "bip115": false, "bitcore": ["https://explorer.testnet.z.cash"], "blockbook": [], "blocktime_seconds": 150, "cashaddr_prefix": null, "coin_label": "Zcash Testnet", "coin_name": "Zcash Testnet", "coin_shortcut": "TAZ", "confidential_assets": null, "consensus_branch_id": {"1": 0, "2": 0, "3": 1537743641, "4": 733220448}, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 10}, "dust_limit": 546, "force_bip143": false, "fork_id": null, "github": "https://github.com/zcash/zcash", "hash_genesis_block": "05a60a92d99d85997cce3b87616c089f6124d7342af37106edc76126334a2c38", "key": "bitcoin:TAZ", "maintainer": "Pavol Rusnak ", "max_address_length": 95, "maxfee_kb": 10000000, "min_address_length": 35, "minfee_kb": 1000, "name": "Zcash Testnet", "negative_fee": false, "segwit": false, "shortcut": "TAZ", "signed_message_header": "Zcash Signed Message:\n", "slip44": 1, "support": {"connect": true, "trezor1": "1.6.2", "trezor2": "2.0.7", "webwallet": true}, "uri_prefix": "zcash", "website": "https://z.cash", "xprv_magic": 70615956, "xpub_magic": 70617039, "xpub_magic_segwit_native": null, "xpub_magic_segwit_p2sh": null}, {"address_type": 82, "address_type_p2sh": 7, "bech32_prefix": null, "bip115": false, "bitcore": ["https://insight.zcoin.io"], "blockbook": [], "blocktime_seconds": 600, "cashaddr_prefix": null, "coin_label": "Zcoin", "coin_name": "Zcoin", "coin_shortcut": "XZC", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Economy": 10, "High": 200, "Low": 1, "Normal": 100}, "dust_limit": 546, "force_bip143": false, "fork_id": null, "github": "https://github.com/zcoinofficial/zcoin", "hash_genesis_block": "4381deb85b1b2c9843c222944b616d997516dcbd6a964e1eaf0def0830695233", "key": "bitcoin:XZC", "maintainer": "Yura Pakhuchiy ", "max_address_length": 34, "maxfee_kb": 1000000, "min_address_length": 27, "minfee_kb": 0, "name": "Zcoin", "negative_fee": false, "segwit": false, "shortcut": "XZC", "signed_message_header": "Zcoin Signed Message:\n", "slip44": 136, "support": {"connect": true, "trezor1": "1.6.2", "trezor2": "2.0.7", "webwallet": true}, "uri_prefix": "zcoin", "website": "https://zcoin.io", "xprv_magic": 76066276, "xpub_magic": 76067358, "xpub_magic_segwit_native": null, "xpub_magic_segwit_p2sh": null}, {"address_type": 65, "address_type_p2sh": 178, "bech32_prefix": null, "bip115": false, "bitcore": [], "blockbook": [], "blocktime_seconds": 600, "cashaddr_prefix": null, "coin_label": "Zcoin Testnet", "coin_name": "Zcoin Testnet", "coin_shortcut": "tXZC", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Economy": 10, "High": 200, "Low": 1, "Normal": 100}, "dust_limit": 546, "force_bip143": false, "fork_id": null, "github": "https://github.com/zcoinofficial/zcoin", "hash_genesis_block": "7ac038c193c2158c428c59f9ae0c02a07115141c6e9dc244ae96132e99b4e642", "key": "bitcoin:tXZC", "maintainer": "Yura Pakhuchiy ", "max_address_length": 35, "maxfee_kb": 1000000, "min_address_length": 27, "minfee_kb": 0, "name": "Zcoin Testnet", "negative_fee": false, "segwit": false, "shortcut": "tXZC", "signed_message_header": "Zcoin Signed Message:\n", "slip44": 1, "support": {"connect": true, "trezor1": "1.6.2", "trezor2": "2.0.7", "webwallet": false}, "uri_prefix": "testzcoin", "website": "https://zcoin.io", "xprv_magic": 70615956, "xpub_magic": 70617039, "xpub_magic_segwit_native": null, "xpub_magic_segwit_p2sh": null}, {"address_type": 7352, "address_type_p2sh": 7357, "bech32_prefix": null, "bip115": false, "bitcore": [], "blockbook": ["https://blockbook.zel.network"], "blocktime_seconds": 120, "cashaddr_prefix": null, "coin_label": "Zel", "coin_name": "ZelCash", "coin_shortcut": "ZEL", "confidential_assets": null, "consensus_branch_id": null, "cooldown": 100, "curve_name": "secp256k1", "decimals": 8, "decred": false, "default_fee_b": {"Normal": 10}, "dust_limit": 546, "force_bip143": false, "fork_id": null, "github": "https://github.com/zelcash", "hash_genesis_block": "00052461a5006c2e3b74ce48992a08695607912d5604c3eb8da25749b0900444", "key": "bitcoin:ZEL", "maintainer": "Cabecinha84 ", "max_address_length": 95, "maxfee_kb": 1000000, "min_address_length": 35, "minfee_kb": 1000, "name": "Zel", "negative_fee": false, "segwit": false, "shortcut": "ZEL", "signed_message_header": "Zcash Signed Message:\n", "slip44": 19167, "support": {"connect": false, "trezor1": "1.8.3", "trezor2": "2.1.4", "webwallet": false}, "uri_prefix": "zelcash", "website": "https://zel.network", "xprv_magic": 76066276, "xpub_magic": 76067358, "xpub_magic_segwit_native": null, "xpub_magic_segwit_p2sh": null}] python-trezor-0.11.6/src/trezorlib/coins.py000066400000000000000000000027041361427340300207410ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . import json import os.path from .tx_api import TxApi COINS_JSON = os.path.join(os.path.dirname(__file__), "coins.json") def _load_coins_json(): # Load coins.json to local variables # NOTE: coins.json is generated via `make coins_json` command. with open(COINS_JSON) as coins_json: return json.load(coins_json) # exported variables __all__ = ["by_name", "slip44", "tx_api"] try: coins_list = _load_coins_json() by_name = {coin["coin_name"]: coin for coin in coins_list} except Exception as e: raise ImportError("Failed to load coins.json. Check your installation.") from e slip44 = {name: coin["slip44"] for name, coin in by_name.items()} tx_api = { name: TxApi(coin) for name, coin in by_name.items() if coin["blockbook"] or coin["bitcore"] } python-trezor-0.11.6/src/trezorlib/cosi.py000066400000000000000000000111301361427340300205540ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . from functools import reduce from typing import Iterable, List, Tuple from . import _ed25519, messages from .tools import expect # XXX, these could be NewType's, but that would infect users of the cosi module with these types as well. # Unsure if we want that. Ed25519PrivateKey = bytes Ed25519PublicPoint = bytes Ed25519Signature = bytes def combine_keys(pks: Iterable[Ed25519PublicPoint]) -> Ed25519PublicPoint: """Combine a list of Ed25519 points into a "global" CoSi key.""" P = [_ed25519.decodepoint(pk) for pk in pks] combine = reduce(_ed25519.edwards_add, P) return Ed25519PublicPoint(_ed25519.encodepoint(combine)) def combine_sig( global_R: Ed25519PublicPoint, sigs: Iterable[Ed25519Signature] ) -> Ed25519Signature: """Combine a list of signatures into a single CoSi signature.""" S = [_ed25519.decodeint(si) for si in sigs] s = sum(S) % _ed25519.l sig = global_R + _ed25519.encodeint(s) return Ed25519Signature(sig) def get_nonce( sk: Ed25519PrivateKey, data: bytes, ctr: int = 0 ) -> Tuple[int, Ed25519PublicPoint]: """Calculate CoSi nonces for given data. These differ from Ed25519 deterministic nonces in that there is a counter appended at end. Returns both the private point `r` and the partial signature `R`. `r` is returned for performance reasons: :func:`sign_with_privkey` takes it as its `nonce` argument so that it doesn't repeat the `get_nonce` call. `R` should be combined with other partial signatures through :func:`combine_keys` to obtain a "global commitment". """ # r = hash(hash(sk)[b .. 2b] + M + ctr) # R = rB h = _ed25519.H(sk) bytesize = _ed25519.b // 8 assert len(h) == bytesize * 2 r = _ed25519.Hint(h[bytesize:] + data + ctr.to_bytes(4, "big")) R = _ed25519.scalarmult(_ed25519.B, r) return r, Ed25519PublicPoint(_ed25519.encodepoint(R)) def verify( signature: Ed25519Signature, digest: bytes, pub_key: Ed25519PublicPoint ) -> None: """Verify Ed25519 signature. Raise exception if the signature is invalid.""" # XXX this *might* change to bool function _ed25519.checkvalid(signature, digest, pub_key) def verify_m_of_n( signature: Ed25519Signature, digest: bytes, m: int, n: int, mask: int, keys: List[Ed25519PublicPoint], ) -> None: if m < 1: raise ValueError("At least 1 signer must be specified") selected_keys = [keys[i] for i in range(n) if mask & (1 << i)] if len(selected_keys) < m: raise ValueError( "Not enough signers ({} required, {} found)".format(m, len(selected_keys)) ) global_pk = combine_keys(selected_keys) return verify(signature, digest, global_pk) def pubkey_from_privkey(privkey: Ed25519PrivateKey) -> Ed25519PublicPoint: """Interpret 32 bytes of data as an Ed25519 private key. Calculate and return the corresponding public key. """ return Ed25519PublicPoint(_ed25519.publickey_unsafe(privkey)) def sign_with_privkey( digest: bytes, privkey: Ed25519PrivateKey, global_pubkey: Ed25519PublicPoint, nonce: int, global_commit: Ed25519PublicPoint, ) -> Ed25519Signature: """Create a CoSi signature of `digest` with the supplied private key. This function needs to know the global public key and global commitment. """ h = _ed25519.H(privkey) a = _ed25519.decodecoord(h) S = (nonce + _ed25519.Hint(global_commit + global_pubkey + digest) * a) % _ed25519.l return Ed25519Signature(_ed25519.encodeint(S)) # ====== Client functions ====== # @expect(messages.CosiCommitment) def commit(client, n, data): return client.call(messages.CosiCommit(address_n=n, data=data)) @expect(messages.CosiSignature) def sign(client, n, data, global_commitment, global_pubkey): return client.call( messages.CosiSign( address_n=n, data=data, global_commitment=global_commitment, global_pubkey=global_pubkey, ) ) python-trezor-0.11.6/src/trezorlib/debuglink.py000066400000000000000000000400271361427340300215720ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . from collections import namedtuple from copy import deepcopy from mnemonic import Mnemonic from . import messages as proto, protobuf from .client import TrezorClient from .tools import expect EXPECTED_RESPONSES_CONTEXT_LINES = 3 LayoutLines = namedtuple("LayoutLines", "lines text") def layout_lines(lines): return LayoutLines(lines, " ".join(lines)) class DebugLink: def __init__(self, transport, auto_interact=True): self.transport = transport self.allow_interactions = auto_interact def open(self): self.transport.begin_session() def close(self): self.transport.end_session() def _call(self, msg, nowait=False): self.transport.write(msg) if nowait: return None ret = self.transport.read() return ret def state(self): return self._call(proto.DebugLinkGetState()) def read_layout(self): return layout_lines(self.state().layout_lines) def wait_layout(self): obj = self._call(proto.DebugLinkGetState(wait_layout=True)) return layout_lines(obj.layout_lines) def read_pin(self): state = self.state() return state.pin, state.matrix def read_pin_encoded(self): return self.encode_pin(*self.read_pin()) def encode_pin(self, pin, matrix=None): """Transform correct PIN according to the displayed matrix.""" if matrix is None: _, matrix = self.read_pin() return "".join([str(matrix.index(p) + 1) for p in pin]) def read_mnemonic_secret(self): obj = self._call(proto.DebugLinkGetState()) return obj.mnemonic_secret def read_recovery_word(self): obj = self._call(proto.DebugLinkGetState()) return (obj.recovery_fake_word, obj.recovery_word_pos) def read_reset_word(self): obj = self._call(proto.DebugLinkGetState(wait_word_list=True)) return obj.reset_word def read_reset_word_pos(self): obj = self._call(proto.DebugLinkGetState(wait_word_pos=True)) return obj.reset_word_pos def read_reset_entropy(self): obj = self._call(proto.DebugLinkGetState()) return obj.reset_entropy def read_passphrase_protection(self): obj = self._call(proto.DebugLinkGetState()) return obj.passphrase_protection def input(self, word=None, button=None, swipe=None, x=None, y=None, wait=False): if not self.allow_interactions: return args = sum(a is not None for a in (word, button, swipe, x)) if args != 1: raise ValueError("Invalid input - must use one of word, button, swipe") decision = proto.DebugLinkDecision( yes_no=button, swipe=swipe, input=word, x=x, y=y, wait=wait ) ret = self._call(decision, nowait=not wait) if ret is not None: return layout_lines(ret.lines) def click(self, click, wait=False): x, y = click return self.input(x=x, y=y, wait=wait) def press_yes(self): self.input(button=True) def press_no(self): self.input(button=False) def swipe_up(self): self.input(swipe=proto.DebugSwipeDirection.UP) def swipe_down(self): self.input(swipe=proto.DebugSwipeDirection.DOWN) def swipe_right(self): self.input(swipe=proto.DebugSwipeDirection.RIGHT) def swipe_left(self): self.input(swipe=proto.DebugSwipeDirection.LEFT) def stop(self): self._call(proto.DebugLinkStop(), nowait=True) @expect(proto.DebugLinkMemory, field="memory") def memory_read(self, address, length): return self._call(proto.DebugLinkMemoryRead(address=address, length=length)) def memory_write(self, address, memory, flash=False): self._call( proto.DebugLinkMemoryWrite(address=address, memory=memory, flash=flash), nowait=True, ) def flash_erase(self, sector): self._call(proto.DebugLinkFlashErase(sector=sector), nowait=True) class NullDebugLink(DebugLink): def __init__(self): super().__init__(None) def open(self): pass def close(self): pass def _call(self, msg, nowait=False): if not nowait: if isinstance(msg, proto.DebugLinkGetState): return proto.DebugLinkState() else: raise RuntimeError("unexpected call to a fake debuglink") class DebugUI: INPUT_FLOW_DONE = object() def __init__(self, debuglink: DebugLink): self.debuglink = debuglink self.pin = None self.passphrase = "sphinx of black quartz, judge my wov" self.input_flow = None def button_request(self, code): if self.input_flow is None: # XXX # On Trezor T, in some rare cases, two layouts may be queuing for events at # the same time. A new workflow will first send out a ButtonRequest, wait # for a ButtonAck, and only then display a layout (closing the old one). # That means that if a layout that accepts debuglink decisions is currently # on screen, it has a good chance of accepting the following `press_yes` # before it can be closed by the newly open layout from the new workflow. # # This happens in particular when the recovery homescreen is on, because # it is a homescreen that accepts debuglink decisions. # # To prevent the issue, we insert a `wait_layout`, which on TT will only # return after the screen is refreshed, so we are certain that the new # layout is on. On T1 it is a no-op. # # This could run into trouble if some workflow asks for a ButtonRequest # without refreshing the screen. # This will also freeze on old bridges, where Read and Write are not # separate operations, because it relies on ButtonAck being sent without # waiting for a response. self.debuglink.wait_layout() self.debuglink.press_yes() elif self.input_flow is self.INPUT_FLOW_DONE: raise AssertionError("input flow ended prematurely") else: try: self.input_flow.send(code) except StopIteration: self.input_flow = self.INPUT_FLOW_DONE def get_pin(self, code=None): if self.pin: return self.pin else: return self.debuglink.read_pin_encoded() def get_passphrase(self): return self.passphrase class TrezorClientDebugLink(TrezorClient): # This class implements automatic responses # and other functionality for unit tests # for various callbacks, created in order # to automatically pass unit tests. # # This mixing should be used only for purposes # of unit testing, because it will fail to work # without special DebugLink interface provided # by the device. def __init__(self, transport, auto_interact=True): try: debug_transport = transport.find_debug() self.debug = DebugLink(debug_transport, auto_interact) # try to open debuglink, see if it works self.debug.open() self.debug.close() except Exception: if not auto_interact: self.debug = NullDebugLink() else: raise self.ui = DebugUI(self.debug) self.in_with_statement = 0 self.screenshot_id = 0 self.filters = {} # Always press Yes and provide correct pin self.setup_debuglink(True, True) # Do not expect any specific response from device self.expected_responses = None self.current_response = None # Use blank passphrase self.set_passphrase("") super().__init__(transport, ui=self.ui) def open(self): super().open() self.debug.open() def close(self): self.debug.close() super().close() def set_filter(self, message_type, callback): self.filters[message_type] = callback def _filter_message(self, msg): message_type = msg.__class__ callback = self.filters.get(message_type) if callable(callback): return callback(deepcopy(msg)) else: return msg def set_input_flow(self, input_flow): if input_flow is None: self.ui.input_flow = None return if not self.in_with_statement: raise RuntimeError("Must be called inside 'with' statement") if callable(input_flow): input_flow = input_flow() if not hasattr(input_flow, "send"): raise RuntimeError("input_flow should be a generator function") self.ui.input_flow = input_flow next(input_flow) # can't send before first yield def __enter__(self): # For usage in with/expected_responses self.in_with_statement += 1 return self def __exit__(self, _type, value, traceback): self.in_with_statement -= 1 # Clear input flow. self.set_input_flow(None) if _type is not None: # Another exception raised return False if self.expected_responses is None: # no need to check anything else return False # return isinstance(value, TypeError) # Evaluate missed responses in 'with' statement if self.current_response < len(self.expected_responses): self._raise_unexpected_response(None) # Cleanup self.expected_responses = None self.current_response = None return False def set_expected_responses(self, expected): if not self.in_with_statement: raise RuntimeError("Must be called inside 'with' statement") self.expected_responses = expected self.current_response = 0 def setup_debuglink(self, button, pin_correct): # self.button = button # True -> YES button, False -> NO button if pin_correct: self.ui.pin = None else: self.ui.pin = "444222" def set_passphrase(self, passphrase): self.ui.passphrase = Mnemonic.normalize_string(passphrase) def set_mnemonic(self, mnemonic): self.mnemonic = Mnemonic.normalize_string(mnemonic).split(" ") def _raw_read(self): __tracebackhide__ = True # for pytest # pylint: disable=W0612 # if SCREENSHOT and self.debug: # from PIL import Image # layout = self.debug.state().layout # im = Image.new("RGB", (128, 64)) # pix = im.load() # for x in range(128): # for y in range(64): # rx, ry = 127 - x, 63 - y # if (ord(layout[rx + (ry / 8) * 128]) & (1 << (ry % 8))) > 0: # pix[x, y] = (255, 255, 255) # im.save("scr%05d.png" % self.screenshot_id) # self.screenshot_id += 1 resp = super()._raw_read() resp = self._filter_message(resp) self._check_request(resp) return resp def _raw_write(self, msg): return super()._raw_write(self._filter_message(msg)) def _raise_unexpected_response(self, msg): __tracebackhide__ = True # for pytest # pylint: disable=W0612 start_at = max(self.current_response - EXPECTED_RESPONSES_CONTEXT_LINES, 0) stop_at = min( self.current_response + EXPECTED_RESPONSES_CONTEXT_LINES + 1, len(self.expected_responses), ) output = [] output.append("Expected responses:") if start_at > 0: output.append(" (...{} previous responses omitted)".format(start_at)) for i in range(start_at, stop_at): exp = self.expected_responses[i] prefix = " " if i != self.current_response else ">>> " set_fields = { key: value for key, value in exp.__dict__.items() if value is not None and value != [] } oneline_str = ", ".join("{}={!r}".format(*i) for i in set_fields.items()) if len(oneline_str) < 60: output.append( "{}{}({})".format(prefix, exp.__class__.__name__, oneline_str) ) else: item = [] item.append("{}{}(".format(prefix, exp.__class__.__name__)) for key, value in set_fields.items(): item.append("{} {}={!r}".format(prefix, key, value)) item.append("{})".format(prefix)) output.append("\n".join(item)) if stop_at < len(self.expected_responses): omitted = len(self.expected_responses) - stop_at output.append(" (...{} following responses omitted)".format(omitted)) output.append("") if msg is not None: output.append("Actually received:") output.append(protobuf.format_message(msg)) else: output.append("This message was never received.") raise AssertionError("\n".join(output)) def _check_request(self, msg): __tracebackhide__ = True # for pytest # pylint: disable=W0612 if self.expected_responses is None: return if self.current_response >= len(self.expected_responses): raise AssertionError( "No more messages were expected, but we got:\n" + protobuf.format_message(msg) ) expected = self.expected_responses[self.current_response] if msg.__class__ != expected.__class__: self._raise_unexpected_response(msg) for field, value in expected.__dict__.items(): if value is None or value == []: continue if getattr(msg, field) != value: self._raise_unexpected_response(msg) self.current_response += 1 def mnemonic_callback(self, _): word, pos = self.debug.read_recovery_word() if word != "": return word if pos != 0: return self.mnemonic[pos - 1] raise RuntimeError("Unexpected call") @expect(proto.Success, field="message") def load_device( client, mnemonic, pin, passphrase_protection, label, language="en-US", skip_checksum=False, needs_backup=False, no_backup=False, ): if not isinstance(mnemonic, (list, tuple)): mnemonic = [mnemonic] mnemonics = [Mnemonic.normalize_string(m) for m in mnemonic] if client.features.initialized: raise RuntimeError( "Device is initialized already. Call device.wipe() and try again." ) resp = client.call( proto.LoadDevice( mnemonics=mnemonics, pin=pin, passphrase_protection=passphrase_protection, language=language, label=label, skip_checksum=skip_checksum, needs_backup=needs_backup, no_backup=no_backup, ) ) client.init_device() return resp # keep the old name for compatibility load_device_by_mnemonic = load_device @expect(proto.Success, field="message") def self_test(client): if client.features.bootloader_mode is not True: raise RuntimeError("Device must be in bootloader mode") return client.call( proto.SelfTest( payload=b"\x00\xFF\x55\xAA\x66\x99\x33\xCCABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\x00\xFF\x55\xAA\x66\x99\x33\xCC" ) ) python-trezor-0.11.6/src/trezorlib/device.py000066400000000000000000000143161361427340300210670ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . import os import time import warnings from . import messages from .exceptions import Cancelled from .tools import expect, session from .transport import enumerate_devices, get_transport RECOVERY_BACK = "\x08" # backspace character, sent literally class TrezorDevice: """ This class is deprecated. (There is no reason for it to exist in the first place, it is nothing but a collection of two functions.) Instead, please use functions from the ``trezorlib.transport`` module. """ @classmethod def enumerate(cls): warnings.warn("TrezorDevice is deprecated.", DeprecationWarning) return enumerate_devices() @classmethod def find_by_path(cls, path): warnings.warn("TrezorDevice is deprecated.", DeprecationWarning) return get_transport(path, prefix_search=False) @expect(messages.Success, field="message") def apply_settings( client, label=None, language=None, use_passphrase=None, homescreen=None, passphrase_source=None, auto_lock_delay_ms=None, display_rotation=None, ): settings = messages.ApplySettings() if label is not None: settings.label = label if language: settings.language = language if use_passphrase is not None: settings.use_passphrase = use_passphrase if homescreen is not None: settings.homescreen = homescreen if passphrase_source is not None: settings.passphrase_source = passphrase_source if auto_lock_delay_ms is not None: settings.auto_lock_delay_ms = auto_lock_delay_ms if display_rotation is not None: settings.display_rotation = display_rotation out = client.call(settings) client.init_device() # Reload Features return out @expect(messages.Success, field="message") def apply_flags(client, flags): out = client.call(messages.ApplyFlags(flags=flags)) client.init_device() # Reload Features return out @expect(messages.Success, field="message") def change_pin(client, remove=False): ret = client.call(messages.ChangePin(remove=remove)) client.init_device() # Re-read features return ret @expect(messages.Success, field="message") def change_wipe_code(client, remove=False): ret = client.call(messages.ChangeWipeCode(remove=remove)) client.init_device() # Re-read features return ret @expect(messages.Success, field="message") def sd_protect(client, operation): ret = client.call(messages.SdProtect(operation=operation)) client.init_device() return ret @expect(messages.Success, field="message") def wipe(client): ret = client.call(messages.WipeDevice()) client.init_device() return ret def recover( client, word_count=24, passphrase_protection=False, pin_protection=True, label=None, language="en-US", input_callback=None, type=messages.RecoveryDeviceType.ScrambledWords, dry_run=False, u2f_counter=None, ): if client.features.model == "1" and input_callback is None: raise RuntimeError("Input callback required for Trezor One") if word_count not in (12, 18, 24): raise ValueError("Invalid word count. Use 12/18/24") if client.features.initialized and not dry_run: raise RuntimeError( "Device already initialized. Call device.wipe() and try again." ) if u2f_counter is None: u2f_counter = int(time.time()) msg = messages.RecoveryDevice( word_count=word_count, enforce_wordlist=True, type=type, dry_run=dry_run ) if not dry_run: # set additional parameters msg.passphrase_protection = passphrase_protection msg.pin_protection = pin_protection msg.label = label msg.language = language msg.u2f_counter = u2f_counter res = client.call(msg) while isinstance(res, messages.WordRequest): try: inp = input_callback(res.type) res = client.call(messages.WordAck(word=inp)) except Cancelled: res = client.call(messages.Cancel()) client.init_device() return res @expect(messages.Success, field="message") @session def reset( client, display_random=False, strength=None, passphrase_protection=False, pin_protection=True, label=None, language="en-US", u2f_counter=0, skip_backup=False, no_backup=False, backup_type=messages.BackupType.Bip39, ): if client.features.initialized: raise RuntimeError( "Device is initialized already. Call wipe_device() and try again." ) if strength is None: if client.features.model == "1": strength = 256 else: strength = 128 # Begin with device reset workflow msg = messages.ResetDevice( display_random=bool(display_random), strength=strength, passphrase_protection=bool(passphrase_protection), pin_protection=bool(pin_protection), language=language, label=label, u2f_counter=u2f_counter, skip_backup=bool(skip_backup), no_backup=bool(no_backup), backup_type=backup_type, ) resp = client.call(msg) if not isinstance(resp, messages.EntropyRequest): raise RuntimeError("Invalid response, expected EntropyRequest") external_entropy = os.urandom(32) # LOG.debug("Computer generated entropy: " + external_entropy.hex()) ret = client.call(messages.EntropyAck(entropy=external_entropy)) client.init_device() return ret @expect(messages.Success, field="message") def backup(client): ret = client.call(messages.BackupDevice()) return ret python-trezor-0.11.6/src/trezorlib/eos.py000066400000000000000000000240021361427340300204070ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . from datetime import datetime from . import messages from .tools import CallException, b58decode, expect, session def name_to_number(name): length = len(name) value = 0 for i in range(0, 13): c = 0 if i < length and i < 13: c = char_to_symbol(name[i]) if i < 12: c &= 0x1F c <<= 64 - 5 * (i + 1) else: c &= 0x0F value |= c return value def char_to_symbol(c): if c >= "a" and c <= "z": return ord(c) - ord("a") + 6 elif c >= "1" and c <= "5": return ord(c) - ord("1") + 1 else: return 0 def parse_asset(asset): amount_str, symbol_str = asset.split(" ") # "-1.0000" => ["-1", "0000"] => -10000 amount_parts = amount_str.split(".", maxsplit=1) amount = int("".join(amount_parts)) precision = 0 if len(amount_parts) > 1: precision = len(amount_parts[1]) # 4, "EOS" => b"\x04EOS" => little-endian uint32 symbol_bytes = bytes([precision]) + symbol_str.encode() symbol = int.from_bytes(symbol_bytes, "little") return messages.EosAsset(amount=amount, symbol=symbol) def public_key_to_buffer(pub_key): _t = 0 if pub_key[:3] == "EOS": pub_key = pub_key[3:] _t = 0 elif pub_key[:7] == "PUB_K1_": pub_key = pub_key[7:] _t = 0 elif pub_key[:7] == "PUB_R1_": pub_key = pub_key[7:] _t = 1 return _t, b58decode(pub_key, None)[:-4] def parse_common(action): authorization = [] for auth in action["authorization"]: authorization.append( messages.EosPermissionLevel( actor=name_to_number(auth["actor"]), permission=name_to_number(auth["permission"]), ) ) return messages.EosActionCommon( account=name_to_number(action["account"]), name=name_to_number(action["name"]), authorization=authorization, ) def parse_transfer(data): return messages.EosActionTransfer( sender=name_to_number(data["from"]), receiver=name_to_number(data["to"]), memo=data["memo"], quantity=parse_asset(data["quantity"]), ) def parse_vote_producer(data): producers = [] for producer in data["producers"]: producers.append(name_to_number(producer)) return messages.EosActionVoteProducer( voter=name_to_number(data["account"]), proxy=name_to_number(data["proxy"]), producers=producers, ) def parse_buy_ram(data): return messages.EosActionBuyRam( payer=name_to_number(data["payer"]), receiver=name_to_number(data["receiver"]), quantity=parse_asset(data["quant"]), ) def parse_buy_rambytes(data): return messages.EosActionBuyRamBytes( payer=name_to_number(data["payer"]), receiver=name_to_number(data["receiver"]), bytes=int(data["bytes"]), ) def parse_sell_ram(data): return messages.EosActionSellRam( account=name_to_number(data["account"]), bytes=int(data["bytes"]) ) def parse_delegate(data): return messages.EosActionDelegate( sender=name_to_number(data["from"]), receiver=name_to_number(data["receiver"]), net_quantity=parse_asset(data["stake_net_quantity"]), cpu_quantity=parse_asset(data["stake_cpu_quantity"]), transfer=bool(data["transfer"]), ) def parse_undelegate(data): return messages.EosActionUndelegate( sender=name_to_number(data["from"]), receiver=name_to_number(data["receiver"]), net_quantity=parse_asset(data["unstake_net_quantity"]), cpu_quantity=parse_asset(data["unstake_cpu_quantity"]), ) def parse_refund(data): return messages.EosActionRefund(owner=name_to_number(data["owner"])) def parse_updateauth(data): auth = parse_authorization(data["auth"]) return messages.EosActionUpdateAuth( account=name_to_number(data["account"]), permission=name_to_number(data["permission"]), parent=name_to_number(data["parent"]), auth=auth, ) def parse_deleteauth(data): return messages.EosActionDeleteAuth( account=name_to_number(data["account"]), permission=name_to_number(data["permission"]), ) def parse_linkauth(data): return messages.EosActionLinkAuth( account=name_to_number(data["account"]), code=name_to_number(data["code"]), type=name_to_number(data["type"]), requirement=name_to_number(data["requirement"]), ) def parse_unlinkauth(data): return messages.EosActionUnlinkAuth( account=name_to_number(data["account"]), code=name_to_number(data["code"]), type=name_to_number(data["type"]), ) def parse_authorization(data): keys = [] for key in data["keys"]: _t, _k = public_key_to_buffer(key["key"]) keys.append( messages.EosAuthorizationKey(type=_t, key=_k, weight=int(key["weight"])) ) accounts = [] for account in data["accounts"]: accounts.append( messages.EosAuthorizationAccount( account=messages.EosPermissionLevel( actor=name_to_number(account["permission"]["actor"]), permission=name_to_number(account["permission"]["permission"]), ), weight=int(account["weight"]), ) ) waits = [] for wait in data["waits"]: waits.append( messages.EosAuthorizationWait( wait_sec=int(wait["wait_sec"]), weight=int(wait["weight"]) ) ) return messages.EosAuthorization( threshold=int(data["threshold"]), keys=keys, accounts=accounts, waits=waits ) def parse_new_account(data): owner = parse_authorization(data["owner"]) active = parse_authorization(data["active"]) return messages.EosActionNewAccount( creator=name_to_number(data["creator"]), name=name_to_number(data["name"]), owner=owner, active=active, ) def parse_unknown(data): data_bytes = bytes.fromhex(data) return messages.EosActionUnknown(data_size=len(data_bytes), data_chunk=data_bytes) def parse_action(action): tx_action = messages.EosTxActionAck() data = action["data"] tx_action.common = parse_common(action) if action["account"] == "eosio": if action["name"] == "voteproducer": tx_action.vote_producer = parse_vote_producer(data) elif action["name"] == "buyram": tx_action.buy_ram = parse_buy_ram(data) elif action["name"] == "buyrambytes": tx_action.buy_ram_bytes = parse_buy_rambytes(data) elif action["name"] == "sellram": tx_action.sell_ram = parse_sell_ram(data) elif action["name"] == "delegatebw": tx_action.delegate = parse_delegate(data) elif action["name"] == "undelegatebw": tx_action.undelegate = parse_undelegate(data) elif action["name"] == "refund": tx_action.refund = parse_refund(data) elif action["name"] == "updateauth": tx_action.update_auth = parse_updateauth(data) elif action["name"] == "deleteauth": tx_action.delete_auth = parse_deleteauth(data) elif action["name"] == "linkauth": tx_action.link_auth = parse_linkauth(data) elif action["name"] == "unlinkauth": tx_action.unlink_auth = parse_unlinkauth(data) elif action["name"] == "newaccount": tx_action.new_account = parse_new_account(data) elif action["name"] == "transfer": tx_action.transfer = parse_transfer(data) else: tx_action.unknown = parse_unknown(data) return tx_action def parse_transaction_json(transaction): header = messages.EosTxHeader() header.expiration = int( ( datetime.strptime(transaction["expiration"], "%Y-%m-%dT%H:%M:%S") - datetime(1970, 1, 1) ).total_seconds() ) header.ref_block_num = int(transaction["ref_block_num"]) header.ref_block_prefix = int(transaction["ref_block_prefix"]) header.max_net_usage_words = int(transaction["max_net_usage_words"]) header.max_cpu_usage_ms = int(transaction["max_cpu_usage_ms"]) header.delay_sec = int(transaction["delay_sec"]) actions = [parse_action(a) for a in transaction["actions"]] return header, actions # ====== Client functions ====== # @expect(messages.EosPublicKey) def get_public_key(client, n, show_display=False, multisig=None): response = client.call( messages.EosGetPublicKey(address_n=n, show_display=show_display) ) return response @session def sign_tx(client, address, transaction, chain_id): header, actions = parse_transaction_json(transaction) msg = messages.EosSignTx() msg.address_n = address msg.chain_id = bytes.fromhex(chain_id) msg.header = header msg.num_actions = len(actions) response = client.call(msg) try: while isinstance(response, messages.EosTxActionRequest): response = client.call(actions.pop(0)) except IndexError: # pop from empty list raise CallException( "Eos.UnexpectedEndOfOperations", "Reached end of operations without a signature.", ) from None if not isinstance(response, messages.EosSignedTx): raise CallException(messages.FailureType.UnexpectedMessage, response) return response python-trezor-0.11.6/src/trezorlib/ethereum.py000066400000000000000000000057111361427340300214450ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . from . import messages as proto from .tools import CallException, expect, normalize_nfc, session def int_to_big_endian(value): return value.to_bytes((value.bit_length() + 7) // 8, "big") # ====== Client functions ====== # @expect(proto.EthereumAddress, field="address") def get_address(client, n, show_display=False, multisig=None): return client.call(proto.EthereumGetAddress(address_n=n, show_display=show_display)) @expect(proto.EthereumPublicKey) def get_public_node(client, n, show_display=False): return client.call( proto.EthereumGetPublicKey(address_n=n, show_display=show_display) ) @session def sign_tx( client, n, nonce, gas_price, gas_limit, to, value, data=None, chain_id=None, tx_type=None, ): msg = proto.EthereumSignTx( address_n=n, nonce=int_to_big_endian(nonce), gas_price=int_to_big_endian(gas_price), gas_limit=int_to_big_endian(gas_limit), value=int_to_big_endian(value), to=to, chain_id=chain_id, tx_type=tx_type, ) if data: msg.data_length = len(data) data, chunk = data[1024:], data[:1024] msg.data_initial_chunk = chunk response = client.call(msg) while response.data_length is not None: data_length = response.data_length data, chunk = data[data_length:], data[:data_length] response = client.call(proto.EthereumTxAck(data_chunk=chunk)) # https://github.com/trezor/trezor-core/pull/311 # only signature bit returned. recalculate signature_v if response.signature_v <= 1: response.signature_v += 2 * chain_id + 35 return response.signature_v, response.signature_r, response.signature_s @expect(proto.EthereumMessageSignature) def sign_message(client, n, message): message = normalize_nfc(message) return client.call(proto.EthereumSignMessage(address_n=n, message=message)) def verify_message(client, address, signature, message): message = normalize_nfc(message) try: resp = client.call( proto.EthereumVerifyMessage( address=address, signature=signature, message=message ) ) except CallException as e: resp = e if isinstance(resp, proto.Success): return True return False python-trezor-0.11.6/src/trezorlib/exceptions.py000066400000000000000000000027751361427340300220170ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . class TrezorException(Exception): pass class TrezorFailure(TrezorException): def __init__(self, failure): self.failure = failure # TODO: this is backwards compatibility with tests. it should be changed super().__init__(self.failure.code, self.failure.message) def __str__(self): from .messages import FailureType types = { getattr(FailureType, name): name for name in dir(FailureType) if not name.startswith("_") } if self.failure.message is not None: return "{}: {}".format(types[self.failure.code], self.failure.message) else: return types[self.failure.code] class PinException(TrezorException): pass class Cancelled(TrezorException): pass class OutdatedFirmwareError(TrezorException): pass python-trezor-0.11.6/src/trezorlib/fido.py000066400000000000000000000027401361427340300205470ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . from . import messages from .tools import expect @expect(messages.WebAuthnCredentials, field="credentials") def list_credentials(client): return client.call(messages.WebAuthnListResidentCredentials()) @expect(messages.Success, field="message") def add_credential(client, credential_id): return client.call(messages.WebAuthnAddResidentCredential(credential_id)) @expect(messages.Success, field="message") def remove_credential(client, index): return client.call(messages.WebAuthnRemoveResidentCredential(index)) @expect(messages.Success, field="message") def set_counter(client, u2f_counter): return client.call(messages.SetU2FCounter(u2f_counter=u2f_counter)) @expect(messages.NextU2FCounter, field="u2f_counter") def get_next_counter(client): return client.call(messages.GetNextU2FCounter()) python-trezor-0.11.6/src/trezorlib/firmware.py000066400000000000000000000335531361427340300214500ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . import hashlib from enum import Enum from typing import Callable, List, NewType, Tuple import construct as c import ecdsa from . import cosi, messages, tools try: from hashlib import blake2s except ImportError: from pyblake2 import blake2s V1_SIGNATURE_SLOTS = 3 V1_BOOTLOADER_KEYS = { 1: "04d571b7f148c5e4232c3814f777d8faeaf1a84216c78d569b71041ffc768a5b2d810fc3bb134dd026b57e65005275aedef43e155f48fc11a32ec790a93312bd58", 2: "0463279c0c0866e50c05c799d32bd6bab0188b6de06536d1109d2ed9ce76cb335c490e55aee10cc901215132e853097d5432eda06b792073bd7740c94ce4516cb1", 3: "0443aedbb6f7e71c563f8ed2ef64ec9981482519e7ef4f4aa98b27854e8c49126d4956d300ab45fdc34cd26bc8710de0a31dbdf6de7435fd0b492be70ac75fde58", 4: "04877c39fd7c62237e038235e9c075dab261630f78eeb8edb92487159fffedfdf6046c6f8b881fa407c4a4ce6c28de0b19c1f4e29f1fcbc5a58ffd1432a3e0938a", 5: "047384c51ae81add0a523adbb186c91b906ffb64c2c765802bf26dbd13bdf12c319e80c2213a136c8ee03d7874fd22b70d68e7dee469decfbbb510ee9a460cda45", } V2_BOOTLOADER_KEYS = [ bytes.fromhex("c2c87a49c5a3460977fbb2ec9dfe60f06bd694db8244bd4981fe3b7a26307f3f"), bytes.fromhex("80d036b08739b846f4cb77593078deb25dc9487aedcf52e30b4fb7cd7024178a"), bytes.fromhex("b8307a71f552c60a4cbb317ff48b82cdbf6b6bb5f04c920fec7badf017883751"), ] V2_BOOTLOADER_M = 2 V2_BOOTLOADER_N = 3 ONEV2_CHUNK_SIZE = 1024 * 64 V2_CHUNK_SIZE = 1024 * 128 def _transform_vendor_trust(data: bytes) -> bytes: """Byte-swap and bit-invert the VendorTrust field. Vendor trust is interpreted as a bitmask in a 16-bit little-endian integer, with the added twist that 0 means set and 1 means unset. We feed it to a `BitStruct` that expects a big-endian sequence where bits have the traditional meaning. We must therefore do a bitwise negation of each byte, and return them in reverse order. This is the same transformation both ways, fortunately, so we don't need two separate functions. """ return bytes(~b & 0xFF for b in data)[::-1] class FirmwareIntegrityError(Exception): pass class InvalidSignatureError(FirmwareIntegrityError): pass class Unsigned(FirmwareIntegrityError): pass class ToifMode(Enum): full_color = b"f" grayscale = b"g" class EnumAdapter(c.Adapter): def __init__(self, subcon, enum): self.enum = enum super().__init__(subcon) def _encode(self, obj, ctx, path): return obj.value def _decode(self, obj, ctx, path): try: return self.enum(obj) except ValueError: return obj # fmt: off Toif = c.Struct( "magic" / c.Const(b"TOI"), "format" / EnumAdapter(c.Bytes(1), ToifMode), "width" / c.Int16ul, "height" / c.Int16ul, "data" / c.Prefixed(c.Int32ul, c.GreedyBytes), ) VendorTrust = c.Transformed(c.BitStruct( "reserved" / c.Default(c.BitsInteger(9), 0), "show_vendor_string" / c.Flag, "require_user_click" / c.Flag, "red_background" / c.Flag, "delay" / c.BitsInteger(4), ), _transform_vendor_trust, 2, _transform_vendor_trust, 2) VendorHeader = c.Struct( "_start_offset" / c.Tell, "magic" / c.Const(b"TRZV"), "_header_len" / c.Padding(4), "expiry" / c.Int32ul, "version" / c.Struct( "major" / c.Int8ul, "minor" / c.Int8ul, ), "vendor_sigs_required" / c.Int8ul, "vendor_sigs_n" / c.Rebuild(c.Int8ul, c.len_(c.this.pubkeys)), "vendor_trust" / VendorTrust, "reserved" / c.Padding(14), "pubkeys" / c.Bytes(32)[c.this.vendor_sigs_n], "vendor_string" / c.Aligned(4, c.PascalString(c.Int8ul, "utf-8")), "vendor_image" / Toif, "_data_end_offset" / c.Tell, c.Padding(-(c.this._data_end_offset + 65) % 512), "sigmask" / c.Byte, "signature" / c.Bytes(64), "_end_offset" / c.Tell, "header_len" / c.Pointer( c.this._start_offset + 4, c.Rebuild(c.Int32ul, c.this._end_offset - c.this._start_offset) ), ) VersionLong = c.Struct( "major" / c.Int8ul, "minor" / c.Int8ul, "patch" / c.Int8ul, "build" / c.Int8ul, ) FirmwareHeader = c.Struct( "_start_offset" / c.Tell, "magic" / c.Const(b"TRZF"), "header_len" / c.Int32ul, "expiry" / c.Int32ul, "code_length" / c.Rebuild( c.Int32ul, lambda this: len(this._.code) if "code" in this._ else (this.code_length or 0) ), "version" / VersionLong, "fix_version" / VersionLong, "reserved" / c.Padding(8), "hashes" / c.Bytes(32)[16], "v1_signatures" / c.Bytes(64)[V1_SIGNATURE_SLOTS], "v1_key_indexes" / c.Int8ul[V1_SIGNATURE_SLOTS], # pylint: disable=E1136 "reserved" / c.Padding(220), "sigmask" / c.Byte, "signature" / c.Bytes(64), "_end_offset" / c.Tell, "_rebuild_header_len" / c.If( c.this.version.major > 1, c.Pointer( c.this._start_offset + 4, c.Rebuild(c.Int32ul, c.this._end_offset - c.this._start_offset) ), ), ) Firmware = c.Struct( "vendor_header" / VendorHeader, "firmware_header" / FirmwareHeader, "_code_offset" / c.Tell, "code" / c.Bytes(c.this.firmware_header.code_length), c.Terminated, ) FirmwareOneV2 = c.Struct( "firmware_header" / FirmwareHeader, "_code_offset" / c.Tell, "code" / c.Bytes(c.this.firmware_header.code_length), c.Terminated, ) FirmwareOne = c.Struct( "magic" / c.Const(b"TRZR"), "code_length" / c.Rebuild(c.Int32ul, c.len_(c.this.code)), "key_indexes" / c.Int8ul[V1_SIGNATURE_SLOTS], # pylint: disable=E1136 "flags" / c.BitStruct( c.Padding(7), "restore_storage" / c.Flag, ), "reserved" / c.Padding(52), "signatures" / c.Bytes(64)[V1_SIGNATURE_SLOTS], "code" / c.Bytes(c.this.code_length), c.Terminated, "embedded_onev2" / c.RestreamData(c.this.code, c.Optional(FirmwareOneV2)), ) # fmt: on class FirmwareFormat(Enum): TREZOR_ONE = 1 TREZOR_T = 2 TREZOR_ONE_V2 = 3 FirmwareType = NewType("FirmwareType", c.Container) ParsedFirmware = Tuple[FirmwareFormat, FirmwareType] def parse(data: bytes) -> ParsedFirmware: if data[:4] == b"TRZR": version = FirmwareFormat.TREZOR_ONE cls = FirmwareOne elif data[:4] == b"TRZV": version = FirmwareFormat.TREZOR_T cls = Firmware elif data[:4] == b"TRZF": version = FirmwareFormat.TREZOR_ONE_V2 cls = FirmwareOneV2 else: raise ValueError("Unrecognized firmware image type") try: fw = cls.parse(data) except Exception as e: raise FirmwareIntegrityError("Invalid firmware image") from e return version, FirmwareType(fw) def digest_onev1(fw: FirmwareType) -> bytes: return hashlib.sha256(fw.code).digest() def check_sig_v1( digest: bytes, key_indexes: List[int], signatures: List[bytes] ) -> None: distinct_key_indexes = set(i for i in key_indexes if i != 0) if not distinct_key_indexes: raise Unsigned if len(distinct_key_indexes) < len(key_indexes): raise InvalidSignatureError( "Not enough distinct signatures (found {}, need {})".format( len(distinct_key_indexes), len(key_indexes) ) ) for i in range(len(key_indexes)): key_idx = key_indexes[i] signature = signatures[i] if key_idx not in V1_BOOTLOADER_KEYS: # unknown pubkey raise InvalidSignatureError("Unknown key in slot {}".format(i)) pubkey = bytes.fromhex(V1_BOOTLOADER_KEYS[key_idx])[1:] verify = ecdsa.VerifyingKey.from_string(pubkey, curve=ecdsa.curves.SECP256k1) try: verify.verify_digest(signature, digest) except ecdsa.BadSignatureError as e: raise InvalidSignatureError("Invalid signature in slot {}".format(i)) from e def _header_digest( header: c.Container, header_type: c.Construct, hash_function: Callable = blake2s ) -> bytes: stripped_header = header.copy() stripped_header.sigmask = 0 stripped_header.signature = b"\0" * 64 stripped_header.v1_key_indexes = [0, 0, 0] stripped_header.v1_signatures = [b"\0" * 64] * 3 header_bytes = header_type.build(stripped_header) return hash_function(header_bytes).digest() def digest_v2(fw: FirmwareType) -> bytes: return _header_digest(fw.firmware_header, FirmwareHeader, blake2s) def digest_onev2(fw: FirmwareType) -> bytes: return _header_digest(fw.firmware_header, FirmwareHeader, hashlib.sha256) def validate_code_hashes( fw: FirmwareType, hash_function: Callable = blake2s, chunk_size: int = V2_CHUNK_SIZE, padding_byte: bytes = None, ) -> None: for i, expected_hash in enumerate(fw.firmware_header.hashes): if i == 0: # Because first chunk is sent along with headers, there is less code in it. chunk = fw.code[: chunk_size - fw._code_offset] else: # Subsequent chunks are shifted by the "missing header" size. ptr = i * chunk_size - fw._code_offset chunk = fw.code[ptr : ptr + chunk_size] # padding for last chunk if padding_byte is not None and i > 1 and chunk and len(chunk) < chunk_size: chunk += padding_byte[0:1] * (chunk_size - len(chunk)) if not chunk and expected_hash == b"\0" * 32: continue chunk_hash = hash_function(chunk).digest() if chunk_hash != expected_hash: raise FirmwareIntegrityError("Invalid firmware data.") def validate_onev2(fw: FirmwareType, allow_unsigned: bool = False) -> None: try: check_sig_v1( digest_onev2(fw), fw.firmware_header.v1_key_indexes, fw.firmware_header.v1_signatures, ) except Unsigned: if not allow_unsigned: raise validate_code_hashes( fw, hash_function=hashlib.sha256, chunk_size=ONEV2_CHUNK_SIZE, padding_byte=b"\xFF", ) def validate_onev1(fw: FirmwareType, allow_unsigned: bool = False) -> None: try: check_sig_v1(digest_onev1(fw), fw.key_indexes, fw.signatures) except Unsigned: if not allow_unsigned: raise if fw.embedded_onev2: validate_onev2(fw.embedded_onev2, allow_unsigned) def validate_v2(fw: FirmwareType, skip_vendor_header: bool = False) -> None: vendor_fingerprint = _header_digest(fw.vendor_header, VendorHeader) fingerprint = digest_v2(fw) if not skip_vendor_header: try: # if you want to validate a custom vendor header, you can modify # the global variables to match your keys and m-of-n scheme cosi.verify_m_of_n( fw.vendor_header.signature, vendor_fingerprint, V2_BOOTLOADER_M, V2_BOOTLOADER_N, fw.vendor_header.sigmask, V2_BOOTLOADER_KEYS, ) except Exception: raise InvalidSignatureError("Invalid vendor header signature.") # XXX expiry is not used now # now = time.gmtime() # if time.gmtime(fw.vendor_header.expiry) < now: # raise ValueError("Vendor header expired.") try: cosi.verify_m_of_n( fw.firmware_header.signature, fingerprint, fw.vendor_header.vendor_sigs_required, fw.vendor_header.vendor_sigs_n, fw.firmware_header.sigmask, fw.vendor_header.pubkeys, ) except Exception: raise InvalidSignatureError("Invalid firmware signature.") # XXX expiry is not used now # if time.gmtime(fw.firmware_header.expiry) < now: # raise ValueError("Firmware header expired.") validate_code_hashes(fw) def digest(version: FirmwareFormat, fw: FirmwareType) -> bytes: if version == FirmwareFormat.TREZOR_ONE: return digest_onev1(fw) elif version == FirmwareFormat.TREZOR_ONE_V2: return digest_onev2(fw) elif version == FirmwareFormat.TREZOR_T: return digest_v2(fw) else: raise ValueError("Unrecognized firmware version") def validate( version: FirmwareFormat, fw: FirmwareType, allow_unsigned: bool = False ) -> None: if version == FirmwareFormat.TREZOR_ONE: return validate_onev1(fw, allow_unsigned) elif version == FirmwareFormat.TREZOR_ONE_V2: return validate_onev2(fw, allow_unsigned) elif version == FirmwareFormat.TREZOR_T: return validate_v2(fw) else: raise ValueError("Unrecognized firmware version") # ====== Client functions ====== # @tools.session def update(client, data): if client.features.bootloader_mode is False: raise RuntimeError("Device must be in bootloader mode") resp = client.call(messages.FirmwareErase(length=len(data))) # TREZORv1 method if isinstance(resp, messages.Success): resp = client.call(messages.FirmwareUpload(payload=data)) if isinstance(resp, messages.Success): return else: raise RuntimeError("Unexpected result %s" % resp) # TREZORv2 method while isinstance(resp, messages.FirmwareRequest): payload = data[resp.offset : resp.offset + resp.length] digest = blake2s(payload).digest() resp = client.call(messages.FirmwareUpload(payload=payload, hash=digest)) if isinstance(resp, messages.Success): return else: raise RuntimeError("Unexpected message %s" % resp) python-trezor-0.11.6/src/trezorlib/lisk.py000066400000000000000000000040101361427340300205600ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . from . import messages as proto from .protobuf import dict_to_proto from .tools import CallException, dict_from_camelcase, expect, normalize_nfc @expect(proto.LiskAddress, field="address") def get_address(client, n, show_display=False): return client.call(proto.LiskGetAddress(address_n=n, show_display=show_display)) @expect(proto.LiskPublicKey) def get_public_key(client, n, show_display=False): return client.call(proto.LiskGetPublicKey(address_n=n, show_display=show_display)) @expect(proto.LiskMessageSignature) def sign_message(client, n, message): message = normalize_nfc(message) return client.call(proto.LiskSignMessage(address_n=n, message=message)) def verify_message(client, pubkey, signature, message): message = normalize_nfc(message) try: resp = client.call( proto.LiskVerifyMessage( signature=signature, public_key=pubkey, message=message ) ) except CallException as e: resp = e return isinstance(resp, proto.Success) RENAMES = {"lifetime": "life_time", "keysgroup": "keys_group"} @expect(proto.LiskSignedTx) def sign_tx(client, n, transaction): transaction = dict_from_camelcase(transaction, renames=RENAMES) msg = dict_to_proto(proto.LiskTransactionCommon, transaction) return client.call(proto.LiskSignTx(address_n=n, transaction=msg)) python-trezor-0.11.6/src/trezorlib/log.py000066400000000000000000000036641361427340300204150ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . import logging from typing import Optional, Set, Type from . import protobuf OMITTED_MESSAGES = set() # type: Set[Type[protobuf.MessageType]] DUMP_BYTES = 5 logging.addLevelName(DUMP_BYTES, "BYTES") class PrettyProtobufFormatter(logging.Formatter): def format(self, record: logging.LogRecord) -> str: time = self.formatTime(record) message = "[{time}] {source} {level}: {msg}".format( time=time, level=record.levelname.upper(), source=record.name, msg=super().format(record), ) if hasattr(record, "protobuf"): if type(record.protobuf) in OMITTED_MESSAGES: message += " ({} bytes)".format(record.protobuf.ByteSize()) else: message += "\n" + protobuf.format_message(record.protobuf) return message def enable_debug_output(verbosity: int = 1, handler: Optional[logging.Handler] = None): if handler is None: handler = logging.StreamHandler() formatter = PrettyProtobufFormatter() handler.setFormatter(formatter) if verbosity > 0: level = logging.DEBUG if verbosity > 1: level = DUMP_BYTES logger = logging.getLogger("trezorlib") logger.setLevel(level) logger.addHandler(handler) python-trezor-0.11.6/src/trezorlib/mapping.py000066400000000000000000000035331361427340300212620ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . from . import messages map_type_to_class = {} map_class_to_type = {} def build_map(): for msg_name in dir(messages.MessageType): if msg_name.startswith("__"): continue try: msg_class = getattr(messages, msg_name) except AttributeError: raise ValueError( "Implementation of protobuf message '%s' is missing" % msg_name ) if msg_class.MESSAGE_WIRE_TYPE != getattr(messages.MessageType, msg_name): raise ValueError( "Inconsistent wire type and MessageType record for '%s'" % msg_class ) register_message(msg_class) def register_message(msg_class): if msg_class.MESSAGE_WIRE_TYPE in map_type_to_class: raise Exception( "Message for wire type %s is already registered by %s" % (msg_class.MESSAGE_WIRE_TYPE, get_class(msg_class.MESSAGE_WIRE_TYPE)) ) map_class_to_type[msg_class] = msg_class.MESSAGE_WIRE_TYPE map_type_to_class[msg_class.MESSAGE_WIRE_TYPE] = msg_class def get_type(msg): return map_class_to_type[msg.__class__] def get_class(t): return map_type_to_class[t] build_map() python-trezor-0.11.6/src/trezorlib/messages/000077500000000000000000000000001361427340300210605ustar00rootroot00000000000000python-trezor-0.11.6/src/trezorlib/messages/.keep000066400000000000000000000000001361427340300217730ustar00rootroot00000000000000python-trezor-0.11.6/src/trezorlib/messages/Address.py000066400000000000000000000010471361427340300230210ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class Address(p.MessageType): MESSAGE_WIRE_TYPE = 30 def __init__( self, address: str = None, ) -> None: self.address = address @classmethod def get_fields(cls) -> Dict: return { 1: ('address', p.UnicodeType, 0), # required } python-trezor-0.11.6/src/trezorlib/messages/ApplyFlags.py000066400000000000000000000010261361427340300234730ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class ApplyFlags(p.MessageType): MESSAGE_WIRE_TYPE = 28 def __init__( self, flags: int = None, ) -> None: self.flags = flags @classmethod def get_fields(cls) -> Dict: return { 1: ('flags', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/ApplySettings.py000066400000000000000000000026501361427340300242430ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypePassphraseSourceType = Literal[0, 1, 2] except ImportError: pass class ApplySettings(p.MessageType): MESSAGE_WIRE_TYPE = 25 def __init__( self, language: str = None, label: str = None, use_passphrase: bool = None, homescreen: bytes = None, passphrase_source: EnumTypePassphraseSourceType = None, auto_lock_delay_ms: int = None, display_rotation: int = None, ) -> None: self.language = language self.label = label self.use_passphrase = use_passphrase self.homescreen = homescreen self.passphrase_source = passphrase_source self.auto_lock_delay_ms = auto_lock_delay_ms self.display_rotation = display_rotation @classmethod def get_fields(cls) -> Dict: return { 1: ('language', p.UnicodeType, 0), 2: ('label', p.UnicodeType, 0), 3: ('use_passphrase', p.BoolType, 0), 4: ('homescreen', p.BytesType, 0), 5: ('passphrase_source', p.EnumType("PassphraseSourceType", (0, 1, 2)), 0), 6: ('auto_lock_delay_ms', p.UVarintType, 0), 7: ('display_rotation', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/BackupDevice.py000066400000000000000000000004701361427340300237600ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class BackupDevice(p.MessageType): MESSAGE_WIRE_TYPE = 34 python-trezor-0.11.6/src/trezorlib/messages/BackupType.py000066400000000000000000000003161361427340300235010ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off if False: from typing_extensions import Literal Bip39 = 0 # type: Literal[0] Slip39_Basic = 1 # type: Literal[1] Slip39_Advanced = 2 # type: Literal[2] python-trezor-0.11.6/src/trezorlib/messages/BinanceAddress.py000066400000000000000000000010431361427340300242750ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class BinanceAddress(p.MessageType): MESSAGE_WIRE_TYPE = 701 def __init__( self, address: str = None, ) -> None: self.address = address @classmethod def get_fields(cls) -> Dict: return { 1: ('address', p.UnicodeType, 0), } python-trezor-0.11.6/src/trezorlib/messages/BinanceCancelMsg.py000066400000000000000000000013511361427340300245460ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class BinanceCancelMsg(p.MessageType): MESSAGE_WIRE_TYPE = 708 def __init__( self, refid: str = None, sender: str = None, symbol: str = None, ) -> None: self.refid = refid self.sender = sender self.symbol = symbol @classmethod def get_fields(cls) -> Dict: return { 1: ('refid', p.UnicodeType, 0), 2: ('sender', p.UnicodeType, 0), 3: ('symbol', p.UnicodeType, 0), } python-trezor-0.11.6/src/trezorlib/messages/BinanceCoin.py000066400000000000000000000011421361427340300236000ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class BinanceCoin(p.MessageType): def __init__( self, amount: int = None, denom: str = None, ) -> None: self.amount = amount self.denom = denom @classmethod def get_fields(cls) -> Dict: return { 1: ('amount', p.SVarintType, 0), 2: ('denom', p.UnicodeType, 0), } python-trezor-0.11.6/src/trezorlib/messages/BinanceGetAddress.py000066400000000000000000000013371361427340300247430ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class BinanceGetAddress(p.MessageType): MESSAGE_WIRE_TYPE = 700 def __init__( self, address_n: List[int] = None, show_display: bool = None, ) -> None: self.address_n = address_n if address_n is not None else [] self.show_display = show_display @classmethod def get_fields(cls) -> Dict: return { 1: ('address_n', p.UVarintType, p.FLAG_REPEATED), 2: ('show_display', p.BoolType, 0), } python-trezor-0.11.6/src/trezorlib/messages/BinanceGetPublicKey.py000066400000000000000000000013411361427340300252400ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class BinanceGetPublicKey(p.MessageType): MESSAGE_WIRE_TYPE = 702 def __init__( self, address_n: List[int] = None, show_display: bool = None, ) -> None: self.address_n = address_n if address_n is not None else [] self.show_display = show_display @classmethod def get_fields(cls) -> Dict: return { 1: ('address_n', p.UVarintType, p.FLAG_REPEATED), 2: ('show_display', p.BoolType, 0), } python-trezor-0.11.6/src/trezorlib/messages/BinanceInputOutput.py000066400000000000000000000013121361427340300252270ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .BinanceCoin import BinanceCoin if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class BinanceInputOutput(p.MessageType): def __init__( self, address: str = None, coins: List[BinanceCoin] = None, ) -> None: self.address = address self.coins = coins if coins is not None else [] @classmethod def get_fields(cls) -> Dict: return { 1: ('address', p.UnicodeType, 0), 2: ('coins', BinanceCoin, p.FLAG_REPEATED), } python-trezor-0.11.6/src/trezorlib/messages/BinanceOrderMsg.py000066400000000000000000000030671361427340300244420ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeBinanceOrderType = Literal[0, 1, 2, 3] EnumTypeBinanceOrderSide = Literal[0, 1, 2] EnumTypeBinanceTimeInForce = Literal[0, 1, 2, 3] except ImportError: pass class BinanceOrderMsg(p.MessageType): MESSAGE_WIRE_TYPE = 707 def __init__( self, id: str = None, ordertype: EnumTypeBinanceOrderType = None, price: int = None, quantity: int = None, sender: str = None, side: EnumTypeBinanceOrderSide = None, symbol: str = None, timeinforce: EnumTypeBinanceTimeInForce = None, ) -> None: self.id = id self.ordertype = ordertype self.price = price self.quantity = quantity self.sender = sender self.side = side self.symbol = symbol self.timeinforce = timeinforce @classmethod def get_fields(cls) -> Dict: return { 1: ('id', p.UnicodeType, 0), 2: ('ordertype', p.EnumType("BinanceOrderType", (0, 1, 2, 3)), 0), 3: ('price', p.SVarintType, 0), 4: ('quantity', p.SVarintType, 0), 5: ('sender', p.UnicodeType, 0), 6: ('side', p.EnumType("BinanceOrderSide", (0, 1, 2)), 0), 7: ('symbol', p.UnicodeType, 0), 8: ('timeinforce', p.EnumType("BinanceTimeInForce", (0, 1, 2, 3)), 0), } python-trezor-0.11.6/src/trezorlib/messages/BinanceOrderSide.py000066400000000000000000000003011361427340300245640ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off if False: from typing_extensions import Literal SIDE_UNKNOWN = 0 # type: Literal[0] BUY = 1 # type: Literal[1] SELL = 2 # type: Literal[2] python-trezor-0.11.6/src/trezorlib/messages/BinanceOrderType.py000066400000000000000000000003471361427340300246330ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off if False: from typing_extensions import Literal OT_UNKNOWN = 0 # type: Literal[0] MARKET = 1 # type: Literal[1] LIMIT = 2 # type: Literal[2] OT_RESERVED = 3 # type: Literal[3] python-trezor-0.11.6/src/trezorlib/messages/BinancePublicKey.py000066400000000000000000000010611361427340300245770ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class BinancePublicKey(p.MessageType): MESSAGE_WIRE_TYPE = 703 def __init__( self, public_key: bytes = None, ) -> None: self.public_key = public_key @classmethod def get_fields(cls) -> Dict: return { 1: ('public_key', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/BinanceSignTx.py000066400000000000000000000023671361427340300241360ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class BinanceSignTx(p.MessageType): MESSAGE_WIRE_TYPE = 704 def __init__( self, address_n: List[int] = None, msg_count: int = None, account_number: int = None, chain_id: str = None, memo: str = None, sequence: int = None, source: int = None, ) -> None: self.address_n = address_n if address_n is not None else [] self.msg_count = msg_count self.account_number = account_number self.chain_id = chain_id self.memo = memo self.sequence = sequence self.source = source @classmethod def get_fields(cls) -> Dict: return { 1: ('address_n', p.UVarintType, p.FLAG_REPEATED), 2: ('msg_count', p.UVarintType, 0), 3: ('account_number', p.SVarintType, 0), 4: ('chain_id', p.UnicodeType, 0), 5: ('memo', p.UnicodeType, 0), 6: ('sequence', p.SVarintType, 0), 7: ('source', p.SVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/BinanceSignedTx.py000066400000000000000000000012421361427340300244360ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class BinanceSignedTx(p.MessageType): MESSAGE_WIRE_TYPE = 709 def __init__( self, signature: bytes = None, public_key: bytes = None, ) -> None: self.signature = signature self.public_key = public_key @classmethod def get_fields(cls) -> Dict: return { 1: ('signature', p.BytesType, 0), 2: ('public_key', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/BinanceTimeInForce.py000066400000000000000000000003441361427340300250570ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off if False: from typing_extensions import Literal TIF_UNKNOWN = 0 # type: Literal[0] GTE = 1 # type: Literal[1] TIF_RESERVED = 2 # type: Literal[2] IOC = 3 # type: Literal[3] python-trezor-0.11.6/src/trezorlib/messages/BinanceTransferMsg.py000066400000000000000000000015161361427340300251500ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .BinanceInputOutput import BinanceInputOutput if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class BinanceTransferMsg(p.MessageType): MESSAGE_WIRE_TYPE = 706 def __init__( self, inputs: List[BinanceInputOutput] = None, outputs: List[BinanceInputOutput] = None, ) -> None: self.inputs = inputs if inputs is not None else [] self.outputs = outputs if outputs is not None else [] @classmethod def get_fields(cls) -> Dict: return { 1: ('inputs', BinanceInputOutput, p.FLAG_REPEATED), 2: ('outputs', BinanceInputOutput, p.FLAG_REPEATED), } python-trezor-0.11.6/src/trezorlib/messages/BinanceTxRequest.py000066400000000000000000000004751361427340300246640ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class BinanceTxRequest(p.MessageType): MESSAGE_WIRE_TYPE = 705 python-trezor-0.11.6/src/trezorlib/messages/ButtonAck.py000066400000000000000000000004651361427340300233310ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class ButtonAck(p.MessageType): MESSAGE_WIRE_TYPE = 27 python-trezor-0.11.6/src/trezorlib/messages/ButtonRequest.py000066400000000000000000000013511361427340300242560ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeButtonRequestType = Literal[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18] except ImportError: pass class ButtonRequest(p.MessageType): MESSAGE_WIRE_TYPE = 26 def __init__( self, code: EnumTypeButtonRequestType = None, ) -> None: self.code = code @classmethod def get_fields(cls) -> Dict: return { 1: ('code', p.EnumType("ButtonRequestType", (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18)), 0), } python-trezor-0.11.6/src/trezorlib/messages/ButtonRequestType.py000066400000000000000000000014061361427340300251210ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off if False: from typing_extensions import Literal Other = 1 # type: Literal[1] FeeOverThreshold = 2 # type: Literal[2] ConfirmOutput = 3 # type: Literal[3] ResetDevice = 4 # type: Literal[4] ConfirmWord = 5 # type: Literal[5] WipeDevice = 6 # type: Literal[6] ProtectCall = 7 # type: Literal[7] SignTx = 8 # type: Literal[8] FirmwareCheck = 9 # type: Literal[9] Address = 10 # type: Literal[10] PublicKey = 11 # type: Literal[11] MnemonicWordCount = 12 # type: Literal[12] MnemonicInput = 13 # type: Literal[13] PassphraseType = 14 # type: Literal[14] UnknownDerivationPath = 15 # type: Literal[15] RecoveryHomepage = 16 # type: Literal[16] Success = 17 # type: Literal[17] Warning = 18 # type: Literal[18] python-trezor-0.11.6/src/trezorlib/messages/Cancel.py000066400000000000000000000004621361427340300226210ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class Cancel(p.MessageType): MESSAGE_WIRE_TYPE = 20 python-trezor-0.11.6/src/trezorlib/messages/Capability.py000066400000000000000000000011471361427340300235160ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off if False: from typing_extensions import Literal Bitcoin = 1 # type: Literal[1] Bitcoin_like = 2 # type: Literal[2] Binance = 3 # type: Literal[3] Cardano = 4 # type: Literal[4] Crypto = 5 # type: Literal[5] EOS = 6 # type: Literal[6] Ethereum = 7 # type: Literal[7] Lisk = 8 # type: Literal[8] Monero = 9 # type: Literal[9] NEM = 10 # type: Literal[10] Ripple = 11 # type: Literal[11] Stellar = 12 # type: Literal[12] Tezos = 13 # type: Literal[13] U2F = 14 # type: Literal[14] Shamir = 15 # type: Literal[15] ShamirGroups = 16 # type: Literal[16] python-trezor-0.11.6/src/trezorlib/messages/CardanoAddress.py000066400000000000000000000010431361427340300243050ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class CardanoAddress(p.MessageType): MESSAGE_WIRE_TYPE = 308 def __init__( self, address: str = None, ) -> None: self.address = address @classmethod def get_fields(cls) -> Dict: return { 1: ('address', p.UnicodeType, 0), } python-trezor-0.11.6/src/trezorlib/messages/CardanoGetAddress.py000066400000000000000000000013371361427340300247530ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class CardanoGetAddress(p.MessageType): MESSAGE_WIRE_TYPE = 307 def __init__( self, address_n: List[int] = None, show_display: bool = None, ) -> None: self.address_n = address_n if address_n is not None else [] self.show_display = show_display @classmethod def get_fields(cls) -> Dict: return { 1: ('address_n', p.UVarintType, p.FLAG_REPEATED), 2: ('show_display', p.BoolType, 0), } python-trezor-0.11.6/src/trezorlib/messages/CardanoGetPublicKey.py000066400000000000000000000013411361427340300252500ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class CardanoGetPublicKey(p.MessageType): MESSAGE_WIRE_TYPE = 305 def __init__( self, address_n: List[int] = None, show_display: bool = None, ) -> None: self.address_n = address_n if address_n is not None else [] self.show_display = show_display @classmethod def get_fields(cls) -> Dict: return { 1: ('address_n', p.UVarintType, p.FLAG_REPEATED), 2: ('show_display', p.BoolType, 0), } python-trezor-0.11.6/src/trezorlib/messages/CardanoPublicKey.py000066400000000000000000000012371361427340300246140ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .HDNodeType import HDNodeType if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class CardanoPublicKey(p.MessageType): MESSAGE_WIRE_TYPE = 306 def __init__( self, xpub: str = None, node: HDNodeType = None, ) -> None: self.xpub = xpub self.node = node @classmethod def get_fields(cls) -> Dict: return { 1: ('xpub', p.UnicodeType, 0), 2: ('node', HDNodeType, 0), } python-trezor-0.11.6/src/trezorlib/messages/CardanoSignTx.py000066400000000000000000000022341361427340300241370ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .CardanoTxInputType import CardanoTxInputType from .CardanoTxOutputType import CardanoTxOutputType if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class CardanoSignTx(p.MessageType): MESSAGE_WIRE_TYPE = 303 def __init__( self, inputs: List[CardanoTxInputType] = None, outputs: List[CardanoTxOutputType] = None, transactions_count: int = None, protocol_magic: int = None, ) -> None: self.inputs = inputs if inputs is not None else [] self.outputs = outputs if outputs is not None else [] self.transactions_count = transactions_count self.protocol_magic = protocol_magic @classmethod def get_fields(cls) -> Dict: return { 1: ('inputs', CardanoTxInputType, p.FLAG_REPEATED), 2: ('outputs', CardanoTxOutputType, p.FLAG_REPEATED), 3: ('transactions_count', p.UVarintType, 0), 5: ('protocol_magic', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/CardanoSignedTx.py000066400000000000000000000012161361427340300244470ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class CardanoSignedTx(p.MessageType): MESSAGE_WIRE_TYPE = 310 def __init__( self, tx_hash: bytes = None, tx_body: bytes = None, ) -> None: self.tx_hash = tx_hash self.tx_body = tx_body @classmethod def get_fields(cls) -> Dict: return { 1: ('tx_hash', p.BytesType, 0), 2: ('tx_body', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/CardanoTxAck.py000066400000000000000000000010611361427340300237320ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class CardanoTxAck(p.MessageType): MESSAGE_WIRE_TYPE = 309 def __init__( self, transaction: bytes = None, ) -> None: self.transaction = transaction @classmethod def get_fields(cls) -> Dict: return { 1: ('transaction', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/CardanoTxInputType.py000066400000000000000000000016161361427340300252030ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class CardanoTxInputType(p.MessageType): def __init__( self, address_n: List[int] = None, prev_hash: bytes = None, prev_index: int = None, type: int = None, ) -> None: self.address_n = address_n if address_n is not None else [] self.prev_hash = prev_hash self.prev_index = prev_index self.type = type @classmethod def get_fields(cls) -> Dict: return { 1: ('address_n', p.UVarintType, p.FLAG_REPEATED), 2: ('prev_hash', p.BytesType, 0), 3: ('prev_index', p.UVarintType, 0), 4: ('type', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/CardanoTxOutputType.py000066400000000000000000000014311361427340300253770ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class CardanoTxOutputType(p.MessageType): def __init__( self, address: str = None, address_n: List[int] = None, amount: int = None, ) -> None: self.address = address self.address_n = address_n if address_n is not None else [] self.amount = amount @classmethod def get_fields(cls) -> Dict: return { 1: ('address', p.UnicodeType, 0), 2: ('address_n', p.UVarintType, p.FLAG_REPEATED), 3: ('amount', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/CardanoTxRequest.py000066400000000000000000000013751361427340300246740ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class CardanoTxRequest(p.MessageType): MESSAGE_WIRE_TYPE = 304 def __init__( self, tx_index: int = None, tx_hash: bytes = None, tx_body: bytes = None, ) -> None: self.tx_index = tx_index self.tx_hash = tx_hash self.tx_body = tx_body @classmethod def get_fields(cls) -> Dict: return { 1: ('tx_index', p.UVarintType, 0), 2: ('tx_hash', p.BytesType, 0), 3: ('tx_body', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/ChangePin.py000066400000000000000000000010261361427340300232650ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class ChangePin(p.MessageType): MESSAGE_WIRE_TYPE = 4 def __init__( self, remove: bool = None, ) -> None: self.remove = remove @classmethod def get_fields(cls) -> Dict: return { 1: ('remove', p.BoolType, 0), } python-trezor-0.11.6/src/trezorlib/messages/ChangeWipeCode.py000066400000000000000000000010341361427340300242350ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class ChangeWipeCode(p.MessageType): MESSAGE_WIRE_TYPE = 82 def __init__( self, remove: bool = None, ) -> None: self.remove = remove @classmethod def get_fields(cls) -> Dict: return { 1: ('remove', p.BoolType, 0), } python-trezor-0.11.6/src/trezorlib/messages/CipherKeyValue.py000066400000000000000000000023411361427340300243120ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class CipherKeyValue(p.MessageType): MESSAGE_WIRE_TYPE = 23 def __init__( self, address_n: List[int] = None, key: str = None, value: bytes = None, encrypt: bool = None, ask_on_encrypt: bool = None, ask_on_decrypt: bool = None, iv: bytes = None, ) -> None: self.address_n = address_n if address_n is not None else [] self.key = key self.value = value self.encrypt = encrypt self.ask_on_encrypt = ask_on_encrypt self.ask_on_decrypt = ask_on_decrypt self.iv = iv @classmethod def get_fields(cls) -> Dict: return { 1: ('address_n', p.UVarintType, p.FLAG_REPEATED), 2: ('key', p.UnicodeType, 0), 3: ('value', p.BytesType, 0), 4: ('encrypt', p.BoolType, 0), 5: ('ask_on_encrypt', p.BoolType, 0), 6: ('ask_on_decrypt', p.BoolType, 0), 7: ('iv', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/CipheredKeyValue.py000066400000000000000000000010341361427340300246210ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class CipheredKeyValue(p.MessageType): MESSAGE_WIRE_TYPE = 48 def __init__( self, value: bytes = None, ) -> None: self.value = value @classmethod def get_fields(cls) -> Dict: return { 1: ('value', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/ClearSession.py000066400000000000000000000004701361427340300240250ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class ClearSession(p.MessageType): MESSAGE_WIRE_TYPE = 24 python-trezor-0.11.6/src/trezorlib/messages/CosiCommit.py000066400000000000000000000012711361427340300235010ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class CosiCommit(p.MessageType): MESSAGE_WIRE_TYPE = 71 def __init__( self, address_n: List[int] = None, data: bytes = None, ) -> None: self.address_n = address_n if address_n is not None else [] self.data = data @classmethod def get_fields(cls) -> Dict: return { 1: ('address_n', p.UVarintType, p.FLAG_REPEATED), 2: ('data', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/CosiCommitment.py000066400000000000000000000012241361427340300243630ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class CosiCommitment(p.MessageType): MESSAGE_WIRE_TYPE = 72 def __init__( self, commitment: bytes = None, pubkey: bytes = None, ) -> None: self.commitment = commitment self.pubkey = pubkey @classmethod def get_fields(cls) -> Dict: return { 1: ('commitment', p.BytesType, 0), 2: ('pubkey', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/CosiSign.py000066400000000000000000000017131361427340300231520ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class CosiSign(p.MessageType): MESSAGE_WIRE_TYPE = 73 def __init__( self, address_n: List[int] = None, data: bytes = None, global_commitment: bytes = None, global_pubkey: bytes = None, ) -> None: self.address_n = address_n if address_n is not None else [] self.data = data self.global_commitment = global_commitment self.global_pubkey = global_pubkey @classmethod def get_fields(cls) -> Dict: return { 1: ('address_n', p.UVarintType, p.FLAG_REPEATED), 2: ('data', p.BytesType, 0), 3: ('global_commitment', p.BytesType, 0), 4: ('global_pubkey', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/CosiSignature.py000066400000000000000000000010511361427340300242060ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class CosiSignature(p.MessageType): MESSAGE_WIRE_TYPE = 74 def __init__( self, signature: bytes = None, ) -> None: self.signature = signature @classmethod def get_fields(cls) -> Dict: return { 1: ('signature', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/DebugLinkDecision.py000066400000000000000000000021301361427340300247500ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeDebugSwipeDirection = Literal[0, 1, 2, 3] except ImportError: pass class DebugLinkDecision(p.MessageType): MESSAGE_WIRE_TYPE = 100 def __init__( self, yes_no: bool = None, swipe: EnumTypeDebugSwipeDirection = None, input: str = None, x: int = None, y: int = None, wait: bool = None, ) -> None: self.yes_no = yes_no self.swipe = swipe self.input = input self.x = x self.y = y self.wait = wait @classmethod def get_fields(cls) -> Dict: return { 1: ('yes_no', p.BoolType, 0), 2: ('swipe', p.EnumType("DebugSwipeDirection", (0, 1, 2, 3)), 0), 3: ('input', p.UnicodeType, 0), 4: ('x', p.UVarintType, 0), 5: ('y', p.UVarintType, 0), 6: ('wait', p.BoolType, 0), } python-trezor-0.11.6/src/trezorlib/messages/DebugLinkFlashErase.py000066400000000000000000000010441361427340300252330ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class DebugLinkFlashErase(p.MessageType): MESSAGE_WIRE_TYPE = 113 def __init__( self, sector: int = None, ) -> None: self.sector = sector @classmethod def get_fields(cls) -> Dict: return { 1: ('sector', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/DebugLinkGetState.py000066400000000000000000000014701361427340300247410ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class DebugLinkGetState(p.MessageType): MESSAGE_WIRE_TYPE = 101 def __init__( self, wait_word_list: bool = None, wait_word_pos: bool = None, wait_layout: bool = None, ) -> None: self.wait_word_list = wait_word_list self.wait_word_pos = wait_word_pos self.wait_layout = wait_layout @classmethod def get_fields(cls) -> Dict: return { 1: ('wait_word_list', p.BoolType, 0), 2: ('wait_word_pos', p.BoolType, 0), 3: ('wait_layout', p.BoolType, 0), } python-trezor-0.11.6/src/trezorlib/messages/DebugLinkLayout.py000066400000000000000000000011161361427340300244730ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class DebugLinkLayout(p.MessageType): MESSAGE_WIRE_TYPE = 9001 def __init__( self, lines: List[str] = None, ) -> None: self.lines = lines if lines is not None else [] @classmethod def get_fields(cls) -> Dict: return { 1: ('lines', p.UnicodeType, p.FLAG_REPEATED), } python-trezor-0.11.6/src/trezorlib/messages/DebugLinkLog.py000066400000000000000000000013351361427340300237420ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class DebugLinkLog(p.MessageType): MESSAGE_WIRE_TYPE = 104 def __init__( self, level: int = None, bucket: str = None, text: str = None, ) -> None: self.level = level self.bucket = bucket self.text = text @classmethod def get_fields(cls) -> Dict: return { 1: ('level', p.UVarintType, 0), 2: ('bucket', p.UnicodeType, 0), 3: ('text', p.UnicodeType, 0), } python-trezor-0.11.6/src/trezorlib/messages/DebugLinkMemory.py000066400000000000000000000010401361427340300244620ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class DebugLinkMemory(p.MessageType): MESSAGE_WIRE_TYPE = 111 def __init__( self, memory: bytes = None, ) -> None: self.memory = memory @classmethod def get_fields(cls) -> Dict: return { 1: ('memory', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/DebugLinkMemoryRead.py000066400000000000000000000012161361427340300252630ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class DebugLinkMemoryRead(p.MessageType): MESSAGE_WIRE_TYPE = 110 def __init__( self, address: int = None, length: int = None, ) -> None: self.address = address self.length = length @classmethod def get_fields(cls) -> Dict: return { 1: ('address', p.UVarintType, 0), 2: ('length', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/DebugLinkMemoryWrite.py000066400000000000000000000013571361427340300255100ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class DebugLinkMemoryWrite(p.MessageType): MESSAGE_WIRE_TYPE = 112 def __init__( self, address: int = None, memory: bytes = None, flash: bool = None, ) -> None: self.address = address self.memory = memory self.flash = flash @classmethod def get_fields(cls) -> Dict: return { 1: ('address', p.UVarintType, 0), 2: ('memory', p.BytesType, 0), 3: ('flash', p.BoolType, 0), } python-trezor-0.11.6/src/trezorlib/messages/DebugLinkState.py000066400000000000000000000041611361427340300243010ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .HDNodeType import HDNodeType if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class DebugLinkState(p.MessageType): MESSAGE_WIRE_TYPE = 102 def __init__( self, layout: bytes = None, pin: str = None, matrix: str = None, mnemonic_secret: bytes = None, node: HDNodeType = None, passphrase_protection: bool = None, reset_word: str = None, reset_entropy: bytes = None, recovery_fake_word: str = None, recovery_word_pos: int = None, reset_word_pos: int = None, mnemonic_type: int = None, layout_lines: List[str] = None, ) -> None: self.layout = layout self.pin = pin self.matrix = matrix self.mnemonic_secret = mnemonic_secret self.node = node self.passphrase_protection = passphrase_protection self.reset_word = reset_word self.reset_entropy = reset_entropy self.recovery_fake_word = recovery_fake_word self.recovery_word_pos = recovery_word_pos self.reset_word_pos = reset_word_pos self.mnemonic_type = mnemonic_type self.layout_lines = layout_lines if layout_lines is not None else [] @classmethod def get_fields(cls) -> Dict: return { 1: ('layout', p.BytesType, 0), 2: ('pin', p.UnicodeType, 0), 3: ('matrix', p.UnicodeType, 0), 4: ('mnemonic_secret', p.BytesType, 0), 5: ('node', HDNodeType, 0), 6: ('passphrase_protection', p.BoolType, 0), 7: ('reset_word', p.UnicodeType, 0), 8: ('reset_entropy', p.BytesType, 0), 9: ('recovery_fake_word', p.UnicodeType, 0), 10: ('recovery_word_pos', p.UVarintType, 0), 11: ('reset_word_pos', p.UVarintType, 0), 12: ('mnemonic_type', p.UVarintType, 0), 13: ('layout_lines', p.UnicodeType, p.FLAG_REPEATED), } python-trezor-0.11.6/src/trezorlib/messages/DebugLinkStop.py000066400000000000000000000004721361427340300241470ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class DebugLinkStop(p.MessageType): MESSAGE_WIRE_TYPE = 103 python-trezor-0.11.6/src/trezorlib/messages/DebugMoneroDiagAck.py000066400000000000000000000020131361427340300250400ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class DebugMoneroDiagAck(p.MessageType): MESSAGE_WIRE_TYPE = 547 def __init__( self, ins: int = None, p1: int = None, p2: int = None, pd: List[int] = None, data1: bytes = None, data2: bytes = None, ) -> None: self.ins = ins self.p1 = p1 self.p2 = p2 self.pd = pd if pd is not None else [] self.data1 = data1 self.data2 = data2 @classmethod def get_fields(cls) -> Dict: return { 1: ('ins', p.UVarintType, 0), 2: ('p1', p.UVarintType, 0), 3: ('p2', p.UVarintType, 0), 4: ('pd', p.UVarintType, p.FLAG_REPEATED), 5: ('data1', p.BytesType, 0), 6: ('data2', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/DebugMoneroDiagRequest.py000066400000000000000000000020171361427340300257760ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class DebugMoneroDiagRequest(p.MessageType): MESSAGE_WIRE_TYPE = 546 def __init__( self, ins: int = None, p1: int = None, p2: int = None, pd: List[int] = None, data1: bytes = None, data2: bytes = None, ) -> None: self.ins = ins self.p1 = p1 self.p2 = p2 self.pd = pd if pd is not None else [] self.data1 = data1 self.data2 = data2 @classmethod def get_fields(cls) -> Dict: return { 1: ('ins', p.UVarintType, 0), 2: ('p1', p.UVarintType, 0), 3: ('p2', p.UVarintType, 0), 4: ('pd', p.UVarintType, p.FLAG_REPEATED), 5: ('data1', p.BytesType, 0), 6: ('data2', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/DebugSwipeDirection.py000066400000000000000000000003261361427340300253320ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off if False: from typing_extensions import Literal UP = 0 # type: Literal[0] DOWN = 1 # type: Literal[1] LEFT = 2 # type: Literal[2] RIGHT = 3 # type: Literal[3] python-trezor-0.11.6/src/trezorlib/messages/ECDHSessionKey.py000066400000000000000000000010621361427340300241510ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class ECDHSessionKey(p.MessageType): MESSAGE_WIRE_TYPE = 62 def __init__( self, session_key: bytes = None, ) -> None: self.session_key = session_key @classmethod def get_fields(cls) -> Dict: return { 1: ('session_key', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/Entropy.py000066400000000000000000000010471361427340300230740ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class Entropy(p.MessageType): MESSAGE_WIRE_TYPE = 10 def __init__( self, entropy: bytes = None, ) -> None: self.entropy = entropy @classmethod def get_fields(cls) -> Dict: return { 1: ('entropy', p.BytesType, 0), # required } python-trezor-0.11.6/src/trezorlib/messages/EntropyAck.py000066400000000000000000000010361361427340300235110ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class EntropyAck(p.MessageType): MESSAGE_WIRE_TYPE = 36 def __init__( self, entropy: bytes = None, ) -> None: self.entropy = entropy @classmethod def get_fields(cls) -> Dict: return { 1: ('entropy', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/EntropyRequest.py000066400000000000000000000004721361427340300244460ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class EntropyRequest(p.MessageType): MESSAGE_WIRE_TYPE = 35 python-trezor-0.11.6/src/trezorlib/messages/EosActionBuyRam.py000066400000000000000000000013741361427340300244430ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .EosAsset import EosAsset if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class EosActionBuyRam(p.MessageType): def __init__( self, payer: int = None, receiver: int = None, quantity: EosAsset = None, ) -> None: self.payer = payer self.receiver = receiver self.quantity = quantity @classmethod def get_fields(cls) -> Dict: return { 1: ('payer', p.UVarintType, 0), 2: ('receiver', p.UVarintType, 0), 3: ('quantity', EosAsset, 0), } python-trezor-0.11.6/src/trezorlib/messages/EosActionBuyRamBytes.py000066400000000000000000000013251361427340300254460ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class EosActionBuyRamBytes(p.MessageType): def __init__( self, payer: int = None, receiver: int = None, bytes: int = None, ) -> None: self.payer = payer self.receiver = receiver self.bytes = bytes @classmethod def get_fields(cls) -> Dict: return { 1: ('payer', p.UVarintType, 0), 2: ('receiver', p.UVarintType, 0), 3: ('bytes', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/EosActionCommon.py000066400000000000000000000015511361427340300244710ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .EosPermissionLevel import EosPermissionLevel if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class EosActionCommon(p.MessageType): def __init__( self, account: int = None, name: int = None, authorization: List[EosPermissionLevel] = None, ) -> None: self.account = account self.name = name self.authorization = authorization if authorization is not None else [] @classmethod def get_fields(cls) -> Dict: return { 1: ('account', p.UVarintType, 0), 2: ('name', p.UVarintType, 0), 3: ('authorization', EosPermissionLevel, p.FLAG_REPEATED), } python-trezor-0.11.6/src/trezorlib/messages/EosActionDelegate.py000066400000000000000000000017741361427340300247620ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .EosAsset import EosAsset if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class EosActionDelegate(p.MessageType): def __init__( self, sender: int = None, receiver: int = None, net_quantity: EosAsset = None, cpu_quantity: EosAsset = None, transfer: bool = None, ) -> None: self.sender = sender self.receiver = receiver self.net_quantity = net_quantity self.cpu_quantity = cpu_quantity self.transfer = transfer @classmethod def get_fields(cls) -> Dict: return { 1: ('sender', p.UVarintType, 0), 2: ('receiver', p.UVarintType, 0), 3: ('net_quantity', EosAsset, 0), 4: ('cpu_quantity', EosAsset, 0), 5: ('transfer', p.BoolType, 0), } python-trezor-0.11.6/src/trezorlib/messages/EosActionDeleteAuth.py000066400000000000000000000012021361427340300252560ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class EosActionDeleteAuth(p.MessageType): def __init__( self, account: int = None, permission: int = None, ) -> None: self.account = account self.permission = permission @classmethod def get_fields(cls) -> Dict: return { 1: ('account', p.UVarintType, 0), 2: ('permission', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/EosActionLinkAuth.py000066400000000000000000000015001361427340300247520ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class EosActionLinkAuth(p.MessageType): def __init__( self, account: int = None, code: int = None, type: int = None, requirement: int = None, ) -> None: self.account = account self.code = code self.type = type self.requirement = requirement @classmethod def get_fields(cls) -> Dict: return { 1: ('account', p.UVarintType, 0), 2: ('code', p.UVarintType, 0), 3: ('type', p.UVarintType, 0), 4: ('requirement', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/EosActionNewAccount.py000066400000000000000000000016021361427340300253040ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .EosAuthorization import EosAuthorization if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class EosActionNewAccount(p.MessageType): def __init__( self, creator: int = None, name: int = None, owner: EosAuthorization = None, active: EosAuthorization = None, ) -> None: self.creator = creator self.name = name self.owner = owner self.active = active @classmethod def get_fields(cls) -> Dict: return { 1: ('creator', p.UVarintType, 0), 2: ('name', p.UVarintType, 0), 3: ('owner', EosAuthorization, 0), 4: ('active', EosAuthorization, 0), } python-trezor-0.11.6/src/trezorlib/messages/EosActionRefund.py000066400000000000000000000010001361427340300244510ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class EosActionRefund(p.MessageType): def __init__( self, owner: int = None, ) -> None: self.owner = owner @classmethod def get_fields(cls) -> Dict: return { 1: ('owner', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/EosActionSellRam.py000066400000000000000000000011531361427340300245760ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class EosActionSellRam(p.MessageType): def __init__( self, account: int = None, bytes: int = None, ) -> None: self.account = account self.bytes = bytes @classmethod def get_fields(cls) -> Dict: return { 1: ('account', p.UVarintType, 0), 2: ('bytes', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/EosActionTransfer.py000066400000000000000000000015401361427340300250230ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .EosAsset import EosAsset if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class EosActionTransfer(p.MessageType): def __init__( self, sender: int = None, receiver: int = None, quantity: EosAsset = None, memo: str = None, ) -> None: self.sender = sender self.receiver = receiver self.quantity = quantity self.memo = memo @classmethod def get_fields(cls) -> Dict: return { 1: ('sender', p.UVarintType, 0), 2: ('receiver', p.UVarintType, 0), 3: ('quantity', EosAsset, 0), 4: ('memo', p.UnicodeType, 0), } python-trezor-0.11.6/src/trezorlib/messages/EosActionUndelegate.py000066400000000000000000000016221361427340300253150ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .EosAsset import EosAsset if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class EosActionUndelegate(p.MessageType): def __init__( self, sender: int = None, receiver: int = None, net_quantity: EosAsset = None, cpu_quantity: EosAsset = None, ) -> None: self.sender = sender self.receiver = receiver self.net_quantity = net_quantity self.cpu_quantity = cpu_quantity @classmethod def get_fields(cls) -> Dict: return { 1: ('sender', p.UVarintType, 0), 2: ('receiver', p.UVarintType, 0), 3: ('net_quantity', EosAsset, 0), 4: ('cpu_quantity', EosAsset, 0), } python-trezor-0.11.6/src/trezorlib/messages/EosActionUnknown.py000066400000000000000000000012071361427340300246760ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class EosActionUnknown(p.MessageType): def __init__( self, data_size: int = None, data_chunk: bytes = None, ) -> None: self.data_size = data_size self.data_chunk = data_chunk @classmethod def get_fields(cls) -> Dict: return { 1: ('data_size', p.UVarintType, 0), 2: ('data_chunk', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/EosActionUnlinkAuth.py000066400000000000000000000013101361427340300253140ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class EosActionUnlinkAuth(p.MessageType): def __init__( self, account: int = None, code: int = None, type: int = None, ) -> None: self.account = account self.code = code self.type = type @classmethod def get_fields(cls) -> Dict: return { 1: ('account', p.UVarintType, 0), 2: ('code', p.UVarintType, 0), 3: ('type', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/EosActionUpdateAuth.py000066400000000000000000000016061361427340300253060ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .EosAuthorization import EosAuthorization if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class EosActionUpdateAuth(p.MessageType): def __init__( self, account: int = None, permission: int = None, parent: int = None, auth: EosAuthorization = None, ) -> None: self.account = account self.permission = permission self.parent = parent self.auth = auth @classmethod def get_fields(cls) -> Dict: return { 1: ('account', p.UVarintType, 0), 2: ('permission', p.UVarintType, 0), 3: ('parent', p.UVarintType, 0), 4: ('auth', EosAuthorization, 0), } python-trezor-0.11.6/src/trezorlib/messages/EosActionVoteProducer.py000066400000000000000000000014171361427340300256630ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class EosActionVoteProducer(p.MessageType): def __init__( self, voter: int = None, proxy: int = None, producers: List[int] = None, ) -> None: self.voter = voter self.proxy = proxy self.producers = producers if producers is not None else [] @classmethod def get_fields(cls) -> Dict: return { 1: ('voter', p.UVarintType, 0), 2: ('proxy', p.UVarintType, 0), 3: ('producers', p.UVarintType, p.FLAG_REPEATED), } python-trezor-0.11.6/src/trezorlib/messages/EosAsset.py000066400000000000000000000011431361427340300231570ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class EosAsset(p.MessageType): def __init__( self, amount: int = None, symbol: int = None, ) -> None: self.amount = amount self.symbol = symbol @classmethod def get_fields(cls) -> Dict: return { 1: ('amount', p.SVarintType, 0), 2: ('symbol', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/EosAuthorization.py000066400000000000000000000023121361427340300247370ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .EosAuthorizationAccount import EosAuthorizationAccount from .EosAuthorizationKey import EosAuthorizationKey from .EosAuthorizationWait import EosAuthorizationWait if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class EosAuthorization(p.MessageType): def __init__( self, threshold: int = None, keys: List[EosAuthorizationKey] = None, accounts: List[EosAuthorizationAccount] = None, waits: List[EosAuthorizationWait] = None, ) -> None: self.threshold = threshold self.keys = keys if keys is not None else [] self.accounts = accounts if accounts is not None else [] self.waits = waits if waits is not None else [] @classmethod def get_fields(cls) -> Dict: return { 1: ('threshold', p.UVarintType, 0), 2: ('keys', EosAuthorizationKey, p.FLAG_REPEATED), 3: ('accounts', EosAuthorizationAccount, p.FLAG_REPEATED), 4: ('waits', EosAuthorizationWait, p.FLAG_REPEATED), } python-trezor-0.11.6/src/trezorlib/messages/EosAuthorizationAccount.py000066400000000000000000000012761361427340300262640ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .EosPermissionLevel import EosPermissionLevel if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class EosAuthorizationAccount(p.MessageType): def __init__( self, account: EosPermissionLevel = None, weight: int = None, ) -> None: self.account = account self.weight = weight @classmethod def get_fields(cls) -> Dict: return { 1: ('account', EosPermissionLevel, 0), 2: ('weight', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/EosAuthorizationKey.py000066400000000000000000000015471361427340300254210ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class EosAuthorizationKey(p.MessageType): def __init__( self, type: int = None, key: bytes = None, address_n: List[int] = None, weight: int = None, ) -> None: self.type = type self.key = key self.address_n = address_n if address_n is not None else [] self.weight = weight @classmethod def get_fields(cls) -> Dict: return { 1: ('type', p.UVarintType, 0), 2: ('key', p.BytesType, 0), 3: ('address_n', p.UVarintType, p.FLAG_REPEATED), 4: ('weight', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/EosAuthorizationWait.py000066400000000000000000000011671361427340300255730ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class EosAuthorizationWait(p.MessageType): def __init__( self, wait_sec: int = None, weight: int = None, ) -> None: self.wait_sec = wait_sec self.weight = weight @classmethod def get_fields(cls) -> Dict: return { 1: ('wait_sec', p.UVarintType, 0), 2: ('weight', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/EosGetPublicKey.py000066400000000000000000000013351361427340300244320ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class EosGetPublicKey(p.MessageType): MESSAGE_WIRE_TYPE = 600 def __init__( self, address_n: List[int] = None, show_display: bool = None, ) -> None: self.address_n = address_n if address_n is not None else [] self.show_display = show_display @classmethod def get_fields(cls) -> Dict: return { 1: ('address_n', p.UVarintType, p.FLAG_REPEATED), 2: ('show_display', p.BoolType, 0), } python-trezor-0.11.6/src/trezorlib/messages/EosPermissionLevel.py000066400000000000000000000011711361427340300252210ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class EosPermissionLevel(p.MessageType): def __init__( self, actor: int = None, permission: int = None, ) -> None: self.actor = actor self.permission = permission @classmethod def get_fields(cls) -> Dict: return { 1: ('actor', p.UVarintType, 0), 2: ('permission', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/EosPublicKey.py000066400000000000000000000013031361427340300237650ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class EosPublicKey(p.MessageType): MESSAGE_WIRE_TYPE = 601 def __init__( self, wif_public_key: str = None, raw_public_key: bytes = None, ) -> None: self.wif_public_key = wif_public_key self.raw_public_key = raw_public_key @classmethod def get_fields(cls) -> Dict: return { 1: ('wif_public_key', p.UnicodeType, 0), 2: ('raw_public_key', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/EosSignTx.py000066400000000000000000000017251361427340300233220ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .EosTxHeader import EosTxHeader if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class EosSignTx(p.MessageType): MESSAGE_WIRE_TYPE = 602 def __init__( self, address_n: List[int] = None, chain_id: bytes = None, header: EosTxHeader = None, num_actions: int = None, ) -> None: self.address_n = address_n if address_n is not None else [] self.chain_id = chain_id self.header = header self.num_actions = num_actions @classmethod def get_fields(cls) -> Dict: return { 1: ('address_n', p.UVarintType, p.FLAG_REPEATED), 2: ('chain_id', p.BytesType, 0), 3: ('header', EosTxHeader, 0), 4: ('num_actions', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/EosSignedTx.py000066400000000000000000000010501361427340300236220ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class EosSignedTx(p.MessageType): MESSAGE_WIRE_TYPE = 605 def __init__( self, signature: str = None, ) -> None: self.signature = signature @classmethod def get_fields(cls) -> Dict: return { 1: ('signature', p.UnicodeType, 0), } python-trezor-0.11.6/src/trezorlib/messages/EosTxActionAck.py000066400000000000000000000062171361427340300242570ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .EosActionBuyRam import EosActionBuyRam from .EosActionBuyRamBytes import EosActionBuyRamBytes from .EosActionCommon import EosActionCommon from .EosActionDelegate import EosActionDelegate from .EosActionDeleteAuth import EosActionDeleteAuth from .EosActionLinkAuth import EosActionLinkAuth from .EosActionNewAccount import EosActionNewAccount from .EosActionRefund import EosActionRefund from .EosActionSellRam import EosActionSellRam from .EosActionTransfer import EosActionTransfer from .EosActionUndelegate import EosActionUndelegate from .EosActionUnknown import EosActionUnknown from .EosActionUnlinkAuth import EosActionUnlinkAuth from .EosActionUpdateAuth import EosActionUpdateAuth from .EosActionVoteProducer import EosActionVoteProducer if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class EosTxActionAck(p.MessageType): MESSAGE_WIRE_TYPE = 604 def __init__( self, common: EosActionCommon = None, transfer: EosActionTransfer = None, delegate: EosActionDelegate = None, undelegate: EosActionUndelegate = None, refund: EosActionRefund = None, buy_ram: EosActionBuyRam = None, buy_ram_bytes: EosActionBuyRamBytes = None, sell_ram: EosActionSellRam = None, vote_producer: EosActionVoteProducer = None, update_auth: EosActionUpdateAuth = None, delete_auth: EosActionDeleteAuth = None, link_auth: EosActionLinkAuth = None, unlink_auth: EosActionUnlinkAuth = None, new_account: EosActionNewAccount = None, unknown: EosActionUnknown = None, ) -> None: self.common = common self.transfer = transfer self.delegate = delegate self.undelegate = undelegate self.refund = refund self.buy_ram = buy_ram self.buy_ram_bytes = buy_ram_bytes self.sell_ram = sell_ram self.vote_producer = vote_producer self.update_auth = update_auth self.delete_auth = delete_auth self.link_auth = link_auth self.unlink_auth = unlink_auth self.new_account = new_account self.unknown = unknown @classmethod def get_fields(cls) -> Dict: return { 1: ('common', EosActionCommon, 0), 2: ('transfer', EosActionTransfer, 0), 3: ('delegate', EosActionDelegate, 0), 4: ('undelegate', EosActionUndelegate, 0), 5: ('refund', EosActionRefund, 0), 6: ('buy_ram', EosActionBuyRam, 0), 7: ('buy_ram_bytes', EosActionBuyRamBytes, 0), 8: ('sell_ram', EosActionSellRam, 0), 9: ('vote_producer', EosActionVoteProducer, 0), 10: ('update_auth', EosActionUpdateAuth, 0), 11: ('delete_auth', EosActionDeleteAuth, 0), 12: ('link_auth', EosActionLinkAuth, 0), 13: ('unlink_auth', EosActionUnlinkAuth, 0), 14: ('new_account', EosActionNewAccount, 0), 15: ('unknown', EosActionUnknown, 0), } python-trezor-0.11.6/src/trezorlib/messages/EosTxActionRequest.py000066400000000000000000000010571361427340300252060ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class EosTxActionRequest(p.MessageType): MESSAGE_WIRE_TYPE = 603 def __init__( self, data_size: int = None, ) -> None: self.data_size = data_size @classmethod def get_fields(cls) -> Dict: return { 1: ('data_size', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/EosTxHeader.py000066400000000000000000000024021361427340300236030ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class EosTxHeader(p.MessageType): def __init__( self, expiration: int = None, ref_block_num: int = None, ref_block_prefix: int = None, max_net_usage_words: int = None, max_cpu_usage_ms: int = None, delay_sec: int = None, ) -> None: self.expiration = expiration self.ref_block_num = ref_block_num self.ref_block_prefix = ref_block_prefix self.max_net_usage_words = max_net_usage_words self.max_cpu_usage_ms = max_cpu_usage_ms self.delay_sec = delay_sec @classmethod def get_fields(cls) -> Dict: return { 1: ('expiration', p.UVarintType, 0), # required 2: ('ref_block_num', p.UVarintType, 0), # required 3: ('ref_block_prefix', p.UVarintType, 0), # required 4: ('max_net_usage_words', p.UVarintType, 0), # required 5: ('max_cpu_usage_ms', p.UVarintType, 0), # required 6: ('delay_sec', p.UVarintType, 0), # required } python-trezor-0.11.6/src/trezorlib/messages/EthereumAddress.py000066400000000000000000000012351361427340300245170ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class EthereumAddress(p.MessageType): MESSAGE_WIRE_TYPE = 57 def __init__( self, old_address: bytes = None, address: str = None, ) -> None: self.old_address = old_address self.address = address @classmethod def get_fields(cls) -> Dict: return { 1: ('old_address', p.BytesType, 0), 2: ('address', p.UnicodeType, 0), } python-trezor-0.11.6/src/trezorlib/messages/EthereumGetAddress.py000066400000000000000000000013371361427340300251620ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class EthereumGetAddress(p.MessageType): MESSAGE_WIRE_TYPE = 56 def __init__( self, address_n: List[int] = None, show_display: bool = None, ) -> None: self.address_n = address_n if address_n is not None else [] self.show_display = show_display @classmethod def get_fields(cls) -> Dict: return { 1: ('address_n', p.UVarintType, p.FLAG_REPEATED), 2: ('show_display', p.BoolType, 0), } python-trezor-0.11.6/src/trezorlib/messages/EthereumGetPublicKey.py000066400000000000000000000013421361427340300254600ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class EthereumGetPublicKey(p.MessageType): MESSAGE_WIRE_TYPE = 450 def __init__( self, address_n: List[int] = None, show_display: bool = None, ) -> None: self.address_n = address_n if address_n is not None else [] self.show_display = show_display @classmethod def get_fields(cls) -> Dict: return { 1: ('address_n', p.UVarintType, p.FLAG_REPEATED), 2: ('show_display', p.BoolType, 0), } python-trezor-0.11.6/src/trezorlib/messages/EthereumMessageSignature.py000066400000000000000000000012361361427340300264010ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class EthereumMessageSignature(p.MessageType): MESSAGE_WIRE_TYPE = 66 def __init__( self, signature: bytes = None, address: str = None, ) -> None: self.signature = signature self.address = address @classmethod def get_fields(cls) -> Dict: return { 2: ('signature', p.BytesType, 0), 3: ('address', p.UnicodeType, 0), } python-trezor-0.11.6/src/trezorlib/messages/EthereumPublicKey.py000066400000000000000000000012401361427340300250150ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .HDNodeType import HDNodeType if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class EthereumPublicKey(p.MessageType): MESSAGE_WIRE_TYPE = 451 def __init__( self, node: HDNodeType = None, xpub: str = None, ) -> None: self.node = node self.xpub = xpub @classmethod def get_fields(cls) -> Dict: return { 1: ('node', HDNodeType, 0), 2: ('xpub', p.UnicodeType, 0), } python-trezor-0.11.6/src/trezorlib/messages/EthereumSignMessage.py000066400000000000000000000013161361427340300253370ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class EthereumSignMessage(p.MessageType): MESSAGE_WIRE_TYPE = 64 def __init__( self, address_n: List[int] = None, message: bytes = None, ) -> None: self.address_n = address_n if address_n is not None else [] self.message = message @classmethod def get_fields(cls) -> Dict: return { 1: ('address_n', p.UVarintType, p.FLAG_REPEATED), 2: ('message', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/EthereumSignTx.py000066400000000000000000000031071361427340300243460ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class EthereumSignTx(p.MessageType): MESSAGE_WIRE_TYPE = 58 def __init__( self, address_n: List[int] = None, nonce: bytes = None, gas_price: bytes = None, gas_limit: bytes = None, to: str = None, value: bytes = None, data_initial_chunk: bytes = None, data_length: int = None, chain_id: int = None, tx_type: int = None, ) -> None: self.address_n = address_n if address_n is not None else [] self.nonce = nonce self.gas_price = gas_price self.gas_limit = gas_limit self.to = to self.value = value self.data_initial_chunk = data_initial_chunk self.data_length = data_length self.chain_id = chain_id self.tx_type = tx_type @classmethod def get_fields(cls) -> Dict: return { 1: ('address_n', p.UVarintType, p.FLAG_REPEATED), 2: ('nonce', p.BytesType, 0), 3: ('gas_price', p.BytesType, 0), 4: ('gas_limit', p.BytesType, 0), 11: ('to', p.UnicodeType, 0), 6: ('value', p.BytesType, 0), 7: ('data_initial_chunk', p.BytesType, 0), 8: ('data_length', p.UVarintType, 0), 9: ('chain_id', p.UVarintType, 0), 10: ('tx_type', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/EthereumTxAck.py000066400000000000000000000010551361427340300241440ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class EthereumTxAck(p.MessageType): MESSAGE_WIRE_TYPE = 60 def __init__( self, data_chunk: bytes = None, ) -> None: self.data_chunk = data_chunk @classmethod def get_fields(cls) -> Dict: return { 1: ('data_chunk', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/EthereumTxRequest.py000066400000000000000000000016431361427340300251010ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class EthereumTxRequest(p.MessageType): MESSAGE_WIRE_TYPE = 59 def __init__( self, data_length: int = None, signature_v: int = None, signature_r: bytes = None, signature_s: bytes = None, ) -> None: self.data_length = data_length self.signature_v = signature_v self.signature_r = signature_r self.signature_s = signature_s @classmethod def get_fields(cls) -> Dict: return { 1: ('data_length', p.UVarintType, 0), 2: ('signature_v', p.UVarintType, 0), 3: ('signature_r', p.BytesType, 0), 4: ('signature_s', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/EthereumVerifyMessage.py000066400000000000000000000014051361427340300257020ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class EthereumVerifyMessage(p.MessageType): MESSAGE_WIRE_TYPE = 65 def __init__( self, signature: bytes = None, message: bytes = None, address: str = None, ) -> None: self.signature = signature self.message = message self.address = address @classmethod def get_fields(cls) -> Dict: return { 2: ('signature', p.BytesType, 0), 3: ('message', p.BytesType, 0), 4: ('address', p.UnicodeType, 0), } python-trezor-0.11.6/src/trezorlib/messages/Failure.py000066400000000000000000000014321361427340300230210ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeFailureType = Literal[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 99] except ImportError: pass class Failure(p.MessageType): MESSAGE_WIRE_TYPE = 3 def __init__( self, code: EnumTypeFailureType = None, message: str = None, ) -> None: self.code = code self.message = message @classmethod def get_fields(cls) -> Dict: return { 1: ('code', p.EnumType("FailureType", (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 99)), 0), 2: ('message', p.UnicodeType, 0), } python-trezor-0.11.6/src/trezorlib/messages/FailureType.py000066400000000000000000000012031361427340300236570ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off if False: from typing_extensions import Literal UnexpectedMessage = 1 # type: Literal[1] ButtonExpected = 2 # type: Literal[2] DataError = 3 # type: Literal[3] ActionCancelled = 4 # type: Literal[4] PinExpected = 5 # type: Literal[5] PinCancelled = 6 # type: Literal[6] PinInvalid = 7 # type: Literal[7] InvalidSignature = 8 # type: Literal[8] ProcessError = 9 # type: Literal[9] NotEnoughFunds = 10 # type: Literal[10] NotInitialized = 11 # type: Literal[11] PinMismatch = 12 # type: Literal[12] WipeCodeMismatch = 13 # type: Literal[13] FirmwareError = 99 # type: Literal[99] python-trezor-0.11.6/src/trezorlib/messages/Features.py000066400000000000000000000113501361427340300232100ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeCapability = Literal[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16] EnumTypeBackupType = Literal[0, 1, 2] except ImportError: pass class Features(p.MessageType): MESSAGE_WIRE_TYPE = 17 def __init__( self, vendor: str = None, major_version: int = None, minor_version: int = None, patch_version: int = None, bootloader_mode: bool = None, device_id: str = None, pin_protection: bool = None, passphrase_protection: bool = None, language: str = None, label: str = None, initialized: bool = None, revision: bytes = None, bootloader_hash: bytes = None, imported: bool = None, pin_cached: bool = None, passphrase_cached: bool = None, firmware_present: bool = None, needs_backup: bool = None, flags: int = None, model: str = None, fw_major: int = None, fw_minor: int = None, fw_patch: int = None, fw_vendor: str = None, fw_vendor_keys: bytes = None, unfinished_backup: bool = None, no_backup: bool = None, recovery_mode: bool = None, capabilities: List[EnumTypeCapability] = None, backup_type: EnumTypeBackupType = None, sd_card_present: bool = None, sd_protection: bool = None, wipe_code_protection: bool = None, ) -> None: self.vendor = vendor self.major_version = major_version self.minor_version = minor_version self.patch_version = patch_version self.bootloader_mode = bootloader_mode self.device_id = device_id self.pin_protection = pin_protection self.passphrase_protection = passphrase_protection self.language = language self.label = label self.initialized = initialized self.revision = revision self.bootloader_hash = bootloader_hash self.imported = imported self.pin_cached = pin_cached self.passphrase_cached = passphrase_cached self.firmware_present = firmware_present self.needs_backup = needs_backup self.flags = flags self.model = model self.fw_major = fw_major self.fw_minor = fw_minor self.fw_patch = fw_patch self.fw_vendor = fw_vendor self.fw_vendor_keys = fw_vendor_keys self.unfinished_backup = unfinished_backup self.no_backup = no_backup self.recovery_mode = recovery_mode self.capabilities = capabilities if capabilities is not None else [] self.backup_type = backup_type self.sd_card_present = sd_card_present self.sd_protection = sd_protection self.wipe_code_protection = wipe_code_protection @classmethod def get_fields(cls) -> Dict: return { 1: ('vendor', p.UnicodeType, 0), 2: ('major_version', p.UVarintType, 0), 3: ('minor_version', p.UVarintType, 0), 4: ('patch_version', p.UVarintType, 0), 5: ('bootloader_mode', p.BoolType, 0), 6: ('device_id', p.UnicodeType, 0), 7: ('pin_protection', p.BoolType, 0), 8: ('passphrase_protection', p.BoolType, 0), 9: ('language', p.UnicodeType, 0), 10: ('label', p.UnicodeType, 0), 12: ('initialized', p.BoolType, 0), 13: ('revision', p.BytesType, 0), 14: ('bootloader_hash', p.BytesType, 0), 15: ('imported', p.BoolType, 0), 16: ('pin_cached', p.BoolType, 0), 17: ('passphrase_cached', p.BoolType, 0), 18: ('firmware_present', p.BoolType, 0), 19: ('needs_backup', p.BoolType, 0), 20: ('flags', p.UVarintType, 0), 21: ('model', p.UnicodeType, 0), 22: ('fw_major', p.UVarintType, 0), 23: ('fw_minor', p.UVarintType, 0), 24: ('fw_patch', p.UVarintType, 0), 25: ('fw_vendor', p.UnicodeType, 0), 26: ('fw_vendor_keys', p.BytesType, 0), 27: ('unfinished_backup', p.BoolType, 0), 28: ('no_backup', p.BoolType, 0), 29: ('recovery_mode', p.BoolType, 0), 30: ('capabilities', p.EnumType("Capability", (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)), p.FLAG_REPEATED), 31: ('backup_type', p.EnumType("BackupType", (0, 1, 2)), 0), 32: ('sd_card_present', p.BoolType, 0), 33: ('sd_protection', p.BoolType, 0), 34: ('wipe_code_protection', p.BoolType, 0), } python-trezor-0.11.6/src/trezorlib/messages/FirmwareErase.py000066400000000000000000000010341361427340300241640ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class FirmwareErase(p.MessageType): MESSAGE_WIRE_TYPE = 6 def __init__( self, length: int = None, ) -> None: self.length = length @classmethod def get_fields(cls) -> Dict: return { 1: ('length', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/FirmwareRequest.py000066400000000000000000000012041361427340300245540ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class FirmwareRequest(p.MessageType): MESSAGE_WIRE_TYPE = 8 def __init__( self, offset: int = None, length: int = None, ) -> None: self.offset = offset self.length = length @classmethod def get_fields(cls) -> Dict: return { 1: ('offset', p.UVarintType, 0), 2: ('length', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/FirmwareUpload.py000066400000000000000000000012131361427340300243500ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class FirmwareUpload(p.MessageType): MESSAGE_WIRE_TYPE = 7 def __init__( self, payload: bytes = None, hash: bytes = None, ) -> None: self.payload = payload self.hash = hash @classmethod def get_fields(cls) -> Dict: return { 1: ('payload', p.BytesType, 0), # required 2: ('hash', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/GetAddress.py000066400000000000000000000024521361427340300234620ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .MultisigRedeemScriptType import MultisigRedeemScriptType if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeInputScriptType = Literal[0, 1, 2, 3, 4] except ImportError: pass class GetAddress(p.MessageType): MESSAGE_WIRE_TYPE = 29 def __init__( self, address_n: List[int] = None, coin_name: str = None, show_display: bool = None, multisig: MultisigRedeemScriptType = None, script_type: EnumTypeInputScriptType = None, ) -> None: self.address_n = address_n if address_n is not None else [] self.coin_name = coin_name self.show_display = show_display self.multisig = multisig self.script_type = script_type @classmethod def get_fields(cls) -> Dict: return { 1: ('address_n', p.UVarintType, p.FLAG_REPEATED), 2: ('coin_name', p.UnicodeType, 0), # default=Bitcoin 3: ('show_display', p.BoolType, 0), 4: ('multisig', MultisigRedeemScriptType, 0), 5: ('script_type', p.EnumType("InputScriptType", (0, 1, 2, 3, 4)), 0), # default=SPENDADDRESS } python-trezor-0.11.6/src/trezorlib/messages/GetECDHSessionKey.py000066400000000000000000000015611361427340300246150ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .IdentityType import IdentityType if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class GetECDHSessionKey(p.MessageType): MESSAGE_WIRE_TYPE = 61 def __init__( self, identity: IdentityType = None, peer_public_key: bytes = None, ecdsa_curve_name: str = None, ) -> None: self.identity = identity self.peer_public_key = peer_public_key self.ecdsa_curve_name = ecdsa_curve_name @classmethod def get_fields(cls) -> Dict: return { 1: ('identity', IdentityType, 0), 2: ('peer_public_key', p.BytesType, 0), 3: ('ecdsa_curve_name', p.UnicodeType, 0), } python-trezor-0.11.6/src/trezorlib/messages/GetEntropy.py000066400000000000000000000010351361427340300235310ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class GetEntropy(p.MessageType): MESSAGE_WIRE_TYPE = 9 def __init__( self, size: int = None, ) -> None: self.size = size @classmethod def get_fields(cls) -> Dict: return { 1: ('size', p.UVarintType, 0), # required } python-trezor-0.11.6/src/trezorlib/messages/GetFeatures.py000066400000000000000000000004671361427340300236570ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class GetFeatures(p.MessageType): MESSAGE_WIRE_TYPE = 55 python-trezor-0.11.6/src/trezorlib/messages/GetNextU2FCounter.py000066400000000000000000000004751361427340300246730ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class GetNextU2FCounter(p.MessageType): MESSAGE_WIRE_TYPE = 80 python-trezor-0.11.6/src/trezorlib/messages/GetPublicKey.py000066400000000000000000000023541361427340300237650ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeInputScriptType = Literal[0, 1, 2, 3, 4] except ImportError: pass class GetPublicKey(p.MessageType): MESSAGE_WIRE_TYPE = 11 def __init__( self, address_n: List[int] = None, ecdsa_curve_name: str = None, show_display: bool = None, coin_name: str = None, script_type: EnumTypeInputScriptType = None, ) -> None: self.address_n = address_n if address_n is not None else [] self.ecdsa_curve_name = ecdsa_curve_name self.show_display = show_display self.coin_name = coin_name self.script_type = script_type @classmethod def get_fields(cls) -> Dict: return { 1: ('address_n', p.UVarintType, p.FLAG_REPEATED), 2: ('ecdsa_curve_name', p.UnicodeType, 0), 3: ('show_display', p.BoolType, 0), 4: ('coin_name', p.UnicodeType, 0), # default=Bitcoin 5: ('script_type', p.EnumType("InputScriptType", (0, 1, 2, 3, 4)), 0), # default=SPENDADDRESS } python-trezor-0.11.6/src/trezorlib/messages/HDNodePathType.py000066400000000000000000000013261361427340300242140ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .HDNodeType import HDNodeType if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class HDNodePathType(p.MessageType): def __init__( self, node: HDNodeType = None, address_n: List[int] = None, ) -> None: self.node = node self.address_n = address_n if address_n is not None else [] @classmethod def get_fields(cls) -> Dict: return { 1: ('node', HDNodeType, 0), # required 2: ('address_n', p.UVarintType, p.FLAG_REPEATED), } python-trezor-0.11.6/src/trezorlib/messages/HDNodeType.py000066400000000000000000000021751361427340300234020ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class HDNodeType(p.MessageType): def __init__( self, depth: int = None, fingerprint: int = None, child_num: int = None, chain_code: bytes = None, private_key: bytes = None, public_key: bytes = None, ) -> None: self.depth = depth self.fingerprint = fingerprint self.child_num = child_num self.chain_code = chain_code self.private_key = private_key self.public_key = public_key @classmethod def get_fields(cls) -> Dict: return { 1: ('depth', p.UVarintType, 0), # required 2: ('fingerprint', p.UVarintType, 0), # required 3: ('child_num', p.UVarintType, 0), # required 4: ('chain_code', p.BytesType, 0), # required 5: ('private_key', p.BytesType, 0), 6: ('public_key', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/IdentityType.py000066400000000000000000000017441361427340300240730ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class IdentityType(p.MessageType): def __init__( self, proto: str = None, user: str = None, host: str = None, port: str = None, path: str = None, index: int = None, ) -> None: self.proto = proto self.user = user self.host = host self.port = port self.path = path self.index = index @classmethod def get_fields(cls) -> Dict: return { 1: ('proto', p.UnicodeType, 0), 2: ('user', p.UnicodeType, 0), 3: ('host', p.UnicodeType, 0), 4: ('port', p.UnicodeType, 0), 5: ('path', p.UnicodeType, 0), 6: ('index', p.UVarintType, 0), # default=0 } python-trezor-0.11.6/src/trezorlib/messages/Initialize.py000066400000000000000000000012351361427340300235340ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class Initialize(p.MessageType): MESSAGE_WIRE_TYPE = 0 def __init__( self, state: bytes = None, skip_passphrase: bool = None, ) -> None: self.state = state self.skip_passphrase = skip_passphrase @classmethod def get_fields(cls) -> Dict: return { 1: ('state', p.BytesType, 0), 2: ('skip_passphrase', p.BoolType, 0), } python-trezor-0.11.6/src/trezorlib/messages/InputScriptType.py000066400000000000000000000004351361427340300245620ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off if False: from typing_extensions import Literal SPENDADDRESS = 0 # type: Literal[0] SPENDMULTISIG = 1 # type: Literal[1] EXTERNAL = 2 # type: Literal[2] SPENDWITNESS = 3 # type: Literal[3] SPENDP2SHWITNESS = 4 # type: Literal[4] python-trezor-0.11.6/src/trezorlib/messages/LiskAddress.py000066400000000000000000000010401361427340300236350ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class LiskAddress(p.MessageType): MESSAGE_WIRE_TYPE = 115 def __init__( self, address: str = None, ) -> None: self.address = address @classmethod def get_fields(cls) -> Dict: return { 1: ('address', p.UnicodeType, 0), } python-trezor-0.11.6/src/trezorlib/messages/LiskDelegateType.py000066400000000000000000000010151361427340300246260ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class LiskDelegateType(p.MessageType): def __init__( self, username: str = None, ) -> None: self.username = username @classmethod def get_fields(cls) -> Dict: return { 1: ('username', p.UnicodeType, 0), } python-trezor-0.11.6/src/trezorlib/messages/LiskGetAddress.py000066400000000000000000000013341361427340300243030ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class LiskGetAddress(p.MessageType): MESSAGE_WIRE_TYPE = 114 def __init__( self, address_n: List[int] = None, show_display: bool = None, ) -> None: self.address_n = address_n if address_n is not None else [] self.show_display = show_display @classmethod def get_fields(cls) -> Dict: return { 1: ('address_n', p.UVarintType, p.FLAG_REPEATED), 2: ('show_display', p.BoolType, 0), } python-trezor-0.11.6/src/trezorlib/messages/LiskGetPublicKey.py000066400000000000000000000013361361427340300246070ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class LiskGetPublicKey(p.MessageType): MESSAGE_WIRE_TYPE = 121 def __init__( self, address_n: List[int] = None, show_display: bool = None, ) -> None: self.address_n = address_n if address_n is not None else [] self.show_display = show_display @classmethod def get_fields(cls) -> Dict: return { 1: ('address_n', p.UVarintType, p.FLAG_REPEATED), 2: ('show_display', p.BoolType, 0), } python-trezor-0.11.6/src/trezorlib/messages/LiskMessageSignature.py000066400000000000000000000012471361427340300255270ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class LiskMessageSignature(p.MessageType): MESSAGE_WIRE_TYPE = 119 def __init__( self, public_key: bytes = None, signature: bytes = None, ) -> None: self.public_key = public_key self.signature = signature @classmethod def get_fields(cls) -> Dict: return { 1: ('public_key', p.BytesType, 0), 2: ('signature', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/LiskMultisignatureType.py000066400000000000000000000014351361427340300261360ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class LiskMultisignatureType(p.MessageType): def __init__( self, min: int = None, life_time: int = None, keys_group: List[str] = None, ) -> None: self.min = min self.life_time = life_time self.keys_group = keys_group if keys_group is not None else [] @classmethod def get_fields(cls) -> Dict: return { 1: ('min', p.UVarintType, 0), 2: ('life_time', p.UVarintType, 0), 3: ('keys_group', p.UnicodeType, p.FLAG_REPEATED), } python-trezor-0.11.6/src/trezorlib/messages/LiskPublicKey.py000066400000000000000000000010561361427340300241460ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class LiskPublicKey(p.MessageType): MESSAGE_WIRE_TYPE = 122 def __init__( self, public_key: bytes = None, ) -> None: self.public_key = public_key @classmethod def get_fields(cls) -> Dict: return { 1: ('public_key', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/LiskSignMessage.py000066400000000000000000000013131361427340300244600ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class LiskSignMessage(p.MessageType): MESSAGE_WIRE_TYPE = 118 def __init__( self, address_n: List[int] = None, message: bytes = None, ) -> None: self.address_n = address_n if address_n is not None else [] self.message = message @classmethod def get_fields(cls) -> Dict: return { 1: ('address_n', p.UVarintType, p.FLAG_REPEATED), 2: ('message', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/LiskSignTx.py000066400000000000000000000014521361427340300234730ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .LiskTransactionCommon import LiskTransactionCommon if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class LiskSignTx(p.MessageType): MESSAGE_WIRE_TYPE = 116 def __init__( self, address_n: List[int] = None, transaction: LiskTransactionCommon = None, ) -> None: self.address_n = address_n if address_n is not None else [] self.transaction = transaction @classmethod def get_fields(cls) -> Dict: return { 1: ('address_n', p.UVarintType, p.FLAG_REPEATED), 2: ('transaction', LiskTransactionCommon, 0), } python-trezor-0.11.6/src/trezorlib/messages/LiskSignatureType.py000066400000000000000000000010261361427340300250570ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class LiskSignatureType(p.MessageType): def __init__( self, public_key: bytes = None, ) -> None: self.public_key = public_key @classmethod def get_fields(cls) -> Dict: return { 1: ('public_key', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/LiskSignedTx.py000066400000000000000000000010511361427340300237770ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class LiskSignedTx(p.MessageType): MESSAGE_WIRE_TYPE = 117 def __init__( self, signature: bytes = None, ) -> None: self.signature = signature @classmethod def get_fields(cls) -> Dict: return { 1: ('signature', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/LiskTransactionAsset.py000066400000000000000000000023241361427340300255430ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .LiskDelegateType import LiskDelegateType from .LiskMultisignatureType import LiskMultisignatureType from .LiskSignatureType import LiskSignatureType if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class LiskTransactionAsset(p.MessageType): def __init__( self, signature: LiskSignatureType = None, delegate: LiskDelegateType = None, votes: List[str] = None, multisignature: LiskMultisignatureType = None, data: str = None, ) -> None: self.signature = signature self.delegate = delegate self.votes = votes if votes is not None else [] self.multisignature = multisignature self.data = data @classmethod def get_fields(cls) -> Dict: return { 1: ('signature', LiskSignatureType, 0), 2: ('delegate', LiskDelegateType, 0), 3: ('votes', p.UnicodeType, p.FLAG_REPEATED), 4: ('multisignature', LiskMultisignatureType, 0), 5: ('data', p.UnicodeType, 0), } python-trezor-0.11.6/src/trezorlib/messages/LiskTransactionCommon.py000066400000000000000000000032371361427340300257200ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .LiskTransactionAsset import LiskTransactionAsset if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeLiskTransactionType = Literal[0, 1, 2, 3, 4, 5, 6, 7] except ImportError: pass class LiskTransactionCommon(p.MessageType): def __init__( self, type: EnumTypeLiskTransactionType = None, amount: int = None, fee: int = None, recipient_id: str = None, sender_public_key: bytes = None, requester_public_key: bytes = None, signature: bytes = None, timestamp: int = None, asset: LiskTransactionAsset = None, ) -> None: self.type = type self.amount = amount self.fee = fee self.recipient_id = recipient_id self.sender_public_key = sender_public_key self.requester_public_key = requester_public_key self.signature = signature self.timestamp = timestamp self.asset = asset @classmethod def get_fields(cls) -> Dict: return { 1: ('type', p.EnumType("LiskTransactionType", (0, 1, 2, 3, 4, 5, 6, 7)), 0), 2: ('amount', p.UVarintType, 0), # default=0 3: ('fee', p.UVarintType, 0), 4: ('recipient_id', p.UnicodeType, 0), 5: ('sender_public_key', p.BytesType, 0), 6: ('requester_public_key', p.BytesType, 0), 7: ('signature', p.BytesType, 0), 8: ('timestamp', p.UVarintType, 0), 9: ('asset', LiskTransactionAsset, 0), } python-trezor-0.11.6/src/trezorlib/messages/LiskTransactionType.py000066400000000000000000000006541361427340300254110ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off if False: from typing_extensions import Literal Transfer = 0 # type: Literal[0] RegisterSecondPassphrase = 1 # type: Literal[1] RegisterDelegate = 2 # type: Literal[2] CastVotes = 3 # type: Literal[3] RegisterMultisignatureAccount = 4 # type: Literal[4] CreateDapp = 5 # type: Literal[5] TransferIntoDapp = 6 # type: Literal[6] TransferOutOfDapp = 7 # type: Literal[7] python-trezor-0.11.6/src/trezorlib/messages/LiskVerifyMessage.py000066400000000000000000000014161361427340300250300ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class LiskVerifyMessage(p.MessageType): MESSAGE_WIRE_TYPE = 120 def __init__( self, public_key: bytes = None, signature: bytes = None, message: bytes = None, ) -> None: self.public_key = public_key self.signature = signature self.message = message @classmethod def get_fields(cls) -> Dict: return { 1: ('public_key', p.BytesType, 0), 2: ('signature', p.BytesType, 0), 3: ('message', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/LoadDevice.py000066400000000000000000000030351361427340300234320ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class LoadDevice(p.MessageType): MESSAGE_WIRE_TYPE = 13 def __init__( self, mnemonics: List[str] = None, pin: str = None, passphrase_protection: bool = None, language: str = None, label: str = None, skip_checksum: bool = None, u2f_counter: int = None, needs_backup: bool = None, no_backup: bool = None, ) -> None: self.mnemonics = mnemonics if mnemonics is not None else [] self.pin = pin self.passphrase_protection = passphrase_protection self.language = language self.label = label self.skip_checksum = skip_checksum self.u2f_counter = u2f_counter self.needs_backup = needs_backup self.no_backup = no_backup @classmethod def get_fields(cls) -> Dict: return { 1: ('mnemonics', p.UnicodeType, p.FLAG_REPEATED), 3: ('pin', p.UnicodeType, 0), 4: ('passphrase_protection', p.BoolType, 0), 5: ('language', p.UnicodeType, 0), # default=en-US 6: ('label', p.UnicodeType, 0), 7: ('skip_checksum', p.BoolType, 0), 8: ('u2f_counter', p.UVarintType, 0), 9: ('needs_backup', p.BoolType, 0), 10: ('no_backup', p.BoolType, 0), } python-trezor-0.11.6/src/trezorlib/messages/MessageSignature.py000066400000000000000000000012261361427340300247010ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MessageSignature(p.MessageType): MESSAGE_WIRE_TYPE = 40 def __init__( self, address: str = None, signature: bytes = None, ) -> None: self.address = address self.signature = signature @classmethod def get_fields(cls) -> Dict: return { 1: ('address', p.UnicodeType, 0), 2: ('signature', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/MessageType.py000066400000000000000000000204521361427340300236630ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off if False: from typing_extensions import Literal Initialize = 0 # type: Literal[0] Ping = 1 # type: Literal[1] Success = 2 # type: Literal[2] Failure = 3 # type: Literal[3] ChangePin = 4 # type: Literal[4] WipeDevice = 5 # type: Literal[5] GetEntropy = 9 # type: Literal[9] Entropy = 10 # type: Literal[10] LoadDevice = 13 # type: Literal[13] ResetDevice = 14 # type: Literal[14] Features = 17 # type: Literal[17] PinMatrixRequest = 18 # type: Literal[18] PinMatrixAck = 19 # type: Literal[19] Cancel = 20 # type: Literal[20] ClearSession = 24 # type: Literal[24] ApplySettings = 25 # type: Literal[25] ButtonRequest = 26 # type: Literal[26] ButtonAck = 27 # type: Literal[27] ApplyFlags = 28 # type: Literal[28] BackupDevice = 34 # type: Literal[34] EntropyRequest = 35 # type: Literal[35] EntropyAck = 36 # type: Literal[36] PassphraseRequest = 41 # type: Literal[41] PassphraseAck = 42 # type: Literal[42] PassphraseStateRequest = 77 # type: Literal[77] PassphraseStateAck = 78 # type: Literal[78] RecoveryDevice = 45 # type: Literal[45] WordRequest = 46 # type: Literal[46] WordAck = 47 # type: Literal[47] GetFeatures = 55 # type: Literal[55] SetU2FCounter = 63 # type: Literal[63] SdProtect = 79 # type: Literal[79] GetNextU2FCounter = 80 # type: Literal[80] NextU2FCounter = 81 # type: Literal[81] ChangeWipeCode = 82 # type: Literal[82] FirmwareErase = 6 # type: Literal[6] FirmwareUpload = 7 # type: Literal[7] FirmwareRequest = 8 # type: Literal[8] SelfTest = 32 # type: Literal[32] GetPublicKey = 11 # type: Literal[11] PublicKey = 12 # type: Literal[12] SignTx = 15 # type: Literal[15] TxRequest = 21 # type: Literal[21] TxAck = 22 # type: Literal[22] GetAddress = 29 # type: Literal[29] Address = 30 # type: Literal[30] SignMessage = 38 # type: Literal[38] VerifyMessage = 39 # type: Literal[39] MessageSignature = 40 # type: Literal[40] CipherKeyValue = 23 # type: Literal[23] CipheredKeyValue = 48 # type: Literal[48] SignIdentity = 53 # type: Literal[53] SignedIdentity = 54 # type: Literal[54] GetECDHSessionKey = 61 # type: Literal[61] ECDHSessionKey = 62 # type: Literal[62] CosiCommit = 71 # type: Literal[71] CosiCommitment = 72 # type: Literal[72] CosiSign = 73 # type: Literal[73] CosiSignature = 74 # type: Literal[74] DebugLinkDecision = 100 # type: Literal[100] DebugLinkGetState = 101 # type: Literal[101] DebugLinkState = 102 # type: Literal[102] DebugLinkStop = 103 # type: Literal[103] DebugLinkLog = 104 # type: Literal[104] DebugLinkMemoryRead = 110 # type: Literal[110] DebugLinkMemory = 111 # type: Literal[111] DebugLinkMemoryWrite = 112 # type: Literal[112] DebugLinkFlashErase = 113 # type: Literal[113] DebugLinkLayout = 9001 # type: Literal[9001] EthereumGetPublicKey = 450 # type: Literal[450] EthereumPublicKey = 451 # type: Literal[451] EthereumGetAddress = 56 # type: Literal[56] EthereumAddress = 57 # type: Literal[57] EthereumSignTx = 58 # type: Literal[58] EthereumTxRequest = 59 # type: Literal[59] EthereumTxAck = 60 # type: Literal[60] EthereumSignMessage = 64 # type: Literal[64] EthereumVerifyMessage = 65 # type: Literal[65] EthereumMessageSignature = 66 # type: Literal[66] NEMGetAddress = 67 # type: Literal[67] NEMAddress = 68 # type: Literal[68] NEMSignTx = 69 # type: Literal[69] NEMSignedTx = 70 # type: Literal[70] NEMDecryptMessage = 75 # type: Literal[75] NEMDecryptedMessage = 76 # type: Literal[76] LiskGetAddress = 114 # type: Literal[114] LiskAddress = 115 # type: Literal[115] LiskSignTx = 116 # type: Literal[116] LiskSignedTx = 117 # type: Literal[117] LiskSignMessage = 118 # type: Literal[118] LiskMessageSignature = 119 # type: Literal[119] LiskVerifyMessage = 120 # type: Literal[120] LiskGetPublicKey = 121 # type: Literal[121] LiskPublicKey = 122 # type: Literal[122] TezosGetAddress = 150 # type: Literal[150] TezosAddress = 151 # type: Literal[151] TezosSignTx = 152 # type: Literal[152] TezosSignedTx = 153 # type: Literal[153] TezosGetPublicKey = 154 # type: Literal[154] TezosPublicKey = 155 # type: Literal[155] StellarSignTx = 202 # type: Literal[202] StellarTxOpRequest = 203 # type: Literal[203] StellarGetAddress = 207 # type: Literal[207] StellarAddress = 208 # type: Literal[208] StellarCreateAccountOp = 210 # type: Literal[210] StellarPaymentOp = 211 # type: Literal[211] StellarPathPaymentOp = 212 # type: Literal[212] StellarManageOfferOp = 213 # type: Literal[213] StellarCreatePassiveOfferOp = 214 # type: Literal[214] StellarSetOptionsOp = 215 # type: Literal[215] StellarChangeTrustOp = 216 # type: Literal[216] StellarAllowTrustOp = 217 # type: Literal[217] StellarAccountMergeOp = 218 # type: Literal[218] StellarManageDataOp = 220 # type: Literal[220] StellarBumpSequenceOp = 221 # type: Literal[221] StellarSignedTx = 230 # type: Literal[230] CardanoSignTx = 303 # type: Literal[303] CardanoTxRequest = 304 # type: Literal[304] CardanoGetPublicKey = 305 # type: Literal[305] CardanoPublicKey = 306 # type: Literal[306] CardanoGetAddress = 307 # type: Literal[307] CardanoAddress = 308 # type: Literal[308] CardanoTxAck = 309 # type: Literal[309] CardanoSignedTx = 310 # type: Literal[310] RippleGetAddress = 400 # type: Literal[400] RippleAddress = 401 # type: Literal[401] RippleSignTx = 402 # type: Literal[402] RippleSignedTx = 403 # type: Literal[403] MoneroTransactionInitRequest = 501 # type: Literal[501] MoneroTransactionInitAck = 502 # type: Literal[502] MoneroTransactionSetInputRequest = 503 # type: Literal[503] MoneroTransactionSetInputAck = 504 # type: Literal[504] MoneroTransactionInputsPermutationRequest = 505 # type: Literal[505] MoneroTransactionInputsPermutationAck = 506 # type: Literal[506] MoneroTransactionInputViniRequest = 507 # type: Literal[507] MoneroTransactionInputViniAck = 508 # type: Literal[508] MoneroTransactionAllInputsSetRequest = 509 # type: Literal[509] MoneroTransactionAllInputsSetAck = 510 # type: Literal[510] MoneroTransactionSetOutputRequest = 511 # type: Literal[511] MoneroTransactionSetOutputAck = 512 # type: Literal[512] MoneroTransactionAllOutSetRequest = 513 # type: Literal[513] MoneroTransactionAllOutSetAck = 514 # type: Literal[514] MoneroTransactionSignInputRequest = 515 # type: Literal[515] MoneroTransactionSignInputAck = 516 # type: Literal[516] MoneroTransactionFinalRequest = 517 # type: Literal[517] MoneroTransactionFinalAck = 518 # type: Literal[518] MoneroKeyImageExportInitRequest = 530 # type: Literal[530] MoneroKeyImageExportInitAck = 531 # type: Literal[531] MoneroKeyImageSyncStepRequest = 532 # type: Literal[532] MoneroKeyImageSyncStepAck = 533 # type: Literal[533] MoneroKeyImageSyncFinalRequest = 534 # type: Literal[534] MoneroKeyImageSyncFinalAck = 535 # type: Literal[535] MoneroGetAddress = 540 # type: Literal[540] MoneroAddress = 541 # type: Literal[541] MoneroGetWatchKey = 542 # type: Literal[542] MoneroWatchKey = 543 # type: Literal[543] DebugMoneroDiagRequest = 546 # type: Literal[546] DebugMoneroDiagAck = 547 # type: Literal[547] MoneroGetTxKeyRequest = 550 # type: Literal[550] MoneroGetTxKeyAck = 551 # type: Literal[551] MoneroLiveRefreshStartRequest = 552 # type: Literal[552] MoneroLiveRefreshStartAck = 553 # type: Literal[553] MoneroLiveRefreshStepRequest = 554 # type: Literal[554] MoneroLiveRefreshStepAck = 555 # type: Literal[555] MoneroLiveRefreshFinalRequest = 556 # type: Literal[556] MoneroLiveRefreshFinalAck = 557 # type: Literal[557] EosGetPublicKey = 600 # type: Literal[600] EosPublicKey = 601 # type: Literal[601] EosSignTx = 602 # type: Literal[602] EosTxActionRequest = 603 # type: Literal[603] EosTxActionAck = 604 # type: Literal[604] EosSignedTx = 605 # type: Literal[605] BinanceGetAddress = 700 # type: Literal[700] BinanceAddress = 701 # type: Literal[701] BinanceGetPublicKey = 702 # type: Literal[702] BinancePublicKey = 703 # type: Literal[703] BinanceSignTx = 704 # type: Literal[704] BinanceTxRequest = 705 # type: Literal[705] BinanceTransferMsg = 706 # type: Literal[706] BinanceOrderMsg = 707 # type: Literal[707] BinanceCancelMsg = 708 # type: Literal[708] BinanceSignedTx = 709 # type: Literal[709] WebAuthnListResidentCredentials = 800 # type: Literal[800] WebAuthnCredentials = 801 # type: Literal[801] WebAuthnAddResidentCredential = 802 # type: Literal[802] WebAuthnRemoveResidentCredential = 803 # type: Literal[803] python-trezor-0.11.6/src/trezorlib/messages/MoneroAccountPublicAddress.py000066400000000000000000000013011361427340300266460ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroAccountPublicAddress(p.MessageType): def __init__( self, spend_public_key: bytes = None, view_public_key: bytes = None, ) -> None: self.spend_public_key = spend_public_key self.view_public_key = view_public_key @classmethod def get_fields(cls) -> Dict: return { 1: ('spend_public_key', p.BytesType, 0), 2: ('view_public_key', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/MoneroAddress.py000066400000000000000000000010421361427340300241740ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroAddress(p.MessageType): MESSAGE_WIRE_TYPE = 541 def __init__( self, address: bytes = None, ) -> None: self.address = address @classmethod def get_fields(cls) -> Dict: return { 1: ('address', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/MoneroExportedKeyImage.py000066400000000000000000000011311361427340300260140ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroExportedKeyImage(p.MessageType): def __init__( self, iv: bytes = None, blob: bytes = None, ) -> None: self.iv = iv self.blob = blob @classmethod def get_fields(cls) -> Dict: return { 1: ('iv', p.BytesType, 0), 3: ('blob', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/MoneroGetAddress.py000066400000000000000000000022361361427340300246420ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroGetAddress(p.MessageType): MESSAGE_WIRE_TYPE = 540 def __init__( self, address_n: List[int] = None, show_display: bool = None, network_type: int = None, account: int = None, minor: int = None, payment_id: bytes = None, ) -> None: self.address_n = address_n if address_n is not None else [] self.show_display = show_display self.network_type = network_type self.account = account self.minor = minor self.payment_id = payment_id @classmethod def get_fields(cls) -> Dict: return { 1: ('address_n', p.UVarintType, p.FLAG_REPEATED), 2: ('show_display', p.BoolType, 0), 3: ('network_type', p.UVarintType, 0), 4: ('account', p.UVarintType, 0), 5: ('minor', p.UVarintType, 0), 6: ('payment_id', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/MoneroGetTxKeyAck.py000066400000000000000000000014121361427340300247330ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroGetTxKeyAck(p.MessageType): MESSAGE_WIRE_TYPE = 551 def __init__( self, salt: bytes = None, tx_keys: bytes = None, tx_derivations: bytes = None, ) -> None: self.salt = salt self.tx_keys = tx_keys self.tx_derivations = tx_derivations @classmethod def get_fields(cls) -> Dict: return { 1: ('salt', p.BytesType, 0), 2: ('tx_keys', p.BytesType, 0), 3: ('tx_derivations', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/MoneroGetTxKeyRequest.py000066400000000000000000000026311361427340300256710ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroGetTxKeyRequest(p.MessageType): MESSAGE_WIRE_TYPE = 550 def __init__( self, address_n: List[int] = None, network_type: int = None, salt1: bytes = None, salt2: bytes = None, tx_enc_keys: bytes = None, tx_prefix_hash: bytes = None, reason: int = None, view_public_key: bytes = None, ) -> None: self.address_n = address_n if address_n is not None else [] self.network_type = network_type self.salt1 = salt1 self.salt2 = salt2 self.tx_enc_keys = tx_enc_keys self.tx_prefix_hash = tx_prefix_hash self.reason = reason self.view_public_key = view_public_key @classmethod def get_fields(cls) -> Dict: return { 1: ('address_n', p.UVarintType, p.FLAG_REPEATED), 2: ('network_type', p.UVarintType, 0), 3: ('salt1', p.BytesType, 0), 4: ('salt2', p.BytesType, 0), 5: ('tx_enc_keys', p.BytesType, 0), 6: ('tx_prefix_hash', p.BytesType, 0), 7: ('reason', p.UVarintType, 0), 8: ('view_public_key', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/MoneroGetWatchKey.py000066400000000000000000000013411361427340300247700ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroGetWatchKey(p.MessageType): MESSAGE_WIRE_TYPE = 542 def __init__( self, address_n: List[int] = None, network_type: int = None, ) -> None: self.address_n = address_n if address_n is not None else [] self.network_type = network_type @classmethod def get_fields(cls) -> Dict: return { 1: ('address_n', p.UVarintType, p.FLAG_REPEATED), 2: ('network_type', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/MoneroKeyImageExportInitAck.py000066400000000000000000000005101361427340300267460ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroKeyImageExportInitAck(p.MessageType): MESSAGE_WIRE_TYPE = 531 python-trezor-0.11.6/src/trezorlib/messages/MoneroKeyImageExportInitRequest.py000066400000000000000000000022411361427340300277030ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .MoneroSubAddressIndicesList import MoneroSubAddressIndicesList if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroKeyImageExportInitRequest(p.MessageType): MESSAGE_WIRE_TYPE = 530 def __init__( self, num: int = None, hash: bytes = None, address_n: List[int] = None, network_type: int = None, subs: List[MoneroSubAddressIndicesList] = None, ) -> None: self.num = num self.hash = hash self.address_n = address_n if address_n is not None else [] self.network_type = network_type self.subs = subs if subs is not None else [] @classmethod def get_fields(cls) -> Dict: return { 1: ('num', p.UVarintType, 0), 2: ('hash', p.BytesType, 0), 3: ('address_n', p.UVarintType, p.FLAG_REPEATED), 4: ('network_type', p.UVarintType, 0), 5: ('subs', MoneroSubAddressIndicesList, p.FLAG_REPEATED), } python-trezor-0.11.6/src/trezorlib/messages/MoneroKeyImageSyncFinalAck.py000066400000000000000000000010571361427340300265360ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroKeyImageSyncFinalAck(p.MessageType): MESSAGE_WIRE_TYPE = 535 def __init__( self, enc_key: bytes = None, ) -> None: self.enc_key = enc_key @classmethod def get_fields(cls) -> Dict: return { 1: ('enc_key', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/MoneroKeyImageSyncFinalRequest.py000066400000000000000000000005131361427340300274640ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroKeyImageSyncFinalRequest(p.MessageType): MESSAGE_WIRE_TYPE = 534 python-trezor-0.11.6/src/trezorlib/messages/MoneroKeyImageSyncStepAck.py000066400000000000000000000012451361427340300264170ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .MoneroExportedKeyImage import MoneroExportedKeyImage if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroKeyImageSyncStepAck(p.MessageType): MESSAGE_WIRE_TYPE = 533 def __init__( self, kis: List[MoneroExportedKeyImage] = None, ) -> None: self.kis = kis if kis is not None else [] @classmethod def get_fields(cls) -> Dict: return { 1: ('kis', MoneroExportedKeyImage, p.FLAG_REPEATED), } python-trezor-0.11.6/src/trezorlib/messages/MoneroKeyImageSyncStepRequest.py000066400000000000000000000012521361427340300273470ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .MoneroTransferDetails import MoneroTransferDetails if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroKeyImageSyncStepRequest(p.MessageType): MESSAGE_WIRE_TYPE = 532 def __init__( self, tdis: List[MoneroTransferDetails] = None, ) -> None: self.tdis = tdis if tdis is not None else [] @classmethod def get_fields(cls) -> Dict: return { 1: ('tdis', MoneroTransferDetails, p.FLAG_REPEATED), } python-trezor-0.11.6/src/trezorlib/messages/MoneroLiveRefreshFinalAck.py000066400000000000000000000005061361427340300264220ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroLiveRefreshFinalAck(p.MessageType): MESSAGE_WIRE_TYPE = 557 python-trezor-0.11.6/src/trezorlib/messages/MoneroLiveRefreshFinalRequest.py000066400000000000000000000005121361427340300273510ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroLiveRefreshFinalRequest(p.MessageType): MESSAGE_WIRE_TYPE = 556 python-trezor-0.11.6/src/trezorlib/messages/MoneroLiveRefreshStartAck.py000066400000000000000000000005061361427340300264660ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroLiveRefreshStartAck(p.MessageType): MESSAGE_WIRE_TYPE = 553 python-trezor-0.11.6/src/trezorlib/messages/MoneroLiveRefreshStartRequest.py000066400000000000000000000013551361427340300274230ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroLiveRefreshStartRequest(p.MessageType): MESSAGE_WIRE_TYPE = 552 def __init__( self, address_n: List[int] = None, network_type: int = None, ) -> None: self.address_n = address_n if address_n is not None else [] self.network_type = network_type @classmethod def get_fields(cls) -> Dict: return { 1: ('address_n', p.UVarintType, p.FLAG_REPEATED), 2: ('network_type', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/MoneroLiveRefreshStepAck.py000066400000000000000000000012231361427340300263010ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroLiveRefreshStepAck(p.MessageType): MESSAGE_WIRE_TYPE = 555 def __init__( self, salt: bytes = None, key_image: bytes = None, ) -> None: self.salt = salt self.key_image = key_image @classmethod def get_fields(cls) -> Dict: return { 1: ('salt', p.BytesType, 0), 2: ('key_image', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/MoneroLiveRefreshStepRequest.py000066400000000000000000000020611361427340300272340ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroLiveRefreshStepRequest(p.MessageType): MESSAGE_WIRE_TYPE = 554 def __init__( self, out_key: bytes = None, recv_deriv: bytes = None, real_out_idx: int = None, sub_addr_major: int = None, sub_addr_minor: int = None, ) -> None: self.out_key = out_key self.recv_deriv = recv_deriv self.real_out_idx = real_out_idx self.sub_addr_major = sub_addr_major self.sub_addr_minor = sub_addr_minor @classmethod def get_fields(cls) -> Dict: return { 1: ('out_key', p.BytesType, 0), 2: ('recv_deriv', p.BytesType, 0), 3: ('real_out_idx', p.UVarintType, 0), 4: ('sub_addr_major', p.UVarintType, 0), 5: ('sub_addr_minor', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/MoneroMultisigKLRki.py000066400000000000000000000013561361427340300253110ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroMultisigKLRki(p.MessageType): def __init__( self, K: bytes = None, L: bytes = None, R: bytes = None, ki: bytes = None, ) -> None: self.K = K self.L = L self.R = R self.ki = ki @classmethod def get_fields(cls) -> Dict: return { 1: ('K', p.BytesType, 0), 2: ('L', p.BytesType, 0), 3: ('R', p.BytesType, 0), 4: ('ki', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/MoneroOutputEntry.py000066400000000000000000000012341361427340300251340ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .MoneroRctKeyPublic import MoneroRctKeyPublic if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroOutputEntry(p.MessageType): def __init__( self, idx: int = None, key: MoneroRctKeyPublic = None, ) -> None: self.idx = idx self.key = key @classmethod def get_fields(cls) -> Dict: return { 1: ('idx', p.UVarintType, 0), 2: ('key', MoneroRctKeyPublic, 0), } python-trezor-0.11.6/src/trezorlib/messages/MoneroRctKeyPublic.py000066400000000000000000000011651361427340300251550ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroRctKeyPublic(p.MessageType): def __init__( self, dest: bytes = None, commitment: bytes = None, ) -> None: self.dest = dest self.commitment = commitment @classmethod def get_fields(cls) -> Dict: return { 1: ('dest', p.BytesType, 0), 2: ('commitment', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/MoneroRingCtSig.py000066400000000000000000000013341361427340300244440ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroRingCtSig(p.MessageType): def __init__( self, txn_fee: int = None, message: bytes = None, rv_type: int = None, ) -> None: self.txn_fee = txn_fee self.message = message self.rv_type = rv_type @classmethod def get_fields(cls) -> Dict: return { 1: ('txn_fee', p.UVarintType, 0), 2: ('message', p.BytesType, 0), 3: ('rv_type', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/MoneroSubAddressIndicesList.py000066400000000000000000000013171361427340300270060ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroSubAddressIndicesList(p.MessageType): def __init__( self, account: int = None, minor_indices: List[int] = None, ) -> None: self.account = account self.minor_indices = minor_indices if minor_indices is not None else [] @classmethod def get_fields(cls) -> Dict: return { 1: ('account', p.UVarintType, 0), 2: ('minor_indices', p.UVarintType, p.FLAG_REPEATED), } python-trezor-0.11.6/src/trezorlib/messages/MoneroTransactionAllInputsSetAck.py000066400000000000000000000012411361427340300300240ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .MoneroTransactionRsigData import MoneroTransactionRsigData if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroTransactionAllInputsSetAck(p.MessageType): MESSAGE_WIRE_TYPE = 510 def __init__( self, rsig_data: MoneroTransactionRsigData = None, ) -> None: self.rsig_data = rsig_data @classmethod def get_fields(cls) -> Dict: return { 1: ('rsig_data', MoneroTransactionRsigData, 0), } python-trezor-0.11.6/src/trezorlib/messages/MoneroTransactionAllInputsSetRequest.py000066400000000000000000000005211361427340300307560ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroTransactionAllInputsSetRequest(p.MessageType): MESSAGE_WIRE_TYPE = 509 python-trezor-0.11.6/src/trezorlib/messages/MoneroTransactionAllOutSetAck.py000066400000000000000000000017241361427340300273170ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .MoneroRingCtSig import MoneroRingCtSig if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroTransactionAllOutSetAck(p.MessageType): MESSAGE_WIRE_TYPE = 514 def __init__( self, extra: bytes = None, tx_prefix_hash: bytes = None, rv: MoneroRingCtSig = None, full_message_hash: bytes = None, ) -> None: self.extra = extra self.tx_prefix_hash = tx_prefix_hash self.rv = rv self.full_message_hash = full_message_hash @classmethod def get_fields(cls) -> Dict: return { 1: ('extra', p.BytesType, 0), 2: ('tx_prefix_hash', p.BytesType, 0), 4: ('rv', MoneroRingCtSig, 0), 5: ('full_message_hash', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/MoneroTransactionAllOutSetRequest.py000066400000000000000000000012421361427340300302440ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .MoneroTransactionRsigData import MoneroTransactionRsigData if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroTransactionAllOutSetRequest(p.MessageType): MESSAGE_WIRE_TYPE = 513 def __init__( self, rsig_data: MoneroTransactionRsigData = None, ) -> None: self.rsig_data = rsig_data @classmethod def get_fields(cls) -> Dict: return { 1: ('rsig_data', MoneroTransactionRsigData, 0), } python-trezor-0.11.6/src/trezorlib/messages/MoneroTransactionData.py000066400000000000000000000051131361427340300256710ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .MoneroTransactionDestinationEntry import MoneroTransactionDestinationEntry from .MoneroTransactionRsigData import MoneroTransactionRsigData if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroTransactionData(p.MessageType): def __init__( self, version: int = None, payment_id: bytes = None, unlock_time: int = None, outputs: List[MoneroTransactionDestinationEntry] = None, change_dts: MoneroTransactionDestinationEntry = None, num_inputs: int = None, mixin: int = None, fee: int = None, account: int = None, minor_indices: List[int] = None, rsig_data: MoneroTransactionRsigData = None, integrated_indices: List[int] = None, client_version: int = None, hard_fork: int = None, monero_version: bytes = None, ) -> None: self.version = version self.payment_id = payment_id self.unlock_time = unlock_time self.outputs = outputs if outputs is not None else [] self.change_dts = change_dts self.num_inputs = num_inputs self.mixin = mixin self.fee = fee self.account = account self.minor_indices = minor_indices if minor_indices is not None else [] self.rsig_data = rsig_data self.integrated_indices = integrated_indices if integrated_indices is not None else [] self.client_version = client_version self.hard_fork = hard_fork self.monero_version = monero_version @classmethod def get_fields(cls) -> Dict: return { 1: ('version', p.UVarintType, 0), 2: ('payment_id', p.BytesType, 0), 3: ('unlock_time', p.UVarintType, 0), 4: ('outputs', MoneroTransactionDestinationEntry, p.FLAG_REPEATED), 5: ('change_dts', MoneroTransactionDestinationEntry, 0), 6: ('num_inputs', p.UVarintType, 0), 7: ('mixin', p.UVarintType, 0), 8: ('fee', p.UVarintType, 0), 9: ('account', p.UVarintType, 0), 10: ('minor_indices', p.UVarintType, p.FLAG_REPEATED), 11: ('rsig_data', MoneroTransactionRsigData, 0), 12: ('integrated_indices', p.UVarintType, p.FLAG_REPEATED), 13: ('client_version', p.UVarintType, 0), 14: ('hard_fork', p.UVarintType, 0), 15: ('monero_version', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/MoneroTransactionDestinationEntry.py000066400000000000000000000021121361427340300303170ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .MoneroAccountPublicAddress import MoneroAccountPublicAddress if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroTransactionDestinationEntry(p.MessageType): def __init__( self, amount: int = None, addr: MoneroAccountPublicAddress = None, is_subaddress: bool = None, original: bytes = None, is_integrated: bool = None, ) -> None: self.amount = amount self.addr = addr self.is_subaddress = is_subaddress self.original = original self.is_integrated = is_integrated @classmethod def get_fields(cls) -> Dict: return { 1: ('amount', p.UVarintType, 0), 2: ('addr', MoneroAccountPublicAddress, 0), 3: ('is_subaddress', p.BoolType, 0), 4: ('original', p.BytesType, 0), 5: ('is_integrated', p.BoolType, 0), } python-trezor-0.11.6/src/trezorlib/messages/MoneroTransactionFinalAck.py000066400000000000000000000015741361427340300264770ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroTransactionFinalAck(p.MessageType): MESSAGE_WIRE_TYPE = 518 def __init__( self, cout_key: bytes = None, salt: bytes = None, rand_mult: bytes = None, tx_enc_keys: bytes = None, ) -> None: self.cout_key = cout_key self.salt = salt self.rand_mult = rand_mult self.tx_enc_keys = tx_enc_keys @classmethod def get_fields(cls) -> Dict: return { 1: ('cout_key', p.BytesType, 0), 2: ('salt', p.BytesType, 0), 3: ('rand_mult', p.BytesType, 0), 4: ('tx_enc_keys', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/MoneroTransactionFinalRequest.py000066400000000000000000000005121361427340300274200ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroTransactionFinalRequest(p.MessageType): MESSAGE_WIRE_TYPE = 517 python-trezor-0.11.6/src/trezorlib/messages/MoneroTransactionInitAck.py000066400000000000000000000014541361427340300263460ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .MoneroTransactionRsigData import MoneroTransactionRsigData if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroTransactionInitAck(p.MessageType): MESSAGE_WIRE_TYPE = 502 def __init__( self, hmacs: List[bytes] = None, rsig_data: MoneroTransactionRsigData = None, ) -> None: self.hmacs = hmacs if hmacs is not None else [] self.rsig_data = rsig_data @classmethod def get_fields(cls) -> Dict: return { 1: ('hmacs', p.BytesType, p.FLAG_REPEATED), 2: ('rsig_data', MoneroTransactionRsigData, 0), } python-trezor-0.11.6/src/trezorlib/messages/MoneroTransactionInitRequest.py000066400000000000000000000020301361427340300272670ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .MoneroTransactionData import MoneroTransactionData if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroTransactionInitRequest(p.MessageType): MESSAGE_WIRE_TYPE = 501 def __init__( self, version: int = None, address_n: List[int] = None, network_type: int = None, tsx_data: MoneroTransactionData = None, ) -> None: self.version = version self.address_n = address_n if address_n is not None else [] self.network_type = network_type self.tsx_data = tsx_data @classmethod def get_fields(cls) -> Dict: return { 1: ('version', p.UVarintType, 0), 2: ('address_n', p.UVarintType, p.FLAG_REPEATED), 3: ('network_type', p.UVarintType, 0), 4: ('tsx_data', MoneroTransactionData, 0), } python-trezor-0.11.6/src/trezorlib/messages/MoneroTransactionInputViniAck.py000066400000000000000000000005121361427340300273620ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroTransactionInputViniAck(p.MessageType): MESSAGE_WIRE_TYPE = 508 python-trezor-0.11.6/src/trezorlib/messages/MoneroTransactionInputViniRequest.py000066400000000000000000000021721361427340300303200ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .MoneroTransactionSourceEntry import MoneroTransactionSourceEntry if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroTransactionInputViniRequest(p.MessageType): MESSAGE_WIRE_TYPE = 507 def __init__( self, src_entr: MoneroTransactionSourceEntry = None, vini: bytes = None, vini_hmac: bytes = None, pseudo_out: bytes = None, pseudo_out_hmac: bytes = None, ) -> None: self.src_entr = src_entr self.vini = vini self.vini_hmac = vini_hmac self.pseudo_out = pseudo_out self.pseudo_out_hmac = pseudo_out_hmac @classmethod def get_fields(cls) -> Dict: return { 1: ('src_entr', MoneroTransactionSourceEntry, 0), 2: ('vini', p.BytesType, 0), 3: ('vini_hmac', p.BytesType, 0), 4: ('pseudo_out', p.BytesType, 0), 5: ('pseudo_out_hmac', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/MoneroTransactionInputsPermutationAck.py000066400000000000000000000005221361427340300311500ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroTransactionInputsPermutationAck(p.MessageType): MESSAGE_WIRE_TYPE = 506 python-trezor-0.11.6/src/trezorlib/messages/MoneroTransactionInputsPermutationRequest.py000066400000000000000000000011421361427340300321010ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroTransactionInputsPermutationRequest(p.MessageType): MESSAGE_WIRE_TYPE = 505 def __init__( self, perm: List[int] = None, ) -> None: self.perm = perm if perm is not None else [] @classmethod def get_fields(cls) -> Dict: return { 1: ('perm', p.UVarintType, p.FLAG_REPEATED), } python-trezor-0.11.6/src/trezorlib/messages/MoneroTransactionRsigData.py000066400000000000000000000024301361427340300265150ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroTransactionRsigData(p.MessageType): def __init__( self, rsig_type: int = None, offload_type: int = None, grouping: List[int] = None, mask: bytes = None, rsig: bytes = None, rsig_parts: List[bytes] = None, bp_version: int = None, ) -> None: self.rsig_type = rsig_type self.offload_type = offload_type self.grouping = grouping if grouping is not None else [] self.mask = mask self.rsig = rsig self.rsig_parts = rsig_parts if rsig_parts is not None else [] self.bp_version = bp_version @classmethod def get_fields(cls) -> Dict: return { 1: ('rsig_type', p.UVarintType, 0), 2: ('offload_type', p.UVarintType, 0), 3: ('grouping', p.UVarintType, p.FLAG_REPEATED), 4: ('mask', p.BytesType, 0), 5: ('rsig', p.BytesType, 0), 6: ('rsig_parts', p.BytesType, p.FLAG_REPEATED), 7: ('bp_version', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/MoneroTransactionSetInputAck.py000066400000000000000000000022271361427340300272150ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroTransactionSetInputAck(p.MessageType): MESSAGE_WIRE_TYPE = 504 def __init__( self, vini: bytes = None, vini_hmac: bytes = None, pseudo_out: bytes = None, pseudo_out_hmac: bytes = None, pseudo_out_alpha: bytes = None, spend_key: bytes = None, ) -> None: self.vini = vini self.vini_hmac = vini_hmac self.pseudo_out = pseudo_out self.pseudo_out_hmac = pseudo_out_hmac self.pseudo_out_alpha = pseudo_out_alpha self.spend_key = spend_key @classmethod def get_fields(cls) -> Dict: return { 1: ('vini', p.BytesType, 0), 2: ('vini_hmac', p.BytesType, 0), 3: ('pseudo_out', p.BytesType, 0), 4: ('pseudo_out_hmac', p.BytesType, 0), 5: ('pseudo_out_alpha', p.BytesType, 0), 6: ('spend_key', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/MoneroTransactionSetInputRequest.py000066400000000000000000000012511361427340300301430ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .MoneroTransactionSourceEntry import MoneroTransactionSourceEntry if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroTransactionSetInputRequest(p.MessageType): MESSAGE_WIRE_TYPE = 503 def __init__( self, src_entr: MoneroTransactionSourceEntry = None, ) -> None: self.src_entr = src_entr @classmethod def get_fields(cls) -> Dict: return { 1: ('src_entr', MoneroTransactionSourceEntry, 0), } python-trezor-0.11.6/src/trezorlib/messages/MoneroTransactionSetOutputAck.py000066400000000000000000000021221361427340300274100ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .MoneroTransactionRsigData import MoneroTransactionRsigData if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroTransactionSetOutputAck(p.MessageType): MESSAGE_WIRE_TYPE = 512 def __init__( self, tx_out: bytes = None, vouti_hmac: bytes = None, rsig_data: MoneroTransactionRsigData = None, out_pk: bytes = None, ecdh_info: bytes = None, ) -> None: self.tx_out = tx_out self.vouti_hmac = vouti_hmac self.rsig_data = rsig_data self.out_pk = out_pk self.ecdh_info = ecdh_info @classmethod def get_fields(cls) -> Dict: return { 1: ('tx_out', p.BytesType, 0), 2: ('vouti_hmac', p.BytesType, 0), 3: ('rsig_data', MoneroTransactionRsigData, 0), 4: ('out_pk', p.BytesType, 0), 5: ('ecdh_info', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/MoneroTransactionSetOutputRequest.py000066400000000000000000000022351361427340300303470ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .MoneroTransactionDestinationEntry import MoneroTransactionDestinationEntry from .MoneroTransactionRsigData import MoneroTransactionRsigData if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroTransactionSetOutputRequest(p.MessageType): MESSAGE_WIRE_TYPE = 511 def __init__( self, dst_entr: MoneroTransactionDestinationEntry = None, dst_entr_hmac: bytes = None, rsig_data: MoneroTransactionRsigData = None, is_offloaded_bp: bool = None, ) -> None: self.dst_entr = dst_entr self.dst_entr_hmac = dst_entr_hmac self.rsig_data = rsig_data self.is_offloaded_bp = is_offloaded_bp @classmethod def get_fields(cls) -> Dict: return { 1: ('dst_entr', MoneroTransactionDestinationEntry, 0), 2: ('dst_entr_hmac', p.BytesType, 0), 3: ('rsig_data', MoneroTransactionRsigData, 0), 4: ('is_offloaded_bp', p.BoolType, 0), } python-trezor-0.11.6/src/trezorlib/messages/MoneroTransactionSignInputAck.py000066400000000000000000000012601361427340300273560ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroTransactionSignInputAck(p.MessageType): MESSAGE_WIRE_TYPE = 516 def __init__( self, signature: bytes = None, pseudo_out: bytes = None, ) -> None: self.signature = signature self.pseudo_out = pseudo_out @classmethod def get_fields(cls) -> Dict: return { 1: ('signature', p.BytesType, 0), 2: ('pseudo_out', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/MoneroTransactionSignInputRequest.py000066400000000000000000000025721361427340300303170ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .MoneroTransactionSourceEntry import MoneroTransactionSourceEntry if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroTransactionSignInputRequest(p.MessageType): MESSAGE_WIRE_TYPE = 515 def __init__( self, src_entr: MoneroTransactionSourceEntry = None, vini: bytes = None, vini_hmac: bytes = None, pseudo_out: bytes = None, pseudo_out_hmac: bytes = None, pseudo_out_alpha: bytes = None, spend_key: bytes = None, ) -> None: self.src_entr = src_entr self.vini = vini self.vini_hmac = vini_hmac self.pseudo_out = pseudo_out self.pseudo_out_hmac = pseudo_out_hmac self.pseudo_out_alpha = pseudo_out_alpha self.spend_key = spend_key @classmethod def get_fields(cls) -> Dict: return { 1: ('src_entr', MoneroTransactionSourceEntry, 0), 2: ('vini', p.BytesType, 0), 3: ('vini_hmac', p.BytesType, 0), 4: ('pseudo_out', p.BytesType, 0), 5: ('pseudo_out_hmac', p.BytesType, 0), 6: ('pseudo_out_alpha', p.BytesType, 0), 7: ('spend_key', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/MoneroTransactionSourceEntry.py000066400000000000000000000034501361427340300273040ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .MoneroMultisigKLRki import MoneroMultisigKLRki from .MoneroOutputEntry import MoneroOutputEntry if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroTransactionSourceEntry(p.MessageType): def __init__( self, outputs: List[MoneroOutputEntry] = None, real_output: int = None, real_out_tx_key: bytes = None, real_out_additional_tx_keys: List[bytes] = None, real_output_in_tx_index: int = None, amount: int = None, rct: bool = None, mask: bytes = None, multisig_kLRki: MoneroMultisigKLRki = None, ) -> None: self.outputs = outputs if outputs is not None else [] self.real_output = real_output self.real_out_tx_key = real_out_tx_key self.real_out_additional_tx_keys = real_out_additional_tx_keys if real_out_additional_tx_keys is not None else [] self.real_output_in_tx_index = real_output_in_tx_index self.amount = amount self.rct = rct self.mask = mask self.multisig_kLRki = multisig_kLRki @classmethod def get_fields(cls) -> Dict: return { 1: ('outputs', MoneroOutputEntry, p.FLAG_REPEATED), 2: ('real_output', p.UVarintType, 0), 3: ('real_out_tx_key', p.BytesType, 0), 4: ('real_out_additional_tx_keys', p.BytesType, p.FLAG_REPEATED), 5: ('real_output_in_tx_index', p.UVarintType, 0), 6: ('amount', p.UVarintType, 0), 7: ('rct', p.BoolType, 0), 8: ('mask', p.BytesType, 0), 9: ('multisig_kLRki', MoneroMultisigKLRki, 0), } python-trezor-0.11.6/src/trezorlib/messages/MoneroTransferDetails.py000066400000000000000000000020161361427340300257030ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroTransferDetails(p.MessageType): def __init__( self, out_key: bytes = None, tx_pub_key: bytes = None, additional_tx_pub_keys: List[bytes] = None, internal_output_index: int = None, ) -> None: self.out_key = out_key self.tx_pub_key = tx_pub_key self.additional_tx_pub_keys = additional_tx_pub_keys if additional_tx_pub_keys is not None else [] self.internal_output_index = internal_output_index @classmethod def get_fields(cls) -> Dict: return { 1: ('out_key', p.BytesType, 0), 2: ('tx_pub_key', p.BytesType, 0), 3: ('additional_tx_pub_keys', p.BytesType, p.FLAG_REPEATED), 4: ('internal_output_index', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/MoneroWatchKey.py000066400000000000000000000012251361427340300243310ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MoneroWatchKey(p.MessageType): MESSAGE_WIRE_TYPE = 543 def __init__( self, watch_key: bytes = None, address: bytes = None, ) -> None: self.watch_key = watch_key self.address = address @classmethod def get_fields(cls) -> Dict: return { 1: ('watch_key', p.BytesType, 0), 2: ('address', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/MultisigRedeemScriptType.py000066400000000000000000000023331361427340300264010ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .HDNodePathType import HDNodePathType from .HDNodeType import HDNodeType if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class MultisigRedeemScriptType(p.MessageType): def __init__( self, pubkeys: List[HDNodePathType] = None, signatures: List[bytes] = None, m: int = None, nodes: List[HDNodeType] = None, address_n: List[int] = None, ) -> None: self.pubkeys = pubkeys if pubkeys is not None else [] self.signatures = signatures if signatures is not None else [] self.m = m self.nodes = nodes if nodes is not None else [] self.address_n = address_n if address_n is not None else [] @classmethod def get_fields(cls) -> Dict: return { 1: ('pubkeys', HDNodePathType, p.FLAG_REPEATED), 2: ('signatures', p.BytesType, p.FLAG_REPEATED), 3: ('m', p.UVarintType, 0), 4: ('nodes', HDNodeType, p.FLAG_REPEATED), 5: ('address_n', p.UVarintType, p.FLAG_REPEATED), } python-trezor-0.11.6/src/trezorlib/messages/NEMAddress.py000066400000000000000000000010521361427340300233550ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class NEMAddress(p.MessageType): MESSAGE_WIRE_TYPE = 68 def __init__( self, address: str = None, ) -> None: self.address = address @classmethod def get_fields(cls) -> Dict: return { 1: ('address', p.UnicodeType, 0), # required } python-trezor-0.11.6/src/trezorlib/messages/NEMAggregateModification.py000066400000000000000000000015241361427340300262100ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .NEMCosignatoryModification import NEMCosignatoryModification if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class NEMAggregateModification(p.MessageType): def __init__( self, modifications: List[NEMCosignatoryModification] = None, relative_change: int = None, ) -> None: self.modifications = modifications if modifications is not None else [] self.relative_change = relative_change @classmethod def get_fields(cls) -> Dict: return { 1: ('modifications', NEMCosignatoryModification, p.FLAG_REPEATED), 2: ('relative_change', p.SVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/NEMCosignatoryModification.py000066400000000000000000000013451361427340300266240ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeNEMModificationType = Literal[1, 2] except ImportError: pass class NEMCosignatoryModification(p.MessageType): def __init__( self, type: EnumTypeNEMModificationType = None, public_key: bytes = None, ) -> None: self.type = type self.public_key = public_key @classmethod def get_fields(cls) -> Dict: return { 1: ('type', p.EnumType("NEMModificationType", (1, 2)), 0), 2: ('public_key', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/NEMDecryptMessage.py000066400000000000000000000016541361427340300247170ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class NEMDecryptMessage(p.MessageType): MESSAGE_WIRE_TYPE = 75 def __init__( self, address_n: List[int] = None, network: int = None, public_key: bytes = None, payload: bytes = None, ) -> None: self.address_n = address_n if address_n is not None else [] self.network = network self.public_key = public_key self.payload = payload @classmethod def get_fields(cls) -> Dict: return { 1: ('address_n', p.UVarintType, p.FLAG_REPEATED), 2: ('network', p.UVarintType, 0), 3: ('public_key', p.BytesType, 0), 4: ('payload', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/NEMDecryptedMessage.py000066400000000000000000000010471361427340300252240ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class NEMDecryptedMessage(p.MessageType): MESSAGE_WIRE_TYPE = 76 def __init__( self, payload: bytes = None, ) -> None: self.payload = payload @classmethod def get_fields(cls) -> Dict: return { 1: ('payload', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/NEMGetAddress.py000066400000000000000000000015041361427340300240170ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class NEMGetAddress(p.MessageType): MESSAGE_WIRE_TYPE = 67 def __init__( self, address_n: List[int] = None, network: int = None, show_display: bool = None, ) -> None: self.address_n = address_n if address_n is not None else [] self.network = network self.show_display = show_display @classmethod def get_fields(cls) -> Dict: return { 1: ('address_n', p.UVarintType, p.FLAG_REPEATED), 2: ('network', p.UVarintType, 0), 3: ('show_display', p.BoolType, 0), } python-trezor-0.11.6/src/trezorlib/messages/NEMImportanceTransfer.py000066400000000000000000000013621361427340300256020ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeNEMImportanceTransferMode = Literal[1, 2] except ImportError: pass class NEMImportanceTransfer(p.MessageType): def __init__( self, mode: EnumTypeNEMImportanceTransferMode = None, public_key: bytes = None, ) -> None: self.mode = mode self.public_key = public_key @classmethod def get_fields(cls) -> Dict: return { 1: ('mode', p.EnumType("NEMImportanceTransferMode", (1, 2)), 0), 2: ('public_key', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/NEMImportanceTransferMode.py000066400000000000000000000003151361427340300264040ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off if False: from typing_extensions import Literal ImportanceTransfer_Activate = 1 # type: Literal[1] ImportanceTransfer_Deactivate = 2 # type: Literal[2] python-trezor-0.11.6/src/trezorlib/messages/NEMModificationType.py000066400000000000000000000003161361427340300252410ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off if False: from typing_extensions import Literal CosignatoryModification_Add = 1 # type: Literal[1] CosignatoryModification_Delete = 2 # type: Literal[2] python-trezor-0.11.6/src/trezorlib/messages/NEMMosaic.py000066400000000000000000000013361361427340300232100ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class NEMMosaic(p.MessageType): def __init__( self, namespace: str = None, mosaic: str = None, quantity: int = None, ) -> None: self.namespace = namespace self.mosaic = mosaic self.quantity = quantity @classmethod def get_fields(cls) -> Dict: return { 1: ('namespace', p.UnicodeType, 0), 2: ('mosaic', p.UnicodeType, 0), 3: ('quantity', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/NEMMosaicCreation.py000066400000000000000000000014321361427340300246720ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .NEMMosaicDefinition import NEMMosaicDefinition if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class NEMMosaicCreation(p.MessageType): def __init__( self, definition: NEMMosaicDefinition = None, sink: str = None, fee: int = None, ) -> None: self.definition = definition self.sink = sink self.fee = fee @classmethod def get_fields(cls) -> Dict: return { 1: ('definition', NEMMosaicDefinition, 0), 2: ('sink', p.UnicodeType, 0), 3: ('fee', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/NEMMosaicDefinition.py000066400000000000000000000043201361427340300252150ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeNEMMosaicLevy = Literal[1, 2] except ImportError: pass class NEMMosaicDefinition(p.MessageType): def __init__( self, name: str = None, ticker: str = None, namespace: str = None, mosaic: str = None, divisibility: int = None, levy: EnumTypeNEMMosaicLevy = None, fee: int = None, levy_address: str = None, levy_namespace: str = None, levy_mosaic: str = None, supply: int = None, mutable_supply: bool = None, transferable: bool = None, description: str = None, networks: List[int] = None, ) -> None: self.name = name self.ticker = ticker self.namespace = namespace self.mosaic = mosaic self.divisibility = divisibility self.levy = levy self.fee = fee self.levy_address = levy_address self.levy_namespace = levy_namespace self.levy_mosaic = levy_mosaic self.supply = supply self.mutable_supply = mutable_supply self.transferable = transferable self.description = description self.networks = networks if networks is not None else [] @classmethod def get_fields(cls) -> Dict: return { 1: ('name', p.UnicodeType, 0), 2: ('ticker', p.UnicodeType, 0), 3: ('namespace', p.UnicodeType, 0), 4: ('mosaic', p.UnicodeType, 0), 5: ('divisibility', p.UVarintType, 0), 6: ('levy', p.EnumType("NEMMosaicLevy", (1, 2)), 0), 7: ('fee', p.UVarintType, 0), 8: ('levy_address', p.UnicodeType, 0), 9: ('levy_namespace', p.UnicodeType, 0), 10: ('levy_mosaic', p.UnicodeType, 0), 11: ('supply', p.UVarintType, 0), 12: ('mutable_supply', p.BoolType, 0), 13: ('transferable', p.BoolType, 0), 14: ('description', p.UnicodeType, 0), 15: ('networks', p.UVarintType, p.FLAG_REPEATED), } python-trezor-0.11.6/src/trezorlib/messages/NEMMosaicLevy.py000066400000000000000000000002751361427340300240510ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off if False: from typing_extensions import Literal MosaicLevy_Absolute = 1 # type: Literal[1] MosaicLevy_Percentile = 2 # type: Literal[2] python-trezor-0.11.6/src/trezorlib/messages/NEMMosaicSupplyChange.py000066400000000000000000000016441361427340300255350ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeNEMSupplyChangeType = Literal[1, 2] except ImportError: pass class NEMMosaicSupplyChange(p.MessageType): def __init__( self, namespace: str = None, mosaic: str = None, type: EnumTypeNEMSupplyChangeType = None, delta: int = None, ) -> None: self.namespace = namespace self.mosaic = mosaic self.type = type self.delta = delta @classmethod def get_fields(cls) -> Dict: return { 1: ('namespace', p.UnicodeType, 0), 2: ('mosaic', p.UnicodeType, 0), 3: ('type', p.EnumType("NEMSupplyChangeType", (1, 2)), 0), 4: ('delta', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/NEMProvisionNamespace.py000066400000000000000000000014641361427340300256040ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class NEMProvisionNamespace(p.MessageType): def __init__( self, namespace: str = None, parent: str = None, sink: str = None, fee: int = None, ) -> None: self.namespace = namespace self.parent = parent self.sink = sink self.fee = fee @classmethod def get_fields(cls) -> Dict: return { 1: ('namespace', p.UnicodeType, 0), 2: ('parent', p.UnicodeType, 0), 3: ('sink', p.UnicodeType, 0), 4: ('fee', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/NEMSignTx.py000066400000000000000000000042151361427340300232100ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .NEMAggregateModification import NEMAggregateModification from .NEMImportanceTransfer import NEMImportanceTransfer from .NEMMosaicCreation import NEMMosaicCreation from .NEMMosaicSupplyChange import NEMMosaicSupplyChange from .NEMProvisionNamespace import NEMProvisionNamespace from .NEMTransactionCommon import NEMTransactionCommon from .NEMTransfer import NEMTransfer if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class NEMSignTx(p.MessageType): MESSAGE_WIRE_TYPE = 69 def __init__( self, transaction: NEMTransactionCommon = None, multisig: NEMTransactionCommon = None, transfer: NEMTransfer = None, cosigning: bool = None, provision_namespace: NEMProvisionNamespace = None, mosaic_creation: NEMMosaicCreation = None, supply_change: NEMMosaicSupplyChange = None, aggregate_modification: NEMAggregateModification = None, importance_transfer: NEMImportanceTransfer = None, ) -> None: self.transaction = transaction self.multisig = multisig self.transfer = transfer self.cosigning = cosigning self.provision_namespace = provision_namespace self.mosaic_creation = mosaic_creation self.supply_change = supply_change self.aggregate_modification = aggregate_modification self.importance_transfer = importance_transfer @classmethod def get_fields(cls) -> Dict: return { 1: ('transaction', NEMTransactionCommon, 0), 2: ('multisig', NEMTransactionCommon, 0), 3: ('transfer', NEMTransfer, 0), 4: ('cosigning', p.BoolType, 0), 5: ('provision_namespace', NEMProvisionNamespace, 0), 6: ('mosaic_creation', NEMMosaicCreation, 0), 7: ('supply_change', NEMMosaicSupplyChange, 0), 8: ('aggregate_modification', NEMAggregateModification, 0), 9: ('importance_transfer', NEMImportanceTransfer, 0), } python-trezor-0.11.6/src/trezorlib/messages/NEMSignedTx.py000066400000000000000000000012051361427340300235150ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class NEMSignedTx(p.MessageType): MESSAGE_WIRE_TYPE = 70 def __init__( self, data: bytes = None, signature: bytes = None, ) -> None: self.data = data self.signature = signature @classmethod def get_fields(cls) -> Dict: return { 1: ('data', p.BytesType, 0), 2: ('signature', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/NEMSupplyChangeType.py000066400000000000000000000002771361427340300252440ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off if False: from typing_extensions import Literal SupplyChange_Increase = 1 # type: Literal[1] SupplyChange_Decrease = 2 # type: Literal[2] python-trezor-0.11.6/src/trezorlib/messages/NEMTransactionCommon.py000066400000000000000000000021241361427340300254270ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class NEMTransactionCommon(p.MessageType): def __init__( self, address_n: List[int] = None, network: int = None, timestamp: int = None, fee: int = None, deadline: int = None, signer: bytes = None, ) -> None: self.address_n = address_n if address_n is not None else [] self.network = network self.timestamp = timestamp self.fee = fee self.deadline = deadline self.signer = signer @classmethod def get_fields(cls) -> Dict: return { 1: ('address_n', p.UVarintType, p.FLAG_REPEATED), 2: ('network', p.UVarintType, 0), 3: ('timestamp', p.UVarintType, 0), 4: ('fee', p.UVarintType, 0), 5: ('deadline', p.UVarintType, 0), 6: ('signer', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/NEMTransfer.py000066400000000000000000000020231361427340300235530ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .NEMMosaic import NEMMosaic if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class NEMTransfer(p.MessageType): def __init__( self, recipient: str = None, amount: int = None, payload: bytes = None, public_key: bytes = None, mosaics: List[NEMMosaic] = None, ) -> None: self.recipient = recipient self.amount = amount self.payload = payload self.public_key = public_key self.mosaics = mosaics if mosaics is not None else [] @classmethod def get_fields(cls) -> Dict: return { 1: ('recipient', p.UnicodeType, 0), 2: ('amount', p.UVarintType, 0), 3: ('payload', p.BytesType, 0), 4: ('public_key', p.BytesType, 0), 5: ('mosaics', NEMMosaic, p.FLAG_REPEATED), } python-trezor-0.11.6/src/trezorlib/messages/NextU2FCounter.py000066400000000000000000000010621361427340300242240ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class NextU2FCounter(p.MessageType): MESSAGE_WIRE_TYPE = 81 def __init__( self, u2f_counter: int = None, ) -> None: self.u2f_counter = u2f_counter @classmethod def get_fields(cls) -> Dict: return { 1: ('u2f_counter', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/OutputScriptType.py000066400000000000000000000005121361427340300247570ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off if False: from typing_extensions import Literal PAYTOADDRESS = 0 # type: Literal[0] PAYTOSCRIPTHASH = 1 # type: Literal[1] PAYTOMULTISIG = 2 # type: Literal[2] PAYTOOPRETURN = 3 # type: Literal[3] PAYTOWITNESS = 4 # type: Literal[4] PAYTOP2SHWITNESS = 5 # type: Literal[5] python-trezor-0.11.6/src/trezorlib/messages/PassphraseAck.py000066400000000000000000000012171361427340300241630ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class PassphraseAck(p.MessageType): MESSAGE_WIRE_TYPE = 42 def __init__( self, passphrase: str = None, state: bytes = None, ) -> None: self.passphrase = passphrase self.state = state @classmethod def get_fields(cls) -> Dict: return { 1: ('passphrase', p.UnicodeType, 0), 2: ('state', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/PassphraseRequest.py000066400000000000000000000010531361427340300251130ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class PassphraseRequest(p.MessageType): MESSAGE_WIRE_TYPE = 41 def __init__( self, on_device: bool = None, ) -> None: self.on_device = on_device @classmethod def get_fields(cls) -> Dict: return { 1: ('on_device', p.BoolType, 0), } python-trezor-0.11.6/src/trezorlib/messages/PassphraseSourceType.py000066400000000000000000000002731361427340300255700ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off if False: from typing_extensions import Literal ASK = 0 # type: Literal[0] DEVICE = 1 # type: Literal[1] HOST = 2 # type: Literal[2] python-trezor-0.11.6/src/trezorlib/messages/PassphraseStateAck.py000066400000000000000000000004761361427340300251720ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class PassphraseStateAck(p.MessageType): MESSAGE_WIRE_TYPE = 78 python-trezor-0.11.6/src/trezorlib/messages/PassphraseStateRequest.py000066400000000000000000000010421361427340300261120ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class PassphraseStateRequest(p.MessageType): MESSAGE_WIRE_TYPE = 77 def __init__( self, state: bytes = None, ) -> None: self.state = state @classmethod def get_fields(cls) -> Dict: return { 1: ('state', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/PinMatrixAck.py000066400000000000000000000010341361427340300237620ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class PinMatrixAck(p.MessageType): MESSAGE_WIRE_TYPE = 19 def __init__( self, pin: str = None, ) -> None: self.pin = pin @classmethod def get_fields(cls) -> Dict: return { 1: ('pin', p.UnicodeType, 0), # required } python-trezor-0.11.6/src/trezorlib/messages/PinMatrixRequest.py000066400000000000000000000012251361427340300247160ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypePinMatrixRequestType = Literal[1, 2, 3, 4, 5] except ImportError: pass class PinMatrixRequest(p.MessageType): MESSAGE_WIRE_TYPE = 18 def __init__( self, type: EnumTypePinMatrixRequestType = None, ) -> None: self.type = type @classmethod def get_fields(cls) -> Dict: return { 1: ('type', p.EnumType("PinMatrixRequestType", (1, 2, 3, 4, 5)), 0), } python-trezor-0.11.6/src/trezorlib/messages/PinMatrixRequestType.py000066400000000000000000000004231361427340300255570ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off if False: from typing_extensions import Literal Current = 1 # type: Literal[1] NewFirst = 2 # type: Literal[2] NewSecond = 3 # type: Literal[3] WipeCodeFirst = 4 # type: Literal[4] WipeCodeSecond = 5 # type: Literal[5] python-trezor-0.11.6/src/trezorlib/messages/Ping.py000066400000000000000000000017131361427340300223310ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class Ping(p.MessageType): MESSAGE_WIRE_TYPE = 1 def __init__( self, message: str = None, button_protection: bool = None, pin_protection: bool = None, passphrase_protection: bool = None, ) -> None: self.message = message self.button_protection = button_protection self.pin_protection = pin_protection self.passphrase_protection = passphrase_protection @classmethod def get_fields(cls) -> Dict: return { 1: ('message', p.UnicodeType, 0), 2: ('button_protection', p.BoolType, 0), 3: ('pin_protection', p.BoolType, 0), 4: ('passphrase_protection', p.BoolType, 0), } python-trezor-0.11.6/src/trezorlib/messages/PublicKey.py000066400000000000000000000012271361427340300233230ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .HDNodeType import HDNodeType if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class PublicKey(p.MessageType): MESSAGE_WIRE_TYPE = 12 def __init__( self, node: HDNodeType = None, xpub: str = None, ) -> None: self.node = node self.xpub = xpub @classmethod def get_fields(cls) -> Dict: return { 1: ('node', HDNodeType, 0), 2: ('xpub', p.UnicodeType, 0), } python-trezor-0.11.6/src/trezorlib/messages/RecoveryDevice.py000066400000000000000000000031451361427340300243530ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeRecoveryDeviceType = Literal[0, 1] except ImportError: pass class RecoveryDevice(p.MessageType): MESSAGE_WIRE_TYPE = 45 def __init__( self, word_count: int = None, passphrase_protection: bool = None, pin_protection: bool = None, language: str = None, label: str = None, enforce_wordlist: bool = None, type: EnumTypeRecoveryDeviceType = None, u2f_counter: int = None, dry_run: bool = None, ) -> None: self.word_count = word_count self.passphrase_protection = passphrase_protection self.pin_protection = pin_protection self.language = language self.label = label self.enforce_wordlist = enforce_wordlist self.type = type self.u2f_counter = u2f_counter self.dry_run = dry_run @classmethod def get_fields(cls) -> Dict: return { 1: ('word_count', p.UVarintType, 0), 2: ('passphrase_protection', p.BoolType, 0), 3: ('pin_protection', p.BoolType, 0), 4: ('language', p.UnicodeType, 0), # default=en-US 5: ('label', p.UnicodeType, 0), 6: ('enforce_wordlist', p.BoolType, 0), 8: ('type', p.EnumType("RecoveryDeviceType", (0, 1)), 0), 9: ('u2f_counter', p.UVarintType, 0), 10: ('dry_run', p.BoolType, 0), } python-trezor-0.11.6/src/trezorlib/messages/RecoveryDeviceType.py000066400000000000000000000002511361427340300252100ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off if False: from typing_extensions import Literal ScrambledWords = 0 # type: Literal[0] Matrix = 1 # type: Literal[1] python-trezor-0.11.6/src/trezorlib/messages/RequestType.py000066400000000000000000000004121361427340300237210ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off if False: from typing_extensions import Literal TXINPUT = 0 # type: Literal[0] TXOUTPUT = 1 # type: Literal[1] TXMETA = 2 # type: Literal[2] TXFINISHED = 3 # type: Literal[3] TXEXTRADATA = 4 # type: Literal[4] python-trezor-0.11.6/src/trezorlib/messages/ResetDevice.py000066400000000000000000000033741361427340300236430ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeBackupType = Literal[0, 1, 2] except ImportError: pass class ResetDevice(p.MessageType): MESSAGE_WIRE_TYPE = 14 def __init__( self, display_random: bool = None, strength: int = None, passphrase_protection: bool = None, pin_protection: bool = None, language: str = None, label: str = None, u2f_counter: int = None, skip_backup: bool = None, no_backup: bool = None, backup_type: EnumTypeBackupType = None, ) -> None: self.display_random = display_random self.strength = strength self.passphrase_protection = passphrase_protection self.pin_protection = pin_protection self.language = language self.label = label self.u2f_counter = u2f_counter self.skip_backup = skip_backup self.no_backup = no_backup self.backup_type = backup_type @classmethod def get_fields(cls) -> Dict: return { 1: ('display_random', p.BoolType, 0), 2: ('strength', p.UVarintType, 0), # default=256 3: ('passphrase_protection', p.BoolType, 0), 4: ('pin_protection', p.BoolType, 0), 5: ('language', p.UnicodeType, 0), # default=en-US 6: ('label', p.UnicodeType, 0), 7: ('u2f_counter', p.UVarintType, 0), 8: ('skip_backup', p.BoolType, 0), 9: ('no_backup', p.BoolType, 0), 10: ('backup_type', p.EnumType("BackupType", (0, 1, 2)), 0), # default=Bip39 } python-trezor-0.11.6/src/trezorlib/messages/RippleAddress.py000066400000000000000000000010421361427340300241700ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class RippleAddress(p.MessageType): MESSAGE_WIRE_TYPE = 401 def __init__( self, address: str = None, ) -> None: self.address = address @classmethod def get_fields(cls) -> Dict: return { 1: ('address', p.UnicodeType, 0), } python-trezor-0.11.6/src/trezorlib/messages/RippleGetAddress.py000066400000000000000000000013361361427340300246360ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class RippleGetAddress(p.MessageType): MESSAGE_WIRE_TYPE = 400 def __init__( self, address_n: List[int] = None, show_display: bool = None, ) -> None: self.address_n = address_n if address_n is not None else [] self.show_display = show_display @classmethod def get_fields(cls) -> Dict: return { 1: ('address_n', p.UVarintType, p.FLAG_REPEATED), 2: ('show_display', p.BoolType, 0), } python-trezor-0.11.6/src/trezorlib/messages/RipplePayment.py000066400000000000000000000014061361427340300242240ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class RipplePayment(p.MessageType): def __init__( self, amount: int = None, destination: str = None, destination_tag: int = None, ) -> None: self.amount = amount self.destination = destination self.destination_tag = destination_tag @classmethod def get_fields(cls) -> Dict: return { 1: ('amount', p.UVarintType, 0), 2: ('destination', p.UnicodeType, 0), 3: ('destination_tag', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/RippleSignTx.py000066400000000000000000000023041361427340300240210ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .RipplePayment import RipplePayment if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class RippleSignTx(p.MessageType): MESSAGE_WIRE_TYPE = 402 def __init__( self, address_n: List[int] = None, fee: int = None, flags: int = None, sequence: int = None, last_ledger_sequence: int = None, payment: RipplePayment = None, ) -> None: self.address_n = address_n if address_n is not None else [] self.fee = fee self.flags = flags self.sequence = sequence self.last_ledger_sequence = last_ledger_sequence self.payment = payment @classmethod def get_fields(cls) -> Dict: return { 1: ('address_n', p.UVarintType, p.FLAG_REPEATED), 2: ('fee', p.UVarintType, 0), 3: ('flags', p.UVarintType, 0), 4: ('sequence', p.UVarintType, 0), 5: ('last_ledger_sequence', p.UVarintType, 0), 6: ('payment', RipplePayment, 0), } python-trezor-0.11.6/src/trezorlib/messages/RippleSignedTx.py000066400000000000000000000012551361427340300243360ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class RippleSignedTx(p.MessageType): MESSAGE_WIRE_TYPE = 403 def __init__( self, signature: bytes = None, serialized_tx: bytes = None, ) -> None: self.signature = signature self.serialized_tx = serialized_tx @classmethod def get_fields(cls) -> Dict: return { 1: ('signature', p.BytesType, 0), 2: ('serialized_tx', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/SdProtect.py000066400000000000000000000012341361427340300233410ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeSdProtectOperationType = Literal[0, 1, 2] except ImportError: pass class SdProtect(p.MessageType): MESSAGE_WIRE_TYPE = 79 def __init__( self, operation: EnumTypeSdProtectOperationType = None, ) -> None: self.operation = operation @classmethod def get_fields(cls) -> Dict: return { 1: ('operation', p.EnumType("SdProtectOperationType", (0, 1, 2)), 0), } python-trezor-0.11.6/src/trezorlib/messages/SdProtectOperationType.py000066400000000000000000000003021361427340300260570ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off if False: from typing_extensions import Literal DISABLE = 0 # type: Literal[0] ENABLE = 1 # type: Literal[1] REFRESH = 2 # type: Literal[2] python-trezor-0.11.6/src/trezorlib/messages/SelfTest.py000066400000000000000000000010341361427340300231610ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class SelfTest(p.MessageType): MESSAGE_WIRE_TYPE = 32 def __init__( self, payload: bytes = None, ) -> None: self.payload = payload @classmethod def get_fields(cls) -> Dict: return { 1: ('payload', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/SetU2FCounter.py000066400000000000000000000010611361427340300240400ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class SetU2FCounter(p.MessageType): MESSAGE_WIRE_TYPE = 63 def __init__( self, u2f_counter: int = None, ) -> None: self.u2f_counter = u2f_counter @classmethod def get_fields(cls) -> Dict: return { 1: ('u2f_counter', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/SignIdentity.py000066400000000000000000000017761361427340300240570ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .IdentityType import IdentityType if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class SignIdentity(p.MessageType): MESSAGE_WIRE_TYPE = 53 def __init__( self, identity: IdentityType = None, challenge_hidden: bytes = None, challenge_visual: str = None, ecdsa_curve_name: str = None, ) -> None: self.identity = identity self.challenge_hidden = challenge_hidden self.challenge_visual = challenge_visual self.ecdsa_curve_name = ecdsa_curve_name @classmethod def get_fields(cls) -> Dict: return { 1: ('identity', IdentityType, 0), 2: ('challenge_hidden', p.BytesType, 0), 3: ('challenge_visual', p.UnicodeType, 0), 4: ('ecdsa_curve_name', p.UnicodeType, 0), } python-trezor-0.11.6/src/trezorlib/messages/SignMessage.py000066400000000000000000000021271361427340300236410ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeInputScriptType = Literal[0, 1, 2, 3, 4] except ImportError: pass class SignMessage(p.MessageType): MESSAGE_WIRE_TYPE = 38 def __init__( self, address_n: List[int] = None, message: bytes = None, coin_name: str = None, script_type: EnumTypeInputScriptType = None, ) -> None: self.address_n = address_n if address_n is not None else [] self.message = message self.coin_name = coin_name self.script_type = script_type @classmethod def get_fields(cls) -> Dict: return { 1: ('address_n', p.UVarintType, p.FLAG_REPEATED), 2: ('message', p.BytesType, 0), # required 3: ('coin_name', p.UnicodeType, 0), # default=Bitcoin 4: ('script_type', p.EnumType("InputScriptType", (0, 1, 2, 3, 4)), 0), # default=SPENDADDRESS } python-trezor-0.11.6/src/trezorlib/messages/SignTx.py000066400000000000000000000032301361427340300226440ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class SignTx(p.MessageType): MESSAGE_WIRE_TYPE = 15 def __init__( self, outputs_count: int = None, inputs_count: int = None, coin_name: str = None, version: int = None, lock_time: int = None, expiry: int = None, overwintered: bool = None, version_group_id: int = None, timestamp: int = None, branch_id: int = None, ) -> None: self.outputs_count = outputs_count self.inputs_count = inputs_count self.coin_name = coin_name self.version = version self.lock_time = lock_time self.expiry = expiry self.overwintered = overwintered self.version_group_id = version_group_id self.timestamp = timestamp self.branch_id = branch_id @classmethod def get_fields(cls) -> Dict: return { 1: ('outputs_count', p.UVarintType, 0), # required 2: ('inputs_count', p.UVarintType, 0), # required 3: ('coin_name', p.UnicodeType, 0), # default=Bitcoin 4: ('version', p.UVarintType, 0), # default=1 5: ('lock_time', p.UVarintType, 0), # default=0 6: ('expiry', p.UVarintType, 0), 7: ('overwintered', p.BoolType, 0), 8: ('version_group_id', p.UVarintType, 0), 9: ('timestamp', p.UVarintType, 0), 10: ('branch_id', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/SignedIdentity.py000066400000000000000000000014121361427340300243530ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class SignedIdentity(p.MessageType): MESSAGE_WIRE_TYPE = 54 def __init__( self, address: str = None, public_key: bytes = None, signature: bytes = None, ) -> None: self.address = address self.public_key = public_key self.signature = signature @classmethod def get_fields(cls) -> Dict: return { 1: ('address', p.UnicodeType, 0), 2: ('public_key', p.BytesType, 0), 3: ('signature', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/StellarAccountMergeOp.py000066400000000000000000000013401361427340300256320ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class StellarAccountMergeOp(p.MessageType): MESSAGE_WIRE_TYPE = 218 def __init__( self, source_account: str = None, destination_account: str = None, ) -> None: self.source_account = source_account self.destination_account = destination_account @classmethod def get_fields(cls) -> Dict: return { 1: ('source_account', p.UnicodeType, 0), 2: ('destination_account', p.UnicodeType, 0), } python-trezor-0.11.6/src/trezorlib/messages/StellarAddress.py000066400000000000000000000010431361427340300243440ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class StellarAddress(p.MessageType): MESSAGE_WIRE_TYPE = 208 def __init__( self, address: str = None, ) -> None: self.address = address @classmethod def get_fields(cls) -> Dict: return { 1: ('address', p.UnicodeType, 0), } python-trezor-0.11.6/src/trezorlib/messages/StellarAllowTrustOp.py000066400000000000000000000020741361427340300254030ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class StellarAllowTrustOp(p.MessageType): MESSAGE_WIRE_TYPE = 217 def __init__( self, source_account: str = None, trusted_account: str = None, asset_type: int = None, asset_code: str = None, is_authorized: int = None, ) -> None: self.source_account = source_account self.trusted_account = trusted_account self.asset_type = asset_type self.asset_code = asset_code self.is_authorized = is_authorized @classmethod def get_fields(cls) -> Dict: return { 1: ('source_account', p.UnicodeType, 0), 2: ('trusted_account', p.UnicodeType, 0), 3: ('asset_type', p.UVarintType, 0), 4: ('asset_code', p.UnicodeType, 0), 5: ('is_authorized', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/StellarAssetType.py000066400000000000000000000013011361427340300246750ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class StellarAssetType(p.MessageType): def __init__( self, type: int = None, code: str = None, issuer: str = None, ) -> None: self.type = type self.code = code self.issuer = issuer @classmethod def get_fields(cls) -> Dict: return { 1: ('type', p.UVarintType, 0), 2: ('code', p.UnicodeType, 0), 3: ('issuer', p.UnicodeType, 0), } python-trezor-0.11.6/src/trezorlib/messages/StellarBumpSequenceOp.py000066400000000000000000000012601361427340300256530ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class StellarBumpSequenceOp(p.MessageType): MESSAGE_WIRE_TYPE = 221 def __init__( self, source_account: str = None, bump_to: int = None, ) -> None: self.source_account = source_account self.bump_to = bump_to @classmethod def get_fields(cls) -> Dict: return { 1: ('source_account', p.UnicodeType, 0), 2: ('bump_to', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/StellarChangeTrustOp.py000066400000000000000000000015111361427340300255050ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .StellarAssetType import StellarAssetType if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class StellarChangeTrustOp(p.MessageType): MESSAGE_WIRE_TYPE = 216 def __init__( self, source_account: str = None, asset: StellarAssetType = None, limit: int = None, ) -> None: self.source_account = source_account self.asset = asset self.limit = limit @classmethod def get_fields(cls) -> Dict: return { 1: ('source_account', p.UnicodeType, 0), 2: ('asset', StellarAssetType, 0), 3: ('limit', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/StellarCreateAccountOp.py000066400000000000000000000015171361427340300260040ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class StellarCreateAccountOp(p.MessageType): MESSAGE_WIRE_TYPE = 210 def __init__( self, source_account: str = None, new_account: str = None, starting_balance: int = None, ) -> None: self.source_account = source_account self.new_account = new_account self.starting_balance = starting_balance @classmethod def get_fields(cls) -> Dict: return { 1: ('source_account', p.UnicodeType, 0), 2: ('new_account', p.UnicodeType, 0), 3: ('starting_balance', p.SVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/StellarCreatePassiveOfferOp.py000066400000000000000000000023261361427340300270030ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .StellarAssetType import StellarAssetType if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class StellarCreatePassiveOfferOp(p.MessageType): MESSAGE_WIRE_TYPE = 214 def __init__( self, source_account: str = None, selling_asset: StellarAssetType = None, buying_asset: StellarAssetType = None, amount: int = None, price_n: int = None, price_d: int = None, ) -> None: self.source_account = source_account self.selling_asset = selling_asset self.buying_asset = buying_asset self.amount = amount self.price_n = price_n self.price_d = price_d @classmethod def get_fields(cls) -> Dict: return { 1: ('source_account', p.UnicodeType, 0), 2: ('selling_asset', StellarAssetType, 0), 3: ('buying_asset', StellarAssetType, 0), 4: ('amount', p.SVarintType, 0), 5: ('price_n', p.UVarintType, 0), 6: ('price_d', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/StellarGetAddress.py000066400000000000000000000013371361427340300250120ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class StellarGetAddress(p.MessageType): MESSAGE_WIRE_TYPE = 207 def __init__( self, address_n: List[int] = None, show_display: bool = None, ) -> None: self.address_n = address_n if address_n is not None else [] self.show_display = show_display @classmethod def get_fields(cls) -> Dict: return { 1: ('address_n', p.UVarintType, p.FLAG_REPEATED), 2: ('show_display', p.BoolType, 0), } python-trezor-0.11.6/src/trezorlib/messages/StellarManageDataOp.py000066400000000000000000000014001361427340300252350ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class StellarManageDataOp(p.MessageType): MESSAGE_WIRE_TYPE = 220 def __init__( self, source_account: str = None, key: str = None, value: bytes = None, ) -> None: self.source_account = source_account self.key = key self.value = value @classmethod def get_fields(cls) -> Dict: return { 1: ('source_account', p.UnicodeType, 0), 2: ('key', p.UnicodeType, 0), 3: ('value', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/StellarManageOfferOp.py000066400000000000000000000024751361427340300254420ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .StellarAssetType import StellarAssetType if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class StellarManageOfferOp(p.MessageType): MESSAGE_WIRE_TYPE = 213 def __init__( self, source_account: str = None, selling_asset: StellarAssetType = None, buying_asset: StellarAssetType = None, amount: int = None, price_n: int = None, price_d: int = None, offer_id: int = None, ) -> None: self.source_account = source_account self.selling_asset = selling_asset self.buying_asset = buying_asset self.amount = amount self.price_n = price_n self.price_d = price_d self.offer_id = offer_id @classmethod def get_fields(cls) -> Dict: return { 1: ('source_account', p.UnicodeType, 0), 2: ('selling_asset', StellarAssetType, 0), 3: ('buying_asset', StellarAssetType, 0), 4: ('amount', p.SVarintType, 0), 5: ('price_n', p.UVarintType, 0), 6: ('price_d', p.UVarintType, 0), 7: ('offer_id', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/StellarPathPaymentOp.py000066400000000000000000000027361361427340300255220ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .StellarAssetType import StellarAssetType if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class StellarPathPaymentOp(p.MessageType): MESSAGE_WIRE_TYPE = 212 def __init__( self, source_account: str = None, send_asset: StellarAssetType = None, send_max: int = None, destination_account: str = None, destination_asset: StellarAssetType = None, destination_amount: int = None, paths: List[StellarAssetType] = None, ) -> None: self.source_account = source_account self.send_asset = send_asset self.send_max = send_max self.destination_account = destination_account self.destination_asset = destination_asset self.destination_amount = destination_amount self.paths = paths if paths is not None else [] @classmethod def get_fields(cls) -> Dict: return { 1: ('source_account', p.UnicodeType, 0), 2: ('send_asset', StellarAssetType, 0), 3: ('send_max', p.SVarintType, 0), 4: ('destination_account', p.UnicodeType, 0), 5: ('destination_asset', StellarAssetType, 0), 6: ('destination_amount', p.SVarintType, 0), 7: ('paths', StellarAssetType, p.FLAG_REPEATED), } python-trezor-0.11.6/src/trezorlib/messages/StellarPaymentOp.py000066400000000000000000000017431361427340300247020ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .StellarAssetType import StellarAssetType if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class StellarPaymentOp(p.MessageType): MESSAGE_WIRE_TYPE = 211 def __init__( self, source_account: str = None, destination_account: str = None, asset: StellarAssetType = None, amount: int = None, ) -> None: self.source_account = source_account self.destination_account = destination_account self.asset = asset self.amount = amount @classmethod def get_fields(cls) -> Dict: return { 1: ('source_account', p.UnicodeType, 0), 2: ('destination_account', p.UnicodeType, 0), 3: ('asset', StellarAssetType, 0), 4: ('amount', p.SVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/StellarSetOptionsOp.py000066400000000000000000000037711361427340300253770ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class StellarSetOptionsOp(p.MessageType): MESSAGE_WIRE_TYPE = 215 def __init__( self, source_account: str = None, inflation_destination_account: str = None, clear_flags: int = None, set_flags: int = None, master_weight: int = None, low_threshold: int = None, medium_threshold: int = None, high_threshold: int = None, home_domain: str = None, signer_type: int = None, signer_key: bytes = None, signer_weight: int = None, ) -> None: self.source_account = source_account self.inflation_destination_account = inflation_destination_account self.clear_flags = clear_flags self.set_flags = set_flags self.master_weight = master_weight self.low_threshold = low_threshold self.medium_threshold = medium_threshold self.high_threshold = high_threshold self.home_domain = home_domain self.signer_type = signer_type self.signer_key = signer_key self.signer_weight = signer_weight @classmethod def get_fields(cls) -> Dict: return { 1: ('source_account', p.UnicodeType, 0), 2: ('inflation_destination_account', p.UnicodeType, 0), 3: ('clear_flags', p.UVarintType, 0), 4: ('set_flags', p.UVarintType, 0), 5: ('master_weight', p.UVarintType, 0), 6: ('low_threshold', p.UVarintType, 0), 7: ('medium_threshold', p.UVarintType, 0), 8: ('high_threshold', p.UVarintType, 0), 9: ('home_domain', p.UnicodeType, 0), 10: ('signer_type', p.UVarintType, 0), 11: ('signer_key', p.BytesType, 0), 12: ('signer_weight', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/StellarSignTx.py000066400000000000000000000036761361427340300242110ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class StellarSignTx(p.MessageType): MESSAGE_WIRE_TYPE = 202 def __init__( self, address_n: List[int] = None, network_passphrase: str = None, source_account: str = None, fee: int = None, sequence_number: int = None, timebounds_start: int = None, timebounds_end: int = None, memo_type: int = None, memo_text: str = None, memo_id: int = None, memo_hash: bytes = None, num_operations: int = None, ) -> None: self.address_n = address_n if address_n is not None else [] self.network_passphrase = network_passphrase self.source_account = source_account self.fee = fee self.sequence_number = sequence_number self.timebounds_start = timebounds_start self.timebounds_end = timebounds_end self.memo_type = memo_type self.memo_text = memo_text self.memo_id = memo_id self.memo_hash = memo_hash self.num_operations = num_operations @classmethod def get_fields(cls) -> Dict: return { 2: ('address_n', p.UVarintType, p.FLAG_REPEATED), 3: ('network_passphrase', p.UnicodeType, 0), 4: ('source_account', p.UnicodeType, 0), 5: ('fee', p.UVarintType, 0), 6: ('sequence_number', p.UVarintType, 0), 8: ('timebounds_start', p.UVarintType, 0), 9: ('timebounds_end', p.UVarintType, 0), 10: ('memo_type', p.UVarintType, 0), 11: ('memo_text', p.UnicodeType, 0), 12: ('memo_id', p.UVarintType, 0), 13: ('memo_hash', p.BytesType, 0), 14: ('num_operations', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/StellarSignedTx.py000066400000000000000000000012421361427340300245050ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class StellarSignedTx(p.MessageType): MESSAGE_WIRE_TYPE = 230 def __init__( self, public_key: bytes = None, signature: bytes = None, ) -> None: self.public_key = public_key self.signature = signature @classmethod def get_fields(cls) -> Dict: return { 1: ('public_key', p.BytesType, 0), 2: ('signature', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/StellarTxOpRequest.py000066400000000000000000000004771361427340300252340ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class StellarTxOpRequest(p.MessageType): MESSAGE_WIRE_TYPE = 203 python-trezor-0.11.6/src/trezorlib/messages/Success.py000066400000000000000000000010321361427340300230360ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class Success(p.MessageType): MESSAGE_WIRE_TYPE = 2 def __init__( self, message: str = None, ) -> None: self.message = message @classmethod def get_fields(cls) -> Dict: return { 1: ('message', p.UnicodeType, 0), } python-trezor-0.11.6/src/trezorlib/messages/TezosAddress.py000066400000000000000000000010411361427340300240400ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class TezosAddress(p.MessageType): MESSAGE_WIRE_TYPE = 151 def __init__( self, address: str = None, ) -> None: self.address = address @classmethod def get_fields(cls) -> Dict: return { 1: ('address', p.UnicodeType, 0), } python-trezor-0.11.6/src/trezorlib/messages/TezosBallotOp.py000066400000000000000000000016361361427340300242010ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeTezosBallotType = Literal[0, 1, 2] except ImportError: pass class TezosBallotOp(p.MessageType): def __init__( self, source: bytes = None, period: int = None, proposal: bytes = None, ballot: EnumTypeTezosBallotType = None, ) -> None: self.source = source self.period = period self.proposal = proposal self.ballot = ballot @classmethod def get_fields(cls) -> Dict: return { 1: ('source', p.BytesType, 0), 2: ('period', p.UVarintType, 0), 3: ('proposal', p.BytesType, 0), 4: ('ballot', p.EnumType("TezosBallotType", (0, 1, 2)), 0), } python-trezor-0.11.6/src/trezorlib/messages/TezosBallotType.py000066400000000000000000000002701361427340300245350ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off if False: from typing_extensions import Literal Yay = 0 # type: Literal[0] Nay = 1 # type: Literal[1] Pass = 2 # type: Literal[2] python-trezor-0.11.6/src/trezorlib/messages/TezosContractID.py000066400000000000000000000012701361427340300244510ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeTezosContractType = Literal[0, 1] except ImportError: pass class TezosContractID(p.MessageType): def __init__( self, tag: EnumTypeTezosContractType = None, hash: bytes = None, ) -> None: self.tag = tag self.hash = hash @classmethod def get_fields(cls) -> Dict: return { 1: ('tag', p.EnumType("TezosContractType", (0, 1)), 0), 2: ('hash', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/TezosContractType.py000066400000000000000000000002471361427340300251010ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off if False: from typing_extensions import Literal Implicit = 0 # type: Literal[0] Originated = 1 # type: Literal[1] python-trezor-0.11.6/src/trezorlib/messages/TezosDelegationOp.py000066400000000000000000000020541361427340300250320ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class TezosDelegationOp(p.MessageType): def __init__( self, source: bytes = None, fee: int = None, counter: int = None, gas_limit: int = None, storage_limit: int = None, delegate: bytes = None, ) -> None: self.source = source self.fee = fee self.counter = counter self.gas_limit = gas_limit self.storage_limit = storage_limit self.delegate = delegate @classmethod def get_fields(cls) -> Dict: return { 7: ('source', p.BytesType, 0), 2: ('fee', p.UVarintType, 0), 3: ('counter', p.UVarintType, 0), 4: ('gas_limit', p.UVarintType, 0), 5: ('storage_limit', p.UVarintType, 0), 6: ('delegate', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/TezosGetAddress.py000066400000000000000000000013351361427340300245060ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class TezosGetAddress(p.MessageType): MESSAGE_WIRE_TYPE = 150 def __init__( self, address_n: List[int] = None, show_display: bool = None, ) -> None: self.address_n = address_n if address_n is not None else [] self.show_display = show_display @classmethod def get_fields(cls) -> Dict: return { 1: ('address_n', p.UVarintType, p.FLAG_REPEATED), 2: ('show_display', p.BoolType, 0), } python-trezor-0.11.6/src/trezorlib/messages/TezosGetPublicKey.py000066400000000000000000000013371361427340300250120ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class TezosGetPublicKey(p.MessageType): MESSAGE_WIRE_TYPE = 154 def __init__( self, address_n: List[int] = None, show_display: bool = None, ) -> None: self.address_n = address_n if address_n is not None else [] self.show_display = show_display @classmethod def get_fields(cls) -> Dict: return { 1: ('address_n', p.UVarintType, p.FLAG_REPEATED), 2: ('show_display', p.BoolType, 0), } python-trezor-0.11.6/src/trezorlib/messages/TezosManagerTransfer.py000066400000000000000000000012771361427340300255450ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .TezosContractID import TezosContractID if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class TezosManagerTransfer(p.MessageType): def __init__( self, destination: TezosContractID = None, amount: int = None, ) -> None: self.destination = destination self.amount = amount @classmethod def get_fields(cls) -> Dict: return { 1: ('destination', TezosContractID, 0), 2: ('amount', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/TezosOriginationOp.py000066400000000000000000000031561361427340300252450ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class TezosOriginationOp(p.MessageType): def __init__( self, source: bytes = None, fee: int = None, counter: int = None, gas_limit: int = None, storage_limit: int = None, manager_pubkey: bytes = None, balance: int = None, spendable: bool = None, delegatable: bool = None, delegate: bytes = None, script: bytes = None, ) -> None: self.source = source self.fee = fee self.counter = counter self.gas_limit = gas_limit self.storage_limit = storage_limit self.manager_pubkey = manager_pubkey self.balance = balance self.spendable = spendable self.delegatable = delegatable self.delegate = delegate self.script = script @classmethod def get_fields(cls) -> Dict: return { 12: ('source', p.BytesType, 0), 2: ('fee', p.UVarintType, 0), 3: ('counter', p.UVarintType, 0), 4: ('gas_limit', p.UVarintType, 0), 5: ('storage_limit', p.UVarintType, 0), 6: ('manager_pubkey', p.BytesType, 0), 7: ('balance', p.UVarintType, 0), 8: ('spendable', p.BoolType, 0), 9: ('delegatable', p.BoolType, 0), 10: ('delegate', p.BytesType, 0), 11: ('script', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/TezosParametersManager.py000066400000000000000000000015511361427340300260570ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .TezosManagerTransfer import TezosManagerTransfer if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class TezosParametersManager(p.MessageType): def __init__( self, set_delegate: bytes = None, cancel_delegate: bool = None, transfer: TezosManagerTransfer = None, ) -> None: self.set_delegate = set_delegate self.cancel_delegate = cancel_delegate self.transfer = transfer @classmethod def get_fields(cls) -> Dict: return { 1: ('set_delegate', p.BytesType, 0), 2: ('cancel_delegate', p.BoolType, 0), 3: ('transfer', TezosManagerTransfer, 0), } python-trezor-0.11.6/src/trezorlib/messages/TezosProposalOp.py000066400000000000000000000014211361427340300245530ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class TezosProposalOp(p.MessageType): def __init__( self, source: bytes = None, period: int = None, proposals: List[bytes] = None, ) -> None: self.source = source self.period = period self.proposals = proposals if proposals is not None else [] @classmethod def get_fields(cls) -> Dict: return { 1: ('source', p.BytesType, 0), 2: ('period', p.UVarintType, 0), 4: ('proposals', p.BytesType, p.FLAG_REPEATED), } python-trezor-0.11.6/src/trezorlib/messages/TezosPublicKey.py000066400000000000000000000010571361427340300243510ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class TezosPublicKey(p.MessageType): MESSAGE_WIRE_TYPE = 155 def __init__( self, public_key: str = None, ) -> None: self.public_key = public_key @classmethod def get_fields(cls) -> Dict: return { 1: ('public_key', p.UnicodeType, 0), } python-trezor-0.11.6/src/trezorlib/messages/TezosRevealOp.py000066400000000000000000000020601361427340300241720ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class TezosRevealOp(p.MessageType): def __init__( self, source: bytes = None, fee: int = None, counter: int = None, gas_limit: int = None, storage_limit: int = None, public_key: bytes = None, ) -> None: self.source = source self.fee = fee self.counter = counter self.gas_limit = gas_limit self.storage_limit = storage_limit self.public_key = public_key @classmethod def get_fields(cls) -> Dict: return { 7: ('source', p.BytesType, 0), 2: ('fee', p.UVarintType, 0), 3: ('counter', p.UVarintType, 0), 4: ('gas_limit', p.UVarintType, 0), 5: ('storage_limit', p.UVarintType, 0), 6: ('public_key', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/TezosSignTx.py000066400000000000000000000033321361427340300236740ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .TezosBallotOp import TezosBallotOp from .TezosDelegationOp import TezosDelegationOp from .TezosOriginationOp import TezosOriginationOp from .TezosProposalOp import TezosProposalOp from .TezosRevealOp import TezosRevealOp from .TezosTransactionOp import TezosTransactionOp if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class TezosSignTx(p.MessageType): MESSAGE_WIRE_TYPE = 152 def __init__( self, address_n: List[int] = None, branch: bytes = None, reveal: TezosRevealOp = None, transaction: TezosTransactionOp = None, origination: TezosOriginationOp = None, delegation: TezosDelegationOp = None, proposal: TezosProposalOp = None, ballot: TezosBallotOp = None, ) -> None: self.address_n = address_n if address_n is not None else [] self.branch = branch self.reveal = reveal self.transaction = transaction self.origination = origination self.delegation = delegation self.proposal = proposal self.ballot = ballot @classmethod def get_fields(cls) -> Dict: return { 1: ('address_n', p.UVarintType, p.FLAG_REPEATED), 2: ('branch', p.BytesType, 0), 3: ('reveal', TezosRevealOp, 0), 4: ('transaction', TezosTransactionOp, 0), 5: ('origination', TezosOriginationOp, 0), 6: ('delegation', TezosDelegationOp, 0), 7: ('proposal', TezosProposalOp, 0), 8: ('ballot', TezosBallotOp, 0), } python-trezor-0.11.6/src/trezorlib/messages/TezosSignedTx.py000066400000000000000000000014721361427340300242100ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class TezosSignedTx(p.MessageType): MESSAGE_WIRE_TYPE = 153 def __init__( self, signature: str = None, sig_op_contents: bytes = None, operation_hash: str = None, ) -> None: self.signature = signature self.sig_op_contents = sig_op_contents self.operation_hash = operation_hash @classmethod def get_fields(cls) -> Dict: return { 1: ('signature', p.UnicodeType, 0), 2: ('sig_op_contents', p.BytesType, 0), 3: ('operation_hash', p.UnicodeType, 0), } python-trezor-0.11.6/src/trezorlib/messages/TezosTransactionOp.py000066400000000000000000000030771361427340300252520ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .TezosContractID import TezosContractID from .TezosParametersManager import TezosParametersManager if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class TezosTransactionOp(p.MessageType): def __init__( self, source: bytes = None, fee: int = None, counter: int = None, gas_limit: int = None, storage_limit: int = None, amount: int = None, destination: TezosContractID = None, parameters: bytes = None, parameters_manager: TezosParametersManager = None, ) -> None: self.source = source self.fee = fee self.counter = counter self.gas_limit = gas_limit self.storage_limit = storage_limit self.amount = amount self.destination = destination self.parameters = parameters self.parameters_manager = parameters_manager @classmethod def get_fields(cls) -> Dict: return { 9: ('source', p.BytesType, 0), 2: ('fee', p.UVarintType, 0), 3: ('counter', p.UVarintType, 0), 4: ('gas_limit', p.UVarintType, 0), 5: ('storage_limit', p.UVarintType, 0), 6: ('amount', p.UVarintType, 0), 7: ('destination', TezosContractID, 0), 8: ('parameters', p.BytesType, 0), 10: ('parameters_manager', TezosParametersManager, 0), } python-trezor-0.11.6/src/trezorlib/messages/TransactionType.py000066400000000000000000000044731361427340300245710ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .TxInputType import TxInputType from .TxOutputBinType import TxOutputBinType from .TxOutputType import TxOutputType if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class TransactionType(p.MessageType): def __init__( self, version: int = None, inputs: List[TxInputType] = None, bin_outputs: List[TxOutputBinType] = None, lock_time: int = None, outputs: List[TxOutputType] = None, inputs_cnt: int = None, outputs_cnt: int = None, extra_data: bytes = None, extra_data_len: int = None, expiry: int = None, overwintered: bool = None, version_group_id: int = None, timestamp: int = None, branch_id: int = None, ) -> None: self.version = version self.inputs = inputs if inputs is not None else [] self.bin_outputs = bin_outputs if bin_outputs is not None else [] self.lock_time = lock_time self.outputs = outputs if outputs is not None else [] self.inputs_cnt = inputs_cnt self.outputs_cnt = outputs_cnt self.extra_data = extra_data self.extra_data_len = extra_data_len self.expiry = expiry self.overwintered = overwintered self.version_group_id = version_group_id self.timestamp = timestamp self.branch_id = branch_id @classmethod def get_fields(cls) -> Dict: return { 1: ('version', p.UVarintType, 0), 2: ('inputs', TxInputType, p.FLAG_REPEATED), 3: ('bin_outputs', TxOutputBinType, p.FLAG_REPEATED), 4: ('lock_time', p.UVarintType, 0), 5: ('outputs', TxOutputType, p.FLAG_REPEATED), 6: ('inputs_cnt', p.UVarintType, 0), 7: ('outputs_cnt', p.UVarintType, 0), 8: ('extra_data', p.BytesType, 0), 9: ('extra_data_len', p.UVarintType, 0), 10: ('expiry', p.UVarintType, 0), 11: ('overwintered', p.BoolType, 0), 12: ('version_group_id', p.UVarintType, 0), 13: ('timestamp', p.UVarintType, 0), 14: ('branch_id', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/TxAck.py000066400000000000000000000011011361427340300224350ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .TransactionType import TransactionType if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class TxAck(p.MessageType): MESSAGE_WIRE_TYPE = 22 def __init__( self, tx: TransactionType = None, ) -> None: self.tx = tx @classmethod def get_fields(cls) -> Dict: return { 1: ('tx', TransactionType, 0), } python-trezor-0.11.6/src/trezorlib/messages/TxInputType.py000066400000000000000000000043421361427340300237120ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .MultisigRedeemScriptType import MultisigRedeemScriptType if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeInputScriptType = Literal[0, 1, 2, 3, 4] except ImportError: pass class TxInputType(p.MessageType): def __init__( self, address_n: List[int] = None, prev_hash: bytes = None, prev_index: int = None, script_sig: bytes = None, sequence: int = None, script_type: EnumTypeInputScriptType = None, multisig: MultisigRedeemScriptType = None, amount: int = None, decred_tree: int = None, decred_script_version: int = None, prev_block_hash_bip115: bytes = None, prev_block_height_bip115: int = None, ) -> None: self.address_n = address_n if address_n is not None else [] self.prev_hash = prev_hash self.prev_index = prev_index self.script_sig = script_sig self.sequence = sequence self.script_type = script_type self.multisig = multisig self.amount = amount self.decred_tree = decred_tree self.decred_script_version = decred_script_version self.prev_block_hash_bip115 = prev_block_hash_bip115 self.prev_block_height_bip115 = prev_block_height_bip115 @classmethod def get_fields(cls) -> Dict: return { 1: ('address_n', p.UVarintType, p.FLAG_REPEATED), 2: ('prev_hash', p.BytesType, 0), # required 3: ('prev_index', p.UVarintType, 0), # required 4: ('script_sig', p.BytesType, 0), 5: ('sequence', p.UVarintType, 0), # default=4294967295 6: ('script_type', p.EnumType("InputScriptType", (0, 1, 2, 3, 4)), 0), # default=SPENDADDRESS 7: ('multisig', MultisigRedeemScriptType, 0), 8: ('amount', p.UVarintType, 0), 9: ('decred_tree', p.UVarintType, 0), 10: ('decred_script_version', p.UVarintType, 0), 11: ('prev_block_hash_bip115', p.BytesType, 0), 12: ('prev_block_height_bip115', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/TxOutputBinType.py000066400000000000000000000015001361427340300245350ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class TxOutputBinType(p.MessageType): def __init__( self, amount: int = None, script_pubkey: bytes = None, decred_script_version: int = None, ) -> None: self.amount = amount self.script_pubkey = script_pubkey self.decred_script_version = decred_script_version @classmethod def get_fields(cls) -> Dict: return { 1: ('amount', p.UVarintType, 0), # required 2: ('script_pubkey', p.BytesType, 0), # required 3: ('decred_script_version', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/TxOutputType.py000066400000000000000000000034751361427340300241210ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .MultisigRedeemScriptType import MultisigRedeemScriptType if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeOutputScriptType = Literal[0, 1, 2, 3, 4, 5] except ImportError: pass class TxOutputType(p.MessageType): def __init__( self, address: str = None, address_n: List[int] = None, amount: int = None, script_type: EnumTypeOutputScriptType = None, multisig: MultisigRedeemScriptType = None, op_return_data: bytes = None, decred_script_version: int = None, block_hash_bip115: bytes = None, block_height_bip115: int = None, ) -> None: self.address = address self.address_n = address_n if address_n is not None else [] self.amount = amount self.script_type = script_type self.multisig = multisig self.op_return_data = op_return_data self.decred_script_version = decred_script_version self.block_hash_bip115 = block_hash_bip115 self.block_height_bip115 = block_height_bip115 @classmethod def get_fields(cls) -> Dict: return { 1: ('address', p.UnicodeType, 0), 2: ('address_n', p.UVarintType, p.FLAG_REPEATED), 3: ('amount', p.UVarintType, 0), # required 4: ('script_type', p.EnumType("OutputScriptType", (0, 1, 2, 3, 4, 5)), 0), # required 5: ('multisig', MultisigRedeemScriptType, 0), 6: ('op_return_data', p.BytesType, 0), 7: ('decred_script_version', p.UVarintType, 0), 8: ('block_hash_bip115', p.BytesType, 0), 9: ('block_height_bip115', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/TxRequest.py000066400000000000000000000020361361427340300233770ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .TxRequestDetailsType import TxRequestDetailsType from .TxRequestSerializedType import TxRequestSerializedType if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeRequestType = Literal[0, 1, 2, 3, 4] except ImportError: pass class TxRequest(p.MessageType): MESSAGE_WIRE_TYPE = 21 def __init__( self, request_type: EnumTypeRequestType = None, details: TxRequestDetailsType = None, serialized: TxRequestSerializedType = None, ) -> None: self.request_type = request_type self.details = details self.serialized = serialized @classmethod def get_fields(cls) -> Dict: return { 1: ('request_type', p.EnumType("RequestType", (0, 1, 2, 3, 4)), 0), 2: ('details', TxRequestDetailsType, 0), 3: ('serialized', TxRequestSerializedType, 0), } python-trezor-0.11.6/src/trezorlib/messages/TxRequestDetailsType.py000066400000000000000000000016471361427340300255560ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class TxRequestDetailsType(p.MessageType): def __init__( self, request_index: int = None, tx_hash: bytes = None, extra_data_len: int = None, extra_data_offset: int = None, ) -> None: self.request_index = request_index self.tx_hash = tx_hash self.extra_data_len = extra_data_len self.extra_data_offset = extra_data_offset @classmethod def get_fields(cls) -> Dict: return { 1: ('request_index', p.UVarintType, 0), 2: ('tx_hash', p.BytesType, 0), 3: ('extra_data_len', p.UVarintType, 0), 4: ('extra_data_offset', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/TxRequestSerializedType.py000066400000000000000000000014441361427340300262570ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class TxRequestSerializedType(p.MessageType): def __init__( self, signature_index: int = None, signature: bytes = None, serialized_tx: bytes = None, ) -> None: self.signature_index = signature_index self.signature = signature self.serialized_tx = serialized_tx @classmethod def get_fields(cls) -> Dict: return { 1: ('signature_index', p.UVarintType, 0), 2: ('signature', p.BytesType, 0), 3: ('serialized_tx', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/VerifyMessage.py000066400000000000000000000016021361427340300242020ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class VerifyMessage(p.MessageType): MESSAGE_WIRE_TYPE = 39 def __init__( self, address: str = None, signature: bytes = None, message: bytes = None, coin_name: str = None, ) -> None: self.address = address self.signature = signature self.message = message self.coin_name = coin_name @classmethod def get_fields(cls) -> Dict: return { 1: ('address', p.UnicodeType, 0), 2: ('signature', p.BytesType, 0), 3: ('message', p.BytesType, 0), 4: ('coin_name', p.UnicodeType, 0), # default=Bitcoin } python-trezor-0.11.6/src/trezorlib/messages/WebAuthnAddResidentCredential.py000066400000000000000000000011121361427340300272440ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class WebAuthnAddResidentCredential(p.MessageType): MESSAGE_WIRE_TYPE = 802 def __init__( self, credential_id: bytes = None, ) -> None: self.credential_id = credential_id @classmethod def get_fields(cls) -> Dict: return { 1: ('credential_id', p.BytesType, 0), } python-trezor-0.11.6/src/trezorlib/messages/WebAuthnCredential.py000066400000000000000000000030221361427340300251370ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class WebAuthnCredential(p.MessageType): def __init__( self, index: int = None, id: bytes = None, rp_id: str = None, rp_name: str = None, user_id: bytes = None, user_name: str = None, user_display_name: str = None, creation_time: int = None, hmac_secret: bool = None, use_sign_count: bool = None, ) -> None: self.index = index self.id = id self.rp_id = rp_id self.rp_name = rp_name self.user_id = user_id self.user_name = user_name self.user_display_name = user_display_name self.creation_time = creation_time self.hmac_secret = hmac_secret self.use_sign_count = use_sign_count @classmethod def get_fields(cls) -> Dict: return { 1: ('index', p.UVarintType, 0), 2: ('id', p.BytesType, 0), 3: ('rp_id', p.UnicodeType, 0), 4: ('rp_name', p.UnicodeType, 0), 5: ('user_id', p.BytesType, 0), 6: ('user_name', p.UnicodeType, 0), 7: ('user_display_name', p.UnicodeType, 0), 8: ('creation_time', p.UVarintType, 0), 9: ('hmac_secret', p.BoolType, 0), 10: ('use_sign_count', p.BoolType, 0), } python-trezor-0.11.6/src/trezorlib/messages/WebAuthnCredentials.py000066400000000000000000000012671361427340300253330ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p from .WebAuthnCredential import WebAuthnCredential if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class WebAuthnCredentials(p.MessageType): MESSAGE_WIRE_TYPE = 801 def __init__( self, credentials: List[WebAuthnCredential] = None, ) -> None: self.credentials = credentials if credentials is not None else [] @classmethod def get_fields(cls) -> Dict: return { 1: ('credentials', WebAuthnCredential, p.FLAG_REPEATED), } python-trezor-0.11.6/src/trezorlib/messages/WebAuthnListResidentCredentials.py000066400000000000000000000005141361427340300276570ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class WebAuthnListResidentCredentials(p.MessageType): MESSAGE_WIRE_TYPE = 800 python-trezor-0.11.6/src/trezorlib/messages/WebAuthnRemoveResidentCredential.py000066400000000000000000000010551361427340300300170ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class WebAuthnRemoveResidentCredential(p.MessageType): MESSAGE_WIRE_TYPE = 803 def __init__( self, index: int = None, ) -> None: self.index = index @classmethod def get_fields(cls) -> Dict: return { 1: ('index', p.UVarintType, 0), } python-trezor-0.11.6/src/trezorlib/messages/WipeDevice.py000066400000000000000000000004651361427340300234630ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class WipeDevice(p.MessageType): MESSAGE_WIRE_TYPE = 5 python-trezor-0.11.6/src/trezorlib/messages/WordAck.py000066400000000000000000000010331361427340300227610ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 except ImportError: pass class WordAck(p.MessageType): MESSAGE_WIRE_TYPE = 47 def __init__( self, word: str = None, ) -> None: self.word = word @classmethod def get_fields(cls) -> Dict: return { 1: ('word', p.UnicodeType, 0), # required } python-trezor-0.11.6/src/trezorlib/messages/WordRequest.py000066400000000000000000000011651361427340300237210ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .. import protobuf as p if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 EnumTypeWordRequestType = Literal[0, 1, 2] except ImportError: pass class WordRequest(p.MessageType): MESSAGE_WIRE_TYPE = 46 def __init__( self, type: EnumTypeWordRequestType = None, ) -> None: self.type = type @classmethod def get_fields(cls) -> Dict: return { 1: ('type', p.EnumType("WordRequestType", (0, 1, 2)), 0), } python-trezor-0.11.6/src/trezorlib/messages/WordRequestType.py000066400000000000000000000003011361427340300245520ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off if False: from typing_extensions import Literal Plain = 0 # type: Literal[0] Matrix9 = 1 # type: Literal[1] Matrix6 = 2 # type: Literal[2] python-trezor-0.11.6/src/trezorlib/messages/__init__.py000066400000000000000000000326641361427340300232040ustar00rootroot00000000000000# Automatically generated by pb2py # fmt: off from .Address import Address from .ApplyFlags import ApplyFlags from .ApplySettings import ApplySettings from .BackupDevice import BackupDevice from .BinanceAddress import BinanceAddress from .BinanceCancelMsg import BinanceCancelMsg from .BinanceCoin import BinanceCoin from .BinanceGetAddress import BinanceGetAddress from .BinanceGetPublicKey import BinanceGetPublicKey from .BinanceInputOutput import BinanceInputOutput from .BinanceOrderMsg import BinanceOrderMsg from .BinancePublicKey import BinancePublicKey from .BinanceSignTx import BinanceSignTx from .BinanceSignedTx import BinanceSignedTx from .BinanceTransferMsg import BinanceTransferMsg from .BinanceTxRequest import BinanceTxRequest from .ButtonAck import ButtonAck from .ButtonRequest import ButtonRequest from .Cancel import Cancel from .CardanoAddress import CardanoAddress from .CardanoGetAddress import CardanoGetAddress from .CardanoGetPublicKey import CardanoGetPublicKey from .CardanoPublicKey import CardanoPublicKey from .CardanoSignTx import CardanoSignTx from .CardanoSignedTx import CardanoSignedTx from .CardanoTxAck import CardanoTxAck from .CardanoTxInputType import CardanoTxInputType from .CardanoTxOutputType import CardanoTxOutputType from .CardanoTxRequest import CardanoTxRequest from .ChangePin import ChangePin from .ChangeWipeCode import ChangeWipeCode from .CipherKeyValue import CipherKeyValue from .CipheredKeyValue import CipheredKeyValue from .ClearSession import ClearSession from .CosiCommit import CosiCommit from .CosiCommitment import CosiCommitment from .CosiSign import CosiSign from .CosiSignature import CosiSignature from .DebugLinkDecision import DebugLinkDecision from .DebugLinkFlashErase import DebugLinkFlashErase from .DebugLinkGetState import DebugLinkGetState from .DebugLinkLayout import DebugLinkLayout from .DebugLinkLog import DebugLinkLog from .DebugLinkMemory import DebugLinkMemory from .DebugLinkMemoryRead import DebugLinkMemoryRead from .DebugLinkMemoryWrite import DebugLinkMemoryWrite from .DebugLinkState import DebugLinkState from .DebugLinkStop import DebugLinkStop from .DebugMoneroDiagAck import DebugMoneroDiagAck from .DebugMoneroDiagRequest import DebugMoneroDiagRequest from .ECDHSessionKey import ECDHSessionKey from .Entropy import Entropy from .EntropyAck import EntropyAck from .EntropyRequest import EntropyRequest from .EosActionBuyRam import EosActionBuyRam from .EosActionBuyRamBytes import EosActionBuyRamBytes from .EosActionCommon import EosActionCommon from .EosActionDelegate import EosActionDelegate from .EosActionDeleteAuth import EosActionDeleteAuth from .EosActionLinkAuth import EosActionLinkAuth from .EosActionNewAccount import EosActionNewAccount from .EosActionRefund import EosActionRefund from .EosActionSellRam import EosActionSellRam from .EosActionTransfer import EosActionTransfer from .EosActionUndelegate import EosActionUndelegate from .EosActionUnknown import EosActionUnknown from .EosActionUnlinkAuth import EosActionUnlinkAuth from .EosActionUpdateAuth import EosActionUpdateAuth from .EosActionVoteProducer import EosActionVoteProducer from .EosAsset import EosAsset from .EosAuthorization import EosAuthorization from .EosAuthorizationAccount import EosAuthorizationAccount from .EosAuthorizationKey import EosAuthorizationKey from .EosAuthorizationWait import EosAuthorizationWait from .EosGetPublicKey import EosGetPublicKey from .EosPermissionLevel import EosPermissionLevel from .EosPublicKey import EosPublicKey from .EosSignTx import EosSignTx from .EosSignedTx import EosSignedTx from .EosTxActionAck import EosTxActionAck from .EosTxActionRequest import EosTxActionRequest from .EosTxHeader import EosTxHeader from .EthereumAddress import EthereumAddress from .EthereumGetAddress import EthereumGetAddress from .EthereumGetPublicKey import EthereumGetPublicKey from .EthereumMessageSignature import EthereumMessageSignature from .EthereumPublicKey import EthereumPublicKey from .EthereumSignMessage import EthereumSignMessage from .EthereumSignTx import EthereumSignTx from .EthereumTxAck import EthereumTxAck from .EthereumTxRequest import EthereumTxRequest from .EthereumVerifyMessage import EthereumVerifyMessage from .Failure import Failure from .Features import Features from .FirmwareErase import FirmwareErase from .FirmwareRequest import FirmwareRequest from .FirmwareUpload import FirmwareUpload from .GetAddress import GetAddress from .GetECDHSessionKey import GetECDHSessionKey from .GetEntropy import GetEntropy from .GetFeatures import GetFeatures from .GetNextU2FCounter import GetNextU2FCounter from .GetPublicKey import GetPublicKey from .HDNodePathType import HDNodePathType from .HDNodeType import HDNodeType from .IdentityType import IdentityType from .Initialize import Initialize from .LiskAddress import LiskAddress from .LiskDelegateType import LiskDelegateType from .LiskGetAddress import LiskGetAddress from .LiskGetPublicKey import LiskGetPublicKey from .LiskMessageSignature import LiskMessageSignature from .LiskMultisignatureType import LiskMultisignatureType from .LiskPublicKey import LiskPublicKey from .LiskSignMessage import LiskSignMessage from .LiskSignTx import LiskSignTx from .LiskSignatureType import LiskSignatureType from .LiskSignedTx import LiskSignedTx from .LiskTransactionAsset import LiskTransactionAsset from .LiskTransactionCommon import LiskTransactionCommon from .LiskVerifyMessage import LiskVerifyMessage from .LoadDevice import LoadDevice from .MessageSignature import MessageSignature from .MoneroAccountPublicAddress import MoneroAccountPublicAddress from .MoneroAddress import MoneroAddress from .MoneroExportedKeyImage import MoneroExportedKeyImage from .MoneroGetAddress import MoneroGetAddress from .MoneroGetTxKeyAck import MoneroGetTxKeyAck from .MoneroGetTxKeyRequest import MoneroGetTxKeyRequest from .MoneroGetWatchKey import MoneroGetWatchKey from .MoneroKeyImageExportInitAck import MoneroKeyImageExportInitAck from .MoneroKeyImageExportInitRequest import MoneroKeyImageExportInitRequest from .MoneroKeyImageSyncFinalAck import MoneroKeyImageSyncFinalAck from .MoneroKeyImageSyncFinalRequest import MoneroKeyImageSyncFinalRequest from .MoneroKeyImageSyncStepAck import MoneroKeyImageSyncStepAck from .MoneroKeyImageSyncStepRequest import MoneroKeyImageSyncStepRequest from .MoneroLiveRefreshFinalAck import MoneroLiveRefreshFinalAck from .MoneroLiveRefreshFinalRequest import MoneroLiveRefreshFinalRequest from .MoneroLiveRefreshStartAck import MoneroLiveRefreshStartAck from .MoneroLiveRefreshStartRequest import MoneroLiveRefreshStartRequest from .MoneroLiveRefreshStepAck import MoneroLiveRefreshStepAck from .MoneroLiveRefreshStepRequest import MoneroLiveRefreshStepRequest from .MoneroMultisigKLRki import MoneroMultisigKLRki from .MoneroOutputEntry import MoneroOutputEntry from .MoneroRctKeyPublic import MoneroRctKeyPublic from .MoneroRingCtSig import MoneroRingCtSig from .MoneroSubAddressIndicesList import MoneroSubAddressIndicesList from .MoneroTransactionAllInputsSetAck import MoneroTransactionAllInputsSetAck from .MoneroTransactionAllInputsSetRequest import MoneroTransactionAllInputsSetRequest from .MoneroTransactionAllOutSetAck import MoneroTransactionAllOutSetAck from .MoneroTransactionAllOutSetRequest import MoneroTransactionAllOutSetRequest from .MoneroTransactionData import MoneroTransactionData from .MoneroTransactionDestinationEntry import MoneroTransactionDestinationEntry from .MoneroTransactionFinalAck import MoneroTransactionFinalAck from .MoneroTransactionFinalRequest import MoneroTransactionFinalRequest from .MoneroTransactionInitAck import MoneroTransactionInitAck from .MoneroTransactionInitRequest import MoneroTransactionInitRequest from .MoneroTransactionInputViniAck import MoneroTransactionInputViniAck from .MoneroTransactionInputViniRequest import MoneroTransactionInputViniRequest from .MoneroTransactionInputsPermutationAck import MoneroTransactionInputsPermutationAck from .MoneroTransactionInputsPermutationRequest import MoneroTransactionInputsPermutationRequest from .MoneroTransactionRsigData import MoneroTransactionRsigData from .MoneroTransactionSetInputAck import MoneroTransactionSetInputAck from .MoneroTransactionSetInputRequest import MoneroTransactionSetInputRequest from .MoneroTransactionSetOutputAck import MoneroTransactionSetOutputAck from .MoneroTransactionSetOutputRequest import MoneroTransactionSetOutputRequest from .MoneroTransactionSignInputAck import MoneroTransactionSignInputAck from .MoneroTransactionSignInputRequest import MoneroTransactionSignInputRequest from .MoneroTransactionSourceEntry import MoneroTransactionSourceEntry from .MoneroTransferDetails import MoneroTransferDetails from .MoneroWatchKey import MoneroWatchKey from .MultisigRedeemScriptType import MultisigRedeemScriptType from .NEMAddress import NEMAddress from .NEMAggregateModification import NEMAggregateModification from .NEMCosignatoryModification import NEMCosignatoryModification from .NEMDecryptMessage import NEMDecryptMessage from .NEMDecryptedMessage import NEMDecryptedMessage from .NEMGetAddress import NEMGetAddress from .NEMImportanceTransfer import NEMImportanceTransfer from .NEMMosaic import NEMMosaic from .NEMMosaicCreation import NEMMosaicCreation from .NEMMosaicDefinition import NEMMosaicDefinition from .NEMMosaicSupplyChange import NEMMosaicSupplyChange from .NEMProvisionNamespace import NEMProvisionNamespace from .NEMSignTx import NEMSignTx from .NEMSignedTx import NEMSignedTx from .NEMTransactionCommon import NEMTransactionCommon from .NEMTransfer import NEMTransfer from .NextU2FCounter import NextU2FCounter from .PassphraseAck import PassphraseAck from .PassphraseRequest import PassphraseRequest from .PassphraseStateAck import PassphraseStateAck from .PassphraseStateRequest import PassphraseStateRequest from .PinMatrixAck import PinMatrixAck from .PinMatrixRequest import PinMatrixRequest from .Ping import Ping from .PublicKey import PublicKey from .RecoveryDevice import RecoveryDevice from .ResetDevice import ResetDevice from .RippleAddress import RippleAddress from .RippleGetAddress import RippleGetAddress from .RipplePayment import RipplePayment from .RippleSignTx import RippleSignTx from .RippleSignedTx import RippleSignedTx from .SdProtect import SdProtect from .SelfTest import SelfTest from .SetU2FCounter import SetU2FCounter from .SignIdentity import SignIdentity from .SignMessage import SignMessage from .SignTx import SignTx from .SignedIdentity import SignedIdentity from .StellarAccountMergeOp import StellarAccountMergeOp from .StellarAddress import StellarAddress from .StellarAllowTrustOp import StellarAllowTrustOp from .StellarAssetType import StellarAssetType from .StellarBumpSequenceOp import StellarBumpSequenceOp from .StellarChangeTrustOp import StellarChangeTrustOp from .StellarCreateAccountOp import StellarCreateAccountOp from .StellarCreatePassiveOfferOp import StellarCreatePassiveOfferOp from .StellarGetAddress import StellarGetAddress from .StellarManageDataOp import StellarManageDataOp from .StellarManageOfferOp import StellarManageOfferOp from .StellarPathPaymentOp import StellarPathPaymentOp from .StellarPaymentOp import StellarPaymentOp from .StellarSetOptionsOp import StellarSetOptionsOp from .StellarSignTx import StellarSignTx from .StellarSignedTx import StellarSignedTx from .StellarTxOpRequest import StellarTxOpRequest from .Success import Success from .TezosAddress import TezosAddress from .TezosBallotOp import TezosBallotOp from .TezosContractID import TezosContractID from .TezosDelegationOp import TezosDelegationOp from .TezosGetAddress import TezosGetAddress from .TezosGetPublicKey import TezosGetPublicKey from .TezosManagerTransfer import TezosManagerTransfer from .TezosOriginationOp import TezosOriginationOp from .TezosParametersManager import TezosParametersManager from .TezosProposalOp import TezosProposalOp from .TezosPublicKey import TezosPublicKey from .TezosRevealOp import TezosRevealOp from .TezosSignTx import TezosSignTx from .TezosSignedTx import TezosSignedTx from .TezosTransactionOp import TezosTransactionOp from .TransactionType import TransactionType from .TxAck import TxAck from .TxInputType import TxInputType from .TxOutputBinType import TxOutputBinType from .TxOutputType import TxOutputType from .TxRequest import TxRequest from .TxRequestDetailsType import TxRequestDetailsType from .TxRequestSerializedType import TxRequestSerializedType from .VerifyMessage import VerifyMessage from .WebAuthnAddResidentCredential import WebAuthnAddResidentCredential from .WebAuthnCredential import WebAuthnCredential from .WebAuthnCredentials import WebAuthnCredentials from .WebAuthnListResidentCredentials import WebAuthnListResidentCredentials from .WebAuthnRemoveResidentCredential import WebAuthnRemoveResidentCredential from .WipeDevice import WipeDevice from .WordAck import WordAck from .WordRequest import WordRequest from . import BackupType from . import BinanceOrderSide from . import BinanceOrderType from . import BinanceTimeInForce from . import ButtonRequestType from . import Capability from . import DebugSwipeDirection from . import FailureType from . import InputScriptType from . import LiskTransactionType from . import MessageType from . import NEMImportanceTransferMode from . import NEMModificationType from . import NEMMosaicLevy from . import NEMSupplyChangeType from . import OutputScriptType from . import PassphraseSourceType from . import PinMatrixRequestType from . import RecoveryDeviceType from . import RequestType from . import SdProtectOperationType from . import TezosBallotType from . import TezosContractType from . import WordRequestType python-trezor-0.11.6/src/trezorlib/messages/__pycache__/000077500000000000000000000000001361427340300232705ustar00rootroot00000000000000python-trezor-0.11.6/src/trezorlib/messages/__pycache__/Address.cpython-36.pyc000066400000000000000000000016211361427340300273030ustar00rootroot000000000000003 ]' @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) AddressN)addressreturncCs ||_dS)N)r )selfr r V/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/Address.py__init__szAddress.__init__)r cCsddtjdfiS)Nr r)pZ UnicodeType)clsr r r get_fieldsszAddress.get_fields)N) __name__ __module__ __qualname__ZMESSAGE_WIRE_TYPEstrr classmethodrrr r r r r s rN) rrtypingrrZtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/ApplyFlags.cpython-36.pyc000066400000000000000000000016331361427340300277630ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) ApplyFlagsN)flagsreturncCs ||_dS)N)r )selfr r Y/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/ApplyFlags.py__init__szApplyFlags.__init__)r cCsddtjdfiS)Nr r)p UVarintType)clsr r r get_fieldsszApplyFlags.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEintr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/ApplySettings.cpython-36.pyc000066400000000000000000000027161361427340300305320ustar00rootroot000000000000003 ] @s`ddlmZy(ddlmZmZddlmZed ZWne k rHYnXGdddej Z dS) )protobuf)DictList)Literalc @s@eZdZdZd eeeeeeeddddZ e e dddZ dS) ApplySettingsN)languagelabeluse_passphrase homescreenpassphrase_sourceauto_lock_delay_msdisplay_rotationreturncCs.||_||_||_||_||_||_||_dS)N)r r r r rrr)selfr r r r rrrr\/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/ApplySettings.py__init__s zApplySettings.__init__)rc CsRdtjdfdtjdfdtjdfdtjdfdtjdd dfd tjdfd tjdfd S)Nr rr r r rPassphraseSourceTyperrrr)rr)rrr)p UnicodeTypeBoolType BytesTypeEnumType UVarintType)clsrrr get_fields#s     zApplySettings.get_fields)NNNNNNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEstrboolbytesEnumTypePassphraseSourceTypeintr classmethodrr#rrrrrs rN)rrr) rrtypingrrtyping_extensionsrr+ ImportError MessageTyperrrrrs   python-trezor-0.11.6/src/trezorlib/messages/__pycache__/BackupDevice.cpython-36.pyc000066400000000000000000000010571361427340300302460ustar00rootroot000000000000003 ]8 @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@seZdZdZdS) BackupDevice"N)__name__ __module__ __qualname__MESSAGE_WIRE_TYPEr r [/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/BackupDevice.pyr srN) rptypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/BackupType.cpython-36.pyc000066400000000000000000000003601361427340300277640ustar00rootroot000000000000003 ]@sdZdZdZdS)N)ZBip39Z Slip39_BasicZSlip39_AdvancedrrY/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/BackupType.pyspython-trezor-0.11.6/src/trezorlib/messages/__pycache__/BinanceAddress.cpython-36.pyc000066400000000000000000000016551361427340300305720ustar00rootroot000000000000003 ]# @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) BinanceAddressiN)addressreturncCs ||_dS)N)r)selfrr ]/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/BinanceAddress.py__init__szBinanceAddress.__init__)r cCsddtjdfiS)Nrr)p UnicodeType)clsr r r get_fieldsszBinanceAddress.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEstrr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/BinanceCancelMsg.cpython-36.pyc000066400000000000000000000020371361427340300310340ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s8eZdZdZd eeeddddZeedddZdS) BinanceCancelMsgiN)refidsendersymbolreturncCs||_||_||_dS)N)rr r )selfrr r r _/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/BinanceCancelMsg.py__init__szBinanceCancelMsg.__init__)r cCs$dtjdfdtjdfdtjdfdS)Nrrr r )r)p UnicodeType)clsr r r get_fieldss  zBinanceCancelMsg.get_fields)NNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEstrr classmethodrrr r r rr srN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/BinanceCoin.cpython-36.pyc000066400000000000000000000017121361427340300300670ustar00rootroot000000000000003 ]b @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s2eZdZdeeddddZeedddZdS) BinanceCoinN)amountdenomreturncCs||_||_dS)N)rr )selfrr r Z/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/BinanceCoin.py__init__szBinanceCoin.__init__)r cCsdtjdfdtjdfdS)Nrrr )r)p SVarintType UnicodeType)clsr r r get_fieldss zBinanceCoin.get_fields)NN) __name__ __module__ __qualname__intstrr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/BinanceGetAddress.cpython-36.pyc000066400000000000000000000020561361427340300312260ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s:eZdZdZd eeeddddZee dddZ dS) BinanceGetAddressiN) address_n show_displayreturncCs|dk r |ng|_||_dS)N)rr )selfrr r `/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/BinanceGetAddress.py__init__szBinanceGetAddress.__init__)r cCsdtjtjfdtjdfdS)Nrr r)r)p UVarintType FLAG_REPEATEDBoolType)clsr r r get_fieldss zBinanceGetAddress.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErintboolr classmethodrrr r r r r s  rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/BinanceGetPublicKey.cpython-36.pyc000066400000000000000000000020661361427340300315310ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s:eZdZdZd eeeddddZee dddZ dS) BinanceGetPublicKeyiN) address_n show_displayreturncCs|dk r |ng|_||_dS)N)rr )selfrr r b/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/BinanceGetPublicKey.py__init__szBinanceGetPublicKey.__init__)r cCsdtjtjfdtjdfdS)Nrr r)r)p UVarintType FLAG_REPEATEDBoolType)clsr r r get_fieldss zBinanceGetPublicKey.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErintboolr classmethodrrr r r r r s  rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/BinanceInputOutput.cpython-36.pyc000066400000000000000000000020521361427340300315150ustar00rootroot000000000000003 ] @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf) BinanceCoin)DictList)Literalc@s6eZdZdeeeddddZeedddZ dS) BinanceInputOutputN)addresscoinsreturncCs||_|dk r|ng|_dS)N)r r )selfr r ra/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/BinanceInputOutput.py__init__szBinanceInputOutput.__init__)r cCsdtjdfdttjfdS)Nr rr )rr)p UnicodeTyper FLAG_REPEATED)clsrrr get_fieldss zBinanceInputOutput.get_fields)NN) __name__ __module__ __qualname__strrrr classmethodrrrrrrr s  r N) rrrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs  python-trezor-0.11.6/src/trezorlib/messages/__pycache__/BinanceOrderMsg.cpython-36.pyc000066400000000000000000000032361361427340300307240ustar00rootroot000000000000003 ]7 @spddlmZy8ddlmZmZddlmZed Zed Z ed Z Wne k rXYnXGdddej Z d S) )protobuf)DictList)Literalc @sBeZdZdZd eeeeeeeedd ddZ e e dddZ dS) BinanceOrderMsgiN) id ordertypepricequantitysendersidesymbol timeinforcereturnc Cs4||_||_||_||_||_||_||_||_dS)N)r r r r rrrr) selfr r r r rrrrr^/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/BinanceOrderMsg.py__init__s zBinanceOrderMsg.__init__)rcCshdtjdfdtjdddfdtjdfd tjdfd tjdfd tjd ddfd tjdfdtjdddfdS)Nr rr BinanceOrderTyperrrr r rrBinanceOrderSiderrBinanceTimeInForce)rrr)rrrr)rrr)rrrr)p UnicodeTypeEnumType SVarintType)clsrrr get_fields's     zBinanceOrderMsg.get_fields)NNNNNNNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEstrEnumTypeBinanceOrderTypeintEnumTypeBinanceOrderSideEnumTypeBinanceTimeInForcer classmethodrr$rrrrr s r N)rrrr)rrr)rrrr)rrtypingrrtyping_extensionsrr*r,r- ImportError MessageTyper rrrrs   python-trezor-0.11.6/src/trezorlib/messages/__pycache__/BinanceOrderSide.cpython-36.pyc000066400000000000000000000003511361427340300310550ustar00rootroot000000000000003 ]@sdZdZdZdS)N)Z SIDE_UNKNOWNZBUYZSELLrr_/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/BinanceOrderSide.pyspython-trezor-0.11.6/src/trezorlib/messages/__pycache__/BinanceOrderType.cpython-36.pyc000066400000000000000000000004031361427340300311100ustar00rootroot000000000000003 ]@sdZdZdZdZdS)N)Z OT_UNKNOWNZMARKETZLIMITZ OT_RESERVEDrr_/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/BinanceOrderType.pyspython-trezor-0.11.6/src/trezorlib/messages/__pycache__/BinancePublicKey.cpython-36.pyc000066400000000000000000000016701361427340300310710ustar00rootroot000000000000003 ]1 @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) BinancePublicKeyiN) public_keyreturncCs ||_dS)N)r)selfrr _/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/BinancePublicKey.py__init__szBinancePublicKey.__init__)r cCsddtjdfiS)Nrr)p BytesType)clsr r r get_fieldsszBinancePublicKey.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEbytesr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/BinanceSignTx.cpython-36.pyc000066400000000000000000000024751361427340300304220ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc @sDeZdZdZd eeeeeeeeddddZee dddZ dS) BinanceSignTxiN) address_n msg_countaccount_numberchain_idmemosequencesourcereturncCs:|dk r |ng|_||_||_||_||_||_||_dS)N)rr r r r r r)selfrr r r r r rr\/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/BinanceSignTx.py__init__s zBinanceSignTx.__init__)rc CsNdtjtjfdtjdfdtjdfdtjdfdtjdfdtjdfdtjdfd S) Nrr rr r r r r)r)p UVarintType FLAG_REPEATED SVarintType UnicodeType)clsrrr get_fields"s      zBinanceSignTx.get_fields)NNNNNNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErintstrr classmethodrr rrrrr s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/BinanceSignedTx.cpython-36.pyc000066400000000000000000000017561361427340300307340ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s6eZdZdZd eeddddZeedddZdS) BinanceSignedTxiN) signature public_keyreturncCs||_||_dS)N)rr )selfrr r ^/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/BinanceSignedTx.py__init__szBinanceSignedTx.__init__)r cCsdtjdfdtjdfdS)Nrrr )r)p BytesType)clsr r r get_fieldss zBinanceSignedTx.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEbytesr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/BinanceTimeInForce.cpython-36.pyc000066400000000000000000000004021361427340300313360ustar00rootroot000000000000003 ]@sdZdZdZdZdS)N)Z TIF_UNKNOWNZGTEZ TIF_RESERVEDZIOCrra/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/BinanceTimeInForce.pyspython-trezor-0.11.6/src/trezorlib/messages/__pycache__/BinanceTransferMsg.cpython-36.pyc000066400000000000000000000021111361427340300314240ustar00rootroot000000000000003 ]N @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf)BinanceInputOutput)DictList)Literalc@s>eZdZdZd eeeeddddZeedddZ dS) BinanceTransferMsgiN)inputsoutputsreturncCs(|dk r |ng|_|dk r|ng|_dS)N)r r )selfr r ra/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/BinanceTransferMsg.py__init__szBinanceTransferMsg.__init__)r cCsdttjfdttjfdS)Nr r )rr)rp FLAG_REPEATED)clsrrr get_fieldss zBinanceTransferMsg.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErrr classmethodrrrrrrr s r N) rrrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs  python-trezor-0.11.6/src/trezorlib/messages/__pycache__/BinanceTxRequest.cpython-36.pyc000066400000000000000000000010671361427340300311460ustar00rootroot000000000000003 ]= @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@seZdZdZdS)BinanceTxRequestiN)__name__ __module__ __qualname__MESSAGE_WIRE_TYPEr r _/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/BinanceTxRequest.pyr srN) rptypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/ButtonAck.cpython-36.pyc000066400000000000000000000010511361427340300276050ustar00rootroot000000000000003 ]5 @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@seZdZdZdS) ButtonAckN)__name__ __module__ __qualname__MESSAGE_WIRE_TYPEr r X/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/ButtonAck.pyr srN) rptypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/ButtonRequest.cpython-36.pyc000066400000000000000000000025031361427340300305420ustar00rootroot000000000000003 ]@s`ddlmZy(ddlmZmZddlmZedZWne k rHYnXGdddej Z dS))protobuf)DictList)Literal c@s4eZdZdZd eddddZeedddZdS) ButtonRequestN)codereturncCs ||_dS)N)r)selfrr\/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/ButtonRequest.py__init__szButtonRequest.__init__)rcCsddtjdddfiS)NrrButtonRequestTyperrr r r r r rrrrrrrrrrr)rrrr r r r r rrrrrrrrrr)pEnumType)clsrrr get_fieldsszButtonRequest.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEEnumTypeButtonRequestTyper classmethodrr$rrrrrs rN)rrrr r r r r rrrrrrrrrr) rr!typingrrtyping_extensionsrr) ImportError MessageTyperrrrrs   python-trezor-0.11.6/src/trezorlib/messages/__pycache__/ButtonRequestType.cpython-36.pyc000066400000000000000000000011511361427340300314020ustar00rootroot000000000000003 ]@sLdZdZdZdZdZdZdZdZdZd Z d Z d Z d Z d Z dZdZdZdZdS) N)ZOtherZFeeOverThresholdZ ConfirmOutput ResetDeviceZ ConfirmWord WipeDeviceZ ProtectCallSignTxZ FirmwareCheckAddress PublicKeyZMnemonicWordCountZ MnemonicInputZPassphraseTypeZUnknownDerivationPathZRecoveryHomepageSuccessWarningrr`/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/ButtonRequestType.pys$python-trezor-0.11.6/src/trezorlib/messages/__pycache__/Cancel.cpython-36.pyc000066400000000000000000000010431361427340300271010ustar00rootroot000000000000003 ]2 @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@seZdZdZdS)CancelN)__name__ __module__ __qualname__MESSAGE_WIRE_TYPEr r U/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/Cancel.pyr srN) rptypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/Capability.cpython-36.pyc000066400000000000000000000007371361427340300300060ustar00rootroot000000000000003 ]g@sDdZdZdZdZdZdZdZdZdZd Z d Z d Z d Z d Z dZdZdS) N)ZBitcoinZ Bitcoin_likeZBinanceZCardanoZCryptoZEOSZEthereumZLiskZMoneroZNEMZRippleZStellarZTezosZU2FZShamirZ ShamirGroupsrrY/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/Capability.pys python-trezor-0.11.6/src/trezorlib/messages/__pycache__/CardanoAddress.cpython-36.pyc000066400000000000000000000016551361427340300306020ustar00rootroot000000000000003 ]# @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) CardanoAddressi4N)addressreturncCs ||_dS)N)r)selfrr ]/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/CardanoAddress.py__init__szCardanoAddress.__init__)r cCsddtjdfiS)Nrr)p UnicodeType)clsr r r get_fieldsszCardanoAddress.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEstrr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/CardanoGetAddress.cpython-36.pyc000066400000000000000000000020561361427340300312360ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s:eZdZdZd eeeddddZee dddZ dS) CardanoGetAddressi3N) address_n show_displayreturncCs|dk r |ng|_||_dS)N)rr )selfrr r `/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/CardanoGetAddress.py__init__szCardanoGetAddress.__init__)r cCsdtjtjfdtjdfdS)Nrr r)r)p UVarintType FLAG_REPEATEDBoolType)clsr r r get_fieldss zCardanoGetAddress.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErintboolr classmethodrrr r r r r s  rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/CardanoGetPublicKey.cpython-36.pyc000066400000000000000000000020661361427340300315410ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s:eZdZdZd eeeddddZee dddZ dS) CardanoGetPublicKeyi1N) address_n show_displayreturncCs|dk r |ng|_||_dS)N)rr )selfrr r b/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/CardanoGetPublicKey.py__init__szCardanoGetPublicKey.__init__)r cCsdtjtjfdtjdfdS)Nrr r)r)p UVarintType FLAG_REPEATEDBoolType)clsr r r get_fieldss zCardanoGetPublicKey.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErintboolr classmethodrrr r r r r s  rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/CardanoPublicKey.cpython-36.pyc000066400000000000000000000020251361427340300310740ustar00rootroot000000000000003 ] @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf) HDNodeType)DictList)Literalc@s6eZdZdZd eeddddZeedddZ dS) CardanoPublicKeyi2N)xpubnodereturncCs||_||_dS)N)r r )selfr r r_/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/CardanoPublicKey.py__init__szCardanoPublicKey.__init__)r cCsdtjdfdtdfdS)Nr rr )rr)p UnicodeTyper)clsrrr get_fieldss zCardanoPublicKey.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEstrrr classmethodrrrrrrr s r N) rrrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs  python-trezor-0.11.6/src/trezorlib/messages/__pycache__/CardanoSignTx.cpython-36.pyc000066400000000000000000000023761361427340300304320ustar00rootroot000000000000003 ] @spddlmZddlmZddlmZy ddlmZmZddlm Z Wne k rXYnXGdd d ej Z d S) )protobuf)CardanoTxInputType)CardanoTxOutputType)DictList)Literalc@sBeZdZdZd eeeeeeddddZe e dddZ dS) CardanoSignTxi/N)inputsoutputstransactions_countprotocol_magicreturncCs4|dk r |ng|_|dk r|ng|_||_||_dS)N)r r r r)selfr r r rr\/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/CardanoSignTx.py__init__szCardanoSignTx.__init__)rcCs.dttjfdttjfdtjdfdtjdfdS)Nr r r rr)rr)rp FLAG_REPEATEDr UVarintType)clsrrr get_fieldss   zCardanoSignTx.get_fields)NNNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErrrintr classmethodrrrrrrr sr N) rrrrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs   python-trezor-0.11.6/src/trezorlib/messages/__pycache__/CardanoSignedTx.cpython-36.pyc000066400000000000000000000017511361427340300307370ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s6eZdZdZd eeddddZeedddZdS) CardanoSignedTxi6N)tx_hashtx_bodyreturncCs||_||_dS)N)rr )selfrr r ^/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/CardanoSignedTx.py__init__szCardanoSignedTx.__init__)r cCsdtjdfdtjdfdS)Nrrr )r)p BytesType)clsr r r get_fieldss zCardanoSignedTx.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEbytesr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/CardanoTxAck.cpython-36.pyc000066400000000000000000000016511361427340300302230ustar00rootroot000000000000003 ]1 @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) CardanoTxAcki5N) transactionreturncCs ||_dS)N)r)selfrr [/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/CardanoTxAck.py__init__szCardanoTxAck.__init__)r cCsddtjdfiS)Nrr)p BytesType)clsr r r get_fieldsszCardanoTxAck.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEbytesr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/CardanoTxInputType.cpython-36.pyc000066400000000000000000000021771361427340300314720ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s:eZdZdeeeeeddddZeedddZ dS) CardanoTxInputTypeN) address_n prev_hash prev_indextypereturncCs(|dk r |ng|_||_||_||_dS)N)rr r r )selfrr r r ra/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/CardanoTxInputType.py__init__szCardanoTxInputType.__init__)r cCs0dtjtjfdtjdfdtjdfdtjdfdS)Nrr rr r )r)p UVarintType FLAG_REPEATED BytesType)clsrrr get_fieldss   zCardanoTxInputType.get_fields)NNNN) __name__ __module__ __qualname__rintbytesr classmethodrrrrrrr srN) rrtypingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/CardanoTxOutputType.cpython-36.pyc000066400000000000000000000021121361427340300316600ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s8eZdZdeeeeddddZeedddZ dS) CardanoTxOutputTypeN)address address_namountreturncCs"||_|dk r|ng|_||_dS)N)rr r )selfrr r r b/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/CardanoTxOutputType.py__init__szCardanoTxOutputType.__init__)r cCs&dtjdfdtjtjfdtjdfdS)Nrrr r )r)p UnicodeType UVarintType FLAG_REPEATED)clsr r r get_fieldss  zCardanoTxOutputType.get_fields)NNN) __name__ __module__ __qualname__strrintr classmethodrrr r r rr s  rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/CardanoTxRequest.cpython-36.pyc000066400000000000000000000020661361427340300311560ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s8eZdZdZd eeeddddZeedddZ dS) CardanoTxRequesti0N)tx_indextx_hashtx_bodyreturncCs||_||_||_dS)N)rr r )selfrr r r _/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/CardanoTxRequest.py__init__szCardanoTxRequest.__init__)r cCs$dtjdfdtjdfdtjdfdS)Nrrr r )r)p UVarintType BytesType)clsr r r get_fieldss  zCardanoTxRequest.get_fields)NNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEintbytesr classmethodrrr r r rr srN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/ChangePin.cpython-36.pyc000066400000000000000000000016261361427340300275570ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) ChangePinN)removereturncCs ||_dS)N)r )selfr r X/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/ChangePin.py__init__szChangePin.__init__)r cCsddtjdfiS)Nr r)pBoolType)clsr r r get_fieldsszChangePin.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEboolr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/ChangeWipeCode.cpython-36.pyc000066400000000000000000000016521361427340300305270ustar00rootroot000000000000003 ʵ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) ChangeWipeCodeRN)removereturncCs ||_dS)N)r )selfr r ]/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/ChangeWipeCode.py__init__szChangeWipeCode.__init__)r cCsddtjdfiS)Nr r)pBoolType)clsr r r get_fieldsszChangeWipeCode.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEboolr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/CipherKeyValue.cpython-36.pyc000066400000000000000000000025221361427340300305770ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc @sDeZdZdZd eeeeeeeeddddZ e e dddZ dS) CipherKeyValueN) address_nkeyvalueencryptask_on_encryptask_on_decryptivreturncCs:|dk r |ng|_||_||_||_||_||_||_dS)N)r r r r r rr)selfr r r r r rrr]/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/CipherKeyValue.py__init__s zCipherKeyValue.__init__)rc CsNdtjtjfdtjdfdtjdfdtjdfdtjdfdtjdfdtjdfd S) Nr r rr r r rr)r)p UVarintType FLAG_REPEATED UnicodeType BytesTypeBoolType)clsrrr get_fields"s      zCipherKeyValue.get_fields)NNNNNNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErintstrbytesboolr classmethodrr"rrrrr s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/CipheredKeyValue.cpython-36.pyc000066400000000000000000000016631361427340300311150ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) CipheredKeyValue0N)valuereturncCs ||_dS)N)r )selfr r _/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/CipheredKeyValue.py__init__szCipheredKeyValue.__init__)r cCsddtjdfiS)Nr r)p BytesType)clsr r r get_fieldsszCipheredKeyValue.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEbytesr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/ClearSession.cpython-36.pyc000066400000000000000000000010571361427340300303130ustar00rootroot000000000000003 ]8 @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@seZdZdZdS) ClearSessionN)__name__ __module__ __qualname__MESSAGE_WIRE_TYPEr r [/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/ClearSession.pyr srN) rptypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/CosiCommit.cpython-36.pyc000066400000000000000000000020141361427340300277610ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s:eZdZdZd eeeddddZee dddZ dS) CosiCommitGN) address_ndatareturncCs|dk r |ng|_||_dS)N)r r )selfr r r Y/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/CosiCommit.py__init__szCosiCommit.__init__)r cCsdtjtjfdtjdfdS)Nr r r)r)p UVarintType FLAG_REPEATED BytesType)clsr r r get_fieldss zCosiCommit.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErintbytesr classmethodrrr r r rr s  rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/CosiCommitment.cpython-36.pyc000066400000000000000000000017471361427340300306610ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s6eZdZdZd eeddddZeedddZdS) CosiCommitmentHN) commitmentpubkeyreturncCs||_||_dS)N)r r )selfr r r ]/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/CosiCommitment.py__init__szCosiCommitment.__init__)r cCsdtjdfdtjdfdS)Nr rr )r)p BytesType)clsr r r get_fieldss zCosiCommitment.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEbytesr classmethodrrr r r rr s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/CosiSign.cpython-36.pyc000066400000000000000000000022001361427340300274260ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s>eZdZdZd eeeeeddddZee dddZ dS) CosiSignIN) address_ndataglobal_commitment global_pubkeyreturncCs(|dk r |ng|_||_||_||_dS)N)r r r r )selfr r r r rW/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/CosiSign.py__init__szCosiSign.__init__)r cCs0dtjtjfdtjdfdtjdfdtjdfdS)Nr r rr r )r)p UVarintType FLAG_REPEATED BytesType)clsrrr get_fieldss   zCosiSign.get_fields)NNNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErintbytesr classmethodrrrrrrr srN) rrtypingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/CosiSignature.cpython-36.pyc000066400000000000000000000016531361427340300305020ustar00rootroot000000000000003 ]) @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) CosiSignatureJN) signaturereturncCs ||_dS)N)r )selfr r \/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/CosiSignature.py__init__szCosiSignature.__init__)r cCsddtjdfiS)Nr r)p BytesType)clsr r r get_fieldsszCosiSignature.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEbytesr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/DebugLinkDecision.cpython-36.pyc000066400000000000000000000025551361427340300312470ustar00rootroot000000000000003 ]X @s`ddlmZy(ddlmZmZddlmZed ZWne k rHYnXGdddej Z d S) )protobuf)DictList)Literalc @s>eZdZdZd eeeeeeddddZe e dddZ dS) DebugLinkDecisiondN)yes_noswipeinputxywaitreturncCs(||_||_||_||_||_||_dS)N)r r r rrr)selfr r r rrrr`/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/DebugLinkDecision.py__init__s zDebugLinkDecision.__init__)rcCsHdtjdfdtjdd dfdtjdfd tjdfd tjdfd tjdfd S)Nr rr DebugSwipeDirectionrrrr rrr)rrr)rrrr)pBoolTypeEnumType UnicodeType UVarintType)clsrrr get_fields!s     zDebugLinkDecision.get_fields)NNNNNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEboolEnumTypeDebugSwipeDirectionstrintr classmethodrr rrrrr sr N)rrrr) rrtypingrrtyping_extensionsrr& ImportError MessageTyper rrrrs   python-trezor-0.11.6/src/trezorlib/messages/__pycache__/DebugLinkFlashErase.cpython-36.pyc000066400000000000000000000017001361427340300315160ustar00rootroot000000000000003 ]$ @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) DebugLinkFlashEraseqN)sectorreturncCs ||_dS)N)r )selfr r b/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/DebugLinkFlashErase.py__init__szDebugLinkFlashErase.__init__)r cCsddtjdfiS)Nr r)p UVarintType)clsr r r get_fieldsszDebugLinkFlashErase.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEintr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/DebugLinkGetState.cpython-36.pyc000066400000000000000000000020661361427340300312270ustar00rootroot000000000000003 ]8 @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s8eZdZdZd eeeddddZeedddZdS) DebugLinkGetStateeN)wait_word_list wait_word_pos wait_layoutreturncCs||_||_||_dS)N)r r r )selfr r r r`/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/DebugLinkGetState.py__init__szDebugLinkGetState.__init__)r cCs$dtjdfdtjdfdtjdfdS)Nr rr r )r)pBoolType)clsrrr get_fieldss  zDebugLinkGetState.get_fields)NNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEboolr classmethodrrrrrrr srN) rrtypingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/DebugLinkLayout.cpython-36.pyc000066400000000000000000000017201361427340300307600ustar00rootroot000000000000003 ]N @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s8eZdZdZd eeddddZeedddZ dS) DebugLinkLayouti)#N)linesreturncCs|dk r |ng|_dS)N)r)selfrr ^/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/DebugLinkLayout.py__init__szDebugLinkLayout.__init__)r cCsddtjtjfiS)Nr)p UnicodeType FLAG_REPEATED)clsr r r get_fieldsszDebugLinkLayout.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErstrr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/DebugLinkLog.cpython-36.pyc000066400000000000000000000020371361427340300302260ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s8eZdZdZd eeeddddZeedddZ dS) DebugLinkLoghN)levelbuckettextreturncCs||_||_||_dS)N)r r r )selfr r r r[/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/DebugLinkLog.py__init__szDebugLinkLog.__init__)r cCs$dtjdfdtjdfdtjdfdS)Nr rr r )r)p UVarintType UnicodeType)clsrrr get_fieldss  zDebugLinkLog.get_fields)NNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEintstrr classmethodrrrrrrr srN) rrtypingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/DebugLinkMemory.cpython-36.pyc000066400000000000000000000016601361427340300307560ustar00rootroot000000000000003 ]  @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) DebugLinkMemoryoN)memoryreturncCs ||_dS)N)r )selfr r ^/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/DebugLinkMemory.py__init__szDebugLinkMemory.__init__)r cCsddtjdfiS)Nr r)p BytesType)clsr r r get_fieldsszDebugLinkMemory.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEbytesr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/DebugLinkMemoryRead.cpython-36.pyc000066400000000000000000000017701361427340300315540ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s6eZdZdZd eeddddZeedddZdS) DebugLinkMemoryReadnN)addresslengthreturncCs||_||_dS)N)r r )selfr r r b/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/DebugLinkMemoryRead.py__init__szDebugLinkMemoryRead.__init__)r cCsdtjdfdtjdfdS)Nr rr )r)p UVarintType)clsr r r get_fieldss zDebugLinkMemoryRead.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEintr classmethodrrr r r rr s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/DebugLinkMemoryWrite.cpython-36.pyc000066400000000000000000000021221361427340300317630ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s8eZdZdZd eeeddddZee dddZ dS) DebugLinkMemoryWritepN)addressmemoryflashreturncCs||_||_||_dS)N)r r r )selfr r r rc/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/DebugLinkMemoryWrite.py__init__szDebugLinkMemoryWrite.__init__)r cCs$dtjdfdtjdfdtjdfdS)Nr rr r )r)p UVarintType BytesTypeBoolType)clsrrr get_fieldss  zDebugLinkMemoryWrite.get_fields)NNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEintbytesboolr classmethodrrrrrrr srN) rrtypingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/DebugLinkState.cpython-36.pyc000066400000000000000000000033741361427340300305720ustar00rootroot000000000000003 ]q @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf) HDNodeType)DictList)Literalc@sPeZdZdZd eeeeeeeeeeeee eddddZ e e dddZ dS) DebugLinkStatefN)layoutpinmatrixmnemonic_secretnodepassphrase_protection reset_word reset_entropyrecovery_fake_wordrecovery_word_posreset_word_pos mnemonic_type layout_linesreturncCs^||_||_||_||_||_||_||_||_| |_| |_ | |_ | |_ | dk rT| ng|_ dS)N) r r r rrrrrrrrrr)selfr r r rrrrrrrrrrr]/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/DebugLinkState.py__init__szDebugLinkState.__init__)rcCsdtjdfdtjdfdtjdfdtjdfdtdfdtjdfdtjdfd tjdfd tjdfd tjdfd tjdfd tjdfdtjtjfd S)Nr rr r rrrrrrrrrr) rr )p BytesType UnicodeTyperBoolType UVarintType FLAG_REPEATED)clsrrr get_fields0s           zDebugLinkState.get_fields) NNNNNNNNNNNNN)__name__ __module__ __qualname__MESSAGE_WIRE_TYPEbytesstrrboolintrr classmethodrr/rrrrr s" r N) rr(rtypingrrtyping_extensionsr ImportError MessageTyper rrrrs  python-trezor-0.11.6/src/trezorlib/messages/__pycache__/DebugLinkStop.cpython-36.pyc000066400000000000000000000010611361427340300304260ustar00rootroot000000000000003 ]: @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@seZdZdZdS) DebugLinkStopgN)__name__ __module__ __qualname__MESSAGE_WIRE_TYPEr r \/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/DebugLinkStop.pyr srN) rptypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/DebugMoneroDiagAck.cpython-36.pyc000066400000000000000000000023561361427340300313360ustar00rootroot000000000000003 ]  @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc @sBeZdZdZd eeeeeeeddddZee dddZ dS) DebugMoneroDiagAcki#N)insp1p2pddata1data2returncCs4||_||_||_|dk r|ng|_||_||_dS)N)rr r r r r )selfrr r r r r ra/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/DebugMoneroDiagAck.py__init__s zDebugMoneroDiagAck.__init__)rcCsDdtjdfdtjdfdtjdfdtjtjfdtjdfdtjdfdS) Nrrr r r r r )r)p UVarintType FLAG_REPEATED BytesType)clsrrr get_fields s      zDebugMoneroDiagAck.get_fields)NNNNNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEintrbytesr classmethodrrrrrrr srN) rrtypingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/DebugMoneroDiagRequest.cpython-36.pyc000066400000000000000000000023761361427340300322720ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc @sBeZdZdZd eeeeeeeddddZee dddZ dS) DebugMoneroDiagRequesti"N)insp1p2pddata1data2returncCs4||_||_||_|dk r|ng|_||_||_dS)N)rr r r r r )selfrr r r r r re/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/DebugMoneroDiagRequest.py__init__s zDebugMoneroDiagRequest.__init__)rcCsDdtjdfdtjdfdtjdfdtjtjfdtjdfdtjdfdS) Nrrr r r r r )r)p UVarintType FLAG_REPEATED BytesType)clsrrr get_fields s      z!DebugMoneroDiagRequest.get_fields)NNNNNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEintrbytesr classmethodrrrrrrr srN) rrtypingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/DebugSwipeDirection.cpython-36.pyc000066400000000000000000000003651361427340300316210ustar00rootroot000000000000003 ]@sdZdZdZdZdS)N)ZUPZDOWNZLEFTZRIGHTrrb/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/DebugSwipeDirection.pyspython-trezor-0.11.6/src/trezorlib/messages/__pycache__/ECDHSessionKey.cpython-36.pyc000066400000000000000000000016611361427340300304420ustar00rootroot000000000000003 ]2 @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) ECDHSessionKey>N) session_keyreturncCs ||_dS)N)r )selfr r ]/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/ECDHSessionKey.py__init__szECDHSessionKey.__init__)r cCsddtjdfiS)Nr r)p BytesType)clsr r r get_fieldsszECDHSessionKey.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEbytesr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/Entropy.cpython-36.pyc000066400000000000000000000016211361427340300273560ustar00rootroot000000000000003 ]' @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) Entropy N)entropyreturncCs ||_dS)N)r )selfr r V/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/Entropy.py__init__szEntropy.__init__)r cCsddtjdfiS)Nr r)p BytesType)clsr r r get_fieldsszEntropy.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEbytesr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/EntropyAck.cpython-36.pyc000066400000000000000000000016351361427340300300020ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) EntropyAck$N)entropyreturncCs ||_dS)N)r )selfr r Y/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/EntropyAck.py__init__szEntropyAck.__init__)r cCsddtjdfiS)Nr r)p BytesType)clsr r r get_fieldsszEntropyAck.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEbytesr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/EntropyRequest.cpython-36.pyc000066400000000000000000000010631361427340300307270ustar00rootroot000000000000003 ]: @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@seZdZdZdS)EntropyRequest#N)__name__ __module__ __qualname__MESSAGE_WIRE_TYPEr r ]/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/EntropyRequest.pyr srN) rptypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/EosActionBuyRam.cpython-36.pyc000066400000000000000000000020551361427340300307240ustar00rootroot000000000000003 ] @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf)EosAsset)DictList)Literalc@s4eZdZdeeeddddZeedddZdS) EosActionBuyRamN)payerreceiverquantityreturncCs||_||_||_dS)N)r r r )selfr r r r^/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/EosActionBuyRam.py__init__szEosActionBuyRam.__init__)r cCs"dtjdfdtjdfdtdfdS)Nr rr r )rr)p UVarintTyper)clsrrr get_fieldss  zEosActionBuyRam.get_fields)NNN) __name__ __module__ __qualname__intrr classmethodrrrrrrr s r N) rrrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs  python-trezor-0.11.6/src/trezorlib/messages/__pycache__/EosActionBuyRamBytes.cpython-36.pyc000066400000000000000000000020221361427340300317250ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdeeeddddZeedddZdS) EosActionBuyRamBytesN)payerreceiverbytesreturncCs||_||_||_dS)N)rr r )selfrr r r c/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/EosActionBuyRamBytes.py__init__szEosActionBuyRamBytes.__init__)r cCs$dtjdfdtjdfdtjdfdS)Nrrr r )r)p UVarintType)clsr r r get_fieldss  zEosActionBuyRamBytes.get_fields)NNN)__name__ __module__ __qualname__intr classmethodrrr r r rr s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/EosActionCommon.cpython-36.pyc000066400000000000000000000021401361427340300307500ustar00rootroot000000000000003 ]i @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf)EosPermissionLevel)DictList)Literalc@s8eZdZdeeeeddddZeedddZ dS) EosActionCommonN)accountname authorizationreturncCs"||_||_|dk r|ng|_dS)N)r r r )selfr r r r^/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/EosActionCommon.py__init__szEosActionCommon.__init__)r cCs$dtjdfdtjdfdttjfdS)Nr rr r )rr)p UVarintTyper FLAG_REPEATED)clsrrr get_fieldss  zEosActionCommon.get_fields)NNN) __name__ __module__ __qualname__intrrr classmethodrrrrrrr s  r N) rrrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs  python-trezor-0.11.6/src/trezorlib/messages/__pycache__/EosActionDelegate.cpython-36.pyc000066400000000000000000000022721361427340300312400ustar00rootroot000000000000003 ] @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf)EosAsset)DictList)Literalc@s8eZdZdeeeeeddddZeedddZ dS) EosActionDelegateN)senderreceiver net_quantity cpu_quantitytransferreturncCs"||_||_||_||_||_dS)N)r r r r r)selfr r r r rr`/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/EosActionDelegate.py__init__s zEosActionDelegate.__init__)rcCs4dtjdfdtjdfdtdfdtdfdtjdfdS)Nr rr r r r)rr)p UVarintTyperBoolType)clsrrr get_fieldss   zEosActionDelegate.get_fields)NNNNN) __name__ __module__ __qualname__intrboolr classmethodrrrrrrr s r N) rrrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs  python-trezor-0.11.6/src/trezorlib/messages/__pycache__/EosActionDeleteAuth.cpython-36.pyc000066400000000000000000000017361361427340300315560ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s2eZdZdeeddddZeedddZdS) EosActionDeleteAuthN)account permissionreturncCs||_||_dS)N)rr )selfrr r b/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/EosActionDeleteAuth.py__init__szEosActionDeleteAuth.__init__)r cCsdtjdfdtjdfdS)Nrrr )r)p UVarintType)clsr r r get_fieldss zEosActionDeleteAuth.get_fields)NN)__name__ __module__ __qualname__intr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/EosActionLinkAuth.cpython-36.pyc000066400000000000000000000020751361427340300312460ustar00rootroot000000000000003 ]@ @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s6eZdZdeeeeddddZeedddZdS) EosActionLinkAuthN)accountcodetype requirementreturncCs||_||_||_||_dS)N)rr r r )selfrr r r r`/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/EosActionLinkAuth.py__init__szEosActionLinkAuth.__init__)r cCs.dtjdfdtjdfdtjdfdtjdfdS)Nrrr r r )r)p UVarintType)clsrrr get_fieldss   zEosActionLinkAuth.get_fields)NNNN)__name__ __module__ __qualname__intr classmethodrrrrrrr s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/EosActionNewAccount.cpython-36.pyc000066400000000000000000000021631361427340300315730ustar00rootroot000000000000003 ] @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf)EosAuthorization)DictList)Literalc@s6eZdZdeeeeddddZeedddZdS) EosActionNewAccountN)creatornameowneractivereturncCs||_||_||_||_dS)N)r r r r )selfr r r r rb/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/EosActionNewAccount.py__init__szEosActionNewAccount.__init__)rcCs*dtjdfdtjdfdtdfdtdfdS)Nr rr r r )rr)p UVarintTyper)clsrrr get_fieldss  zEosActionNewAccount.get_fields)NNNN) __name__ __module__ __qualname__intrr classmethodrrrrrrr s r N) rrrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs  python-trezor-0.11.6/src/trezorlib/messages/__pycache__/EosActionRefund.cpython-36.pyc000066400000000000000000000016211361427340300307460ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s0eZdZdeddddZeedddZdS) EosActionRefundN)ownerreturncCs ||_dS)N)r)selfrr ^/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/EosActionRefund.py__init__szEosActionRefund.__init__)r cCsddtjdfiS)Nrr)p UVarintType)clsr r r get_fieldsszEosActionRefund.get_fields)N)__name__ __module__ __qualname__intr classmethodrrr r r r r srN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/EosActionSellRam.cpython-36.pyc000066400000000000000000000017151361427340300310660ustar00rootroot000000000000003 ]k @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s2eZdZdeeddddZeedddZdS) EosActionSellRamN)accountbytesreturncCs||_||_dS)N)rr )selfrr r _/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/EosActionSellRam.py__init__szEosActionSellRam.__init__)r cCsdtjdfdtjdfdS)Nrrr )r)p UVarintType)clsr r r get_fieldss zEosActionSellRam.get_fields)NN)__name__ __module__ __qualname__intr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/EosActionTransfer.cpython-36.pyc000066400000000000000000000021731361427340300313120ustar00rootroot000000000000003 ]` @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf)EosAsset)DictList)Literalc@s6eZdZdeeeeddddZeedddZ dS) EosActionTransferN)senderreceiverquantitymemoreturncCs||_||_||_||_dS)N)r r r r )selfr r r r r`/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/EosActionTransfer.py__init__szEosActionTransfer.__init__)rcCs,dtjdfdtjdfdtdfdtjdfdS)Nr rr r r )rr)p UVarintTyper UnicodeType)clsrrr get_fieldss  zEosActionTransfer.get_fields)NNNN) __name__ __module__ __qualname__intrstrr classmethodrrrrrrr s r N) rrrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs  python-trezor-0.11.6/src/trezorlib/messages/__pycache__/EosActionUndelegate.cpython-36.pyc000066400000000000000000000021731361427340300316030ustar00rootroot000000000000003 ] @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf)EosAsset)DictList)Literalc@s6eZdZdeeeeddddZeedddZdS) EosActionUndelegateN)senderreceiver net_quantity cpu_quantityreturncCs||_||_||_||_dS)N)r r r r )selfr r r r rb/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/EosActionUndelegate.py__init__szEosActionUndelegate.__init__)rcCs*dtjdfdtjdfdtdfdtdfdS)Nr rr r r )rr)p UVarintTyper)clsrrr get_fieldss  zEosActionUndelegate.get_fields)NNNN) __name__ __module__ __qualname__intrr classmethodrrrrrrr s r N) rrrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs  python-trezor-0.11.6/src/trezorlib/messages/__pycache__/EosActionUnknown.cpython-36.pyc000066400000000000000000000017461361427340300311720ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s2eZdZdeeddddZeedddZdS) EosActionUnknownN) data_size data_chunkreturncCs||_||_dS)N)rr )selfrr r _/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/EosActionUnknown.py__init__szEosActionUnknown.__init__)r cCsdtjdfdtjdfdS)Nrrr )r)p UVarintType BytesType)clsr r r get_fieldss zEosActionUnknown.get_fields)NN) __name__ __module__ __qualname__intbytesr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/EosActionUnlinkAuth.cpython-36.pyc000066400000000000000000000020131361427340300316010ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdeeeddddZeedddZdS) EosActionUnlinkAuthN)accountcodetypereturncCs||_||_||_dS)N)rr r )selfrr r r b/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/EosActionUnlinkAuth.py__init__szEosActionUnlinkAuth.__init__)r cCs$dtjdfdtjdfdtjdfdS)Nrrr r )r)p UVarintType)clsr r r get_fieldss  zEosActionUnlinkAuth.get_fields)NNN)__name__ __module__ __qualname__intr classmethodrrr r r rr s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/EosActionUpdateAuth.cpython-36.pyc000066400000000000000000000021721361427340300315710ustar00rootroot000000000000003 ] @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf)EosAuthorization)DictList)Literalc@s6eZdZdeeeeddddZeedddZdS) EosActionUpdateAuthN)account permissionparentauthreturncCs||_||_||_||_dS)N)r r r r )selfr r r r rb/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/EosActionUpdateAuth.py__init__szEosActionUpdateAuth.__init__)rcCs,dtjdfdtjdfdtjdfdtdfdS)Nr rr r r )rr)p UVarintTyper)clsrrr get_fieldss   zEosActionUpdateAuth.get_fields)NNNN) __name__ __module__ __qualname__intrr classmethodrrrrrrr s r N) rrrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs  python-trezor-0.11.6/src/trezorlib/messages/__pycache__/EosActionVoteProducer.cpython-36.pyc000066400000000000000000000020751361427340300321500ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s8eZdZdeeeeddddZeedddZdS) EosActionVoteProducerN)voterproxy producersreturncCs"||_||_|dk r|ng|_dS)N)rr r )selfrr r r d/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/EosActionVoteProducer.py__init__szEosActionVoteProducer.__init__)r cCs&dtjdfdtjdfdtjtjfdS)Nrrr r )r)p UVarintType FLAG_REPEATED)clsr r r get_fieldss  z EosActionVoteProducer.get_fields)NNN) __name__ __module__ __qualname__intrr classmethodrrr r r rr s  rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/EosAsset.cpython-36.pyc000066400000000000000000000016721361427340300274520ustar00rootroot000000000000003 ]c @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s2eZdZdeeddddZeedddZdS) EosAssetN)amountsymbolreturncCs||_||_dS)N)rr )selfrr r W/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/EosAsset.py__init__szEosAsset.__init__)r cCsdtjdfdtjdfdS)Nrrr )r)p SVarintType UVarintType)clsr r r get_fieldss zEosAsset.get_fields)NN)__name__ __module__ __qualname__intr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/EosAuthorization.cpython-36.pyc000066400000000000000000000024431361427340300312300ustar00rootroot000000000000003 ] @s|ddlmZddlmZddlmZddlmZy ddlmZmZddl m Z Wne k rdYnXGd d d ej Z d S) )protobuf)EosAuthorizationAccount)EosAuthorizationKey)EosAuthorizationWait)DictList)Literalc@sBeZdZdeeeeeeeddddZe e dddZ dS) EosAuthorizationN) thresholdkeysaccountswaitsreturncCs@||_|dk r|ng|_|dk r$|ng|_|dk r6|ng|_dS)N)r r rr)selfr r rrr_/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/EosAuthorization.py__init__szEosAuthorization.__init__)rcCs.dtjdfdttjfdttjfdttjfdS)Nr rr rr)rr)p UVarintTyper FLAG_REPEATEDrr)clsrrr get_fieldss   zEosAuthorization.get_fields)NNNN) __name__ __module__ __qualname__intr rrrr classmethodrrrrrrr sr N)rrrrrtypingrr typing_extensionsr ImportError MessageTyper rrrrs    python-trezor-0.11.6/src/trezorlib/messages/__pycache__/EosAuthorizationAccount.cpython-36.pyc000066400000000000000000000020401361427340300325360ustar00rootroot000000000000003 ] @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf)EosPermissionLevel)DictList)Literalc@s2eZdZdeeddddZeedddZdS) EosAuthorizationAccountN)accountweightreturncCs||_||_dS)N)r r )selfr r rf/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/EosAuthorizationAccount.py__init__sz EosAuthorizationAccount.__init__)r cCsdtdfdtjdfdS)Nr rr )rr)rp UVarintType)clsrrr get_fieldssz"EosAuthorizationAccount.get_fields)NN) __name__ __module__ __qualname__rintr classmethodrrrrrrr s r N) rrrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs  python-trezor-0.11.6/src/trezorlib/messages/__pycache__/EosAuthorizationKey.cpython-36.pyc000066400000000000000000000021711361427340300316770ustar00rootroot000000000000003 ]g @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s:eZdZdeeeeeddddZeedddZ dS) EosAuthorizationKeyN)typekey address_nweightreturncCs(||_||_|dk r|ng|_||_dS)N)rr r r )selfrr r r rb/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/EosAuthorizationKey.py__init__szEosAuthorizationKey.__init__)r cCs0dtjdfdtjdfdtjtjfdtjdfdS)Nrrr r r )r)p UVarintType BytesType FLAG_REPEATED)clsrrr get_fieldss   zEosAuthorizationKey.get_fields)NNNN) __name__ __module__ __qualname__intbytesrr classmethodrrrrrrr srN) rrtypingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/EosAuthorizationWait.cpython-36.pyc000066400000000000000000000017371361427340300320620ustar00rootroot000000000000003 ]w @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s2eZdZdeeddddZeedddZdS) EosAuthorizationWaitN)wait_secweightreturncCs||_||_dS)N)rr )selfrr r c/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/EosAuthorizationWait.py__init__szEosAuthorizationWait.__init__)r cCsdtjdfdtjdfdS)Nrrr )r)p UVarintType)clsr r r get_fieldss zEosAuthorizationWait.get_fields)NN)__name__ __module__ __qualname__intr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/EosGetPublicKey.cpython-36.pyc000066400000000000000000000020461361427340300307160ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s:eZdZdZd eeeddddZee dddZ dS) EosGetPublicKeyiXN) address_n show_displayreturncCs|dk r |ng|_||_dS)N)rr )selfrr r ^/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/EosGetPublicKey.py__init__szEosGetPublicKey.__init__)r cCsdtjtjfdtjdfdS)Nrr r)r)p UVarintType FLAG_REPEATEDBoolType)clsr r r get_fieldss zEosGetPublicKey.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErintboolr classmethodrrr r r r r s  rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/EosPermissionLevel.cpython-36.pyc000066400000000000000000000017301361427340300315060ustar00rootroot000000000000003 ]y @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s2eZdZdeeddddZeedddZdS) EosPermissionLevelN)actor permissionreturncCs||_||_dS)N)rr )selfrr r a/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/EosPermissionLevel.py__init__szEosPermissionLevel.__init__)r cCsdtjdfdtjdfdS)Nrrr )r)p UVarintType)clsr r r get_fieldss zEosPermissionLevel.get_fields)NN)__name__ __module__ __qualname__intr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/EosPublicKey.cpython-36.pyc000066400000000000000000000017751361427340300302660ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s6eZdZdZd eeddddZeedddZ dS) EosPublicKeyiYN)wif_public_keyraw_public_keyreturncCs||_||_dS)N)rr )selfrr r [/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/EosPublicKey.py__init__szEosPublicKey.__init__)r cCsdtjdfdtjdfdS)Nrrr )r)p UnicodeType BytesType)clsr r r get_fieldss zEosPublicKey.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEstrbytesr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/EosSignTx.cpython-36.pyc000066400000000000000000000022521361427340300276020ustar00rootroot000000000000003 ] @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf) EosTxHeader)DictList)Literalc@s>eZdZdZd eeeeeddddZe e dddZ dS) EosSignTxiZN) address_nchain_idheader num_actionsreturncCs(|dk r |ng|_||_||_||_dS)N)r r r r )selfr r r r rX/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/EosSignTx.py__init__szEosSignTx.__init__)rcCs.dtjtjfdtjdfdtdfdtjdfdS)Nr r rr r )rr)p UVarintType FLAG_REPEATED BytesTyper)clsrrr get_fieldss  zEosSignTx.get_fields)NNNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErintbytesrr classmethodrrrrrrr sr N) rrrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs  python-trezor-0.11.6/src/trezorlib/messages/__pycache__/EosSignedTx.cpython-36.pyc000066400000000000000000000016431361427340300301160ustar00rootroot000000000000003 ]( @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) EosSignedTxi]N) signaturereturncCs ||_dS)N)r)selfrr Z/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/EosSignedTx.py__init__szEosSignedTx.__init__)r cCsddtjdfiS)Nrr)p UnicodeType)clsr r r get_fieldsszEosSignedTx.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEstrr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/EosTxActionAck.cpython-36.pyc000066400000000000000000000046141361427340300305420ustar00rootroot000000000000003 ] @s ddlmZddlmZddlmZddlmZddlmZddlmZddlmZdd l m Z dd l m Z dd l m Z dd l m Z dd l m Z ddlmZddlmZddlmZddlmZy ddlmZmZddlmZWnek rYnXGdddejZdS))protobuf)EosActionBuyRam)EosActionBuyRamBytes)EosActionCommon)EosActionDelegate)EosActionDeleteAuth)EosActionLinkAuth)EosActionNewAccount)EosActionRefund)EosActionSellRam)EosActionTransfer)EosActionUndelegate)EosActionUnknown)EosActionUnlinkAuth)EosActionUpdateAuth)EosActionVoteProducer)DictList)Literalc@sPeZdZdZd eeeeee e e e e eeeeeddddZeedddZdS) EosTxActionAcki\N)commontransferdelegate undelegaterefundbuy_ram buy_ram_bytessell_ram vote_producer update_auth delete_auth link_auth unlink_auth new_accountunknownreturncCs^||_||_||_||_||_||_||_||_| |_| |_ | |_ | |_ | |_ ||_ ||_dS)N)rrrrrrrrr r!r"r#r$r%r&)selfrrrrrrrrr r!r"r#r$r%r&r)]/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/EosTxActionAck.py__init__ szEosTxActionAck.__init__)r'cCs~dtdfdtdfdtdfdtdfdtdfdtdfdtdfd tdfd tdfd t dfd t dfd t dfdt dfdt dfdtdfdS)Nrrrrrrrrrr r!r"r#r$r%r&)rr )rr rrr rrr rrrr rr r)clsr)r)r* get_fieldsBszEosTxActionAck.get_fields)NNNNNNNNNNNNNNN)__name__ __module__ __qualname__MESSAGE_WIRE_TYPErr rrr rrr rrrr rr rr+ classmethodrr:r)r)r)r*rs& rN)rprrrrrr r r r r rrrrrtypingrrtyping_extensionsr ImportError MessageTyperr)r)r)r*s*                python-trezor-0.11.6/src/trezorlib/messages/__pycache__/EosTxActionRequest.cpython-36.pyc000066400000000000000000000016771361427340300315020ustar00rootroot000000000000003 ]/ @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) EosTxActionRequesti[N) data_sizereturncCs ||_dS)N)r)selfrr a/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/EosTxActionRequest.py__init__szEosTxActionRequest.__init__)r cCsddtjdfiS)Nrr)p UVarintType)clsr r r get_fieldsszEosTxActionRequest.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEintr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/EosTxHeader.cpython-36.pyc000066400000000000000000000022741361427340300300760ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc @s:eZdZdeeeeeeddddZeedddZdS) EosTxHeaderN) expiration ref_block_numref_block_prefixmax_net_usage_wordsmax_cpu_usage_ms delay_secreturncCs(||_||_||_||_||_||_dS)N)rr r r r r )selfrr r r r r rZ/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/EosTxHeader.py__init__s zEosTxHeader.__init__)rcCsBdtjdfdtjdfdtjdfdtjdfdtjdfdtjdfdS) Nrrr r r r r )r)p UVarintType)clsrrr get_fieldss      zEosTxHeader.get_fields)NNNNNN)__name__ __module__ __qualname__intr classmethodrrrrrrr srN) rrtypingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/EthereumAddress.cpython-36.pyc000066400000000000000000000017771361427340300310160ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s6eZdZdZd eeddddZeedddZ dS) EthereumAddress9N) old_addressaddressreturncCs||_||_dS)N)r r )selfr r r ^/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/EthereumAddress.py__init__szEthereumAddress.__init__)r cCsdtjdfdtjdfdS)Nr rr )r)p BytesType UnicodeType)clsr r r get_fieldss zEthereumAddress.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEbytesstrr classmethodrrr r r rr s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/EthereumGetAddress.cpython-36.pyc000066400000000000000000000020621361427340300314420ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s:eZdZdZd eeeddddZee dddZ dS) EthereumGetAddress8N) address_n show_displayreturncCs|dk r |ng|_||_dS)N)r r )selfr r r a/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/EthereumGetAddress.py__init__szEthereumGetAddress.__init__)r cCsdtjtjfdtjdfdS)Nr r r)r)p UVarintType FLAG_REPEATEDBoolType)clsr r r get_fieldss zEthereumGetAddress.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErintboolr classmethodrrr r r rr s  rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/EthereumGetPublicKey.cpython-36.pyc000066400000000000000000000020721361427340300317450ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s:eZdZdZd eeeddddZee dddZ dS) EthereumGetPublicKeyiN) address_n show_displayreturncCs|dk r |ng|_||_dS)N)rr )selfrr r c/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/EthereumGetPublicKey.py__init__szEthereumGetPublicKey.__init__)r cCsdtjtjfdtjdfdS)Nrr r)r)p UVarintType FLAG_REPEATEDBoolType)clsr r r get_fieldss zEthereumGetPublicKey.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErintboolr classmethodrrr r r r r s  rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/EthereumMessageSignature.cpython-36.pyc000066400000000000000000000020411361427340300326600ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s6eZdZdZd eeddddZeedddZ dS) EthereumMessageSignatureBN) signatureaddressreturncCs||_||_dS)N)r r )selfr r r g/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/EthereumMessageSignature.py__init__sz!EthereumMessageSignature.__init__)r cCsdtjdfdtjdfdS)Nr rr )r)p BytesType UnicodeType)clsr r r get_fieldss z#EthereumMessageSignature.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEbytesstrr classmethodrrr r r rr s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/EthereumPublicKey.cpython-36.pyc000066400000000000000000000020311361427340300313000ustar00rootroot000000000000003 ] @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf) HDNodeType)DictList)Literalc@s6eZdZdZd eeddddZeedddZ dS) EthereumPublicKeyiN)nodexpubreturncCs||_||_dS)N)r r )selfr r r`/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/EthereumPublicKey.py__init__szEthereumPublicKey.__init__)r cCsdtdfdtjdfdS)Nr rr )rr)rp UnicodeType)clsrrr get_fieldsszEthereumPublicKey.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErstrr classmethodrrrrrrr s r N) rrrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs  python-trezor-0.11.6/src/trezorlib/messages/__pycache__/EthereumSignMessage.cpython-36.pyc000066400000000000000000000020631361427340300316230ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s:eZdZdZd eeeddddZee dddZ dS) EthereumSignMessage@N) address_nmessagereturncCs|dk r |ng|_||_dS)N)r r )selfr r r b/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/EthereumSignMessage.py__init__szEthereumSignMessage.__init__)r cCsdtjtjfdtjdfdS)Nr r r)r)p UVarintType FLAG_REPEATED BytesType)clsr r r get_fieldss zEthereumSignMessage.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErintbytesr classmethodrrr r r rr s  rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/EthereumSignTx.cpython-36.pyc000066400000000000000000000027541361427340300306410ustar00rootroot000000000000003 ]G @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc @sJeZdZdZd eeeeeeeeeeedd ddZe e dddZ dS) EthereumSignTx:N) address_nnonce gas_price gas_limittovaluedata_initial_chunk data_lengthchain_idtx_typereturnc CsL|dk r |ng|_||_||_||_||_||_||_||_| |_| |_ dS)N) r r r r r rrrrr) selfr r r r r rrrrrr]/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/EthereumSignTx.py__init__s zEthereumSignTx.__init__)rc Csldtjtjfdtjdfdtjdfdtjdfdtjdfdtjdfdtjdfd tjdfd tjdfd tjdfd S) Nr r rr r r rrrrr) r  )p UVarintType FLAG_REPEATED BytesType UnicodeType)clsrrr get_fields(s         zEthereumSignTx.get_fields) NNNNNNNNNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErintbytesstrr classmethodrr'rrrrr s rN) rr!typingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/EthereumTxAck.cpython-36.pyc000066400000000000000000000016541361427340300304350ustar00rootroot000000000000003 ]- @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) EthereumTxAck<N) data_chunkreturncCs ||_dS)N)r )selfr r \/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/EthereumTxAck.py__init__szEthereumTxAck.__init__)r cCsddtjdfiS)Nr r)p BytesType)clsr r r get_fieldsszEthereumTxAck.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEbytesr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/EthereumTxRequest.cpython-36.pyc000066400000000000000000000021771361427340300313700ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s:eZdZdZd eeeeddddZeedddZ dS) EthereumTxRequest;N) data_length signature_v signature_r signature_sreturncCs||_||_||_||_dS)N)r r r r )selfr r r r r`/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/EthereumTxRequest.py__init__szEthereumTxRequest.__init__)r cCs.dtjdfdtjdfdtjdfdtjdfdS)Nr rr r r )r)p UVarintType BytesType)clsrrr get_fieldss   zEthereumTxRequest.get_fields)NNNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEintbytesr classmethodrrrrrrr s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/EthereumVerifyMessage.cpython-36.pyc000066400000000000000000000021131361427340300321630ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s8eZdZdZd eeeddddZeedddZ dS) EthereumVerifyMessageAN) signaturemessageaddressreturncCs||_||_||_dS)N)r r r )selfr r r rd/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/EthereumVerifyMessage.py__init__szEthereumVerifyMessage.__init__)r cCs$dtjdfdtjdfdtjdfdS)Nr rr r )r)p BytesType UnicodeType)clsrrr get_fieldss  z EthereumVerifyMessage.get_fields)NNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEbytesstrr classmethodrrrrrrr srN) rrtypingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/Failure.cpython-36.pyc000066400000000000000000000024361361427340300273120ustar00rootroot000000000000003 ʵ]@s`ddlmZy(ddlmZmZddlmZedZWne k rHYnXGdddej Z dS))protobuf)DictList)Literal cc@s6eZdZdZd eeddddZeedddZ dS) FailurerN)codemessagereturncCs||_||_dS)N)rr)selfrrrV/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/Failure.py__init__szFailure.__init__)rcCs dtjdddfdtjdfdS)Nr FailureTyperrrr r r r r rrrrrrrr)rr)rrrr r r r r rrrrrr)pEnumType UnicodeType)clsrrr get_fieldsszFailure.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEEnumTypeFailureTypestrr classmethodrr!rrrrrs rN)rrrr r r r r rrrrrr) rrtypingrrtyping_extensionsrr& ImportError MessageTyperrrrrs   python-trezor-0.11.6/src/trezorlib/messages/__pycache__/FailureType.cpython-36.pyc000066400000000000000000000010301361427340300301410ustar00rootroot000000000000003 ʵ]@s<dZdZdZdZdZdZdZdZdZd Z d Z d Z d Z d Z dS) cN)ZUnexpectedMessageZButtonExpectedZ DataErrorZActionCancelledZ PinExpectedZ PinCancelledZ PinInvalidZInvalidSignatureZ ProcessErrorZNotEnoughFundsZNotInitializedZ PinMismatchZWipeCodeMismatchZ FirmwareErrorrrZ/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/FailureType.pyspython-trezor-0.11.6/src/trezorlib/messages/__pycache__/Features.cpython-36.pyc000066400000000000000000000064341361427340300275030ustar00rootroot000000000000003 ʵ]@shddlmZy0ddlmZmZddlmZedZedZ Wne k rPYnXGdddej Z dS))protobuf)DictList)Literal c$@sxeZdZdZd eeeeeeeeeeeeeeeeeeeeeeeeeeeeee e eeedd"ddZ e e dddZdS) FeaturesN)"vendor major_version minor_version patch_versionbootloader_mode device_idpin_protectionpassphrase_protectionlanguagelabel initializedrevisionbootloader_hashimported pin_cachedpassphrase_cachedfirmware_present needs_backupflagsmodelfw_majorfw_minorfw_patch fw_vendorfw_vendor_keysunfinished_backup no_backup recovery_mode capabilities backup_typesd_card_present sd_protectionwipe_code_protectionreturnc""Cs||_||_||_||_||_||_||_||_| |_| |_ | |_ | |_ | |_ ||_ ||_||_||_||_||_||_||_||_||_||_||_||_||_||_|dk r|ng|_||_||_| |_|!|_ dS)N)!rrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8)"selfrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r;W/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/Features.py__init__sB$zFeatures.__init__)r9c/Cs^dtjdfdtjdfdtjdfdtjdfdtjdfdtjdfdtjdfd tjdfd tjdfd tjdfd tjdfd tjdfdtjdfdtjdfdtjdfdtjdfdtjdfdtjdfdtjdfdtjdfdtjdfdtjdfdtjdfdtjdfdtjdfdtjdfdtjdfdtjdfdtjdd6tjfd0tjd1d7dfd2tjdfd3tjdfd4tjdfd5!S)8Nrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4 Capabilityrrrr r r r r rrrrrrrrr5 BackupTyper6r7r8)!rrrr r r r r rrrrrrrr !")rrrr r r r r rrrrrrrr)rrr)p UnicodeType UVarintTypeBoolType BytesTypeEnumType FLAG_REPEATED)clsr;r;r< get_fieldsXsB                              zFeatures.get_fields)!NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN)__name__ __module__ __qualname__MESSAGE_WIRE_TYPEstrintboolbytesrEnumTypeCapabilityEnumTypeBackupTyper= classmethodrrYr;r;r;r<rsJH#rN)rrrr r r r r rrrrrrrr)rrr) rrQtypingrrtyping_extensionsrrbrc ImportError MessageTyperr;r;r;r<s   python-trezor-0.11.6/src/trezorlib/messages/__pycache__/FirmwareErase.cpython-36.pyc000066400000000000000000000016501361427340300304540ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) FirmwareEraseN)lengthreturncCs ||_dS)N)r )selfr r \/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/FirmwareErase.py__init__szFirmwareErase.__init__)r cCsddtjdfiS)Nr r)p UVarintType)clsr r r get_fieldsszFirmwareErase.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEintr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/FirmwareRequest.cpython-36.pyc000066400000000000000000000017471361427340300310540ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s6eZdZdZd eeddddZeedddZdS) FirmwareRequestN)offsetlengthreturncCs||_||_dS)N)r r )selfr r r ^/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/FirmwareRequest.py__init__szFirmwareRequest.__init__)r cCsdtjdfdtjdfdS)Nr rr )r)p UVarintType)clsr r r get_fieldss zFirmwareRequest.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEintr classmethodrrr r r rr s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/FirmwareUpload.cpython-36.pyc000066400000000000000000000017421361427340300306430ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s6eZdZdZd eeddddZeedddZdS) FirmwareUploadN)payloadhashreturncCs||_||_dS)N)r r )selfr r r ]/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/FirmwareUpload.py__init__szFirmwareUpload.__init__)r cCsdtjdfdtjdfdS)Nr rr )r)p BytesType)clsr r r get_fieldss zFirmwareUpload.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEbytesr classmethodrrr r r rr s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/GetAddress.cpython-36.pyc000066400000000000000000000026461361427340300277530ustar00rootroot000000000000003 ]* @slddlmZddlmZy(ddlmZmZddlmZed Z Wne k rTYnXGd d d ej Z d S) )protobuf)MultisigRedeemScriptType)DictList)Literalc@s@eZdZdZd eeeeee ddddZ e e dddZ dS) GetAddressN) address_n coin_name show_displaymultisig script_typereturncCs.|dk r |ng|_||_||_||_||_dS)N)r rrrr)selfr rrrrrY/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/GetAddress.py__init__s zGetAddress.__init__)rc Cs>dtjtjfdtjdfdtjdfdtdfdtjdd dfd S)Nr rrrrrInputScriptTyperrr r )rrr r )rrrr r )p UVarintType FLAG_REPEATED UnicodeTypeBoolTyperEnumType)clsrrr get_fields!s    zGetAddress.get_fields)NNNNN)__name__ __module__ __qualname__MESSAGE_WIRE_TYPErintstrboolrEnumTypeInputScriptTyper classmethodrr rrrrr sr N)rrrr r ) rrrtypingrrtyping_extensionsrr( ImportError MessageTyper rrrrs    python-trezor-0.11.6/src/trezorlib/messages/__pycache__/GetECDHSessionKey.cpython-36.pyc000066400000000000000000000021731361427340300311010ustar00rootroot000000000000003 ]q @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf) IdentityType)DictList)Literalc@s8eZdZdZd eeeddddZee dddZ dS) GetECDHSessionKey=N)identitypeer_public_keyecdsa_curve_namereturncCs||_||_||_dS)N)r r r )selfr r r r`/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/GetECDHSessionKey.py__init__szGetECDHSessionKey.__init__)rcCs"dtdfdtjdfdtjdfdS)Nr rr r )rr)rp BytesType UnicodeType)clsrrr get_fieldss zGetECDHSessionKey.get_fields)NNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErbytesstrr classmethodrrrrrrr sr N) rrrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs  python-trezor-0.11.6/src/trezorlib/messages/__pycache__/GetEntropy.cpython-36.pyc000066400000000000000000000016321361427340300300200ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) GetEntropy N)sizereturncCs ||_dS)N)r )selfr r Y/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/GetEntropy.py__init__szGetEntropy.__init__)r cCsddtjdfiS)Nr r)p UVarintType)clsr r r get_fieldsszGetEntropy.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEintr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/GetFeatures.cpython-36.pyc000066400000000000000000000010551361427340300301350ustar00rootroot000000000000003 ]7 @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@seZdZdZdS) GetFeatures7N)__name__ __module__ __qualname__MESSAGE_WIRE_TYPEr r Z/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/GetFeatures.pyr srN) rptypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/GetNextU2FCounter.cpython-36.pyc000066400000000000000000000010711361427340300311500ustar00rootroot000000000000003 ʵ]= @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@seZdZdZdS)GetNextU2FCounterPN)__name__ __module__ __qualname__MESSAGE_WIRE_TYPEr r `/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/GetNextU2FCounter.pyr srN) rptypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/GetPublicKey.cpython-36.pyc000066400000000000000000000025771361427340300302600ustar00rootroot000000000000003 ] @s`ddlmZy(ddlmZmZddlmZed ZWne k rHYnXGdd d ej Z d S) )protobuf)DictList)Literalc@s@eZdZdZd eeeeeeddddZ e e dddZ dS) GetPublicKey N) address_necdsa_curve_name show_display coin_name script_typereturncCs.|dk r |ng|_||_||_||_||_dS)N)r r rrr)selfr r rrrr[/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/GetPublicKey.py__init__s zGetPublicKey.__init__)rc Cs@dtjtjfdtjdfdtjdfdtjdfdtjdd dfd S)Nr r rrrrInputScriptTyperrrr )rrrr )rrrrr )p UVarintType FLAG_REPEATED UnicodeTypeBoolTypeEnumType)clsrrr get_fieldss     zGetPublicKey.get_fields)NNNNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErintstrboolEnumTypeInputScriptTyper classmethodrrrrrrr sr N)rrrrr ) rrtypingrrtyping_extensionsrr' ImportError MessageTyper rrrrs   python-trezor-0.11.6/src/trezorlib/messages/__pycache__/HDNodePathType.cpython-36.pyc000066400000000000000000000020321361427340300304730ustar00rootroot000000000000003 ] @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf) HDNodeType)DictList)Literalc@s6eZdZdeeeddddZeedddZ dS) HDNodePathTypeN)node address_nreturncCs||_|dk r|ng|_dS)N)r r )selfr r r]/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/HDNodePathType.py__init__szHDNodePathType.__init__)r cCsdtdfdtjtjfdS)Nr rr )rr)rp UVarintType FLAG_REPEATED)clsrrr get_fieldsszHDNodePathType.get_fields)NN) __name__ __module__ __qualname__rrintr classmethodrrrrrrr s  r N) rrrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs  python-trezor-0.11.6/src/trezorlib/messages/__pycache__/HDNodeType.cpython-36.pyc000066400000000000000000000022571361427340300276670ustar00rootroot000000000000003 ]} @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc @s:eZdZdeeeeeeddddZeedddZdS) HDNodeTypeN)depth fingerprint child_num chain_code private_key public_keyreturncCs(||_||_||_||_||_||_dS)N)rr r r r r )selfrr r r r r rY/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/HDNodeType.py__init__s zHDNodeType.__init__)rcCsBdtjdfdtjdfdtjdfdtjdfdtjdfdtjdfdS) Nrrr r r r r )r)p UVarintType BytesType)clsrrr get_fieldss      zHDNodeType.get_fields)NNNNNN) __name__ __module__ __qualname__intbytesr classmethodrrrrrrr srN) rrtypingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/IdentityType.cpython-36.pyc000066400000000000000000000022311361427340300303470ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc @s:eZdZdeeeeeeddddZeedddZdS) IdentityTypeN)protouserhostportpathindexreturncCs(||_||_||_||_||_||_dS)N)rr r r r r )selfrr r r r r r[/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/IdentityType.py__init__s zIdentityType.__init__)rcCsBdtjdfdtjdfdtjdfdtjdfdtjdfdtjdfdS) Nrrr r r r r )r)p UnicodeType UVarintType)clsrrr get_fieldss      zIdentityType.get_fields)NNNNNN) __name__ __module__ __qualname__strintr classmethodrrrrrrr srN) rrtypingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/Initialize.cpython-36.pyc000066400000000000000000000017531361427340300300250ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s6eZdZdZd eeddddZeedddZ dS) InitializerN)stateskip_passphrasereturncCs||_||_dS)N)rr )selfrr r Y/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/Initialize.py__init__szInitialize.__init__)r cCsdtjdfdtjdfdS)Nrrr )r)p BytesTypeBoolType)clsr r r get_fieldss zInitialize.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEbytesboolr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/InputScriptType.cpython-36.pyc000066400000000000000000000004541361427340300310470ustar00rootroot000000000000003 ]@sdZdZdZdZdZdS)N)Z SPENDADDRESSZ SPENDMULTISIGZEXTERNALZ SPENDWITNESSZSPENDP2SHWITNESSrr^/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/InputScriptType.pys python-trezor-0.11.6/src/trezorlib/messages/__pycache__/LiskAddress.cpython-36.pyc000066400000000000000000000016411361427340300301300ustar00rootroot000000000000003 ]  @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) LiskAddresssN)addressreturncCs ||_dS)N)r )selfr r Z/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/LiskAddress.py__init__szLiskAddress.__init__)r cCsddtjdfiS)Nr r)p UnicodeType)clsr r r get_fieldsszLiskAddress.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEstrr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/LiskDelegateType.cpython-36.pyc000066400000000000000000000016301361427340300311150ustar00rootroot000000000000003 ]  @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s0eZdZdeddddZeedddZdS) LiskDelegateTypeN)usernamereturncCs ||_dS)N)r)selfrr _/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/LiskDelegateType.py__init__szLiskDelegateType.__init__)r cCsddtjdfiS)Nrr)p UnicodeType)clsr r r get_fieldsszLiskDelegateType.get_fields)N)__name__ __module__ __qualname__strr classmethodrrr r r r r srN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/LiskGetAddress.cpython-36.pyc000066400000000000000000000020421361427340300305640ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s:eZdZdZd eeeddddZee dddZ dS) LiskGetAddressrN) address_n show_displayreturncCs|dk r |ng|_||_dS)N)r r )selfr r r ]/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/LiskGetAddress.py__init__szLiskGetAddress.__init__)r cCsdtjtjfdtjdfdS)Nr r r)r)p UVarintType FLAG_REPEATEDBoolType)clsr r r get_fieldss zLiskGetAddress.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErintboolr classmethodrrr r r rr s  rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/LiskGetPublicKey.cpython-36.pyc000066400000000000000000000020521361427340300310670ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s:eZdZdZd eeeddddZee dddZ dS) LiskGetPublicKeyyN) address_n show_displayreturncCs|dk r |ng|_||_dS)N)r r )selfr r r _/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/LiskGetPublicKey.py__init__szLiskGetPublicKey.__init__)r cCsdtjtjfdtjdfdS)Nr r r)r)p UVarintType FLAG_REPEATEDBoolType)clsr r r get_fieldss zLiskGetPublicKey.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErintboolr classmethodrrr r r rr s  rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/LiskMessageSignature.cpython-36.pyc000066400000000000000000000020021361427340300320010ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s6eZdZdZd eeddddZeedddZdS) LiskMessageSignaturewN) public_key signaturereturncCs||_||_dS)N)r r )selfr r r c/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/LiskMessageSignature.py__init__szLiskMessageSignature.__init__)r cCsdtjdfdtjdfdS)Nr rr )r)p BytesType)clsr r r get_fieldss zLiskMessageSignature.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEbytesr classmethodrrr r r rr s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/LiskMultisignatureType.cpython-36.pyc000066400000000000000000000021261361427340300324200ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s8eZdZdeeeeddddZeedddZ dS) LiskMultisignatureTypeN)min life_time keys_groupreturncCs"||_||_|dk r|ng|_dS)N)rr r )selfrr r r e/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/LiskMultisignatureType.py__init__szLiskMultisignatureType.__init__)r cCs&dtjdfdtjdfdtjtjfdS)Nrrr r )r)p UVarintType UnicodeType FLAG_REPEATED)clsr r r get_fieldss  z!LiskMultisignatureType.get_fields)NNN) __name__ __module__ __qualname__intrstrr classmethodrrr r r rr s  rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/LiskPublicKey.cpython-36.pyc000066400000000000000000000016541361427340300304360ustar00rootroot000000000000003 ]. @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) LiskPublicKeyzN) public_keyreturncCs ||_dS)N)r )selfr r \/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/LiskPublicKey.py__init__szLiskPublicKey.__init__)r cCsddtjdfiS)Nr r)p BytesType)clsr r r get_fieldsszLiskPublicKey.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEbytesr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/LiskSignMessage.cpython-36.pyc000066400000000000000000000020431361427340300307450ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s:eZdZdZd eeeddddZee dddZ dS) LiskSignMessagevN) address_nmessagereturncCs|dk r |ng|_||_dS)N)r r )selfr r r ^/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/LiskSignMessage.py__init__szLiskSignMessage.__init__)r cCsdtjtjfdtjdfdS)Nr r r)r)p UVarintType FLAG_REPEATED BytesType)clsr r r get_fieldss zLiskSignMessage.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErintbytesr classmethodrrr r r rr s  rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/LiskSignTx.cpython-36.pyc000066400000000000000000000020721361427340300277560ustar00rootroot000000000000003 ]* @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf)LiskTransactionCommon)DictList)Literalc@s:eZdZdZd eeeddddZee dddZ dS) LiskSignTxtN) address_n transactionreturncCs|dk r |ng|_||_dS)N)r r )selfr r rY/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/LiskSignTx.py__init__szLiskSignTx.__init__)r cCsdtjtjfdtdfdS)Nr r r)rr)p UVarintType FLAG_REPEATEDr)clsrrr get_fieldss zLiskSignTx.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErintrr classmethodrrrrrrr s  r N) rrrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs  python-trezor-0.11.6/src/trezorlib/messages/__pycache__/LiskSignatureType.cpython-36.pyc000066400000000000000000000016361361427340300313520ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s0eZdZdeddddZeedddZdS) LiskSignatureTypeN) public_keyreturncCs ||_dS)N)r)selfrr `/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/LiskSignatureType.py__init__szLiskSignatureType.__init__)r cCsddtjdfiS)Nrr)p BytesType)clsr r r get_fieldsszLiskSignatureType.get_fields)N)__name__ __module__ __qualname__bytesr classmethodrrr r r r r srN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/LiskSignedTx.cpython-36.pyc000066400000000000000000000016471361427340300302760ustar00rootroot000000000000003 ]) @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) LiskSignedTxuN) signaturereturncCs ||_dS)N)r )selfr r [/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/LiskSignedTx.py__init__szLiskSignedTx.__init__)r cCsddtjdfiS)Nr r)p BytesType)clsr r r get_fieldsszLiskSignedTx.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEbytesr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/LiskTransactionAsset.cpython-36.pyc000066400000000000000000000025051361427340300320300ustar00rootroot000000000000003 ] @s|ddlmZddlmZddlmZddlmZy ddlmZmZddl m Z Wne k rdYnXGd d d ej Z d S) )protobuf)LiskDelegateType)LiskMultisignatureType)LiskSignatureType)DictList)Literalc@s<eZdZdeeeeeeddddZe e dddZ dS) LiskTransactionAssetN) signaturedelegatevotesmultisignaturedatareturncCs.||_||_|dk r|ng|_||_||_dS)N)r r rrr)selfr r rrrrc/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/LiskTransactionAsset.py__init__s zLiskTransactionAsset.__init__)rcCs4dtdfdtdfdtjtjfdtdfdtjdfdS)Nr rr rrr)rr)rrp UnicodeType FLAG_REPEATEDr)clsrrr get_fields!s  zLiskTransactionAsset.get_fields)NNNNN) __name__ __module__ __qualname__rrr strrr classmethodrrrrrrr sr N)rrrrrtypingrr typing_extensionsr ImportError MessageTyper rrrrs    python-trezor-0.11.6/src/trezorlib/messages/__pycache__/LiskTransactionCommon.cpython-36.pyc000066400000000000000000000032601361427340300322000ustar00rootroot000000000000003 ]@slddlmZddlmZy(ddlmZmZddlmZedZ Wne k rTYnXGd d d ej Z dS))protobuf)LiskTransactionAsset)DictList)Literalc @s@eZdZdeeeeeeeeedd ddZe e dddZ dS) LiskTransactionCommonN) typeamountfee recipient_idsender_public_keyrequester_public_key signature timestampassetreturnc Cs:||_||_||_||_||_||_||_||_| |_dS)N) rrrrrrrrr) selfrrrrrrrrrrd/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/LiskTransactionCommon.py__init__s zLiskTransactionCommon.__init__)rc Csddtjdddfd tjdfd tjdfd tjdfdtjdfdtjdfdtjdfdtjdfdtdfd S)NrLiskTransactionTyperrrr r r r r rrrrrrrr) rrr r r r r  )rrrr r r r r )pEnumType UVarintType UnicodeType BytesTyper)clsrrr get_fields(s       z LiskTransactionCommon.get_fields) NNNNNNNNN) __name__ __module__ __qualname__EnumTypeLiskTransactionTypeintstrbytesrr classmethodrr&rrrrrs rN)rrrr r r r r ) rr rtypingrrtyping_extensionsrr* ImportError MessageTyperrrrrs    python-trezor-0.11.6/src/trezorlib/messages/__pycache__/LiskTransactionType.cpython-36.pyc000066400000000000000000000006331361427340300316720ustar00rootroot000000000000003 ]@s$dZdZdZdZdZdZdZdZdS) N)ZTransferZRegisterSecondPassphraseZRegisterDelegateZ CastVotesZRegisterMultisignatureAccountZ CreateDappZTransferIntoDappZTransferOutOfDappr r b/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/LiskTransactionType.pyspython-trezor-0.11.6/src/trezorlib/messages/__pycache__/LiskVerifyMessage.cpython-36.pyc000066400000000000000000000020541361427340300313130ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s8eZdZdZd eeeddddZeedddZdS) LiskVerifyMessagexN) public_key signaturemessagereturncCs||_||_||_dS)N)r r r )selfr r r r`/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/LiskVerifyMessage.py__init__szLiskVerifyMessage.__init__)r cCs$dtjdfdtjdfdtjdfdS)Nr rr r )r)p BytesType)clsrrr get_fieldss  zLiskVerifyMessage.get_fields)NNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEbytesr classmethodrrrrrrr srN) rrtypingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/LoadDevice.cpython-36.pyc000066400000000000000000000026631361427340300277240ustar00rootroot000000000000003 ʵ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc @sHeZdZdZd eeeeeeeeeedd ddZe e dddZ dS) LoadDevice N) mnemonicspinpassphrase_protectionlanguagelabel skip_checksum u2f_counter needs_backup no_backupreturnc CsF|dk r |ng|_||_||_||_||_||_||_||_| |_dS)N) r r r r r rrrr) selfr r r r r rrrrrY/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/LoadDevice.py__init__s zLoadDevice.__init__)rc Csbdtjtjfdtjdfdtjdfdtjdfdtjdfdtjdfdtjdfd tjdfd tjdfd S) Nr r rr r r rrrr)  )p UnicodeType FLAG_REPEATEDBoolType UVarintType)clsrrr get_fields&s        zLoadDevice.get_fields) NNNNNNNNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErstrboolintr classmethodrr&rrrrr s rN) rr typingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/MessageSignature.cpython-36.pyc000066400000000000000000000020011361427340300311550ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s6eZdZdZd eeddddZeedddZ dS) MessageSignature(N)address signaturereturncCs||_||_dS)N)r r )selfr r r _/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MessageSignature.py__init__szMessageSignature.__init__)r cCsdtjdfdtjdfdS)Nr rr )r)p UnicodeType BytesType)clsr r r get_fieldss zMessageSignature.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEstrbytesr classmethodrrr r r rr s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/MessageType.cpython-36.pyc000066400000000000000000000131651361427340300301520ustar00rootroot000000000000003 ]*!@sdZdZdZdZdZdZdZdZdZd Z d Z d Z d Z d Z dZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZd Z d!Z!d"Z"d#Z#d$Z$d%Z%d&Z&d'Z'd(Z(d)Z)d*Z*d+Z+d,Z,d-Z-d.Z.d/Z/d0Z0d1Z1d2Z2d3Z3d4Z4d5Z5d6Z6d7Z7d8Z8d9Z9d:Z:d;Z;dZ>d?Z?d@Z@dAZAdBZBdCZCdDZDdEZEdFZFdGZGdHZHdIZIdJZJdKZKdLZLdMZMdNZNdOZOdPZPdQZQdRZRdSZSdTZTdUZUdVZVdWZWdXZXdYZYdZZZd[Z[d\Z\d]Z]d^Z^d_Z_d`Z`daZadbZbdcZcddZddeZedfZfdgZgdhZhdiZidjZjdkZkdlZldmZmdnZndoZodpZpdqZqdrZrdsZsdtZtduZudvZvdwZwdxZxdyZydzZzd{Z{d|Z|d}Z}d~Z~dZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdS) "#$)*MN-./7?OPQR &'(056=>GHIJdefghnopqi)#ii89:;<@ABCDEFKLrstuvwxyzi/i0i1i2i3i4i5i6iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii"i#i&i'i(i)i*i+i,i-iXiYiZi[i\i]iiiiiiiiiii i!i"i#N) InitializePingSuccessFailure ChangePin WipeDevice GetEntropyEntropy LoadDevice ResetDeviceFeaturesPinMatrixRequest PinMatrixAckCancel ClearSession ApplySettings ButtonRequest ButtonAck ApplyFlags BackupDeviceEntropyRequest EntropyAckPassphraseRequest PassphraseAckPassphraseStateRequestPassphraseStateAckRecoveryDevice WordRequestWordAck GetFeatures SetU2FCounter SdProtectGetNextU2FCounterNextU2FCounterChangeWipeCode FirmwareEraseFirmwareUploadFirmwareRequestSelfTest GetPublicKey PublicKeySignTx TxRequestTxAck GetAddressAddress SignMessage VerifyMessageMessageSignatureCipherKeyValueCipheredKeyValue SignIdentitySignedIdentityGetECDHSessionKeyECDHSessionKey CosiCommitCosiCommitmentCosiSign CosiSignatureDebugLinkDecisionDebugLinkGetStateDebugLinkState DebugLinkStop DebugLinkLogDebugLinkMemoryReadDebugLinkMemoryDebugLinkMemoryWriteDebugLinkFlashEraseDebugLinkLayoutEthereumGetPublicKeyEthereumPublicKeyEthereumGetAddressEthereumAddressEthereumSignTxEthereumTxRequest EthereumTxAckEthereumSignMessageEthereumVerifyMessageEthereumMessageSignature NEMGetAddress NEMAddress NEMSignTx NEMSignedTxNEMDecryptMessageNEMDecryptedMessageLiskGetAddress LiskAddress LiskSignTx LiskSignedTxLiskSignMessageLiskMessageSignatureLiskVerifyMessageLiskGetPublicKey LiskPublicKeyTezosGetAddress TezosAddress TezosSignTx TezosSignedTxTezosGetPublicKeyTezosPublicKey StellarSignTxStellarTxOpRequestStellarGetAddressStellarAddressStellarCreateAccountOpStellarPaymentOpStellarPathPaymentOpStellarManageOfferOpStellarCreatePassiveOfferOpStellarSetOptionsOpStellarChangeTrustOpStellarAllowTrustOpStellarAccountMergeOpStellarManageDataOpStellarBumpSequenceOpStellarSignedTx CardanoSignTxCardanoTxRequestCardanoGetPublicKeyCardanoPublicKeyCardanoGetAddressCardanoAddress CardanoTxAckCardanoSignedTxRippleGetAddress RippleAddress RippleSignTxRippleSignedTxMoneroTransactionInitRequestMoneroTransactionInitAck MoneroTransactionSetInputRequestMoneroTransactionSetInputAck)MoneroTransactionInputsPermutationRequest%MoneroTransactionInputsPermutationAck!MoneroTransactionInputViniRequestMoneroTransactionInputViniAck$MoneroTransactionAllInputsSetRequest MoneroTransactionAllInputsSetAck!MoneroTransactionSetOutputRequestMoneroTransactionSetOutputAck!MoneroTransactionAllOutSetRequestMoneroTransactionAllOutSetAck!MoneroTransactionSignInputRequestMoneroTransactionSignInputAckMoneroTransactionFinalRequestMoneroTransactionFinalAckMoneroKeyImageExportInitRequestMoneroKeyImageExportInitAckMoneroKeyImageSyncStepRequestMoneroKeyImageSyncStepAckMoneroKeyImageSyncFinalRequestMoneroKeyImageSyncFinalAckMoneroGetAddress MoneroAddressMoneroGetWatchKeyMoneroWatchKeyDebugMoneroDiagRequestDebugMoneroDiagAckMoneroGetTxKeyRequestMoneroGetTxKeyAckMoneroLiveRefreshStartRequestMoneroLiveRefreshStartAckMoneroLiveRefreshStepRequestMoneroLiveRefreshStepAckMoneroLiveRefreshFinalRequestMoneroLiveRefreshFinalAckEosGetPublicKey EosPublicKey EosSignTxEosTxActionRequestEosTxActionAck EosSignedTxBinanceGetAddressBinanceAddressBinanceGetPublicKeyBinancePublicKey BinanceSignTxBinanceTxRequestBinanceTransferMsgBinanceOrderMsgBinanceCancelMsgBinanceSignedTxWebAuthnListResidentCredentialsWebAuthnCredentialsWebAuthnAddResidentCredential WebAuthnRemoveResidentCredentialr,r,Z/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MessageType.pystpython-trezor-0.11.6/src/trezorlib/messages/__pycache__/MoneroAccountPublicAddress.cpython-36.pyc000066400000000000000000000020101361427340300331300ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s2eZdZdeeddddZeedddZdS) MoneroAccountPublicAddressN)spend_public_keyview_public_keyreturncCs||_||_dS)N)rr )selfrr r i/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroAccountPublicAddress.py__init__sz#MoneroAccountPublicAddress.__init__)r cCsdtjdfdtjdfdS)Nrrr )r)p BytesType)clsr r r get_fieldss z%MoneroAccountPublicAddress.get_fields)NN)__name__ __module__ __qualname__bytesr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/MoneroAddress.cpython-36.pyc000066400000000000000000000016511361427340300304660ustar00rootroot000000000000003 ]" @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) MoneroAddressiN)addressreturncCs ||_dS)N)r)selfrr \/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroAddress.py__init__szMoneroAddress.__init__)r cCsddtjdfiS)Nrr)p BytesType)clsr r r get_fieldsszMoneroAddress.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEbytesr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/MoneroExportedKeyImage.cpython-36.pyc000066400000000000000000000017371361427340300323140ustar00rootroot000000000000003 ]Y @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s2eZdZdeeddddZeedddZdS) MoneroExportedKeyImageN)ivblobreturncCs||_||_dS)N)rr )selfrr r e/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroExportedKeyImage.py__init__szMoneroExportedKeyImage.__init__)r cCsdtjdfdtjdfdS)Nrrr ))p BytesType)clsr r r get_fieldss z!MoneroExportedKeyImage.get_fields)NN)__name__ __module__ __qualname__bytesr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/MoneroGetAddress.cpython-36.pyc000066400000000000000000000024321361427340300311240ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc @sBeZdZdZd eeeeeeeddddZe e dddZ dS) MoneroGetAddressiN) address_n show_display network_typeaccountminor payment_idreturncCs4|dk r |ng|_||_||_||_||_||_dS)N)rr r r r r )selfrr r r r r r_/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroGetAddress.py__init__s zMoneroGetAddress.__init__)rcCsDdtjtjfdtjdfdtjdfdtjdfdtjdfdtjdfdS) Nrr rr r r r )r)p UVarintType FLAG_REPEATEDBoolType BytesType)clsrrr get_fields s      zMoneroGetAddress.get_fields)NNNNNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErintboolbytesr classmethodrrrrrrr srN) rrtypingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/MoneroGetTxKeyAck.cpython-36.pyc000066400000000000000000000020531361427340300312210ustar00rootroot000000000000003 ]  @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s8eZdZdZd eeeddddZeedddZdS) MoneroGetTxKeyAcki'N)salttx_keystx_derivationsreturncCs||_||_||_dS)N)rr r )selfrr r r `/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroGetTxKeyAck.py__init__szMoneroGetTxKeyAck.__init__)r cCs$dtjdfdtjdfdtjdfdS)Nrrr r )r)p BytesType)clsr r r get_fieldss  zMoneroGetTxKeyAck.get_fields)NNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEbytesr classmethodrrr r r rr srN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/MoneroGetTxKeyRequest.cpython-36.pyc000066400000000000000000000026221361427340300321550ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc @sFeZdZdZd eeeeeeeeedd ddZee dddZ dS) MoneroGetTxKeyRequesti&N) address_n network_typesalt1salt2 tx_enc_keystx_prefix_hashreasonview_public_keyreturnc Cs@|dk r |ng|_||_||_||_||_||_||_||_dS)N)rr r r r r rr) selfrr r r r r rrrd/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroGetTxKeyRequest.py__init__s zMoneroGetTxKeyRequest.__init__)rc CsXdtjtjfdtjdfdtjdfdtjdfdtjdfdtjdfdtjdfd tjdfd S) Nrr rr r r r rr)r)p UVarintType FLAG_REPEATED BytesType)clsrrr get_fields$s       z MoneroGetTxKeyRequest.get_fields)NNNNNNNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErintbytesr classmethodrr!rrrrr s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/MoneroGetWatchKey.cpython-36.pyc000066400000000000000000000020361361427340300312560ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s:eZdZdZd eeeddddZeedddZ dS) MoneroGetWatchKeyiN) address_n network_typereturncCs|dk r |ng|_||_dS)N)rr )selfrr r `/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroGetWatchKey.py__init__szMoneroGetWatchKey.__init__)r cCsdtjtjfdtjdfdS)Nrr r)r)p UVarintType FLAG_REPEATED)clsr r r get_fieldss zMoneroGetWatchKey.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErintr classmethodrrr r r r r s  rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/MoneroKeyImageExportInitAck.cpython-36.pyc000066400000000000000000000011151361427340300332340ustar00rootroot000000000000003 ]H @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@seZdZdZdS)MoneroKeyImageExportInitAckiN)__name__ __module__ __qualname__MESSAGE_WIRE_TYPEr r j/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroKeyImageExportInitAck.pyr srN) rptypingrrtyping_extensionsr ImportError MessageTyperr r r r s MoneroKeyImageExportInitRequest.cpython-36.pyc000066400000000000000000000025211361427340300341110ustar00rootroot00000000000000python-trezor-0.11.6/src/trezorlib/messages/__pycache__3 ] @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf)MoneroSubAddressIndicesList)DictList)Literalc@sDeZdZdZd eeeeeeeddddZe e dddZ dS) MoneroKeyImageExportInitRequestiN)numhash address_n network_typesubsreturncCs:||_||_|dk r|ng|_||_|dk r0|ng|_dS)N)r r r r r)selfr r r r rrn/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroKeyImageExportInitRequest.py__init__s z(MoneroKeyImageExportInitRequest.__init__)rcCs:dtjdfdtjdfdtjtjfdtjdfdttjfdS)Nr rr r r r)rr)p UVarintType BytesType FLAG_REPEATEDr)clsrrr get_fields s     z*MoneroKeyImageExportInitRequest.get_fields)NNNNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEintbytesrrr classmethodrrrrrrr sr N) rrrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs  python-trezor-0.11.6/src/trezorlib/messages/__pycache__/MoneroKeyImageSyncFinalAck.cpython-36.pyc000066400000000000000000000017351361427340300330250ustar00rootroot000000000000003 ]/ @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) MoneroKeyImageSyncFinalAckiN)enc_keyreturncCs ||_dS)N)r)selfrr i/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroKeyImageSyncFinalAck.py__init__sz#MoneroKeyImageSyncFinalAck.__init__)r cCsddtjdfiS)Nrr)p BytesType)clsr r r get_fieldssz%MoneroKeyImageSyncFinalAck.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEbytesr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s MoneroKeyImageSyncFinalRequest.cpython-36.pyc000066400000000000000000000011231361427340300336670ustar00rootroot00000000000000python-trezor-0.11.6/src/trezorlib/messages/__pycache__3 ]K @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@seZdZdZdS)MoneroKeyImageSyncFinalRequestiN)__name__ __module__ __qualname__MESSAGE_WIRE_TYPEr r m/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroKeyImageSyncFinalRequest.pyr srN) rptypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/MoneroKeyImageSyncStepAck.cpython-36.pyc000066400000000000000000000020361361427340300327020ustar00rootroot000000000000003 ] @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf)MoneroExportedKeyImage)DictList)Literalc@s8eZdZdZd eeddddZeedddZ dS) MoneroKeyImageSyncStepAckiN)kisreturncCs|dk r |ng|_dS)N)r )selfr r h/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroKeyImageSyncStepAck.py__init__sz"MoneroKeyImageSyncStepAck.__init__)r cCsddttjfiS)Nrr )rp FLAG_REPEATED)clsr r r get_fieldssz$MoneroKeyImageSyncStepAck.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErrr classmethodrrr r r rr s r N) rrrtypingrrtyping_extensionsr ImportError MessageTyper r r r rs  python-trezor-0.11.6/src/trezorlib/messages/__pycache__/MoneroKeyImageSyncStepRequest.cpython-36.pyc000066400000000000000000000020561361427340300336360ustar00rootroot000000000000003 ] @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf)MoneroTransferDetails)DictList)Literalc@s8eZdZdZd eeddddZeedddZ dS) MoneroKeyImageSyncStepRequestiN)tdisreturncCs|dk r |ng|_dS)N)r )selfr r l/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroKeyImageSyncStepRequest.py__init__sz&MoneroKeyImageSyncStepRequest.__init__)r cCsddttjfiS)Nrr )rp FLAG_REPEATED)clsr r r get_fieldssz(MoneroKeyImageSyncStepRequest.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErrr classmethodrrr r r rr s r N) rrrtypingrrtyping_extensionsr ImportError MessageTyper r r r rs  python-trezor-0.11.6/src/trezorlib/messages/__pycache__/MoneroLiveRefreshFinalAck.cpython-36.pyc000066400000000000000000000011111361427340300326770ustar00rootroot000000000000003 ]F @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@seZdZdZdS)MoneroLiveRefreshFinalAcki-N)__name__ __module__ __qualname__MESSAGE_WIRE_TYPEr r h/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroLiveRefreshFinalAck.pyr srN) rptypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/MoneroLiveRefreshFinalRequest.cpython-36.pyc000066400000000000000000000011211361427340300336320ustar00rootroot000000000000003 ]J @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@seZdZdZdS)MoneroLiveRefreshFinalRequesti,N)__name__ __module__ __qualname__MESSAGE_WIRE_TYPEr r l/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroLiveRefreshFinalRequest.pyr srN) rptypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/MoneroLiveRefreshStartAck.cpython-36.pyc000066400000000000000000000011111361427340300327430ustar00rootroot000000000000003 ]F @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@seZdZdZdS)MoneroLiveRefreshStartAcki)N)__name__ __module__ __qualname__MESSAGE_WIRE_TYPEr r h/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroLiveRefreshStartAck.pyr srN) rptypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/MoneroLiveRefreshStartRequest.cpython-36.pyc000066400000000000000000000021161361427340300337030ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s:eZdZdZd eeeddddZeedddZ dS) MoneroLiveRefreshStartRequesti(N) address_n network_typereturncCs|dk r |ng|_||_dS)N)rr )selfrr r l/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroLiveRefreshStartRequest.py__init__sz&MoneroLiveRefreshStartRequest.__init__)r cCsdtjtjfdtjdfdS)Nrr r)r)p UVarintType FLAG_REPEATED)clsr r r get_fieldss z(MoneroLiveRefreshStartRequest.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErintr classmethodrrr r r r r s  rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/MoneroLiveRefreshStepAck.cpython-36.pyc000066400000000000000000000020141361427340300325640ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s6eZdZdZd eeddddZeedddZdS) MoneroLiveRefreshStepAcki+N)salt key_imagereturncCs||_||_dS)N)rr )selfrr r g/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroLiveRefreshStepAck.py__init__sz!MoneroLiveRefreshStepAck.__init__)r cCsdtjdfdtjdfdS)Nrrr )r)p BytesType)clsr r r get_fieldss z#MoneroLiveRefreshStepAck.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEbytesr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/MoneroLiveRefreshStepRequest.cpython-36.pyc000066400000000000000000000023471361427340300335270ustar00rootroot000000000000003 ]1 @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s<eZdZdZd eeeeeddddZeedddZ dS) MoneroLiveRefreshStepRequesti*N)out_key recv_deriv real_out_idxsub_addr_majorsub_addr_minorreturncCs"||_||_||_||_||_dS)N)rr r r r )selfrr r r r rk/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroLiveRefreshStepRequest.py__init__s z%MoneroLiveRefreshStepRequest.__init__)r cCs8dtjdfdtjdfdtjdfdtjdfdtjdfdS)Nrrr r r r )r)p BytesType UVarintType)clsrrr get_fieldss     z'MoneroLiveRefreshStepRequest.get_fields)NNNNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEbytesintr classmethodrrrrrrr s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/MoneroMultisigKLRki.cpython-36.pyc000066400000000000000000000020601361427340300315660ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s6eZdZdeeeeddddZeedddZdS) MoneroMultisigKLRkiN)KLRkireturncCs||_||_||_||_dS)N)rr r r )selfrr r r rb/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroMultisigKLRki.py__init__szMoneroMultisigKLRki.__init__)r cCs.dtjdfdtjdfdtjdfdtjdfdS)Nrrr r r )r)p BytesType)clsrrr get_fieldss   zMoneroMultisigKLRki.get_fields)NNNN)__name__ __module__ __qualname__bytesr classmethodrrrrrrr s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/MoneroOutputEntry.cpython-36.pyc000066400000000000000000000020011361427340300314110ustar00rootroot000000000000003 ] @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf)MoneroRctKeyPublic)DictList)Literalc@s2eZdZdeeddddZeedddZdS) MoneroOutputEntryN)idxkeyreturncCs||_||_dS)N)r r )selfr r r`/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroOutputEntry.py__init__szMoneroOutputEntry.__init__)r cCsdtjdfdtdfdS)Nr rr )rr)p UVarintTyper)clsrrr get_fieldss zMoneroOutputEntry.get_fields)NN) __name__ __module__ __qualname__intrr classmethodrrrrrrr s r N) rrrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs  python-trezor-0.11.6/src/trezorlib/messages/__pycache__/MoneroRctKeyPublic.cpython-36.pyc000066400000000000000000000017271361427340300314450ustar00rootroot000000000000003 ]u @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s2eZdZdeeddddZeedddZdS) MoneroRctKeyPublicN)dest commitmentreturncCs||_||_dS)N)rr )selfrr r a/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroRctKeyPublic.py__init__szMoneroRctKeyPublic.__init__)r cCsdtjdfdtjdfdS)Nrrr )r)p BytesType)clsr r r get_fieldss zMoneroRctKeyPublic.get_fields)NN)__name__ __module__ __qualname__bytesr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/MoneroRingCtSig.cpython-36.pyc000066400000000000000000000020231361427340300307240ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdeeeddddZeedddZdS) MoneroRingCtSigN)txn_feemessagerv_typereturncCs||_||_||_dS)N)rr r )selfrr r r ^/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroRingCtSig.py__init__szMoneroRingCtSig.__init__)r cCs$dtjdfdtjdfdtjdfdS)Nrrr r )r)p UVarintType BytesType)clsr r r get_fieldss  zMoneroRingCtSig.get_fields)NNN) __name__ __module__ __qualname__intbytesr classmethodrrr r r rr s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/MoneroSubAddressIndicesList.cpython-36.pyc000066400000000000000000000020471361427340300332730ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s6eZdZdeeeddddZeedddZdS) MoneroSubAddressIndicesListN)account minor_indicesreturncCs||_|dk r|ng|_dS)N)rr )selfrr r j/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroSubAddressIndicesList.py__init__sz$MoneroSubAddressIndicesList.__init__)r cCsdtjdfdtjtjfdS)Nrrr )r)p UVarintType FLAG_REPEATED)clsr r r get_fieldss z&MoneroSubAddressIndicesList.get_fields)NN) __name__ __module__ __qualname__intrr classmethodrrr r r r r s  rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s MoneroTransactionAllInputsSetAck.cpython-36.pyc000066400000000000000000000020351361427340300342330ustar00rootroot00000000000000python-trezor-0.11.6/src/trezorlib/messages/__pycache__3 ] @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf)MoneroTransactionRsigData)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) MoneroTransactionAllInputsSetAckiN) rsig_datareturncCs ||_dS)N)r )selfr r o/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroTransactionAllInputsSetAck.py__init__sz)MoneroTransactionAllInputsSetAck.__init__)r cCsddtdfiS)Nrr r)r)clsr r r get_fieldssz+MoneroTransactionAllInputsSetAck.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErr classmethodrrr r r rr s r N) rprtypingrrtyping_extensionsr ImportError MessageTyper r r r rs  MoneroTransactionAllInputsSetRequest.cpython-36.pyc000066400000000000000000000011371361427340300351670ustar00rootroot00000000000000python-trezor-0.11.6/src/trezorlib/messages/__pycache__3 ]Q @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@seZdZdZdS)$MoneroTransactionAllInputsSetRequestiN)__name__ __module__ __qualname__MESSAGE_WIRE_TYPEr r s/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroTransactionAllInputsSetRequest.pyr srN) rptypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/MoneroTransactionAllOutSetAck.cpython-36.pyc000066400000000000000000000023121361427340300335750ustar00rootroot000000000000003 ] @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf)MoneroRingCtSig)DictList)Literalc@s:eZdZdZd eeeeddddZeedddZ dS) MoneroTransactionAllOutSetAckiN)extratx_prefix_hashrvfull_message_hashreturncCs||_||_||_||_dS)N)r r r r )selfr r r r rl/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroTransactionAllOutSetAck.py__init__sz&MoneroTransactionAllOutSetAck.__init__)rcCs,dtjdfdtjdfdtdfdtjdfdS)Nr rr r r )rr)p BytesTyper)clsrrr get_fieldss  z(MoneroTransactionAllOutSetAck.get_fields)NNNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEbytesrr classmethodrrrrrrr s r N) rrrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs  MoneroTransactionAllOutSetRequest.cpython-36.pyc000066400000000000000000000020411361427340300344470ustar00rootroot00000000000000python-trezor-0.11.6/src/trezorlib/messages/__pycache__3 ] @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf)MoneroTransactionRsigData)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) !MoneroTransactionAllOutSetRequestiN) rsig_datareturncCs ||_dS)N)r )selfr r p/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroTransactionAllOutSetRequest.py__init__sz*MoneroTransactionAllOutSetRequest.__init__)r cCsddtdfiS)Nrr r)r)clsr r r get_fieldssz,MoneroTransactionAllOutSetRequest.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErr classmethodrrr r r rr s r N) rprtypingrrtyping_extensionsr ImportError MessageTyper r r r rs  python-trezor-0.11.6/src/trezorlib/messages/__pycache__/MoneroTransactionData.cpython-36.pyc000066400000000000000000000036421361427340300321620ustar00rootroot000000000000003 ]K @spddlmZddlmZddlmZy ddlmZmZddlm Z Wne k rXYnXGdd d ej Z d S) )protobuf)!MoneroTransactionDestinationEntry)MoneroTransactionRsigData)DictList)Literalc@sXeZdZdeeeeeeeeeeeeeeeeeeddddZe e dddZ dS) MoneroTransactionDataN)version payment_id unlock_timeoutputs change_dts num_inputsmixinfeeaccount minor_indices rsig_dataintegrated_indicesclient_version hard_forkmonero_versionreturncCs||_||_||_|dk r|ng|_||_||_||_||_| |_| dk rN| ng|_ | |_ | dk rf| ng|_ | |_ ||_ ||_dS)N)r r r rrrrrrrrrrrr)selfr r r rrrrrrrrrrrrrd/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroTransactionData.py__init__szMoneroTransactionData.__init__)rcCsdtjdfdtjdfdtjdfdttjfdtdfdtjdfdtjdfd tjdfd tjdfd tjtjfd tdfd tjtjfdtjdfdtjdfdtjdfdS)Nr rr r rrrrrrrrrrrr)rr )p UVarintType BytesTyper FLAG_REPEATEDr)clsrrr get_fields4s            z MoneroTransactionData.get_fields)NNNNNNNNNNNNNNN) __name__ __module__ __qualname__intbytesrrrr classmethodrr1rrrrr s$,r N) rr,rrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs   MoneroTransactionDestinationEntry.cpython-36.pyc000066400000000000000000000024361361427340300345350ustar00rootroot00000000000000python-trezor-0.11.6/src/trezorlib/messages/__pycache__3 ]J @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf)MoneroAccountPublicAddress)DictList)Literalc@s8eZdZdeeeeeddddZee dddZ dS) !MoneroTransactionDestinationEntryN)amountaddr is_subaddressoriginal is_integratedreturncCs"||_||_||_||_||_dS)N)r r r r r)selfr r r r rrp/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroTransactionDestinationEntry.py__init__s z*MoneroTransactionDestinationEntry.__init__)rcCs6dtjdfdtdfdtjdfdtjdfdtjdfdS)Nr rr r r r)rr)p UVarintTyperBoolType BytesType)clsrrr get_fieldss    z,MoneroTransactionDestinationEntry.get_fields)NNNNN) __name__ __module__ __qualname__intrboolbytesr classmethodrrrrrrr s r N) rrrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs  python-trezor-0.11.6/src/trezorlib/messages/__pycache__/MoneroTransactionFinalAck.cpython-36.pyc000066400000000000000000000022011361427340300327470ustar00rootroot000000000000003 ]| @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s:eZdZdZd eeeeddddZeedddZdS) MoneroTransactionFinalAckiN)cout_keysalt rand_mult tx_enc_keysreturncCs||_||_||_||_dS)N)rr r r )selfrr r r rh/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroTransactionFinalAck.py__init__sz"MoneroTransactionFinalAck.__init__)r cCs.dtjdfdtjdfdtjdfdtjdfdS)Nrrr r r )r)p BytesType)clsrrr get_fieldss   z$MoneroTransactionFinalAck.get_fields)NNNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEbytesr classmethodrrrrrrr s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/MoneroTransactionFinalRequest.cpython-36.pyc000066400000000000000000000011211361427340300337010ustar00rootroot000000000000003 ]J @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@seZdZdZdS)MoneroTransactionFinalRequestiN)__name__ __module__ __qualname__MESSAGE_WIRE_TYPEr r l/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroTransactionFinalRequest.pyr srN) rptypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/MoneroTransactionInitAck.cpython-36.pyc000066400000000000000000000021601361427340300326250ustar00rootroot000000000000003 ], @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf)MoneroTransactionRsigData)DictList)Literalc@s:eZdZdZd eeeddddZee dddZ dS) MoneroTransactionInitAckiN)hmacs rsig_datareturncCs|dk r |ng|_||_dS)N)r r )selfr r rg/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroTransactionInitAck.py__init__sz!MoneroTransactionInitAck.__init__)r cCsdtjtjfdtdfdS)Nr r r)rr)p BytesType FLAG_REPEATEDr)clsrrr get_fieldss z#MoneroTransactionInitAck.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErbytesrr classmethodrrrrrrr s  r N) rrrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs  python-trezor-0.11.6/src/trezorlib/messages/__pycache__/MoneroTransactionInitRequest.cpython-36.pyc000066400000000000000000000023601361427340300335610ustar00rootroot000000000000003 ] @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf)MoneroTransactionData)DictList)Literalc@s>eZdZdZd eeeeeddddZee dddZ dS) MoneroTransactionInitRequestiN)version address_n network_typetsx_datareturncCs(||_|dk r|ng|_||_||_dS)N)r r r r )selfr r r r rk/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroTransactionInitRequest.py__init__sz%MoneroTransactionInitRequest.__init__)rcCs.dtjdfdtjtjfdtjdfdtdfdS)Nr rr r r )rr)p UVarintType FLAG_REPEATEDr)clsrrr get_fieldss   z'MoneroTransactionInitRequest.get_fields)NNNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEintrrr classmethodrrrrrrr sr N) rrrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs  python-trezor-0.11.6/src/trezorlib/messages/__pycache__/MoneroTransactionInputViniAck.cpython-36.pyc000066400000000000000000000011211361427340300336430ustar00rootroot000000000000003 ]J @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@seZdZdZdS)MoneroTransactionInputViniAckiN)__name__ __module__ __qualname__MESSAGE_WIRE_TYPEr r l/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroTransactionInputViniAck.pyr srN) rptypingrrtyping_extensionsr ImportError MessageTyperr r r r s MoneroTransactionInputViniRequest.cpython-36.pyc000066400000000000000000000024361361427340300345300ustar00rootroot00000000000000python-trezor-0.11.6/src/trezorlib/messages/__pycache__3 ]z @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf)MoneroTransactionSourceEntry)DictList)Literalc@s<eZdZdZd eeeeeddddZeedddZ dS) !MoneroTransactionInputViniRequestiN)src_entrvini vini_hmac pseudo_outpseudo_out_hmacreturncCs"||_||_||_||_||_dS)N)r r r r r)selfr r r r rrp/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroTransactionInputViniRequest.py__init__s z*MoneroTransactionInputViniRequest.__init__)rcCs6dtdfdtjdfdtjdfdtjdfdtjdfdS)Nr rr r r r)rr)rp BytesType)clsrrr get_fields s    z,MoneroTransactionInputViniRequest.get_fields)NNNNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErbytesr classmethodrrrrrrr s r N) rrrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs  MoneroTransactionInputsPermutationAck.cpython-36.pyc000066400000000000000000000011411361427340300353530ustar00rootroot00000000000000python-trezor-0.11.6/src/trezorlib/messages/__pycache__3 ]R @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@seZdZdZdS)%MoneroTransactionInputsPermutationAckiN)__name__ __module__ __qualname__MESSAGE_WIRE_TYPEr r t/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroTransactionInputsPermutationAck.pyr srN) rptypingrrtyping_extensionsr ImportError MessageTyperr r r r s MoneroTransactionInputsPermutationRequest.cpython-36.pyc000066400000000000000000000020671361427340300363150ustar00rootroot00000000000000python-trezor-0.11.6/src/trezorlib/messages/__pycache__3 ]b @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s8eZdZdZd eeddddZeedddZ dS) )MoneroTransactionInputsPermutationRequestiN)permreturncCs|dk r |ng|_dS)N)r)selfrr x/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroTransactionInputsPermutationRequest.py__init__sz2MoneroTransactionInputsPermutationRequest.__init__)r cCsddtjtjfiS)Nr)p UVarintType FLAG_REPEATED)clsr r r get_fieldssz4MoneroTransactionInputsPermutationRequest.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErintr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/MoneroTransactionRsigData.cpython-36.pyc000066400000000000000000000025231361427340300330040ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc @sDeZdZdeeeeeeeeeddddZeedddZ dS) MoneroTransactionRsigDataN) rsig_type offload_typegroupingmaskrsig rsig_parts bp_versionreturncCsF||_||_|dk r|ng|_||_||_|dk r6|ng|_||_dS)N)rr r r r r r)selfrr r r r r rrh/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroTransactionRsigData.py__init__s z"MoneroTransactionRsigData.__init__)rc CsPdtjdfdtjdfdtjtjfdtjdfdtjdfdtjtjfdtjdfd S) Nrrr r r r r r)r)p UVarintType FLAG_REPEATED BytesType)clsrrr get_fields!s      z$MoneroTransactionRsigData.get_fields)NNNNNNN) __name__ __module__ __qualname__intrbytesr classmethodrrrrrrr s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/MoneroTransactionSetInputAck.cpython-36.pyc000066400000000000000000000024121361427340300334750ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc @s>eZdZdZd eeeeeeddddZeedddZdS) MoneroTransactionSetInputAckiN)vini vini_hmac pseudo_outpseudo_out_hmacpseudo_out_alpha spend_keyreturncCs(||_||_||_||_||_||_dS)N)rr r r r r )selfrr r r r r rk/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroTransactionSetInputAck.py__init__s z%MoneroTransactionSetInputAck.__init__)rcCsBdtjdfdtjdfdtjdfdtjdfdtjdfdtjdfdS) Nrrr r r r r )r)p BytesType)clsrrr get_fields s      z'MoneroTransactionSetInputAck.get_fields)NNNNNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEbytesr classmethodrrrrrrr srN) rrtypingrrtyping_extensionsr ImportError MessageTyperrrrrs MoneroTransactionSetInputRequest.cpython-36.pyc000066400000000000000000000020371361427340300343530ustar00rootroot00000000000000python-trezor-0.11.6/src/trezorlib/messages/__pycache__3 ] @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf)MoneroTransactionSourceEntry)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) MoneroTransactionSetInputRequestiN)src_entrreturncCs ||_dS)N)r )selfr r o/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroTransactionSetInputRequest.py__init__sz)MoneroTransactionSetInputRequest.__init__)r cCsddtdfiS)Nrr r)r)clsr r r get_fieldssz+MoneroTransactionSetInputRequest.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErr classmethodrrr r r rr s r N) rprtypingrrtyping_extensionsr ImportError MessageTyper r r r rs  python-trezor-0.11.6/src/trezorlib/messages/__pycache__/MoneroTransactionSetOutputAck.cpython-36.pyc000066400000000000000000000024051361427340300337000ustar00rootroot000000000000003 ]R @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf)MoneroTransactionRsigData)DictList)Literalc@s<eZdZdZd eeeeeddddZeedddZ dS) MoneroTransactionSetOutputAckiN)tx_out vouti_hmac rsig_dataout_pk ecdh_inforeturncCs"||_||_||_||_||_dS)N)r r r r r)selfr r r r rrl/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroTransactionSetOutputAck.py__init__s z&MoneroTransactionSetOutputAck.__init__)rcCs6dtjdfdtjdfdtdfdtjdfdtjdfdS)Nr rr r r r)rr)p BytesTyper)clsrrr get_fields s    z(MoneroTransactionSetOutputAck.get_fields)NNNNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEbytesrr classmethodrrrrrrr s r N) rrrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs  MoneroTransactionSetOutputRequest.cpython-36.pyc000066400000000000000000000024731361427340300345600ustar00rootroot00000000000000python-trezor-0.11.6/src/trezorlib/messages/__pycache__3 ] @spddlmZddlmZddlmZy ddlmZmZddlm Z Wne k rXYnXGdd d ej Z d S) )protobuf)!MoneroTransactionDestinationEntry)MoneroTransactionRsigData)DictList)Literalc@s:eZdZdZd eeeeddddZe e dddZ dS) !MoneroTransactionSetOutputRequestiN)dst_entr dst_entr_hmac rsig_datais_offloaded_bpreturncCs||_||_||_||_dS)N)r r r r)selfr r r rrp/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroTransactionSetOutputRequest.py__init__sz*MoneroTransactionSetOutputRequest.__init__)rcCs*dtdfdtjdfdtdfdtjdfdS)Nr rr r r)rr)rp BytesTyperBoolType)clsrrr get_fieldss z,MoneroTransactionSetOutputRequest.get_fields)NNNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErbytesrboolr classmethodrrrrrrr s r N) rrrrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs   python-trezor-0.11.6/src/trezorlib/messages/__pycache__/MoneroTransactionSignInputAck.cpython-36.pyc000066400000000000000000000020461361427340300336450ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s6eZdZdZd eeddddZeedddZdS) MoneroTransactionSignInputAckiN) signature pseudo_outreturncCs||_||_dS)N)rr )selfrr r l/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroTransactionSignInputAck.py__init__sz&MoneroTransactionSignInputAck.__init__)r cCsdtjdfdtjdfdS)Nrrr )r)p BytesType)clsr r r get_fieldss z(MoneroTransactionSignInputAck.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEbytesr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s MoneroTransactionSignInputRequest.cpython-36.pyc000066400000000000000000000026251361427340300345230ustar00rootroot00000000000000python-trezor-0.11.6/src/trezorlib/messages/__pycache__3 ]z @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf)MoneroTransactionSourceEntry)DictList)Literalc @s@eZdZdZd eeeeeeeddddZeedddZ dS) !MoneroTransactionSignInputRequestiN)src_entrvini vini_hmac pseudo_outpseudo_out_hmacpseudo_out_alpha spend_keyreturncCs.||_||_||_||_||_||_||_dS)N)r r r r rrr)selfr r r r rrrrp/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroTransactionSignInputRequest.py__init__s z*MoneroTransactionSignInputRequest.__init__)rc CsJdtdfdtjdfdtjdfdtjdfdtjdfdtjdfdtjdfd S) Nr rr r r rrr)rr)rp BytesType)clsrrr get_fields$s     z,MoneroTransactionSignInputRequest.get_fields)NNNNNNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErbytesr classmethodrrrrrrr s r N) rrrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs  python-trezor-0.11.6/src/trezorlib/messages/__pycache__/MoneroTransactionSourceEntry.cpython-36.pyc000066400000000000000000000031511361427340300335660ustar00rootroot000000000000003 ]( @spddlmZddlmZddlmZy ddlmZmZddlm Z Wne k rXYnXGdd d ej Z d S) )protobuf)MoneroMultisigKLRki)MoneroOutputEntry)DictList)Literalc @sHeZdZdeeeeeeeeeeedd ddZ e e dddZ dS) MoneroTransactionSourceEntryN) outputs real_outputreal_out_tx_keyreal_out_additional_tx_keysreal_output_in_tx_indexamountrctmaskmultisig_kLRkireturnc CsR|dk r |ng|_||_||_|dk r*|ng|_||_||_||_||_| |_dS)N) r r r rrrrrr) selfr r r rrrrrrrk/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroTransactionSourceEntry.py__init__s z%MoneroTransactionSourceEntry.__init__)rc Cs`dttjfdtjdfdtjdfdtjtjfdtjdfdtjdfdtjdfd tjdfd tdfd S) Nr r rr rrrrrr) rr )rp FLAG_REPEATED UVarintType BytesTypeBoolTyper)clsrrr get_fields(s        z'MoneroTransactionSourceEntry.get_fields) NNNNNNNNN) __name__ __module__ __qualname__rrintbytesboolrr classmethodrr&rrrrr s r N) rr rrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs   python-trezor-0.11.6/src/trezorlib/messages/__pycache__/MoneroTransferDetails.cpython-36.pyc000066400000000000000000000022471361427340300321750ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s:eZdZdeeeeeddddZeedddZ dS) MoneroTransferDetailsN)out_key tx_pub_keyadditional_tx_pub_keysinternal_output_indexreturncCs(||_||_|dk r|ng|_||_dS)N)rr r r )selfrr r r rd/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroTransferDetails.py__init__szMoneroTransferDetails.__init__)r cCs0dtjdfdtjdfdtjtjfdtjdfdS)Nrrr r r )r)p BytesType FLAG_REPEATED UVarintType)clsrrr get_fieldss   z MoneroTransferDetails.get_fields)NNNN) __name__ __module__ __qualname__bytesrintr classmethodrrrrrrr srN) rrtypingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/MoneroWatchKey.cpython-36.pyc000066400000000000000000000017471361427340300306260ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s6eZdZdZd eeddddZeedddZdS) MoneroWatchKeyiN) watch_keyaddressreturncCs||_||_dS)N)rr )selfrr r ]/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MoneroWatchKey.py__init__szMoneroWatchKey.__init__)r cCsdtjdfdtjdfdS)Nrrr )r)p BytesType)clsr r r get_fieldss zMoneroWatchKey.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEbytesr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/MultisigRedeemScriptType.cpython-36.pyc000066400000000000000000000025271361427340300326720ustar00rootroot000000000000003 ] @spddlmZddlmZddlmZy ddlmZmZddlm Z Wne k rXYnXGdd d ej Z d S) )protobuf)HDNodePathType) HDNodeType)DictList)Literalc@sHeZdZdeeeeeeeeeddddZe e dddZ dS) MultisigRedeemScriptTypeN)pubkeys signaturesmnodes address_nreturncCsR|dk r |ng|_|dk r|ng|_||_|dk r6|ng|_|dk rH|ng|_dS)N)r r r rr)selfr r r rrrg/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/MultisigRedeemScriptType.py__init__s z!MultisigRedeemScriptType.__init__)rcCs<dttjfdtjtjfdtjdfdttjfdtjtjfdS)Nr r r rrr)rr)rp FLAG_REPEATED BytesType UVarintTyper)clsrrr get_fields s     z#MultisigRedeemScriptType.get_fields)NNNNN) __name__ __module__ __qualname__rrbytesintrr classmethodrrrrrrr sr N) rrrrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs   python-trezor-0.11.6/src/trezorlib/messages/__pycache__/NEMAddress.cpython-36.pyc000066400000000000000000000016351361427340300276500ustar00rootroot000000000000003 ]* @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) NEMAddressDN)addressreturncCs ||_dS)N)r )selfr r Y/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/NEMAddress.py__init__szNEMAddress.__init__)r cCsddtjdfiS)Nr r)p UnicodeType)clsr r r get_fieldsszNEMAddress.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEstrr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/NEMAggregateModification.cpython-36.pyc000066400000000000000000000021411361427340300324700ustar00rootroot000000000000003 ]T @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf)NEMCosignatoryModification)DictList)Literalc@s6eZdZdeeeddddZeedddZ dS) NEMAggregateModificationN) modificationsrelative_changereturncCs|dk r |ng|_||_dS)N)r r )selfr r rg/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/NEMAggregateModification.py__init__sz!NEMAggregateModification.__init__)r cCsdttjfdtjdfdS)Nr r r)rr)rp FLAG_REPEATED SVarintType)clsrrr get_fieldss z#NEMAggregateModification.get_fields)NN) __name__ __module__ __qualname__rrintr classmethodrrrrrrr s  r N) rrrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs  python-trezor-0.11.6/src/trezorlib/messages/__pycache__/NEMCosignatoryModification.cpython-36.pyc000066400000000000000000000021571361427340300331120ustar00rootroot000000000000003 ] @s`ddlmZy(ddlmZmZddlmZed ZWne k rHYnXGdddej Z dS) )protobuf)DictList)Literalc@s2eZdZdeeddddZeedddZdS) NEMCosignatoryModificationN)type public_keyreturncCs||_||_dS)N)r r )selfr r r i/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/NEMCosignatoryModification.py__init__sz#NEMCosignatoryModification.__init__)r cCs dtjdddfdtjdfdS) Nr NEMModificationTyperrrr )rr)rr)pEnumType BytesType)clsr r r get_fieldssz%NEMCosignatoryModification.get_fields)NN) __name__ __module__ __qualname__EnumTypeNEMModificationTypebytesr classmethodrrr r r rrs rN)rr) rrtypingrrtyping_extensionsrr ImportError MessageTyperr r r rs   python-trezor-0.11.6/src/trezorlib/messages/__pycache__/NEMDecryptMessage.cpython-36.pyc000066400000000000000000000022321361427340300311740ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s>eZdZdZd eeeeeddddZee dddZ dS) NEMDecryptMessageKN) address_nnetwork public_keypayloadreturncCs(|dk r |ng|_||_||_||_dS)N)r r r r )selfr r r r r`/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/NEMDecryptMessage.py__init__szNEMDecryptMessage.__init__)r cCs0dtjtjfdtjdfdtjdfdtjdfdS)Nr r rr r )r)p UVarintType FLAG_REPEATED BytesType)clsrrr get_fieldss   zNEMDecryptMessage.get_fields)NNNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErintbytesr classmethodrrrrrrr srN) rrtypingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/NEMDecryptedMessage.cpython-36.pyc000066400000000000000000000017011361427340300315050ustar00rootroot000000000000003 ]' @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) NEMDecryptedMessageLN)payloadreturncCs ||_dS)N)r )selfr r b/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/NEMDecryptedMessage.py__init__szNEMDecryptedMessage.__init__)r cCsddtjdfiS)Nr r)p BytesType)clsr r r get_fieldsszNEMDecryptedMessage.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEbytesr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/NEMGetAddress.cpython-36.pyc000066400000000000000000000021241361427340300303020ustar00rootroot000000000000003 ]D @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s<eZdZdZd eeeeddddZee dddZ dS) NEMGetAddressCN) address_nnetwork show_displayreturncCs"|dk r |ng|_||_||_dS)N)r r r )selfr r r r\/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/NEMGetAddress.py__init__szNEMGetAddress.__init__)r cCs&dtjtjfdtjdfdtjdfdS)Nr r rr )r)p UVarintType FLAG_REPEATEDBoolType)clsrrr get_fieldss  zNEMGetAddress.get_fields)NNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErintboolr classmethodrrrrrrr s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/NEMImportanceTransfer.cpython-36.pyc000066400000000000000000000021471361427340300320700ustar00rootroot000000000000003 ] @s`ddlmZy(ddlmZmZddlmZed ZWne k rHYnXGdddej Z dS) )protobuf)DictList)Literalc@s2eZdZdeeddddZeedddZdS) NEMImportanceTransferN)mode public_keyreturncCs||_||_dS)N)r r )selfr r r d/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/NEMImportanceTransfer.py__init__szNEMImportanceTransfer.__init__)r cCs dtjdddfdtjdfdS) Nr NEMImportanceTransferModerrrr )rr)rr)pEnumType BytesType)clsr r r get_fieldssz NEMImportanceTransfer.get_fields)NN) __name__ __module__ __qualname__!EnumTypeNEMImportanceTransferModebytesr classmethodrrr r r rrs rN)rr) rrtypingrrtyping_extensionsrr ImportError MessageTyperr r r rs   python-trezor-0.11.6/src/trezorlib/messages/__pycache__/NEMImportanceTransferMode.cpython-36.pyc000066400000000000000000000004121361427340300326660ustar00rootroot000000000000003 ]@s dZdZdS)N)ZImportanceTransfer_ActivateZImportanceTransfer_Deactivaterrh/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/NEMImportanceTransferMode.pyspython-trezor-0.11.6/src/trezorlib/messages/__pycache__/NEMModificationType.cpython-36.pyc000066400000000000000000000004051361427340300315240ustar00rootroot000000000000003 ]@s dZdZdS)N)ZCosignatoryModification_AddZCosignatoryModification_Deleterrb/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/NEMModificationType.pyspython-trezor-0.11.6/src/trezorlib/messages/__pycache__/NEMMosaic.cpython-36.pyc000066400000000000000000000017751361427340300275030ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdeeeddddZeedddZdS) NEMMosaicN) namespacemosaicquantityreturncCs||_||_||_dS)N)rr r )selfrr r r X/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/NEMMosaic.py__init__szNEMMosaic.__init__)r cCs$dtjdfdtjdfdtjdfdS)Nrrr r )r)p UnicodeType UVarintType)clsr r r get_fieldss  zNEMMosaic.get_fields)NNN) __name__ __module__ __qualname__strintr classmethodrrr r r rr s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/NEMMosaicCreation.cpython-36.pyc000066400000000000000000000021161361427340300311560ustar00rootroot000000000000003 ] @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf)NEMMosaicDefinition)DictList)Literalc@s4eZdZdeeeddddZeedddZ dS) NEMMosaicCreationN) definitionsinkfeereturncCs||_||_||_dS)N)r r r )selfr r r r`/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/NEMMosaicCreation.py__init__szNEMMosaicCreation.__init__)r cCs"dtdfdtjdfdtjdfdS)Nr rr r )rr)rp UnicodeType UVarintType)clsrrr get_fieldss zNEMMosaicCreation.get_fields)NNN) __name__ __module__ __qualname__rstrintr classmethodrrrrrrr s r N) rrrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs  python-trezor-0.11.6/src/trezorlib/messages/__pycache__/NEMMosaicDefinition.cpython-36.pyc000066400000000000000000000035501361427340300315050ustar00rootroot000000000000003 ] @s`ddlmZy(ddlmZmZddlmZed ZWne k rHYnXGdddej Z dS) )protobuf)DictList)Literalc@sPeZdZdeeeeeeeeeeeeeeeeddddZe e dddZ dS) NEMMosaicDefinitionN)nameticker namespacemosaic divisibilitylevyfee levy_addresslevy_namespace levy_mosaicsupplymutable_supply transferable descriptionnetworksreturncCsj||_||_||_||_||_||_||_||_| |_| |_ | |_ | |_ | |_ ||_ |dk r`|ng|_dS)N)r r r r r rrrrrrrrrr)selfr r r r r rrrrrrrrrrrb/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/NEMMosaicDefinition.py__init__szNEMMosaicDefinition.__init__)rcCsdtjdfdtjdfdtjdfdtjdfdtjdfdtjdddfd tjdfd tjdfd tjdfdtjdfdtjdfdtjdfdtjdfdtjdfdtjtjfdS)Nr rr r r r r NEMMosaicLevyrrrrrrrrrrr)rr )rr)p UnicodeType UVarintTypeEnumTypeBoolType FLAG_REPEATED)clsrrr get_fields2s             zNEMMosaicDefinition.get_fields)NNNNNNNNNNNNNNN) __name__ __module__ __qualname__strintEnumTypeNEMMosaicLevyboolrr classmethodrr2rrrrrs$$rN)rr) rr+typingrrtyping_extensionsrr8 ImportError MessageTyperrrrrs   python-trezor-0.11.6/src/trezorlib/messages/__pycache__/NEMMosaicLevy.cpython-36.pyc000066400000000000000000000003561361427340300303350ustar00rootroot000000000000003 ]@s dZdZdS)N)ZMosaicLevy_AbsoluteZMosaicLevy_Percentilerr\/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/NEMMosaicLevy.pyspython-trezor-0.11.6/src/trezorlib/messages/__pycache__/NEMMosaicSupplyChange.cpython-36.pyc000066400000000000000000000023251361427340300320160ustar00rootroot000000000000003 ] @s`ddlmZy(ddlmZmZddlmZed ZWne k rHYnXGdddej Z dS) )protobuf)DictList)Literalc@s6eZdZdeeeeddddZeedddZ dS) NEMMosaicSupplyChangeN) namespacemosaictypedeltareturncCs||_||_||_||_dS)N)r r r r )selfr r r r rd/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/NEMMosaicSupplyChange.py__init__szNEMMosaicSupplyChange.__init__)r cCs4dtjdfdtjdfdtjdd dfdtjdfd S) Nr rr r NEMSupplyChangeTyperrr )rr)rr)p UnicodeTypeEnumType UVarintType)clsrrr get_fieldss  z NEMMosaicSupplyChange.get_fields)NNNN) __name__ __module__ __qualname__strEnumTypeNEMSupplyChangeTypeintr classmethodrrrrrrrs rN)rr) rrtypingrrtyping_extensionsrr ImportError MessageTyperrrrrs   python-trezor-0.11.6/src/trezorlib/messages/__pycache__/NEMProvisionNamespace.cpython-36.pyc000066400000000000000000000021331361427340300320620ustar00rootroot000000000000003 ]4 @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s6eZdZdeeeeddddZeedddZdS) NEMProvisionNamespaceN) namespaceparentsinkfeereturncCs||_||_||_||_dS)N)rr r r )selfrr r r rd/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/NEMProvisionNamespace.py__init__szNEMProvisionNamespace.__init__)r cCs.dtjdfdtjdfdtjdfdtjdfdS)Nrrr r r )r)p UnicodeType UVarintType)clsrrr get_fieldss   z NEMProvisionNamespace.get_fields)NNNN) __name__ __module__ __qualname__strintr classmethodrrrrrrr s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/NEMSignTx.cpython-36.pyc000066400000000000000000000033511361427340300274740ustar00rootroot000000000000003 ] @sddlmZddlmZddlmZddlmZddlmZddlmZddlmZdd l m Z y d d l m Z m Z d d l mZWnek rYnXGd ddejZdS))protobuf)NEMAggregateModification)NEMImportanceTransfer)NEMMosaicCreation)NEMMosaicSupplyChange)NEMProvisionNamespace)NEMTransactionCommon) NEMTransfer)DictList)Literalc @sDeZdZdZd eeeeeee e e dd ddZ e edddZdS) NEMSignTxEN) transactionmultisigtransfer cosigningprovision_namespacemosaic_creation supply_changeaggregate_modificationimportance_transferreturnc Cs:||_||_||_||_||_||_||_||_| |_dS)N) rrrrrrrrr) selfrrrrrrrrrrX/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/NEMSignTx.py__init__s zNEMSignTx.__init__)rc CsPdtdfdtdfdtdfdtjdfdtdfdtdfdtdfd tdfd tdfd S) Nrr rrrrrrrr) rr ) r r pBoolTyperrrrr)clsrrr get_fields.s zNEMSignTx.get_fields) NNNNNNNNN)__name__ __module__ __qualname__MESSAGE_WIRE_TYPEr r boolrrrrrr classmethodr r)rrrrrs rN)rr&rrrrrr r typingr r typing_extensionsr ImportError MessageTyperrrrrs        python-trezor-0.11.6/src/trezorlib/messages/__pycache__/NEMSignedTx.cpython-36.pyc000066400000000000000000000017301361427340300300040ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s6eZdZdZd eeddddZeedddZdS) NEMSignedTxFN)data signaturereturncCs||_||_dS)N)r r )selfr r r Z/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/NEMSignedTx.py__init__szNEMSignedTx.__init__)r cCsdtjdfdtjdfdS)Nr rr )r)p BytesType)clsr r r get_fieldss zNEMSignedTx.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEbytesr classmethodrrr r r rr s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/NEMSupplyChangeType.cpython-36.pyc000066400000000000000000000003661361427340300315270ustar00rootroot000000000000003 ]@s dZdZdS)N)ZSupplyChange_IncreaseZSupplyChange_Decreaserrb/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/NEMSupplyChangeType.pyspython-trezor-0.11.6/src/trezorlib/messages/__pycache__/NEMTransactionCommon.cpython-36.pyc000066400000000000000000000023571361427340300317230ustar00rootroot000000000000003 ]T @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc @s>eZdZdeeeeeeeddddZeedddZ dS) NEMTransactionCommonN) address_nnetwork timestampfeedeadlinesignerreturncCs4|dk r |ng|_||_||_||_||_||_dS)N)rr r r r r )selfrr r r r r rc/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/NEMTransactionCommon.py__init__s zNEMTransactionCommon.__init__)rcCsDdtjtjfdtjdfdtjdfdtjdfdtjdfdtjdfdS) Nrr rr r r r )r)p UVarintType FLAG_REPEATED BytesType)clsrrr get_fieldss      zNEMTransactionCommon.get_fields)NNNNNN) __name__ __module__ __qualname__rintbytesr classmethodrrrrrrr srN) rrtypingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/NEMTransfer.cpython-36.pyc000066400000000000000000000023301361427340300300400ustar00rootroot000000000000003 ] @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf) NEMMosaic)DictList)Literalc@s<eZdZdeeeeeeddddZe e dddZ dS) NEMTransferN) recipientamountpayload public_keymosaicsreturncCs.||_||_||_||_|dk r$|ng|_dS)N)r r r r r)selfr r r r rrZ/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/NEMTransfer.py__init__s zNEMTransfer.__init__)rcCs8dtjdfdtjdfdtjdfdtjdfdttjfdS)Nr rr r r r)rr)p UnicodeType UVarintType BytesTyper FLAG_REPEATED)clsrrr get_fieldss     zNEMTransfer.get_fields)NNNNN) __name__ __module__ __qualname__strintbytesrrr classmethodrrrrrrr sr N) rrrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs  python-trezor-0.11.6/src/trezorlib/messages/__pycache__/NextU2FCounter.cpython-36.pyc000066400000000000000000000016611361427340300305150ustar00rootroot000000000000003 ʵ]2 @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) NextU2FCounterQN) u2f_counterreturncCs ||_dS)N)r )selfr r ]/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/NextU2FCounter.py__init__szNextU2FCounter.__init__)r cCsddtjdfiS)Nr r)p UVarintType)clsr r r get_fieldsszNextU2FCounter.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEintr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/OutputScriptType.cpython-36.pyc000066400000000000000000000005161361427340300312470ustar00rootroot000000000000003 ]J@sdZdZdZdZdZdZdS)N)Z PAYTOADDRESSZPAYTOSCRIPTHASHZ PAYTOMULTISIGZ PAYTOOPRETURNZ PAYTOWITNESSZPAYTOP2SHWITNESSrr_/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/OutputScriptType.pys python-trezor-0.11.6/src/trezorlib/messages/__pycache__/PassphraseAck.cpython-36.pyc000066400000000000000000000017641361427340300304560ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s6eZdZdZd eeddddZeedddZ dS) PassphraseAck*N) passphrasestatereturncCs||_||_dS)N)r r )selfr r r \/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/PassphraseAck.py__init__szPassphraseAck.__init__)r cCsdtjdfdtjdfdS)Nr rr )r)p UnicodeType BytesType)clsr r r get_fieldss zPassphraseAck.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEstrbytesr classmethodrrr r r rr s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/PassphraseRequest.cpython-36.pyc000066400000000000000000000016711361427340300314050ustar00rootroot000000000000003 ]+ @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) PassphraseRequest)N) on_devicereturncCs ||_dS)N)r )selfr r `/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/PassphraseRequest.py__init__szPassphraseRequest.__init__)r cCsddtjdfiS)Nr r)pBoolType)clsr r r get_fieldsszPassphraseRequest.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEboolr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/PassphraseSourceType.cpython-36.pyc000066400000000000000000000003471361427340300320560ustar00rootroot000000000000003 ]@sdZdZdZdS)N)ZASKZDEVICEZHOSTrrc/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/PassphraseSourceType.pyspython-trezor-0.11.6/src/trezorlib/messages/__pycache__/PassphraseStateAck.cpython-36.pyc000066400000000000000000000010731361427340300314500ustar00rootroot000000000000003 ]> @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@seZdZdZdS)PassphraseStateAckNN)__name__ __module__ __qualname__MESSAGE_WIRE_TYPEr r a/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/PassphraseStateAck.pyr srN) rptypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/PassphraseStateRequest.cpython-36.pyc000066400000000000000000000017131361427340300324030ustar00rootroot000000000000003 ]" @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) PassphraseStateRequestMN)statereturncCs ||_dS)N)r )selfr r e/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/PassphraseStateRequest.py__init__szPassphraseStateRequest.__init__)r cCsddtjdfiS)Nr r)p BytesType)clsr r r get_fieldssz!PassphraseStateRequest.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEbytesr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/PinMatrixAck.cpython-36.pyc000066400000000000000000000016411361427340300302520ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) PinMatrixAckN)pinreturncCs ||_dS)N)r )selfr r [/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/PinMatrixAck.py__init__szPinMatrixAck.__init__)r cCsddtjdfiS)Nr r)p UnicodeType)clsr r r get_fieldsszPinMatrixAck.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEstrr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/PinMatrixRequest.cpython-36.pyc000066400000000000000000000021211361427340300311760ustar00rootroot000000000000003 ʵ] @s`ddlmZy(ddlmZmZddlmZed ZWne k rHYnXGd d d ej Z d S) )protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) PinMatrixRequestN)typereturncCs ||_dS)N)r )selfr r_/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/PinMatrixRequest.py__init__szPinMatrixRequest.__init__)rc Csddtjdd dfiS) Nrr PinMatrixRequestTyperrr r r)rrrr r )pEnumType)clsrrr get_fieldsszPinMatrixRequest.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEEnumTypePinMatrixRequestTyper classmethodrrrrrrr s r N)rrrr r ) rrtypingrrtyping_extensionsrr ImportError MessageTyper rrrrs   python-trezor-0.11.6/src/trezorlib/messages/__pycache__/PinMatrixRequestType.cpython-36.pyc000066400000000000000000000004471361427340300320510ustar00rootroot000000000000003 ʵ]@sdZdZdZdZdZdS)N)ZCurrentZNewFirstZ NewSecondZ WipeCodeFirstZWipeCodeSecondrrc/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/PinMatrixRequestType.pys python-trezor-0.11.6/src/trezorlib/messages/__pycache__/Ping.cpython-36.pyc000066400000000000000000000021301361427340300266070ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s:eZdZdZd eeeeddddZeedddZ dS) PingN)messagebutton_protectionpin_protectionpassphrase_protectionreturncCs||_||_||_||_dS)N)r r r r )selfr r r r rS/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/Ping.py__init__sz Ping.__init__)r cCs.dtjdfdtjdfdtjdfdtjdfdS)Nr rr r r )rr)p UnicodeTypeBoolType)clsrrr get_fieldss   zPing.get_fields)NNNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEstrboolr classmethodrrrrrrr s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/PublicKey.cpython-36.pyc000066400000000000000000000017711361427340300276130ustar00rootroot000000000000003 ] @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf) HDNodeType)DictList)Literalc@s6eZdZdZd eeddddZeedddZ dS) PublicKey N)nodexpubreturncCs||_||_dS)N)r r )selfr r rX/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/PublicKey.py__init__szPublicKey.__init__)r cCsdtdfdtjdfdS)Nr rr )rr)rp UnicodeType)clsrrr get_fieldsszPublicKey.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErstrr classmethodrrrrrrr s r N) rrrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs  python-trezor-0.11.6/src/trezorlib/messages/__pycache__/RecoveryDevice.cpython-36.pyc000066400000000000000000000030231361427340300306320ustar00rootroot000000000000003 ʵ]e @s`ddlmZy(ddlmZmZddlmZed ZWne k rHYnXGdddej Z dS) )protobuf)DictList)Literalc @sDeZdZdZd eeeeeeeeedd ddZe e dddZ dS) RecoveryDevice-N) word_countpassphrase_protectionpin_protectionlanguagelabelenforce_wordlisttype u2f_counterdry_runreturnc Cs:||_||_||_||_||_||_||_||_| |_dS)N) r r r r rrrrr) selfr r r r rrrrrr]/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/RecoveryDevice.py__init__s zRecoveryDevice.__init__)rc Csfdtjdfdtjdfdtjdfdtjdfdtjdfdtjdfdtjd ddfd tjdfd tjdfd S)Nr rr r r rrrRecoveryDeviceTyperrr) rr )rr)p UVarintTypeBoolType UnicodeTypeEnumType)clsrrr get_fields's       zRecoveryDevice.get_fields) NNNNNNNNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEintboolstrEnumTypeRecoveryDeviceTyper classmethodrr&rrrrrs rN)rr) rr typingrrtyping_extensionsrr. ImportError MessageTyperrrrrs   python-trezor-0.11.6/src/trezorlib/messages/__pycache__/RecoveryDeviceType.cpython-36.pyc000066400000000000000000000003371361427340300315010ustar00rootroot000000000000003 ]@s dZdZdS)N)ZScrambledWordsZMatrixrra/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/RecoveryDeviceType.pyspython-trezor-0.11.6/src/trezorlib/messages/__pycache__/RequestType.cpython-36.pyc000066400000000000000000000004251361427340300302110ustar00rootroot000000000000003 ] @sdZdZdZdZdZdS)N)ZTXINPUTZTXOUTPUTZTXMETAZ TXFINISHEDZ TXEXTRADATArrZ/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/RequestType.pys python-trezor-0.11.6/src/trezorlib/messages/__pycache__/ResetDevice.cpython-36.pyc000066400000000000000000000031051361427340300301170ustar00rootroot000000000000003 ʵ] @s`ddlmZy(ddlmZmZddlmZed ZWne k rHYnXGdddej Z dS) )protobuf)DictList)Literalc @sFeZdZdZd eeeeeeeeeedd ddZe e dddZ dS) ResetDeviceN) display_randomstrengthpassphrase_protectionpin_protectionlanguagelabel u2f_counter skip_backup no_backup backup_typereturnc Cs@||_||_||_||_||_||_||_||_| |_| |_ dS)N) r r r r rrrrrr) selfr r r r rrrrrrrZ/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/ResetDevice.py__init__s zResetDevice.__init__)rcCspdtjdfdtjdfdtjdfdtjdfdtjdfdtjdfdtjdfd tjdfd tjdfd tjd ddfd S)Nr rr r r rrrrrr BackupTyperr) rr )rrr)pBoolType UVarintType UnicodeTypeEnumType)clsrrr get_fields)s         zResetDevice.get_fields) NNNNNNNNNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEboolintstrEnumTypeBackupTyper classmethodrr(rrrrrs rN)rrr) rr"typingrrtyping_extensionsrr0 ImportError MessageTyperrrrrs   python-trezor-0.11.6/src/trezorlib/messages/__pycache__/RippleAddress.cpython-36.pyc000066400000000000000000000016511361427340300304620ustar00rootroot000000000000003 ]" @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) RippleAddressiN)addressreturncCs ||_dS)N)r)selfrr \/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/RippleAddress.py__init__szRippleAddress.__init__)r cCsddtjdfiS)Nrr)p UnicodeType)clsr r r get_fieldsszRippleAddress.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEstrr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/RippleGetAddress.cpython-36.pyc000066400000000000000000000020521361427340300311160ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s:eZdZdZd eeeddddZee dddZ dS) RippleGetAddressiN) address_n show_displayreturncCs|dk r |ng|_||_dS)N)rr )selfrr r _/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/RippleGetAddress.py__init__szRippleGetAddress.__init__)r cCsdtjtjfdtjdfdS)Nrr r)r)p UVarintType FLAG_REPEATEDBoolType)clsr r r get_fieldss zRippleGetAddress.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErintboolr classmethodrrr r r r r s  rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/RipplePayment.cpython-36.pyc000066400000000000000000000020261361427340300305070ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdeeeddddZeedddZdS) RipplePaymentN)amount destinationdestination_tagreturncCs||_||_||_dS)N)rr r )selfrr r r \/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/RipplePayment.py__init__szRipplePayment.__init__)r cCs$dtjdfdtjdfdtjdfdS)Nrrr r )r)p UVarintType UnicodeType)clsr r r get_fieldss  zRipplePayment.get_fields)NNN) __name__ __module__ __qualname__intstrr classmethodrrr r r rr s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/RippleSignTx.cpython-36.pyc000066400000000000000000000024261361427340300303120ustar00rootroot000000000000003 ] @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf) RipplePayment)DictList)Literalc @sBeZdZdZd eeeeeeeddddZee dddZ dS) RippleSignTxiN) address_nfeeflagssequencelast_ledger_sequencepaymentreturncCs4|dk r |ng|_||_||_||_||_||_dS)N)r r r r rr)selfr r r r rrr[/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/RippleSignTx.py__init__s zRippleSignTx.__init__)rcCsBdtjtjfdtjdfdtjdfdtjdfdtjdfdtdfdS) Nr r rr r rr)rr)p UVarintType FLAG_REPEATEDr)clsrrr get_fields"s      zRippleSignTx.get_fields)NNNNNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErintrr classmethodrrrrrrr sr N) rrrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs  python-trezor-0.11.6/src/trezorlib/messages/__pycache__/RippleSignedTx.cpython-36.pyc000066400000000000000000000017551361427340300306270ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s6eZdZdZd eeddddZeedddZdS) RippleSignedTxiN) signature serialized_txreturncCs||_||_dS)N)rr )selfrr r ]/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/RippleSignedTx.py__init__szRippleSignedTx.__init__)r cCsdtjdfdtjdfdS)Nrrr )r)p BytesType)clsr r r get_fieldss zRippleSignedTx.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEbytesr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/SdProtect.cpython-36.pyc000066400000000000000000000020141361427340300276220ustar00rootroot000000000000003 ] @s`ddlmZy(ddlmZmZddlmZed ZWne k rHYnXGdddej Z dS) )protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) SdProtectON) operationreturncCs ||_dS)N)r )selfr r X/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/SdProtect.py__init__szSdProtect.__init__)r cCsddtjdddfiS)Nrr SdProtectOperationTyperr)rrr)pEnumType)clsr r r get_fieldsszSdProtect.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEEnumTypeSdProtectOperationTyper classmethodrrr r r rrs rN)rrr) rrtypingrrtyping_extensionsrr ImportError MessageTyperr r r rs   python-trezor-0.11.6/src/trezorlib/messages/__pycache__/SdProtectOperationType.cpython-36.pyc000066400000000000000000000003601361427340300323470ustar00rootroot000000000000003 ]@sdZdZdZdS)N)ZDISABLEZENABLEZREFRESHrre/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/SdProtectOperationType.pyspython-trezor-0.11.6/src/trezorlib/messages/__pycache__/SelfTest.cpython-36.pyc000066400000000000000000000016251361427340300274530ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) SelfTest N)payloadreturncCs ||_dS)N)r )selfr r W/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/SelfTest.py__init__szSelfTest.__init__)r cCsddtjdfiS)Nr r)p BytesType)clsr r r get_fieldsszSelfTest.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEbytesr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/SetU2FCounter.cpython-36.pyc000066400000000000000000000016551361427340300303350ustar00rootroot000000000000003 ]1 @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) SetU2FCounter?N) u2f_counterreturncCs ||_dS)N)r )selfr r \/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/SetU2FCounter.py__init__szSetU2FCounter.__init__)r cCsddtjdfiS)Nr r)p UVarintType)clsr r r get_fieldsszSetU2FCounter.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEintr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/SignIdentity.cpython-36.pyc000066400000000000000000000022471361427340300303350ustar00rootroot000000000000003 ] @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf) IdentityType)DictList)Literalc@s:eZdZdZd eeeeddddZee dddZ dS) SignIdentity5N)identitychallenge_hiddenchallenge_visualecdsa_curve_namereturncCs||_||_||_||_dS)N)r r r r)selfr r r rr[/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/SignIdentity.py__init__szSignIdentity.__init__)rcCs,dtdfdtjdfdtjdfdtjdfdS)Nr rr r r)rr)rp BytesType UnicodeType)clsrrr get_fieldss  zSignIdentity.get_fields)NNNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErbytesstrr classmethodrrrrrrr s r N) rrrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs  python-trezor-0.11.6/src/trezorlib/messages/__pycache__/SignMessage.cpython-36.pyc000066400000000000000000000024711361427340300301270ustar00rootroot000000000000003 ]W @s`ddlmZy(ddlmZmZddlmZed ZWne k rHYnXGdd d ej Z d S) )protobuf)DictList)Literalc@s>eZdZdZd eeeeeddddZ e e dddZ dS) SignMessage&N) address_nmessage coin_name script_typereturncCs(|dk r |ng|_||_||_||_dS)N)r r rr)selfr r rrrZ/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/SignMessage.py__init__szSignMessage.__init__)rc Cs6dtjtjfdtjdfdtjdfdtjdd dfd S) Nr r rrrInputScriptTyperrrr )rrrr )rrrrr )p UVarintType FLAG_REPEATED BytesType UnicodeTypeEnumType)clsrrr get_fieldss   zSignMessage.get_fields)NNNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErintbytesstrEnumTypeInputScriptTyper classmethodrrrrrrr sr N)rrrrr ) rrtypingrrtyping_extensionsrr% ImportError MessageTyper rrrrs   python-trezor-0.11.6/src/trezorlib/messages/__pycache__/SignTx.cpython-36.pyc000066400000000000000000000026671361427340300271450ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc @sFeZdZdZd eeeeeeeeeedd ddZee dddZ dS) SignTxN) outputs_count inputs_count coin_nameversion lock_timeexpiry overwinteredversion_group_id timestamp branch_idreturnc Cs@||_||_||_||_||_||_||_||_| |_| |_ dS)N) r r r r r rrrrr) selfr r r r r rrrrrrU/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/SignTx.py__init__s zSignTx.__init__)rc Csjdtjdfdtjdfdtjdfdtjdfdtjdfdtjdfdtjdfd tjdfd tjdfd tjdfd S) Nr rr r r r rrrrr) r )p UVarintType UnicodeTypeBoolType)clsrrr get_fields(s         zSignTx.get_fields) NNNNNNNNNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEintstrboolr classmethodrr&rrrrr s rN) rr!typingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/SignedIdentity.cpython-36.pyc000066400000000000000000000020621361427340300306410ustar00rootroot000000000000003 ]  @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s8eZdZdZd eeeddddZeedddZ dS) SignedIdentity6N)address public_key signaturereturncCs||_||_||_dS)N)r r r )selfr r r r]/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/SignedIdentity.py__init__szSignedIdentity.__init__)r cCs$dtjdfdtjdfdtjdfdS)Nr rr r )r)p UnicodeType BytesType)clsrrr get_fieldss  zSignedIdentity.get_fields)NNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEstrbytesr classmethodrrrrrrr srN) rrtypingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/StellarAccountMergeOp.cpython-36.pyc000066400000000000000000000020241361427340300321160ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s6eZdZdZd eeddddZeedddZdS) StellarAccountMergeOpN)source_accountdestination_accountreturncCs||_||_dS)N)r r )selfr r r d/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/StellarAccountMergeOp.py__init__szStellarAccountMergeOp.__init__)r cCsdtjdfdtjdfdS)Nr rr )r)p UnicodeType)clsr r r get_fieldss z StellarAccountMergeOp.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEstrr classmethodrrr r r rr s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/StellarAddress.cpython-36.pyc000066400000000000000000000016551361427340300306410ustar00rootroot000000000000003 ]# @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) StellarAddressN)addressreturncCs ||_dS)N)r )selfr r ]/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/StellarAddress.py__init__szStellarAddress.__init__)r cCsddtjdfiS)Nr r)p UnicodeType)clsr r r get_fieldsszStellarAddress.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEstrr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/StellarAllowTrustOp.cpython-36.pyc000066400000000000000000000023101361427340300316600ustar00rootroot000000000000003 ]< @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s<eZdZdZd eeeeeddddZeedddZ dS) StellarAllowTrustOpN)source_accounttrusted_account asset_type asset_code is_authorizedreturncCs"||_||_||_||_||_dS)N)r r r r r )selfr r r r r rb/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/StellarAllowTrustOp.py__init__s zStellarAllowTrustOp.__init__)rcCs8dtjdfdtjdfdtjdfdtjdfdtjdfdS)Nr rr r r r )r)p UnicodeType UVarintType)clsrrr get_fieldss     zStellarAllowTrustOp.get_fields)NNNNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEstrintr classmethodrrrrrrr s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/StellarAssetType.cpython-36.pyc000066400000000000000000000020201361427340300311600ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdeeeddddZeedddZdS) StellarAssetTypeN)typecodeissuerreturncCs||_||_||_dS)N)rr r )selfrr r r _/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/StellarAssetType.py__init__szStellarAssetType.__init__)r cCs$dtjdfdtjdfdtjdfdS)Nrrr r )r)p UVarintType UnicodeType)clsr r r get_fieldss  zStellarAssetType.get_fields)NNN) __name__ __module__ __qualname__intstrr classmethodrrr r r rr s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/StellarBumpSequenceOp.cpython-36.pyc000066400000000000000000000020321361427340300321350ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s6eZdZdZd eeddddZeedddZ dS) StellarBumpSequenceOpN)source_accountbump_toreturncCs||_||_dS)N)r r )selfr r r d/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/StellarBumpSequenceOp.py__init__szStellarBumpSequenceOp.__init__)r cCsdtjdfdtjdfdS)Nr rr )r)p UnicodeType UVarintType)clsr r r get_fieldss z StellarBumpSequenceOp.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEstrintr classmethodrrr r r rr s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/StellarChangeTrustOp.cpython-36.pyc000066400000000000000000000021741361427340300317770ustar00rootroot000000000000003 ]I @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf)StellarAssetType)DictList)Literalc@s8eZdZdZd eeeddddZee dddZ dS) StellarChangeTrustOpN)source_accountassetlimitreturncCs||_||_||_dS)N)r r r )selfr r r rc/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/StellarChangeTrustOp.py__init__szStellarChangeTrustOp.__init__)rcCs"dtjdfdtdfdtjdfdS)Nr rr r )rr)p UnicodeTyper UVarintType)clsrrr get_fieldss zStellarChangeTrustOp.get_fields)NNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEstrrintr classmethodrrrrrrr sr N) rrrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs  python-trezor-0.11.6/src/trezorlib/messages/__pycache__/StellarCreateAccountOp.cpython-36.pyc000066400000000000000000000021411361427340300322620ustar00rootroot000000000000003 ]O @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s8eZdZdZd eeeddddZeedddZ dS) StellarCreateAccountOpN)source_account new_accountstarting_balancereturncCs||_||_||_dS)N)r r r )selfr r r re/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/StellarCreateAccountOp.py__init__szStellarCreateAccountOp.__init__)r cCs$dtjdfdtjdfdtjdfdS)Nr rr r )r)p UnicodeType SVarintType)clsrrr get_fieldss  z!StellarCreateAccountOp.get_fields)NNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEstrintr classmethodrrrrrrr srN) rrtypingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/StellarCreatePassiveOfferOp.cpython-36.pyc000066400000000000000000000025231361427340300332660ustar00rootroot000000000000003 ] @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf)StellarAssetType)DictList)Literalc @s>eZdZdZd eeeeeeddddZee dddZ dS) StellarCreatePassiveOfferOpN)source_account selling_asset buying_assetamountprice_nprice_dreturncCs(||_||_||_||_||_||_dS)N)r r r rrr)selfr r r rrrrj/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/StellarCreatePassiveOfferOp.py__init__s z$StellarCreatePassiveOfferOp.__init__)rcCs>dtjdfdtdfdtdfdtjdfdtjdfdtjdfdS) Nr rr r rrr)rr)p UnicodeTyper SVarintType UVarintType)clsrrr get_fields"s    z&StellarCreatePassiveOfferOp.get_fields)NNNNNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEstrrintr classmethodrrrrrrr sr N) rrrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs  python-trezor-0.11.6/src/trezorlib/messages/__pycache__/StellarGetAddress.cpython-36.pyc000066400000000000000000000020561361427340300312750ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s:eZdZdZd eeeddddZee dddZ dS) StellarGetAddressN) address_n show_displayreturncCs|dk r |ng|_||_dS)N)r r )selfr r r `/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/StellarGetAddress.py__init__szStellarGetAddress.__init__)r cCsdtjtjfdtjdfdS)Nr r r)r)p UVarintType FLAG_REPEATEDBoolType)clsr r r get_fieldss zStellarGetAddress.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErintboolr classmethodrrr r r rr s  rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/StellarManageDataOp.cpython-36.pyc000066400000000000000000000021021361427340300315210ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s8eZdZdZd eeeddddZeedddZ dS) StellarManageDataOpN)source_accountkeyvaluereturncCs||_||_||_dS)N)r r r )selfr r r rb/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/StellarManageDataOp.py__init__szStellarManageDataOp.__init__)r cCs$dtjdfdtjdfdtjdfdS)Nr rr r )r)p UnicodeType BytesType)clsrrr get_fieldss  zStellarManageDataOp.get_fields)NNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEstrbytesr classmethodrrrrrrr srN) rrtypingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/StellarManageOfferOp.cpython-36.pyc000066400000000000000000000025561361427340300317260ustar00rootroot000000000000003 ]= @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf)StellarAssetType)DictList)Literalc @s@eZdZdZd eeeeeeeddddZee dddZ dS) StellarManageOfferOpN)source_account selling_asset buying_assetamountprice_nprice_doffer_idreturncCs.||_||_||_||_||_||_||_dS)N)r r r rrrr)selfr r r rrrrrc/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/StellarManageOfferOp.py__init__s zStellarManageOfferOp.__init__)rc CsHdtjdfdtdfdtdfdtjdfdtjdfdtjdfdtjdfd S) Nr rr r rrrr)rr)p UnicodeTyper SVarintType UVarintType)clsrrr get_fields$s    zStellarManageOfferOp.get_fields)NNNNNNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEstrrintr classmethodrr!rrrrr s r N) rrrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs  python-trezor-0.11.6/src/trezorlib/messages/__pycache__/StellarPathPaymentOp.cpython-36.pyc000066400000000000000000000026351361427340300320040ustar00rootroot000000000000003 ] @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf)StellarAssetType)DictList)Literalc @sDeZdZdZd eeeeeeeeddddZe e dddZ dS) StellarPathPaymentOpN)source_account send_assetsend_maxdestination_accountdestination_assetdestination_amountpathsreturncCs:||_||_||_||_||_||_|dk r0|ng|_dS)N)r r r rrrr)selfr r r rrrrrc/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/StellarPathPaymentOp.py__init__s zStellarPathPaymentOp.__init__)rc CsHdtjdfdtdfdtjdfdtjdfdtdfdtjdfdttjfd S) Nr rr r rrrr)rr)p UnicodeTyper SVarintType FLAG_REPEATED)clsrrr get_fields$s    zStellarPathPaymentOp.get_fields)NNNNNNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEstrrintrr classmethodrr!rrrrr s r N) rrrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs  python-trezor-0.11.6/src/trezorlib/messages/__pycache__/StellarPaymentOp.cpython-36.pyc000066400000000000000000000022571361427340300311670ustar00rootroot000000000000003 ] @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf)StellarAssetType)DictList)Literalc@s:eZdZdZd eeeeddddZee dddZ dS) StellarPaymentOpN)source_accountdestination_accountassetamountreturncCs||_||_||_||_dS)N)r r r r)selfr r r rr_/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/StellarPaymentOp.py__init__szStellarPaymentOp.__init__)rcCs,dtjdfdtjdfdtdfdtjdfdS)Nr rr r r)rr)p UnicodeTyper SVarintType)clsrrr get_fieldss  zStellarPaymentOp.get_fields)NNNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEstrrintr classmethodrrrrrrr s r N) rrrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs  python-trezor-0.11.6/src/trezorlib/messages/__pycache__/StellarSetOptionsOp.cpython-36.pyc000066400000000000000000000032111361427340300316500ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@sJeZdZdZd eeeeeeeeeeeedd ddZee dddZ dS) StellarSetOptionsOpN) source_accountinflation_destination_account clear_flags set_flags master_weight low_thresholdmedium_thresholdhigh_threshold home_domain signer_type signer_key signer_weightreturnc CsL||_||_||_||_||_||_||_||_| |_| |_ | |_ | |_ dS)N) r r r r r rrrrrrr) selfr r r r r rrrrrrrrb/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/StellarSetOptionsOp.py__init__szStellarSetOptionsOp.__init__)rcCs~dtjdfdtjdfdtjdfdtjdfdtjdfdtjdfdtjdfd tjdfd tjdfd tjdfd tjdfd tjdfd S)Nr rr r r r rrrrrrr) r )p UnicodeType UVarintType BytesType)clsrrr get_fields,s           zStellarSetOptionsOp.get_fields) NNNNNNNNNNNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEstrintbytesr classmethodrr*rrrrr s rN) rr%typingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/StellarSignTx.cpython-36.pyc000066400000000000000000000031741361427340300304660ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@sNeZdZdZd eeeeeeeeeeeeedd ddZe e dddZ dS) StellarSignTxN) address_nnetwork_passphrasesource_accountfeesequence_numbertimebounds_starttimebounds_end memo_type memo_textmemo_id memo_hashnum_operationsreturnc CsX|dk r |ng|_||_||_||_||_||_||_||_| |_| |_ | |_ | |_ dS)N) r r r r r rrrrrrr) selfr r r r r rrrrrrrr\/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/StellarSignTx.py__init__szStellarSignTx.__init__)rcCsdtjtjfdtjdfdtjdfdtjdfdtjdfdtjdfdtjdfd tjdfd tjdfd tjdfd tjdfd tjdfd S)Nr r rr r r rrrrrrr) r )p UVarintType FLAG_REPEATED UnicodeType BytesType)clsrrr get_fields,s           zStellarSignTx.get_fields) NNNNNNNNNNNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErintstrbytesr classmethodrr+rrrrr s rN) rr%typingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/StellarSignedTx.cpython-36.pyc000066400000000000000000000017561361427340300310030ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s6eZdZdZd eeddddZeedddZdS) StellarSignedTxN) public_key signaturereturncCs||_||_dS)N)r r )selfr r r ^/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/StellarSignedTx.py__init__szStellarSignedTx.__init__)r cCsdtjdfdtjdfdS)Nr rr )r)p BytesType)clsr r r get_fieldss zStellarSignedTx.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEbytesr classmethodrrr r r rr s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/StellarTxOpRequest.cpython-36.pyc000066400000000000000000000010731361427340300315110ustar00rootroot000000000000003 ]? @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@seZdZdZdS)StellarTxOpRequestN)__name__ __module__ __qualname__MESSAGE_WIRE_TYPEr r a/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/StellarTxOpRequest.pyr srN) rptypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/Success.cpython-36.pyc000066400000000000000000000016211361427340300273260ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) SuccessrN)messagereturncCs ||_dS)N)r)selfrr V/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/Success.py__init__szSuccess.__init__)r cCsddtjdfiS)Nrr)p UnicodeType)clsr r r get_fieldsszSuccess.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEstrr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/TezosAddress.cpython-36.pyc000066400000000000000000000016451361427340300303360ustar00rootroot000000000000003 ]! @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) TezosAddressN)addressreturncCs ||_dS)N)r )selfr r [/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/TezosAddress.py__init__szTezosAddress.__init__)r cCsddtjdfiS)Nr r)p UnicodeType)clsr r r get_fieldsszTezosAddress.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEstrr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/TezosBallotOp.cpython-36.pyc000066400000000000000000000022711361427340300304610ustar00rootroot000000000000003 ] @s`ddlmZy(ddlmZmZddlmZed ZWne k rHYnXGdddej Z dS) )protobuf)DictList)Literalc@s6eZdZdeeeeddddZeedddZ dS) TezosBallotOpN)sourceperiodproposalballotreturncCs||_||_||_||_dS)N)r r r r )selfr r r r r\/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/TezosBallotOp.py__init__szTezosBallotOp.__init__)r c Cs4dtjdfdtjdfdtjdfdtjdd dfd S) Nr rr r r TezosBallotTyperr)rr)rrr)p BytesType UVarintTypeEnumType)clsrrr get_fieldss   zTezosBallotOp.get_fields)NNNN) __name__ __module__ __qualname__bytesintEnumTypeTezosBallotTyper classmethodrrrrrrrs rN)rrr) rrtypingrrtyping_extensionsrr ImportError MessageTyperrrrrs   python-trezor-0.11.6/src/trezorlib/messages/__pycache__/TezosBallotType.cpython-36.pyc000066400000000000000000000003371361427340300310250ustar00rootroot000000000000003 ]@sdZdZdZdS)N)ZYayZNayPassrr^/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/TezosBallotType.pyspython-trezor-0.11.6/src/trezorlib/messages/__pycache__/TezosContractID.cpython-36.pyc000066400000000000000000000020631361427340300307360ustar00rootroot000000000000003 ] @s`ddlmZy(ddlmZmZddlmZed ZWne k rHYnXGdddej Z dS) )protobuf)DictList)Literalc@s2eZdZdeeddddZeedddZdS) TezosContractIDN)taghashreturncCs||_||_dS)N)r r )selfr r r ^/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/TezosContractID.py__init__szTezosContractID.__init__)r cCs dtjdddfdtjdfdS)Nr TezosContractTyperrr )rr)rr)pEnumType BytesType)clsr r r get_fieldsszTezosContractID.get_fields)NN) __name__ __module__ __qualname__EnumTypeTezosContractTypebytesr classmethodrrr r r rrs rN)rr) rrtypingrrtyping_extensionsrr ImportError MessageTyperr r r rs   python-trezor-0.11.6/src/trezorlib/messages/__pycache__/TezosContractType.cpython-36.pyc000066400000000000000000000003341361427340300313620ustar00rootroot000000000000003 ]@s dZdZdS)N)ZImplicitZ Originatedrr`/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/TezosContractType.pyspython-trezor-0.11.6/src/trezorlib/messages/__pycache__/TezosDelegationOp.cpython-36.pyc000066400000000000000000000023011361427340300313110ustar00rootroot000000000000003 ], @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc @s:eZdZdeeeeeeddddZeedddZdS) TezosDelegationOpN)sourcefeecounter gas_limit storage_limitdelegatereturncCs(||_||_||_||_||_||_dS)N)rr r r r r )selfrr r r r r r`/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/TezosDelegationOp.py__init__s zTezosDelegationOp.__init__)rcCsBdtjdfdtjdfdtjdfdtjdfdtjdfdtjdfdS) Nrrr r r r r )r)p BytesType UVarintType)clsrrr get_fieldss      zTezosDelegationOp.get_fields)NNNNNN) __name__ __module__ __qualname__bytesintr classmethodrrrrrrr srN) rrtypingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/TezosGetAddress.cpython-36.pyc000066400000000000000000000020461361427340300307720ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s:eZdZdZd eeeddddZee dddZ dS) TezosGetAddressN) address_n show_displayreturncCs|dk r |ng|_||_dS)N)r r )selfr r r ^/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/TezosGetAddress.py__init__szTezosGetAddress.__init__)r cCsdtjtjfdtjdfdS)Nr r r)r)p UVarintType FLAG_REPEATEDBoolType)clsr r r get_fieldss zTezosGetAddress.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErintboolr classmethodrrr r r rr s  rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/TezosGetPublicKey.cpython-36.pyc000066400000000000000000000020561361427340300312750ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s:eZdZdZd eeeddddZee dddZ dS) TezosGetPublicKeyN) address_n show_displayreturncCs|dk r |ng|_||_dS)N)r r )selfr r r `/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/TezosGetPublicKey.py__init__szTezosGetPublicKey.__init__)r cCsdtjtjfdtjdfdS)Nr r r)r)p UVarintType FLAG_REPEATEDBoolType)clsr r r get_fieldss zTezosGetPublicKey.get_fields)NN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErintboolr classmethodrrr r r rr s  rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/TezosManagerTransfer.cpython-36.pyc000066400000000000000000000020251361427340300320210ustar00rootroot000000000000003 ] @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf)TezosContractID)DictList)Literalc@s2eZdZdeeddddZeedddZdS) TezosManagerTransferN) destinationamountreturncCs||_||_dS)N)r r )selfr r rc/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/TezosManagerTransfer.py__init__szTezosManagerTransfer.__init__)r cCsdtdfdtjdfdS)Nr rr )rr)rp UVarintType)clsrrr get_fieldsszTezosManagerTransfer.get_fields)NN) __name__ __module__ __qualname__rintr classmethodrrrrrrr s r N) rrrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs  python-trezor-0.11.6/src/trezorlib/messages/__pycache__/TezosOriginationOp.cpython-36.pyc000066400000000000000000000027571361427340300315370ustar00rootroot000000000000003 ]n @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@sDeZdZdeeeeeeeeeeedd ddZeedddZ dS) TezosOriginationOpN) sourcefeecounter gas_limit storage_limitmanager_pubkeybalance spendable delegatabledelegatescriptreturnc CsF||_||_||_||_||_||_||_||_| |_| |_ | |_ dS)N) rr r r r r rrrrr) selfrr r r r r rrrrrra/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/TezosOriginationOp.py__init__szTezosOriginationOp.__init__)rc Cstdtjdfdtjdfdtjdfdtjdfdtjdfdtjdfdtjdfd tjdfd tjdfd tjdfd tjdfd S)Nrrr r r r r rrrrr) r )p BytesType UVarintTypeBoolType)clsrrr get_fields)s          zTezosOriginationOp.get_fields) NNNNNNNNNNN) __name__ __module__ __qualname__bytesintboolr classmethodrr'rrrrr s rN) rr"typingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/TezosParametersManager.cpython-36.pyc000066400000000000000000000021631361427340300323430ustar00rootroot000000000000003 ]i @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf)TezosManagerTransfer)DictList)Literalc@s4eZdZdeeeddddZeedddZ dS) TezosParametersManagerN) set_delegatecancel_delegatetransferreturncCs||_||_||_dS)N)r r r )selfr r r re/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/TezosParametersManager.py__init__szTezosParametersManager.__init__)r cCs"dtjdfdtjdfdtdfdS)Nr rr r )rr)p BytesTypeBoolTyper)clsrrr get_fieldss  z!TezosParametersManager.get_fields)NNN) __name__ __module__ __qualname__bytesboolrr classmethodrrrrrrr s r N) rrrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs  python-trezor-0.11.6/src/trezorlib/messages/__pycache__/TezosProposalOp.cpython-36.pyc000066400000000000000000000020711361427340300310410ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s8eZdZdeeeeddddZeedddZ dS) TezosProposalOpN)sourceperiod proposalsreturncCs"||_||_|dk r|ng|_dS)N)rr r )selfrr r r ^/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/TezosProposalOp.py__init__szTezosProposalOp.__init__)r cCs&dtjdfdtjdfdtjtjfdS)Nrrr r )r)p BytesType UVarintType FLAG_REPEATED)clsr r r get_fieldss  zTezosProposalOp.get_fields)NNN) __name__ __module__ __qualname__bytesintrr classmethodrrr r r rr s  rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/TezosPublicKey.cpython-36.pyc000066400000000000000000000016601361427340300306350ustar00rootroot000000000000003 ]/ @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) TezosPublicKeyN) public_keyreturncCs ||_dS)N)r )selfr r ]/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/TezosPublicKey.py__init__szTezosPublicKey.__init__)r cCsddtjdfiS)Nr r)p UnicodeType)clsr r r get_fieldsszTezosPublicKey.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEstrr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/TezosRevealOp.cpython-36.pyc000066400000000000000000000022631361427340300304630ustar00rootroot000000000000003 ]0 @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc @s:eZdZdeeeeeeddddZeedddZdS) TezosRevealOpN)sourcefeecounter gas_limit storage_limit public_keyreturncCs(||_||_||_||_||_||_dS)N)rr r r r r )selfrr r r r r r\/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/TezosRevealOp.py__init__s zTezosRevealOp.__init__)rcCsBdtjdfdtjdfdtjdfdtjdfdtjdfdtjdfdS) Nrrr r r r r )r)p BytesType UVarintType)clsrrr get_fieldss      zTezosRevealOp.get_fields)NNNNNN) __name__ __module__ __qualname__bytesintr classmethodrrrrrrr srN) rrtypingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/TezosSignTx.cpython-36.pyc000066400000000000000000000031751361427340300301650ustar00rootroot000000000000003 ] @sddlmZddlmZddlmZddlmZddlmZddlmZddlmZy d d l m Z m Z d d l m Z Wnek rYnXGd d d ejZdS))protobuf) TezosBallotOp)TezosDelegationOp)TezosOriginationOp)TezosProposalOp) TezosRevealOp)TezosTransactionOp)DictList)Literalc @sFeZdZdZd eeeeee e e e dd ddZ eedddZdS) TezosSignTxN) address_nbranchreveal transaction origination delegationproposalballotreturnc Cs@|dk r |ng|_||_||_||_||_||_||_||_dS)N)rrrrrrrr) selfrrrrrrrrrZ/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/TezosSignTx.py__init__s zTezosSignTx.__init__)rc CsLdtjtjfdtjdfdtdfdtdfdtdfdtdfdtdfd t dfd S) Nrrr rrrrrr)rr) p UVarintType FLAG_REPEATED BytesTyperr rrrr)clsrrr get_fields+s  zTezosSignTx.get_fields)NNNNNNNN)__name__ __module__ __qualname__MESSAGE_WIRE_TYPEr intbytesrr rrrrr classmethodr r(rrrrrs rN)rr#rrrrrr typingr r typing_extensionsr ImportError MessageTyperrrrrs       python-trezor-0.11.6/src/trezorlib/messages/__pycache__/TezosSignedTx.cpython-36.pyc000066400000000000000000000020721361427340300304710ustar00rootroot000000000000003 ]: @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s8eZdZdZd eeeddddZeedddZ dS) TezosSignedTxN) signaturesig_op_contentsoperation_hashreturncCs||_||_||_dS)N)r r r )selfr r r r\/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/TezosSignedTx.py__init__szTezosSignedTx.__init__)r cCs$dtjdfdtjdfdtjdfdS)Nr rr r )r)p UnicodeType BytesType)clsrrr get_fieldss  zTezosSignedTx.get_fields)NNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEstrbytesr classmethodrrrrrrr srN) rrtypingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/TezosTransactionOp.cpython-36.pyc000066400000000000000000000027371361427340300315400ustar00rootroot000000000000003 ]? @spddlmZddlmZddlmZy ddlmZmZddlm Z Wne k rXYnXGdd d ej Z d S) )protobuf)TezosContractID)TezosParametersManager)DictList)Literalc @s@eZdZdeeeeeeeeedd ddZee dddZ dS) TezosTransactionOpN) sourcefeecounter gas_limit storage_limitamount destination parametersparameters_managerreturnc Cs:||_||_||_||_||_||_||_||_| |_dS)N) r r r rrrrrr) selfr r r rrrrrrra/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/TezosTransactionOp.py__init__s zTezosTransactionOp.__init__)rc Cs\dtjdfdtjdfdtjdfdtjdfdtjdfdtjdfdtdfd tjdfd tdfd S) Nr rr r rrrrrr) r )p BytesType UVarintTyperr)clsrrr get_fields(s       zTezosTransactionOp.get_fields) NNNNNNNNN) __name__ __module__ __qualname__bytesintrrr classmethodrr%rrrrr s r N) rr!rrtypingrrtyping_extensionsr ImportError MessageTyper rrrrs   python-trezor-0.11.6/src/trezorlib/messages/__pycache__/TransactionType.cpython-36.pyc000066400000000000000000000035561361427340300310560ustar00rootroot000000000000003 ]; @s|ddlmZddlmZddlmZddlmZy ddlmZmZddl m Z Wne k rdYnXGd d d ej Z d S) )protobuf) TxInputType)TxOutputBinType) TxOutputType)DictList)Literalc@sVeZdZdeeeeeeeeeeeeee eeeddddZ e e dddZ dS) TransactionTypeN)versioninputs bin_outputs lock_timeoutputs inputs_cnt outputs_cnt extra_dataextra_data_lenexpiry overwinteredversion_group_id timestamp branch_idreturncCs|||_|dk r|ng|_|dk r$|ng|_||_|dk r<|ng|_||_||_||_| |_| |_ | |_ | |_ | |_ ||_ dS)N)r r rrrrrrrrrrrr)selfr r rrrrrrrrrrrrr^/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/TransactionType.py__init__szTransactionType.__init__)rcCsdtjdfdttjfdttjfdtjdfdttjfdtjdfdtjdfd tjdfd tjdfd tjdfd tjdfd tjdfdtjdfdtjdfdS)Nr rr rrrrrrrrrrrr)rr )p UVarintTyper FLAG_REPEATEDrr BytesTypeBoolType)clsrrr get_fields3s             zTransactionType.get_fields)NNNNNNNNNNNNNN)__name__ __module__ __qualname__intr rrrbytesboolr classmethodrr1rrrrr s"*r N)rr+rrrtypingrr typing_extensionsr ImportError MessageTyper rrrrs    python-trezor-0.11.6/src/trezorlib/messages/__pycache__/TxAck.cpython-36.pyc000066400000000000000000000016401361427340300267310ustar00rootroot000000000000003 ]A @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf)TransactionType)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) TxAckN)txreturncCs ||_dS)N)r )selfr rT/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/TxAck.py__init__szTxAck.__init__)r cCsddtdfiS)Nrr r)r)clsrrr get_fieldsszTxAck.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErr classmethodrrrrrrr s r N) rprtypingrrtyping_extensionsr ImportError MessageTyper rrrrs  python-trezor-0.11.6/src/trezorlib/messages/__pycache__/TxInputType.cpython-36.pyc000066400000000000000000000034511361427340300301760ustar00rootroot000000000000003 ] @slddlmZddlmZy(ddlmZmZddlmZed Z Wne k rTYnXGd d d ej Z d S) )protobuf)MultisigRedeemScriptType)DictList)Literalc@sJeZdZdeeeeeeeeeeeeedd ddZe e dddZ dS) TxInputTypeN) address_n prev_hash prev_index script_sigsequence script_typemultisigamount decred_treedecred_script_versionprev_block_hash_bip115prev_block_height_bip115returnc CsX|dk r |ng|_||_||_||_||_||_||_||_| |_| |_ | |_ | |_ dS)N) r r rrrrrrrrrr) selfr r rrrrrrrrrrrZ/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/TxInputType.py__init__szTxInputType.__init__)rcCsdtjtjfdtjdfdtjdfdtjdfdtjdfdtjdddfd tdfdtjdfdtjdfdtjdfdtjdfdtjdfd S)Nr r rrrrrInputScriptTyperrr r rrrrrr) rrr r  )rrrr r )p UVarintType FLAG_REPEATED BytesTypeEnumTyper)clsrrr get_fields.s         zTxInputType.get_fields) NNNNNNNNNNNN) __name__ __module__ __qualname__rintbytesEnumTypeInputScriptTyperr classmethodrr,rrrrr sr N)rrrr r ) rr&rtypingrrtyping_extensionsrr2 ImportError MessageTyper rrrrs    python-trezor-0.11.6/src/trezorlib/messages/__pycache__/TxOutputBinType.cpython-36.pyc000066400000000000000000000020461361427340300310270ustar00rootroot000000000000003 ]@ @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdeeeddddZeedddZdS) TxOutputBinTypeN)amount script_pubkeydecred_script_versionreturncCs||_||_||_dS)N)rr r )selfrr r r ^/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/TxOutputBinType.py__init__szTxOutputBinType.__init__)r cCs$dtjdfdtjdfdtjdfdS)Nrrr r )r)p UVarintType BytesType)clsr r r get_fieldss  zTxOutputBinType.get_fields)NNN) __name__ __module__ __qualname__intbytesr classmethodrrr r r rr s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/TxOutputType.cpython-36.pyc000066400000000000000000000032431361427340300303760ustar00rootroot000000000000003 ]= @slddlmZddlmZy(ddlmZmZddlmZed Z Wne k rTYnXGd d d ej Z d S))protobuf)MultisigRedeemScriptType)DictList)Literalc @sDeZdZdeeeeeeeeeedd ddZ e e dddZ dS) TxOutputTypeN) address address_namount script_typemultisigop_return_datadecred_script_versionblock_hash_bip115block_height_bip115returnc CsF||_|dk r|ng|_||_||_||_||_||_||_| |_dS)N) r rrrrrrrr) selfr rrrrrrrrr[/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/TxOutputType.py__init__s zTxOutputType.__init__)rc Csfdtjdfdtjtjfdtjdfdtjdddfd tdfd tjdfdtjdfdtjdfdtjdfd S)Nr rrrrOutputScriptTyperrr r r rrrrr) rrr r r  )rrrr r r )p UnicodeType UVarintType FLAG_REPEATEDEnumTyper BytesType)clsrrr get_fields(s      zTxOutputType.get_fields) NNNNNNNNN) __name__ __module__ __qualname__strrintEnumTypeOutputScriptTyperbytesr classmethodrr'rrrrr s r N)rrrr r r ) rr rtypingrrtyping_extensionsrr- ImportError MessageTyper rrrrs    python-trezor-0.11.6/src/trezorlib/messages/__pycache__/TxRequest.cpython-36.pyc000066400000000000000000000024001361427340300276560ustar00rootroot000000000000003 ] @sxddlmZddlmZddlmZy(ddlmZmZddlm Z e d Z Wne k r`YnXGd d d ej Z d S))protobuf)TxRequestDetailsType)TxRequestSerializedType)DictList)Literalc@s8eZdZdZd eeeddddZee dddZ dS) TxRequestN) request_typedetails serializedreturncCs||_||_||_dS)N)rrr)selfrrrrX/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/TxRequest.py__init__szTxRequest.__init__)rcCs&dtjdd dfdtdfd tdfd S) Nr RequestTyperrrr r rr)rrr )rrrr r )pEnumTyperr)clsrrr get_fieldsszTxRequest.get_fields)NNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEEnumTypeRequestTyperrr classmethodrrrrrrr sr N)rrrr r )rrrrtypingrrtyping_extensionsr r ImportError MessageTyper rrrrs     python-trezor-0.11.6/src/trezorlib/messages/__pycache__/TxRequestDetailsType.cpython-36.pyc000066400000000000000000000021641361427340300320350ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s6eZdZdeeeeddddZeedddZdS) TxRequestDetailsTypeN) request_indextx_hashextra_data_lenextra_data_offsetreturncCs||_||_||_||_dS)N)rr r r )selfrr r r rc/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/TxRequestDetailsType.py__init__szTxRequestDetailsType.__init__)r cCs.dtjdfdtjdfdtjdfdtjdfdS)Nrrr r r )r)p UVarintType BytesType)clsrrr get_fieldss   zTxRequestDetailsType.get_fields)NNNN) __name__ __module__ __qualname__intbytesr classmethodrrrrrrr s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/TxRequestSerializedType.cpython-36.pyc000066400000000000000000000021031361427340300325340ustar00rootroot000000000000003 ]$ @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdeeeddddZeedddZdS) TxRequestSerializedTypeN)signature_index signature serialized_txreturncCs||_||_||_dS)N)rr r )selfrr r r f/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/TxRequestSerializedType.py__init__sz TxRequestSerializedType.__init__)r cCs$dtjdfdtjdfdtjdfdS)Nrrr r )r)p UVarintType BytesType)clsr r r get_fieldss  z"TxRequestSerializedType.get_fields)NNN) __name__ __module__ __qualname__intbytesr classmethodrrr r r rr s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/VerifyMessage.cpython-36.pyc000066400000000000000000000021431361427340300304670ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s:eZdZdZd eeeeddddZeedddZ dS) VerifyMessage'N)address signaturemessage coin_namereturncCs||_||_||_||_dS)N)r r r r )selfr r r r r\/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/VerifyMessage.py__init__szVerifyMessage.__init__)r cCs.dtjdfdtjdfdtjdfdtjdfdS)Nr rr r r )r)p UnicodeType BytesType)clsrrr get_fieldss   zVerifyMessage.get_fields)NNNN) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEstrbytesr classmethodrrrrrrr s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/WebAuthnAddResidentCredential.cpython-36.pyc000066400000000000000000000017571361427340300335470ustar00rootroot000000000000003 ]J @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) WebAuthnAddResidentCredentiali"N) credential_idreturncCs ||_dS)N)r)selfrr l/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/WebAuthnAddResidentCredential.py__init__sz&WebAuthnAddResidentCredential.__init__)r cCsddtjdfiS)Nrr)p BytesType)clsr r r get_fieldssz(WebAuthnAddResidentCredential.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEbytesr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/WebAuthnCredential.cpython-36.pyc000066400000000000000000000027171361427340300314350ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc @sBeZdZdeeeeeeeeeedd ddZee dddZ dS) WebAuthnCredentialN) indexidrp_idrp_nameuser_id user_nameuser_display_name creation_time hmac_secretuse_sign_countreturnc Cs@||_||_||_||_||_||_||_||_| |_| |_ dS)N) rr r r r r rrrr) selfrr r r r r rrrrra/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/WebAuthnCredential.py__init__s zWebAuthnCredential.__init__)rc Csjdtjdfdtjdfdtjdfdtjdfdtjdfdtjdfdtjdfd tjdfd tjdfd tjdfd S) Nrrr r r r r rrrr) r )p UVarintType BytesType UnicodeTypeBoolType)clsrrr get_fields's         zWebAuthnCredential.get_fields) NNNNNNNNNN) __name__ __module__ __qualname__intbytesstrboolr classmethodrr&rrrrr s rN) rr typingrrtyping_extensionsr ImportError MessageTyperrrrrs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/WebAuthnCredentials.cpython-36.pyc000066400000000000000000000020121361427340300316040ustar00rootroot000000000000003 ] @sdddlmZddlmZy ddlmZmZddlmZWne k rLYnXGdddej Z d S) )protobuf)WebAuthnCredential)DictList)Literalc@s8eZdZdZd eeddddZeedddZ dS) WebAuthnCredentialsi!N) credentialsreturncCs|dk r |ng|_dS)N)r )selfr r b/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/WebAuthnCredentials.py__init__szWebAuthnCredentials.__init__)r cCsddttjfiS)Nrr )rp FLAG_REPEATED)clsr r r get_fieldsszWebAuthnCredentials.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPErrr classmethodrrr r r rr s r N) rrrtypingrrtyping_extensionsr ImportError MessageTyper r r r rs  WebAuthnListResidentCredentials.cpython-36.pyc000066400000000000000000000011251361427340300340630ustar00rootroot00000000000000python-trezor-0.11.6/src/trezorlib/messages/__pycache__3 ]L @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@seZdZdZdS)WebAuthnListResidentCredentialsi N)__name__ __module__ __qualname__MESSAGE_WIRE_TYPEr r n/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/WebAuthnListResidentCredentials.pyr srN) rptypingrrtyping_extensionsr ImportError MessageTyperr r r r s WebAuthnRemoveResidentCredential.cpython-36.pyc000066400000000000000000000017631361427340300342320ustar00rootroot00000000000000python-trezor-0.11.6/src/trezorlib/messages/__pycache__3 ]- @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) WebAuthnRemoveResidentCredentiali#N)indexreturncCs ||_dS)N)r)selfrr o/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/WebAuthnRemoveResidentCredential.py__init__sz)WebAuthnRemoveResidentCredential.__init__)r cCsddtjdfiS)Nrr)p UVarintType)clsr r r get_fieldssz+WebAuthnRemoveResidentCredential.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEintr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/WipeDevice.cpython-36.pyc000066400000000000000000000010531361427340300277410ustar00rootroot000000000000003 ]5 @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@seZdZdZdS) WipeDeviceN)__name__ __module__ __qualname__MESSAGE_WIRE_TYPEr r Y/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/WipeDevice.pyr srN) rptypingrrtyping_extensionsr ImportError MessageTyperr r r rs python-trezor-0.11.6/src/trezorlib/messages/__pycache__/WordAck.cpython-36.pyc000066400000000000000000000016161361427340300272540ustar00rootroot000000000000003 ] @sXddlmZy ddlmZmZddlmZWnek r@YnXGdddej Z dS))protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) WordAck/N)wordreturncCs ||_dS)N)r )selfr r V/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/WordAck.py__init__szWordAck.__init__)r cCsddtjdfiS)Nr r)p UnicodeType)clsr r r get_fieldsszWordAck.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEstrr classmethodrrr r r r r s rN) rrtypingrrtyping_extensionsr ImportError MessageTyperr r r r s python-trezor-0.11.6/src/trezorlib/messages/__pycache__/WordRequest.cpython-36.pyc000066400000000000000000000020011361427340300301730ustar00rootroot000000000000003 ]u @s`ddlmZy(ddlmZmZddlmZed ZWne k rHYnXGdddej Z dS) )protobuf)DictList)Literalc@s4eZdZdZd eddddZeedddZdS) WordRequest.N)typereturncCs ||_dS)N)r )selfr r Z/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/WordRequest.py__init__szWordRequest.__init__)r cCsddtjdddfiS)Nrr WordRequestTyperr)rrr)pEnumType)clsr r r get_fieldsszWordRequest.get_fields)N) __name__ __module__ __qualname__MESSAGE_WIRE_TYPEEnumTypeWordRequestTyper classmethodrrr r r rrs rN)rrr) rrtypingrrtyping_extensionsrr ImportError MessageTyperr r r rs   python-trezor-0.11.6/src/trezorlib/messages/__pycache__/WordRequestType.cpython-36.pyc000066400000000000000000000003501361427340300310420ustar00rootroot000000000000003 ]@sdZdZdZdS)N)ZPlainZMatrix9ZMatrix6rr^/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/WordRequestType.pyspython-trezor-0.11.6/src/trezorlib/messages/__pycache__/__init__.cpython-36.pyc000066400000000000000000000271461361427340300274670ustar00rootroot000000000000003 ]5@sLddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZdd lmZdd l m Z dd l m Z dd l m Z dd l m Z ddl m Z ddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZdd lmZdd!l m Z dd"l!m!Z!dd#l"m"Z"dd$l#m#Z#dd%l$m$Z$dd&l%m%Z%dd'l&m&Z&dd(l'm'Z'dd)l(m(Z(dd*l)m)Z)dd+l*m*Z*dd,l+m+Z+dd-l,m,Z,dd.l-m-Z-dd/l.m.Z.dd0l/m/Z/dd1l0m0Z0dd2l1m1Z1dd3l2m2Z2dd4l3m3Z3dd5l4m4Z4dd6l5m5Z5dd7l6m6Z6dd8l7m7Z7dd9l8m8Z8dd:l9m9Z9dd;l:m:Z:ddl=m=Z=dd?l>m>Z>dd@l?m?Z?ddAl@m@Z@ddBlAmAZAddClBmBZBddDlCmCZCddElDmDZDddFlEmEZEddGlFmFZFddHlGmGZGddIlHmHZHddJlImIZIddKlJmJZJddLlKmKZKddMlLmLZLddNlMmMZMddOlNmNZNddPlOmOZOddQlPmPZPddRlQmQZQddSlRmRZRddTlSmSZSddUlTmTZTddVlUmUZUddWlVmVZVddXlWmWZWddYlXmXZXddZlYmYZYdd[lZmZZZdd\l[m[Z[dd]l\m\Z\dd^l]m]Z]dd_l^m^Z^dd`l_m_Z_ddal`m`Z`ddblamaZaddclbmbZbdddlcmcZcddeldmdZdddflemeZeddglfmfZfddhlgmgZgddilhmhZhddjlimiZiddkljmjZjddllkmkZkddmllmlZlddnlmmmZmddolnmnZnddplomoZoddqlpmpZpddrlqmqZqddslrmrZrddtlsmsZsddultmtZtddvlumuZuddwlvmvZvddxlwmwZwddylxmxZxddzlymyZydd{lzmzZzdd|l{m{Z{dd}l|m|Z|dd~l}m}Z}ddl~m~Z~ddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZdd lm Z dd lm Z dd lm Z dd lm Z dd lm Z ddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZdS()Address) ApplyFlags) ApplySettings) BackupDevice)BinanceAddress)BinanceCancelMsg) BinanceCoin)BinanceGetAddress)BinanceGetPublicKey)BinanceInputOutput)BinanceOrderMsg)BinancePublicKey) BinanceSignTx)BinanceSignedTx)BinanceTransferMsg)BinanceTxRequest) ButtonAck) ButtonRequest)Cancel)CardanoAddress)CardanoGetAddress)CardanoGetPublicKey)CardanoPublicKey) CardanoSignTx)CardanoSignedTx) CardanoTxAck)CardanoTxInputType)CardanoTxOutputType)CardanoTxRequest) ChangePin)ChangeWipeCode)CipherKeyValue)CipheredKeyValue) ClearSession) CosiCommit)CosiCommitment)CosiSign) CosiSignature)DebugLinkDecision)DebugLinkFlashErase)DebugLinkGetState)DebugLinkLayout) DebugLinkLog)DebugLinkMemory)DebugLinkMemoryRead)DebugLinkMemoryWrite)DebugLinkState) DebugLinkStop)DebugMoneroDiagAck)DebugMoneroDiagRequest)ECDHSessionKey)Entropy) EntropyAck)EntropyRequest)EosActionBuyRam)EosActionBuyRamBytes)EosActionCommon)EosActionDelegate)EosActionDeleteAuth)EosActionLinkAuth)EosActionNewAccount)EosActionRefund)EosActionSellRam)EosActionTransfer)EosActionUndelegate)EosActionUnknown)EosActionUnlinkAuth)EosActionUpdateAuth)EosActionVoteProducer)EosAsset)EosAuthorization)EosAuthorizationAccount)EosAuthorizationKey)EosAuthorizationWait)EosGetPublicKey)EosPermissionLevel) EosPublicKey) EosSignTx) EosSignedTx)EosTxActionAck)EosTxActionRequest) EosTxHeader)EthereumAddress)EthereumGetAddress)EthereumGetPublicKey)EthereumMessageSignature)EthereumPublicKey)EthereumSignMessage)EthereumSignTx) EthereumTxAck)EthereumTxRequest)EthereumVerifyMessage)Failure)Features) FirmwareErase)FirmwareRequest)FirmwareUpload) GetAddress)GetECDHSessionKey) GetEntropy) GetFeatures)GetNextU2FCounter) GetPublicKey)HDNodePathType) HDNodeType) IdentityType) Initialize) LiskAddress)LiskDelegateType)LiskGetAddress)LiskGetPublicKey)LiskMessageSignature)LiskMultisignatureType) LiskPublicKey)LiskSignMessage) LiskSignTx)LiskSignatureType) LiskSignedTx)LiskTransactionAsset)LiskTransactionCommon)LiskVerifyMessage) LoadDevice)MessageSignature)MoneroAccountPublicAddress) MoneroAddress)MoneroExportedKeyImage)MoneroGetAddress)MoneroGetTxKeyAck)MoneroGetTxKeyRequest)MoneroGetWatchKey)MoneroKeyImageExportInitAck)MoneroKeyImageExportInitRequest)MoneroKeyImageSyncFinalAck)MoneroKeyImageSyncFinalRequest)MoneroKeyImageSyncStepAck)MoneroKeyImageSyncStepRequest)MoneroLiveRefreshFinalAck)MoneroLiveRefreshFinalRequest)MoneroLiveRefreshStartAck)MoneroLiveRefreshStartRequest)MoneroLiveRefreshStepAck)MoneroLiveRefreshStepRequest)MoneroMultisigKLRki)MoneroOutputEntry)MoneroRctKeyPublic)MoneroRingCtSig)MoneroSubAddressIndicesList) MoneroTransactionAllInputsSetAck)$MoneroTransactionAllInputsSetRequest)MoneroTransactionAllOutSetAck)!MoneroTransactionAllOutSetRequest)MoneroTransactionData)!MoneroTransactionDestinationEntry)MoneroTransactionFinalAck)MoneroTransactionFinalRequest)MoneroTransactionInitAck)MoneroTransactionInitRequest)MoneroTransactionInputViniAck)!MoneroTransactionInputViniRequest)%MoneroTransactionInputsPermutationAck))MoneroTransactionInputsPermutationRequest)MoneroTransactionRsigData)MoneroTransactionSetInputAck) MoneroTransactionSetInputRequest)MoneroTransactionSetOutputAck)!MoneroTransactionSetOutputRequest)MoneroTransactionSignInputAck)!MoneroTransactionSignInputRequest)MoneroTransactionSourceEntry)MoneroTransferDetails)MoneroWatchKey)MultisigRedeemScriptType) NEMAddress)NEMAggregateModification)NEMCosignatoryModification)NEMDecryptMessage)NEMDecryptedMessage) NEMGetAddress)NEMImportanceTransfer) NEMMosaic)NEMMosaicCreation)NEMMosaicDefinition)NEMMosaicSupplyChange)NEMProvisionNamespace) NEMSignTx) NEMSignedTx)NEMTransactionCommon) NEMTransfer)NextU2FCounter) PassphraseAck)PassphraseRequest)PassphraseStateAck)PassphraseStateRequest) PinMatrixAck)PinMatrixRequest)Ping) PublicKey)RecoveryDevice) ResetDevice) RippleAddress)RippleGetAddress) RipplePayment) RippleSignTx)RippleSignedTx) SdProtect)SelfTest) SetU2FCounter) SignIdentity) SignMessage)SignTx)SignedIdentity)StellarAccountMergeOp)StellarAddress)StellarAllowTrustOp)StellarAssetType)StellarBumpSequenceOp)StellarChangeTrustOp)StellarCreateAccountOp)StellarCreatePassiveOfferOp)StellarGetAddress)StellarManageDataOp)StellarManageOfferOp)StellarPathPaymentOp)StellarPaymentOp)StellarSetOptionsOp) StellarSignTx)StellarSignedTx)StellarTxOpRequest)Success) TezosAddress) TezosBallotOp)TezosContractID)TezosDelegationOp)TezosGetAddress)TezosGetPublicKey)TezosManagerTransfer)TezosOriginationOp)TezosParametersManager)TezosProposalOp)TezosPublicKey) TezosRevealOp) TezosSignTx) TezosSignedTx)TezosTransactionOp)TransactionType)TxAck) TxInputType)TxOutputBinType) TxOutputType) TxRequest)TxRequestDetailsType)TxRequestSerializedType) VerifyMessage)WebAuthnAddResidentCredential)WebAuthnCredential)WebAuthnCredentials)WebAuthnListResidentCredentials) WebAuthnRemoveResidentCredential) WipeDevice)WordAck) WordRequest) BackupType)BinanceOrderSide)BinanceOrderType)BinanceTimeInForce)ButtonRequestType) Capability)DebugSwipeDirection) FailureType)InputScriptType)LiskTransactionType) MessageType)NEMImportanceTransferMode)NEMModificationType) NEMMosaicLevy)NEMSupplyChangeType)OutputScriptType)PassphraseSourceType)PinMatrixRequestType)RecoveryDeviceType) RequestType)SdProtectOperationType)TezosBallotType)TezosContractType)WordRequestTypeN(rrrrrrrr r r r r rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnrorprqrrrsrtrurvrwrxryrzr{r|r}r~rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr r r r r rrrrrrrrrrrrrrrrrr r W/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/messages/__init__.pys8                                                                                                                                                                                                                                                               python-trezor-0.11.6/src/trezorlib/misc.py000066400000000000000000000056031361427340300205620ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . from . import messages from .tools import Address, expect if False: from .client import TrezorClient @expect(messages.Entropy, field="entropy") def get_entropy(client: "TrezorClient", size: int) -> messages.Entropy: return client.call(messages.GetEntropy(size=size)) @expect(messages.SignedIdentity) def sign_identity( client: "TrezorClient", identity: messages.IdentityType, challenge_hidden: bytes, challenge_visual: str, ecdsa_curve_name: str = None, ) -> messages.SignedIdentity: return client.call( messages.SignIdentity( identity=identity, challenge_hidden=challenge_hidden, challenge_visual=challenge_visual, ecdsa_curve_name=ecdsa_curve_name, ) ) @expect(messages.ECDHSessionKey) def get_ecdh_session_key( client: "TrezorClient", identity: messages.IdentityType, peer_public_key: bytes, ecdsa_curve_name: str = None, ) -> messages.ECDHSessionKey: return client.call( messages.GetECDHSessionKey( identity=identity, peer_public_key=peer_public_key, ecdsa_curve_name=ecdsa_curve_name, ) ) @expect(messages.CipheredKeyValue, field="value") def encrypt_keyvalue( client: "TrezorClient", n: Address, key: str, value: bytes, ask_on_encrypt: bool = True, ask_on_decrypt: bool = True, iv: bytes = b"", ) -> messages.CipheredKeyValue: return client.call( messages.CipherKeyValue( address_n=n, key=key, value=value, encrypt=True, ask_on_encrypt=ask_on_encrypt, ask_on_decrypt=ask_on_decrypt, iv=iv, ) ) @expect(messages.CipheredKeyValue, field="value") def decrypt_keyvalue( client: "TrezorClient", n: Address, key: str, value: bytes, ask_on_encrypt: bool = True, ask_on_decrypt: bool = True, iv: bytes = b"", ) -> messages.CipheredKeyValue: return client.call( messages.CipherKeyValue( address_n=n, key=key, value=value, encrypt=False, ask_on_encrypt=ask_on_encrypt, ask_on_decrypt=ask_on_decrypt, iv=iv, ) ) python-trezor-0.11.6/src/trezorlib/monero.py000066400000000000000000000023131361427340300211210ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . from . import messages as proto from .tools import expect # MAINNET = 0 # TESTNET = 1 # STAGENET = 2 # FAKECHAIN = 3 @expect(proto.MoneroAddress, field="address") def get_address(client, n, show_display=False, network_type=0): return client.call( proto.MoneroGetAddress( address_n=n, show_display=show_display, network_type=network_type ) ) @expect(proto.MoneroWatchKey) def get_watch_key(client, n, network_type=0): return client.call(proto.MoneroGetWatchKey(address_n=n, network_type=network_type)) python-trezor-0.11.6/src/trezorlib/nem.py000066400000000000000000000151601361427340300204050ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . import json from . import messages as proto from .tools import CallException, expect TYPE_TRANSACTION_TRANSFER = 0x0101 TYPE_IMPORTANCE_TRANSFER = 0x0801 TYPE_AGGREGATE_MODIFICATION = 0x1001 TYPE_MULTISIG_SIGNATURE = 0x1002 TYPE_MULTISIG = 0x1004 TYPE_PROVISION_NAMESPACE = 0x2001 TYPE_MOSAIC_CREATION = 0x4001 TYPE_MOSAIC_SUPPLY_CHANGE = 0x4002 def create_transaction_common(transaction): msg = proto.NEMTransactionCommon() msg.network = (transaction["version"] >> 24) & 0xFF msg.timestamp = transaction["timeStamp"] msg.fee = transaction["fee"] msg.deadline = transaction["deadline"] if "signer" in transaction: msg.signer = bytes.fromhex(transaction["signer"]) return msg def create_transfer(transaction): msg = proto.NEMTransfer() msg.recipient = transaction["recipient"] msg.amount = transaction["amount"] if "payload" in transaction["message"]: msg.payload = bytes.fromhex(transaction["message"]["payload"]) if transaction["message"]["type"] == 0x02: msg.public_key = bytes.fromhex(transaction["message"]["publicKey"]) if "mosaics" in transaction: msg.mosaics = [ proto.NEMMosaic( namespace=mosaic["mosaicId"]["namespaceId"], mosaic=mosaic["mosaicId"]["name"], quantity=mosaic["quantity"], ) for mosaic in transaction["mosaics"] ] return msg def create_aggregate_modification(transactions): msg = proto.NEMAggregateModification() msg.modifications = [ proto.NEMCosignatoryModification( type=modification["modificationType"], public_key=bytes.fromhex(modification["cosignatoryAccount"]), ) for modification in transactions["modifications"] ] if "minCosignatories" in transactions: msg.relative_change = transactions["minCosignatories"]["relativeChange"] return msg def create_provision_namespace(transaction): msg = proto.NEMProvisionNamespace() msg.namespace = transaction["newPart"] if transaction["parent"]: msg.parent = transaction["parent"] msg.sink = transaction["rentalFeeSink"] msg.fee = transaction["rentalFee"] return msg def create_mosaic_creation(transaction): definition = transaction["mosaicDefinition"] msg = proto.NEMMosaicCreation() msg.definition = proto.NEMMosaicDefinition() msg.definition.namespace = definition["id"]["namespaceId"] msg.definition.mosaic = definition["id"]["name"] if definition["levy"]: msg.definition.levy = definition["levy"]["type"] msg.definition.fee = definition["levy"]["fee"] msg.definition.levy_address = definition["levy"]["recipient"] msg.definition.levy_namespace = definition["levy"]["mosaicId"]["namespaceId"] msg.definition.levy_mosaic = definition["levy"]["mosaicId"]["name"] msg.definition.description = definition["description"] for property in definition["properties"]: name = property["name"] value = json.loads(property["value"]) if name == "divisibility": msg.definition.divisibility = value elif name == "initialSupply": msg.definition.supply = value elif name == "supplyMutable": msg.definition.mutable_supply = value elif name == "transferable": msg.definition.transferable = value msg.sink = transaction["creationFeeSink"] msg.fee = transaction["creationFee"] return msg def create_supply_change(transaction): msg = proto.NEMMosaicSupplyChange() msg.namespace = transaction["mosaicId"]["namespaceId"] msg.mosaic = transaction["mosaicId"]["name"] msg.type = transaction["supplyType"] msg.delta = transaction["delta"] return msg def create_importance_transfer(transaction): msg = proto.NEMImportanceTransfer() msg.mode = transaction["importanceTransfer"]["mode"] msg.public_key = bytes.fromhex(transaction["importanceTransfer"]["publicKey"]) return msg def fill_transaction_by_type(msg, transaction): if transaction["type"] == TYPE_TRANSACTION_TRANSFER: msg.transfer = create_transfer(transaction) elif transaction["type"] == TYPE_AGGREGATE_MODIFICATION: msg.aggregate_modification = create_aggregate_modification(transaction) elif transaction["type"] == TYPE_PROVISION_NAMESPACE: msg.provision_namespace = create_provision_namespace(transaction) elif transaction["type"] == TYPE_MOSAIC_CREATION: msg.mosaic_creation = create_mosaic_creation(transaction) elif transaction["type"] == TYPE_MOSAIC_SUPPLY_CHANGE: msg.supply_change = create_supply_change(transaction) elif transaction["type"] == TYPE_IMPORTANCE_TRANSFER: msg.importance_transfer = create_importance_transfer(transaction) else: raise ValueError("Unknown transaction type") def create_sign_tx(transaction): msg = proto.NEMSignTx() msg.transaction = create_transaction_common(transaction) msg.cosigning = transaction["type"] == TYPE_MULTISIG_SIGNATURE if transaction["type"] in (TYPE_MULTISIG_SIGNATURE, TYPE_MULTISIG): other_trans = transaction["otherTrans"] msg.multisig = create_transaction_common(other_trans) fill_transaction_by_type(msg, other_trans) elif "otherTrans" in transaction: raise ValueError("Transaction does not support inner transaction") else: fill_transaction_by_type(msg, transaction) return msg # ====== Client functions ====== # @expect(proto.NEMAddress, field="address") def get_address(client, n, network, show_display=False): return client.call( proto.NEMGetAddress(address_n=n, network=network, show_display=show_display) ) @expect(proto.NEMSignedTx) def sign_tx(client, n, transaction): try: msg = create_sign_tx(transaction) except ValueError as e: raise CallException(e.args) assert msg.transaction is not None msg.transaction.address_n = n return client.call(msg) python-trezor-0.11.6/src/trezorlib/protobuf.py000066400000000000000000000400561361427340300214700ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . """ Extremely minimal streaming codec for a subset of protobuf. Supports uint32, bytes, string, embedded message and repeated fields. For de-serializing (loading) protobuf types, object with `Reader` interface is required. For serializing (dumping) protobuf types, object with `Writer` interface is required. """ import logging from io import BytesIO from typing import ( Any, Callable, Dict, Iterable, Iterator, List, Optional, Tuple, Type, TypeVar, Union, ) from typing_extensions import Protocol FieldType = Union[ "EnumType", Type["MessageType"], Type["UVarintType"], Type["SVarintType"], Type["BoolType"], Type["UnicodeType"], Type["BytesType"], ] FieldInfo = Tuple[str, FieldType, int] MT = TypeVar("MT", bound="MessageType") class Reader(Protocol): def readinto(self, buffer: bytearray) -> int: """ Reads exactly `len(buffer)` bytes into `buffer`. Returns number of bytes read, or 0 if it cannot read that much. """ class Writer(Protocol): def write(self, buffer: bytes) -> int: """ Writes all bytes from `buffer`, or raises `EOFError` """ _UVARINT_BUFFER = bytearray(1) LOG = logging.getLogger(__name__) def load_uvarint(reader: Reader) -> int: buffer = _UVARINT_BUFFER result = 0 shift = 0 byte = 0x80 bytes_read = 0 while byte & 0x80: if reader.readinto(buffer) == 0: if bytes_read > 0: raise IOError("Interrupted UVarint") else: raise EOFError bytes_read += 1 byte = buffer[0] result += (byte & 0x7F) << shift shift += 7 return result def dump_uvarint(writer: Writer, n: int) -> None: if n < 0: raise ValueError("Cannot dump signed value, convert it to unsigned first.") buffer = _UVARINT_BUFFER shifted = 1 while shifted: shifted = n >> 7 buffer[0] = (n & 0x7F) | (0x80 if shifted else 0x00) writer.write(buffer) n = shifted # protobuf interleaved signed encoding: # https://developers.google.com/protocol-buffers/docs/encoding#structure # the idea is to save the sign in LSbit instead of twos-complement. # so counting up, you go: 0, -1, 1, -2, 2, ... (as the first bit changes, sign flips) # # To achieve this with a twos-complement number: # 1. shift left by 1, leaving LSbit free # 2. if the number is negative, do bitwise negation. # This keeps positive number the same, and converts negative from twos-complement # to the appropriate value, while setting the sign bit. # # The original algorithm makes use of the fact that arithmetic (signed) shift # keeps the sign bits, so for a n-bit number, (x >> n) gets us "all sign bits". # Then you can take "number XOR all-sign-bits", which is XOR 0 (identity) for positive # and XOR 1 (bitwise negation) for negative. Cute and efficient. # # But this is harder in Python because we don't natively know the bit size of the number. # So we have to branch on whether the number is negative. def sint_to_uint(sint: int) -> int: res = sint << 1 if sint < 0: res = ~res return res def uint_to_sint(uint: int) -> int: sign = uint & 1 res = uint >> 1 if sign: res = ~res return res class UVarintType: WIRE_TYPE = 0 class SVarintType: WIRE_TYPE = 0 class BoolType: WIRE_TYPE = 0 class EnumType: WIRE_TYPE = 0 def __init__(self, enum_name: str, enum_values: Iterable[int]) -> None: self.enum_name = enum_name self.enum_values = enum_values def validate(self, fvalue: int) -> int: if fvalue not in self.enum_values: # raise TypeError("Invalid enum value") LOG.warning("Value {} unknown for type {}".format(fvalue, self.enum_name)) return fvalue def to_str(self, fvalue: int) -> str: from . import messages module = getattr(messages, self.enum_name) for name in dir(module): if name.startswith("__"): continue if getattr(module, name) == fvalue: return name else: raise TypeError("Invalid enum value") def from_str(self, fstr: str) -> int: try: from . import messages module = getattr(messages, self.enum_name) ivalue = getattr(module, fstr) if isinstance(ivalue, int): return ivalue else: raise TypeError("Invalid enum value") except AttributeError: raise TypeError("Invalid enum value") from None class BytesType: WIRE_TYPE = 2 class UnicodeType: WIRE_TYPE = 2 class MessageType: WIRE_TYPE = 2 @classmethod def get_fields(cls) -> Dict[int, FieldInfo]: return {} @classmethod def get_field_type(cls, name: str) -> Optional[FieldType]: for fname, ftype, flags in cls.get_fields().values(): if fname == name: return ftype return None def __init__(self, **kwargs: Any) -> None: for kw in kwargs: setattr(self, kw, kwargs[kw]) self._fill_missing() def __eq__(self, rhs: Any) -> bool: return self.__class__ is rhs.__class__ and self.__dict__ == rhs.__dict__ def __repr__(self) -> str: d = {} for key, value in self.__dict__.items(): if value is None or value == []: continue d[key] = value return "<%s: %s>" % (self.__class__.__name__, d) def __iter__(self) -> Iterator[str]: return iter(self.keys()) def keys(self) -> Iterator[str]: return (name for name, _, _ in self.get_fields().values()) def __getitem__(self, key: str) -> Any: return getattr(self, key) def _fill_missing(self) -> None: # fill missing fields for fname, ftype, fflags in self.get_fields().values(): if not hasattr(self, fname): if fflags & FLAG_REPEATED: setattr(self, fname, []) else: setattr(self, fname, None) def ByteSize(self) -> int: data = BytesIO() dump_message(data, self) return len(data.getvalue()) class LimitedReader: def __init__(self, reader: Reader, limit: int) -> None: self.reader = reader self.limit = limit def readinto(self, buf: bytearray) -> int: if self.limit < len(buf): return 0 else: nread = self.reader.readinto(buf) self.limit -= nread return nread class CountingWriter: def __init__(self) -> None: self.size = 0 def write(self, buf: bytes) -> int: nwritten = len(buf) self.size += nwritten return nwritten FLAG_REPEATED = 1 def decode_packed_array_field(ftype: FieldType, reader: Reader) -> List[Any]: length = load_uvarint(reader) packed_reader = LimitedReader(reader, length) values = [] try: while True: values.append(decode_varint_field(ftype, packed_reader)) except EOFError: pass return values def decode_varint_field(ftype: FieldType, reader: Reader) -> Union[int, bool]: value = load_uvarint(reader) if ftype is UVarintType: return value elif ftype is SVarintType: return uint_to_sint(value) elif ftype is BoolType: return bool(value) elif isinstance(ftype, EnumType): return ftype.validate(value) else: raise TypeError # not a varint field or unknown type def decode_length_delimited_field( ftype: FieldType, reader: Reader ) -> Union[bytes, str, MessageType]: value = load_uvarint(reader) if ftype is BytesType: buf = bytearray(value) reader.readinto(buf) return bytes(buf) elif ftype is UnicodeType: buf = bytearray(value) reader.readinto(buf) return buf.decode() elif isinstance(ftype, type) and issubclass(ftype, MessageType): return load_message(LimitedReader(reader, value), ftype) else: raise TypeError # field type is unknown def load_message(reader: Reader, msg_type: Type[MT]) -> MT: fields = msg_type.get_fields() msg = msg_type() while True: try: fkey = load_uvarint(reader) except EOFError: break # no more fields to load ftag = fkey >> 3 wtype = fkey & 7 field = fields.get(ftag, None) if field is None: # unknown field, skip it if wtype == 0: load_uvarint(reader) elif wtype == 2: ivalue = load_uvarint(reader) reader.readinto(bytearray(ivalue)) else: raise ValueError continue fname, ftype, fflags = field if wtype == 2 and ftype.WIRE_TYPE == 0 and fflags & FLAG_REPEATED: # packed array fvalues = decode_packed_array_field(ftype, reader) elif wtype != ftype.WIRE_TYPE: raise TypeError # parsed wire type differs from the schema elif wtype == 2: fvalues = [decode_length_delimited_field(ftype, reader)] elif wtype == 0: fvalues = [decode_varint_field(ftype, reader)] else: raise TypeError # unknown wire type if fflags & FLAG_REPEATED: pvalue = getattr(msg, fname) pvalue.extend(fvalues) fvalue = pvalue elif len(fvalues) != 1: raise ValueError("Unexpected multiple values in non-repeating field") else: fvalue = fvalues[0] setattr(msg, fname, fvalue) return msg def dump_message(writer: Writer, msg: MessageType) -> None: repvalue = [0] mtype = msg.__class__ fields = mtype.get_fields() for ftag in fields: fname, ftype, fflags = fields[ftag] fvalue = getattr(msg, fname, None) if fvalue is None: continue fkey = (ftag << 3) | ftype.WIRE_TYPE if not fflags & FLAG_REPEATED: repvalue[0] = fvalue fvalue = repvalue for svalue in fvalue: dump_uvarint(writer, fkey) if ftype is UVarintType: dump_uvarint(writer, svalue) elif ftype is SVarintType: dump_uvarint(writer, sint_to_uint(svalue)) elif ftype is BoolType: dump_uvarint(writer, int(svalue)) elif isinstance(ftype, EnumType): dump_uvarint(writer, ftype.validate(svalue)) elif ftype is BytesType: dump_uvarint(writer, len(svalue)) writer.write(svalue) elif ftype is UnicodeType: svalue_bytes = svalue.encode() dump_uvarint(writer, len(svalue_bytes)) writer.write(svalue_bytes) elif issubclass(ftype, MessageType): counter = CountingWriter() dump_message(counter, svalue) dump_uvarint(writer, counter.size) dump_message(writer, svalue) else: raise TypeError def format_message( pb: MessageType, indent: int = 0, sep: str = " " * 4, truncate_after: Optional[int] = 256, truncate_to: Optional[int] = 64, ) -> str: def mostly_printable(bytes: bytes) -> bool: if not bytes: return True printable = sum(1 for byte in bytes if 0x20 <= byte <= 0x7E) return printable / len(bytes) > 0.8 def pformat(name: str, value: Any, indent: int) -> str: level = sep * indent leadin = sep * (indent + 1) ftype = pb.get_field_type(name) if isinstance(value, MessageType): return format_message(value, indent, sep) if isinstance(value, list): # short list of simple values if not value or isinstance(value, (UVarintType, SVarintType, BoolType)): return repr(value) # long list, one line per entry lines = ["[", level + "]"] lines[1:1] = [leadin + pformat(name, x, indent + 1) + "," for x in value] return "\n".join(lines) if isinstance(value, dict): lines = ["{"] for key, val in sorted(value.items()): if val is None or val == []: continue lines.append(leadin + key + ": " + pformat(key, val, indent + 1) + ",") lines.append(level + "}") return "\n".join(lines) if isinstance(value, (bytes, bytearray)): length = len(value) suffix = "" if truncate_after and length > truncate_after: suffix = "..." value = value[: truncate_to or 0] if mostly_printable(value): output = repr(value) else: output = "0x" + value.hex() return "{} bytes {}{}".format(length, output, suffix) if isinstance(value, int) and isinstance(ftype, EnumType): return "{} ({})".format(ftype.to_str(value), value) return repr(value) return "{name} ({size} bytes) {content}".format( name=pb.__class__.__name__, size=pb.ByteSize(), content=pformat("", pb.__dict__, indent), ) def value_to_proto(ftype: FieldType, value: Any) -> Any: if isinstance(ftype, type) and issubclass(ftype, MessageType): raise TypeError("value_to_proto only converts simple values") if isinstance(ftype, EnumType): if isinstance(value, str): return ftype.from_str(value) else: return int(value) if ftype in (UVarintType, SVarintType): return int(value) if ftype is BoolType: return bool(value) if ftype is UnicodeType: return str(value) if ftype is BytesType: if isinstance(value, str): return bytes.fromhex(value) elif isinstance(value, bytes): return value else: raise TypeError("can't convert {} value to bytes".format(type(value))) def dict_to_proto(message_type: Type[MT], d: Dict[str, Any]) -> MT: params = {} for fname, ftype, fflags in message_type.get_fields().values(): repeated = fflags & FLAG_REPEATED value = d.get(fname) if value is None: continue if not repeated: value = [value] if isinstance(ftype, type) and issubclass(ftype, MessageType): function = dict_to_proto # type: Callable[[Any, Any], Any] else: function = value_to_proto newvalue = [function(ftype, v) for v in value] if not repeated: newvalue = newvalue[0] params[fname] = newvalue return message_type(**params) def to_dict(msg: MessageType, hexlify_bytes: bool = True) -> Dict[str, Any]: def convert_value(ftype: FieldType, value: Any) -> Any: if hexlify_bytes and isinstance(value, bytes): return value.hex() elif isinstance(value, MessageType): return to_dict(value, hexlify_bytes) elif isinstance(value, list): return [convert_value(ftype, v) for v in value] elif isinstance(value, int) and isinstance(ftype, EnumType): return ftype.to_str(value) else: return value res = {} for key, value in msg.__dict__.items(): if value is None or value == []: continue res[key] = convert_value(msg.get_field_type(key), value) return res python-trezor-0.11.6/src/trezorlib/qt/000077500000000000000000000000001361427340300176755ustar00rootroot00000000000000python-trezor-0.11.6/src/trezorlib/qt/__init__.py000066400000000000000000000000001361427340300217740ustar00rootroot00000000000000python-trezor-0.11.6/src/trezorlib/qt/pinmatrix.py000066400000000000000000000123251361427340300222650ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . import math import sys try: from PyQt5.QtWidgets import ( QPushButton, QLineEdit, QSizePolicy, QLabel, QApplication, QWidget, QGridLayout, QVBoxLayout, QHBoxLayout, ) from PyQt5.QtGui import QRegExpValidator from PyQt5.QtCore import QRegExp, Qt, QT_VERSION_STR except Exception: from PyQt4.QtGui import ( QPushButton, QLineEdit, QSizePolicy, QRegExpValidator, QLabel, QApplication, QWidget, QGridLayout, QVBoxLayout, QHBoxLayout, ) from PyQt4.QtCore import QObject, SIGNAL, QRegExp, Qt, QT_VERSION_STR class PinButton(QPushButton): def __init__(self, password, encoded_value): super(PinButton, self).__init__("?") self.password = password self.encoded_value = encoded_value if QT_VERSION_STR >= "5": self.clicked.connect(self._pressed) elif QT_VERSION_STR >= "4": QObject.connect(self, SIGNAL("clicked()"), self._pressed) else: raise RuntimeError("Unsupported Qt version") def _pressed(self): self.password.setText(self.password.text() + str(self.encoded_value)) self.password.setFocus() class PinMatrixWidget(QWidget): """ Displays widget with nine blank buttons and password box. Encodes button clicks into sequence of numbers for passing into PinAck messages of Trezor. show_strength=True may be useful for entering new PIN """ def __init__(self, show_strength=True, parent=None): super(PinMatrixWidget, self).__init__(parent) self.password = QLineEdit() self.password.setValidator(QRegExpValidator(QRegExp("[1-9]+"), None)) self.password.setEchoMode(QLineEdit.Password) if QT_VERSION_STR >= "5": self.password.textChanged.connect(self._password_changed) elif QT_VERSION_STR >= "4": QObject.connect( self.password, SIGNAL("textChanged(QString)"), self._password_changed ) else: raise RuntimeError("Unsupported Qt version") self.strength = QLabel() self.strength.setMinimumWidth(75) self.strength.setAlignment(Qt.AlignCenter) self._set_strength(0) grid = QGridLayout() grid.setSpacing(0) for y in range(3)[::-1]: for x in range(3): button = PinButton(self.password, x + y * 3 + 1) button.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) button.setFocusPolicy(Qt.NoFocus) grid.addWidget(button, 3 - y, x) hbox = QHBoxLayout() hbox.addWidget(self.password) if show_strength: hbox.addWidget(self.strength) vbox = QVBoxLayout() vbox.addLayout(grid) vbox.addLayout(hbox) self.setLayout(vbox) def _set_strength(self, strength): if strength < 3000: self.strength.setText("weak") self.strength.setStyleSheet("QLabel { color : #d00; }") elif strength < 60000: self.strength.setText("fine") self.strength.setStyleSheet("QLabel { color : #db0; }") elif strength < 360000: self.strength.setText("strong") self.strength.setStyleSheet("QLabel { color : #0a0; }") else: self.strength.setText("ULTIMATE") self.strength.setStyleSheet("QLabel { color : #000; font-weight: bold;}") def _password_changed(self, password): self._set_strength(self.get_strength()) def get_strength(self): digits = len(set(str(self.password.text()))) strength = math.factorial(9) / math.factorial(9 - digits) return strength def get_value(self): return self.password.text() if __name__ == "__main__": """ Demo application showing PinMatrix widget in action """ app = QApplication(sys.argv) matrix = PinMatrixWidget() def clicked(): print("PinMatrix value is", matrix.get_value()) print("Possible button combinations:", matrix.get_strength()) sys.exit() ok = QPushButton("OK") if QT_VERSION_STR >= "5": ok.clicked.connect(clicked) elif QT_VERSION_STR >= "4": QObject.connect(ok, SIGNAL("clicked()"), clicked) else: raise RuntimeError("Unsupported Qt version") vbox = QVBoxLayout() vbox.addWidget(matrix) vbox.addWidget(ok) w = QWidget() w.setLayout(vbox) w.move(100, 100) w.show() app.exec_() python-trezor-0.11.6/src/trezorlib/ripple.py000066400000000000000000000034751361427340300211270ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . from . import messages from .protobuf import dict_to_proto from .tools import dict_from_camelcase, expect REQUIRED_FIELDS = ("Fee", "Sequence", "TransactionType", "Payment") REQUIRED_PAYMENT_FIELDS = ("Amount", "Destination") @expect(messages.RippleAddress, field="address") def get_address(client, address_n, show_display=False): return client.call( messages.RippleGetAddress(address_n=address_n, show_display=show_display) ) @expect(messages.RippleSignedTx) def sign_tx(client, address_n, msg: messages.RippleSignTx): msg.address_n = address_n return client.call(msg) def create_sign_tx_msg(transaction) -> messages.RippleSignTx: if not all(transaction.get(k) for k in REQUIRED_FIELDS): raise ValueError("Some of the required fields missing") if not all(transaction["Payment"].get(k) for k in REQUIRED_PAYMENT_FIELDS): raise ValueError("Some of the required payment fields missing") if transaction["TransactionType"] != "Payment": raise ValueError("Only Payment transaction type is supported") converted = dict_from_camelcase(transaction) return dict_to_proto(messages.RippleSignTx, converted) python-trezor-0.11.6/src/trezorlib/stellar.py000066400000000000000000000302051361427340300212710ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . import base64 import struct import xdrlib from . import messages from .tools import CallException, expect # Memo types MEMO_TYPE_NONE = 0 MEMO_TYPE_TEXT = 1 MEMO_TYPE_ID = 2 MEMO_TYPE_HASH = 3 MEMO_TYPE_RETURN = 4 # Asset types ASSET_TYPE_NATIVE = 0 ASSET_TYPE_ALPHA4 = 1 ASSET_TYPE_ALPHA12 = 2 # Operations OP_CREATE_ACCOUNT = 0 OP_PAYMENT = 1 OP_PATH_PAYMENT = 2 OP_MANAGE_OFFER = 3 OP_CREATE_PASSIVE_OFFER = 4 OP_SET_OPTIONS = 5 OP_CHANGE_TRUST = 6 OP_ALLOW_TRUST = 7 OP_ACCOUNT_MERGE = 8 OP_INFLATION = 9 # Included for documentation purposes, not supported by Trezor OP_MANAGE_DATA = 10 OP_BUMP_SEQUENCE = 11 DEFAULT_BIP32_PATH = "m/44h/148h/0h" # Stellar's BIP32 differs to Bitcoin's see https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0005.md DEFAULT_NETWORK_PASSPHRASE = "Public Global Stellar Network ; September 2015" def address_from_public_key(pk_bytes): """Returns the base32-encoded version of pk_bytes (G...) """ final_bytes = bytearray() # version final_bytes.append(6 << 3) # public key final_bytes.extend(pk_bytes) # checksum final_bytes.extend(struct.pack(" max_timebound or tx.timebounds_start < 0: raise ValueError( "Starting timebound out of range (must be between 0 and " + max_timebound ) if tx.timebounds_end > max_timebound or tx.timebounds_end < 0: raise ValueError( "Ending timebound out of range (must be between 0 and " + max_timebound ) # memo type determines what optional fields are set tx.memo_type = unpacker.unpack_uint() # text if tx.memo_type == MEMO_TYPE_TEXT: tx.memo_text = unpacker.unpack_string() # id (64-bit uint) if tx.memo_type == MEMO_TYPE_ID: tx.memo_id = unpacker.unpack_uhyper() # hash / return are the same structure (32 bytes representing a hash) if tx.memo_type == MEMO_TYPE_HASH or tx.memo_type == MEMO_TYPE_RETURN: tx.memo_hash = unpacker.unpack_fopaque(32) tx.num_operations = unpacker.unpack_uint() operations = [] for _ in range(tx.num_operations): operations.append(_parse_operation_bytes(unpacker)) return tx, operations def _parse_operation_bytes(unpacker): """Returns a protobuf message representing the next operation as read from the byte stream in unpacker """ # Check for and parse optional source account field source_account = None if unpacker.unpack_bool(): source_account = unpacker.unpack_fopaque(32) # Operation type (See OP_ constants) type = unpacker.unpack_uint() if type == OP_CREATE_ACCOUNT: return messages.StellarCreateAccountOp( source_account=source_account, new_account=_xdr_read_address(unpacker), starting_balance=unpacker.unpack_hyper(), ) if type == OP_PAYMENT: return messages.StellarPaymentOp( source_account=source_account, destination_account=_xdr_read_address(unpacker), asset=_xdr_read_asset(unpacker), amount=unpacker.unpack_hyper(), ) if type == OP_PATH_PAYMENT: op = messages.StellarPathPaymentOp( source_account=source_account, send_asset=_xdr_read_asset(unpacker), send_max=unpacker.unpack_hyper(), destination_account=_xdr_read_address(unpacker), destination_asset=_xdr_read_asset(unpacker), destination_amount=unpacker.unpack_hyper(), paths=[], ) num_paths = unpacker.unpack_uint() for _ in range(num_paths): op.paths.append(_xdr_read_asset(unpacker)) return op if type == OP_MANAGE_OFFER: return messages.StellarManageOfferOp( source_account=source_account, selling_asset=_xdr_read_asset(unpacker), buying_asset=_xdr_read_asset(unpacker), amount=unpacker.unpack_hyper(), price_n=unpacker.unpack_uint(), price_d=unpacker.unpack_uint(), offer_id=unpacker.unpack_uhyper(), ) if type == OP_CREATE_PASSIVE_OFFER: return messages.StellarCreatePassiveOfferOp( source_account=source_account, selling_asset=_xdr_read_asset(unpacker), buying_asset=_xdr_read_asset(unpacker), amount=unpacker.unpack_hyper(), price_n=unpacker.unpack_uint(), price_d=unpacker.unpack_uint(), ) if type == OP_SET_OPTIONS: op = messages.StellarSetOptionsOp(source_account=source_account) # Inflation destination if unpacker.unpack_bool(): op.inflation_destination_account = _xdr_read_address(unpacker) # clear flags if unpacker.unpack_bool(): op.clear_flags = unpacker.unpack_uint() # set flags if unpacker.unpack_bool(): op.set_flags = unpacker.unpack_uint() # master weight if unpacker.unpack_bool(): op.master_weight = unpacker.unpack_uint() # low threshold if unpacker.unpack_bool(): op.low_threshold = unpacker.unpack_uint() # medium threshold if unpacker.unpack_bool(): op.medium_threshold = unpacker.unpack_uint() # high threshold if unpacker.unpack_bool(): op.high_threshold = unpacker.unpack_uint() # home domain if unpacker.unpack_bool(): op.home_domain = unpacker.unpack_string() # signer if unpacker.unpack_bool(): op.signer_type = unpacker.unpack_uint() op.signer_key = unpacker.unpack_fopaque(32) op.signer_weight = unpacker.unpack_uint() return op if type == OP_CHANGE_TRUST: return messages.StellarChangeTrustOp( source_account=source_account, asset=_xdr_read_asset(unpacker), limit=unpacker.unpack_uhyper(), ) if type == OP_ALLOW_TRUST: op = messages.StellarAllowTrustOp( source_account=source_account, trusted_account=_xdr_read_address(unpacker), asset_type=unpacker.unpack_uint(), ) if op.asset_type == ASSET_TYPE_ALPHA4: op.asset_code = unpacker.unpack_fstring(4) if op.asset_type == ASSET_TYPE_ALPHA12: op.asset_code = unpacker.unpack_fstring(12) op.is_authorized = unpacker.unpack_bool() return op if type == OP_ACCOUNT_MERGE: return messages.StellarAccountMergeOp( source_account=source_account, destination_account=_xdr_read_address(unpacker), ) # Inflation is not implemented since anyone can submit this operation to the network if type == OP_MANAGE_DATA: op = messages.StellarManageDataOp( source_account=source_account, key=unpacker.unpack_string() ) # Only set value if the field is present if unpacker.unpack_bool(): op.value = unpacker.unpack_opaque() return op # Bump Sequence # see: https://github.com/stellar/stellar-core/blob/master/src/xdr/Stellar-transaction.x#L269 if type == OP_BUMP_SEQUENCE: return messages.StellarBumpSequenceOp( source_account=source_account, bump_to=unpacker.unpack_uhyper() ) raise ValueError("Unknown operation type: " + str(type)) def _xdr_read_asset(unpacker): """Reads a stellar Asset from unpacker""" asset = messages.StellarAssetType(type=unpacker.unpack_uint()) if asset.type == ASSET_TYPE_ALPHA4: asset.code = unpacker.unpack_fstring(4) asset.issuer = _xdr_read_address(unpacker) if asset.type == ASSET_TYPE_ALPHA12: asset.code = unpacker.unpack_fstring(12) asset.issuer = _xdr_read_address(unpacker) return asset def _xdr_read_address(unpacker): """Reads a stellar address and returns the string representing the address This method assumes the encoded address is a public address (starting with G) """ # First 4 bytes are the address type address_type = unpacker.unpack_uint() if address_type != 0: raise ValueError("Unsupported address type") return address_from_public_key(unpacker.unpack_fopaque(32)) def _crc16_checksum(bytes): """Returns the CRC-16 checksum of bytearray bytes Ported from Java implementation at: http://introcs.cs.princeton.edu/java/61data/CRC16CCITT.java.html Initial value changed to 0x0000 to match Stellar configuration. """ crc = 0x0000 polynomial = 0x1021 for byte in bytes: for i in range(8): bit = (byte >> (7 - i) & 1) == 1 c15 = (crc >> 15 & 1) == 1 crc <<= 1 if c15 ^ bit: crc ^= polynomial return crc & 0xFFFF # ====== Client functions ====== # @expect(messages.StellarAddress, field="address") def get_address(client, address_n, show_display=False): return client.call( messages.StellarGetAddress(address_n=address_n, show_display=show_display) ) def sign_tx( client, tx, operations, address_n, network_passphrase=DEFAULT_NETWORK_PASSPHRASE ): tx.network_passphrase = network_passphrase tx.address_n = address_n tx.num_operations = len(operations) # Signing loop works as follows: # # 1. Start with tx (header information for the transaction) and operations (an array of operation protobuf messagess) # 2. Send the tx header to the device # 3. Receive a StellarTxOpRequest message # 4. Send operations one by one until all operations have been sent. If there are more operations to sign, the device will send a StellarTxOpRequest message # 5. The final message received will be StellarSignedTx which is returned from this method resp = client.call(tx) try: while isinstance(resp, messages.StellarTxOpRequest): resp = client.call(operations.pop(0)) except IndexError: # pop from empty list raise CallException( "Stellar.UnexpectedEndOfOperations", "Reached end of operations without a signature.", ) from None if not isinstance(resp, messages.StellarSignedTx): raise CallException(messages.FailureType.UnexpectedMessage, resp) if operations: raise CallException( "Stellar.UnprocessedOperations", "Received a signature before processing all operations.", ) return resp python-trezor-0.11.6/src/trezorlib/tezos.py000066400000000000000000000024571361427340300207770ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . from . import messages from .tools import expect @expect(messages.TezosAddress, field="address") def get_address(client, address_n, show_display=False): return client.call( messages.TezosGetAddress(address_n=address_n, show_display=show_display) ) @expect(messages.TezosPublicKey, field="public_key") def get_public_key(client, address_n, show_display=False): return client.call( messages.TezosGetPublicKey(address_n=address_n, show_display=show_display) ) @expect(messages.TezosSignedTx) def sign_tx(client, address_n, sign_tx_msg): sign_tx_msg.address_n = address_n return client.call(sign_tx_msg) python-trezor-0.11.6/src/trezorlib/tools.py000066400000000000000000000155561361427340300207770ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . import functools import hashlib import re import struct import unicodedata from typing import List, NewType from .coins import slip44 from .exceptions import TrezorFailure CallException = TrezorFailure HARDENED_FLAG = 1 << 31 Address = NewType("Address", List[int]) def H_(x: int) -> int: """ Shortcut function that "hardens" a number in a BIP44 path. """ return x | HARDENED_FLAG def btc_hash(data): """ Double-SHA256 hash as used in BTC """ return hashlib.sha256(hashlib.sha256(data).digest()).digest() def hash_160(public_key): md = hashlib.new("ripemd160") md.update(hashlib.sha256(public_key).digest()) return md.digest() def hash_160_to_bc_address(h160, address_type): vh160 = struct.pack("= __b58base: div, mod = divmod(long_value, __b58base) result = __b58chars[mod] + result long_value = div result = __b58chars[long_value] + result # Bitcoin does a little leading-zero-compression: # leading 0-bytes in the input become leading-1s nPad = 0 for c in v: if c == 0: nPad += 1 else: break return (__b58chars[0] * nPad) + result def b58decode(v, length=None): """ decode v into a string of len bytes.""" if isinstance(v, bytes): v = v.decode() for c in v: if c not in __b58chars: raise ValueError("invalid Base58 string") long_value = 0 for (i, c) in enumerate(v[::-1]): long_value += __b58chars.find(c) * (__b58base ** i) result = b"" while long_value >= 256: div, mod = divmod(long_value, 256) result = struct.pack("B", mod) + result long_value = div result = struct.pack("B", long_value) + result nPad = 0 for c in v: if c == __b58chars[0]: nPad += 1 else: break result = b"\x00" * nPad + result if length is not None and len(result) != length: return None return result def b58check_encode(v): checksum = btc_hash(v)[:4] return b58encode(v + checksum) def b58check_decode(v, length=None): dec = b58decode(v, length) data, checksum = dec[:-4], dec[-4:] if btc_hash(data)[:4] != checksum: raise ValueError("invalid checksum") return data def parse_path(nstr: str) -> Address: """ Convert BIP32 path string to list of uint32 integers with hardened flags. Several conventions are supported to set the hardened flag: -1, 1', 1h e.g.: "0/1h/1" -> [0, 0x80000001, 1] :param nstr: path string :return: list of integers """ if not nstr: return [] n = nstr.split("/") # m/a/b/c => a/b/c if n[0] == "m": n = n[1:] # coin_name/a/b/c => 44'/SLIP44_constant'/a/b/c if n[0] in slip44: coin_id = slip44[n[0]] n[0:1] = ["44h", "{}h".format(coin_id)] def str_to_harden(x: str) -> int: if x.startswith("-"): return H_(abs(int(x))) elif x.endswith(("h", "'")): return H_(int(x[:-1])) else: return int(x) try: return [str_to_harden(x) for x in n] except Exception: raise ValueError("Invalid BIP32 path", nstr) def normalize_nfc(txt): """ Normalize message to NFC and return bytes suitable for protobuf. This seems to be bitcoin-qt standard of doing things. """ if isinstance(txt, bytes): txt = txt.decode() return unicodedata.normalize("NFC", txt).encode() class expect: # Decorator checks if the method # returned one of expected protobuf messages # or raises an exception def __init__(self, expected, field=None): self.expected = expected self.field = field def __call__(self, f): @functools.wraps(f) def wrapped_f(*args, **kwargs): __tracebackhide__ = True # for pytest # pylint: disable=W0612 ret = f(*args, **kwargs) if not isinstance(ret, self.expected): raise RuntimeError( "Got %s, expected %s" % (ret.__class__, self.expected) ) if self.field is not None: return getattr(ret, self.field) else: return ret return wrapped_f def session(f): # Decorator wraps a BaseClient method # with session activation / deactivation @functools.wraps(f) def wrapped_f(client, *args, **kwargs): __tracebackhide__ = True # for pytest # pylint: disable=W0612 client.open() try: return f(client, *args, **kwargs) finally: client.close() return wrapped_f # de-camelcasifier # https://stackoverflow.com/a/1176023/222189 FIRST_CAP_RE = re.compile("(.)([A-Z][a-z]+)") ALL_CAP_RE = re.compile("([a-z0-9])([A-Z])") def from_camelcase(s): s = FIRST_CAP_RE.sub(r"\1_\2", s) return ALL_CAP_RE.sub(r"\1_\2", s).lower() def dict_from_camelcase(d, renames=None): if not isinstance(d, dict): return d if renames is None: renames = {} res = {} for key, value in d.items(): newkey = from_camelcase(key) renamed_key = renames.get(newkey) or renames.get(key) if renamed_key: newkey = renamed_key if isinstance(value, list): res[newkey] = [dict_from_camelcase(v, renames) for v in value] else: res[newkey] = dict_from_camelcase(value, renames) return res python-trezor-0.11.6/src/trezorlib/transport/000077500000000000000000000000001361427340300213055ustar00rootroot00000000000000python-trezor-0.11.6/src/trezorlib/transport/__init__.py000066400000000000000000000114431361427340300234210ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . import logging from typing import Iterable, List, Type from ..exceptions import TrezorException from ..protobuf import MessageType LOG = logging.getLogger(__name__) # USB vendor/product IDs for Trezors DEV_TREZOR1 = (0x534C, 0x0001) DEV_TREZOR2 = (0x1209, 0x53C1) DEV_TREZOR2_BL = (0x1209, 0x53C0) TREZORS = {DEV_TREZOR1, DEV_TREZOR2, DEV_TREZOR2_BL} UDEV_RULES_STR = """ Do you have udev rules installed? https://github.com/trezor/trezor-common/blob/master/udev/51-trezor.rules """.strip() class TransportException(TrezorException): pass class Transport: """Raw connection to a Trezor device. Transport subclass represents a kind of communication link: Trezor Bridge, WebUSB or USB-HID connection, or UDP socket of listening emulator(s). It can also enumerate devices available over this communication link, and return them as instances. Transport instance is a thing that: - can be identified and requested by a string URI-like path - can open and close sessions, which enclose related operations - can read and write protobuf messages You need to implement a new Transport subclass if you invent a new way to connect a Trezor device to a computer. """ PATH_PREFIX = None # type: str ENABLED = False def __str__(self) -> str: return self.get_path() def get_path(self) -> str: raise NotImplementedError def begin_session(self) -> None: raise NotImplementedError def end_session(self) -> None: raise NotImplementedError def read(self) -> MessageType: raise NotImplementedError def write(self, message: MessageType) -> None: raise NotImplementedError @classmethod def enumerate(cls) -> Iterable["Transport"]: raise NotImplementedError @classmethod def find_by_path(cls, path: str, prefix_search: bool = False) -> "Transport": for device in cls.enumerate(): if ( path is None or device.get_path() == path or (prefix_search and device.get_path().startswith(path)) ): return device raise TransportException( "{} device not found: {}".format(cls.PATH_PREFIX, path) ) def all_transports() -> Iterable[Type[Transport]]: from .bridge import BridgeTransport from .hid import HidTransport from .udp import UdpTransport from .webusb import WebUsbTransport return set( cls for cls in (BridgeTransport, HidTransport, UdpTransport, WebUsbTransport) if cls.ENABLED ) def enumerate_devices() -> Iterable[Transport]: devices = [] # type: List[Transport] for transport in all_transports(): name = transport.__name__ try: found = list(transport.enumerate()) LOG.info("Enumerating {}: found {} devices".format(name, len(found))) devices.extend(found) except NotImplementedError: LOG.error("{} does not implement device enumeration".format(name)) except Exception as e: excname = e.__class__.__name__ LOG.error("Failed to enumerate {}. {}: {}".format(name, excname, e)) return devices def get_transport(path: str = None, prefix_search: bool = False) -> Transport: if path is None: try: return next(iter(enumerate_devices())) except StopIteration: raise TransportException("No Trezor device found") from None # Find whether B is prefix of A (transport name is part of the path) # or A is prefix of B (path is a prefix, or a name, of transport). # This naively expects that no two transports have a common prefix. def match_prefix(a: str, b: str) -> bool: return a.startswith(b) or b.startswith(a) LOG.info( "looking for device by {}: {}".format( "prefix" if prefix_search else "full path", path ) ) transports = [t for t in all_transports() if match_prefix(path, t.PATH_PREFIX)] if transports: return transports[0].find_by_path(path, prefix_search=prefix_search) raise TransportException("Could not find device by path: {}".format(path)) python-trezor-0.11.6/src/trezorlib/transport/__pycache__/000077500000000000000000000000001361427340300235155ustar00rootroot00000000000000python-trezor-0.11.6/src/trezorlib/transport/__pycache__/__init__.cpython-36.pyc000066400000000000000000000114341361427340300277050ustar00rootroot000000000000003 ]#@sddlZddlmZmZmZddlmZddlmZej e Z dZ dZ dZe e ehZd jZGd d d eZGdddZeeedddZeedddZdeeedddZdS)N)IterableListType)TrezorException) MessageTypeLS SSzl Do you have udev rules installed? https://github.com/trezor/trezor-common/blob/master/udev/51-trezor.rules c@s eZdZdS)TransportExceptionN)__name__ __module__ __qualname__rrX/home/matejcik/projekty/prace/trezor-firmware/python/src/trezorlib/transport/__init__.pyr &sr c@seZdZdZdZdZedddZedddZddd d Z ddd d Z e dd dZ e ddddZ eeddddZedeeddddZdS) TransportaRaw connection to a Trezor device. Transport subclass represents a kind of communication link: Trezor Bridge, WebUSB or USB-HID connection, or UDP socket of listening emulator(s). It can also enumerate devices available over this communication link, and return them as instances. Transport instance is a thing that: - can be identified and requested by a string URI-like path - can open and close sessions, which enclose related operations - can read and write protobuf messages You need to implement a new Transport subclass if you invent a new way to connect a Trezor device to a computer. NF)returncCs|jS)N)get_path)selfrrr__str__>szTransport.__str__cCstdS)N)NotImplementedError)rrrrrAszTransport.get_pathcCstdS)N)r)rrrr begin_sessionDszTransport.begin_sessioncCstdS)N)r)rrrr end_sessionGszTransport.end_sessioncCstdS)N)r)rrrrreadJszTransport.read)messagercCstdS)N)r)rrrrrwriteMszTransport.writecCstdS)N)r)clsrrr enumeratePszTransport.enumerate)path prefix_searchrcCsRx:|jD].}|dks4|j|ks4|r |jj|r |Sq Wtdj|j|dS)Nz{} device not found: {})rr startswithr format PATH_PREFIX)rr r!devicerrr find_by_pathTs zTransport.find_by_path)F)rrr__doc__r$ENABLEDstrrrrrrrr classmethodrrboolr&rrrrr*sr)rcCsJddlm}ddlm}ddlm}ddlm}tdd||||fDS)Nr )BridgeTransport) HidTransport) UdpTransport)WebUsbTransportcss|]}|jr|VqdS)N)r().0rrrr jsz!all_transports..) Zbridger,Zhidr-Zudpr.Zwebusbr/set)r,r-r.r/rrrall_transportscs    r3cCsg}xtD]}|j}y0t|j}tjdj|t||j|Wq t k rjtj dj|Yq t k r}z"|j j}tj dj|||WYdd}~Xq Xq W|S)Nz Enumerating {}: found {} devicesz({} does not implement device enumerationzFailed to enumerate {}. {}: {}) r3rlistrLOGinfor#lenextendrerror Exception __class__)Zdevices transportnamefoundeZexcnamerrrenumerate_devicesps  *r@F)r r!rc sdkr6ytttStk r4tddYnXtttdddtjdj |rXdndfdd t D}|r|d j |d Std j dS) NzNo Trezor device found)abrcSs|j|p|j|S)N)r")rArBrrr match_prefixsz#get_transport..match_prefixzlooking for device by {}: {}prefixz full pathcsg|]}|jr|qSr)r$)r0t)rCr rr sz!get_transport..r)r!z!Could not find device by path: {}) nextiterr@ StopIterationr r)r+r5r6r#r3r&)r r!Z transportsr)rCr r get_transportsrJ)rr )r r )r r )NF)loggingtypingrrr exceptionsrprotobufr getLoggerrr5Z DEV_TREZOR1Z DEV_TREZOR2ZDEV_TREZOR2_BLZTREZORSstripZUDEV_RULES_STRr rr3r@r)r+rJrrrrs    9 python-trezor-0.11.6/src/trezorlib/transport/bridge.py000066400000000000000000000133011361427340300231110ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . import logging import struct from io import BytesIO from typing import Any, Dict, Iterable, Optional import requests from .. import mapping, protobuf from ..log import DUMP_BYTES from . import Transport, TransportException LOG = logging.getLogger(__name__) TREZORD_HOST = "http://127.0.0.1:21325" TREZORD_ORIGIN_HEADER = {"Origin": "https://python.trezor.io"} TREZORD_VERSION_MODERN = (2, 0, 25) CONNECTION = requests.Session() CONNECTION.headers.update(TREZORD_ORIGIN_HEADER) def call_bridge(uri: str, data=None) -> requests.Response: url = TREZORD_HOST + "/" + uri r = CONNECTION.post(url, data=data) if r.status_code != 200: error_str = "trezord: {} failed with code {}: {}".format( uri, r.status_code, r.json()["error"] ) raise TransportException(error_str) return r def is_legacy_bridge() -> bool: config = call_bridge("configure").json() version_tuple = tuple(map(int, config["version"].split("."))) return version_tuple < TREZORD_VERSION_MODERN class BridgeHandle: def __init__(self, transport: "BridgeTransport") -> None: self.transport = transport def read_buf(self) -> bytes: raise NotImplementedError def write_buf(self, buf: bytes) -> None: raise NotImplementedError class BridgeHandleModern(BridgeHandle): def write_buf(self, buf: bytes) -> None: self.transport._call("post", data=buf.hex()) def read_buf(self) -> bytes: data = self.transport._call("read") return bytes.fromhex(data.text) class BridgeHandleLegacy(BridgeHandle): def __init__(self, transport: "BridgeTransport") -> None: super().__init__(transport) self.request = None # type: Optional[str] def write_buf(self, buf: bytes) -> None: if self.request is not None: raise TransportException("Can't write twice on legacy Bridge") self.request = buf.hex() def read_buf(self) -> bytes: if self.request is None: raise TransportException("Can't read without write on legacy Bridge") try: data = self.transport._call("call", data=self.request) return bytes.fromhex(data.text) finally: self.request = None class BridgeTransport(Transport): """ BridgeTransport implements transport through Trezor Bridge (aka trezord). """ PATH_PREFIX = "bridge" ENABLED = True def __init__( self, device: Dict[str, Any], legacy: bool, debug: bool = False ) -> None: if legacy and debug: raise TransportException("Debugging not supported on legacy Bridge") self.device = device self.session = None # type: Optional[str] self.debug = debug self.legacy = legacy if legacy: self.handle = BridgeHandleLegacy(self) # type: BridgeHandle else: self.handle = BridgeHandleModern(self) def get_path(self) -> str: return "%s:%s" % (self.PATH_PREFIX, self.device["path"]) def find_debug(self) -> "BridgeTransport": if not self.device.get("debug"): raise TransportException("Debug device not available") return BridgeTransport(self.device, self.legacy, debug=True) def _call(self, action: str, data: str = None) -> requests.Response: session = self.session or "null" uri = action + "/" + str(session) if self.debug: uri = "debug/" + uri return call_bridge(uri, data=data) @classmethod def enumerate(cls) -> Iterable["BridgeTransport"]: try: legacy = is_legacy_bridge() return [ BridgeTransport(dev, legacy) for dev in call_bridge("enumerate").json() ] except Exception: return [] def begin_session(self) -> None: data = self._call("acquire/" + self.device["path"]) self.session = data.json()["session"] def end_session(self) -> None: if not self.session: return self._call("release") self.session = None def write(self, msg: protobuf.MessageType) -> None: LOG.debug( "sending message: {}".format(msg.__class__.__name__), extra={"protobuf": msg}, ) buffer = BytesIO() protobuf.dump_message(buffer, msg) ser = buffer.getvalue() LOG.log(DUMP_BYTES, "sending bytes: {}".format(ser.hex())) header = struct.pack(">HL", mapping.get_type(msg), len(ser)) self.handle.write_buf(header + ser) def read(self) -> protobuf.MessageType: data = self.handle.read_buf() headerlen = struct.calcsize(">HL") msg_type, datalen = struct.unpack(">HL", data[:headerlen]) ser = data[headerlen : headerlen + datalen] LOG.log(DUMP_BYTES, "received bytes: {}".format(ser.hex())) buffer = BytesIO(ser) msg = protobuf.load_message(buffer, mapping.get_class(msg_type)) LOG.debug( "received message: {}".format(msg.__class__.__name__), extra={"protobuf": msg}, ) return msg python-trezor-0.11.6/src/trezorlib/transport/hid.py000066400000000000000000000122151361427340300224240ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . import logging import sys import time from typing import Any, Dict, Iterable from . import DEV_TREZOR1, UDEV_RULES_STR, TransportException from .protocol import ProtocolBasedTransport, ProtocolV1 LOG = logging.getLogger(__name__) try: import hid except Exception as e: LOG.info("HID transport is disabled: {}".format(e)) hid = None HidDevice = Dict[str, Any] HidDeviceHandle = Any class HidHandle: def __init__( self, path: bytes, serial: str, probe_hid_version: bool = False ) -> None: self.path = path self.serial = serial self.handle = None # type: HidDeviceHandle self.hid_version = None if probe_hid_version else 2 def open(self) -> None: self.handle = hid.device() try: self.handle.open_path(self.path) except (IOError, OSError) as e: if sys.platform.startswith("linux"): e.args = e.args + (UDEV_RULES_STR,) raise e # On some platforms, HID path stays the same over device reconnects. # That means that someone could unplug a Trezor, plug a different one # and we wouldn't even know. # So we check that the serial matches what we expect. serial = self.handle.get_serial_number_string() if serial != self.serial: self.handle.close() self.handle = None raise TransportException( "Unexpected device {} on path {}".format(serial, self.path.decode()) ) self.handle.set_nonblocking(True) if self.hid_version is None: self.hid_version = self.probe_hid_version() def close(self) -> None: if self.handle is not None: # reload serial, because device.wipe() can reset it self.serial = self.handle.get_serial_number_string() self.handle.close() self.handle = None def write_chunk(self, chunk: bytes) -> None: if len(chunk) != 64: raise TransportException("Unexpected chunk size: %d" % len(chunk)) if self.hid_version == 2: self.handle.write(b"\0" + bytearray(chunk)) else: self.handle.write(chunk) def read_chunk(self) -> bytes: while True: chunk = self.handle.read(64) if chunk: break else: time.sleep(0.001) if len(chunk) != 64: raise TransportException("Unexpected chunk size: %d" % len(chunk)) return bytes(chunk) def probe_hid_version(self) -> int: n = self.handle.write([0, 63] + [0xFF] * 63) if n == 65: return 2 n = self.handle.write([63] + [0xFF] * 63) if n == 64: return 1 raise TransportException("Unknown HID version") class HidTransport(ProtocolBasedTransport): """ HidTransport implements transport over USB HID interface. """ PATH_PREFIX = "hid" ENABLED = hid is not None def __init__(self, device: HidDevice) -> None: self.device = device self.handle = HidHandle(device["path"], device["serial_number"]) protocol = ProtocolV1(self.handle) super().__init__(protocol=protocol) def get_path(self) -> str: return "%s:%s" % (self.PATH_PREFIX, self.device["path"].decode()) @classmethod def enumerate(cls, debug: bool = False) -> Iterable["HidTransport"]: devices = [] for dev in hid.enumerate(0, 0): usb_id = (dev["vendor_id"], dev["product_id"]) if usb_id != DEV_TREZOR1: continue if debug: if not is_debuglink(dev): continue else: if not is_wirelink(dev): continue devices.append(HidTransport(dev)) return devices def find_debug(self) -> "HidTransport": if self.protocol.VERSION >= 2: # use the same device return self else: # For v1 protocol, find debug USB interface for the same serial number for debug in HidTransport.enumerate(debug=True): if debug.device["serial_number"] == self.device["serial_number"]: return debug raise TransportException("Debug HID device not found") def is_wirelink(dev: HidDevice) -> bool: return dev["usage_page"] == 0xFF00 or dev["interface_number"] == 0 def is_debuglink(dev: HidDevice) -> bool: return dev["usage_page"] == 0xFF01 or dev["interface_number"] == 1 python-trezor-0.11.6/src/trezorlib/transport/protocol.py000066400000000000000000000265701361427340300235320ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . import logging import os import struct from io import BytesIO from typing import Tuple from typing_extensions import Protocol as StructuralType from .. import mapping, protobuf from ..log import DUMP_BYTES from . import Transport REPLEN = 64 V2_FIRST_CHUNK = 0x01 V2_NEXT_CHUNK = 0x02 V2_BEGIN_SESSION = 0x03 V2_END_SESSION = 0x04 LOG = logging.getLogger(__name__) class Handle(StructuralType): """PEP 544 structural type for Handle functionality. (called a "Protocol" in the proposed PEP, name which is impractical here) Handle is a "physical" layer for a protocol. It can open/close a connection and read/write bare data in 64-byte chunks. Functionally we gain nothing from making this an (abstract) base class for handle implementations, so this definition is for type hinting purposes only. You can, but don't have to, inherit from it. """ def open(self) -> None: ... def close(self) -> None: ... def read_chunk(self) -> bytes: ... def write_chunk(self, chunk: bytes) -> None: ... class Protocol: """Wire protocol that can communicate with a Trezor device, given a Handle. A Protocol implements the part of the Transport API that relates to communicating logical messages over a physical layer. It is a thing that can: - open and close sessions, - send and receive protobuf messages, given the ability to: - open and close physical connections, - and send and receive binary chunks. We declare a protocol version (we have implementations of v1 and v2). For now, the class also handles session counting and opening the underlying Handle. This will probably be removed in the future. We will need a new Protocol class if we change the way a Trezor device encapsulates its messages. """ VERSION = None # type: int def __init__(self, handle: Handle) -> None: self.handle = handle self.session_counter = 0 # XXX we might be able to remove this now that TrezorClient does session handling def begin_session(self) -> None: if self.session_counter == 0: self.handle.open() self.session_counter += 1 def end_session(self) -> None: self.session_counter = max(self.session_counter - 1, 0) if self.session_counter == 0: self.handle.close() def read(self) -> protobuf.MessageType: raise NotImplementedError def write(self, message: protobuf.MessageType) -> None: raise NotImplementedError class ProtocolBasedTransport(Transport): """Transport that implements its communications through a Protocol. Intended as a base class for implementations that proxy their communication operations to a Protocol. """ def __init__(self, protocol: Protocol) -> None: self.protocol = protocol def write(self, message: protobuf.MessageType) -> None: self.protocol.write(message) def read(self) -> protobuf.MessageType: return self.protocol.read() def begin_session(self) -> None: self.protocol.begin_session() def end_session(self) -> None: self.protocol.end_session() class ProtocolV1(Protocol): """Protocol version 1. Currently (11/2018) in use on all Trezors. Does not understand sessions. """ VERSION = 1 def write(self, msg: protobuf.MessageType) -> None: LOG.debug( "sending message: {}".format(msg.__class__.__name__), extra={"protobuf": msg}, ) data = BytesIO() protobuf.dump_message(data, msg) ser = data.getvalue() LOG.log(DUMP_BYTES, "sending bytes: {}".format(ser.hex())) header = struct.pack(">HL", mapping.get_type(msg), len(ser)) buffer = bytearray(b"##" + header + ser) while buffer: # Report ID, data padded to 63 bytes chunk = b"?" + buffer[: REPLEN - 1] chunk = chunk.ljust(REPLEN, b"\x00") self.handle.write_chunk(chunk) buffer = buffer[63:] def read(self) -> protobuf.MessageType: buffer = bytearray() # Read header with first part of message data msg_type, datalen, first_chunk = self.read_first() buffer.extend(first_chunk) # Read the rest of the message while len(buffer) < datalen: buffer.extend(self.read_next()) # Strip padding ser = buffer[:datalen] data = BytesIO(ser) LOG.log(DUMP_BYTES, "received bytes: {}".format(ser.hex())) # Parse to protobuf msg = protobuf.load_message(data, mapping.get_class(msg_type)) LOG.debug( "received message: {}".format(msg.__class__.__name__), extra={"protobuf": msg}, ) return msg def read_first(self) -> Tuple[int, int, bytes]: chunk = self.handle.read_chunk() if chunk[:3] != b"?##": raise RuntimeError("Unexpected magic characters") try: headerlen = struct.calcsize(">HL") msg_type, datalen = struct.unpack(">HL", chunk[3 : 3 + headerlen]) except Exception: raise RuntimeError("Cannot parse header") data = chunk[3 + headerlen :] return msg_type, datalen, data def read_next(self) -> bytes: chunk = self.handle.read_chunk() if chunk[:1] != b"?": raise RuntimeError("Unexpected magic characters") return chunk[1:] class ProtocolV2(Protocol): """Protocol version 2. Currently (11/2018) not used. Intended to mimic U2F/WebAuthN session handling. """ VERSION = 2 def __init__(self, handle: Handle) -> None: self.session = None super().__init__(handle) def begin_session(self) -> None: # ensure open connection super().begin_session() # initiate session chunk = struct.pack(">B", V2_BEGIN_SESSION) chunk = chunk.ljust(REPLEN, b"\x00") self.handle.write_chunk(chunk) # get session identifier resp = self.handle.read_chunk() try: headerlen = struct.calcsize(">BL") magic, session = struct.unpack(">BL", resp[:headerlen]) except Exception: raise RuntimeError("Cannot parse header") if magic != V2_BEGIN_SESSION: raise RuntimeError("Unexpected magic character") self.session = session LOG.debug("[session {}] session started".format(self.session)) def end_session(self) -> None: if not self.session: return try: chunk = struct.pack(">BL", V2_END_SESSION, self.session) chunk = chunk.ljust(REPLEN, b"\x00") self.handle.write_chunk(chunk) resp = self.handle.read_chunk() (magic,) = struct.unpack(">B", resp[:1]) if magic != V2_END_SESSION: raise RuntimeError("Expected session close") LOG.debug("[session {}] session ended".format(self.session)) finally: self.session = None # close connection if appropriate super().end_session() def write(self, msg: protobuf.MessageType) -> None: if not self.session: raise RuntimeError("Missing session for v2 protocol") LOG.debug( "[session {}] sending message: {}".format( self.session, msg.__class__.__name__ ), extra={"protobuf": msg}, ) # Serialize whole message data = BytesIO() protobuf.dump_message(data, msg) data = data.getvalue() dataheader = struct.pack(">LL", mapping.get_type(msg), len(data)) data = dataheader + data seq = -1 # Write it out while data: if seq < 0: repheader = struct.pack(">BL", V2_FIRST_CHUNK, self.session) else: repheader = struct.pack(">BLL", V2_NEXT_CHUNK, self.session, seq) datalen = REPLEN - len(repheader) chunk = repheader + data[:datalen] chunk = chunk.ljust(REPLEN, b"\x00") self.handle.write_chunk(chunk) data = data[datalen:] seq += 1 def read(self) -> protobuf.MessageType: if not self.session: raise RuntimeError("Missing session for v2 protocol") buffer = bytearray() # Read header with first part of message data msg_type, datalen, chunk = self.read_first() buffer.extend(chunk) # Read the rest of the message while len(buffer) < datalen: next_chunk = self.read_next() buffer.extend(next_chunk) # Strip padding buffer = BytesIO(buffer[:datalen]) # Parse to protobuf msg = protobuf.load_message(buffer, mapping.get_class(msg_type)) LOG.debug( "[session {}] received message: {}".format( self.session, msg.__class__.__name__ ), extra={"protobuf": msg}, ) return msg def read_first(self) -> Tuple[int, int, bytes]: chunk = self.handle.read_chunk() try: headerlen = struct.calcsize(">BLLL") magic, session, msg_type, datalen = struct.unpack( ">BLLL", chunk[:headerlen] ) except Exception: raise RuntimeError("Cannot parse header") if magic != V2_FIRST_CHUNK: raise RuntimeError("Unexpected magic character") if session != self.session: raise RuntimeError("Session id mismatch") return msg_type, datalen, chunk[headerlen:] def read_next(self) -> bytes: chunk = self.handle.read_chunk() try: headerlen = struct.calcsize(">BLL") magic, session, sequence = struct.unpack(">BLL", chunk[:headerlen]) except Exception: raise RuntimeError("Cannot parse header") if magic != V2_NEXT_CHUNK: raise RuntimeError("Unexpected magic characters") if session != self.session: raise RuntimeError("Session id mismatch") return chunk[headerlen:] def get_protocol(handle: Handle, want_v2: bool) -> Protocol: """Make a Protocol instance for the given handle. Each transport can have a preference for using a particular protocol version. This preference is overridable through `TREZOR_PROTOCOL_V1` environment variable, which forces the library to use V1 anyways. As of 11/2018, no devices support V2, so we enforce V1 here. It is still possible to set `TREZOR_PROTOCOL_V1=0` and thus enable V2 protocol for transports that ask for it (i.e., USB transports for Trezor T). """ force_v1 = int(os.environ.get("TREZOR_PROTOCOL_V1", 1)) if want_v2 and not force_v1: return ProtocolV2(handle) else: return ProtocolV1(handle) python-trezor-0.11.6/src/trezorlib/transport/udp.py000066400000000000000000000100601361427340300224440ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . import socket from typing import Iterable, Optional, cast from . import TransportException from .protocol import ProtocolBasedTransport, get_protocol SOCKET_TIMEOUT = 10 class UdpTransport(ProtocolBasedTransport): DEFAULT_HOST = "127.0.0.1" DEFAULT_PORT = 21324 PATH_PREFIX = "udp" ENABLED = True def __init__(self, device: str = None) -> None: if not device: host = UdpTransport.DEFAULT_HOST port = UdpTransport.DEFAULT_PORT else: devparts = device.split(":") host = devparts[0] port = int(devparts[1]) if len(devparts) > 1 else UdpTransport.DEFAULT_PORT self.device = (host, port) self.socket = None # type: Optional[socket.socket] protocol = get_protocol(self, want_v2=False) super().__init__(protocol=protocol) def get_path(self) -> str: return "{}:{}:{}".format(self.PATH_PREFIX, *self.device) def find_debug(self) -> "UdpTransport": host, port = self.device return UdpTransport("{}:{}".format(host, port + 1)) @classmethod def _try_path(cls, path: str) -> "UdpTransport": d = cls(path) try: d.open() if d._ping(): return d else: raise TransportException( "No Trezor device found at address {}".format(path) ) finally: d.close() @classmethod def enumerate(cls) -> Iterable["UdpTransport"]: default_path = "{}:{}".format(cls.DEFAULT_HOST, cls.DEFAULT_PORT) try: return [cls._try_path(default_path)] except TransportException: return [] @classmethod def find_by_path(cls, path: str, prefix_search: bool = False) -> "UdpTransport": if prefix_search: return cast(UdpTransport, super().find_by_path(path, prefix_search)) # This is *technically* type-able: mark `find_by_path` as returning # the same type from which `cls` comes from. # Mypy can't handle that though, so here we are. else: path = path.replace("{}:".format(cls.PATH_PREFIX), "") return cls._try_path(path) def open(self) -> None: self.socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) self.socket.connect(self.device) self.socket.settimeout(SOCKET_TIMEOUT) def close(self) -> None: if self.socket is not None: self.socket.close() self.socket = None def _ping(self) -> bool: """Test if the device is listening.""" assert self.socket is not None resp = None try: self.socket.sendall(b"PINGPING") resp = self.socket.recv(8) except Exception: pass return resp == b"PONGPONG" def write_chunk(self, chunk: bytes) -> None: assert self.socket is not None if len(chunk) != 64: raise TransportException("Unexpected data length") self.socket.sendall(chunk) def read_chunk(self) -> bytes: assert self.socket is not None while True: try: chunk = self.socket.recv(64) break except socket.timeout: continue if len(chunk) != 64: raise TransportException("Unexpected chunk size: %d" % len(chunk)) return bytearray(chunk) python-trezor-0.11.6/src/trezorlib/transport/webusb.py000066400000000000000000000124451361427340300231540ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . import atexit import logging import sys import time from typing import Iterable, Optional from . import TREZORS, UDEV_RULES_STR, TransportException from .protocol import ProtocolBasedTransport, ProtocolV1 LOG = logging.getLogger(__name__) try: import usb1 except Exception as e: LOG.warning("WebUSB transport is disabled: {}".format(e)) usb1 = None INTERFACE = 0 ENDPOINT = 1 DEBUG_INTERFACE = 1 DEBUG_ENDPOINT = 2 class WebUsbHandle: def __init__(self, device: "usb1.USBDevice", debug: bool = False) -> None: self.device = device self.interface = DEBUG_INTERFACE if debug else INTERFACE self.endpoint = DEBUG_ENDPOINT if debug else ENDPOINT self.count = 0 self.handle = None # type: Optional[usb1.USBDeviceHandle] def open(self) -> None: self.handle = self.device.open() if self.handle is None: if sys.platform.startswith("linux"): args = (UDEV_RULES_STR,) else: args = () raise IOError("Cannot open device", *args) self.handle.claimInterface(self.interface) def close(self) -> None: if self.handle is not None: self.handle.releaseInterface(self.interface) self.handle.close() self.handle = None def write_chunk(self, chunk: bytes) -> None: assert self.handle is not None if len(chunk) != 64: raise TransportException("Unexpected chunk size: %d" % len(chunk)) self.handle.interruptWrite(self.endpoint, chunk) def read_chunk(self) -> bytes: assert self.handle is not None endpoint = 0x80 | self.endpoint while True: chunk = self.handle.interruptRead(endpoint, 64) if chunk: break else: time.sleep(0.001) if len(chunk) != 64: raise TransportException("Unexpected chunk size: %d" % len(chunk)) return chunk class WebUsbTransport(ProtocolBasedTransport): """ WebUsbTransport implements transport over WebUSB interface. """ PATH_PREFIX = "webusb" ENABLED = usb1 is not None context = None def __init__( self, device: str, handle: WebUsbHandle = None, debug: bool = False ) -> None: if handle is None: handle = WebUsbHandle(device, debug) self.device = device self.handle = handle self.debug = debug super().__init__(protocol=ProtocolV1(handle)) def get_path(self) -> str: return "%s:%s" % (self.PATH_PREFIX, dev_to_str(self.device)) @classmethod def enumerate(cls, usb_reset=False) -> Iterable["WebUsbTransport"]: if cls.context is None: cls.context = usb1.USBContext() cls.context.open() atexit.register(cls.context.close) devices = [] for dev in cls.context.getDeviceIterator(skip_on_error=True): usb_id = (dev.getVendorID(), dev.getProductID()) if usb_id not in TREZORS: continue if not is_vendor_class(dev): continue try: # workaround for issue #223: # on certain combinations of Windows USB drivers and libusb versions, # Trezor is returned twice (possibly because Windows know it as both # a HID and a WebUSB device), and one of the returned devices is # non-functional. dev.getProduct() devices.append(WebUsbTransport(dev)) except usb1.USBErrorNotSupported: pass except usb1.USBErrorPipe: if usb_reset: handle = dev.open() handle.resetDevice() handle.close() return devices def find_debug(self) -> "WebUsbTransport": if self.protocol.VERSION >= 2: # TODO test this # XXX this is broken right now because sessions don't really work # For v2 protocol, use the same WebUSB interface with a different session return WebUsbTransport(self.device, self.handle) else: # For v1 protocol, find debug USB interface for the same serial number return WebUsbTransport(self.device, debug=True) def is_vendor_class(dev: "usb1.USBDevice") -> bool: configurationId = 0 altSettingId = 0 return ( dev[configurationId][INTERFACE][altSettingId].getClass() == usb1.libusb1.LIBUSB_CLASS_VENDOR_SPEC ) def dev_to_str(dev: "usb1.USBDevice") -> str: return ":".join( str(x) for x in ["%03i" % (dev.getBusNumber(),)] + dev.getPortNumberList() ) python-trezor-0.11.6/src/trezorlib/tx_api.py000066400000000000000000000143201361427340300211070ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . import random import struct from decimal import Decimal import requests from . import messages cache_dir = None def is_zcash(coin): lcn = coin["coin_name"].lower() return lcn.startswith("zcash") or lcn.startswith("komodo") def is_capricoin(coin): return coin["coin_name"].lower().startswith("capricoin") def is_peercoin(coin): return coin["coin_name"].lower().startswith("peercoin") def is_dash(coin): return coin["coin_name"].lower().startswith("dash") def pack_varint(n): if n < 253: return struct.pack(" <32-byte block hash> <3-byte block height> tail = o.script_pubkey[-38:] o.block_hash = tail[1:33] # <32-byte block hash> o.block_height = int.from_bytes(tail[34:37], "little") # <3-byte block height> if coin["decred"]: o.decred_script_version = vout["version"] return o def json_to_tx(coin, data): t = messages.TransactionType() t.version = data["version"] t.lock_time = data.get("locktime") if is_capricoin(coin) or is_peercoin(coin): t.timestamp = data["time"] if coin["decred"]: t.expiry = data["expiry"] if is_zcash(coin): t.overwintered = data.get("fOverwintered", False) t.expiry = data.get("nExpiryHeight", None) t.version_group_id = data.get("nVersionGroupId", None) t.inputs = [_json_to_input(coin, vin) for vin in data["vin"]] t.bin_outputs = [_json_to_bin_output(coin, vout) for vout in data["vout"]] # zcash extra data if is_zcash(coin) and t.version >= 2: joinsplit_cnt = len(data["vjoinsplit"]) if joinsplit_cnt == 0: t.extra_data = b"\x00" elif joinsplit_cnt >= 253: # we assume cnt < 253, so we can treat varIntLen(cnt) as 1 raise ValueError("Too many joinsplits") elif "hex" not in data: raise ValueError("Raw TX data required for Zcash joinsplit transaction") else: rawtx = bytes.fromhex(data["hex"]) extra_data_len = 1 + joinsplit_cnt * 1802 + 32 + 64 t.extra_data = rawtx[-extra_data_len:] if is_dash(coin): dip2_type = data.get("type", 0) if t.version == 3 and dip2_type != 0: # It's a DIP2 special TX with payload if "extraPayloadSize" not in data or "extraPayload" not in data: raise ValueError("Payload data missing in DIP2 transaction") if data["extraPayloadSize"] * 2 != len(data["extraPayload"]): raise ValueError("length mismatch") t.extra_data = pack_varint(data["extraPayloadSize"]) + bytes.fromhex( data["extraPayload"] ) # Trezor firmware doesn't understand the split of version and type, so let's mimic the # old serialization format t.version |= dip2_type << 16 return t class TxApi: def __init__(self, coin_data): self.coin_data = coin_data if coin_data["blockbook"]: self.url = random.choice(coin_data["blockbook"]) self.pushtx_url = self.url + "/sendtx" self.type = "blockbook" elif coin_data["bitcore"]: self.url = random.choice(coin_data["bitcore"]) self.pushtx_url = self.url + "/tx/send" self.type = "bitcore" else: raise ValueError("No API URL in coin data") def fetch_json(self, *path, **params): url = self.url + "/api/" + "/".join(map(str, path)) return requests.get(url, params=params).json(parse_float=Decimal) def get_block_hash(self, block_number): j = self.fetch_json("block-index", block_number) return bytes.fromhex(j["blockHash"]) def current_height(self): j = self.fetch_json("status", q="getBlockCount") return j["info"]["blocks"] def __getitem__(self, txhash): return self.get_tx(txhash.hex()) def get_tx_data(self, txhash): method = "tx-specific" if self.type == "blockbook" else "tx" data = self.fetch_json(method, txhash) if is_zcash(self.coin_data) and data.get("vjoinsplit") and "hex" not in data: j = self.fetch_json("rawtx", txhash) data["hex"] = j["rawtx"] return data def get_tx(self, txhash): data = self.get_tx_data(txhash) return json_to_tx(self.coin_data, data) python-trezor-0.11.6/src/trezorlib/ui.py000066400000000000000000000121631361427340300202430ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . import os import click from mnemonic import Mnemonic from . import device from .exceptions import Cancelled from .messages import PinMatrixRequestType, WordRequestType PIN_MATRIX_DESCRIPTION = """ Use the numeric keypad to describe number positions. The layout is: 7 8 9 4 5 6 1 2 3 """.strip() RECOVERY_MATRIX_DESCRIPTION = """ Use the numeric keypad to describe positions. For the word list use only left and right keys. Use backspace to correct an entry. The keypad layout is: 7 8 9 7 | 9 4 5 6 4 | 6 1 2 3 1 | 3 """.strip() PIN_GENERIC = None PIN_CURRENT = PinMatrixRequestType.Current PIN_NEW = PinMatrixRequestType.NewFirst PIN_CONFIRM = PinMatrixRequestType.NewSecond WIPE_CODE_NEW = PinMatrixRequestType.WipeCodeFirst WIPE_CODE_CONFIRM = PinMatrixRequestType.WipeCodeSecond def echo(*args, **kwargs): return click.echo(*args, err=True, **kwargs) def prompt(*args, **kwargs): return click.prompt(*args, err=True, **kwargs) class ClickUI: def __init__(self, always_prompt=False): self.pinmatrix_shown = False self.prompt_shown = False self.always_prompt = always_prompt def button_request(self, code): if not self.prompt_shown: echo("Please confirm action on your Trezor device") if not self.always_prompt: self.prompt_shown = True def get_pin(self, code=None): if code == PIN_CURRENT: desc = "current PIN" elif code == PIN_NEW: desc = "new PIN" elif code == PIN_CONFIRM: desc = "new PIN again" elif code == WIPE_CODE_NEW: desc = "new wipe code" elif code == WIPE_CODE_CONFIRM: desc = "new wipe code again" else: desc = "PIN" if not self.pinmatrix_shown: echo(PIN_MATRIX_DESCRIPTION) if not self.always_prompt: self.pinmatrix_shown = True while True: try: pin = prompt("Please enter {}".format(desc), hide_input=True) except click.Abort: raise Cancelled from None if not pin.isdigit(): echo("Non-numerical value provided, please try again") else: return pin def get_passphrase(self): if os.getenv("PASSPHRASE") is not None: echo("Passphrase required. Using PASSPHRASE environment variable.") return os.getenv("PASSPHRASE") while True: try: passphrase = prompt( "Passphrase required", hide_input=True, default="", show_default=False, ) second = prompt( "Confirm your passphrase", hide_input=True, default="", show_default=False, ) if passphrase == second: return passphrase else: echo("Passphrase did not match. Please try again.") except click.Abort: raise Cancelled from None def mnemonic_words(expand=False, language="english"): if expand: wordlist = Mnemonic(language).wordlist else: wordlist = set() def expand_word(word): if not expand: return word if word in wordlist: return word matches = [w for w in wordlist if w.startswith(word)] if len(matches) == 1: return matches[0] echo("Choose one of: " + ", ".join(matches)) raise KeyError(word) def get_word(type): assert type == WordRequestType.Plain while True: try: word = prompt("Enter one word of mnemonic") return expand_word(word) except KeyError: pass except click.Abort: raise Cancelled from None return get_word def matrix_words(type): while True: try: ch = click.getchar() except (KeyboardInterrupt, EOFError): raise Cancelled from None if ch in "\x04\x1b": # Ctrl+D, Esc raise Cancelled if ch in "\x08\x7f": # Backspace, Del return device.RECOVERY_BACK if type == WordRequestType.Matrix6 and ch in "147369": return ch if type == WordRequestType.Matrix9 and ch in "123456789": return ch python-trezor-0.11.6/tests/000077500000000000000000000000001361427340300156105ustar00rootroot00000000000000python-trezor-0.11.6/tests/test_ckd_public.py000066400000000000000000000025661361427340300213310ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . from trezorlib import ckd_public def test_ckd_public(): xpub1 = "xpub661MyMwAqRbcEnKbXcCqD2GT1di5zQxVqoHPAgHNe8dv5JP8gWmDproS6kFHJnLZd23tWevhdn4urGJ6b264DfTGKr8zjmYDjyDTi9U7iyT" node1 = ckd_public.deserialize(xpub1) node2 = ckd_public.public_ckd(node1, [0]) node3 = ckd_public.public_ckd(node1, [0, 0]) xpub2 = ckd_public.serialize(node2) xpub3 = ckd_public.serialize(node3) assert ( xpub2 == "xpub67ymn1YTdE2iSGXitxUEZeUdHF2FsejJATroeAxVMtzTAK9o3vjmFLrE7TqE1X76iobkVc3p8h3gNzNRTwPeQGYW3CCmYCG8n5ThVkXaQzs" ) assert ( xpub3 == "xpub6BD2MwdEg5PJPqiGetL9DJs7oDo6zP3XwAABX2vAQb5eLpY3QhHGUEm25V4nkQhnFMsqEVfTwtax2gKz8EFrt1PnBN6xQjE9jGmWDR6modu" ) python-trezor-0.11.6/tests/test_cosi.py000066400000000000000000000152601361427340300201620ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . import hashlib import pytest from trezorlib import _ed25519, cosi RFC8032_VECTORS = ( ( # test 1 # privkey bytes.fromhex( "9d61b19deffd5a60ba844af492ec2cc44449c5697b326919703bac031cae7f60" ), # pubkey bytes.fromhex( "d75a980182b10ab7d54bfed3c964073a0ee172f3daa62325af021a68f707511a" ), # message bytes.fromhex(""), # signature bytes.fromhex( "e5564300c360ac729086e2cc806e828a84877f1eb8e5d974d873e06522490155" "5fb8821590a33bacc61e39701cf9b46bd25bf5f0595bbe24655141438e7a100b" ), ), ( # test 2 # privkey bytes.fromhex( "4ccd089b28ff96da9db6c346ec114e0f5b8a319f35aba624da8cf6ed4fb8a6fb" ), # pubkey bytes.fromhex( "3d4017c3e843895a92b70aa74d1b7ebc9c982ccf2ec4968cc0cd55f12af4660c" ), # message bytes.fromhex("72"), # signature bytes.fromhex( "92a009a9f0d4cab8720e820b5f642540a2b27b5416503f8fb3762223ebdb69da" "085ac1e43e15996e458f3613d0f11d8c387b2eaeb4302aeeb00d291612bb0c00" ), ), ( # test 3 # privkey bytes.fromhex( "c5aa8df43f9f837bedb7442f31dcb7b166d38535076f094b85ce3a2e0b4458f7" ), # pubkey bytes.fromhex( "fc51cd8e6218a1a38da47ed00230f0580816ed13ba3303ac5deb911548908025" ), # message bytes.fromhex("af82"), # signature bytes.fromhex( "6291d657deec24024827e69c3abe01a30ce548a284743a445e3680d7db5ac3ac" "18ff9b538d16f290ae67f760984dc6594a7c15e9716ed28dc027beceea1ec40a" ), ), ( # test SHA(abc) # privkey bytes.fromhex( "833fe62409237b9d62ec77587520911e9a759cec1d19755b7da901b96dca3d42" ), # pubkey bytes.fromhex( "ec172b93ad5e563bf4932c70e1245034c35467ef2efd4d64ebf819683467e2bf" ), # message hashlib.sha512(b"abc").digest(), # signature bytes.fromhex( "dc2a4459e7369633a52b1bf277839a00201009a3efbf3ecb69bea2186c26b589" "09351fc9ac90b3ecfdfbc7c66431e0303dca179c138ac17ad9bef1177331a704" ), ), ) COMBINED_KEY = bytes.fromhex( "283967b1c19ff93d2924cdcba95e586547cafef509ea402963ceefe96ccb44f2" ) GLOBAL_COMMIT = bytes.fromhex( "75bd5806c6366e0374a1c6e020c53feb0791d6cc07560d27d8c158f886ecf389" ) @pytest.mark.parametrize("privkey, pubkey, message, signature", RFC8032_VECTORS) def test_single_eddsa_vector(privkey, pubkey, message, signature): my_pubkey = cosi.pubkey_from_privkey(privkey) assert my_pubkey == pubkey try: cosi.verify(signature, message, pubkey) except ValueError: pytest.fail("Signature does not verify.") fake_signature = signature[:37] + b"\xf0" + signature[38:] with pytest.raises(_ed25519.SignatureMismatch): cosi.verify(fake_signature, message, pubkey) def test_combine_keys(): pubkeys = [pubkey for _, pubkey, _, _ in RFC8032_VECTORS] assert cosi.combine_keys(pubkeys) == COMBINED_KEY Rs = [ cosi.get_nonce(privkey, message)[1] for privkey, _, message, _ in RFC8032_VECTORS ] assert cosi.combine_keys(Rs) == GLOBAL_COMMIT @pytest.mark.parametrize("keyset", [(0,), (0, 1), (0, 1, 2), (0, 1, 2, 3), (1, 3)]) def test_cosi_combination(keyset): message = hashlib.sha512(b"You all have to sign this.").digest() selection = [RFC8032_VECTORS[i] for i in keyset] # zip(*iterable) turns a list of tuples to a tuple of lists privkeys, pubkeys, _, _ = zip(*selection) nonce_pairs = [cosi.get_nonce(pk, message) for pk in privkeys] nonces, commits = zip(*nonce_pairs) # calculate global pubkey and commitment global_pk = cosi.combine_keys(pubkeys) global_commit = cosi.combine_keys(commits) # generate individual signatures signatures = [ cosi.sign_with_privkey(message, privkey, global_pk, nonce, global_commit) for privkey, nonce in zip(privkeys, nonces) ] # combine signatures global_sig = cosi.combine_sig(global_commit, signatures) try: cosi.verify(global_sig, message, global_pk) except Exception: pytest.fail("Failed to validate global signature") def test_m_of_n(): privkeys, pubkeys, _, _ = zip(*RFC8032_VECTORS) message = hashlib.sha512(b"My hovercraft is full of eels!").digest() signer_ids = 0, 2, 3 signers = [privkeys[i] for i in signer_ids] signer_pubkeys = [pubkeys[i] for i in signer_ids] sigmask = sum(1 << i for i in signer_ids) # generate multisignature nonce_pairs = [cosi.get_nonce(pk, message) for pk in signers] nonces, commits = zip(*nonce_pairs) global_pk = cosi.combine_keys(signer_pubkeys) global_commit = cosi.combine_keys(commits) signatures = [ cosi.sign_with_privkey(message, privkey, global_pk, nonce, global_commit) for privkey, nonce in zip(signers, nonces) ] global_sig = cosi.combine_sig(global_commit, signatures) try: # this is what we are actually doing cosi.verify_m_of_n(global_sig, message, 3, 4, sigmask, pubkeys) # we can require less signers too cosi.verify_m_of_n(global_sig, message, 1, 4, sigmask, pubkeys) except Exception: pytest.fail("Failed to validate by sigmask") # and now for various ways that should fail with pytest.raises(ValueError) as e: cosi.verify_m_of_n(global_sig, message, 4, 4, sigmask, pubkeys) assert "Not enough signers" in e.value.args[0] with pytest.raises(_ed25519.SignatureMismatch): # when N < number of possible signers, the topmost signers will be ignored cosi.verify_m_of_n(global_sig, message, 2, 3, sigmask, pubkeys) with pytest.raises(_ed25519.SignatureMismatch): # wrong sigmask cosi.verify_m_of_n(global_sig, message, 1, 4, 5, pubkeys) with pytest.raises(ValueError): # can't use "0 of N" scheme cosi.verify_m_of_n(global_sig, message, 0, 4, sigmask, pubkeys) python-trezor-0.11.6/tests/test_nem.py000066400000000000000000000030431361427340300200000ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . from trezorlib import nem def test_nem_basic(): transaction = { "timeStamp": 76809215, "amount": 1000000, "fee": 1000000, "recipient": "TALICE2GMA34CXHD7XLJQ536NM5UNKQHTORNNT2J", "type": nem.TYPE_TRANSACTION_TRANSFER, "deadline": 76895615, "version": (0x98 << 24), "message": {"payload": b"hello world".hex(), "type": 1}, "mosaics": [ {"mosaicId": {"namespaceId": "nem", "name": "xem"}, "quantity": 1000000} ], } msg = nem.create_sign_tx(transaction) # this is basically just a random sampling of expected properties assert msg.transaction is not None assert msg.transfer is not None assert len(msg.transfer.mosaics) == 1 assert msg.transfer.mosaics[0].namespace == "nem" assert msg.aggregate_modification is None assert msg.provision_namespace is None python-trezor-0.11.6/tests/test_protobuf_encoding.py000066400000000000000000000146351361427340300227400ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . from io import BytesIO import pytest from trezorlib import protobuf class PrimitiveMessage(protobuf.MessageType): @classmethod def get_fields(cls): return { 1: ("uvarint", protobuf.UVarintType, 0), 2: ("svarint", protobuf.SVarintType, 0), 3: ("bool", protobuf.BoolType, 0), 4: ("bytes", protobuf.BytesType, 0), 5: ("unicode", protobuf.UnicodeType, 0), 6: ("enum", protobuf.EnumType("t", (0, 5, 25)), 0), } class EnumMessageMoreValues(protobuf.MessageType): @classmethod def get_fields(cls): return {1: ("enum", protobuf.EnumType("t", (0, 1, 2, 3, 4, 5)), 0)} class EnumMessageLessValues(protobuf.MessageType): @classmethod def get_fields(cls): return {1: ("enum", protobuf.EnumType("t", (0, 5)), 0)} class RepeatedFields(protobuf.MessageType): @classmethod def get_fields(cls): return { 1: ("uintlist", protobuf.UVarintType, protobuf.FLAG_REPEATED), 2: ("enumlist", protobuf.EnumType("t", (0, 1)), protobuf.FLAG_REPEATED), 3: ("strlist", protobuf.UnicodeType, protobuf.FLAG_REPEATED), } def load_uvarint(buffer): reader = BytesIO(buffer) return protobuf.load_uvarint(reader) def dump_uvarint(value): writer = BytesIO() protobuf.dump_uvarint(writer, value) return writer.getvalue() def test_dump_uvarint(): assert dump_uvarint(0) == b"\x00" assert dump_uvarint(1) == b"\x01" assert dump_uvarint(0xFF) == b"\xff\x01" assert dump_uvarint(123456) == b"\xc0\xc4\x07" with pytest.raises(ValueError): dump_uvarint(-1) def test_load_uvarint(): assert load_uvarint(b"\x00") == 0 assert load_uvarint(b"\x01") == 1 assert load_uvarint(b"\xff\x01") == 0xFF assert load_uvarint(b"\xc0\xc4\x07") == 123456 assert load_uvarint(b"\x80\x80\x80\x80\x00") == 0 def test_broken_uvarint(): with pytest.raises(IOError): load_uvarint(b"\x80\x80") def test_sint_uint(): """ Protobuf interleaved signed encoding https://developers.google.com/protocol-buffers/docs/encoding#structure LSbit is sign, rest is shifted absolute value. Or, by example, you count like so: 0, -1, 1, -2, 2, -3 ... """ assert protobuf.sint_to_uint(0) == 0 assert protobuf.uint_to_sint(0) == 0 assert protobuf.sint_to_uint(-1) == 1 assert protobuf.sint_to_uint(1) == 2 assert protobuf.uint_to_sint(1) == -1 assert protobuf.uint_to_sint(2) == 1 # roundtrip: assert protobuf.uint_to_sint(protobuf.sint_to_uint(1234567891011)) == 1234567891011 assert protobuf.uint_to_sint(protobuf.sint_to_uint(-2 ** 32)) == -2 ** 32 def test_simple_message(): msg = PrimitiveMessage( uvarint=12345678910, svarint=-12345678910, bool=True, bytes=b"\xDE\xAD\xCA\xFE", unicode="Příliš žluťoučký kůň úpěl ďábelské ódy 😊", enum=5, ) buf = BytesIO() protobuf.dump_message(buf, msg) buf.seek(0) retr = protobuf.load_message(buf, PrimitiveMessage) assert msg == retr assert retr.uvarint == 12345678910 assert retr.svarint == -12345678910 assert retr.bool is True assert retr.bytes == b"\xDE\xAD\xCA\xFE" assert retr.unicode == "Příliš žluťoučký kůň úpěl ďábelské ódy 😊" assert retr.enum == 5 def test_validate_enum(caplog): # round-trip of a valid value msg = EnumMessageMoreValues(enum=0) buf = BytesIO() protobuf.dump_message(buf, msg) buf.seek(0) retr = protobuf.load_message(buf, EnumMessageLessValues) assert retr.enum == msg.enum assert not caplog.records # dumping an invalid enum value fails msg.enum = 19 buf.seek(0) protobuf.dump_message(buf, msg) assert len(caplog.records) == 1 record = caplog.records.pop(0) assert record.levelname == "WARNING" assert record.getMessage() == "Value 19 unknown for type t" msg.enum = 3 buf.seek(0) protobuf.dump_message(buf, msg) buf.seek(0) protobuf.load_message(buf, EnumMessageLessValues) assert len(caplog.records) == 1 record = caplog.records.pop(0) assert record.levelname == "WARNING" assert record.getMessage() == "Value 3 unknown for type t" def test_repeated(): msg = RepeatedFields( uintlist=[1, 2, 3], enumlist=[0, 1, 0, 1], strlist=["hello", "world"] ) buf = BytesIO() protobuf.dump_message(buf, msg) buf.seek(0) retr = protobuf.load_message(buf, RepeatedFields) assert retr == msg def test_enum_in_repeated(caplog): msg = RepeatedFields(enumlist=[0, 1, 2, 3]) buf = BytesIO() protobuf.dump_message(buf, msg) assert len(caplog.records) == 2 for record in caplog.records: assert record.levelname == "WARNING" assert "unknown for type t" in record.getMessage() def test_packed(): values = [4, 44, 444] packed_values = b"".join(dump_uvarint(v) for v in values) field_id = 1 << 3 | 2 # field number 1, wire type 2 field_len = len(packed_values) message_bytes = dump_uvarint(field_id) + dump_uvarint(field_len) + packed_values buf = BytesIO(message_bytes) msg = protobuf.load_message(buf, RepeatedFields) assert msg assert msg.uintlist == values assert not msg.enumlist assert not msg.strlist def test_packed_enum(): values = [0, 0, 0, 0] packed_values = b"".join(dump_uvarint(v) for v in values) field_id = 2 << 3 | 2 # field number 2, wire type 2 field_len = len(packed_values) message_bytes = dump_uvarint(field_id) + dump_uvarint(field_len) + packed_values buf = BytesIO(message_bytes) msg = protobuf.load_message(buf, RepeatedFields) assert msg assert msg.enumlist == values assert not msg.uintlist assert not msg.strlist python-trezor-0.11.6/tests/test_protobuf_misc.py000066400000000000000000000151171361427340300221010ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . from unittest.mock import patch from types import SimpleNamespace import pytest from trezorlib import protobuf SimpleEnum = SimpleNamespace(FOO=0, BAR=5, QUUX=13) SimpleEnumType = protobuf.EnumType("SimpleEnum", (0, 5, 13)) with_simple_enum = patch("trezorlib.messages.SimpleEnum", SimpleEnum, create=True) class SimpleMessage(protobuf.MessageType): @classmethod def get_fields(cls): return { 1: ("uvarint", protobuf.UVarintType, 0), 2: ("svarint", protobuf.SVarintType, 0), 3: ("bool", protobuf.BoolType, 0), 4: ("bytes", protobuf.BytesType, 0), 5: ("unicode", protobuf.UnicodeType, 0), 6: ("enum", SimpleEnumType, 0), 7: ("rep_int", protobuf.UVarintType, protobuf.FLAG_REPEATED), 8: ("rep_str", protobuf.UnicodeType, protobuf.FLAG_REPEATED), 9: ("rep_enum", SimpleEnumType, protobuf.FLAG_REPEATED), } class NestedMessage(protobuf.MessageType): @classmethod def get_fields(cls): return { 1: ("scalar", protobuf.UVarintType, 0), 2: ("nested", SimpleMessage, 0), 3: ("repeated", SimpleMessage, protobuf.FLAG_REPEATED), } def test_get_field_type(): # smoke test assert SimpleMessage.get_field_type("bool") is protobuf.BoolType # full field list for fname, ftype, _ in SimpleMessage.get_fields().values(): assert SimpleMessage.get_field_type(fname) is ftype @with_simple_enum def test_enum_to_str(): # smoke test assert SimpleEnumType.to_str(5) == "BAR" # full value list for name, value in SimpleEnum.__dict__.items(): assert SimpleEnumType.to_str(value) == name assert SimpleEnumType.from_str(name) == value with pytest.raises(TypeError): SimpleEnumType.from_str("NotAValidValue") with pytest.raises(TypeError): SimpleEnumType.to_str(999) @with_simple_enum def test_dict_roundtrip(): msg = SimpleMessage( uvarint=5, svarint=-13, bool=False, bytes=b"\xca\xfe\x00\xfe", unicode="žluťoučký kůň", enum=5, rep_int=[1, 2, 3], rep_str=["a", "b", "c"], rep_enum=[0, 5, 13], ) converted = protobuf.to_dict(msg) recovered = protobuf.dict_to_proto(SimpleMessage, converted) assert recovered == msg @with_simple_enum def test_to_dict(): msg = SimpleMessage( uvarint=5, svarint=-13, bool=False, bytes=b"\xca\xfe\x00\xfe", unicode="žluťoučký kůň", enum=5, rep_int=[1, 2, 3], rep_str=["a", "b", "c"], rep_enum=[0, 5, 13], ) converted = protobuf.to_dict(msg) fields = [fname for fname, _, _ in msg.get_fields().values()] assert list(sorted(converted.keys())) == list(sorted(fields)) assert converted["uvarint"] == 5 assert converted["svarint"] == -13 assert converted["bool"] is False assert converted["bytes"] == "cafe00fe" assert converted["unicode"] == "žluťoučký kůň" assert converted["enum"] == "BAR" assert converted["rep_int"] == [1, 2, 3] assert converted["rep_str"] == ["a", "b", "c"] assert converted["rep_enum"] == ["FOO", "BAR", "QUUX"] @with_simple_enum def test_recover_mismatch(): dictdata = { "bool": True, "enum": "FOO", "another_field": "hello", "rep_enum": ["FOO", 5, 5], } recovered = protobuf.dict_to_proto(SimpleMessage, dictdata) assert recovered.bool is True assert recovered.enum is SimpleEnum.FOO assert not hasattr(recovered, "another_field") assert recovered.rep_enum == [SimpleEnum.FOO, SimpleEnum.BAR, SimpleEnum.BAR] for name, _, flags in SimpleMessage.get_fields().values(): if name not in dictdata: if flags == protobuf.FLAG_REPEATED: assert getattr(recovered, name) == [] else: assert getattr(recovered, name) is None @with_simple_enum def test_hexlify(): msg = SimpleMessage(bytes=b"\xca\xfe\x00\x12\x34", unicode="žluťoučký kůň") converted_nohex = protobuf.to_dict(msg, hexlify_bytes=False) converted_hex = protobuf.to_dict(msg, hexlify_bytes=True) assert converted_nohex["bytes"] == b"\xca\xfe\x00\x12\x34" assert converted_nohex["unicode"] == "žluťoučký kůň" assert converted_hex["bytes"] == "cafe001234" assert converted_hex["unicode"] == "žluťoučký kůň" recovered_nohex = protobuf.dict_to_proto(SimpleMessage, converted_nohex) recovered_hex = protobuf.dict_to_proto(SimpleMessage, converted_hex) assert recovered_nohex.bytes == msg.bytes assert recovered_hex.bytes == msg.bytes @with_simple_enum def test_nested_round_trip(): msg = NestedMessage( scalar=9, nested=SimpleMessage(uvarint=4, enum=SimpleEnum.FOO), repeated=[ SimpleMessage(), SimpleMessage(rep_enum=[SimpleEnum.BAR, SimpleEnum.BAR]), SimpleMessage(bytes=b"\xca\xfe"), ], ) converted = protobuf.to_dict(msg) recovered = protobuf.dict_to_proto(NestedMessage, converted) assert msg == recovered @with_simple_enum def test_nested_to_dict(): msg = NestedMessage( scalar=9, nested=SimpleMessage(uvarint=4, enum=SimpleEnum.FOO), repeated=[ SimpleMessage(), SimpleMessage(rep_enum=[SimpleEnum.BAR, SimpleEnum.BAR]), SimpleMessage(bytes=b"\xca\xfe"), ], ) converted = protobuf.to_dict(msg) assert converted["scalar"] == 9 assert isinstance(converted["nested"], dict) assert isinstance(converted["repeated"], list) rep = converted["repeated"] assert rep[0] == {} assert rep[1] == {"rep_enum": ["BAR", "BAR"]} assert rep[2] == {"bytes": "cafe"} @with_simple_enum def test_nested_recover(): dictdata = {"nested": {}} recovered = protobuf.dict_to_proto(NestedMessage, dictdata) assert isinstance(recovered.nested, SimpleMessage) python-trezor-0.11.6/tests/test_stellar.py000066400000000000000000000366401361427340300207000ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . import base64 from trezorlib import messages, stellar def test_stellar_parse_transaction_bytes_simple(): b64 = b"AAAAABXWSL/k028ZbPtXNf/YylTNS4Iz90PyJEnefPMBzbRpAAAAZAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAXVVkJGaxhbhDFS6eIZFR28WJICfsQBAaUXvtXKAwwuAAAAAAO5/eyAAAAAA=" tx, operations = stellar.parse_transaction_bytes(base64.b64decode(b64)) assert ( tx.source_account == "GAK5MSF74TJW6GLM7NLTL76YZJKM2S4CGP3UH4REJHPHZ4YBZW2GSBPW" ) assert tx.fee == 100 assert tx.sequence_number == 4294967296 assert tx.timebounds_start is None assert tx.timebounds_end is None assert tx.memo_type == stellar.MEMO_TYPE_NONE assert tx.memo_text is None assert tx.memo_id is None assert tx.memo_hash is None assert tx.num_operations == len(operations) def test_stellar_parse_transaction_bytes_memo_text(): b64 = b"AAAAABXWSL/k028ZbPtXNf/YylTNS4Iz90PyJEnefPMBzbRpAAAAZAAAAAEAAAAAAAAAAAAAAAEAAAAMZXhhbXBsZSBtZW1vAAAAAQAAAAAAAAAAAAAAAF1VZCRmsYW4QxUuniGRUdvFiSAn7EAQGlF77VygMMLgAAAAADuf3sgAAAAA" tx, operations = stellar.parse_transaction_bytes(base64.b64decode(b64)) assert ( tx.source_account == "GAK5MSF74TJW6GLM7NLTL76YZJKM2S4CGP3UH4REJHPHZ4YBZW2GSBPW" ) assert tx.fee == 100 assert tx.sequence_number == 4294967296 assert tx.timebounds_start is None assert tx.timebounds_end is None assert tx.memo_type == stellar.MEMO_TYPE_TEXT assert tx.memo_text == b"example memo" assert tx.memo_id is None assert tx.memo_hash is None assert tx.num_operations == len(operations) def test_stellar_parse_transaction_bytes_memo_id(): b64 = b"AAAAABXWSL/k028ZbPtXNf/YylTNS4Iz90PyJEnefPMBzbRpAAAAZAAAAAEAAAAAAAAAAAAAAAIAAAAAB1vNFQAAAAEAAAAAAAAAAAAAAABdVWQkZrGFuEMVLp4hkVHbxYkgJ+xAEBpRe+1coDDC4AAAAAA7n97IAAAAAA==" tx, operations = stellar.parse_transaction_bytes(base64.b64decode(b64)) assert ( tx.source_account == "GAK5MSF74TJW6GLM7NLTL76YZJKM2S4CGP3UH4REJHPHZ4YBZW2GSBPW" ) assert tx.fee == 100 assert tx.sequence_number == 4294967296 assert tx.timebounds_start is None assert tx.timebounds_end is None assert tx.memo_type == stellar.MEMO_TYPE_ID assert tx.memo_text is None assert tx.memo_id == 123456789 assert tx.memo_hash is None assert tx.num_operations == len(operations) def test_stellar_parse_transaction_bytes_memo_hash(): b64 = b"AAAAABXWSL/k028ZbPtXNf/YylTNS4Iz90PyJEnefPMBzbRpAAAAZAAAAAEAAAAAAAAAAAAAAAMjLtb5+r8U47tVOSsYz+PQ/ryU0gzGMnw4odB11uoRjAAAAAEAAAAAAAAAAAAAAABdVWQkZrGFuEMVLp4hkVHbxYkgJ+xAEBpRe+1coDDC4AAAAAA7n97IAAAAAA==" tx, operations = stellar.parse_transaction_bytes(base64.b64decode(b64)) assert ( tx.source_account == "GAK5MSF74TJW6GLM7NLTL76YZJKM2S4CGP3UH4REJHPHZ4YBZW2GSBPW" ) assert tx.fee == 100 assert tx.sequence_number == 4294967296 assert tx.timebounds_start is None assert tx.timebounds_end is None assert tx.memo_type == stellar.MEMO_TYPE_HASH assert tx.memo_text is None assert tx.memo_id is None # base-64 encoding of the raw bytes of sha256('stellar') assert ( base64.b64encode(tx.memo_hash) == b"Iy7W+fq/FOO7VTkrGM/j0P68lNIMxjJ8OKHQddbqEYw=" ) assert tx.num_operations == len(operations) def test_stellar_parse_transaction_bytes_memo_return(): b64 = b"AAAAABXWSL/k028ZbPtXNf/YylTNS4Iz90PyJEnefPMBzbRpAAAAZAAAAAEAAAAAAAAAAAAAAAQjLtb5+r8U47tVOSsYz+PQ/ryU0gzGMnw4odB11uoRjAAAAAEAAAAAAAAAAAAAAABdVWQkZrGFuEMVLp4hkVHbxYkgJ+xAEBpRe+1coDDC4AAAAAA7n97IAAAAAA==" tx, operations = stellar.parse_transaction_bytes(base64.b64decode(b64)) assert ( tx.source_account == "GAK5MSF74TJW6GLM7NLTL76YZJKM2S4CGP3UH4REJHPHZ4YBZW2GSBPW" ) assert tx.fee == 100 assert tx.sequence_number == 4294967296 assert tx.timebounds_start is None assert tx.timebounds_end is None assert tx.memo_type == stellar.MEMO_TYPE_RETURN assert tx.memo_text is None assert tx.memo_id is None # base-64 encoding of the raw bytes of sha256('stellar') assert ( base64.b64encode(tx.memo_hash) == b"Iy7W+fq/FOO7VTkrGM/j0P68lNIMxjJ8OKHQddbqEYw=" ) assert tx.num_operations == len(operations) def test_stellar_parse_operation_bytes_create_account_simple(): b64 = b"AAAAABXWSL/k028ZbPtXNf/YylTNS4Iz90PyJEnefPMBzbRpAAAAZAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAXVVkJGaxhbhDFS6eIZFR28WJICfsQBAaUXvtXKAwwuAAAAAAO5/eyAAAAAA=" tx, operations = stellar.parse_transaction_bytes(base64.b64decode(b64)) op = operations[0] assert isinstance(op, messages.StellarCreateAccountOp) assert op.source_account is None assert op.new_account == "GBOVKZBEM2YYLOCDCUXJ4IMRKHN4LCJAE7WEAEA2KF562XFAGDBOB64V" assert op.starting_balance == 1000333000 def test_stellar_parse_operation_bytes_payment_native(): b64 = b"AAAAABXWSL/k028ZbPtXNf/YylTNS4Iz90PyJEnefPMBzbRpAAAAZAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAXVVkJGaxhbhDFS6eIZFR28WJICfsQBAaUXvtXKAwwuAAAAAAAAAAAB3PFpgAAAAA" tx, operations = stellar.parse_transaction_bytes(base64.b64decode(b64)) op = operations[0] assert isinstance(op, messages.StellarPaymentOp) assert op.source_account is None assert ( op.destination_account == "GBOVKZBEM2YYLOCDCUXJ4IMRKHN4LCJAE7WEAEA2KF562XFAGDBOB64V" ) assert op.asset.type == stellar.ASSET_TYPE_NATIVE assert op.amount == 500111000 def test_stellar_parse_operation_bytes_payment_custom4(): b64 = b"AAAAABXWSL/k028ZbPtXNf/YylTNS4Iz90PyJEnefPMBzbRpAAAAZAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAXVVkJGaxhbhDFS6eIZFR28WJICfsQBAaUXvtXKAwwuAAAAABVEVTVAAAAAAphJYCwg5YNl8SPBLYehykVQ0QzSGwrg4Y1E4+Vv1qFQAAAAAdzxaYAAAAAA==" tx, operations = stellar.parse_transaction_bytes(base64.b64decode(b64)) op = operations[0] assert op.source_account is None assert ( op.destination_account == "GBOVKZBEM2YYLOCDCUXJ4IMRKHN4LCJAE7WEAEA2KF562XFAGDBOB64V" ) assert op.asset.type == stellar.ASSET_TYPE_ALPHA4 assert op.asset.code == b"TEST" assert op.asset.issuer == "GAUYJFQCYIHFQNS7CI6BFWD2DSSFKDIQZUQ3BLQODDKE4PSW7VVBKENC" assert op.amount == 500111000 def test_stellar_parse_operation_bytes_payment_custom7(): b64 = b"AAAAABXWSL/k028ZbPtXNf/YylTNS4Iz90PyJEnefPMBzbRpAAAAZAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAXVVkJGaxhbhDFS6eIZFR28WJICfsQBAaUXvtXKAwwuAAAAACU0VWRU5YWAAAAAAAAAAAACmElgLCDlg2XxI8Eth6HKRVDRDNIbCuDhjUTj5W/WoVAAAAAB3PFpgAAAAA" tx, operations = stellar.parse_transaction_bytes(base64.b64decode(b64)) op = operations[0] assert isinstance(op, messages.StellarPaymentOp) assert op.source_account is None assert ( op.destination_account == "GBOVKZBEM2YYLOCDCUXJ4IMRKHN4LCJAE7WEAEA2KF562XFAGDBOB64V" ) assert op.asset.type == stellar.ASSET_TYPE_ALPHA12 # asset codes are either 4 or 12 characters, so this will be null-padded at the end assert op.asset.code == b"SEVENXX\x00\x00\x00\x00\x00" assert op.asset.issuer == "GAUYJFQCYIHFQNS7CI6BFWD2DSSFKDIQZUQ3BLQODDKE4PSW7VVBKENC" assert op.amount == 500111000 def test_stellar_parse_operation_bytes_path_payment_none(): b64 = b"AAAAABXWSL/k028ZbPtXNf/YylTNS4Iz90PyJEnefPMBzbRpAAAAZAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAIAAAAAAAAAAHfOKn8AAAAAXVVkJGaxhbhDFS6eIZFR28WJICfsQBAaUXvtXKAwwuAAAAABSlBZAAAAAADE+xa3Eb3cy85WSdqgwnUtC6UDwrC41YDANuCqe8vGxgAAAAAL68IBAAAAAAAAAAA=" tx, operations = stellar.parse_transaction_bytes(base64.b64decode(b64)) op = operations[0] assert isinstance(op, messages.StellarPathPaymentOp) assert op.source_account is None assert ( op.destination_account == "GBOVKZBEM2YYLOCDCUXJ4IMRKHN4LCJAE7WEAEA2KF562XFAGDBOB64V" ) assert op.send_asset.type == stellar.ASSET_TYPE_NATIVE assert op.send_max == 2009999999 assert ( op.destination_account == "GBOVKZBEM2YYLOCDCUXJ4IMRKHN4LCJAE7WEAEA2KF562XFAGDBOB64V" ) assert op.destination_asset.type == stellar.ASSET_TYPE_ALPHA4 # asset codes are either 4 or 12 characters, so this will be null-padded at the end assert op.destination_asset.code == b"JPY\x00" assert ( op.destination_asset.issuer == "GDCPWFVXCG65ZS6OKZE5VIGCOUWQXJIDYKYLRVMAYA3OBKT3ZPDMNTIJ" ) assert len(op.paths) == 0 def test_stellar_parse_operation_bytes_path_payment_one(): b64 = b"AAAAABXWSL/k028ZbPtXNf/YylTNS4Iz90PyJEnefPMBzbRpAAAAZAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAIAAAAAAAAAAHfOKn8AAAAAXVVkJGaxhbhDFS6eIZFR28WJICfsQBAaUXvtXKAwwuAAAAABSlBZAAAAAADE+xa3Eb3cy85WSdqgwnUtC6UDwrC41YDANuCqe8vGxgAAAAAL68IBAAAAAQAAAAFQVEgxAAAAAMz/d9fJ3rFifblw3jT7sRZv/Ja+fqLfob//aLZQRQibAAAAAA==" tx, operations = stellar.parse_transaction_bytes(base64.b64decode(b64)) op = operations[0] assert isinstance(op, messages.StellarPathPaymentOp) assert op.source_account is None assert ( op.destination_account == "GBOVKZBEM2YYLOCDCUXJ4IMRKHN4LCJAE7WEAEA2KF562XFAGDBOB64V" ) assert op.send_asset.type == stellar.ASSET_TYPE_NATIVE assert op.send_max == 2009999999 assert ( op.destination_account == "GBOVKZBEM2YYLOCDCUXJ4IMRKHN4LCJAE7WEAEA2KF562XFAGDBOB64V" ) assert op.destination_asset.type == stellar.ASSET_TYPE_ALPHA4 # asset codes are either 4 or 12 characters, so this will be null-padded at the end assert op.destination_asset.code == b"JPY\x00" assert ( op.destination_asset.issuer == "GDCPWFVXCG65ZS6OKZE5VIGCOUWQXJIDYKYLRVMAYA3OBKT3ZPDMNTIJ" ) assert op.destination_amount == 200000001 assert len(op.paths) == 1 assert op.paths[0].type == stellar.ASSET_TYPE_ALPHA4 assert op.paths[0].code == b"PTH1" assert ( op.paths[0].issuer == "GDGP656XZHPLCYT5XFYN4NH3WELG77EWXZ7KFX5BX77WRNSQIUEJXAJK" ) def test_stellar_parse_operation_bytes_manage_offer_new(): b64 = b"AAAAABXWSL/k028ZbPtXNf/YylTNS4Iz90PyJEnefPMBzbRpAAAAZAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAMAAAAAAAAAAVVTRAAAAAAABkAD8fq0d+bofA1LCatUL0dCTJexnyYYd4Y1ghnNUXMAAAAAdzWUAAAKSzYAD0JAAAAAAAAAAAAAAAAA" tx, operations = stellar.parse_transaction_bytes(base64.b64decode(b64)) op = operations[0] assert isinstance(op, messages.StellarManageOfferOp) assert op.source_account is None assert op.selling_asset.type == stellar.ASSET_TYPE_NATIVE assert op.buying_asset.type == stellar.ASSET_TYPE_ALPHA4 # asset codes are either 4 or 12 characters, so this will be null-padded at the end assert op.buying_asset.code == b"USD\x00" assert ( op.buying_asset.issuer == "GADEAA7R7K2HPZXIPQGUWCNLKQXUOQSMS6YZ6JQYO6DDLAQZZVIXG74A" ) assert op.amount == 2000000000 assert op.price_n == 674614 assert op.price_d == 1000000 assert op.offer_id == 0 # indicates a new offer def test_stellar_parse_operation_bytes_passive_offer_new(): b64 = b"AAAAABXWSL/k028ZbPtXNf/YylTNS4Iz90PyJEnefPMBzbRpAAAAZAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAQAAAAAAAAAAVVTRAAAAAAABkAD8fq0d+bofA1LCatUL0dCTJexnyYYd4Y1ghnNUXMAAAAAdzWUAAAKSzYAD0JAAAAAAA==" tx, operations = stellar.parse_transaction_bytes(base64.b64decode(b64)) op = operations[0] assert isinstance(op, messages.StellarCreatePassiveOfferOp) assert op.source_account is None assert op.selling_asset.type == stellar.ASSET_TYPE_NATIVE assert op.buying_asset.type == stellar.ASSET_TYPE_ALPHA4 # asset codes are either 4 or 12 characters, so this will be null-padded at the end assert op.buying_asset.code == b"USD\x00" assert ( op.buying_asset.issuer == "GADEAA7R7K2HPZXIPQGUWCNLKQXUOQSMS6YZ6JQYO6DDLAQZZVIXG74A" ) assert op.amount == 2000000000 assert op.price_n == 674614 assert op.price_d == 1000000 def test_stellar_parse_operation_bytes_set_options_inflation(): b64 = b"AAAAABXWSL/k028ZbPtXNf/YylTNS4Iz90PyJEnefPMBzbRpAAAAZAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAUAAAABAAAAAAt5i66vbwH70/2M4Oj0rQW81SNLAjfOsMV2bavzocXhAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" tx, operations = stellar.parse_transaction_bytes(base64.b64decode(b64)) op = operations[0] assert isinstance(op, messages.StellarSetOptionsOp) assert op.source_account is None assert ( op.inflation_destination_account == "GAFXTC5OV5XQD66T7WGOB2HUVUC3ZVJDJMBDPTVQYV3G3K7TUHC6CLBR" ) def test_stellar_parse_operation_bytes_change_trust_add(): b64 = b"AAAAABXWSL/k028ZbPtXNf/YylTNS4Iz90PyJEnefPMBzbRpAAAAZAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAYAAAABVVNEAAAAAACkn7CoQZEWAlyO6z6VBUAddrDDR078TtLt/nP/hZJ9KQAAAAJUC+QAAAAAAA==" tx, operations = stellar.parse_transaction_bytes(base64.b64decode(b64)) op = operations[0] assert isinstance(op, messages.StellarChangeTrustOp) assert op.source_account is None assert op.asset.type == stellar.ASSET_TYPE_ALPHA4 assert op.asset.code == b"USD\x00" assert op.asset.issuer == "GCSJ7MFIIGIRMAS4R3VT5FIFIAOXNMGDI5HPYTWS5X7HH74FSJ6STSGF" assert op.limit == 10000000000 def test_stellar_parse_operation_bytes_allow_trust_allow(): b64 = b"AAAAABXWSL/k028ZbPtXNf/YylTNS4Iz90PyJEnefPMBzbRpAAAAZAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAcAAAAAZ0Me3OnxI2tuaC8qt95THF1fuB42qARTnP2ookJapQUAAAABSlBZAAAAAAEAAAAA" tx, operations = stellar.parse_transaction_bytes(base64.b64decode(b64)) op = operations[0] assert isinstance(op, messages.StellarAllowTrustOp) assert op.source_account is None assert op.asset_type == stellar.ASSET_TYPE_ALPHA4 assert op.asset_code == b"JPY\x00" assert ( op.trusted_account == "GBTUGHW45HYSG23ONAXSVN66KMOF2X5YDY3KQBCTTT62RISCLKSQLYF4" ) def test_stellar_parse_operation_bytes_account_merge_simple(): b64 = b"AAAAABXWSL/k028ZbPtXNf/YylTNS4Iz90PyJEnefPMBzbRpAAAAZAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAgAAAAAXVVkJGaxhbhDFS6eIZFR28WJICfsQBAaUXvtXKAwwuAAAAAA" tx, operations = stellar.parse_transaction_bytes(base64.b64decode(b64)) op = operations[0] assert isinstance(op, messages.StellarAccountMergeOp) assert op.source_account is None assert ( op.destination_account == "GBOVKZBEM2YYLOCDCUXJ4IMRKHN4LCJAE7WEAEA2KF562XFAGDBOB64V" ) def test_stellar_parse_operation_bytes_manage_data_set_simple(): b64 = b"AAAAABXWSL/k028ZbPtXNf/YylTNS4Iz90PyJEnefPMBzbRpAAAAZAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAoAAAAJdGVzdCBkYXRhAAAAAAAAAQAAAARhc2RmAAAAAA==" tx, operations = stellar.parse_transaction_bytes(base64.b64decode(b64)) op = operations[0] assert isinstance(op, messages.StellarManageDataOp) assert op.source_account is None assert op.key == b"test data" assert op.value == b"asdf" def test_stellar_parse_operation_bytes_bump_sequence_simple(): b64 = b"AAAAABXWSL/k028ZbPtXNf/YylTNS4Iz90PyJEnefPMBzbRpAAAAZAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAsAAAAASZYC0gAAAAA=" tx, operations = stellar.parse_transaction_bytes(base64.b64decode(b64)) op = operations[0] assert isinstance(op, messages.StellarBumpSequenceOp) assert op.source_account is None assert op.bump_to == 1234567890 python-trezor-0.11.6/tests/test_transport.py000066400000000000000000000034561361427340300212650ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . import importlib from unittest import mock from trezorlib.transport import all_transports from trezorlib.transport.bridge import BridgeTransport def test_disabled_transport(): assert BridgeTransport.ENABLED assert BridgeTransport in all_transports() BridgeTransport.ENABLED = False assert BridgeTransport not in all_transports() # re-enable BridgeTransport.ENABLED = True def test_import_all_transports(): from trezorlib.transport.bridge import BridgeTransport from trezorlib.transport.hid import HidTransport from trezorlib.transport.webusb import WebUsbTransport from trezorlib.transport.udp import UdpTransport assert BridgeTransport assert HidTransport assert WebUsbTransport assert UdpTransport def test_transport_dependencies(): import trezorlib.transport.hid as hid_transport with mock.patch.dict("sys.modules", {"hid": None}): importlib.reload(hid_transport) assert not hid_transport.HidTransport.ENABLED with mock.patch.dict("sys.modules", {"hid": mock.Mock()}): importlib.reload(hid_transport) assert hid_transport.HidTransport.ENABLED python-trezor-0.11.6/tests/test_tx_api.py000066400000000000000000000067541361427340300205210ustar00rootroot00000000000000# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . import decimal import json import os from trezorlib import coins, tx_api CACHE_PATH = os.path.join(os.path.dirname(__file__), "../../tests/txcache") TxApiBitcoin = coins.tx_api["Bitcoin"] TxApiZencash = coins.tx_api["Horizen"] def load_tx_json(coin_name, txhash): filename = "insight_{}_tx_{}.json".format(coin_name, txhash) with open(os.path.join(CACHE_PATH, filename)) as f: return json.load(f, parse_float=decimal.Decimal) def test_tx_api_gettx(): TxApiBitcoin.get_tx( "39a29e954977662ab3879c66fb251ef753e0912223a83d1dcb009111d28265e5" ) TxApiBitcoin.get_tx( "54aa5680dea781f45ebb536e53dffc526d68c0eb5c00547e323b2c32382dfba3" ) TxApiBitcoin.get_tx( "58497a7757224d1ff1941488d23087071103e5bf855f4c1c44e5c8d9d82ca46e" ) TxApiBitcoin.get_tx( "6189e3febb5a21cee8b725aa1ef04ffce7e609448446d3a8d6f483c634ef5315" ) TxApiBitcoin.get_tx( "a6e2829d089cee47e481b1a753a53081b40738cc87e38f1d9b23ab57d9ad4396" ) TxApiBitcoin.get_tx( "c6091adf4c0c23982a35899a6e58ae11e703eacd7954f588ed4b9cdefc4dba52" ) TxApiBitcoin.get_tx( "c63e24ed820c5851b60c54613fbc4bcb37df6cd49b4c96143e99580a472f79fb" ) TxApiBitcoin.get_tx( "c6be22d34946593bcad1d2b013e12f74159e69574ffea21581dad115572e031c" ) TxApiBitcoin.get_tx( "d1d08ea63255af4ad16b098e9885a252632086fa6be53301521d05253ce8a73d" ) TxApiBitcoin.get_tx( "d5f65ee80147b4bcc70b75e4bbf2d7382021b871bd8867ef8fa525ef50864882" ) TxApiBitcoin.get_tx( "e4bc1ae5e5007a08f2b3926fe11c66612e8f73c6b00c69c7027213b84d259be3" ) def test_tx_api_current_block(): height = TxApiZencash.current_height() assert height > 347041 def test_tx_api_get_block_hash(): hash = TxApiZencash.get_block_hash(110000) assert ( hash.hex() == "000000003f5d6ba1385c6cd2d4f836dfc5adf7f98834309ad67e26faef462454" ) def test_tx_api_dash_dip2(): dash_data = coins.by_name["Dash"] def get_tx(txhash): data = load_tx_json("dash", txhash) return tx_api.json_to_tx(dash_data, data) # Test if pre-DIP2 TXs are still working as expected tx = get_tx("acb3b7f259429989fc9c51ae4a5e3e3eab0723dceb21577533ac7c4b4ba4db5d") assert tx.version == 2 # pre-DIP2 assert tx.extra_data is None and tx.extra_data_len is None # Test if version 3 TX with type=0 is treated as normal TX tx = get_tx("5579eaa64b2a0233e7d8d037f5a5afc957cedf48f1c4067e9e33ca6df22ab04f") assert tx.version == 3 assert tx.extra_data is None and tx.extra_data_len is None # Test if DIP2 payloads are initialized correctly tx = get_tx("15575a1c874bd60a819884e116c42e6791c8283ce1fc3b79f0d18531a61bbb8a") assert tx.version == (3 | (5 << 16)) # DIP2 type 1 (ProRegTx) assert len(tx.extra_data) == (38 + 1) # real length + varint size python-trezor-0.11.6/tools/000077500000000000000000000000001361427340300156065ustar00rootroot00000000000000python-trezor-0.11.6/tools/build_tx.py000077500000000000000000000137361361427340300200070ustar00rootroot00000000000000#!/usr/bin/env python3 # This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the License along with this library. # If not, see . import json import sys import click from trezorlib import coins, messages, tools from trezorlib.cli import ChoiceType from trezorlib.cli.btc import INPUT_SCRIPTS, OUTPUT_SCRIPTS from trezorlib.protobuf import to_dict def echo(*args, **kwargs): return click.echo(*args, err=True, **kwargs) def prompt(*args, **kwargs): return click.prompt(*args, err=True, **kwargs) def _default_script_type(address_n, script_types): script_type = "address" if address_n is None: pass elif address_n[0] == tools.H_(49): script_type = "p2shsegwit" elif address_n[0] == tools.H_(84): script_type = "segwit" return script_type # return script_types[script_type] def parse_vin(s): txid, vout = s.split(":") return bytes.fromhex(txid), int(vout) def _get_inputs_interactive(coin_data, txapi): inputs = [] txes = {} while True: echo() prev = prompt( "Previous output to spend (txid:vout)", type=parse_vin, default="" ) if not prev: break prev_hash, prev_index = prev address_n = prompt("BIP-32 path to derive the key", type=tools.parse_path) try: tx = txapi[prev_hash] txes[prev_hash] = tx amount = tx.bin_outputs[prev_index].amount echo("Prefilling input amount: {}".format(amount)) except Exception as e: print(e) echo("Failed to fetch transation. This might bite you later.") amount = prompt("Input amount (satoshis)", type=int, default=0) sequence = prompt( "Sequence Number to use (RBF opt-in enabled by default)", type=int, default=0xFFFFFFFD, ) script_type = prompt( "Input type", type=ChoiceType(INPUT_SCRIPTS), default=_default_script_type(address_n, INPUT_SCRIPTS), ) if isinstance(script_type, str): script_type = INPUT_SCRIPTS[script_type] new_input = messages.TxInputType( address_n=address_n, prev_hash=prev_hash, prev_index=prev_index, amount=amount, script_type=script_type, sequence=sequence, ) if coin_data["bip115"]: prev_output = txapi.get_tx(prev_hash.hex()).bin_outputs[prev_index] new_input.prev_block_hash_bip115 = prev_output.block_hash new_input.prev_block_height_bip115 = prev_output.block_height inputs.append(new_input) return inputs, txes def _get_outputs_interactive(): outputs = [] while True: echo() address = prompt("Output address (for non-change output)", default="") if address: address_n = None script_type = messages.OutputScriptType.PAYTOADDRESS else: address = None address_n = prompt( "BIP-32 path (for change output)", type=tools.parse_path, default="" ) if not address_n: break script_type = prompt( "Output type", type=ChoiceType(OUTPUT_SCRIPTS), default=_default_script_type(address_n, OUTPUT_SCRIPTS), ) if isinstance(script_type, str): script_type = OUTPUT_SCRIPTS[script_type] amount = prompt("Amount to spend (satoshis)", type=int) outputs.append( messages.TxOutputType( address_n=address_n, address=address, amount=amount, script_type=script_type, ) ) return outputs @click.command() def sign_interactive(): coin = prompt("Coin name", default="Bitcoin") if coin in coins.tx_api: coin_data = coins.by_name[coin] txapi = coins.tx_api[coin] else: echo('Coin "%s" is not recognized.' % coin, err=True) echo("Supported coin types: %s" % ", ".join(coins.tx_api.keys()), err=True) sys.exit(1) inputs, txes = _get_inputs_interactive(coin_data, txapi) outputs = _get_outputs_interactive() if coin_data["bip115"]: current_block_height = txapi.current_height() # Zencash recommendation for the better protection block_height = current_block_height - 300 block_hash = txapi.get_block_hash(block_height) # Blockhash passed in reverse order block_hash = block_hash[::-1] for output in outputs: output.block_hash_bip115 = block_hash output.block_height_bip115 = block_height signtx = messages.SignTx() signtx.version = prompt("Transaction version", type=int, default=2) signtx.lock_time = prompt("Transaction locktime", type=int, default=0) if coin == "Capricoin": signtx.timestamp = prompt("Transaction timestamp", type=int) result = { "coin_name": coin, "inputs": [to_dict(i, hexlify_bytes=True) for i in inputs], "outputs": [to_dict(o, hexlify_bytes=True) for o in outputs], "details": to_dict(signtx, hexlify_bytes=True), "prev_txes": { txhash.hex(): to_dict(txdata, hexlify_bytes=True) for txhash, txdata in txes.items() }, } print(json.dumps(result, sort_keys=True, indent=2)) if __name__ == "__main__": sign_interactive() python-trezor-0.11.6/tools/deserialize_tx.py000077500000000000000000000041551361427340300212030ustar00rootroot00000000000000#!/usr/bin/env python3 import os import sys try: import construct as c except ImportError: sys.stderr.write("This tool requires Construct. Install it with 'pip install Construct'.\n") sys.exit(1) from construct import this, len_ if os.isatty(sys.stdin.fileno()): tx_hex = input("Enter transaction in hex format: ") else: tx_hex = sys.stdin.read().strip() tx_bin = bytes.fromhex(tx_hex) CompactUintStruct = c.Struct( "base" / c.Int8ul, "ext" / c.Switch(this.base, {0xfd: c.Int16ul, 0xfe: c.Int32ul, 0xff: c.Int64ul}), ) class CompactUintAdapter(c.Adapter): def _encode(self, obj, context, path): if obj < 0xfd: return {"base": obj} if obj < 2 ** 16: return {"base": 0xfd, "ext": obj} if obj < 2 ** 32: return {"base": 0xfe, "ext": obj} if obj < 2 ** 64: return {"base": 0xff, "ext": obj} raise ValueError("Value too big for compact uint") def _decode(self, obj, context, path): return obj["ext"] or obj["base"] class ConstFlag(c.Adapter): def __init__(self, const): self.const = const super().__init__(c.Optional(c.Const(const))) def _encode(self, obj, context, path): return self.const if obj else None def _decode(self, obj, context, path): return obj is not None CompactUint = CompactUintAdapter(CompactUintStruct) TxInput = c.Struct( "tx" / c.Bytes(32), "index" / c.Int32ul, # TODO coinbase tx "script" / c.Prefixed(CompactUint, c.GreedyBytes), "sequence" / c.Int32ul, ) TxOutput = c.Struct( "value" / c.Int64ul, "pk_script" / c.Prefixed(CompactUint, c.GreedyBytes), ) StackItem = c.Prefixed(CompactUint, c.GreedyBytes) TxInputWitness = c.PrefixedArray(CompactUint, StackItem) Transaction = c.Struct( "version" / c.Int32ul, "segwit" / ConstFlag(b"\x00\x01"), "inputs" / c.PrefixedArray(CompactUint, TxInput), "outputs" / c.PrefixedArray(CompactUint, TxOutput), "witness" / c.If(this.segwit, TxInputWitness[len_(this.inputs)]), "lock_time" / c.Int32ul, c.Terminated, ) print(Transaction.parse(tx_bin)) python-trezor-0.11.6/tools/encfs_aes_getpass.py000077500000000000000000000071451361427340300216460ustar00rootroot00000000000000#!/usr/bin/env python3 """ Use Trezor as a hardware key for opening EncFS filesystem! Usage: encfs --standard --extpass=./encfs_aes_getpass.py ~/.crypt ~/crypt """ import os import sys import json import hashlib import trezorlib version_tuple = tuple(map(int, trezorlib.__version__.split("."))) if not (0, 11) <= version_tuple < (0, 12): raise RuntimeError("trezorlib version mismatch (0.11.x is required)") from trezorlib.client import TrezorClient from trezorlib.transport import enumerate_devices from trezorlib.ui import ClickUI import trezorlib.misc def wait_for_devices(): devices = enumerate_devices() while not len(devices): sys.stderr.write("Please connect Trezor to computer and press Enter...") input() devices = enumerate_devices() return devices def choose_device(devices): if not len(devices): raise RuntimeError("No Trezor connected!") if len(devices) == 1: try: return devices[0] except IOError: raise RuntimeError("Device is currently in use") i = 0 sys.stderr.write("----------------------------\n") sys.stderr.write("Available devices:\n") for d in devices: try: client = TrezorClient(d, ui=ClickUI()) except IOError: sys.stderr.write("[-] \n") continue if client.features.label: sys.stderr.write("[%d] %s\n" % (i, client.features.label)) else: sys.stderr.write("[%d] \n" % i) client.close() i += 1 sys.stderr.write("----------------------------\n") sys.stderr.write("Please choose device to use:") try: device_id = int(input()) return devices[device_id] except Exception: raise ValueError("Invalid choice, exiting...") def main(): if "encfs_root" not in os.environ: sys.stderr.write( "\nThis is not a standalone script and is not meant to be run independently.\n" ) sys.stderr.write( "\nUsage: encfs --standard --extpass=./encfs_aes_getpass.py ~/.crypt ~/crypt\n" ) sys.exit(1) devices = wait_for_devices() transport = choose_device(devices) client = TrezorClient(transport, ui=ClickUI()) rootdir = os.environ["encfs_root"] # Read "man encfs" for more passw_file = os.path.join(rootdir, "password.dat") if not os.path.exists(passw_file): # New encfs drive, let's generate password sys.stderr.write("Please provide label for new drive: ") label = input() sys.stderr.write("Computer asked Trezor for new strong password.\n") # 32 bytes, good for AES trezor_entropy = trezorlib.misc.get_entropy(client, 32) urandom_entropy = os.urandom(32) passw = hashlib.sha256(trezor_entropy + urandom_entropy).digest() if len(passw) != 32: raise ValueError("32 bytes password expected") bip32_path = [10, 0] passw_encrypted = trezorlib.misc.encrypt_keyvalue( client, bip32_path, label, passw, False, True ) data = { "label": label, "bip32_path": bip32_path, "password_encrypted_hex": passw_encrypted.hex(), } json.dump(data, open(passw_file, "w")) # Let's load password data = json.load(open(passw_file, "r")) passw = trezorlib.misc.decrypt_keyvalue( client, data["bip32_path"], data["label"], bytes.fromhex(data["password_encrypted_hex"]), False, True, ) print(passw) if __name__ == "__main__": main() python-trezor-0.11.6/tools/helloworld.py000077500000000000000000000011271361427340300203370ustar00rootroot00000000000000#!/usr/bin/env python3 from trezorlib.client import get_default_client from trezorlib.tools import parse_path from trezorlib import btc 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) print("Bitcoin address:", address) if __name__ == "__main__": main() python-trezor-0.11.6/tools/mem_flashblock.py000077500000000000000000000025011361427340300211270ustar00rootroot00000000000000#!/usr/bin/env python3 from trezorlib.debuglink import DebugLink from trezorlib.transport import enumerate_devices import sys # fmt: off sectoraddrs = [0x8000000, 0x8004000, 0x8008000, 0x800c000, 0x8010000, 0x8020000, 0x8040000, 0x8060000, 0x8080000, 0x80a0000, 0x80c0000, 0x80f0000] sectorlens = [0x4000, 0x4000, 0x4000, 0x4000, 0x8000, 0x10000, 0x10000, 0x10000, 0x10000, 0x10000, 0x10000, 0x10000] # fmt: on def find_debug(): for device in enumerate_devices(): try: debug_transport = device.find_debug() debug = DebugLink(debug_transport, auto_interact=False) debug.open() return debug except Exception: continue else: print("No suitable Trezor device found") sys.exit(1) def main(): debug = find_debug() sector = int(sys.argv[1]) f = open(sys.argv[2], "rb") content = f.read(sectorlens[sector]) if len(content) != sectorlens[sector]: print("Not enough bytes in file") return debug.flash_erase(sector) step = 0x400 for offset in range(0, sectorlens[sector], step): debug.memory_write( sectoraddrs[sector] + offset, content[offset : offset + step], flash=True ) if __name__ == "__main__": main() python-trezor-0.11.6/tools/mem_read.py000077500000000000000000000023031361427340300177320ustar00rootroot00000000000000#!/usr/bin/env python3 from trezorlib.debuglink import DebugLink from trezorlib.transport import enumerate_devices import sys # usage examples # read entire bootloader: ./mem_read.py 8000000 8000 # read initial stack pointer: ./mem_read.py 8000000 4 # an entire bootloader can be later disassembled with: # arm-none-eabi-objdump -D -b binary -m arm -M force-thumb memory.dat # note that in order for this to work, your trezor device must # be running a firmware that was built with debug link enabled def find_debug(): for device in enumerate_devices(): try: debug_transport = device.find_debug() debug = DebugLink(debug_transport, auto_interact=False) debug.open() return debug except Exception: continue else: print("No suitable Trezor device found") sys.exit(1) def main(): debug = find_debug() arg1 = int(sys.argv[1], 16) arg2 = int(sys.argv[2], 16) step = 0x400 if arg2 >= 0x400 else arg2 f = open("memory.dat", "wb") for addr in range(arg1, arg1 + arg2, step): mem = debug.memory_read(addr, step) f.write(mem) f.close() if __name__ == "__main__": main() python-trezor-0.11.6/tools/mem_write.py000077500000000000000000000012201361427340300201460ustar00rootroot00000000000000#!/usr/bin/env python3 from trezorlib.debuglink import DebugLink from trezorlib.transport import enumerate_devices import sys def find_debug(): for device in enumerate_devices(): try: debug_transport = device.find_debug() debug = DebugLink(debug_transport, auto_interact=False) debug.open() return debug except Exception: continue else: print("No suitable Trezor device found") sys.exit(1) def main(): debug = find_debug() debug.memory_write(int(sys.argv[1], 16), bytes.fromhex(sys.argv[2]), flash=True) if __name__ == "__main__": main() python-trezor-0.11.6/tools/mnemonic_check.py000077500000000000000000000042241361427340300211270ustar00rootroot00000000000000#!/usr/bin/env python3 import hashlib import mnemonic __doc__ = ''' Use this script to cross-check that Trezor generated valid mnemonic sentence for given internal (Trezor-generated) and external (computer-generated) entropy. Keep in mind that you're entering secret information to this script. Leaking of these information may lead to stealing your bitcoins from your wallet! We strongly recommend to run this script only on highly secured computer (ideally live linux distribution without an internet connection). ''' def generate_entropy(strength, internal_entropy, external_entropy): ''' strength - length of produced seed. One of 128, 192, 256 random - binary stream of random data from external HRNG ''' if strength not in (128, 192, 256): raise ValueError("Invalid strength") if not internal_entropy: raise ValueError("Internal entropy is not provided") if len(internal_entropy) < 32: raise ValueError("Internal entropy too short") if not external_entropy: raise ValueError("External entropy is not provided") if len(external_entropy) < 32: raise ValueError("External entropy too short") entropy = hashlib.sha256(internal_entropy + external_entropy).digest() entropy_stripped = entropy[:strength // 8] if len(entropy_stripped) * 8 != strength: raise ValueError("Entropy length mismatch") return entropy_stripped def main(): print(__doc__) comp = bytes.fromhex(input("Please enter computer-generated entropy (in hex): ").strip()) trzr = bytes.fromhex(input("Please enter Trezor-generated entropy (in hex): ").strip()) word_count = int(input("How many words your mnemonic has? ")) strength = word_count * 32 // 3 entropy = generate_entropy(strength, trzr, comp) words = mnemonic.Mnemonic('english').to_mnemonic(entropy) if not mnemonic.Mnemonic('english').check(words): print("Mnemonic is invalid") return if len(words.split(' ')) != word_count: print("Mnemonic length mismatch!") return print("Generated mnemonic is:", words) if __name__ == '__main__': main() python-trezor-0.11.6/tools/pwd_reader.py000077500000000000000000000116311361427340300203010ustar00rootroot00000000000000#!/usr/bin/env python3 from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes from cryptography.hazmat.backends import default_backend import hmac import hashlib import json import os from urllib.parse import urlparse from trezorlib import misc, ui from trezorlib.client import TrezorClient from trezorlib.transport import get_transport from trezorlib.tools import parse_path # Return path by BIP-32 BIP32_PATH = parse_path("10016h/0") # Deriving master key def getMasterKey(client): bip32_path = BIP32_PATH ENC_KEY = 'Activate TREZOR Password Manager?' ENC_VALUE = bytes.fromhex('2d650551248d792eabf628f451200d7f51cb63e46aadcbb1038aacb05e8c8aee2d650551248d792eabf628f451200d7f51cb63e46aadcbb1038aacb05e8c8aee') key = misc.encrypt_keyvalue( client, bip32_path, ENC_KEY, ENC_VALUE, True, True ) return key.hex() # Deriving file name and encryption key def getFileEncKey(key): filekey, enckey = key[:len(key) // 2], key[len(key) // 2:] FILENAME_MESS = b'5f91add3fa1c3c76e90c90a3bd0999e2bd7833d06a483fe884ee60397aca277a' digest = hmac.new(str.encode(filekey), FILENAME_MESS, hashlib.sha256).hexdigest() filename = digest + '.pswd' return [filename, filekey, enckey] # File level decryption and file reading def decryptStorage(path, key): cipherkey = bytes.fromhex(key) with open(path, 'rb') as f: iv = f.read(12) tag = f.read(16) cipher = Cipher(algorithms.AES(cipherkey), modes.GCM(iv, tag), backend=default_backend()) decryptor = cipher.decryptor() data = '' while True: block = f.read(16) # data are not authenticated yet if block: data = data + decryptor.update(block).decode() else: break # throws exception when the tag is wrong data = data + decryptor.finalize().decode() return json.loads(data) def decryptEntryValue(nonce, val): cipherkey = bytes.fromhex(nonce) iv = val[:12] tag = val[12:28] cipher = Cipher(algorithms.AES(cipherkey), modes.GCM(iv, tag), backend=default_backend()) decryptor = cipher.decryptor() data = '' inputData = val[28:] while True: block = inputData[:16] inputData = inputData[16:] if block: data = data + decryptor.update(block).decode() else: break # throws exception when the tag is wrong data = data + decryptor.finalize().decode() return json.loads(data) # Decrypt give entry nonce def getDecryptedNonce(client, entry): print() print('Waiting for Trezor input ...') print() if 'item' in entry: item = entry['item'] else: item = entry['title'] pr = urlparse(item) if pr.scheme and pr.netloc: item = pr.netloc ENC_KEY = 'Unlock %s for user %s?' % (item, entry['username']) ENC_VALUE = entry['nonce'] decrypted_nonce = misc.decrypt_keyvalue( client, BIP32_PATH, ENC_KEY, bytes.fromhex(ENC_VALUE), False, True ) return decrypted_nonce.hex() # Pretty print of list def printEntries(entries): print('Password entries') print('================') print() for k, v in entries.items(): print('Entry id: #%s' % k) print('-------------') for kk, vv in v.items(): if kk in ['nonce', 'safe_note', 'password']: continue # skip these fields print('*', kk, ': ', vv) print() return def main(): try: transport = get_transport() except Exception as e: print(e) return client = TrezorClient(transport=transport, ui=ui.ClickUI()) print() print('Confirm operation on Trezor') print() masterKey = getMasterKey(client) # print('master key:', masterKey) fileName = getFileEncKey(masterKey)[0] # print('file name:', fileName) home = os.path.expanduser('~') path = os.path.join(home, 'Dropbox', 'Apps', 'TREZOR Password Manager') # print('path to file:', path) encKey = getFileEncKey(masterKey)[2] # print('enckey:', encKey) full_path = os.path.join(path, fileName) parsed_json = decryptStorage(full_path, encKey) # list entries entries = parsed_json['entries'] printEntries(entries) entry_id = input('Select entry number to decrypt: ') entry_id = str(entry_id) plain_nonce = getDecryptedNonce(client, entries[entry_id]) pwdArr = entries[entry_id]['password']['data'] pwdHex = ''.join([hex(x)[2:].zfill(2) for x in pwdArr]) print('password: ', decryptEntryValue(plain_nonce, bytes.fromhex(pwdHex))) safeNoteArr = entries[entry_id]['safe_note']['data'] safeNoteHex = ''.join([hex(x)[2:].zfill(2) for x in safeNoteArr]) print('safe_note:', decryptEntryValue(plain_nonce, bytes.fromhex(safeNoteHex))) return if __name__ == '__main__': main() python-trezor-0.11.6/tools/rng_entropy_collector.py000077500000000000000000000017231361427340300226020ustar00rootroot00000000000000#!/usr/bin/env python3 # example usage: ./rng_entropy_collector.py stm32_rng_1.dat 1048576 # note: for reading large amounts of entropy, compile a firmware # that has DEBUG_RNG == 1 as that will disable the user button # push confirmation import io import sys from trezorlib import misc, ui from trezorlib.client import TrezorClient from trezorlib.transport import get_transport def main(): try: client = TrezorClient(get_transport(), ui=ui.ClickUI()) except Exception as e: print(e) return arg1 = sys.argv[1] # output file arg2 = int(sys.argv[2], 10) # total number of how many bytes of entropy to read step = 1024 if arg2 >= 1024 else arg2 # trezor will only return 1KB at a time with io.open(arg1, 'wb') as f: for i in range(0, arg2, step): entropy = misc.get_entropy(client, step) f.write(entropy) client.close() if __name__ == '__main__': main() python-trezor-0.11.6/tools/trezor-otp.py000077500000000000000000000054101361427340300203100ustar00rootroot00000000000000#!/usr/bin/env python3 import configparser import os import re import sys import pyotp from trezorlib.client import TrezorClient from trezorlib.misc import decrypt_keyvalue, encrypt_keyvalue from trezorlib.tools import parse_path from trezorlib.transport import get_transport from trezorlib.ui import ClickUI BIP32_PATH = parse_path("10016h/0") def encrypt(type, domain, secret): transport = get_transport() client = TrezorClient(transport, ClickUI()) dom = type.upper() + ": " + domain enc = encrypt_keyvalue(client, BIP32_PATH, dom, secret.encode(), False, True) client.close() return enc.hex() def decrypt(type, domain, secret): transport = get_transport() client = TrezorClient(transport, ClickUI()) dom = type.upper() + ": " + domain dec = decrypt_keyvalue(client, BIP32_PATH, dom, secret, False, True) client.close() return dec class Config: def __init__(self): XDG_CONFIG_HOME = os.getenv("XDG_CONFIG_HOME", os.path.expanduser("~/.config")) os.makedirs(XDG_CONFIG_HOME, exist_ok=True) self.filename = XDG_CONFIG_HOME + "/trezor-otp.ini" self.config = configparser.ConfigParser() self.config.read(self.filename) def add(self, domain, secret, type="totp"): self.config[domain] = {} self.config[domain]["secret"] = encrypt(type, domain, secret) self.config[domain]["type"] = type if type == "hotp": self.config[domain]["counter"] = "0" with open(self.filename, "w") as f: self.config.write(f) def get(self, domain): s = self.config[domain] if s["type"] == "hotp": s["counter"] = str(int(s["counter"]) + 1) with open(self.filename, "w") as f: self.config.write(f) secret = decrypt(s["type"], domain, bytes.fromhex(s["secret"])) if s["type"] == "totp": return pyotp.TOTP(secret).now() if s["type"] == "hotp": c = int(s["counter"]) return pyotp.HOTP(secret).at(c) return ValueError("unknown domain or type") def add(): c = Config() domain = input("domain: ") while True: secret = input("secret: ") if re.match(r"^[A-Z2-7]{16}$", secret): break print("invalid secret") while True: type = input("type (t=totp h=hotp): ") if type in ("t", "h"): break print("invalid type") c.add(domain, secret, type + "otp") print("Entry added") def get(domain): c = Config() s = c.get(domain) print(s) def main(): if len(sys.argv) < 2: print("Usage: trezor-otp.py [add|domain]") sys.exit(1) if sys.argv[1] == "add": add() else: get(sys.argv[1]) if __name__ == "__main__": main()