From 6149775a7da2b79e7adf7e34659d1b57d2884532 Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Tue, 22 Jul 2025 10:54:33 +0200 Subject: [PATCH 01/31] Adjust bitcoind location It was moved by https://github.com/bitcoin/bitcoin/pull/31161 --- .github/actions/build-bitcoind/action.yml | 2 +- docs/examples/bitcoin-core-usage.rst | 2 +- test/run_tests.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/build-bitcoind/action.yml b/.github/actions/build-bitcoind/action.yml index ed4c5957c..e4befd42e 100644 --- a/.github/actions/build-bitcoind/action.yml +++ b/.github/actions/build-bitcoind/action.yml @@ -23,7 +23,7 @@ runs: ccache --zero-stats cd test; ./setup_environment.sh --bitcoind; cd .. ccache --show-stats --verbose - tar -czf bitcoind.tar.gz test/work/bitcoin/build/src/bitcoind + tar -czf bitcoind.tar.gz test/work/bitcoin/build/bin/bitcoind - uses: actions/cache/save@v4 if: github.event_name != 'pull_request' && steps.ccache-cache.outputs.cache-hit != 'true' diff --git a/docs/examples/bitcoin-core-usage.rst b/docs/examples/bitcoin-core-usage.rst index 5114dc228..cf0170a25 100644 --- a/docs/examples/bitcoin-core-usage.rst +++ b/docs/examples/bitcoin-core-usage.rst @@ -32,7 +32,7 @@ Clone Bitcoin Core and build it. Clone HWI. $ cd bitcoin $ cmake -B build $ cmake --build build - $ build/src/bitcoind -daemon -addresstype=bech32 -changetype=bech32 + $ build/bin/bitcoind -daemon -addresstype=bech32 -changetype=bech32 $ cd .. $ git clone https://github.com/bitcoin-core/HWI.git $ cd HWI diff --git a/test/run_tests.py b/test/run_tests.py index cd502a6c0..42384b117 100755 --- a/test/run_tests.py +++ b/test/run_tests.py @@ -66,7 +66,7 @@ parser.add_argument('--bitbox02-path', dest='bitbox02_path', help='Path to BitBox02 simulator', default='work/bitbox02-firmware/build-build/bin/simulator') parser.add_argument('--all', help='Run tests on all existing simulators', default=False, action='store_true') -parser.add_argument('--bitcoind', help='Path to bitcoind', default='work/bitcoin/build/src/bitcoind') +parser.add_argument('--bitcoind', help='Path to bitcoind', default='work/bitcoin/build/bin/bitcoind') parser.add_argument('--interface', help='Which interface to send commands over', choices=['library', 'cli', 'bindist', 'stdin'], default='library') parser.add_argument("--device-only", help="Only run device tests", action="store_true") From 07b3ae7a16970d147cddafa21ffb365c0e0dd9f2 Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Tue, 22 Jul 2025 11:27:59 +0200 Subject: [PATCH 02/31] ci: bump docker/build-push-action to v6 --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bbf858dea..703f22c05 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -91,7 +91,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: docker/build-push-action@v5 + - uses: docker/build-push-action@v6 with: context: . file: contrib/build-wine.Dockerfile @@ -115,7 +115,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: docker/build-push-action@v5 + - uses: docker/build-push-action@v6 with: context: . file: contrib/build.Dockerfile From b8d7147f511b58ecd00e90f4537ad2000d903b04 Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Tue, 22 Jul 2025 11:42:19 +0200 Subject: [PATCH 03/31] Drop Python 3.8 --- .github/workflows/ci.yml | 4 +- ci/cirrus.Dockerfile | 4 +- poetry.lock | 105 ++++++++++++++++++++++++++++++--------- pyproject.toml | 4 +- setup.py | 2 +- 5 files changed, 88 insertions(+), 31 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 703f22c05..873be671e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -210,7 +210,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ] + python-version: [ '3.9', '3.10', '3.11', '3.12' ] device: - 'trezor-1' - 'trezor-t' @@ -281,7 +281,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ] + python-version: [ '3.9', '3.10', '3.11', '3.12' ] device: - 'trezor-1' - 'trezor-t' diff --git a/ci/cirrus.Dockerfile b/ci/cirrus.Dockerfile index 17d6752d8..07c201c6e 100644 --- a/ci/cirrus.Dockerfile +++ b/ci/cirrus.Dockerfile @@ -1,6 +1,6 @@ # Cache break (modify this line to break cirrus' dockerfile build cache) 1 -FROM python:3.8 +FROM python:3.9 ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update @@ -10,7 +10,7 @@ RUN apt-get install -y \ bsdmainutils \ build-essential \ ccache \ - clang \ + clang \ cmake \ curl \ cython3 \ diff --git a/poetry.lock b/poetry.lock index 1e1047655..8f1173a36 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.1.3 and should not be changed by hand. [[package]] name = "alabaster" @@ -6,6 +6,7 @@ version = "0.7.13" description = "A configurable sidebar-enabled Sphinx theme" optional = false python-versions = ">=3.6" +groups = ["dev"] files = [ {file = "alabaster-0.7.13-py3-none-any.whl", hash = "sha256:1ee19aca801bbabb5ba3f5f258e4422dfa86f82f3e9cefb0859b283cdd7f62a3"}, {file = "alabaster-0.7.13.tar.gz", hash = "sha256:a27a4a084d5e690e16e01e03ad2b2e552c61a65469419b907243193de1a84ae2"}, @@ -17,6 +18,7 @@ version = "0.17.4" description = "Python graph (network) package" optional = false python-versions = "*" +groups = ["dev"] files = [ {file = "altgraph-0.17.4-py2.py3-none-any.whl", hash = "sha256:642743b4750de17e655e6711601b077bc6598dbfa3ba5fa2b2a35ce12b508dff"}, {file = "altgraph-0.17.4.tar.gz", hash = "sha256:1b5afbb98f6c4dcadb2e2ae6ab9fa994bbb8c1d75f4fa96d340f9437ae454406"}, @@ -28,6 +30,7 @@ version = "1.7.0" description = "A tool that automatically formats Python code to conform to the PEP 8 style guide" optional = false python-versions = "*" +groups = ["dev"] files = [ {file = "autopep8-1.7.0-py2.py3-none-any.whl", hash = "sha256:6f09e90a2be784317e84dc1add17ebfc7abe3924239957a37e5040e27d812087"}, {file = "autopep8-1.7.0.tar.gz", hash = "sha256:ca9b1a83e53a7fad65d731dc7a2a2d50aa48f43850407c59f6a1a306c4201142"}, @@ -43,14 +46,12 @@ version = "2.14.0" description = "Internationalization utilities" optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "Babel-2.14.0-py3-none-any.whl", hash = "sha256:efb1a25b7118e67ce3a259bed20545c29cb68be8ad2c784c83689981b7a57287"}, {file = "Babel-2.14.0.tar.gz", hash = "sha256:6919867db036398ba21eb5c7a0f6b28ab8cbc3ae7a73a44ebe34ae74a4e7d363"}, ] -[package.dependencies] -pytz = {version = ">=2015.7", markers = "python_version < \"3.9\""} - [package.extras] dev = ["freezegun (>=1.0,<2.0)", "pytest (>=6.0)", "pytest-cov"] @@ -60,6 +61,7 @@ version = "5.6.0" description = "CBOR (de)serializer with extensive tag support" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "cbor2-5.6.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:7569627514699b10d903795e344e5520cd758f7db968e46e667b6875c409610b"}, {file = "cbor2-5.6.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:0e6d5c5b5cb25450561c92c9ac7d72912027cfa8807aab77ea6f5549e2157335"}, @@ -102,7 +104,7 @@ files = [ [package.extras] benchmarks = ["pytest-benchmark (==4.0.0)"] -doc = ["Sphinx (>=7)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphinx-rtd-theme (>=1.3.0)", "typing-extensions"] +doc = ["Sphinx (>=7)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphinx-rtd-theme (>=1.3.0)", "typing-extensions ; python_version < \"3.12\""] test = ["coverage (>=7)", "hypothesis", "pytest"] [[package]] @@ -111,6 +113,7 @@ version = "2023.11.17" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.6" +groups = ["dev"] files = [ {file = "certifi-2023.11.17-py3-none-any.whl", hash = "sha256:e036ab49d5b79556f99cfc2d9320b34cfbe5be05c5871b51de9329f0603b0474"}, {file = "certifi-2023.11.17.tar.gz", hash = "sha256:9b469f3a900bf28dc19b8cfbf8019bf47f7fdd1a65a1d4ffb98fc14166beb4d1"}, @@ -122,6 +125,8 @@ version = "1.16.0" description = "Foreign Function Interface for Python calling C code." optional = false python-versions = ">=3.8" +groups = ["main"] +markers = "platform_python_implementation != \"PyPy\"" files = [ {file = "cffi-1.16.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6b3d6606d369fc1da4fd8c357d026317fbb9c9b75d36dc16e90e84c26854b088"}, {file = "cffi-1.16.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ac0f5edd2360eea2f1daa9e26a41db02dd4b0451b48f7c318e217ee092a213e9"}, @@ -186,6 +191,7 @@ version = "3.3.2" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." optional = false python-versions = ">=3.7.0" +groups = ["dev"] files = [ {file = "charset-normalizer-3.3.2.tar.gz", hash = "sha256:f30c3cb33b24454a82faecaf01b19c18562b1e89558fb6c56de4d9118a032fd5"}, {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:25baf083bf6f6b341f4121c2f3c548875ee6f5339300e08be3f2b2ba1721cdd3"}, @@ -285,6 +291,8 @@ version = "0.4.6" description = "Cross-platform colored terminal text." optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +groups = ["dev"] +markers = "sys_platform == \"win32\"" files = [ {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, @@ -296,6 +304,7 @@ version = "42.0.2" description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." optional = false python-versions = ">=3.7" +groups = ["main"] files = [ {file = "cryptography-42.0.2-cp37-abi3-macosx_10_12_universal2.whl", hash = "sha256:701171f825dcab90969596ce2af253143b93b08f1a716d4b2a9d2db5084ef7be"}, {file = "cryptography-42.0.2-cp37-abi3-macosx_10_12_x86_64.whl", hash = "sha256:61321672b3ac7aade25c40449ccedbc6db72c7f5f0fdf34def5e2f8b51ca530d"}, @@ -350,6 +359,7 @@ version = "0.18.1" description = "Docutils -- Python Documentation Utilities" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +groups = ["dev"] files = [ {file = "docutils-0.18.1-py2.py3-none-any.whl", hash = "sha256:23010f129180089fbcd3bc08cfefccb3b890b0050e1ca00c867036e9d161b98c"}, {file = "docutils-0.18.1.tar.gz", hash = "sha256:679987caf361a7539d76e584cbeddc311e3aee937877c87346f31debc63e9d06"}, @@ -361,6 +371,7 @@ version = "0.18.0" description = "ECDSA cryptographic signature library (pure python)" optional = false python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" +groups = ["main"] files = [ {file = "ecdsa-0.18.0-py2.py3-none-any.whl", hash = "sha256:80600258e7ed2f16b9aa1d7c295bd70194109ad5a30fdee0eaeefef1d4c559dd"}, {file = "ecdsa-0.18.0.tar.gz", hash = "sha256:190348041559e21b22a1d65cee485282ca11a6f81d503fddb84d5017e9ed1e49"}, @@ -379,6 +390,7 @@ version = "5.0.4" description = "the modular source code checker: pep8 pyflakes and co" optional = false python-versions = ">=3.6.1" +groups = ["dev"] files = [ {file = "flake8-5.0.4-py2.py3-none-any.whl", hash = "sha256:7a1cf6b73744f5806ab95e526f6f0d8c01c66d7bbe349562d22dfca20610b248"}, {file = "flake8-5.0.4.tar.gz", hash = "sha256:6fbe320aad8d6b95cec8b8e47bc933004678dc63095be98528b7bdd2a9f510db"}, @@ -395,6 +407,7 @@ version = "0.14.0" description = "A Cython interface to the hidapi from https://github.com/libusb/hidapi" optional = false python-versions = "*" +groups = ["main"] files = [ {file = "hidapi-0.14.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:f68bbf88805553911e7e5a9b91136c96a54042b6e3d82d39d733d2edb46ff9a6"}, {file = "hidapi-0.14.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:b264c6a1a1a0cacacc82299785415bec91184cb3e4a77d127c40016086705327"}, @@ -476,6 +489,7 @@ version = "3.6" description = "Internationalized Domain Names in Applications (IDNA)" optional = false python-versions = ">=3.5" +groups = ["dev"] files = [ {file = "idna-3.6-py3-none-any.whl", hash = "sha256:c05567e9c24a6b9faaa835c4821bad0590fbb9d5779e7caa6e1cc4978e7eb24f"}, {file = "idna-3.6.tar.gz", hash = "sha256:9ecdbbd083b06798ae1e86adcbfe8ab1479cf864e4ee30fe4e46a003d12491ca"}, @@ -487,6 +501,7 @@ version = "1.4.1" description = "Getting image size from png/jpeg/jpeg2000/gif file" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +groups = ["dev"] files = [ {file = "imagesize-1.4.1-py2.py3-none-any.whl", hash = "sha256:0d8d18d08f840c19d0ee7ca1fd82490fdc3729b7ac93f49870406ddde8ef8d8b"}, {file = "imagesize-1.4.1.tar.gz", hash = "sha256:69150444affb9cb0d5cc5a92b3676f0b2fb7cd9ae39e947a5e11a36b4497cd4a"}, @@ -498,6 +513,8 @@ version = "7.0.1" description = "Read metadata from Python packages" optional = false python-versions = ">=3.8" +groups = ["dev"] +markers = "python_version == \"3.9\"" files = [ {file = "importlib_metadata-7.0.1-py3-none-any.whl", hash = "sha256:4805911c3a4ec7c3966410053e9ec6a1fecd629117df5adee56dfc9432a1081e"}, {file = "importlib_metadata-7.0.1.tar.gz", hash = "sha256:f238736bb06590ae52ac1fab06a3a9ef1d8dce2b7a35b5ab329371d6c8f5d2cc"}, @@ -509,7 +526,7 @@ zipp = ">=0.5" [package.extras] docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (<7.2.5)", "sphinx (>=3.5)", "sphinx-lint"] perf = ["ipython"] -testing = ["flufl.flake8", "importlib-resources (>=1.3)", "packaging", "pyfakefs", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy (>=0.9.1)", "pytest-perf (>=0.9.2)", "pytest-ruff"] +testing = ["flufl.flake8", "importlib-resources (>=1.3) ; python_version < \"3.9\"", "packaging", "pyfakefs", "pytest (>=6)", "pytest-black (>=0.3.7) ; platform_python_implementation != \"PyPy\"", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy (>=0.9.1) ; platform_python_implementation != \"PyPy\"", "pytest-perf (>=0.9.2)", "pytest-ruff"] [[package]] name = "jinja2" @@ -517,6 +534,7 @@ version = "3.1.3" description = "A very fast and expressive template engine." optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "Jinja2-3.1.3-py3-none-any.whl", hash = "sha256:7d6d50dd97d52cbc355597bd845fabfbac3f551e1f99619e39a35ce8c370b5fa"}, {file = "Jinja2-3.1.3.tar.gz", hash = "sha256:ac8bd6544d4bb2c9792bf3a159e80bba8fda7f07e81bc3aed565432d5925ba90"}, @@ -534,6 +552,7 @@ version = "3.1.0" description = "Pure-python wrapper for libusb-1.0" optional = false python-versions = "*" +groups = ["main"] files = [ {file = "libusb1-3.1.0-py3-none-any.whl", hash = "sha256:9d9f16e2c199cab91f48ead585d3f5ec7e8e4be428a25ddfed22abf786fa9b3a"}, {file = "libusb1-3.1.0-py3-none-win32.whl", hash = "sha256:bc7874302565721f443a27d8182fcc7152e5b560523f12f1377b130f473e4a0c"}, @@ -547,6 +566,8 @@ version = "1.16.3" description = "Mach-O header analysis and editing" optional = false python-versions = "*" +groups = ["dev"] +markers = "sys_platform == \"darwin\"" files = [ {file = "macholib-1.16.3-py2.py3-none-any.whl", hash = "sha256:0e315d7583d38b8c77e815b1ecbdbf504a8258d8b3e17b61165c6feb60d18f2c"}, {file = "macholib-1.16.3.tar.gz", hash = "sha256:07ae9e15e8e4cd9a788013d81f5908b3609aa76f9b1421bae9c4d7606ec86a30"}, @@ -561,6 +582,7 @@ version = "2.1.4" description = "Safely add untrusted strings to HTML/XML markup." optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "MarkupSafe-2.1.4-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:de8153a7aae3835484ac168a9a9bdaa0c5eee4e0bc595503c95d53b942879c84"}, {file = "MarkupSafe-2.1.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e888ff76ceb39601c59e219f281466c6d7e66bd375b4ec1ce83bcdc68306796b"}, @@ -630,6 +652,7 @@ version = "0.7.0" description = "McCabe checker, plugin for flake8" optional = false python-versions = ">=3.6" +groups = ["dev"] files = [ {file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"}, {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, @@ -641,6 +664,7 @@ version = "0.20" description = "Implementation of Bitcoin BIP-0039" optional = false python-versions = ">=3.5" +groups = ["main"] files = [ {file = "mnemonic-0.20-py3-none-any.whl", hash = "sha256:acd2168872d0379e7a10873bb3e12bf6c91b35de758135c4fbd1015ef18fafc5"}, {file = "mnemonic-0.20.tar.gz", hash = "sha256:7c6fb5639d779388027a77944680aee4870f0fcd09b1e42a5525ee2ce4c625f6"}, @@ -652,6 +676,7 @@ version = "0.991" description = "Optional static typing for Python" optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "mypy-0.991-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:7d17e0a9707d0772f4a7b878f04b4fd11f6f5bcb9b3813975a9b13c9332153ab"}, {file = "mypy-0.991-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0714258640194d75677e86c786e80ccf294972cc76885d3ebbb560f11db0003d"}, @@ -702,6 +727,7 @@ version = "1.0.0" description = "Type system extensions for programs checked with the mypy type checker." optional = false python-versions = ">=3.5" +groups = ["dev"] files = [ {file = "mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d"}, {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"}, @@ -713,6 +739,7 @@ version = "0.3.1" description = "Implementation of Noise Protocol Framework" optional = false python-versions = "~=3.5" +groups = ["main"] files = [ {file = "noiseprotocol-0.3.1-py3-none-any.whl", hash = "sha256:2e1a603a38439636cf0ffd8b3e8b12cee27d368a28b41be7dbe568b2abb23111"}, {file = "noiseprotocol-0.3.1.tar.gz", hash = "sha256:b092a871b60f6a8f07f17950dc9f7098c8fe7d715b049bd4c24ee3752b90d645"}, @@ -727,6 +754,7 @@ version = "23.2" description = "Core utilities for Python packages" optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "packaging-23.2-py3-none-any.whl", hash = "sha256:8c491190033a9af7e1d931d0b5dacc2ef47509b34dd0de67ed209b5203fc88c7"}, {file = "packaging-23.2.tar.gz", hash = "sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5"}, @@ -738,6 +766,8 @@ version = "2023.2.7" description = "Python PE parsing module" optional = false python-versions = ">=3.6.0" +groups = ["dev"] +markers = "sys_platform == \"win32\"" files = [ {file = "pefile-2023.2.7-py3-none-any.whl", hash = "sha256:da185cd2af68c08a6cd4481f7325ed600a88f6a813bad9dea07ab3ef73d8d8d6"}, {file = "pefile-2023.2.7.tar.gz", hash = "sha256:82e6114004b3d6911c77c3953e3838654b04511b8b66e8583db70c65998017dc"}, @@ -749,6 +779,7 @@ version = "4.25.2" description = "" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "protobuf-4.25.2-cp310-abi3-win32.whl", hash = "sha256:b50c949608682b12efb0b2717f53256f03636af5f60ac0c1d900df6213910fd6"}, {file = "protobuf-4.25.2-cp310-abi3-win_amd64.whl", hash = "sha256:8f62574857ee1de9f770baf04dde4165e30b15ad97ba03ceac65f760ff018ac9"}, @@ -769,6 +800,7 @@ version = "1.6.1" description = "Pure-Python Implementation of the AES block-cipher and common modes of operation" optional = false python-versions = "*" +groups = ["main"] files = [ {file = "pyaes-1.6.1.tar.gz", hash = "sha256:02c1b1405c38d3c370b085fb952dd8bea3fadcee6411ad99f312cc129c536d8f"}, ] @@ -779,6 +811,7 @@ version = "2.9.1" description = "Python style guide checker" optional = false python-versions = ">=3.6" +groups = ["dev"] files = [ {file = "pycodestyle-2.9.1-py2.py3-none-any.whl", hash = "sha256:d1735fc58b418fd7c5f658d28d943854f8a849b01a5d0a1e6f3f3fdd0166804b"}, {file = "pycodestyle-2.9.1.tar.gz", hash = "sha256:2c9607871d58c76354b697b42f5d57e1ada7d261c261efac224b664affdc5785"}, @@ -790,6 +823,8 @@ version = "2.21" description = "C parser in Python" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +groups = ["main"] +markers = "platform_python_implementation != \"PyPy\"" files = [ {file = "pycparser-2.21-py2.py3-none-any.whl", hash = "sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9"}, {file = "pycparser-2.21.tar.gz", hash = "sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206"}, @@ -801,6 +836,7 @@ version = "2.5.0" description = "passive checker of Python programs" optional = false python-versions = ">=3.6" +groups = ["dev"] files = [ {file = "pyflakes-2.5.0-py2.py3-none-any.whl", hash = "sha256:4579f67d887f804e67edb544428f264b7b24f435b263c4614f384135cea553d2"}, {file = "pyflakes-2.5.0.tar.gz", hash = "sha256:491feb020dca48ccc562a8c0cbe8df07ee13078df59813b83959cbdada312ea3"}, @@ -812,13 +848,14 @@ version = "2.17.2" description = "Pygments is a syntax highlighting package written in Python." optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "pygments-2.17.2-py3-none-any.whl", hash = "sha256:b27c2826c47d0f3219f29554824c30c5e8945175d888647acd804ddd04af846c"}, {file = "pygments-2.17.2.tar.gz", hash = "sha256:da46cec9fd2de5be3a8a784f434e4c4ab670b4ff54d605c4c2717e9d49c4c367"}, ] [package.extras] -plugins = ["importlib-metadata"] +plugins = ["importlib-metadata ; python_version < \"3.8\""] windows-terminal = ["colorama (>=0.4.6)"] [[package]] @@ -827,6 +864,7 @@ version = "6.3.0" description = "PyInstaller bundles a Python application and all its dependencies into a single package." optional = false python-versions = "<3.13,>=3.8" +groups = ["dev"] files = [ {file = "pyinstaller-6.3.0-py3-none-macosx_10_13_universal2.whl", hash = "sha256:75a6f2a6f835a2e6e0899d10e60c10caf5defd25aced38b1dd48fbbabc89de07"}, {file = "pyinstaller-6.3.0-py3-none-manylinux2014_aarch64.whl", hash = "sha256:de25beb176f73a944758553caacec46cc665bf3910ad8a174706d79cf6e95340"}, @@ -862,6 +900,7 @@ version = "2024.0" description = "Community maintained hooks for PyInstaller" optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "pyinstaller-hooks-contrib-2024.0.tar.gz", hash = "sha256:a7118c1a5c9788595e5c43ad058a7a5b7b6d59e1eceb42362f6ec1f0b61986b0"}, {file = "pyinstaller_hooks_contrib-2024.0-py2.py3-none-any.whl", hash = "sha256:469b5690df53223e2e8abffb2e44d6ee596e7d79d4b1eed9465123b67439875a"}, @@ -878,6 +917,7 @@ version = "3.5" description = "Python Serial Port Extension" optional = false python-versions = "*" +groups = ["main"] files = [ {file = "pyserial-3.5-py2.py3-none-any.whl", hash = "sha256:c4451db6ba391ca6ca299fb3ec7bae67a5c55dde170964c7a14ceefec02f2cf0"}, {file = "pyserial-3.5.tar.gz", hash = "sha256:3c77e014170dfffbd816e6ffc205e9842efb10be9f58ec16d3e8675b4925cddb"}, @@ -892,6 +932,8 @@ version = "5.15.2.1" description = "Python bindings for the Qt cross-platform application and UI framework" optional = true python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <3.11" +groups = ["main"] +markers = "python_version == \"3.9\" and extra == \"qt\"" files = [ {file = "PySide2-5.15.2.1-5.15.2-cp27-cp27m-macosx_10_13_intel.whl", hash = "sha256:b5e1d92f26b0bbaefff67727ccbb2e1b577f2c0164b349b3d6e80febb4c5bde2"}, {file = "PySide2-5.15.2.1-5.15.2-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:235240b6ec8206d9fdf0232472c6ef3241783d480425e5b54796f06e39ed23da"}, @@ -904,23 +946,14 @@ files = [ [package.dependencies] shiboken2 = "5.15.2.1" -[[package]] -name = "pytz" -version = "2023.4" -description = "World timezone definitions, modern and historical" -optional = false -python-versions = "*" -files = [ - {file = "pytz-2023.4-py2.py3-none-any.whl", hash = "sha256:f90ef520d95e7c46951105338d918664ebfd6f1d995bd7d153127ce90efafa6a"}, - {file = "pytz-2023.4.tar.gz", hash = "sha256:31d4583c4ed539cd037956140d695e42c033a19e984bfce9964a3f7d59bc2b40"}, -] - [[package]] name = "pywin32-ctypes" version = "0.2.2" description = "A (partial) reimplementation of pywin32 using ctypes/cffi" optional = false python-versions = ">=3.6" +groups = ["dev"] +markers = "sys_platform == \"win32\"" files = [ {file = "pywin32-ctypes-0.2.2.tar.gz", hash = "sha256:3426e063bdd5fd4df74a14fa3cf80a0b42845a87e1d1e81f6549f9daec593a60"}, {file = "pywin32_ctypes-0.2.2-py3-none-any.whl", hash = "sha256:bf490a1a709baf35d688fe0ecf980ed4de11d2b3e37b51e5442587a75d9957e7"}, @@ -932,6 +965,7 @@ version = "2.31.0" description = "Python HTTP for Humans." optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "requests-2.31.0-py3-none-any.whl", hash = "sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f"}, {file = "requests-2.31.0.tar.gz", hash = "sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1"}, @@ -953,6 +987,7 @@ version = "3.0.2" description = "Python helper for Semantic Versioning (https://semver.org)" optional = false python-versions = ">=3.7" +groups = ["main"] files = [ {file = "semver-3.0.2-py3-none-any.whl", hash = "sha256:b1ea4686fe70b981f85359eda33199d60c53964284e0cfb4977d243e37cf4bf4"}, {file = "semver-3.0.2.tar.gz", hash = "sha256:6253adb39c70f6e51afed2fa7152bcd414c411286088fb4b9effb133885ab4cc"}, @@ -964,6 +999,7 @@ version = "69.0.3" description = "Easily download, build, install, upgrade, and uninstall Python packages" optional = false python-versions = ">=3.8" +groups = ["main", "dev"] files = [ {file = "setuptools-69.0.3-py3-none-any.whl", hash = "sha256:385eb4edd9c9d5c17540511303e39a147ce2fc04bc55289c322b9e5904fe2c05"}, {file = "setuptools-69.0.3.tar.gz", hash = "sha256:be1af57fc409f93647f2e8e4573a142ed38724b8cdd389706a867bb4efcf1e78"}, @@ -971,7 +1007,7 @@ files = [ [package.extras] docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx (<7.2.5)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"] -testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pip (>=19.1)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-ruff", "pytest-timeout", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] +testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.develop (>=7.21) ; python_version >= \"3.9\" and sys_platform != \"cygwin\"", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pip (>=19.1)", "pytest (>=6)", "pytest-black (>=0.3.7) ; platform_python_implementation != \"PyPy\"", "pytest-checkdocs (>=2.4)", "pytest-cov ; platform_python_implementation != \"PyPy\"", "pytest-enabler (>=2.2)", "pytest-mypy (>=0.9.1) ; platform_python_implementation != \"PyPy\"", "pytest-perf ; sys_platform != \"cygwin\"", "pytest-ruff ; sys_platform != \"cygwin\"", "pytest-timeout", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] testing-integration = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "packaging (>=23.1)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] [[package]] @@ -980,6 +1016,8 @@ version = "5.15.2.1" description = "Python / C++ bindings helper module" optional = true python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <3.11" +groups = ["main"] +markers = "python_version == \"3.9\" and extra == \"qt\"" files = [ {file = "shiboken2-5.15.2.1-5.15.2-cp27-cp27m-macosx_10_13_intel.whl", hash = "sha256:f890f5611ab8f48b88cfecb716da2ac55aef99e2923198cefcf781842888ea65"}, {file = "shiboken2-5.15.2.1-5.15.2-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:87079c07587859a525b9800d60b1be971338ce9b371d6ead81f15ee5a46d448b"}, @@ -995,6 +1033,7 @@ version = "1.16.0" description = "Python 2 and 3 compatibility utilities" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" +groups = ["main", "dev"] files = [ {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, @@ -1006,6 +1045,7 @@ version = "2.2.0" description = "This package provides 29 stemmers for 28 languages generated from Snowball algorithms." optional = false python-versions = "*" +groups = ["dev"] files = [ {file = "snowballstemmer-2.2.0-py2.py3-none-any.whl", hash = "sha256:c8e1716e83cc398ae16824e5572ae04e0d9fc2c6b985fb0f900f5f0c96ecba1a"}, {file = "snowballstemmer-2.2.0.tar.gz", hash = "sha256:09b16deb8547d3412ad7b590689584cd0fe25ec8db3be37788be3810cbf19cb1"}, @@ -1017,6 +1057,7 @@ version = "7.1.2" description = "Python documentation generator" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "sphinx-7.1.2-py3-none-any.whl", hash = "sha256:d170a81825b2fcacb6dfd5a0d7f578a053e45d3f2b153fecc948c37344eb4cbe"}, {file = "sphinx-7.1.2.tar.gz", hash = "sha256:780f4d32f1d7d1126576e0e5ecc19dc32ab76cd24e950228dcf7b1f6d3d9e22f"}, @@ -1052,6 +1093,7 @@ version = "1.3.0" description = "Read the Docs theme for Sphinx" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,>=2.7" +groups = ["dev"] files = [ {file = "sphinx_rtd_theme-1.3.0-py2.py3-none-any.whl", hash = "sha256:46ddef89cc2416a81ecfbeaceab1881948c014b1b6e4450b815311a89fb977b0"}, {file = "sphinx_rtd_theme-1.3.0.tar.gz", hash = "sha256:590b030c7abb9cf038ec053b95e5380b5c70d61591eb0b552063fbe7c41f0931"}, @@ -1071,6 +1113,7 @@ version = "1.0.4" description = "sphinxcontrib-applehelp is a Sphinx extension which outputs Apple help books" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "sphinxcontrib-applehelp-1.0.4.tar.gz", hash = "sha256:828f867945bbe39817c210a1abfd1bc4895c8b73fcaade56d45357a348a07d7e"}, {file = "sphinxcontrib_applehelp-1.0.4-py3-none-any.whl", hash = "sha256:29d341f67fb0f6f586b23ad80e072c8e6ad0b48417db2bde114a4c9746feb228"}, @@ -1086,6 +1129,7 @@ version = "0.1.8" description = "Documenting CLI programs" optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "sphinxcontrib-autoprogram-0.1.8.tar.gz", hash = "sha256:5a69729db9d283e0e4c6d349bd60e62a4b8ebd2c07c0ab634b82d08a4121f10a"}, {file = "sphinxcontrib_autoprogram-0.1.8-py2.py3-none-any.whl", hash = "sha256:222b029217b05cb22a6c72a473bafd0e57bbe666420be636d91e5ea71b704610"}, @@ -1101,6 +1145,7 @@ version = "1.0.2" description = "sphinxcontrib-devhelp is a sphinx extension which outputs Devhelp document." optional = false python-versions = ">=3.5" +groups = ["dev"] files = [ {file = "sphinxcontrib-devhelp-1.0.2.tar.gz", hash = "sha256:ff7f1afa7b9642e7060379360a67e9c41e8f3121f2ce9164266f61b9f4b338e4"}, {file = "sphinxcontrib_devhelp-1.0.2-py2.py3-none-any.whl", hash = "sha256:8165223f9a335cc1af7ffe1ed31d2871f325254c0423bc0c4c7cd1c1e4734a2e"}, @@ -1116,6 +1161,7 @@ version = "2.0.1" description = "sphinxcontrib-htmlhelp is a sphinx extension which renders HTML help files" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "sphinxcontrib-htmlhelp-2.0.1.tar.gz", hash = "sha256:0cbdd302815330058422b98a113195c9249825d681e18f11e8b1f78a2f11efff"}, {file = "sphinxcontrib_htmlhelp-2.0.1-py3-none-any.whl", hash = "sha256:c38cb46dccf316c79de6e5515e1770414b797162b23cd3d06e67020e1d2a6903"}, @@ -1131,6 +1177,7 @@ version = "4.1" description = "Extension to include jQuery on newer Sphinx releases" optional = false python-versions = ">=2.7" +groups = ["dev"] files = [ {file = "sphinxcontrib-jquery-4.1.tar.gz", hash = "sha256:1620739f04e36a2c779f1a131a2dfd49b2fd07351bf1968ced074365933abc7a"}, {file = "sphinxcontrib_jquery-4.1-py2.py3-none-any.whl", hash = "sha256:f936030d7d0147dd026a4f2b5a57343d233f1fc7b363f68b3d4f1cb0993878ae"}, @@ -1145,6 +1192,7 @@ version = "1.0.1" description = "A sphinx extension which renders display math in HTML via JavaScript" optional = false python-versions = ">=3.5" +groups = ["dev"] files = [ {file = "sphinxcontrib-jsmath-1.0.1.tar.gz", hash = "sha256:a9925e4a4587247ed2191a22df5f6970656cb8ca2bd6284309578f2153e0c4b8"}, {file = "sphinxcontrib_jsmath-1.0.1-py2.py3-none-any.whl", hash = "sha256:2ec2eaebfb78f3f2078e73666b1415417a116cc848b72e5172e596c871103178"}, @@ -1159,6 +1207,7 @@ version = "1.0.3" description = "sphinxcontrib-qthelp is a sphinx extension which outputs QtHelp document." optional = false python-versions = ">=3.5" +groups = ["dev"] files = [ {file = "sphinxcontrib-qthelp-1.0.3.tar.gz", hash = "sha256:4c33767ee058b70dba89a6fc5c1892c0d57a54be67ddd3e7875a18d14cba5a72"}, {file = "sphinxcontrib_qthelp-1.0.3-py2.py3-none-any.whl", hash = "sha256:bd9fc24bcb748a8d51fd4ecaade681350aa63009a347a8c14e637895444dfab6"}, @@ -1174,6 +1223,7 @@ version = "1.1.5" description = "sphinxcontrib-serializinghtml is a sphinx extension which outputs \"serialized\" HTML files (json and pickle)." optional = false python-versions = ">=3.5" +groups = ["dev"] files = [ {file = "sphinxcontrib-serializinghtml-1.1.5.tar.gz", hash = "sha256:aa5f6de5dfdf809ef505c4895e51ef5c9eac17d0f287933eb49ec495280b6952"}, {file = "sphinxcontrib_serializinghtml-1.1.5-py2.py3-none-any.whl", hash = "sha256:352a9a00ae864471d3a7ead8d7d79f5fc0b57e8b3f95e9867eb9eb28999b92fd"}, @@ -1189,6 +1239,7 @@ version = "0.10.2" description = "Python Library for Tom's Obvious, Minimal Language" optional = false python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" +groups = ["dev"] files = [ {file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"}, {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}, @@ -1200,6 +1251,8 @@ version = "2.0.1" description = "A lil' TOML parser" optional = false python-versions = ">=3.7" +groups = ["dev"] +markers = "python_version < \"3.11\"" files = [ {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, @@ -1211,6 +1264,7 @@ version = "4.9.0" description = "Backported and Experimental Type Hints for Python 3.8+" optional = false python-versions = ">=3.8" +groups = ["main", "dev"] files = [ {file = "typing_extensions-4.9.0-py3-none-any.whl", hash = "sha256:af72aea155e91adfc61c3ae9e0e342dbc0cba726d6cba4b6c72c1f34e47291cd"}, {file = "typing_extensions-4.9.0.tar.gz", hash = "sha256:23478f88c37f27d76ac8aee6c905017a143b0b1b886c3c9f66bc2fd94f9f5783"}, @@ -1222,13 +1276,14 @@ version = "2.2.0" description = "HTTP library with thread-safe connection pooling, file post, and more." optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "urllib3-2.2.0-py3-none-any.whl", hash = "sha256:ce3711610ddce217e6d113a2732fafad960a03fd0318c91faa79481e35c11224"}, {file = "urllib3-2.2.0.tar.gz", hash = "sha256:051d961ad0c62a94e50ecf1af379c3aba230c66c710493493560c0c223c49f20"}, ] [package.extras] -brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)"] +brotli = ["brotli (>=1.0.9) ; platform_python_implementation == \"CPython\"", "brotlicffi (>=0.8.0) ; platform_python_implementation != \"CPython\""] h2 = ["h2 (>=4,<5)"] socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] zstd = ["zstandard (>=0.18.0)"] @@ -1239,6 +1294,8 @@ version = "3.17.0" description = "Backport of pathlib-compatible object wrapper for zip files" optional = false python-versions = ">=3.8" +groups = ["dev"] +markers = "python_version == \"3.9\"" files = [ {file = "zipp-3.17.0-py3-none-any.whl", hash = "sha256:0e923e726174922dce09c53c59ad483ff7bbb8e572e00c7f7c46b88556409f31"}, {file = "zipp-3.17.0.tar.gz", hash = "sha256:84e64a1c28cf7e91ed2078bb8cc8c259cb19b76942096c8d7b84947690cabaf0"}, @@ -1246,12 +1303,12 @@ files = [ [package.extras] docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (<7.2.5)", "sphinx (>=3.5)", "sphinx-lint"] -testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ignore-flaky", "pytest-mypy (>=0.9.1)", "pytest-ruff"] +testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "pytest (>=6)", "pytest-black (>=0.3.7) ; platform_python_implementation != \"PyPy\"", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ignore-flaky", "pytest-mypy (>=0.9.1) ; platform_python_implementation != \"PyPy\"", "pytest-ruff"] [extras] qt = ["pyside2"] [metadata] -lock-version = "2.0" -python-versions = "^3.8,<3.13" -content-hash = "a24d5b8abbe7db4818f283f1adab4667c7255f427b86bc96ae88e539691a3947" +lock-version = "2.1" +python-versions = "^3.9,<3.13" +content-hash = "536fcc537f47e6fd969f84474533853a87cfc8b60613b7dea5f88ecbea8365d0" diff --git a/pyproject.toml b/pyproject.toml index a3a69cd48..76d8f09ce 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,7 @@ packages = [ ] [tool.poetry.dependencies] -python = "^3.8,<3.13" +python = "^3.9,<3.13" hidapi = ">=0.14.0" ecdsa = "~0" pyaes = "^1.6" @@ -34,7 +34,7 @@ protobuf = "^4.23.3" [tool.poetry.extras] qt = ["pyside2"] -[tool.poetry.dev-dependencies] +[tool.poetry.group.dev.dependencies] pyinstaller = "^6.3" autopep8 = "~1" flake8 = ">=3" diff --git a/setup.py b/setup.py index 13fa4a924..47bef782d 100644 --- a/setup.py +++ b/setup.py @@ -61,7 +61,7 @@ 'install_requires': install_requires, 'extras_require': extras_require, 'entry_points': entry_points, - 'python_requires': '>=3.8,<3.13', + 'python_requires': '>=3.9,<3.13', } From 8215159f9ca9c50620d2368179fca380349c0848 Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Tue, 22 Jul 2025 11:29:48 +0200 Subject: [PATCH 04/31] build: bump debian to bookworm --- contrib/build.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/build.Dockerfile b/contrib/build.Dockerfile index a1edf1171..4e1025352 100644 --- a/contrib/build.Dockerfile +++ b/contrib/build.Dockerfile @@ -1,4 +1,4 @@ -FROM debian:buster-slim +FROM debian:bookworm-slim SHELL ["/bin/bash", "-c"] From 72bbef2955c79773d9297c2affa5bd5889bbc85f Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Tue, 22 Jul 2025 11:50:25 +0200 Subject: [PATCH 05/31] ci: .github match 'on' from Bitcoin Core --- .github/workflows/ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 873be671e..10d99a60f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,9 +1,13 @@ name: CI on: + # See: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request. pull_request: + # See: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#push. push: - branches: ['**'] - tags-ignore: ['**'] + branches: + - '**' + tags-ignore: + - '**' concurrency: group: ${{ github.event_name != 'pull_request' && github.run_id || github.ref }} From c5f62a020460152c5ca769c1fa706a5f01d422a3 Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Tue, 22 Jul 2025 12:35:38 +0200 Subject: [PATCH 06/31] ci: fix rust emulator build failure ``` error: "/home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/Cargo.lock" does not exist, unable to build with the standard library, try: rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu ``` https://github.com/bitcoin-core/HWI/actions/runs/16440824447/job/46462763374?pr=795 --- test/setup_environment.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/test/setup_environment.sh b/test/setup_environment.sh index cb4600fe8..949a866b0 100755 --- a/test/setup_environment.sh +++ b/test/setup_environment.sh @@ -110,6 +110,7 @@ if [[ -n ${build_trezor_1} || -n ${build_trezor_t} ]]; then rustup toolchain install nightly rustup default nightly rustup component add rustfmt + rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu # Build trezor t emulator. This is pretty fast, so rebuilding every time is ok # But there should be some caching that makes this faster poetry install From 9c83f52c7b520656656ae0e3cb9df260c3bdb3fb Mon Sep 17 00:00:00 2001 From: "Jamie C. Driver" Date: Fri, 21 Mar 2025 13:23:38 +0000 Subject: [PATCH 07/31] jade setup_environment: update qemu installation We can now use the main esp-idf toochain to install the appropriate version of the qemu emulator, rather than building it ourselves from source. Mirrors change recently made to Jade repo. --- test/setup_environment.sh | 56 +++++++-------------------------------- 1 file changed, 10 insertions(+), 46 deletions(-) diff --git a/test/setup_environment.sh b/test/setup_environment.sh index 949a866b0..aaf9d5fc5 100755 --- a/test/setup_environment.sh +++ b/test/setup_environment.sh @@ -306,54 +306,11 @@ if [[ -n ${build_jade} ]]; then git submodule update --recursive --init fi - # Deduce the relevant versions of esp-idf and qemu to use + # Deduce the relevant version of esp-idf to use ESP_IDF_BRANCH=$(grep "ARG ESP_IDF_BRANCH=" Dockerfile | cut -d\= -f2) ESP_IDF_COMMIT=$(grep "ARG ESP_IDF_COMMIT=" Dockerfile | cut -d\= -f2) - ESP_QEMU_BRANCH=$(grep "ARG ESP_QEMU_BRANCH=" Dockerfile | cut -d\= -f2) - ESP_QEMU_COMMIT=$(grep "ARG ESP_QEMU_COMMIT=" Dockerfile | cut -d\= -f2) cd .. - # Build the qemu emulator if required - - # If the directory exists, see if it is at the expected commit - # If not, remove the entire directory (it will be re-cloned below) - if [ -d "qemu" ]; then - cd qemu - LOCAL=$(git rev-parse @) - if [ $LOCAL = $ESP_QEMU_COMMIT ]; then - echo "esp-qemu up-to-date" - cd .. - else - cd .. - rm -fr qemu - fi - fi - - # Clone the upstream if the directory does not exist - # Then build the emulator - if [ ! -d "qemu" ]; then - git clone --quiet --depth 1 --branch ${ESP_QEMU_BRANCH} --single-branch --shallow-submodules https://github.com/espressif/qemu.git ./qemu - cd qemu - - git checkout ${ESP_QEMU_COMMIT} - ./configure \ - --target-list=xtensa-softmmu \ - --enable-gcrypt \ - --disable-sanitizers \ - --disable-strip \ - --disable-user \ - --disable-capstone \ - --disable-vnc \ - --disable-sdl \ - --disable-gtk \ - --enable-slirp \ - --extra-cflags=-Wno-array-parameter - ninja -C build - cd .. - fi - - # Build the esp-idf toolchain if required - # We will install the esp-idf tools in a given location (otherwise defaults to user home dir) export IDF_TOOLS_PATH="$(pwd)/esp-idf-tools" @@ -395,6 +352,13 @@ if [[ -n ${build_jade} ]]; then # Export the tools . ./esp-idf/export.sh + # Install the emulator + idf_tools.py install qemu-xtensa + QEMU_EXE=$(find ${IDF_TOOLS_PATH} -type f -name qemu-system-xtensa) + QEMU_BIOS_DIR=$(dirname "${QEMU_EXE}")/../share/qemu + echo "Installed qemu emulator: ${QEMU_EXE}" + echo "Installed qemu bios files: ${QEMU_BIOS_DIR}" + # Build Blockstream Jade firmware configured for the emulator cd jade rm -fr sdkconfig @@ -413,8 +377,8 @@ if [[ -n ${build_jade} ]]; then # Extract the minimal artifacts required to run the emulator rm -fr simulator mkdir simulator - cp qemu/build/qemu-system-xtensa simulator/ - cp -R qemu/pc-bios simulator/ + cp ${QEMU_EXE} simulator/ + cp -R ${QEMU_BIOS_DIR} simulator/pc-bios cp jade/main/qemu/flash_image.bin simulator/ cp jade/main/qemu/qemu_efuse.bin simulator/ From 784342fcee850398eacfd713a774e8145a164434 Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Tue, 22 Jul 2025 14:13:55 +0200 Subject: [PATCH 08/31] ci: abort if bitcoind fails to start See e.g. https://github.com/bitcoin-core/HWI/actions/runs/16440824447/job/46463441252 ``` work/bitcoin/build/bin/bitcoind: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.38' not found (required by work/bitcoin/build/bin/bitcoind) ```` Job lingered for 45 minutes. --- test/test_device.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/test_device.py b/test/test_device.py index 887a6ea65..5e6e520ac 100644 --- a/test/test_device.py +++ b/test/test_device.py @@ -96,6 +96,10 @@ def get_free_port(): cookie_path = os.path.join(self.datadir, "regtest", ".cookie") while not os.path.exists(cookie_path): time.sleep(0.5) + # Prevent CI from lingering until timeout: + if self.bitcoind_proc.poll() is not None: + raise RuntimeError(f"bitcoind failed with exit code {self.bitcoind_proc.poll()}") + # Read .cookie file to get user and pass with open(cookie_path) as f: self.userpass = f.readline().lstrip().rstrip() From 48d965df2df1c40d654032c52622b17ff6a6d55c Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Wed, 23 Jul 2025 13:27:14 +0200 Subject: [PATCH 09/31] ci: abort if simulator fails to start --- test/test_bitbox02.py | 4 ++++ test/test_coldcard.py | 4 ++++ test/test_digitalbitbox.py | 4 ++++ test/test_jade.py | 4 ++++ test/test_keepkey.py | 4 ++++ test/test_ledger.py | 4 ++++ test/test_trezor.py | 4 ++++ 7 files changed, 28 insertions(+) diff --git a/test/test_bitbox02.py b/test/test_bitbox02.py index fb9cf8490..c1cd7f63f 100644 --- a/test/test_bitbox02.py +++ b/test/test_bitbox02.py @@ -51,6 +51,10 @@ def start(self): ) time.sleep(1) + # Prevent CI from lingering until timeout: + if self.simulator_proc.poll() is not None: + raise RuntimeError(f"BitBox02 simulator failed with exit code {self.simulator_proc.poll()}") + self.setup_client = Bitbox02Client(self.path) self.setup_bb02 = self.setup_client.restore_device() self.setup_client.close() diff --git a/test/test_coldcard.py b/test/test_coldcard.py index 9eb90f379..e605ded2d 100755 --- a/test/test_coldcard.py +++ b/test/test_coldcard.py @@ -61,6 +61,10 @@ def start(self): ) # Wait for simulator to be up while True: + # Prevent CI from lingering until timeout: + if self.coldcard_proc.poll() is not None: + raise RuntimeError(f"coldcard simulator failed with exit code {self.coldcard_proc.poll()}") + try: enum_res = process_commands(["--emulators", "enumerate"]) found = False diff --git a/test/test_digitalbitbox.py b/test/test_digitalbitbox.py index d43a9af65..1a98c9562 100755 --- a/test/test_digitalbitbox.py +++ b/test/test_digitalbitbox.py @@ -58,6 +58,10 @@ def start(self): ) # Wait for simulator to be up while True: + # Prevent CI from lingering until timeout: + if self.simulator_proc.poll() is not None: + raise RuntimeError(f"BitBox simulator failed with exit code {self.simulator_proc.poll()}") + try: self.dev = BitboxSimulator('127.0.0.1', 35345) reply = send_plain(b'{"password":"0000"}', self.dev) diff --git a/test/test_jade.py b/test/test_jade.py index 1e707dfe2..71422eab7 100755 --- a/test/test_jade.py +++ b/test/test_jade.py @@ -82,6 +82,10 @@ def start(self): # Wait for emulator to be up while True: + # Prevent CI from lingering until timeout: + if self.emulator_proc.poll() is not None: + raise RuntimeError(f"Jade simulator failed with exit code {self.emulator_proc.poll()}") + time.sleep(1) try: # Try to connect and set the test seed diff --git a/test/test_keepkey.py b/test/test_keepkey.py index f926d9807..845a0976a 100755 --- a/test/test_keepkey.py +++ b/test/test_keepkey.py @@ -77,6 +77,10 @@ def start(self): sock.connect(('127.0.0.1', 11044)) sock.settimeout(0) while True: + # Prevent CI from lingering until timeout: + if self.emulator_proc.poll() is not None: + raise RuntimeError(f"Keepkey simulator failed with exit code {self.emulator_proc.poll()}") + try: sock.sendall(b"PINGPING") r = sock.recv(8) diff --git a/test/test_ledger.py b/test/test_ledger.py index 26876c0df..7e819141a 100755 --- a/test/test_ledger.py +++ b/test/test_ledger.py @@ -79,6 +79,10 @@ def start(self): ) # Wait for simulator to be up while True: + # Prevent CI from lingering until timeout: + if self.emulator_proc.poll() is not None: + raise RuntimeError(f"Ledger simulator failed with exit code {self.emulator_proc.poll()}") + try: enum_res = process_commands(["--emulators", "enumerate"]) found = False diff --git a/test/test_trezor.py b/test/test_trezor.py index f7424ce90..335fa571f 100755 --- a/test/test_trezor.py +++ b/test/test_trezor.py @@ -76,6 +76,10 @@ def start(self): sock.connect(('127.0.0.1', 21324)) sock.settimeout(0) while True: + # Prevent CI from lingering until timeout: + if self.emulator_proc.poll() is not None: + raise RuntimeError(f"Trezor simulator failed with exit code {self.emulator_proc.poll()}") + try: sock.sendall(b"PINGPING") r = sock.recv(8) From 4457bacfbbfdc70115b80e650cea25abc7b1de75 Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Wed, 23 Jul 2025 17:32:25 +0200 Subject: [PATCH 10/31] Set 60 second timeout on proc.communicate --- test/test_device.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/test_device.py b/test/test_device.py index 5e6e520ac..85f939c96 100644 --- a/test/test_device.py +++ b/test/test_device.py @@ -164,17 +164,17 @@ def do_command(self, args): cli_args.append(shlex.quote(arg)) if self.interface == 'cli': proc = subprocess.Popen(['hwi ' + ' '.join(cli_args)], stdout=subprocess.PIPE, shell=True) - result = proc.communicate() + result = proc.communicate(timeout=60) return json.loads(result[0].decode()) elif self.interface == 'bindist': proc = subprocess.Popen(['../dist/hwi ' + ' '.join(cli_args)], stdout=subprocess.PIPE, shell=True) - result = proc.communicate() + result = proc.communicate(timeout=60) return json.loads(result[0].decode()) elif self.interface == 'stdin': args = [f'"{arg}"' for arg in args] input_str = '\n'.join(args) + '\n' proc = subprocess.Popen(['hwi', '--stdin'], stdin=subprocess.PIPE, stdout=subprocess.PIPE) - result = proc.communicate(input_str.encode()) + result = proc.communicate(input_str.encode(), timeout=60) return json.loads(result[0].decode()) else: return process_commands(args) From 514fe633470717f0f28d3c9c55b7a1cde25da260 Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Tue, 22 Jul 2025 15:02:48 +0200 Subject: [PATCH 11/31] ci: build bitcoind with Ubuntu 22.04 --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 10d99a60f..8a66f4293 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -200,7 +200,9 @@ jobs: bitcoind-builder: name: bitcoind builder - runs-on: ubuntu-latest + # Ubuntu 22.04 ships with glibc 2.35, which is needed to keep binaries + # compatible with Debian Bookworm (glibc 2.36) Python containers. + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - uses: ./.github/actions/build-bitcoind From a539f1b20cfcd1ed00bc384aa5075647aa2e4efb Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Wed, 23 Jul 2025 10:48:13 +0200 Subject: [PATCH 12/31] coldcard: drop address patch Seems to be no longer needed: Coldcard/firmware#537 Related CI failure: https://github.com/bitcoin-core/HWI/actions/runs/16464204169/job/46537622260?pr=797 --- test/data/coldcard-multisig.patch | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/test/data/coldcard-multisig.patch b/test/data/coldcard-multisig.patch index 23038b66f..88fffed0c 100644 --- a/test/data/coldcard-multisig.patch +++ b/test/data/coldcard-multisig.patch @@ -1,34 +1,3 @@ -From c2e4c24c226555903705aae0386aefe0e15bf873 Mon Sep 17 00:00:00 2001 -From: Andrew Chow -Date: Tue, 27 Nov 2018 17:32:44 -0500 -Subject: [PATCH 1/3] Use linux unix socket address format - ---- - unix/variant/pyb.py | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/unix/variant/pyb.py b/unix/variant/pyb.py -index d22bb1b..fe8e7ca 100644 ---- a/unix/variant/pyb.py -+++ b/unix/variant/pyb.py -@@ -36,10 +36,10 @@ class USB_HID: - import usocket as socket - self.pipe = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM) - # If on linux, try commenting the following line -- addr = bytes([len(self.fn)+2, socket.AF_UNIX] + list(self.fn)) -+ # addr = bytes([len(self.fn)+2, socket.AF_UNIX] + list(self.fn)) - # If on linux, try uncommenting the following two lines -- #import struct -- #addr = struct.pack('H108s', socket.AF_UNIX, self.fn) -+ import struct -+ addr = struct.pack('H108s', socket.AF_UNIX, self.fn) - while 1: - try: - self.pipe.bind(addr) --- -2.38.1 - - From fd51e85693e0d66129133b1f195134aead1cf7d0 Mon Sep 17 00:00:00 2001 From: Andrew Chow Date: Tue, 17 Dec 2019 17:56:05 -0500 From ba3c0504a8d6bf59a723212277cf77f54171bfb5 Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Wed, 23 Jul 2025 10:56:15 +0200 Subject: [PATCH 13/31] coldcard: update multisig patch Manually re-applied the patch after the original code seems to have moved around a bit. --- test/data/coldcard-multisig.patch | 45 +++++++++++++++---------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/test/data/coldcard-multisig.patch b/test/data/coldcard-multisig.patch index 88fffed0c..b9ad6477c 100644 --- a/test/data/coldcard-multisig.patch +++ b/test/data/coldcard-multisig.patch @@ -27,21 +27,21 @@ index 2706fb4..f9b533d 100644 -- 2.38.1 +From 8b4323c1e393d79d46248dd822ca9aaaeb2b2bc3 Mon Sep 17 00:00:00 2001 +From: Sjors Provoost +Date: Wed, 23 Jul 2025 10:16:22 +0200 +Subject: [PATCH] Allow multisigs to share master fingerprint -From 04aecb1005d997783e63bd6cd830c4a98f099cb8 Mon Sep 17 00:00:00 2001 -From: Andrew Chow -Date: Wed, 27 Jan 2021 21:50:22 -0500 -Subject: [PATCH 3/3] Allow multisigs to share master fingerprint - +Co-Authored-By: Ava Chow --- - shared/multisig.py | 40 +++++++++++++++++++++++++--------------- - 1 file changed, 25 insertions(+), 15 deletions(-) + shared/multisig.py | 37 ++++++++++++++++++++++++------------- + 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/shared/multisig.py b/shared/multisig.py -index 6f26644..6e190b5 100644 +index 446998a2..cabb2003 100644 --- a/shared/multisig.py +++ b/shared/multisig.py -@@ -144,9 +144,9 @@ class MultisigWallet: +@@ -144,9 +144,9 @@ class MultisigWallet(WalletABC): # calc useful cache value: numeric xfp+subpath, with lookup self.xfp_paths = {} for xfp, deriv, xpub in self.xpubs: @@ -53,7 +53,7 @@ index 6f26644..6e190b5 100644 @classmethod def render_addr_fmt(cls, addr_fmt): -@@ -245,7 +245,11 @@ class MultisigWallet: +@@ -270,7 +270,11 @@ class MultisigWallet(WalletABC): def get_xfp_paths(self): # return list of lists [xfp, *deriv] @@ -66,7 +66,7 @@ index 6f26644..6e190b5 100644 @classmethod def find_match(cls, M, N, xfp_paths, addr_fmt=None): -@@ -280,24 +284,30 @@ class MultisigWallet: +@@ -305,24 +309,31 @@ class MultisigWallet(WalletABC): # the same prefix path per-each xfp, as indicated # xfp_paths (unordered)? # - could also check non-prefix part is all non-hardened @@ -79,22 +79,16 @@ index 6f26644..6e190b5 100644 if x[0] not in self.xfp_paths: return False - prefix = self.xfp_paths[x[0]] -- -- if len(x) < len(prefix): -- # PSBT specs a path shorter than wallet's xpub -- #print('path len: %d vs %d' % (len(prefix), len(x))) -- return False -- -- comm = len(prefix) -- if tuple(prefix[:comm]) != tuple(x[:comm]): -- # xfp => maps to wrong path -- #print('path mismatch:\n%r\n%r\ncomm=%d' % (prefix[:comm], x[:comm], comm)) + for prefix in self.xfp_paths[x[0]]: + if len(x) < len(prefix): + # PSBT specs a path shorter than wallet's xpub + #print('path len: %d vs %d' % (len(prefix), len(x))) + return False -+ + +- if len(x) < len(prefix): +- # PSBT specs a path shorter than wallet's xpub +- #print('path len: %d vs %d' % (len(prefix), len(x))) +- return False + comm = len(prefix) + if tuple(prefix[:comm]) != tuple(x[:comm]): + # xfp => maps to wrong path @@ -106,9 +100,14 @@ index 6f26644..6e190b5 100644 + break + else: + # No match was found + +- comm = len(prefix) +- if tuple(prefix[:comm]) != tuple(x[:comm]): +- # xfp => maps to wrong path +- #print('path mismatch:\n%r\n%r\ncomm=%d' % (prefix[:comm], x[:comm], comm)) return False return True -- -2.38.1 +2.39.5 (Apple Git-154) From 451efa6d8f185576c41950471986241f3ce272be Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Wed, 23 Jul 2025 16:11:02 +0200 Subject: [PATCH 14/31] coldcard: install pysdl2-dll https://github.com/Coldcard/firmware/pull/173 --- .github/actions/install-sim/action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/actions/install-sim/action.yml b/.github/actions/install-sim/action.yml index abfbded13..1715d15e9 100644 --- a/.github/actions/install-sim/action.yml +++ b/.github/actions/install-sim/action.yml @@ -30,6 +30,8 @@ runs: pushd test/work/firmware; git am ../../data/coldcard-multisig.patch; popd poetry run pip install -r test/work/firmware/requirements.txt pip install -r test/work/firmware/requirements.txt + poetry run pip install pysdl2-dll + pip install pysdl2-dll - if: inputs.device == 'bitbox01' shell: bash From 7dc25797b3e6b211409b1951780d8b0fc5143acb Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Wed, 23 Jul 2025 18:37:22 +0200 Subject: [PATCH 15/31] coldcard: use --headless --- test/test_coldcard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_coldcard.py b/test/test_coldcard.py index e605ded2d..0369497e5 100755 --- a/test/test_coldcard.py +++ b/test/test_coldcard.py @@ -53,7 +53,7 @@ def start(self): self.coldcard_proc = subprocess.Popen( [ "python3", - os.path.basename(self.simulator), "--ms" + os.path.basename(self.simulator), "--ms", "--headless" ], cwd=os.path.dirname(self.simulator), stdout=self.coldcard_log, From 598aad236caf41faba56626a8fc50166f0b769ff Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Thu, 24 Jul 2025 09:00:25 +0200 Subject: [PATCH 16/31] coldcard: disable test_signtx ``` ERROR: coldcard: test_signtx (test_device.TestSignTx.test_signtx) (addrtypes=['legacy'], multisig_types=['legacy'], external=True, op_return=False) ---------------------------------------------------------------------- Traceback (most recent call last): File "/__w/HWI/HWI/test/test_device.py", line 588, in test_signtx self._test_signtx(addrtypes, multisig_types, external, op_return) File "/__w/HWI/HWI/test/test_device.py", line 576, in _test_signtx self._generate_and_finalize(True, psbt) File "/__w/HWI/HWI/test/test_device.py", line 403, in _generate_and_finalize self.assertTrue(first_sign_res["signed"]) ~~~~~~~~~~~~~~^^^^^^^^^^ KeyError: 'signed' ``` --- test/test_device.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/test_device.py b/test/test_device.py index 85f939c96..cbb72bb67 100644 --- a/test/test_device.py +++ b/test/test_device.py @@ -137,7 +137,7 @@ def create(*args, **kwargs): return c class DeviceTestCase(unittest.TestCase): - def __init__(self, bitcoind, emulator=None, interface='library', methodName='runTest'): + def __init__(self, bitcoind, emulator: DeviceEmulator = None, interface='library', methodName='runTest'): super(DeviceTestCase, self).__init__(methodName) self.bitcoind = bitcoind self.rpc = bitcoind.rpc @@ -582,6 +582,9 @@ def _test_signtx(self, input_types, multisig_types, external, op_return: bool): # Test wrapper to avoid mixed-inputs signing for Ledger def test_signtx(self): + if self.emulator.type == "coldcard": + # https://github.com/bitcoin-core/HWI/pull/795#issuecomment-3112271927 + raise unittest.SkipTest("Coldcard sign test temporarily disabled") for addrtypes, multisig_types, external, op_return in self.signtx_cases: with self.subTest(addrtypes=addrtypes, multisig_types=multisig_types, external=external, op_return=op_return): From 103d70d1b26e056bc69941113bd825eb5e617fa3 Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Wed, 23 Jul 2025 14:36:31 +0200 Subject: [PATCH 17/31] ledger: add missing flask-cors https://github.com/LedgerHQ/speculos/commit/a1b4918d02f772a71a2ce360b876594fc4be6783 --- .github/actions/install-sim/action.yml | 4 ++-- test/README.md | 2 +- test/setup_environment.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/actions/install-sim/action.yml b/.github/actions/install-sim/action.yml index 1715d15e9..a27061f23 100644 --- a/.github/actions/install-sim/action.yml +++ b/.github/actions/install-sim/action.yml @@ -60,8 +60,8 @@ runs: apt-get update apt-get install -y libusb-1.0-0 qemu-user-static tar -xvf speculos.tar.gz - poetry run pip install construct flask-restful jsonschema mnemonic pyelftools pillow requests pytesseract - pip install construct flask-restful jsonschema mnemonic pyelftools pillow requests pytesseract + poetry run pip install construct flask-cors flask-restful jsonschema mnemonic pyelftools pillow requests pytesseract + pip install construct flask-cors flask-restful jsonschema mnemonic pyelftools pillow requests pytesseract - if: inputs.device == 'ledger' uses: actions/download-artifact@v4 diff --git a/test/README.md b/test/README.md index c3efb9262..1e1264ec7 100644 --- a/test/README.md +++ b/test/README.md @@ -293,7 +293,7 @@ cmake gcc-arm-linux-gnueabihf libc6-dev-armhf-cross gdb-multiarch qemu-user-stat The python packages can be installed with ``` -pip install construct flask-restful jsonschema mnemonic pyelftools pillow requests +pip install construct flask-cors flask-restful jsonschema mnemonic pyelftools pillow requests ``` ### Building diff --git a/test/setup_environment.sh b/test/setup_environment.sh index aaf9d5fc5..b35bb24c8 100755 --- a/test/setup_environment.sh +++ b/test/setup_environment.sh @@ -249,7 +249,7 @@ if [[ -n ${build_keepkey} ]]; then fi if [[ -n ${build_ledger} ]]; then - speculos_packages="construct flask-restful jsonschema mnemonic pyelftools pillow requests pytesseract" + speculos_packages="construct flask-cors flask-restful jsonschema mnemonic pyelftools pillow requests pytesseract" poetry run pip install ${speculos_packages} pip install ${speculos_packages} # Clone ledger simulator Speculos if it doesn't exist, or update it if it does From 79bc7885c31abbada983059d6351879ab76a9951 Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Wed, 23 Jul 2025 14:57:10 +0200 Subject: [PATCH 18/31] ledger: add missing ledgerd https://github.com/LedgerHQ/speculos/pull/593 --- .github/actions/install-sim/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/install-sim/action.yml b/.github/actions/install-sim/action.yml index a27061f23..2d004a8e2 100644 --- a/.github/actions/install-sim/action.yml +++ b/.github/actions/install-sim/action.yml @@ -60,8 +60,8 @@ runs: apt-get update apt-get install -y libusb-1.0-0 qemu-user-static tar -xvf speculos.tar.gz - poetry run pip install construct flask-cors flask-restful jsonschema mnemonic pyelftools pillow requests pytesseract - pip install construct flask-cors flask-restful jsonschema mnemonic pyelftools pillow requests pytesseract + poetry run pip install construct flask-cors flask-restful jsonschema ledgered mnemonic pyelftools pillow requests pytesseract + pip install construct flask-cors flask-restful jsonschema ledgered mnemonic pyelftools pillow requests pytesseract - if: inputs.device == 'ledger' uses: actions/download-artifact@v4 From 3d7c3c9bb15cbf8667629550052838408cce5ba2 Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Thu, 24 Jul 2025 09:07:10 +0200 Subject: [PATCH 19/31] ledger: disable several tests for NanoX --- test/test_device.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/test_device.py b/test/test_device.py index cbb72bb67..3e5add321 100644 --- a/test/test_device.py +++ b/test/test_device.py @@ -586,12 +586,20 @@ def test_signtx(self): # https://github.com/bitcoin-core/HWI/pull/795#issuecomment-3112271927 raise unittest.SkipTest("Coldcard sign test temporarily disabled") + if self.emulator.type == "ledger" and not self.emulator.legacy: + # https://github.com/bitcoin-core/HWI/pull/795#issuecomment-3112271927 + raise unittest.SkipTest("Test temporarily disabled for NanoX") + for addrtypes, multisig_types, external, op_return in self.signtx_cases: with self.subTest(addrtypes=addrtypes, multisig_types=multisig_types, external=external, op_return=op_return): self._test_signtx(addrtypes, multisig_types, external, op_return) # Make a huge transaction which might cause some problems with different interfaces def test_big_tx(self): + if self.emulator.type == "ledger" and not self.emulator.legacy: + # https://github.com/bitcoin-core/HWI/pull/795#issuecomment-3112271927 + raise unittest.SkipTest("Test temporarily disabled for NanoX") + # make a huge transaction keypool_desc = self.do_command(self.dev_args + ["getkeypool", "--account", "10", "--addr-type", "sh_wit", "0", "100"]) import_result = self.wrpc.importdescriptors(keypool_desc) @@ -622,6 +630,10 @@ def test_big_tx(self): class TestDisplayAddress(DeviceTestCase): def test_display_address_path(self): + if self.emulator.type == "ledger" and not self.emulator.legacy: + # https://github.com/bitcoin-core/HWI/pull/795#issuecomment-3112271927 + raise unittest.SkipTest("Test temporarily disabled for NanoX") + result = self.do_command(self.dev_args + ['displayaddress', "--addr-type", "legacy", '--path', 'm/44h/1h/0h/0/0']) if self.emulator.supports_legacy: self.assertNotIn('error', result) @@ -647,6 +659,10 @@ def test_display_address_bad_path(self): self.assertEqual(result['code'], -7) def test_display_address_descriptor(self): + if self.emulator.type == "ledger" and not self.emulator.legacy: + # https://github.com/bitcoin-core/HWI/pull/795#issuecomment-3112271927 + raise unittest.SkipTest("Test temporarily disabled for NanoX") + account_xpub = self.do_command(self.dev_args + ['getxpub', 'm/84h/1h/0h'])['xpub'] p2sh_segwit_account_xpub = self.do_command(self.dev_args + ['getxpub', 'm/49h/1h/0h'])['xpub'] legacy_account_xpub = self.do_command(self.dev_args + ['getxpub', 'm/44h/1h/0h'])['xpub'] @@ -768,6 +784,10 @@ def _check_sign_msg(self, msg): self.assertTrue(self.rpc.verifymessage(addr, sig, msg)) def test_sign_msg(self): + if self.emulator.type == "ledger" and not self.emulator.legacy: + # https://github.com/bitcoin-core/HWI/pull/795#issuecomment-3112271927 + raise unittest.SkipTest("Test temporarily disabled for NanoX") + self._check_sign_msg("Message signing test") self._check_sign_msg("285") # Specific test case for Ledger shorter S From 4aa0b261cfdb2065ee352bace49613462e6029bb Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Tue, 22 Jul 2025 12:21:01 +0200 Subject: [PATCH 20/31] Revert "ci: Always run test" This reverts commit edab2afc5a7538ebec884520b5ae99fefb0a19f9. The always() option is too powerfull. The next commit implements an alternative solution to the original issue. --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8a66f4293..bf09d6245 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -210,7 +210,6 @@ jobs: test-dist: name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.script.name }} runs-on: ubuntu-latest - if: ${{ always() }} needs: [ dist-builder, sim-builder, ledger-app-builder, bitcoind-builder ] strategy: @@ -280,7 +279,6 @@ jobs: test-all: name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.interface }} runs-on: ubuntu-latest - if: ${{ always() }} needs: [ sim-builder, ledger-app-builder, bitcoind-builder ] timeout-minutes: 45 From 536e9cb68c0a0bd34cd2ece62623f8dcc102dec7 Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Tue, 22 Jul 2025 20:11:08 +0200 Subject: [PATCH 21/31] ci: split device groups This ensures the failure to build a simulator for one device doesn't abort running jobs for the others. They're still grouped by manufacturer. Alternative to #743. --- .github/actions/build-sim/action.yml | 28 ++ .github/actions/test-device/action.yml | 31 ++ .github/actions/test-dist/action.yml | 67 +++++ .github/workflows/ci.yml | 396 +++++++++++++++++++------ 4 files changed, 435 insertions(+), 87 deletions(-) create mode 100644 .github/actions/build-sim/action.yml create mode 100644 .github/actions/test-device/action.yml create mode 100644 .github/actions/test-dist/action.yml diff --git a/.github/actions/build-sim/action.yml b/.github/actions/build-sim/action.yml new file mode 100644 index 000000000..323eb5f7e --- /dev/null +++ b/.github/actions/build-sim/action.yml @@ -0,0 +1,28 @@ +name: Build sim +description: Build device simulator(s) +runs: + using: composite + steps: + - name: Install dependencies + shell: bash + run: | + sudo apt-get update + sudo apt-get install -y gcc-arm-linux-gnueabihf libsdl2-image-dev libslirp-dev libpcsclite-dev ninja-build + pip install poetry + wget https://github.com/protocolbuffers/protobuf/releases/download/v22.0/protoc-22.0-linux-x86_64.zip + sudo unzip protoc-22.0-linux-x86_64.zip -d /usr/local + protoc --version + + - name: Build simulator + shell: bash + run: | + git config --global user.email "ci@ci.com" + git config --global user.name "ci" + cd test; ./setup_environment.sh --${{ matrix.device.name }}; cd .. + tar -czf ${{ matrix.device.archive }}.tar.gz ${{ matrix.device.paths }} + + - uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.device.name }}-sim + path: ${{ matrix.device.archive }}.tar.gz + diff --git a/.github/actions/test-device/action.yml b/.github/actions/test-device/action.yml new file mode 100644 index 000000000..4bf20a7b1 --- /dev/null +++ b/.github/actions/test-device/action.yml @@ -0,0 +1,31 @@ +name: Test device +description: Run tests for one device type. +runs: + using: composite + steps: + - shell: bash + run: | + pip install poetry + poetry install + + - uses: actions/download-artifact@v4 + with: + name: bitcoind + + - shell: bash + run: | + tar -xvf bitcoind.tar.gz + + - uses: ./.github/actions/install-sim + with: + device: ${{ matrix.device }} + + - name: Run tests + shell: bash + run: | + cd test; poetry run ./run_tests.py --${{ matrix.device }} --interface=${{ matrix.interface }} --device-only; cd .. + + - if: failure() + shell: bash + run: | + tail -v -n +1 test/*.std* diff --git a/.github/actions/test-dist/action.yml b/.github/actions/test-dist/action.yml new file mode 100644 index 000000000..99fab7e96 --- /dev/null +++ b/.github/actions/test-dist/action.yml @@ -0,0 +1,67 @@ +name: Test dist +description: Run dist tests for one device type. +runs: + using: composite + steps: + - shell: bash + run: | + pip install poetry + + - uses: actions/download-artifact@v4 + with: + name: dist + path: dist/ + + - name: Install (Wheel) + if: matrix.script == 'Wheel' + shell: bash + run: | + pip install dist/*.whl + + - name: Install (Sdist) + if: matrix.script == 'Sdist' + shell: bash + run: | + pip install $(find dist -name "*.tar.gz" -a -not -name "*linux*") + + - name: Install (Bindist) + if: matrix.script == 'Bindist' + shell: bash + run: | + poetry install; cd dist; tar -xvf hwi*linux*.tar.gz; cd .. + + - uses: actions/download-artifact@v4 + with: + name: bitcoind + + - shell: bash + run: | + tar -xvf bitcoind.tar.gz + + - uses: ./.github/actions/install-sim + with: + device: ${{ matrix.device }} + + - name: Run tests (Wheel) + if: matrix.script == 'Wheel' + shell: bash + run: | + cd test; ./run_tests.py $DEVICE --interface=cli --device-only; cd .. + + - name: Run tests (Sdist) + if: matrix.script == 'Sdist' + shell: bash + run: | + cd test; ./run_tests.py $DEVICE --interface=cli --device-only; cd .. + + - name: Run tests (Bindist) + if: matrix.script == 'Bindist' + shell: bash + run: | + cd test; poetry run ./run_tests.py $DEVICE --interface=bindist --device-only; cd .. + + - if: failure() + shell: bash + run: | + tail -v -n +1 test/*.std* + diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bf09d6245..cd90e89d4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -142,8 +142,8 @@ jobs: name: dist path: dist/ - sim-builder: - name: Sim builder + sim-builder-trezor: + name: Trezor sim builder runs-on: ubuntu-latest strategy: @@ -152,36 +152,82 @@ jobs: device: - { name: 'trezor-1', archive: 'trezor-firmware', paths: 'test/work/trezor-firmware' } - { name: 'trezor-t', archive: 'trezor-firmware', paths: 'test/work/trezor-firmware' } + + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/build-sim + + sim-builder-coldcard: + name: Coldcard sim builder + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + device: - { name: 'coldcard', archive: 'coldcard-mpy', paths: 'test/work/firmware/external/micropython/ports/unix/coldcard-mpy test/work/firmware/unix/coldcard-mpy test/work/firmware/unix/l-mpy test/work/firmware/unix/l-port' } + + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/build-sim + + sim-builder-bitbox: + name: Bitbox sim builder + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + device: - { name: 'bitbox01', archive: 'mcu', paths: 'test/work/mcu' } + - { name: 'bitbox02', archive: 'bitbox02', paths: 'test/work/bitbox02-firmware/build-build/bin/simulator' } + + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/build-sim + + sim-builder-jade: + name: Jade sim builder + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + device: - { name: 'jade', archive: 'jade', paths: 'test/work/jade/simulator' } + + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/build-sim + + sim-builder-ledger: + name: Ledger sim builder + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + device: - { name: 'ledger', archive: 'speculos', paths: 'test/work/speculos' } - - { name: 'keepkey', archive: 'keepkey-firmware', paths: 'test/work/keepkey-firmware/bin' } - - { name: 'bitbox02', archive: 'bitbox02', paths: 'test/work/bitbox02-firmware/build-build/bin/simulator' } steps: - uses: actions/checkout@v4 + - uses: ./.github/actions/build-sim - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y gcc-arm-linux-gnueabihf libsdl2-image-dev libslirp-dev libpcsclite-dev ninja-build - pip install poetry - wget https://github.com/protocolbuffers/protobuf/releases/download/v22.0/protoc-22.0-linux-x86_64.zip - sudo unzip protoc-22.0-linux-x86_64.zip -d /usr/local - protoc --version + sim-builder-keepkey: + name: Keepkey sim builder + runs-on: ubuntu-latest - - name: Build simulator - run: | - git config --global user.email "ci@ci.com" - git config --global user.name "ci" - cd test; ./setup_environment.sh --${{ matrix.device.name }}; cd .. - tar -czf ${{ matrix.device.archive }}.tar.gz ${{ matrix.device.paths }} + strategy: + fail-fast: false + matrix: + device: + - { name: 'keepkey', archive: 'keepkey-firmware', paths: 'test/work/keepkey-firmware/bin' } + + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/build-sim - - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.device.name }}-sim - path: ${{ matrix.device.archive }}.tar.gz ledger-app-builder: name: Ledger App builder @@ -207,10 +253,13 @@ jobs: - uses: actions/checkout@v4 - uses: ./.github/actions/build-bitcoind - test-dist: - name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.script.name }} + test-trezor-dist: + name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.script }} runs-on: ubuntu-latest - needs: [ dist-builder, sim-builder, ledger-app-builder, bitcoind-builder ] + needs: + - dist-builder + - sim-builder-trezor + - bitcoind-builder strategy: fail-fast: false @@ -219,23 +268,67 @@ jobs: device: - 'trezor-1' - 'trezor-t' + script: + - 'Wheel' + - 'Sdist' + - 'Bindist' + + env: + DEVICE: '--${{ matrix.device }}' + + container: python:${{ matrix.python-version }} + + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/test-dist + + test-coldcard-dist: + name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.script.name }} + runs-on: ubuntu-latest + needs: + - dist-builder + - sim-builder-coldcard + - bitcoind-builder + + strategy: + fail-fast: false + matrix: + python-version: [ '3.9', '3.10', '3.11', '3.12' ] + device: - 'coldcard' + script: + - 'Wheel' + - 'Sdist' + - 'Bindist' + + env: + DEVICE: '--${{ matrix.device }}' + + container: python:${{ matrix.python-version }} + + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/test-dist + + test-bitbox-dist: + name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.script.name }} + runs-on: ubuntu-latest + needs: + - dist-builder + - sim-builder-bitbox + - bitcoind-builder + + strategy: + fail-fast: false + matrix: + python-version: [ '3.9', '3.10', '3.11', '3.12' ] + device: - 'bitbox01' - - 'jade' - - 'ledger' - - 'ledger-legacy' - - 'keepkey' - 'bitbox02' script: - - name: 'Wheel' - install: 'pip install dist/*.whl' - test: 'cd test; ./run_tests.py $DEVICE --interface=cli --device-only; cd ..' - - name: 'Sdist' - install: 'pip install $(find dist -name "*.tar.gz" -a -not -name "*linux*")' - test: 'cd test; ./run_tests.py $DEVICE --interface=cli --device-only; cd ..' - - name: 'Bindist' - install: 'poetry install; cd dist; tar -xvf hwi*linux*.tar.gz; cd ..' - test: 'cd test; poetry run ./run_tests.py $DEVICE --interface=bindist --device-only; cd ..' + - 'Wheel' + - 'Sdist' + - 'Bindist' env: DEVICE: '--${{ matrix.device }}' @@ -244,42 +337,97 @@ jobs: steps: - uses: actions/checkout@v4 + - uses: ./.github/actions/test-dist - - run: | - pip install poetry + test-jade-dist: + name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.script.name }} + runs-on: ubuntu-latest + needs: + - dist-builder + - sim-builder-jade + - bitcoind-builder - - uses: actions/download-artifact@v4 - with: - name: dist - path: dist/ + strategy: + fail-fast: false + matrix: + python-version: [ '3.9', '3.10', '3.11', '3.12' ] + device: + - 'jade' + script: + - 'Wheel' + - 'Sdist' + - 'Bindist' - - run: | - ${{ matrix.script.install }} + env: + DEVICE: '--${{ matrix.device }}' - - uses: actions/download-artifact@v4 - with: - name: bitcoind + container: python:${{ matrix.python-version }} - - run: | - tar -xvf bitcoind.tar.gz + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/test-dist - - uses: ./.github/actions/install-sim - with: - device: ${{ matrix.device }} + test-ledger-dist: + name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.script.name }} + runs-on: ubuntu-latest + needs: + - dist-builder + - sim-builder-ledger + - bitcoind-builder - - name: Run tests - run: | - ${{ matrix.script.test }} + strategy: + fail-fast: false + matrix: + python-version: [ '3.9', '3.10', '3.11', '3.12' ] + device: + - 'ledger' + - 'ledger-legacy' + script: + - 'Wheel' + - 'Sdist' + - 'Bindist' - - if: failure() - run: | - tail -v -n +1 test/*.std* + env: + DEVICE: '--${{ matrix.device }}' + + container: python:${{ matrix.python-version }} + + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/test-dist + test-keepkey-dist: + name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.script.name }} + runs-on: ubuntu-latest + needs: + - dist-builder + - sim-builder-keepkey + - bitcoind-builder - test-all: + strategy: + fail-fast: false + matrix: + python-version: [ '3.9', '3.10', '3.11', '3.12' ] + device: + - 'keepkey' + script: + - 'Wheel' + - 'Sdist' + - 'Bindist' + + env: + DEVICE: '--${{ matrix.device }}' + + container: python:${{ matrix.python-version }} + + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/test-dist + + test-trezor: name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.interface }} runs-on: ubuntu-latest - needs: [ sim-builder, ledger-app-builder, bitcoind-builder ] + needs: [ sim-builder-trezor, bitcoind-builder ] timeout-minutes: 45 strategy: @@ -289,39 +437,113 @@ jobs: device: - 'trezor-1' - 'trezor-t' - - 'coldcard' - - 'bitbox01' - - 'jade' - - 'ledger' - - 'ledger-legacy' - - 'keepkey' - - 'bitbox02' interface: [ 'library', 'cli', 'stdin' ] container: python:${{ matrix.python-version }} steps: - uses: actions/checkout@v4 + - uses: ./.github/actions/test-device - - run: | - pip install poetry - poetry install - - - uses: actions/download-artifact@v4 - with: - name: bitcoind + test-ledger: + name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.interface }} + runs-on: ubuntu-latest + needs: [ sim-builder-ledger, ledger-app-builder, bitcoind-builder ] + timeout-minutes: 45 - - run: | - tar -xvf bitcoind.tar.gz + strategy: + fail-fast: false + matrix: + python-version: [ '3.9', '3.10', '3.11', '3.12' ] + device: + - 'ledger' + - 'ledger-legacy' + interface: [ 'library', 'cli', 'stdin' ] - - uses: ./.github/actions/install-sim - with: - device: ${{ matrix.device }} + container: python:${{ matrix.python-version }} - - name: Run tests - run: | - cd test; poetry run ./run_tests.py --${{ matrix.device }} --interface=${{ matrix.interface }} --device-only; cd .. + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/test-device + + test-coldcard: + name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.interface }} + runs-on: ubuntu-latest + needs: [ sim-builder-coldcard, bitcoind-builder ] + timeout-minutes: 45 + + strategy: + fail-fast: false + matrix: + python-version: [ '3.9', '3.10', '3.11', '3.12' ] + device: + - 'coldcard' + interface: [ 'library', 'cli', 'stdin' ] + + container: python:${{ matrix.python-version }} + + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/test-device + + test-bitbox: + name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.interface }} + runs-on: ubuntu-latest + needs: [ sim-builder-bitbox, bitcoind-builder ] + timeout-minutes: 45 + + strategy: + fail-fast: false + matrix: + python-version: [ '3.9', '3.10', '3.11', '3.12' ] + device: + - 'bitbox01' + - 'bitbox02' + interface: [ 'library', 'cli', 'stdin' ] + + container: python:${{ matrix.python-version }} + + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/test-device + + test-jade: + name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.interface }} + runs-on: ubuntu-latest + needs: [ sim-builder-jade, bitcoind-builder ] + timeout-minutes: 45 + + strategy: + fail-fast: false + matrix: + python-version: [ '3.9', '3.10', '3.11', '3.12' ] + device: + - 'jade' + interface: [ 'library', 'cli', 'stdin' ] + + container: python:${{ matrix.python-version }} + + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/test-device + + test-keepkey: + name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.interface }} + runs-on: ubuntu-latest + needs: [ sim-builder-keepkey, bitcoind-builder ] + timeout-minutes: 45 + + strategy: + fail-fast: false + matrix: + python-version: [ '3.9', '3.10', '3.11', '3.12' ] + device: + - 'keepkey' + interface: [ 'library', 'cli', 'stdin' ] + + container: python:${{ matrix.python-version }} + + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/test-device - - if: failure() - run: | - tail -v -n +1 test/*.std* From 260277f4f625ea3cb117a8a526953ec4909a53a7 Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Wed, 23 Jul 2025 09:43:33 +0200 Subject: [PATCH 22/31] ci: downgrade Keepkey sim builder to Ubuntu 22.04 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cd90e89d4..d3b61f1cd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -216,7 +216,7 @@ jobs: sim-builder-keepkey: name: Keepkey sim builder - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 strategy: fail-fast: false From 0639d6d8de1210f448f66cef38cae452d5bea8a8 Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Wed, 23 Jul 2025 13:14:38 +0200 Subject: [PATCH 23/31] ci: downgrade Coinkite sim builder and tests to Ubuntu 22.04 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Build failure on ubuntu-latest: ``` ../py/stackctrl.c: In function ‘mp_stack_ctrl_init’: ../py/stackctrl.c:32:32: error: storing the address of local variable ‘stack_dummy’ in ‘mp_state_ctx.thread.stack_top’ [-Werror=dangling-pointer=] 32 | MP_STATE_THREAD(stack_top) = (char *)&stack_dummy; ../py/stackctrl.c:31:18: note: ‘stack_dummy’ declared here 31 | volatile int stack_dummy; | ^~~~~~~~~~~ In file included from ../py/runtime.h:29, from ../py/stackctrl.c:27: ../py/mpstate.h:282:23: note: ‘mp_state_ctx’ declared here 282 | extern mp_state_ctx_t mp_state_ctx; | ^~~~~~~~~~~~ cc1: all warnings being treated as errors make: *** [../py/mkrules.mk:77: build/py/stackctrl.o] Error 1 ``` Test failure (after downgrading build sim): ``` File "/github/home/.cache/pypoetry/virtualenvs/hwi-crEDFiR--py3.9/lib/python3.9/site-packages/sdl2/dll.py", line 362, in dll = DLL("SDL2", ["SDL2", "SDL2-2.0", "SDL2-2.0.0"], os.getenv("PYSDL2_DLL_PATH")) File "/github/home/.cache/pypoetry/virtualenvs/hwi-crEDFiR--py3.9/lib/python3.9/site-packages/sdl2/dll.py", line 253, in __init__ raise RuntimeError("could not find any library for %s (%s)" % RuntimeError: could not find any library for SDL2 (PYSDL2_DLL_PATH: unset) ``` https://github.com/bitcoin-core/HWI/actions/runs/16466809973/job/46548656293?pr=795 --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d3b61f1cd..d0a512c2f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -159,7 +159,7 @@ jobs: sim-builder-coldcard: name: Coldcard sim builder - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 strategy: fail-fast: false @@ -468,7 +468,7 @@ jobs: test-coldcard: name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.interface }} - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 needs: [ sim-builder-coldcard, bitcoind-builder ] timeout-minutes: 45 From a482d1579ca12c4fe22b6045a0f4df4eb6d1a5e5 Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Wed, 23 Jul 2025 13:43:11 +0200 Subject: [PATCH 24/31] ci: downgrade Trezor sim builder to Ubuntu 22.04 The build on ubuntu-latest succeeds, but the resulting binary uses a too recent version of glibc for the test runners to handle. This only seems to impact Trezor 1, but just downgrade for Trezor T as well. --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d0a512c2f..d75c72cd0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -144,7 +144,10 @@ jobs: sim-builder-trezor: name: Trezor sim builder - runs-on: ubuntu-latest + # Ubuntu 22.04 ships with glibc 2.35, which is needed to keep Trezor 1 + # binaries compatible with Debian Bookworm (glibc 2.36) Python containers. + # Trezor T binaries don't need this. + runs-on: ubuntu-22.04 strategy: fail-fast: false From 5f0edffa83c5b7a425e8d402b7f451968d73720e Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Wed, 23 Jul 2025 16:37:06 +0200 Subject: [PATCH 25/31] ledger: use NanoX NanoS support has been dropped: LedgerHQ/app-bitcoin-new#262 NanoX also makes it possible to test MuSig2 in the future. Keep NanoS for legacy. --- .github/actions/install-sim/action.yml | 3 ++- .github/workflows/ci.yml | 24 ++++++++++++++++++++---- test/data/speculos-automation.json | 2 +- test/test_ledger.py | 4 ++-- 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/.github/actions/install-sim/action.yml b/.github/actions/install-sim/action.yml index 2d004a8e2..3cc846811 100644 --- a/.github/actions/install-sim/action.yml +++ b/.github/actions/install-sim/action.yml @@ -66,7 +66,8 @@ runs: - if: inputs.device == 'ledger' uses: actions/download-artifact@v4 with: - name: ledger_app + name: ${{ inputs.device == 'ledger-legacy' && 'ledger_app_nano_s' || 'ledger_app_nano_x' }} + - if: inputs.device == 'ledger' shell: bash diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d75c72cd0..b44af1633 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -232,8 +232,8 @@ jobs: - uses: ./.github/actions/build-sim - ledger-app-builder: - name: Ledger App builder + ledger-s-app-builder: + name: Ledger Nano S Bitcoin App builder runs-on: ubuntu-latest container: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest steps: @@ -244,7 +244,23 @@ jobs: - uses: actions/upload-artifact@v4 with: - name: ledger_app + name: ledger_app_nano_s + path: app-bitcoin-new/bin/app.elf + + + ledger-x-app-builder: + name: Ledger Nano X Bitcoin App builder + runs-on: ubuntu-latest + container: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest + steps: + - run: | + git clone https://github.com/LedgerHQ/app-bitcoin-new.git + cd app-bitcoin-new + make DEBUG=1 BOLOS_SDK=$NANOX_SDK + + - uses: actions/upload-artifact@v4 + with: + name: ledger_app_nano_x path: app-bitcoin-new/bin/app.elf bitcoind-builder: @@ -451,7 +467,7 @@ jobs: test-ledger: name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.interface }} runs-on: ubuntu-latest - needs: [ sim-builder-ledger, ledger-app-builder, bitcoind-builder ] + needs: [ sim-builder-ledger, ledger-s-app-builder, ledger-x-app-builder, bitcoind-builder ] timeout-minutes: 45 strategy: diff --git a/test/data/speculos-automation.json b/test/data/speculos-automation.json index 694cde276..0e53a29d4 100644 --- a/test/data/speculos-automation.json +++ b/test/data/speculos-automation.json @@ -2,7 +2,7 @@ "version": 1, "rules": [ { - "regexp": "^(Address|Review|Amount|Fee|Confirm|The derivation|Derivation path|Reject if you're|The change path|Change path|external inputs|Register wallet|Policy map|Key|Path|Public key|Spend from|Wallet name|Wallet policy).*", + "regexp": "^(Address|Review|Amount|Fee|Confirm|The derivation|Derivation path|Reject if you're|The change path|Change path|external inputs|Register wallet|Register account|Policy map|Key|Path|Public key|Spend from|Account name|Wallet name|Wallet policy|Descriptor template).*", "actions": [ [ "button", 2, true ], [ "button", 2, false ] diff --git a/test/test_ledger.py b/test/test_ledger.py index 7e819141a..c63bb5853 100755 --- a/test/test_ledger.py +++ b/test/test_ledger.py @@ -52,7 +52,7 @@ def start(self): super().start() automation_path = os.path.abspath("data/speculos-automation.json") app_path = "./apps/nanos#btc#2.0#ce796c1b.elf" if self.legacy else "./apps/btc-test.elf" - os.environ["SPECULOS_APPNAME"] = "Bitcoin Test:1.6.0" if self.legacy else "Bitcoin Test:2.1.0" + os.environ["SPECULOS_APPNAME"] = "Bitcoin Test:1.6.0" if self.legacy else "Bitcoin Test:2.4.1" self.emulator_stderr = open('ledger-emulator.stderr', 'a') # Start the emulator @@ -70,7 +70,7 @@ def start(self): 'seproxyhal:DEBUG', '--api-port', '0', - '--model', 'nanos', + '--model', 'nanos' if self.legacy else 'nanox', app_path ], cwd=os.path.dirname(self.emulator_path), From e771d31096eb4a873cd592aa883ee2439f561d74 Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Fri, 29 Aug 2025 14:18:25 +0200 Subject: [PATCH 26/31] ci: pin non-device jobs to Python 3.12 --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b44af1633..5e6150af4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: type-check: name: Type check runs-on: ubuntu-latest - container: python:latest + container: python:3.12 steps: - uses: actions/checkout@v4 @@ -61,7 +61,7 @@ jobs: non-device-tests: name: Non-device tests runs-on: ubuntu-latest - container: python:latest + container: python:3.12 steps: - uses: actions/checkout@v4 @@ -76,7 +76,7 @@ jobs: lint: name: lint runs-on: ubuntu-latest - container: python:latest + container: python:3.12 steps: - uses: actions/checkout@v4 From 1c53f9a8a1ecf9b9d3439d3f3c44651a6907e158 Mon Sep 17 00:00:00 2001 From: Marko Bencun Date: Thu, 17 Jul 2025 15:43:17 +0200 Subject: [PATCH 27/31] support BitBox02 Nova by updating bitbox02 lib to v7.0.0 This adds support for BitBox02 Nova. It has the same API has BitBox02. --- hwilib/devices/bitbox02.py | 16 +- hwilib/devices/bitbox02_lib/README.md | 6 +- .../devices/bitbox02_lib/bitbox02/__init__.py | 4 +- .../devices/bitbox02_lib/bitbox02/bitbox02.py | 126 +++- .../bitbox02_lib/bitbox02/bootloader.py | 75 ++- .../communication/bitbox_api_protocol.py | 255 ++++---- .../communication/communication.py | 22 +- .../bitbox02_lib/communication/devices.py | 9 + .../generated/antiklepto_pb2.pyi | 43 -- .../generated/backup_commands_pb2.pyi | 93 ++- .../generated/bitbox02_system_pb2.py | 30 +- .../generated/bitbox02_system_pb2.pyi | 160 +++-- .../communication/generated/bluetooth_pb2.py | 37 ++ .../communication/generated/btc_pb2.py | 92 +-- .../communication/generated/btc_pb2.pyi | 587 ++++++++++++------ .../communication/generated/cardano_pb2.py | 56 +- .../communication/generated/cardano_pb2.pyi | 340 ---------- .../communication/generated/common_pb2.pyi | 88 ++- .../communication/generated/eth_pb2.py | 62 +- .../communication/generated/eth_pb2.pyi | 327 ++++++---- .../communication/generated/hww_pb2.py | 19 +- .../communication/generated/hww_pb2.pyi | 162 +++-- .../communication/generated/keystore_pb2.pyi | 76 ++- .../communication/generated/mnemonic_pb2.pyi | 44 +- .../generated/perform_attestation_pb2.pyi | 26 +- .../communication/generated/system_pb2.pyi | 37 +- .../communication/u2fhid/u2fhid.py | 4 +- 27 files changed, 1595 insertions(+), 1201 deletions(-) delete mode 100644 hwilib/devices/bitbox02_lib/communication/generated/antiklepto_pb2.pyi create mode 100644 hwilib/devices/bitbox02_lib/communication/generated/bluetooth_pb2.py delete mode 100644 hwilib/devices/bitbox02_lib/communication/generated/cardano_pb2.pyi diff --git a/hwilib/devices/bitbox02.py b/hwilib/devices/bitbox02.py index 9484e0aae..cc6b783b3 100644 --- a/hwilib/devices/bitbox02.py +++ b/hwilib/devices/bitbox02.py @@ -194,10 +194,10 @@ def enumerate(password: Optional[str] = None, expert: bool = False, chain: Chain bb02 = None with handle_errors(common_err_msgs["enumerate"], d_data): bb02 = client.init(expect_initialized=None) - version, platform, edition, unlocked = bitbox02.BitBox02.get_info( + version, platform, edition, unlocked, _ = bitbox02.BitBox02.get_info( client.transport ) - if platform != Platform.BITBOX02: + if platform not in (Platform.BITBOX02, Platform.BITBOX02PLUS): client.close() continue if edition not in (BitBox02Edition.MULTI, BitBox02Edition.BTCONLY): @@ -211,9 +211,15 @@ def enumerate(password: Optional[str] = None, expert: bool = False, chain: Chain "type": "bitbox02", "path": path, "model": { - BitBox02Edition.MULTI: "bitbox02_multi", - BitBox02Edition.BTCONLY: "bitbox02_btconly", - }[edition], + Platform.BITBOX02: { + BitBox02Edition.MULTI: "bitbox02_multi", + BitBox02Edition.BTCONLY: "bitbox02_btconly", + }, + Platform.BITBOX02PLUS: { + BitBox02Edition.MULTI: "bitbox02_nova_multi", + BitBox02Edition.BTCONLY: "bitbox02_nova_btconly", + }, + }[platform][edition], "needs_pin_sent": False, "needs_passphrase_sent": False, } diff --git a/hwilib/devices/bitbox02_lib/README.md b/hwilib/devices/bitbox02_lib/README.md index 6285ee407..f55d4115f 100644 --- a/hwilib/devices/bitbox02_lib/README.md +++ b/hwilib/devices/bitbox02_lib/README.md @@ -1,12 +1,12 @@ # Python BitBox02 Library -This is a slightly modified version of the official [bitbox02](https://github.com/digitalbitbox/bitbox02-firmware/tree/master/py/bitbox02) library. +This is a slightly modified version of the official [bitbox02](https://github.com/BitBoxSwiss/bitbox02-firmware/tree/master/py/bitbox02) library. -This was made at commit [5b004e84e2928545db881e380c8ae8782743f5b2](https://github.com/digitalbitbox/bitbox02-firmware/commit/5b004e84e2928545db881e380c8ae8782743f5b2) +This was made at tag [py-bitbox02-7.0,0](https://github.com/BitBoxSwiss/bitbox02-firmware/tree/py-bitbox02-7.0.0) ## Changes - Use our own _base58 rather than external base58 library - Use relative imports between bitbox02 and communication instead of standard imports that require module installation -See commit ac1d5184f1d7c34630b7eb02d1ce5a7b1e16dc61 for the modifications made +See commit 753a9d0c6eec9d7446793a4ce2330fb975d58684 for the modifications made diff --git a/hwilib/devices/bitbox02_lib/bitbox02/__init__.py b/hwilib/devices/bitbox02_lib/bitbox02/__init__.py index 598ed110a..62e44c7ce 100644 --- a/hwilib/devices/bitbox02_lib/bitbox02/__init__.py +++ b/hwilib/devices/bitbox02_lib/bitbox02/__init__.py @@ -11,12 +11,12 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -""" Library to interact with a BitBox02 device. """ +"""Library to interact with a BitBox02 device.""" from __future__ import print_function import sys -__version__ = "6.3.0" +__version__ = "7.0.0" if sys.version_info.major != 3 or sys.version_info.minor < 6: print( diff --git a/hwilib/devices/bitbox02_lib/bitbox02/bitbox02.py b/hwilib/devices/bitbox02_lib/bitbox02/bitbox02.py index 91bc2fcc9..6c5876fa4 100644 --- a/hwilib/devices/bitbox02_lib/bitbox02/bitbox02.py +++ b/hwilib/devices/bitbox02_lib/bitbox02/bitbox02.py @@ -43,9 +43,10 @@ from ..communication.generated import common_pb2 as common from ..communication.generated import keystore_pb2 as keystore from ..communication.generated import antiklepto_pb2 as antiklepto + from ..communication.generated import bluetooth_pb2 as bluetooth import google.protobuf.empty_pb2 - # pylint: disable=unused-import + # pylint: disable=unused-import,ungrouped-imports # We export it in __init__.py from ..communication.generated import system_pb2 as system except ModuleNotFoundError: @@ -116,18 +117,31 @@ class BTCInputType(TypedDict): class BTCOutputInternal: # TODO: Use NamedTuple, but not playing well with protobuf types. + """ + Internal transaction output (output belongs to BitBox). + """ - def __init__(self, keypath: Sequence[int], value: int, script_config_index: int): + def __init__( + self, + keypath: Sequence[int], + value: int, + script_config_index: int, + output_script_config_index: Optional[int] = None, + ): """ keypath: keypath to the change output. """ self.keypath = keypath self.value = value self.script_config_index = script_config_index + self.output_script_config_index = output_script_config_index class BTCOutputExternal: # TODO: Use NamedTuple, but not playing well with protobuf types. + """ + External transaction output. + """ def __init__(self, output_type: "btc.BTCOutputType.V", output_payload: bytes, value: int): self.type = output_type @@ -161,6 +175,14 @@ def device_info(self) -> Dict[str, Any]: } if self.version >= semver.VersionInfo(9, 6, 0): result["securechip_model"] = response.device_info.securechip_model + if response.device_info.bluetooth is not None: + result["bluetooth"] = { + "firmware_hash": response.device_info.bluetooth.firmware_hash, + "firmware_version": response.device_info.bluetooth.firmware_version, + "enabled": response.device_info.bluetooth.enabled, + } + else: + result["bluetooth"] = None return result @@ -390,13 +412,14 @@ def btc_sign( version: int = 1, locktime: int = 0, format_unit: "btc.BTCSignInitRequest.FormatUnit.V" = btc.BTCSignInitRequest.FormatUnit.DEFAULT, + output_script_configs: Optional[Sequence[btc.BTCScriptConfigWithKeypath]] = None, ) -> Sequence[Tuple[int, bytes]]: """ coin: the first element of all provided keypaths must match the coin: - BTC: 0 + HARDENED - Testnets: 1 + HARDENED - LTC: 2 + HARDENED - script_configs: types of all inputs and change outputs. The first element of all provided + script_configs: types of all inputs and outputs belonging to the same account (change or non-change). The first element of all provided keypaths must match this type: - SCRIPT_P2PKH: 44 + HARDENED - SCRIPT_P2WPKH_P2SH: 49 + HARDENED @@ -407,6 +430,8 @@ def btc_sign( outputs: transaction outputs. Can be an external output (BTCOutputExternal) or an internal output for change (BTCOutputInternal). version, locktime: reserved for future use. + format_unit: defines in which unit amounts will be displayed + output_script_configs: script types for outputs belonging to the same keystore Returns: list of (input index, signature) tuples. Raises Bitbox02Exception with ERR_USER_ABORT on user abort. """ @@ -418,6 +443,10 @@ def btc_sign( if any(map(is_taproot, script_configs)): self._require_atleast(semver.VersionInfo(9, 10, 0)) + if output_script_configs: + # Attaching output info supported since v9.22.0. + self._require_atleast(semver.VersionInfo(9, 22, 0)) + supports_antiklepto = self.version >= semver.VersionInfo(9, 4, 0) sigs: List[Tuple[int, bytes]] = [] @@ -433,6 +462,7 @@ def btc_sign( num_outputs=len(outputs), locktime=locktime, format_unit=format_unit, + output_script_configs=output_script_configs, ) ) next_response = self._msg_query(request, expected_response="btc_sign_next").btc_sign_next @@ -552,12 +582,16 @@ def btc_sign( request = hww.Request() if isinstance(tx_output, BTCOutputInternal): + if tx_output.output_script_config_index is not None: + # Attaching output info supported since v9.22.0. + self._require_atleast(semver.VersionInfo(9, 22, 0)) request.btc_sign_output.CopyFrom( btc.BTCSignOutputRequest( ours=True, value=tx_output.value, keypath=tx_output.keypath, script_config_index=tx_output.script_config_index, + output_script_config_index=tx_output.output_script_config_index, ) ) elif isinstance(tx_output, BTCOutputExternal): @@ -588,6 +622,8 @@ def btc_sign_msg( # pylint: disable=no-member self._require_atleast(semver.VersionInfo(9, 2, 0)) + if coin in (btc.TBTC, btc.RBTC): + self._require_atleast(semver.VersionInfo(9, 23, 0)) request = btc.BTCRequest() request.sign_message.CopyFrom( @@ -648,16 +684,6 @@ def insert_sdcard(self) -> None: ) self._msg_query(request, expected_response="success") - def remove_sdcard(self) -> None: - # pylint: disable=no-member - request = hww.Request() - request.insert_remove_sdcard.CopyFrom( - bitbox02_system.InsertRemoveSDCardRequest( - action=bitbox02_system.InsertRemoveSDCardRequest.REMOVE_CARD - ) - ) - self._msg_query(request, expected_response="success") - def root_fingerprint(self) -> bytes: """ Get the root fingerprint from the bitbox02 @@ -788,10 +814,18 @@ def eth_pub( ) return self._eth_msg_query(request, expected_response="pub").pub.pub - def eth_sign(self, transaction: bytes, keypath: Sequence[int], chain_id: int = 1) -> bytes: + def eth_sign( + self, + transaction: bytes, + keypath: Sequence[int], + address_case: eth.ETHAddressCase.ValueType = eth.ETH_ADDRESS_CASE_MIXED, + chain_id: int = 1, + ) -> bytes: """ transaction should be given as a full rlp encoded eth transaction. """ + # pylint: disable=no-member + is_eip1559 = transaction.startswith(b"\x02") def handle_antiklepto(request: eth.ETHRequest) -> bytes: @@ -853,6 +887,7 @@ def handle_antiklepto(request: eth.ETHRequest) -> bytes: recipient=recipient, value=value, data=data, + address_case=address_case, ) ) return handle_antiklepto(request) @@ -871,6 +906,7 @@ def handle_antiklepto(request: eth.ETHRequest) -> bytes: recipient=recipient, value=value, data=data, + address_case=address_case, ) ) @@ -1176,7 +1212,69 @@ def cardano_address(self, address: cardano.CardanoAddressRequest) -> str: def cardano_sign_transaction( self, transaction: cardano.CardanoSignTransactionRequest ) -> cardano.CardanoSignTransactionResponse: + if transaction.tag_cbor_sets: + self._require_atleast(semver.VersionInfo(9, 22, 0)) request = cardano.CardanoRequest(sign_transaction=transaction) return self._cardano_msg_query( request, expected_response="sign_transaction" ).sign_transaction + + def _bluetooth_msg_query( + self, bluetooth_request: bluetooth.BluetoothRequest, expected_response: Optional[str] = None + ) -> bluetooth.BluetoothResponse: + """ + Same as _msg_query, but one nesting deeper for bluetooth messages. + """ + # pylint: disable=no-member + request = hww.Request() + request.bluetooth.CopyFrom(bluetooth_request) + bluetooth_response = self._msg_query(request, expected_response="bluetooth").bluetooth + if ( + expected_response is not None + and bluetooth_response.WhichOneof("response") != expected_response + ): + raise Exception( + "Unexpected response: {}, expected: {}".format( + bluetooth_response.WhichOneof("response"), expected_response + ) + ) + return bluetooth_response + + def bluetooth_upgrade(self, firmware: bytes) -> None: + """ + Install the given Bluetooth firmware. + """ + # pylint: disable=no-member + request = bluetooth.BluetoothRequest() + request.upgrade_init.CopyFrom( + bluetooth.BluetoothUpgradeInitRequest(firmware_length=len(firmware)) + ) + + response = self._bluetooth_msg_query(request) + while True: + response_type = response.WhichOneof("response") + if response_type == "request_chunk": + chunk_response = response.request_chunk + request = bluetooth.BluetoothRequest() + request.chunk.CopyFrom( + bluetooth.BluetoothChunkRequest( + data=firmware[ + chunk_response.offset : chunk_response.offset + chunk_response.length + ] + ), + ) + response = self._bluetooth_msg_query(request) + elif response_type == "success": + break + else: + raise Exception(f"Unexpected response: f{response_type}") + + def bluetooth_toggle_enabled(self) -> None: + """ + Enable/disable Bluetooth in non-volatile storage + """ + # pylint: disable=no-member + request = bluetooth.BluetoothRequest() + request.toggle_enabled.CopyFrom(bluetooth.BluetoothToggleEnabledRequest()) + + self._bluetooth_msg_query(request, expected_response="success") diff --git a/hwilib/devices/bitbox02_lib/bitbox02/bootloader.py b/hwilib/devices/bitbox02_lib/bitbox02/bootloader.py index 21ddd35a0..f623158b7 100644 --- a/hwilib/devices/bitbox02_lib/bitbox02/bootloader.py +++ b/hwilib/devices/bitbox02_lib/bitbox02/bootloader.py @@ -11,16 +11,26 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -""" Interact with a BitBox02 bootloader. """ +"""Interact with a BitBox02 bootloader.""" import struct import typing import io import math import hashlib +import enum +from typing import TypedDict from ..communication import TransportLayer -from ..communication.devices import DeviceInfo + +from ..communication.devices import ( + DeviceInfo, + parse_device_version, + BB02MULTI_BOOTLOADER, + BB02BTC_BOOTLOADER, + BITBOX02PLUS_MULTI_BOOTLOADER, + BITBOX02PLUS_BTC_BOOTLOADER, +) BOOTLOADER_CMD = 0x80 + 0x40 + 0x03 NUM_ROOT_KEYS = 3 @@ -32,9 +42,10 @@ assert MAX_FIRMWARE_SIZE % CHUNK_SIZE == 0 FIRMWARE_CHUNKS = MAX_FIRMWARE_SIZE // CHUNK_SIZE -SIGDATA_MAGIC_STANDARD = struct.pack(">I", 0x653F362B) -SIGDATA_MAGIC_BTCONLY = struct.pack(">I", 0x11233B0B) -SIGDATA_MAGIC_BITBOXBASE_STANDARD = struct.pack(">I", 0xAB6BD345) +SIGDATA_MAGIC_BITBOX02_MULTI = struct.pack(">I", 0x653F362B) +SIGDATA_MAGIC_BITBOX02_BTCONLY = struct.pack(">I", 0x11233B0B) +SIGDATA_MAGIC_BITBOX02PLUS_MULTI = struct.pack(">I", 0x5B648CEB) +SIGDATA_MAGIC_BITBOX02PLUS_BTCONLY = struct.pack(">I", 0x48714774) MAGIC_LEN = 4 @@ -44,6 +55,19 @@ SIGDATA_LEN = SIGNING_PUBKEYS_DATA_LEN + FIRMWARE_DATA_LEN +class SecureChipModel(enum.Enum): + """Secure chip model variants for the BitBox02 platform.""" + + ATECC = "ATECC" + OPTIGA = "Optiga" + + +class Hardware(TypedDict): + """Hardware configuration containing secure chip model information.""" + + secure_chip_model: SecureChipModel + + def parse_signed_firmware(firmware: bytes) -> typing.Tuple[bytes, bytes, bytes]: """ Split raw firmware bytes into magic, sigdata and firmware @@ -53,9 +77,10 @@ def parse_signed_firmware(firmware: bytes) -> typing.Tuple[bytes, bytes, bytes]: raise ValueError("firmware too small") magic, firmware = firmware[:MAGIC_LEN], firmware[MAGIC_LEN:] if magic not in ( - SIGDATA_MAGIC_STANDARD, - SIGDATA_MAGIC_BTCONLY, - SIGDATA_MAGIC_BITBOXBASE_STANDARD, + SIGDATA_MAGIC_BITBOX02_MULTI, + SIGDATA_MAGIC_BITBOX02_BTCONLY, + SIGDATA_MAGIC_BITBOX02PLUS_MULTI, + SIGDATA_MAGIC_BITBOX02PLUS_BTCONLY, ): raise ValueError("invalid magic") @@ -71,10 +96,15 @@ class Bootloader: def __init__(self, transport: TransportLayer, device_info: DeviceInfo): self._transport = transport self.expected_magic = { - "bb02-bootloader": SIGDATA_MAGIC_STANDARD, - "bb02btc-bootloader": SIGDATA_MAGIC_BTCONLY, - "bitboxbase-bootloader": SIGDATA_MAGIC_BITBOXBASE_STANDARD, + BB02MULTI_BOOTLOADER: SIGDATA_MAGIC_BITBOX02_MULTI, + BB02BTC_BOOTLOADER: SIGDATA_MAGIC_BITBOX02_BTCONLY, + BITBOX02PLUS_MULTI_BOOTLOADER: SIGDATA_MAGIC_BITBOX02PLUS_MULTI, + BITBOX02PLUS_BTC_BOOTLOADER: SIGDATA_MAGIC_BITBOX02PLUS_BTCONLY, }.get(device_info["product_string"]) + self.version = parse_device_version(device_info["serial_number"]) + # Delete the prelease part, as it messes with the comparison (e.g. 3.0.0-pre < 3.0.0 is + # True, but the 3.0.0-pre has already the same API breaking changes like 3.0.0...). + self.version = self.version.replace(prerelease=None) assert self.expected_magic def _query(self, msg: bytes) -> bytes: @@ -94,6 +124,25 @@ def versions(self) -> typing.Tuple[int, int]: firmware_v, signing_pubkeys_v = struct.unpack(" Hardware: + """ + Returns (hardware variant). + """ + secure_chip: SecureChipModel = SecureChipModel.ATECC + + # Previous bootloader versions do not support the call and have ATECC SC. + if self.version >= "1.1.0": + response = self._query(b"W") + response_code = response[:1] + + if response_code == b"\x00": + secure_chip = SecureChipModel.ATECC + elif response_code == b"\x01": + secure_chip = SecureChipModel.OPTIGA + else: + raise ValueError(f"Unrecognized securechip model: {response_code!r}") + return {"secure_chip_model": secure_chip} + def get_hashes( self, display_firmware_hash: bool = False, display_signing_keydata_hash: bool = False ) -> typing.Tuple[bytes, bytes]: @@ -111,7 +160,7 @@ def show_firmware_hash_enabled(self) -> bool: """ Returns whether the bootloader will automatically show the firmware hash on boot. """ - return bool(self._query(b"H\xFF")[0]) + return bool(self._query(b"H\xff")[0]) def set_show_firmware_hash(self, enable: bool) -> None: """ @@ -184,7 +233,7 @@ def erased(self) -> bool: # We check by comparing the device reported firmware hash. # If erased, the firmware is all '\xFF'. firmware_v, _ = self.versions() - empty_firmware = struct.pack(" bool: """ Returns True if the user confirms the pairing (both device and host). @@ -541,12 +573,14 @@ def __init__( if device_info is not None: version = device_info["serial_number"] - if device_info["product_string"] == BITBOX02MULTI: + if device_info["product_string"] in (BITBOX02MULTI, BITBOX02PLUS_MULTI): edition = BitBox02Edition.MULTI - elif device_info["product_string"] == BITBOX02BTC: + elif device_info["product_string"] in (BITBOX02BTC, BITBOX02PLUS_BTC): edition = BitBox02Edition.BTCONLY + else: + raise Exception("Invalid product string") else: - version, _, edition, _ = self.get_info(transport) + version, _, edition, _, _ = self.get_info(transport) self.edition = edition try: @@ -557,9 +591,7 @@ def __init__( # Delete the prelease part, as it messes with the comparison (e.g. 3.0.0-pre < 3.0.0 is # True, but the 3.0.0-pre has already the same API breaking changes like 3.0.0...). - self.version = semver.VersionInfo( - self.version.major, self.version.minor, self.version.patch, build=self.version.build - ) + self.version = self.version.replace(prerelease=None) # raises exceptions if the library is out of date self._check_max_version() @@ -604,14 +636,7 @@ def _perform_attestation(self) -> bool: # root pubkey could not be identified. return False - root_pubkey_info = ATTESTATION_PUBKEYS_MAP[root_pubkey_identifier] - root_pubkey_bytes_uncompressed = root_pubkey_info["pubkey"] - if ( - root_pubkey_info["accepted_bootloader_hash"] is not None - and root_pubkey_info["accepted_bootloader_hash"] != bootloader_hash - ): - return False - + root_pubkey_bytes_uncompressed = ATTESTATION_PUBKEYS_MAP[root_pubkey_identifier] root_pubkey = ecdsa.VerifyingKey.from_string( root_pubkey_bytes_uncompressed[1:], ecdsa.curves.SECP256k1 ) @@ -680,11 +705,14 @@ def reboot( return True @staticmethod - def get_info(transport: TransportLayer) -> Tuple[str, Platform, Union[BitBox02Edition], bool]: + def get_info( + transport: TransportLayer, + ) -> Tuple[str, Platform, Union[BitBox02Edition], bool, Optional[bool]]: """ - Returns (version, platform, edition, unlocked). - This is useful to get the version of the firmware when a usb descriptor is not available - (via BitBoxBridge, etc.). + Returns (version, platform, edition, unlocked, initialized). + This is useful to get the version of the firmware or the device unlocked/initialized status + when a usb descriptor is not available (via BitBoxBridge, etc.). The initialized status is + supported from firmware v9.20.0 (it is None if not supported). This call does not use a versioned BitBoxProtocol for communication, as the version is not available (this call is used to get the version), so it must work for all firmware versions. """ @@ -695,18 +723,23 @@ def get_info(transport: TransportLayer) -> Tuple[str, Platform, Union[BitBox02Ed version_str = version.rstrip(b"\0").decode("ascii") platform_byte, response = response[0], response[1:] - platform = {0x00: Platform.BITBOX02}[platform_byte] + platform = {0x00: Platform.BITBOX02, 0x02: Platform.BITBOX02PLUS}[platform_byte] edition_byte, response = response[0], response[1:] edition: Union[BitBox02Edition] - if platform == Platform.BITBOX02: + if platform in (Platform.BITBOX02, Platform.BITBOX02PLUS): edition = {0x00: BitBox02Edition.MULTI, 0x01: BitBox02Edition.BTCONLY}[edition_byte] else: raise Exception("Unknown platform: {}".format(platform)) - unlocked_byte = response[0] + unlocked_byte, response = response[0], response[1:] unlocked = {0x00: False, 0x01: True}[unlocked_byte] - return (version_str, platform, edition, unlocked) + + initialized = None + if parse_device_version(version_str) >= semver.VersionInfo(9, 20, 0): + initialized_byte = response[0] + initialized = {0x00: False, 0x01: True}[initialized_byte] + return (version_str, platform, edition, unlocked, initialized) def check_min_version(self) -> None: """ diff --git a/hwilib/devices/bitbox02_lib/communication/communication.py b/hwilib/devices/bitbox02_lib/communication/communication.py index 6dea22107..1e9bc80c8 100644 --- a/hwilib/devices/bitbox02_lib/communication/communication.py +++ b/hwilib/devices/bitbox02_lib/communication/communication.py @@ -26,31 +26,25 @@ class TransportLayer(Protocol): transmitting byte strings. """ - # pylint: disable=unused-argument,no-self-use + # pylint: disable=unused-argument def write(self, data: bytes, endpoint: int, cid: int) -> None: """Sends a frame of data to the specified endpoint""" - def read(self, endpoint: int, cid: int) -> bytes: - ... + def read(self, endpoint: int, cid: int) -> bytes: ... def query(self, data: bytes, endpoint: int, cid: int) -> bytes: self.write(data, endpoint, cid) return self.read(endpoint, cid) - def generate_cid(self) -> int: - ... + def generate_cid(self) -> int: ... - def close(self) -> None: - ... + def close(self) -> None: ... class PhysicalLayer(Protocol): - # pylint: disable=unused-argument,no-self-use - def write(self, data: bytes) -> None: - ... + # pylint: disable=unused-argument + def write(self, data: bytes) -> None: ... - def read(self, size: int, timeout_ms: int) -> bytes: - ... + def read(self, size: int, timeout_ms: int) -> bytes: ... - def close(self) -> None: - ... + def close(self) -> None: ... diff --git a/hwilib/devices/bitbox02_lib/communication/devices.py b/hwilib/devices/bitbox02_lib/communication/devices.py index 027121f8d..9bfba05d5 100644 --- a/hwilib/devices/bitbox02_lib/communication/devices.py +++ b/hwilib/devices/bitbox02_lib/communication/devices.py @@ -26,6 +26,11 @@ BITBOX02MULTI = "BitBox02" BITBOX02BTC = "BitBox02BTC" +BITBOX02PLUS_MULTI_BOOTLOADER = "BitBox02 Nova Multi bl" +BITBOX02PLUS_BTC_BOOTLOADER = "BitBox02 Nova BTC-only bl" +BITBOX02PLUS_MULTI = "BitBox02 Nova Multi" +BITBOX02PLUS_BTC = "BitBox02 Nova BTC-only" + class TooManyFoundException(Exception): def __init__(self, count: int) -> None: @@ -111,6 +116,8 @@ def get_any_bitbox02s() -> List[DeviceInfo]: """ devices = get_bitbox02multi_devices() devices.extend(get_bitbox02btc_devices()) + devices.extend(get_devices(BITBOX02PLUS_MULTI)) + devices.extend(get_devices(BITBOX02PLUS_BTC)) return devices @@ -138,6 +145,8 @@ def get_any_bitbox02_bootloaders() -> List[DeviceInfo]: """ devices = get_bitbox02multi_bootloaders() devices.extend(get_bitbox02btc_bootloaders()) + devices.extend(get_devices(BITBOX02PLUS_MULTI_BOOTLOADER)) + devices.extend(get_devices(BITBOX02PLUS_BTC_BOOTLOADER)) return devices diff --git a/hwilib/devices/bitbox02_lib/communication/generated/antiklepto_pb2.pyi b/hwilib/devices/bitbox02_lib/communication/generated/antiklepto_pb2.pyi deleted file mode 100644 index adc4a83b7..000000000 --- a/hwilib/devices/bitbox02_lib/communication/generated/antiklepto_pb2.pyi +++ /dev/null @@ -1,43 +0,0 @@ -""" -@generated by mypy-protobuf. Do not edit manually! -isort:skip_file -""" -import builtins -import google.protobuf.descriptor -import google.protobuf.message -import typing_extensions - -DESCRIPTOR: google.protobuf.descriptor.FileDescriptor - -class AntiKleptoHostNonceCommitment(google.protobuf.message.Message): - DESCRIPTOR: google.protobuf.descriptor.Descriptor - COMMITMENT_FIELD_NUMBER: builtins.int - commitment: builtins.bytes - def __init__(self, - *, - commitment: builtins.bytes = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["commitment",b"commitment"]) -> None: ... -global___AntiKleptoHostNonceCommitment = AntiKleptoHostNonceCommitment - -class AntiKleptoSignerCommitment(google.protobuf.message.Message): - DESCRIPTOR: google.protobuf.descriptor.Descriptor - COMMITMENT_FIELD_NUMBER: builtins.int - commitment: builtins.bytes - def __init__(self, - *, - commitment: builtins.bytes = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["commitment",b"commitment"]) -> None: ... -global___AntiKleptoSignerCommitment = AntiKleptoSignerCommitment - -class AntiKleptoSignatureRequest(google.protobuf.message.Message): - DESCRIPTOR: google.protobuf.descriptor.Descriptor - HOST_NONCE_FIELD_NUMBER: builtins.int - host_nonce: builtins.bytes - def __init__(self, - *, - host_nonce: builtins.bytes = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["host_nonce",b"host_nonce"]) -> None: ... -global___AntiKleptoSignatureRequest = AntiKleptoSignatureRequest diff --git a/hwilib/devices/bitbox02_lib/communication/generated/backup_commands_pb2.pyi b/hwilib/devices/bitbox02_lib/communication/generated/backup_commands_pb2.pyi index 77239679d..14f25ebd2 100644 --- a/hwilib/devices/bitbox02_lib/communication/generated/backup_commands_pb2.pyi +++ b/hwilib/devices/bitbox02_lib/communication/generated/backup_commands_pb2.pyi @@ -1,103 +1,132 @@ """ @generated by mypy-protobuf. Do not edit manually! isort:skip_file -""" +This file is named backup_commands to avoid conflicting header files with top-most backup.proto""" + import builtins +import collections.abc import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message import typing -import typing_extensions DESCRIPTOR: google.protobuf.descriptor.FileDescriptor +@typing.final class CheckBackupRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + SILENT_FIELD_NUMBER: builtins.int silent: builtins.bool - def __init__(self, + def __init__( + self, *, silent: builtins.bool = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["silent",b"silent"]) -> None: ... + ) -> None: ... + def ClearField(self, field_name: typing.Literal["silent", b"silent"]) -> None: ... + global___CheckBackupRequest = CheckBackupRequest +@typing.final class CheckBackupResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + ID_FIELD_NUMBER: builtins.int - id: typing.Text - def __init__(self, + id: builtins.str + def __init__( + self, *, - id: typing.Text = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["id",b"id"]) -> None: ... + id: builtins.str = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["id", b"id"]) -> None: ... + global___CheckBackupResponse = CheckBackupResponse +@typing.final class CreateBackupRequest(google.protobuf.message.Message): """Timestamp must be in UTC""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + TIMESTAMP_FIELD_NUMBER: builtins.int TIMEZONE_OFFSET_FIELD_NUMBER: builtins.int timestamp: builtins.int timezone_offset: builtins.int - def __init__(self, + def __init__( + self, *, timestamp: builtins.int = ..., timezone_offset: builtins.int = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["timestamp",b"timestamp","timezone_offset",b"timezone_offset"]) -> None: ... + ) -> None: ... + def ClearField(self, field_name: typing.Literal["timestamp", b"timestamp", "timezone_offset", b"timezone_offset"]) -> None: ... + global___CreateBackupRequest = CreateBackupRequest +@typing.final class ListBackupsRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor - def __init__(self, - ) -> None: ... + + def __init__( + self, + ) -> None: ... + global___ListBackupsRequest = ListBackupsRequest +@typing.final class BackupInfo(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + ID_FIELD_NUMBER: builtins.int TIMESTAMP_FIELD_NUMBER: builtins.int NAME_FIELD_NUMBER: builtins.int - id: typing.Text + id: builtins.str timestamp: builtins.int - name: typing.Text + name: builtins.str """uint32 timezone_offset = 3;""" - - def __init__(self, + def __init__( + self, *, - id: typing.Text = ..., + id: builtins.str = ..., timestamp: builtins.int = ..., - name: typing.Text = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["id",b"id","name",b"name","timestamp",b"timestamp"]) -> None: ... + name: builtins.str = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["id", b"id", "name", b"name", "timestamp", b"timestamp"]) -> None: ... + global___BackupInfo = BackupInfo +@typing.final class ListBackupsResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + INFO_FIELD_NUMBER: builtins.int @property def info(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___BackupInfo]: ... - def __init__(self, + def __init__( + self, *, - info: typing.Optional[typing.Iterable[global___BackupInfo]] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["info",b"info"]) -> None: ... + info: collections.abc.Iterable[global___BackupInfo] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["info", b"info"]) -> None: ... + global___ListBackupsResponse = ListBackupsResponse +@typing.final class RestoreBackupRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + ID_FIELD_NUMBER: builtins.int TIMESTAMP_FIELD_NUMBER: builtins.int TIMEZONE_OFFSET_FIELD_NUMBER: builtins.int - id: typing.Text + id: builtins.str timestamp: builtins.int timezone_offset: builtins.int - def __init__(self, + def __init__( + self, *, - id: typing.Text = ..., + id: builtins.str = ..., timestamp: builtins.int = ..., timezone_offset: builtins.int = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["id",b"id","timestamp",b"timestamp","timezone_offset",b"timezone_offset"]) -> None: ... + ) -> None: ... + def ClearField(self, field_name: typing.Literal["id", b"id", "timestamp", b"timestamp", "timezone_offset", b"timezone_offset"]) -> None: ... + global___RestoreBackupRequest = RestoreBackupRequest diff --git a/hwilib/devices/bitbox02_lib/communication/generated/bitbox02_system_pb2.py b/hwilib/devices/bitbox02_lib/communication/generated/bitbox02_system_pb2.py index 4dbeb63fc..1b519c92c 100644 --- a/hwilib/devices/bitbox02_lib/communication/generated/bitbox02_system_pb2.py +++ b/hwilib/devices/bitbox02_lib/communication/generated/bitbox02_system_pb2.py @@ -13,7 +13,7 @@ -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15\x62itbox02_system.proto\x12\x14shiftcrypto.bitbox02\"\x14\n\x12\x43heckSDCardRequest\"\'\n\x13\x43heckSDCardResponse\x12\x10\n\x08inserted\x18\x01 \x01(\x08\"\x13\n\x11\x44\x65viceInfoRequest\"\xaf\x01\n\x12\x44\x65viceInfoResponse\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0binitialized\x18\x02 \x01(\x08\x12\x0f\n\x07version\x18\x03 \x01(\t\x12#\n\x1bmnemonic_passphrase_enabled\x18\x04 \x01(\x08\x12&\n\x1emonotonic_increments_remaining\x18\x05 \x01(\r\x12\x18\n\x10securechip_model\x18\x06 \x01(\t\"\x9b\x01\n\x19InsertRemoveSDCardRequest\x12L\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32<.shiftcrypto.bitbox02.InsertRemoveSDCardRequest.SDCardAction\"0\n\x0cSDCardAction\x12\x0f\n\x0bREMOVE_CARD\x10\x00\x12\x0f\n\x0bINSERT_CARD\x10\x01\"\x0e\n\x0cResetRequest\",\n\x18SetDeviceLanguageRequest\x12\x10\n\x08language\x18\x01 \x01(\t\"$\n\x14SetDeviceNameRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\"%\n\x12SetPasswordRequest\x12\x0f\n\x07\x65ntropy\x18\x01 \x01(\x0c\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15\x62itbox02_system.proto\x12\x14shiftcrypto.bitbox02\"\x14\n\x12\x43heckSDCardRequest\"\'\n\x13\x43heckSDCardResponse\x12\x10\n\x08inserted\x18\x01 \x01(\x08\"\x13\n\x11\x44\x65viceInfoRequest\"\xd8\x02\n\x12\x44\x65viceInfoResponse\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0binitialized\x18\x02 \x01(\x08\x12\x0f\n\x07version\x18\x03 \x01(\t\x12#\n\x1bmnemonic_passphrase_enabled\x18\x04 \x01(\x08\x12&\n\x1emonotonic_increments_remaining\x18\x05 \x01(\r\x12\x18\n\x10securechip_model\x18\x06 \x01(\t\x12J\n\tbluetooth\x18\x07 \x01(\x0b\x32\x32.shiftcrypto.bitbox02.DeviceInfoResponse.BluetoothH\x00\x88\x01\x01\x1aM\n\tBluetooth\x12\x15\n\rfirmware_hash\x18\x01 \x01(\x0c\x12\x18\n\x10\x66irmware_version\x18\x02 \x01(\t\x12\x0f\n\x07\x65nabled\x18\x03 \x01(\x08\x42\x0c\n\n_bluetooth\"\x9b\x01\n\x19InsertRemoveSDCardRequest\x12L\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32<.shiftcrypto.bitbox02.InsertRemoveSDCardRequest.SDCardAction\"0\n\x0cSDCardAction\x12\x0f\n\x0bREMOVE_CARD\x10\x00\x12\x0f\n\x0bINSERT_CARD\x10\x01\"\x0e\n\x0cResetRequest\",\n\x18SetDeviceLanguageRequest\x12\x10\n\x08language\x18\x01 \x01(\t\"$\n\x14SetDeviceNameRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\"%\n\x12SetPasswordRequest\x12\x0f\n\x07\x65ntropy\x18\x01 \x01(\x0c\x62\x06proto3') _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'bitbox02_system_pb2', globals()) @@ -27,17 +27,19 @@ _DEVICEINFOREQUEST._serialized_start=110 _DEVICEINFOREQUEST._serialized_end=129 _DEVICEINFORESPONSE._serialized_start=132 - _DEVICEINFORESPONSE._serialized_end=307 - _INSERTREMOVESDCARDREQUEST._serialized_start=310 - _INSERTREMOVESDCARDREQUEST._serialized_end=465 - _INSERTREMOVESDCARDREQUEST_SDCARDACTION._serialized_start=417 - _INSERTREMOVESDCARDREQUEST_SDCARDACTION._serialized_end=465 - _RESETREQUEST._serialized_start=467 - _RESETREQUEST._serialized_end=481 - _SETDEVICELANGUAGEREQUEST._serialized_start=483 - _SETDEVICELANGUAGEREQUEST._serialized_end=527 - _SETDEVICENAMEREQUEST._serialized_start=529 - _SETDEVICENAMEREQUEST._serialized_end=565 - _SETPASSWORDREQUEST._serialized_start=567 - _SETPASSWORDREQUEST._serialized_end=604 + _DEVICEINFORESPONSE._serialized_end=476 + _DEVICEINFORESPONSE_BLUETOOTH._serialized_start=385 + _DEVICEINFORESPONSE_BLUETOOTH._serialized_end=462 + _INSERTREMOVESDCARDREQUEST._serialized_start=479 + _INSERTREMOVESDCARDREQUEST._serialized_end=634 + _INSERTREMOVESDCARDREQUEST_SDCARDACTION._serialized_start=586 + _INSERTREMOVESDCARDREQUEST_SDCARDACTION._serialized_end=634 + _RESETREQUEST._serialized_start=636 + _RESETREQUEST._serialized_end=650 + _SETDEVICELANGUAGEREQUEST._serialized_start=652 + _SETDEVICELANGUAGEREQUEST._serialized_end=696 + _SETDEVICENAMEREQUEST._serialized_start=698 + _SETDEVICENAMEREQUEST._serialized_end=734 + _SETPASSWORDREQUEST._serialized_start=736 + _SETPASSWORDREQUEST._serialized_end=773 # @@protoc_insertion_point(module_scope) diff --git a/hwilib/devices/bitbox02_lib/communication/generated/bitbox02_system_pb2.pyi b/hwilib/devices/bitbox02_lib/communication/generated/bitbox02_system_pb2.pyi index 6b6829e2c..8591bfebe 100644 --- a/hwilib/devices/bitbox02_lib/communication/generated/bitbox02_system_pb2.pyi +++ b/hwilib/devices/bitbox02_lib/communication/generated/bitbox02_system_pb2.pyi @@ -1,126 +1,210 @@ """ @generated by mypy-protobuf. Do not edit manually! isort:skip_file +Copyright 2019 Shift Cryptosecurity AG + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. """ + import builtins import google.protobuf.descriptor import google.protobuf.internal.enum_type_wrapper import google.protobuf.message +import sys import typing -import typing_extensions + +if sys.version_info >= (3, 10): + import typing as typing_extensions +else: + import typing_extensions DESCRIPTOR: google.protobuf.descriptor.FileDescriptor +@typing.final class CheckSDCardRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor - def __init__(self, - ) -> None: ... + + def __init__( + self, + ) -> None: ... + global___CheckSDCardRequest = CheckSDCardRequest +@typing.final class CheckSDCardResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + INSERTED_FIELD_NUMBER: builtins.int inserted: builtins.bool - def __init__(self, + def __init__( + self, *, inserted: builtins.bool = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["inserted",b"inserted"]) -> None: ... + ) -> None: ... + def ClearField(self, field_name: typing.Literal["inserted", b"inserted"]) -> None: ... + global___CheckSDCardResponse = CheckSDCardResponse +@typing.final class DeviceInfoRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor - def __init__(self, - ) -> None: ... + + def __init__( + self, + ) -> None: ... + global___DeviceInfoRequest = DeviceInfoRequest +@typing.final class DeviceInfoResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + + @typing.final + class Bluetooth(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + FIRMWARE_HASH_FIELD_NUMBER: builtins.int + FIRMWARE_VERSION_FIELD_NUMBER: builtins.int + ENABLED_FIELD_NUMBER: builtins.int + firmware_hash: builtins.bytes + """Hash of the currently active Bluetooth firmware on the device.""" + firmware_version: builtins.str + """Firmware version, formated as "major.minor.patch".""" + enabled: builtins.bool + """True if Bluetooth is enabled""" + def __init__( + self, + *, + firmware_hash: builtins.bytes = ..., + firmware_version: builtins.str = ..., + enabled: builtins.bool = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["enabled", b"enabled", "firmware_hash", b"firmware_hash", "firmware_version", b"firmware_version"]) -> None: ... + NAME_FIELD_NUMBER: builtins.int INITIALIZED_FIELD_NUMBER: builtins.int VERSION_FIELD_NUMBER: builtins.int MNEMONIC_PASSPHRASE_ENABLED_FIELD_NUMBER: builtins.int MONOTONIC_INCREMENTS_REMAINING_FIELD_NUMBER: builtins.int SECURECHIP_MODEL_FIELD_NUMBER: builtins.int - name: typing.Text + BLUETOOTH_FIELD_NUMBER: builtins.int + name: builtins.str initialized: builtins.bool - version: typing.Text + version: builtins.str mnemonic_passphrase_enabled: builtins.bool monotonic_increments_remaining: builtins.int - securechip_model: typing.Text + securechip_model: builtins.str """From v9.6.0: "ATECC608A" or "ATECC608B".""" + @property + def bluetooth(self) -> global___DeviceInfoResponse.Bluetooth: + """Only present in Bluetooth-enabled devices.""" - def __init__(self, + def __init__( + self, *, - name: typing.Text = ..., + name: builtins.str = ..., initialized: builtins.bool = ..., - version: typing.Text = ..., + version: builtins.str = ..., mnemonic_passphrase_enabled: builtins.bool = ..., monotonic_increments_remaining: builtins.int = ..., - securechip_model: typing.Text = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["initialized",b"initialized","mnemonic_passphrase_enabled",b"mnemonic_passphrase_enabled","monotonic_increments_remaining",b"monotonic_increments_remaining","name",b"name","securechip_model",b"securechip_model","version",b"version"]) -> None: ... + securechip_model: builtins.str = ..., + bluetooth: global___DeviceInfoResponse.Bluetooth | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["_bluetooth", b"_bluetooth", "bluetooth", b"bluetooth"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["_bluetooth", b"_bluetooth", "bluetooth", b"bluetooth", "initialized", b"initialized", "mnemonic_passphrase_enabled", b"mnemonic_passphrase_enabled", "monotonic_increments_remaining", b"monotonic_increments_remaining", "name", b"name", "securechip_model", b"securechip_model", "version", b"version"]) -> None: ... + def WhichOneof(self, oneof_group: typing.Literal["_bluetooth", b"_bluetooth"]) -> typing.Literal["bluetooth"] | None: ... + global___DeviceInfoResponse = DeviceInfoResponse +@typing.final class InsertRemoveSDCardRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + class _SDCardAction: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType + class _SDCardActionEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[InsertRemoveSDCardRequest._SDCardAction.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor REMOVE_CARD: InsertRemoveSDCardRequest._SDCardAction.ValueType # 0 INSERT_CARD: InsertRemoveSDCardRequest._SDCardAction.ValueType # 1 - class SDCardAction(_SDCardAction, metaclass=_SDCardActionEnumTypeWrapper): - pass + class SDCardAction(_SDCardAction, metaclass=_SDCardActionEnumTypeWrapper): ... REMOVE_CARD: InsertRemoveSDCardRequest.SDCardAction.ValueType # 0 INSERT_CARD: InsertRemoveSDCardRequest.SDCardAction.ValueType # 1 ACTION_FIELD_NUMBER: builtins.int action: global___InsertRemoveSDCardRequest.SDCardAction.ValueType - def __init__(self, + def __init__( + self, *, action: global___InsertRemoveSDCardRequest.SDCardAction.ValueType = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["action",b"action"]) -> None: ... + ) -> None: ... + def ClearField(self, field_name: typing.Literal["action", b"action"]) -> None: ... + global___InsertRemoveSDCardRequest = InsertRemoveSDCardRequest +@typing.final class ResetRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor - def __init__(self, - ) -> None: ... + + def __init__( + self, + ) -> None: ... + global___ResetRequest = ResetRequest +@typing.final class SetDeviceLanguageRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + LANGUAGE_FIELD_NUMBER: builtins.int - language: typing.Text - def __init__(self, + language: builtins.str + def __init__( + self, *, - language: typing.Text = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["language",b"language"]) -> None: ... + language: builtins.str = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["language", b"language"]) -> None: ... + global___SetDeviceLanguageRequest = SetDeviceLanguageRequest +@typing.final class SetDeviceNameRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int - name: typing.Text - def __init__(self, + name: builtins.str + def __init__( + self, *, - name: typing.Text = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["name",b"name"]) -> None: ... + name: builtins.str = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["name", b"name"]) -> None: ... + global___SetDeviceNameRequest = SetDeviceNameRequest +@typing.final class SetPasswordRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + ENTROPY_FIELD_NUMBER: builtins.int entropy: builtins.bytes - def __init__(self, + def __init__( + self, *, entropy: builtins.bytes = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["entropy",b"entropy"]) -> None: ... + ) -> None: ... + def ClearField(self, field_name: typing.Literal["entropy", b"entropy"]) -> None: ... + global___SetPasswordRequest = SetPasswordRequest diff --git a/hwilib/devices/bitbox02_lib/communication/generated/bluetooth_pb2.py b/hwilib/devices/bitbox02_lib/communication/generated/bluetooth_pb2.py new file mode 100644 index 000000000..b68db7f1e --- /dev/null +++ b/hwilib/devices/bitbox02_lib/communication/generated/bluetooth_pb2.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: bluetooth.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0f\x62luetooth.proto\x12\x14shiftcrypto.bitbox02\"\x1f\n\x1d\x42luetoothToggleEnabledRequest\"6\n\x1b\x42luetoothUpgradeInitRequest\x12\x17\n\x0f\x66irmware_length\x18\x01 \x01(\r\"%\n\x15\x42luetoothChunkRequest\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\"\x12\n\x10\x42luetoothSuccess\"?\n\x1d\x42luetoothRequestChunkResponse\x12\x0e\n\x06offset\x18\x01 \x01(\r\x12\x0e\n\x06length\x18\x02 \x01(\r\"\xf5\x01\n\x10\x42luetoothRequest\x12I\n\x0cupgrade_init\x18\x01 \x01(\x0b\x32\x31.shiftcrypto.bitbox02.BluetoothUpgradeInitRequestH\x00\x12<\n\x05\x63hunk\x18\x02 \x01(\x0b\x32+.shiftcrypto.bitbox02.BluetoothChunkRequestH\x00\x12M\n\x0etoggle_enabled\x18\x03 \x01(\x0b\x32\x33.shiftcrypto.bitbox02.BluetoothToggleEnabledRequestH\x00\x42\t\n\x07request\"\xa8\x01\n\x11\x42luetoothResponse\x12\x39\n\x07success\x18\x01 \x01(\x0b\x32&.shiftcrypto.bitbox02.BluetoothSuccessH\x00\x12L\n\rrequest_chunk\x18\x02 \x01(\x0b\x32\x33.shiftcrypto.bitbox02.BluetoothRequestChunkResponseH\x00\x42\n\n\x08responseb\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'bluetooth_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + _BLUETOOTHTOGGLEENABLEDREQUEST._serialized_start=41 + _BLUETOOTHTOGGLEENABLEDREQUEST._serialized_end=72 + _BLUETOOTHUPGRADEINITREQUEST._serialized_start=74 + _BLUETOOTHUPGRADEINITREQUEST._serialized_end=128 + _BLUETOOTHCHUNKREQUEST._serialized_start=130 + _BLUETOOTHCHUNKREQUEST._serialized_end=167 + _BLUETOOTHSUCCESS._serialized_start=169 + _BLUETOOTHSUCCESS._serialized_end=187 + _BLUETOOTHREQUESTCHUNKRESPONSE._serialized_start=189 + _BLUETOOTHREQUESTCHUNKRESPONSE._serialized_end=252 + _BLUETOOTHREQUEST._serialized_start=255 + _BLUETOOTHREQUEST._serialized_end=500 + _BLUETOOTHRESPONSE._serialized_start=503 + _BLUETOOTHRESPONSE._serialized_end=671 +# @@protoc_insertion_point(module_scope) diff --git a/hwilib/devices/bitbox02_lib/communication/generated/btc_pb2.py b/hwilib/devices/bitbox02_lib/communication/generated/btc_pb2.py index f94d03b35..111d577b4 100644 --- a/hwilib/devices/bitbox02_lib/communication/generated/btc_pb2.py +++ b/hwilib/devices/bitbox02_lib/communication/generated/btc_pb2.py @@ -15,17 +15,17 @@ from . import antiklepto_pb2 as antiklepto__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\tbtc.proto\x12\x14shiftcrypto.bitbox02\x1a\x0c\x63ommon.proto\x1a\x10\x61ntiklepto.proto\"\xc6\x04\n\x0f\x42TCScriptConfig\x12G\n\x0bsimple_type\x18\x01 \x01(\x0e\x32\x30.shiftcrypto.bitbox02.BTCScriptConfig.SimpleTypeH\x00\x12\x42\n\x08multisig\x18\x02 \x01(\x0b\x32..shiftcrypto.bitbox02.BTCScriptConfig.MultisigH\x00\x12>\n\x06policy\x18\x03 \x01(\x0b\x32,.shiftcrypto.bitbox02.BTCScriptConfig.PolicyH\x00\x1a\xd9\x01\n\x08Multisig\x12\x11\n\tthreshold\x18\x01 \x01(\r\x12)\n\x05xpubs\x18\x02 \x03(\x0b\x32\x1a.shiftcrypto.bitbox02.XPub\x12\x16\n\x0eour_xpub_index\x18\x03 \x01(\r\x12N\n\x0bscript_type\x18\x04 \x01(\x0e\x32\x39.shiftcrypto.bitbox02.BTCScriptConfig.Multisig.ScriptType\"\'\n\nScriptType\x12\t\n\x05P2WSH\x10\x00\x12\x0e\n\nP2WSH_P2SH\x10\x01\x1aK\n\x06Policy\x12\x0e\n\x06policy\x18\x01 \x01(\t\x12\x31\n\x04keys\x18\x02 \x03(\x0b\x32#.shiftcrypto.bitbox02.KeyOriginInfo\"3\n\nSimpleType\x12\x0f\n\x0bP2WPKH_P2SH\x10\x00\x12\n\n\x06P2WPKH\x10\x01\x12\x08\n\x04P2TR\x10\x02\x42\x08\n\x06\x63onfig\"\xfc\x02\n\rBTCPubRequest\x12+\n\x04\x63oin\x18\x01 \x01(\x0e\x32\x1d.shiftcrypto.bitbox02.BTCCoin\x12\x0f\n\x07keypath\x18\x02 \x03(\r\x12\x41\n\txpub_type\x18\x03 \x01(\x0e\x32,.shiftcrypto.bitbox02.BTCPubRequest.XPubTypeH\x00\x12>\n\rscript_config\x18\x04 \x01(\x0b\x32%.shiftcrypto.bitbox02.BTCScriptConfigH\x00\x12\x0f\n\x07\x64isplay\x18\x05 \x01(\x08\"\x8e\x01\n\x08XPubType\x12\x08\n\x04TPUB\x10\x00\x12\x08\n\x04XPUB\x10\x01\x12\x08\n\x04YPUB\x10\x02\x12\x08\n\x04ZPUB\x10\x03\x12\x08\n\x04VPUB\x10\x04\x12\x08\n\x04UPUB\x10\x05\x12\x10\n\x0c\x43\x41PITAL_VPUB\x10\x06\x12\x10\n\x0c\x43\x41PITAL_ZPUB\x10\x07\x12\x10\n\x0c\x43\x41PITAL_UPUB\x10\x08\x12\x10\n\x0c\x43\x41PITAL_YPUB\x10\tB\x08\n\x06output\"k\n\x1a\x42TCScriptConfigWithKeypath\x12<\n\rscript_config\x18\x02 \x01(\x0b\x32%.shiftcrypto.bitbox02.BTCScriptConfig\x12\x0f\n\x07keypath\x18\x03 \x03(\r\"\xc5\x02\n\x12\x42TCSignInitRequest\x12+\n\x04\x63oin\x18\x01 \x01(\x0e\x32\x1d.shiftcrypto.bitbox02.BTCCoin\x12H\n\x0escript_configs\x18\x02 \x03(\x0b\x32\x30.shiftcrypto.bitbox02.BTCScriptConfigWithKeypath\x12\x0f\n\x07version\x18\x04 \x01(\r\x12\x12\n\nnum_inputs\x18\x05 \x01(\r\x12\x13\n\x0bnum_outputs\x18\x06 \x01(\r\x12\x10\n\x08locktime\x18\x07 \x01(\r\x12H\n\x0b\x66ormat_unit\x18\x08 \x01(\x0e\x32\x33.shiftcrypto.bitbox02.BTCSignInitRequest.FormatUnit\"\"\n\nFormatUnit\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10\x00\x12\x07\n\x03SAT\x10\x01\"\xe8\x02\n\x13\x42TCSignNextResponse\x12<\n\x04type\x18\x01 \x01(\x0e\x32..shiftcrypto.bitbox02.BTCSignNextResponse.Type\x12\r\n\x05index\x18\x02 \x01(\r\x12\x15\n\rhas_signature\x18\x03 \x01(\x08\x12\x11\n\tsignature\x18\x04 \x01(\x0c\x12\x12\n\nprev_index\x18\x05 \x01(\r\x12W\n\x1d\x61nti_klepto_signer_commitment\x18\x06 \x01(\x0b\x32\x30.shiftcrypto.bitbox02.AntiKleptoSignerCommitment\"m\n\x04Type\x12\t\n\x05INPUT\x10\x00\x12\n\n\x06OUTPUT\x10\x01\x12\x08\n\x04\x44ONE\x10\x02\x12\x0f\n\x0bPREVTX_INIT\x10\x03\x12\x10\n\x0cPREVTX_INPUT\x10\x04\x12\x11\n\rPREVTX_OUTPUT\x10\x05\x12\x0e\n\nHOST_NONCE\x10\x06\"\xea\x01\n\x13\x42TCSignInputRequest\x12\x13\n\x0bprevOutHash\x18\x01 \x01(\x0c\x12\x14\n\x0cprevOutIndex\x18\x02 \x01(\r\x12\x14\n\x0cprevOutValue\x18\x03 \x01(\x04\x12\x10\n\x08sequence\x18\x04 \x01(\r\x12\x0f\n\x07keypath\x18\x06 \x03(\r\x12\x1b\n\x13script_config_index\x18\x07 \x01(\r\x12R\n\x15host_nonce_commitment\x18\x08 \x01(\x0b\x32\x33.shiftcrypto.bitbox02.AntiKleptoHostNonceCommitment\"\xa5\x01\n\x14\x42TCSignOutputRequest\x12\x0c\n\x04ours\x18\x01 \x01(\x08\x12\x31\n\x04type\x18\x02 \x01(\x0e\x32#.shiftcrypto.bitbox02.BTCOutputType\x12\r\n\x05value\x18\x03 \x01(\x04\x12\x0f\n\x07payload\x18\x04 \x01(\x0c\x12\x0f\n\x07keypath\x18\x05 \x03(\r\x12\x1b\n\x13script_config_index\x18\x06 \x01(\r\"\x99\x01\n\x1b\x42TCScriptConfigRegistration\x12+\n\x04\x63oin\x18\x01 \x01(\x0e\x32\x1d.shiftcrypto.bitbox02.BTCCoin\x12<\n\rscript_config\x18\x02 \x01(\x0b\x32%.shiftcrypto.bitbox02.BTCScriptConfig\x12\x0f\n\x07keypath\x18\x03 \x03(\r\"\x0c\n\nBTCSuccess\"m\n\"BTCIsScriptConfigRegisteredRequest\x12G\n\x0cregistration\x18\x01 \x01(\x0b\x32\x31.shiftcrypto.bitbox02.BTCScriptConfigRegistration\"<\n#BTCIsScriptConfigRegisteredResponse\x12\x15\n\ris_registered\x18\x01 \x01(\x08\"\xfc\x01\n\x1e\x42TCRegisterScriptConfigRequest\x12G\n\x0cregistration\x18\x01 \x01(\x0b\x32\x31.shiftcrypto.bitbox02.BTCScriptConfigRegistration\x12\x0c\n\x04name\x18\x02 \x01(\t\x12P\n\txpub_type\x18\x03 \x01(\x0e\x32=.shiftcrypto.bitbox02.BTCRegisterScriptConfigRequest.XPubType\"1\n\x08XPubType\x12\x11\n\rAUTO_ELECTRUM\x10\x00\x12\x12\n\x0e\x41UTO_XPUB_TPUB\x10\x01\"b\n\x14\x42TCPrevTxInitRequest\x12\x0f\n\x07version\x18\x01 \x01(\r\x12\x12\n\nnum_inputs\x18\x02 \x01(\r\x12\x13\n\x0bnum_outputs\x18\x03 \x01(\r\x12\x10\n\x08locktime\x18\x04 \x01(\r\"r\n\x15\x42TCPrevTxInputRequest\x12\x15\n\rprev_out_hash\x18\x01 \x01(\x0c\x12\x16\n\x0eprev_out_index\x18\x02 \x01(\r\x12\x18\n\x10signature_script\x18\x03 \x01(\x0c\x12\x10\n\x08sequence\x18\x04 \x01(\r\">\n\x16\x42TCPrevTxOutputRequest\x12\r\n\x05value\x18\x01 \x01(\x04\x12\x15\n\rpubkey_script\x18\x02 \x01(\x0c\"\xee\x01\n\x15\x42TCSignMessageRequest\x12+\n\x04\x63oin\x18\x01 \x01(\x0e\x32\x1d.shiftcrypto.bitbox02.BTCCoin\x12G\n\rscript_config\x18\x02 \x01(\x0b\x32\x30.shiftcrypto.bitbox02.BTCScriptConfigWithKeypath\x12\x0b\n\x03msg\x18\x03 \x01(\x0c\x12R\n\x15host_nonce_commitment\x18\x04 \x01(\x0b\x32\x33.shiftcrypto.bitbox02.AntiKleptoHostNonceCommitment\"+\n\x16\x42TCSignMessageResponse\x12\x11\n\tsignature\x18\x01 \x01(\x0c\"\xb6\x04\n\nBTCRequest\x12_\n\x1bis_script_config_registered\x18\x01 \x01(\x0b\x32\x38.shiftcrypto.bitbox02.BTCIsScriptConfigRegisteredRequestH\x00\x12V\n\x16register_script_config\x18\x02 \x01(\x0b\x32\x34.shiftcrypto.bitbox02.BTCRegisterScriptConfigRequestH\x00\x12\x41\n\x0bprevtx_init\x18\x03 \x01(\x0b\x32*.shiftcrypto.bitbox02.BTCPrevTxInitRequestH\x00\x12\x43\n\x0cprevtx_input\x18\x04 \x01(\x0b\x32+.shiftcrypto.bitbox02.BTCPrevTxInputRequestH\x00\x12\x45\n\rprevtx_output\x18\x05 \x01(\x0b\x32,.shiftcrypto.bitbox02.BTCPrevTxOutputRequestH\x00\x12\x43\n\x0csign_message\x18\x06 \x01(\x0b\x32+.shiftcrypto.bitbox02.BTCSignMessageRequestH\x00\x12P\n\x14\x61ntiklepto_signature\x18\x07 \x01(\x0b\x32\x30.shiftcrypto.bitbox02.AntiKleptoSignatureRequestH\x00\x42\t\n\x07request\"\x90\x03\n\x0b\x42TCResponse\x12\x33\n\x07success\x18\x01 \x01(\x0b\x32 .shiftcrypto.bitbox02.BTCSuccessH\x00\x12`\n\x1bis_script_config_registered\x18\x02 \x01(\x0b\x32\x39.shiftcrypto.bitbox02.BTCIsScriptConfigRegisteredResponseH\x00\x12>\n\tsign_next\x18\x03 \x01(\x0b\x32).shiftcrypto.bitbox02.BTCSignNextResponseH\x00\x12\x44\n\x0csign_message\x18\x04 \x01(\x0b\x32,.shiftcrypto.bitbox02.BTCSignMessageResponseH\x00\x12X\n\x1c\x61ntiklepto_signer_commitment\x18\x05 \x01(\x0b\x32\x30.shiftcrypto.bitbox02.AntiKleptoSignerCommitmentH\x00\x42\n\n\x08response*/\n\x07\x42TCCoin\x12\x07\n\x03\x42TC\x10\x00\x12\x08\n\x04TBTC\x10\x01\x12\x07\n\x03LTC\x10\x02\x12\x08\n\x04TLTC\x10\x03*R\n\rBTCOutputType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\t\n\x05P2PKH\x10\x01\x12\x08\n\x04P2SH\x10\x02\x12\n\n\x06P2WPKH\x10\x03\x12\t\n\x05P2WSH\x10\x04\x12\x08\n\x04P2TR\x10\x05\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\tbtc.proto\x12\x14shiftcrypto.bitbox02\x1a\x0c\x63ommon.proto\x1a\x10\x61ntiklepto.proto\"\xc6\x04\n\x0f\x42TCScriptConfig\x12G\n\x0bsimple_type\x18\x01 \x01(\x0e\x32\x30.shiftcrypto.bitbox02.BTCScriptConfig.SimpleTypeH\x00\x12\x42\n\x08multisig\x18\x02 \x01(\x0b\x32..shiftcrypto.bitbox02.BTCScriptConfig.MultisigH\x00\x12>\n\x06policy\x18\x03 \x01(\x0b\x32,.shiftcrypto.bitbox02.BTCScriptConfig.PolicyH\x00\x1a\xd9\x01\n\x08Multisig\x12\x11\n\tthreshold\x18\x01 \x01(\r\x12)\n\x05xpubs\x18\x02 \x03(\x0b\x32\x1a.shiftcrypto.bitbox02.XPub\x12\x16\n\x0eour_xpub_index\x18\x03 \x01(\r\x12N\n\x0bscript_type\x18\x04 \x01(\x0e\x32\x39.shiftcrypto.bitbox02.BTCScriptConfig.Multisig.ScriptType\"\'\n\nScriptType\x12\t\n\x05P2WSH\x10\x00\x12\x0e\n\nP2WSH_P2SH\x10\x01\x1aK\n\x06Policy\x12\x0e\n\x06policy\x18\x01 \x01(\t\x12\x31\n\x04keys\x18\x02 \x03(\x0b\x32#.shiftcrypto.bitbox02.KeyOriginInfo\"3\n\nSimpleType\x12\x0f\n\x0bP2WPKH_P2SH\x10\x00\x12\n\n\x06P2WPKH\x10\x01\x12\x08\n\x04P2TR\x10\x02\x42\x08\n\x06\x63onfig\"\xfc\x02\n\rBTCPubRequest\x12+\n\x04\x63oin\x18\x01 \x01(\x0e\x32\x1d.shiftcrypto.bitbox02.BTCCoin\x12\x0f\n\x07keypath\x18\x02 \x03(\r\x12\x41\n\txpub_type\x18\x03 \x01(\x0e\x32,.shiftcrypto.bitbox02.BTCPubRequest.XPubTypeH\x00\x12>\n\rscript_config\x18\x04 \x01(\x0b\x32%.shiftcrypto.bitbox02.BTCScriptConfigH\x00\x12\x0f\n\x07\x64isplay\x18\x05 \x01(\x08\"\x8e\x01\n\x08XPubType\x12\x08\n\x04TPUB\x10\x00\x12\x08\n\x04XPUB\x10\x01\x12\x08\n\x04YPUB\x10\x02\x12\x08\n\x04ZPUB\x10\x03\x12\x08\n\x04VPUB\x10\x04\x12\x08\n\x04UPUB\x10\x05\x12\x10\n\x0c\x43\x41PITAL_VPUB\x10\x06\x12\x10\n\x0c\x43\x41PITAL_ZPUB\x10\x07\x12\x10\n\x0c\x43\x41PITAL_UPUB\x10\x08\x12\x10\n\x0c\x43\x41PITAL_YPUB\x10\tB\x08\n\x06output\"k\n\x1a\x42TCScriptConfigWithKeypath\x12<\n\rscript_config\x18\x02 \x01(\x0b\x32%.shiftcrypto.bitbox02.BTCScriptConfig\x12\x0f\n\x07keypath\x18\x03 \x03(\r\"\xbf\x03\n\x12\x42TCSignInitRequest\x12+\n\x04\x63oin\x18\x01 \x01(\x0e\x32\x1d.shiftcrypto.bitbox02.BTCCoin\x12H\n\x0escript_configs\x18\x02 \x03(\x0b\x32\x30.shiftcrypto.bitbox02.BTCScriptConfigWithKeypath\x12\x0f\n\x07version\x18\x04 \x01(\r\x12\x12\n\nnum_inputs\x18\x05 \x01(\r\x12\x13\n\x0bnum_outputs\x18\x06 \x01(\r\x12\x10\n\x08locktime\x18\x07 \x01(\r\x12H\n\x0b\x66ormat_unit\x18\x08 \x01(\x0e\x32\x33.shiftcrypto.bitbox02.BTCSignInitRequest.FormatUnit\x12\'\n\x1f\x63ontains_silent_payment_outputs\x18\t \x01(\x08\x12O\n\x15output_script_configs\x18\n \x03(\x0b\x32\x30.shiftcrypto.bitbox02.BTCScriptConfigWithKeypath\"\"\n\nFormatUnit\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10\x00\x12\x07\n\x03SAT\x10\x01\"\xc4\x03\n\x13\x42TCSignNextResponse\x12<\n\x04type\x18\x01 \x01(\x0e\x32..shiftcrypto.bitbox02.BTCSignNextResponse.Type\x12\r\n\x05index\x18\x02 \x01(\r\x12\x15\n\rhas_signature\x18\x03 \x01(\x08\x12\x11\n\tsignature\x18\x04 \x01(\x0c\x12\x12\n\nprev_index\x18\x05 \x01(\r\x12W\n\x1d\x61nti_klepto_signer_commitment\x18\x06 \x01(\x0b\x32\x30.shiftcrypto.bitbox02.AntiKleptoSignerCommitment\x12!\n\x19generated_output_pkscript\x18\x07 \x01(\x0c\x12!\n\x19silent_payment_dleq_proof\x18\x08 \x01(\x0c\"\x82\x01\n\x04Type\x12\t\n\x05INPUT\x10\x00\x12\n\n\x06OUTPUT\x10\x01\x12\x08\n\x04\x44ONE\x10\x02\x12\x0f\n\x0bPREVTX_INIT\x10\x03\x12\x10\n\x0cPREVTX_INPUT\x10\x04\x12\x11\n\rPREVTX_OUTPUT\x10\x05\x12\x0e\n\nHOST_NONCE\x10\x06\x12\x13\n\x0fPAYMENT_REQUEST\x10\x07\"\xea\x01\n\x13\x42TCSignInputRequest\x12\x13\n\x0bprevOutHash\x18\x01 \x01(\x0c\x12\x14\n\x0cprevOutIndex\x18\x02 \x01(\r\x12\x14\n\x0cprevOutValue\x18\x03 \x01(\x04\x12\x10\n\x08sequence\x18\x04 \x01(\r\x12\x0f\n\x07keypath\x18\x06 \x03(\r\x12\x1b\n\x13script_config_index\x18\x07 \x01(\r\x12R\n\x15host_nonce_commitment\x18\x08 \x01(\x0b\x32\x33.shiftcrypto.bitbox02.AntiKleptoHostNonceCommitment\"\x9f\x03\n\x14\x42TCSignOutputRequest\x12\x0c\n\x04ours\x18\x01 \x01(\x08\x12\x31\n\x04type\x18\x02 \x01(\x0e\x32#.shiftcrypto.bitbox02.BTCOutputType\x12\r\n\x05value\x18\x03 \x01(\x04\x12\x0f\n\x07payload\x18\x04 \x01(\x0c\x12\x0f\n\x07keypath\x18\x05 \x03(\r\x12\x1b\n\x13script_config_index\x18\x06 \x01(\r\x12\"\n\x15payment_request_index\x18\x07 \x01(\rH\x00\x88\x01\x01\x12P\n\x0esilent_payment\x18\x08 \x01(\x0b\x32\x38.shiftcrypto.bitbox02.BTCSignOutputRequest.SilentPayment\x12\'\n\x1aoutput_script_config_index\x18\t \x01(\rH\x01\x88\x01\x01\x1a \n\rSilentPayment\x12\x0f\n\x07\x61\x64\x64ress\x18\x01 \x01(\tB\x18\n\x16_payment_request_indexB\x1d\n\x1b_output_script_config_index\"\x99\x01\n\x1b\x42TCScriptConfigRegistration\x12+\n\x04\x63oin\x18\x01 \x01(\x0e\x32\x1d.shiftcrypto.bitbox02.BTCCoin\x12<\n\rscript_config\x18\x02 \x01(\x0b\x32%.shiftcrypto.bitbox02.BTCScriptConfig\x12\x0f\n\x07keypath\x18\x03 \x03(\r\"\x0c\n\nBTCSuccess\"m\n\"BTCIsScriptConfigRegisteredRequest\x12G\n\x0cregistration\x18\x01 \x01(\x0b\x32\x31.shiftcrypto.bitbox02.BTCScriptConfigRegistration\"<\n#BTCIsScriptConfigRegisteredResponse\x12\x15\n\ris_registered\x18\x01 \x01(\x08\"\xfc\x01\n\x1e\x42TCRegisterScriptConfigRequest\x12G\n\x0cregistration\x18\x01 \x01(\x0b\x32\x31.shiftcrypto.bitbox02.BTCScriptConfigRegistration\x12\x0c\n\x04name\x18\x02 \x01(\t\x12P\n\txpub_type\x18\x03 \x01(\x0e\x32=.shiftcrypto.bitbox02.BTCRegisterScriptConfigRequest.XPubType\"1\n\x08XPubType\x12\x11\n\rAUTO_ELECTRUM\x10\x00\x12\x12\n\x0e\x41UTO_XPUB_TPUB\x10\x01\"b\n\x14\x42TCPrevTxInitRequest\x12\x0f\n\x07version\x18\x01 \x01(\r\x12\x12\n\nnum_inputs\x18\x02 \x01(\r\x12\x13\n\x0bnum_outputs\x18\x03 \x01(\r\x12\x10\n\x08locktime\x18\x04 \x01(\r\"r\n\x15\x42TCPrevTxInputRequest\x12\x15\n\rprev_out_hash\x18\x01 \x01(\x0c\x12\x16\n\x0eprev_out_index\x18\x02 \x01(\r\x12\x18\n\x10signature_script\x18\x03 \x01(\x0c\x12\x10\n\x08sequence\x18\x04 \x01(\r\">\n\x16\x42TCPrevTxOutputRequest\x12\r\n\x05value\x18\x01 \x01(\x04\x12\x15\n\rpubkey_script\x18\x02 \x01(\x0c\"\xab\x02\n\x18\x42TCPaymentRequestRequest\x12\x16\n\x0erecipient_name\x18\x01 \x01(\t\x12\x42\n\x05memos\x18\x02 \x03(\x0b\x32\x33.shiftcrypto.bitbox02.BTCPaymentRequestRequest.Memo\x12\r\n\x05nonce\x18\x03 \x01(\x0c\x12\x14\n\x0ctotal_amount\x18\x04 \x01(\x04\x12\x11\n\tsignature\x18\x05 \x01(\x0c\x1a{\n\x04Memo\x12Q\n\ttext_memo\x18\x01 \x01(\x0b\x32<.shiftcrypto.bitbox02.BTCPaymentRequestRequest.Memo.TextMemoH\x00\x1a\x18\n\x08TextMemo\x12\x0c\n\x04note\x18\x01 \x01(\tB\x06\n\x04memo\"\xee\x01\n\x15\x42TCSignMessageRequest\x12+\n\x04\x63oin\x18\x01 \x01(\x0e\x32\x1d.shiftcrypto.bitbox02.BTCCoin\x12G\n\rscript_config\x18\x02 \x01(\x0b\x32\x30.shiftcrypto.bitbox02.BTCScriptConfigWithKeypath\x12\x0b\n\x03msg\x18\x03 \x01(\x0c\x12R\n\x15host_nonce_commitment\x18\x04 \x01(\x0b\x32\x33.shiftcrypto.bitbox02.AntiKleptoHostNonceCommitment\"+\n\x16\x42TCSignMessageResponse\x12\x11\n\tsignature\x18\x01 \x01(\x0c\"\x81\x05\n\nBTCRequest\x12_\n\x1bis_script_config_registered\x18\x01 \x01(\x0b\x32\x38.shiftcrypto.bitbox02.BTCIsScriptConfigRegisteredRequestH\x00\x12V\n\x16register_script_config\x18\x02 \x01(\x0b\x32\x34.shiftcrypto.bitbox02.BTCRegisterScriptConfigRequestH\x00\x12\x41\n\x0bprevtx_init\x18\x03 \x01(\x0b\x32*.shiftcrypto.bitbox02.BTCPrevTxInitRequestH\x00\x12\x43\n\x0cprevtx_input\x18\x04 \x01(\x0b\x32+.shiftcrypto.bitbox02.BTCPrevTxInputRequestH\x00\x12\x45\n\rprevtx_output\x18\x05 \x01(\x0b\x32,.shiftcrypto.bitbox02.BTCPrevTxOutputRequestH\x00\x12\x43\n\x0csign_message\x18\x06 \x01(\x0b\x32+.shiftcrypto.bitbox02.BTCSignMessageRequestH\x00\x12P\n\x14\x61ntiklepto_signature\x18\x07 \x01(\x0b\x32\x30.shiftcrypto.bitbox02.AntiKleptoSignatureRequestH\x00\x12I\n\x0fpayment_request\x18\x08 \x01(\x0b\x32..shiftcrypto.bitbox02.BTCPaymentRequestRequestH\x00\x42\t\n\x07request\"\x90\x03\n\x0b\x42TCResponse\x12\x33\n\x07success\x18\x01 \x01(\x0b\x32 .shiftcrypto.bitbox02.BTCSuccessH\x00\x12`\n\x1bis_script_config_registered\x18\x02 \x01(\x0b\x32\x39.shiftcrypto.bitbox02.BTCIsScriptConfigRegisteredResponseH\x00\x12>\n\tsign_next\x18\x03 \x01(\x0b\x32).shiftcrypto.bitbox02.BTCSignNextResponseH\x00\x12\x44\n\x0csign_message\x18\x04 \x01(\x0b\x32,.shiftcrypto.bitbox02.BTCSignMessageResponseH\x00\x12X\n\x1c\x61ntiklepto_signer_commitment\x18\x05 \x01(\x0b\x32\x30.shiftcrypto.bitbox02.AntiKleptoSignerCommitmentH\x00\x42\n\n\x08response*9\n\x07\x42TCCoin\x12\x07\n\x03\x42TC\x10\x00\x12\x08\n\x04TBTC\x10\x01\x12\x07\n\x03LTC\x10\x02\x12\x08\n\x04TLTC\x10\x03\x12\x08\n\x04RBTC\x10\x04*R\n\rBTCOutputType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\t\n\x05P2PKH\x10\x01\x12\x08\n\x04P2SH\x10\x02\x12\n\n\x06P2WPKH\x10\x03\x12\t\n\x05P2WSH\x10\x04\x12\x08\n\x04P2TR\x10\x05\x62\x06proto3') _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'btc_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None - _BTCCOIN._serialized_start=4376 - _BTCCOIN._serialized_end=4423 - _BTCOUTPUTTYPE._serialized_start=4425 - _BTCOUTPUTTYPE._serialized_end=4507 + _BTCCOIN._serialized_start=5217 + _BTCCOIN._serialized_end=5274 + _BTCOUTPUTTYPE._serialized_start=5276 + _BTCOUTPUTTYPE._serialized_end=5358 _BTCSCRIPTCONFIG._serialized_start=68 _BTCSCRIPTCONFIG._serialized_end=650 _BTCSCRIPTCONFIG_MULTISIG._serialized_start=293 @@ -43,41 +43,49 @@ _BTCSCRIPTCONFIGWITHKEYPATH._serialized_start=1035 _BTCSCRIPTCONFIGWITHKEYPATH._serialized_end=1142 _BTCSIGNINITREQUEST._serialized_start=1145 - _BTCSIGNINITREQUEST._serialized_end=1470 - _BTCSIGNINITREQUEST_FORMATUNIT._serialized_start=1436 - _BTCSIGNINITREQUEST_FORMATUNIT._serialized_end=1470 - _BTCSIGNNEXTRESPONSE._serialized_start=1473 - _BTCSIGNNEXTRESPONSE._serialized_end=1833 - _BTCSIGNNEXTRESPONSE_TYPE._serialized_start=1724 - _BTCSIGNNEXTRESPONSE_TYPE._serialized_end=1833 - _BTCSIGNINPUTREQUEST._serialized_start=1836 - _BTCSIGNINPUTREQUEST._serialized_end=2070 - _BTCSIGNOUTPUTREQUEST._serialized_start=2073 - _BTCSIGNOUTPUTREQUEST._serialized_end=2238 - _BTCSCRIPTCONFIGREGISTRATION._serialized_start=2241 - _BTCSCRIPTCONFIGREGISTRATION._serialized_end=2394 - _BTCSUCCESS._serialized_start=2396 - _BTCSUCCESS._serialized_end=2408 - _BTCISSCRIPTCONFIGREGISTEREDREQUEST._serialized_start=2410 - _BTCISSCRIPTCONFIGREGISTEREDREQUEST._serialized_end=2519 - _BTCISSCRIPTCONFIGREGISTEREDRESPONSE._serialized_start=2521 - _BTCISSCRIPTCONFIGREGISTEREDRESPONSE._serialized_end=2581 - _BTCREGISTERSCRIPTCONFIGREQUEST._serialized_start=2584 - _BTCREGISTERSCRIPTCONFIGREQUEST._serialized_end=2836 - _BTCREGISTERSCRIPTCONFIGREQUEST_XPUBTYPE._serialized_start=2787 - _BTCREGISTERSCRIPTCONFIGREQUEST_XPUBTYPE._serialized_end=2836 - _BTCPREVTXINITREQUEST._serialized_start=2838 - _BTCPREVTXINITREQUEST._serialized_end=2936 - _BTCPREVTXINPUTREQUEST._serialized_start=2938 - _BTCPREVTXINPUTREQUEST._serialized_end=3052 - _BTCPREVTXOUTPUTREQUEST._serialized_start=3054 - _BTCPREVTXOUTPUTREQUEST._serialized_end=3116 - _BTCSIGNMESSAGEREQUEST._serialized_start=3119 - _BTCSIGNMESSAGEREQUEST._serialized_end=3357 - _BTCSIGNMESSAGERESPONSE._serialized_start=3359 - _BTCSIGNMESSAGERESPONSE._serialized_end=3402 - _BTCREQUEST._serialized_start=3405 - _BTCREQUEST._serialized_end=3971 - _BTCRESPONSE._serialized_start=3974 - _BTCRESPONSE._serialized_end=4374 + _BTCSIGNINITREQUEST._serialized_end=1592 + _BTCSIGNINITREQUEST_FORMATUNIT._serialized_start=1558 + _BTCSIGNINITREQUEST_FORMATUNIT._serialized_end=1592 + _BTCSIGNNEXTRESPONSE._serialized_start=1595 + _BTCSIGNNEXTRESPONSE._serialized_end=2047 + _BTCSIGNNEXTRESPONSE_TYPE._serialized_start=1917 + _BTCSIGNNEXTRESPONSE_TYPE._serialized_end=2047 + _BTCSIGNINPUTREQUEST._serialized_start=2050 + _BTCSIGNINPUTREQUEST._serialized_end=2284 + _BTCSIGNOUTPUTREQUEST._serialized_start=2287 + _BTCSIGNOUTPUTREQUEST._serialized_end=2702 + _BTCSIGNOUTPUTREQUEST_SILENTPAYMENT._serialized_start=2613 + _BTCSIGNOUTPUTREQUEST_SILENTPAYMENT._serialized_end=2645 + _BTCSCRIPTCONFIGREGISTRATION._serialized_start=2705 + _BTCSCRIPTCONFIGREGISTRATION._serialized_end=2858 + _BTCSUCCESS._serialized_start=2860 + _BTCSUCCESS._serialized_end=2872 + _BTCISSCRIPTCONFIGREGISTEREDREQUEST._serialized_start=2874 + _BTCISSCRIPTCONFIGREGISTEREDREQUEST._serialized_end=2983 + _BTCISSCRIPTCONFIGREGISTEREDRESPONSE._serialized_start=2985 + _BTCISSCRIPTCONFIGREGISTEREDRESPONSE._serialized_end=3045 + _BTCREGISTERSCRIPTCONFIGREQUEST._serialized_start=3048 + _BTCREGISTERSCRIPTCONFIGREQUEST._serialized_end=3300 + _BTCREGISTERSCRIPTCONFIGREQUEST_XPUBTYPE._serialized_start=3251 + _BTCREGISTERSCRIPTCONFIGREQUEST_XPUBTYPE._serialized_end=3300 + _BTCPREVTXINITREQUEST._serialized_start=3302 + _BTCPREVTXINITREQUEST._serialized_end=3400 + _BTCPREVTXINPUTREQUEST._serialized_start=3402 + _BTCPREVTXINPUTREQUEST._serialized_end=3516 + _BTCPREVTXOUTPUTREQUEST._serialized_start=3518 + _BTCPREVTXOUTPUTREQUEST._serialized_end=3580 + _BTCPAYMENTREQUESTREQUEST._serialized_start=3583 + _BTCPAYMENTREQUESTREQUEST._serialized_end=3882 + _BTCPAYMENTREQUESTREQUEST_MEMO._serialized_start=3759 + _BTCPAYMENTREQUESTREQUEST_MEMO._serialized_end=3882 + _BTCPAYMENTREQUESTREQUEST_MEMO_TEXTMEMO._serialized_start=3850 + _BTCPAYMENTREQUESTREQUEST_MEMO_TEXTMEMO._serialized_end=3874 + _BTCSIGNMESSAGEREQUEST._serialized_start=3885 + _BTCSIGNMESSAGEREQUEST._serialized_end=4123 + _BTCSIGNMESSAGERESPONSE._serialized_start=4125 + _BTCSIGNMESSAGERESPONSE._serialized_end=4168 + _BTCREQUEST._serialized_start=4171 + _BTCREQUEST._serialized_end=4812 + _BTCRESPONSE._serialized_start=4815 + _BTCRESPONSE._serialized_end=5215 # @@protoc_insertion_point(module_scope) diff --git a/hwilib/devices/bitbox02_lib/communication/generated/btc_pb2.pyi b/hwilib/devices/bitbox02_lib/communication/generated/btc_pb2.pyi index 4cb1dc3f9..acf1f548d 100644 --- a/hwilib/devices/bitbox02_lib/communication/generated/btc_pb2.pyi +++ b/hwilib/devices/bitbox02_lib/communication/generated/btc_pb2.pyi @@ -1,41 +1,67 @@ """ @generated by mypy-protobuf. Do not edit manually! isort:skip_file +Copyright 2019 Shift Cryptosecurity AG +Copyright 2020 Shift Crypto AG + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. """ + from . import antiklepto_pb2 import builtins +import collections.abc from . import common_pb2 import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message +import sys import typing -import typing_extensions + +if sys.version_info >= (3, 10): + import typing as typing_extensions +else: + import typing_extensions DESCRIPTOR: google.protobuf.descriptor.FileDescriptor class _BTCCoin: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType + class _BTCCoinEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_BTCCoin.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor BTC: _BTCCoin.ValueType # 0 TBTC: _BTCCoin.ValueType # 1 LTC: _BTCCoin.ValueType # 2 TLTC: _BTCCoin.ValueType # 3 -class BTCCoin(_BTCCoin, metaclass=_BTCCoinEnumTypeWrapper): - pass + RBTC: _BTCCoin.ValueType # 4 + """Regtest""" + +class BTCCoin(_BTCCoin, metaclass=_BTCCoinEnumTypeWrapper): ... BTC: BTCCoin.ValueType # 0 TBTC: BTCCoin.ValueType # 1 LTC: BTCCoin.ValueType # 2 TLTC: BTCCoin.ValueType # 3 +RBTC: BTCCoin.ValueType # 4 +"""Regtest""" global___BTCCoin = BTCCoin - class _BTCOutputType: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType + class _BTCOutputTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_BTCOutputType.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor UNKNOWN: _BTCOutputType.ValueType # 0 @@ -44,8 +70,8 @@ class _BTCOutputTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._ P2WPKH: _BTCOutputType.ValueType # 3 P2WSH: _BTCOutputType.ValueType # 4 P2TR: _BTCOutputType.ValueType # 5 -class BTCOutputType(_BTCOutputType, metaclass=_BTCOutputTypeEnumTypeWrapper): - pass + +class BTCOutputType(_BTCOutputType, metaclass=_BTCOutputTypeEnumTypeWrapper): ... UNKNOWN: BTCOutputType.ValueType # 0 P2PKH: BTCOutputType.ValueType # 1 @@ -55,90 +81,94 @@ P2WSH: BTCOutputType.ValueType # 4 P2TR: BTCOutputType.ValueType # 5 global___BTCOutputType = BTCOutputType - +@typing.final class BTCScriptConfig(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + class _SimpleType: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType + class _SimpleTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[BTCScriptConfig._SimpleType.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor P2WPKH_P2SH: BTCScriptConfig._SimpleType.ValueType # 0 P2WPKH: BTCScriptConfig._SimpleType.ValueType # 1 P2TR: BTCScriptConfig._SimpleType.ValueType # 2 + class SimpleType(_SimpleType, metaclass=_SimpleTypeEnumTypeWrapper): """SimpleType is a "simple" script: one public key, no additional inputs.""" - pass P2WPKH_P2SH: BTCScriptConfig.SimpleType.ValueType # 0 P2WPKH: BTCScriptConfig.SimpleType.ValueType # 1 P2TR: BTCScriptConfig.SimpleType.ValueType # 2 + @typing.final class Multisig(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + class _ScriptType: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType + class _ScriptTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[BTCScriptConfig.Multisig._ScriptType.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor P2WSH: BTCScriptConfig.Multisig._ScriptType.ValueType # 0 """native segwit v0 multisig (bech32 addresses)""" - P2WSH_P2SH: BTCScriptConfig.Multisig._ScriptType.ValueType # 1 """wrapped segwit for legacy address compatibility""" - class ScriptType(_ScriptType, metaclass=_ScriptTypeEnumTypeWrapper): - pass - + class ScriptType(_ScriptType, metaclass=_ScriptTypeEnumTypeWrapper): ... P2WSH: BTCScriptConfig.Multisig.ScriptType.ValueType # 0 """native segwit v0 multisig (bech32 addresses)""" - P2WSH_P2SH: BTCScriptConfig.Multisig.ScriptType.ValueType # 1 """wrapped segwit for legacy address compatibility""" - THRESHOLD_FIELD_NUMBER: builtins.int XPUBS_FIELD_NUMBER: builtins.int OUR_XPUB_INDEX_FIELD_NUMBER: builtins.int SCRIPT_TYPE_FIELD_NUMBER: builtins.int threshold: builtins.int + our_xpub_index: builtins.int + """Index to the xpub of our keystore in xpubs. The keypath to it is provided via + BTCPubRequest/BTCSignInit. + """ + script_type: global___BTCScriptConfig.Multisig.ScriptType.ValueType @property def xpubs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[common_pb2.XPub]: """xpubs are acount-level xpubs. Addresses are going to be derived from it using: `m//`. The number of xpubs defines the number of cosigners. """ - pass - our_xpub_index: builtins.int - """Index to the xpub of our keystore in xpubs. The keypath to it is provided via - BTCPubRequest/BTCSignInit. - """ - script_type: global___BTCScriptConfig.Multisig.ScriptType.ValueType - def __init__(self, + def __init__( + self, *, threshold: builtins.int = ..., - xpubs: typing.Optional[typing.Iterable[common_pb2.XPub]] = ..., + xpubs: collections.abc.Iterable[common_pb2.XPub] | None = ..., our_xpub_index: builtins.int = ..., script_type: global___BTCScriptConfig.Multisig.ScriptType.ValueType = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["our_xpub_index",b"our_xpub_index","script_type",b"script_type","threshold",b"threshold","xpubs",b"xpubs"]) -> None: ... + ) -> None: ... + def ClearField(self, field_name: typing.Literal["our_xpub_index", b"our_xpub_index", "script_type", b"script_type", "threshold", b"threshold", "xpubs", b"xpubs"]) -> None: ... + @typing.final class Policy(google.protobuf.message.Message): """A policy as specified by 'Wallet policies': https://github.com/bitcoin/bips/pull/1389 """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + POLICY_FIELD_NUMBER: builtins.int KEYS_FIELD_NUMBER: builtins.int - policy: typing.Text + policy: builtins.str @property def keys(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[common_pb2.KeyOriginInfo]: ... - def __init__(self, + def __init__( + self, *, - policy: typing.Text = ..., - keys: typing.Optional[typing.Iterable[common_pb2.KeyOriginInfo]] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["keys",b"keys","policy",b"policy"]) -> None: ... + policy: builtins.str = ..., + keys: collections.abc.Iterable[common_pb2.KeyOriginInfo] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["keys", b"keys", "policy", b"policy"]) -> None: ... SIMPLE_TYPE_FIELD_NUMBER: builtins.int MULTISIG_FIELD_NUMBER: builtins.int @@ -148,22 +178,27 @@ class BTCScriptConfig(google.protobuf.message.Message): def multisig(self) -> global___BTCScriptConfig.Multisig: ... @property def policy(self) -> global___BTCScriptConfig.Policy: ... - def __init__(self, + def __init__( + self, *, simple_type: global___BTCScriptConfig.SimpleType.ValueType = ..., - multisig: typing.Optional[global___BTCScriptConfig.Multisig] = ..., - policy: typing.Optional[global___BTCScriptConfig.Policy] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["config",b"config","multisig",b"multisig","policy",b"policy","simple_type",b"simple_type"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["config",b"config","multisig",b"multisig","policy",b"policy","simple_type",b"simple_type"]) -> None: ... - def WhichOneof(self, oneof_group: typing_extensions.Literal["config",b"config"]) -> typing.Optional[typing_extensions.Literal["simple_type","multisig","policy"]]: ... + multisig: global___BTCScriptConfig.Multisig | None = ..., + policy: global___BTCScriptConfig.Policy | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["config", b"config", "multisig", b"multisig", "policy", b"policy", "simple_type", b"simple_type"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["config", b"config", "multisig", b"multisig", "policy", b"policy", "simple_type", b"simple_type"]) -> None: ... + def WhichOneof(self, oneof_group: typing.Literal["config", b"config"]) -> typing.Literal["simple_type", "multisig", "policy"] | None: ... + global___BTCScriptConfig = BTCScriptConfig +@typing.final class BTCPubRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + class _XPubType: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType + class _XPubTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[BTCPubRequest._XPubType.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor TPUB: BTCPubRequest._XPubType.ValueType # 0 @@ -171,114 +206,105 @@ class BTCPubRequest(google.protobuf.message.Message): YPUB: BTCPubRequest._XPubType.ValueType # 2 ZPUB: BTCPubRequest._XPubType.ValueType # 3 """zpub""" - VPUB: BTCPubRequest._XPubType.ValueType # 4 """vpub""" - UPUB: BTCPubRequest._XPubType.ValueType # 5 CAPITAL_VPUB: BTCPubRequest._XPubType.ValueType # 6 """Vpub""" - CAPITAL_ZPUB: BTCPubRequest._XPubType.ValueType # 7 """Zpub""" - CAPITAL_UPUB: BTCPubRequest._XPubType.ValueType # 8 """Upub""" - CAPITAL_YPUB: BTCPubRequest._XPubType.ValueType # 9 """Ypub""" - class XPubType(_XPubType, metaclass=_XPubTypeEnumTypeWrapper): - pass - + class XPubType(_XPubType, metaclass=_XPubTypeEnumTypeWrapper): ... TPUB: BTCPubRequest.XPubType.ValueType # 0 XPUB: BTCPubRequest.XPubType.ValueType # 1 YPUB: BTCPubRequest.XPubType.ValueType # 2 ZPUB: BTCPubRequest.XPubType.ValueType # 3 """zpub""" - VPUB: BTCPubRequest.XPubType.ValueType # 4 """vpub""" - UPUB: BTCPubRequest.XPubType.ValueType # 5 CAPITAL_VPUB: BTCPubRequest.XPubType.ValueType # 6 """Vpub""" - CAPITAL_ZPUB: BTCPubRequest.XPubType.ValueType # 7 """Zpub""" - CAPITAL_UPUB: BTCPubRequest.XPubType.ValueType # 8 """Upub""" - CAPITAL_YPUB: BTCPubRequest.XPubType.ValueType # 9 """Ypub""" - COIN_FIELD_NUMBER: builtins.int KEYPATH_FIELD_NUMBER: builtins.int XPUB_TYPE_FIELD_NUMBER: builtins.int SCRIPT_CONFIG_FIELD_NUMBER: builtins.int DISPLAY_FIELD_NUMBER: builtins.int coin: global___BTCCoin.ValueType + xpub_type: global___BTCPubRequest.XPubType.ValueType + display: builtins.bool @property def keypath(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]: ... - xpub_type: global___BTCPubRequest.XPubType.ValueType @property def script_config(self) -> global___BTCScriptConfig: ... - display: builtins.bool - def __init__(self, + def __init__( + self, *, coin: global___BTCCoin.ValueType = ..., - keypath: typing.Optional[typing.Iterable[builtins.int]] = ..., + keypath: collections.abc.Iterable[builtins.int] | None = ..., xpub_type: global___BTCPubRequest.XPubType.ValueType = ..., - script_config: typing.Optional[global___BTCScriptConfig] = ..., + script_config: global___BTCScriptConfig | None = ..., display: builtins.bool = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["output",b"output","script_config",b"script_config","xpub_type",b"xpub_type"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["coin",b"coin","display",b"display","keypath",b"keypath","output",b"output","script_config",b"script_config","xpub_type",b"xpub_type"]) -> None: ... - def WhichOneof(self, oneof_group: typing_extensions.Literal["output",b"output"]) -> typing.Optional[typing_extensions.Literal["xpub_type","script_config"]]: ... + ) -> None: ... + def HasField(self, field_name: typing.Literal["output", b"output", "script_config", b"script_config", "xpub_type", b"xpub_type"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["coin", b"coin", "display", b"display", "keypath", b"keypath", "output", b"output", "script_config", b"script_config", "xpub_type", b"xpub_type"]) -> None: ... + def WhichOneof(self, oneof_group: typing.Literal["output", b"output"]) -> typing.Literal["xpub_type", "script_config"] | None: ... + global___BTCPubRequest = BTCPubRequest +@typing.final class BTCScriptConfigWithKeypath(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + SCRIPT_CONFIG_FIELD_NUMBER: builtins.int KEYPATH_FIELD_NUMBER: builtins.int @property def script_config(self) -> global___BTCScriptConfig: ... @property def keypath(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]: ... - def __init__(self, + def __init__( + self, *, - script_config: typing.Optional[global___BTCScriptConfig] = ..., - keypath: typing.Optional[typing.Iterable[builtins.int]] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["script_config",b"script_config"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["keypath",b"keypath","script_config",b"script_config"]) -> None: ... + script_config: global___BTCScriptConfig | None = ..., + keypath: collections.abc.Iterable[builtins.int] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["script_config", b"script_config"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["keypath", b"keypath", "script_config", b"script_config"]) -> None: ... + global___BTCScriptConfigWithKeypath = BTCScriptConfigWithKeypath +@typing.final class BTCSignInitRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + class _FormatUnit: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType + class _FormatUnitEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[BTCSignInitRequest._FormatUnit.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor DEFAULT: BTCSignInitRequest._FormatUnit.ValueType # 0 """According to `coin` (BTC, LTC, etc.).""" - SAT: BTCSignInitRequest._FormatUnit.ValueType # 1 """Only valid for BTC/TBTC, formats as "sat"/"tsat".""" - class FormatUnit(_FormatUnit, metaclass=_FormatUnitEnumTypeWrapper): - pass - + class FormatUnit(_FormatUnit, metaclass=_FormatUnitEnumTypeWrapper): ... DEFAULT: BTCSignInitRequest.FormatUnit.ValueType # 0 """According to `coin` (BTC, LTC, etc.).""" - SAT: BTCSignInitRequest.FormatUnit.ValueType # 1 """Only valid for BTC/TBTC, formats as "sat"/"tsat".""" - COIN_FIELD_NUMBER: builtins.int SCRIPT_CONFIGS_FIELD_NUMBER: builtins.int VERSION_FIELD_NUMBER: builtins.int @@ -286,38 +312,52 @@ class BTCSignInitRequest(google.protobuf.message.Message): NUM_OUTPUTS_FIELD_NUMBER: builtins.int LOCKTIME_FIELD_NUMBER: builtins.int FORMAT_UNIT_FIELD_NUMBER: builtins.int + CONTAINS_SILENT_PAYMENT_OUTPUTS_FIELD_NUMBER: builtins.int + OUTPUT_SCRIPT_CONFIGS_FIELD_NUMBER: builtins.int coin: global___BTCCoin.ValueType - @property - def script_configs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___BTCScriptConfigWithKeypath]: - """used script configs in inputs and changes""" - pass version: builtins.int """must be 1 or 2""" - num_inputs: builtins.int num_outputs: builtins.int locktime: builtins.int """must be <500000000""" - format_unit: global___BTCSignInitRequest.FormatUnit.ValueType - def __init__(self, + contains_silent_payment_outputs: builtins.bool + @property + def script_configs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___BTCScriptConfigWithKeypath]: + """used script configs in inputs and changes""" + + @property + def output_script_configs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___BTCScriptConfigWithKeypath]: + """used script configs for outputs that send to an address of the same keystore, but not + necessarily the same account (as defined by `script_configs` above). + """ + + def __init__( + self, *, coin: global___BTCCoin.ValueType = ..., - script_configs: typing.Optional[typing.Iterable[global___BTCScriptConfigWithKeypath]] = ..., + script_configs: collections.abc.Iterable[global___BTCScriptConfigWithKeypath] | None = ..., version: builtins.int = ..., num_inputs: builtins.int = ..., num_outputs: builtins.int = ..., locktime: builtins.int = ..., format_unit: global___BTCSignInitRequest.FormatUnit.ValueType = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["coin",b"coin","format_unit",b"format_unit","locktime",b"locktime","num_inputs",b"num_inputs","num_outputs",b"num_outputs","script_configs",b"script_configs","version",b"version"]) -> None: ... + contains_silent_payment_outputs: builtins.bool = ..., + output_script_configs: collections.abc.Iterable[global___BTCScriptConfigWithKeypath] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["coin", b"coin", "contains_silent_payment_outputs", b"contains_silent_payment_outputs", "format_unit", b"format_unit", "locktime", b"locktime", "num_inputs", b"num_inputs", "num_outputs", b"num_outputs", "output_script_configs", b"output_script_configs", "script_configs", b"script_configs", "version", b"version"]) -> None: ... + global___BTCSignInitRequest = BTCSignInitRequest +@typing.final class BTCSignNextResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + class _Type: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType + class _TypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[BTCSignNextResponse._Type.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor INPUT: BTCSignNextResponse._Type.ValueType # 0 @@ -325,22 +365,21 @@ class BTCSignNextResponse(google.protobuf.message.Message): DONE: BTCSignNextResponse._Type.ValueType # 2 PREVTX_INIT: BTCSignNextResponse._Type.ValueType # 3 """For the previous transaction at input `index`.""" - PREVTX_INPUT: BTCSignNextResponse._Type.ValueType # 4 PREVTX_OUTPUT: BTCSignNextResponse._Type.ValueType # 5 HOST_NONCE: BTCSignNextResponse._Type.ValueType # 6 - class Type(_Type, metaclass=_TypeEnumTypeWrapper): - pass + PAYMENT_REQUEST: BTCSignNextResponse._Type.ValueType # 7 + class Type(_Type, metaclass=_TypeEnumTypeWrapper): ... INPUT: BTCSignNextResponse.Type.ValueType # 0 OUTPUT: BTCSignNextResponse.Type.ValueType # 1 DONE: BTCSignNextResponse.Type.ValueType # 2 PREVTX_INIT: BTCSignNextResponse.Type.ValueType # 3 """For the previous transaction at input `index`.""" - PREVTX_INPUT: BTCSignNextResponse.Type.ValueType # 4 PREVTX_OUTPUT: BTCSignNextResponse.Type.ValueType # 5 HOST_NONCE: BTCSignNextResponse.Type.ValueType # 6 + PAYMENT_REQUEST: BTCSignNextResponse.Type.ValueType # 7 TYPE_FIELD_NUMBER: builtins.int INDEX_FIELD_NUMBER: builtins.int @@ -348,36 +387,43 @@ class BTCSignNextResponse(google.protobuf.message.Message): SIGNATURE_FIELD_NUMBER: builtins.int PREV_INDEX_FIELD_NUMBER: builtins.int ANTI_KLEPTO_SIGNER_COMMITMENT_FIELD_NUMBER: builtins.int + GENERATED_OUTPUT_PKSCRIPT_FIELD_NUMBER: builtins.int + SILENT_PAYMENT_DLEQ_PROOF_FIELD_NUMBER: builtins.int type: global___BTCSignNextResponse.Type.ValueType index: builtins.int """index of the current input or output""" - has_signature: builtins.bool """only as a response to BTCSignInputRequest""" - signature: builtins.bytes """64 bytes (32 bytes big endian R, 32 bytes big endian S). Only if has_signature is true.""" - prev_index: builtins.int """Previous tx's input/output index in case of PREV_INPUT or PREV_OUTPUT, for the input at `index`.""" - + generated_output_pkscript: builtins.bytes + """Generated output. The host *must* verify its correctness using `silent_payment_dleq_proof`.""" + silent_payment_dleq_proof: builtins.bytes @property def anti_klepto_signer_commitment(self) -> antiklepto_pb2.AntiKleptoSignerCommitment: ... - def __init__(self, + def __init__( + self, *, type: global___BTCSignNextResponse.Type.ValueType = ..., index: builtins.int = ..., has_signature: builtins.bool = ..., signature: builtins.bytes = ..., prev_index: builtins.int = ..., - anti_klepto_signer_commitment: typing.Optional[antiklepto_pb2.AntiKleptoSignerCommitment] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["anti_klepto_signer_commitment",b"anti_klepto_signer_commitment"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["anti_klepto_signer_commitment",b"anti_klepto_signer_commitment","has_signature",b"has_signature","index",b"index","prev_index",b"prev_index","signature",b"signature","type",b"type"]) -> None: ... + anti_klepto_signer_commitment: antiklepto_pb2.AntiKleptoSignerCommitment | None = ..., + generated_output_pkscript: builtins.bytes = ..., + silent_payment_dleq_proof: builtins.bytes = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["anti_klepto_signer_commitment", b"anti_klepto_signer_commitment"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["anti_klepto_signer_commitment", b"anti_klepto_signer_commitment", "generated_output_pkscript", b"generated_output_pkscript", "has_signature", b"has_signature", "index", b"index", "prev_index", b"prev_index", "signature", b"signature", "silent_payment_dleq_proof", b"silent_payment_dleq_proof", "type", b"type"]) -> None: ... + global___BTCSignNextResponse = BTCSignNextResponse +@typing.final class BTCSignInputRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + PREVOUTHASH_FIELD_NUMBER: builtins.int PREVOUTINDEX_FIELD_NUMBER: builtins.int PREVOUTVALUE_FIELD_NUMBER: builtins.int @@ -390,69 +436,113 @@ class BTCSignInputRequest(google.protobuf.message.Message): prevOutValue: builtins.int sequence: builtins.int """must be 0xffffffff-2, 0xffffffff-1 or 0xffffffff""" - + script_config_index: builtins.int + """References a script config from BTCSignInitRequest""" @property def keypath(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]: """all inputs must be ours.""" - pass - script_config_index: builtins.int - """References a script config from BTCSignInitRequest""" @property def host_nonce_commitment(self) -> antiklepto_pb2.AntiKleptoHostNonceCommitment: ... - def __init__(self, + def __init__( + self, *, prevOutHash: builtins.bytes = ..., prevOutIndex: builtins.int = ..., prevOutValue: builtins.int = ..., sequence: builtins.int = ..., - keypath: typing.Optional[typing.Iterable[builtins.int]] = ..., + keypath: collections.abc.Iterable[builtins.int] | None = ..., script_config_index: builtins.int = ..., - host_nonce_commitment: typing.Optional[antiklepto_pb2.AntiKleptoHostNonceCommitment] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["host_nonce_commitment",b"host_nonce_commitment"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["host_nonce_commitment",b"host_nonce_commitment","keypath",b"keypath","prevOutHash",b"prevOutHash","prevOutIndex",b"prevOutIndex","prevOutValue",b"prevOutValue","script_config_index",b"script_config_index","sequence",b"sequence"]) -> None: ... + host_nonce_commitment: antiklepto_pb2.AntiKleptoHostNonceCommitment | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["host_nonce_commitment", b"host_nonce_commitment"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["host_nonce_commitment", b"host_nonce_commitment", "keypath", b"keypath", "prevOutHash", b"prevOutHash", "prevOutIndex", b"prevOutIndex", "prevOutValue", b"prevOutValue", "script_config_index", b"script_config_index", "sequence", b"sequence"]) -> None: ... + global___BTCSignInputRequest = BTCSignInputRequest +@typing.final class BTCSignOutputRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + + @typing.final + class SilentPayment(google.protobuf.message.Message): + """https://github.com/bitcoin/bips/blob/master/bip-0352.mediawiki""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + ADDRESS_FIELD_NUMBER: builtins.int + address: builtins.str + def __init__( + self, + *, + address: builtins.str = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["address", b"address"]) -> None: ... + OURS_FIELD_NUMBER: builtins.int TYPE_FIELD_NUMBER: builtins.int VALUE_FIELD_NUMBER: builtins.int PAYLOAD_FIELD_NUMBER: builtins.int KEYPATH_FIELD_NUMBER: builtins.int SCRIPT_CONFIG_INDEX_FIELD_NUMBER: builtins.int + PAYMENT_REQUEST_INDEX_FIELD_NUMBER: builtins.int + SILENT_PAYMENT_FIELD_NUMBER: builtins.int + OUTPUT_SCRIPT_CONFIG_INDEX_FIELD_NUMBER: builtins.int ours: builtins.bool type: global___BTCOutputType.ValueType """if ours is false""" - value: builtins.int """20 bytes for p2pkh, p2sh, pw2wpkh. 32 bytes for p2wsh.""" - payload: builtins.bytes """if ours is false. Renamed from `hash`.""" - + script_config_index: builtins.int + """If ours is true and `output_script_config_index` is absent. References a script config from + BTCSignInitRequest. This allows change output identification and allows us to identify + non-change outputs to the same account, so we can display this info to the user. + """ + payment_request_index: builtins.int + output_script_config_index: builtins.int + """If ours is true. If set, `script_config_index` is ignored. References an output script config + from BTCSignInitRequest. This enables verification that an output belongs to the same keystore, + even if it is from a different account than we spend from, allowing us to display this info to + the user. + """ @property def keypath(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]: """if ours is true""" - pass - script_config_index: builtins.int - """If ours is true. References a script config from BTCSignInitRequest""" - def __init__(self, + @property + def silent_payment(self) -> global___BTCSignOutputRequest.SilentPayment: + """If provided, `type` and `payload` is ignored. The generated output pkScript is returned in + BTCSignNextResponse. `contains_silent_payment_outputs` in the init request must be true. + """ + + def __init__( + self, *, ours: builtins.bool = ..., type: global___BTCOutputType.ValueType = ..., value: builtins.int = ..., payload: builtins.bytes = ..., - keypath: typing.Optional[typing.Iterable[builtins.int]] = ..., + keypath: collections.abc.Iterable[builtins.int] | None = ..., script_config_index: builtins.int = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["keypath",b"keypath","ours",b"ours","payload",b"payload","script_config_index",b"script_config_index","type",b"type","value",b"value"]) -> None: ... + payment_request_index: builtins.int | None = ..., + silent_payment: global___BTCSignOutputRequest.SilentPayment | None = ..., + output_script_config_index: builtins.int | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["_output_script_config_index", b"_output_script_config_index", "_payment_request_index", b"_payment_request_index", "output_script_config_index", b"output_script_config_index", "payment_request_index", b"payment_request_index", "silent_payment", b"silent_payment"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["_output_script_config_index", b"_output_script_config_index", "_payment_request_index", b"_payment_request_index", "keypath", b"keypath", "ours", b"ours", "output_script_config_index", b"output_script_config_index", "payload", b"payload", "payment_request_index", b"payment_request_index", "script_config_index", b"script_config_index", "silent_payment", b"silent_payment", "type", b"type", "value", b"value"]) -> None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing.Literal["_output_script_config_index", b"_output_script_config_index"]) -> typing.Literal["output_script_config_index"] | None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing.Literal["_payment_request_index", b"_payment_request_index"]) -> typing.Literal["payment_request_index"] | None: ... + global___BTCSignOutputRequest = BTCSignOutputRequest +@typing.final class BTCScriptConfigRegistration(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + COIN_FIELD_NUMBER: builtins.int SCRIPT_CONFIG_FIELD_NUMBER: builtins.int KEYPATH_FIELD_NUMBER: builtins.int @@ -462,91 +552,106 @@ class BTCScriptConfigRegistration(google.protobuf.message.Message): @property def keypath(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]: """Unused for policy registrations.""" - pass - def __init__(self, + + def __init__( + self, *, coin: global___BTCCoin.ValueType = ..., - script_config: typing.Optional[global___BTCScriptConfig] = ..., - keypath: typing.Optional[typing.Iterable[builtins.int]] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["script_config",b"script_config"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["coin",b"coin","keypath",b"keypath","script_config",b"script_config"]) -> None: ... + script_config: global___BTCScriptConfig | None = ..., + keypath: collections.abc.Iterable[builtins.int] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["script_config", b"script_config"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["coin", b"coin", "keypath", b"keypath", "script_config", b"script_config"]) -> None: ... + global___BTCScriptConfigRegistration = BTCScriptConfigRegistration +@typing.final class BTCSuccess(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor - def __init__(self, - ) -> None: ... + + def __init__( + self, + ) -> None: ... + global___BTCSuccess = BTCSuccess +@typing.final class BTCIsScriptConfigRegisteredRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + REGISTRATION_FIELD_NUMBER: builtins.int @property def registration(self) -> global___BTCScriptConfigRegistration: ... - def __init__(self, + def __init__( + self, *, - registration: typing.Optional[global___BTCScriptConfigRegistration] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["registration",b"registration"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["registration",b"registration"]) -> None: ... + registration: global___BTCScriptConfigRegistration | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["registration", b"registration"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["registration", b"registration"]) -> None: ... + global___BTCIsScriptConfigRegisteredRequest = BTCIsScriptConfigRegisteredRequest +@typing.final class BTCIsScriptConfigRegisteredResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + IS_REGISTERED_FIELD_NUMBER: builtins.int is_registered: builtins.bool - def __init__(self, + def __init__( + self, *, is_registered: builtins.bool = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["is_registered",b"is_registered"]) -> None: ... + ) -> None: ... + def ClearField(self, field_name: typing.Literal["is_registered", b"is_registered"]) -> None: ... + global___BTCIsScriptConfigRegisteredResponse = BTCIsScriptConfigRegisteredResponse +@typing.final class BTCRegisterScriptConfigRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + class _XPubType: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType + class _XPubTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[BTCRegisterScriptConfigRequest._XPubType.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor AUTO_ELECTRUM: BTCRegisterScriptConfigRequest._XPubType.ValueType # 0 """Automatically choose to match Electrum's xpub format (e.g. Zpub/Vpub for p2wsh multisig mainnet/testnet).""" - AUTO_XPUB_TPUB: BTCRegisterScriptConfigRequest._XPubType.ValueType # 1 """Always xpub for mainnets, tpub for testnets.""" - class XPubType(_XPubType, metaclass=_XPubTypeEnumTypeWrapper): - pass - + class XPubType(_XPubType, metaclass=_XPubTypeEnumTypeWrapper): ... AUTO_ELECTRUM: BTCRegisterScriptConfigRequest.XPubType.ValueType # 0 """Automatically choose to match Electrum's xpub format (e.g. Zpub/Vpub for p2wsh multisig mainnet/testnet).""" - AUTO_XPUB_TPUB: BTCRegisterScriptConfigRequest.XPubType.ValueType # 1 """Always xpub for mainnets, tpub for testnets.""" - REGISTRATION_FIELD_NUMBER: builtins.int NAME_FIELD_NUMBER: builtins.int XPUB_TYPE_FIELD_NUMBER: builtins.int - @property - def registration(self) -> global___BTCScriptConfigRegistration: ... - name: typing.Text + name: builtins.str """If empty, the name is entered on the device instead.""" - xpub_type: global___BTCRegisterScriptConfigRequest.XPubType.ValueType - def __init__(self, + @property + def registration(self) -> global___BTCScriptConfigRegistration: ... + def __init__( + self, *, - registration: typing.Optional[global___BTCScriptConfigRegistration] = ..., - name: typing.Text = ..., + registration: global___BTCScriptConfigRegistration | None = ..., + name: builtins.str = ..., xpub_type: global___BTCRegisterScriptConfigRequest.XPubType.ValueType = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["registration",b"registration"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["name",b"name","registration",b"registration","xpub_type",b"xpub_type"]) -> None: ... + ) -> None: ... + def HasField(self, field_name: typing.Literal["registration", b"registration"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["name", b"name", "registration", b"registration", "xpub_type", b"xpub_type"]) -> None: ... + global___BTCRegisterScriptConfigRequest = BTCRegisterScriptConfigRequest +@typing.final class BTCPrevTxInitRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + VERSION_FIELD_NUMBER: builtins.int NUM_INPUTS_FIELD_NUMBER: builtins.int NUM_OUTPUTS_FIELD_NUMBER: builtins.int @@ -555,18 +660,22 @@ class BTCPrevTxInitRequest(google.protobuf.message.Message): num_inputs: builtins.int num_outputs: builtins.int locktime: builtins.int - def __init__(self, + def __init__( + self, *, version: builtins.int = ..., num_inputs: builtins.int = ..., num_outputs: builtins.int = ..., locktime: builtins.int = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["locktime",b"locktime","num_inputs",b"num_inputs","num_outputs",b"num_outputs","version",b"version"]) -> None: ... + ) -> None: ... + def ClearField(self, field_name: typing.Literal["locktime", b"locktime", "num_inputs", b"num_inputs", "num_outputs", b"num_outputs", "version", b"version"]) -> None: ... + global___BTCPrevTxInitRequest = BTCPrevTxInitRequest +@typing.final class BTCPrevTxInputRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + PREV_OUT_HASH_FIELD_NUMBER: builtins.int PREV_OUT_INDEX_FIELD_NUMBER: builtins.int SIGNATURE_SCRIPT_FIELD_NUMBER: builtins.int @@ -575,68 +684,140 @@ class BTCPrevTxInputRequest(google.protobuf.message.Message): prev_out_index: builtins.int signature_script: builtins.bytes sequence: builtins.int - def __init__(self, + def __init__( + self, *, prev_out_hash: builtins.bytes = ..., prev_out_index: builtins.int = ..., signature_script: builtins.bytes = ..., sequence: builtins.int = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["prev_out_hash",b"prev_out_hash","prev_out_index",b"prev_out_index","sequence",b"sequence","signature_script",b"signature_script"]) -> None: ... + ) -> None: ... + def ClearField(self, field_name: typing.Literal["prev_out_hash", b"prev_out_hash", "prev_out_index", b"prev_out_index", "sequence", b"sequence", "signature_script", b"signature_script"]) -> None: ... + global___BTCPrevTxInputRequest = BTCPrevTxInputRequest +@typing.final class BTCPrevTxOutputRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + VALUE_FIELD_NUMBER: builtins.int PUBKEY_SCRIPT_FIELD_NUMBER: builtins.int value: builtins.int pubkey_script: builtins.bytes - def __init__(self, + def __init__( + self, *, value: builtins.int = ..., pubkey_script: builtins.bytes = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["pubkey_script",b"pubkey_script","value",b"value"]) -> None: ... + ) -> None: ... + def ClearField(self, field_name: typing.Literal["pubkey_script", b"pubkey_script", "value", b"value"]) -> None: ... + global___BTCPrevTxOutputRequest = BTCPrevTxOutputRequest +@typing.final +class BTCPaymentRequestRequest(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + @typing.final + class Memo(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + @typing.final + class TextMemo(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + NOTE_FIELD_NUMBER: builtins.int + note: builtins.str + def __init__( + self, + *, + note: builtins.str = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["note", b"note"]) -> None: ... + + TEXT_MEMO_FIELD_NUMBER: builtins.int + @property + def text_memo(self) -> global___BTCPaymentRequestRequest.Memo.TextMemo: ... + def __init__( + self, + *, + text_memo: global___BTCPaymentRequestRequest.Memo.TextMemo | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["memo", b"memo", "text_memo", b"text_memo"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["memo", b"memo", "text_memo", b"text_memo"]) -> None: ... + def WhichOneof(self, oneof_group: typing.Literal["memo", b"memo"]) -> typing.Literal["text_memo"] | None: ... + + RECIPIENT_NAME_FIELD_NUMBER: builtins.int + MEMOS_FIELD_NUMBER: builtins.int + NONCE_FIELD_NUMBER: builtins.int + TOTAL_AMOUNT_FIELD_NUMBER: builtins.int + SIGNATURE_FIELD_NUMBER: builtins.int + recipient_name: builtins.str + nonce: builtins.bytes + total_amount: builtins.int + signature: builtins.bytes + @property + def memos(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___BTCPaymentRequestRequest.Memo]: ... + def __init__( + self, + *, + recipient_name: builtins.str = ..., + memos: collections.abc.Iterable[global___BTCPaymentRequestRequest.Memo] | None = ..., + nonce: builtins.bytes = ..., + total_amount: builtins.int = ..., + signature: builtins.bytes = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["memos", b"memos", "nonce", b"nonce", "recipient_name", b"recipient_name", "signature", b"signature", "total_amount", b"total_amount"]) -> None: ... + +global___BTCPaymentRequestRequest = BTCPaymentRequestRequest + +@typing.final class BTCSignMessageRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + COIN_FIELD_NUMBER: builtins.int SCRIPT_CONFIG_FIELD_NUMBER: builtins.int MSG_FIELD_NUMBER: builtins.int HOST_NONCE_COMMITMENT_FIELD_NUMBER: builtins.int coin: global___BTCCoin.ValueType + msg: builtins.bytes @property def script_config(self) -> global___BTCScriptConfigWithKeypath: ... - msg: builtins.bytes @property def host_nonce_commitment(self) -> antiklepto_pb2.AntiKleptoHostNonceCommitment: ... - def __init__(self, + def __init__( + self, *, coin: global___BTCCoin.ValueType = ..., - script_config: typing.Optional[global___BTCScriptConfigWithKeypath] = ..., + script_config: global___BTCScriptConfigWithKeypath | None = ..., msg: builtins.bytes = ..., - host_nonce_commitment: typing.Optional[antiklepto_pb2.AntiKleptoHostNonceCommitment] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["host_nonce_commitment",b"host_nonce_commitment","script_config",b"script_config"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["coin",b"coin","host_nonce_commitment",b"host_nonce_commitment","msg",b"msg","script_config",b"script_config"]) -> None: ... + host_nonce_commitment: antiklepto_pb2.AntiKleptoHostNonceCommitment | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["host_nonce_commitment", b"host_nonce_commitment", "script_config", b"script_config"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["coin", b"coin", "host_nonce_commitment", b"host_nonce_commitment", "msg", b"msg", "script_config", b"script_config"]) -> None: ... + global___BTCSignMessageRequest = BTCSignMessageRequest +@typing.final class BTCSignMessageResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + SIGNATURE_FIELD_NUMBER: builtins.int signature: builtins.bytes """65 bytes (32 bytes big endian R, 32 bytes big endian S, 1 recid).""" - - def __init__(self, + def __init__( + self, *, signature: builtins.bytes = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["signature",b"signature"]) -> None: ... + ) -> None: ... + def ClearField(self, field_name: typing.Literal["signature", b"signature"]) -> None: ... + global___BTCSignMessageResponse = BTCSignMessageResponse +@typing.final class BTCRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + IS_SCRIPT_CONFIG_REGISTERED_FIELD_NUMBER: builtins.int REGISTER_SCRIPT_CONFIG_FIELD_NUMBER: builtins.int PREVTX_INIT_FIELD_NUMBER: builtins.int @@ -644,6 +825,7 @@ class BTCRequest(google.protobuf.message.Message): PREVTX_OUTPUT_FIELD_NUMBER: builtins.int SIGN_MESSAGE_FIELD_NUMBER: builtins.int ANTIKLEPTO_SIGNATURE_FIELD_NUMBER: builtins.int + PAYMENT_REQUEST_FIELD_NUMBER: builtins.int @property def is_script_config_registered(self) -> global___BTCIsScriptConfigRegisteredRequest: ... @property @@ -658,23 +840,30 @@ class BTCRequest(google.protobuf.message.Message): def sign_message(self) -> global___BTCSignMessageRequest: ... @property def antiklepto_signature(self) -> antiklepto_pb2.AntiKleptoSignatureRequest: ... - def __init__(self, + @property + def payment_request(self) -> global___BTCPaymentRequestRequest: ... + def __init__( + self, *, - is_script_config_registered: typing.Optional[global___BTCIsScriptConfigRegisteredRequest] = ..., - register_script_config: typing.Optional[global___BTCRegisterScriptConfigRequest] = ..., - prevtx_init: typing.Optional[global___BTCPrevTxInitRequest] = ..., - prevtx_input: typing.Optional[global___BTCPrevTxInputRequest] = ..., - prevtx_output: typing.Optional[global___BTCPrevTxOutputRequest] = ..., - sign_message: typing.Optional[global___BTCSignMessageRequest] = ..., - antiklepto_signature: typing.Optional[antiklepto_pb2.AntiKleptoSignatureRequest] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["antiklepto_signature",b"antiklepto_signature","is_script_config_registered",b"is_script_config_registered","prevtx_init",b"prevtx_init","prevtx_input",b"prevtx_input","prevtx_output",b"prevtx_output","register_script_config",b"register_script_config","request",b"request","sign_message",b"sign_message"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["antiklepto_signature",b"antiklepto_signature","is_script_config_registered",b"is_script_config_registered","prevtx_init",b"prevtx_init","prevtx_input",b"prevtx_input","prevtx_output",b"prevtx_output","register_script_config",b"register_script_config","request",b"request","sign_message",b"sign_message"]) -> None: ... - def WhichOneof(self, oneof_group: typing_extensions.Literal["request",b"request"]) -> typing.Optional[typing_extensions.Literal["is_script_config_registered","register_script_config","prevtx_init","prevtx_input","prevtx_output","sign_message","antiklepto_signature"]]: ... + is_script_config_registered: global___BTCIsScriptConfigRegisteredRequest | None = ..., + register_script_config: global___BTCRegisterScriptConfigRequest | None = ..., + prevtx_init: global___BTCPrevTxInitRequest | None = ..., + prevtx_input: global___BTCPrevTxInputRequest | None = ..., + prevtx_output: global___BTCPrevTxOutputRequest | None = ..., + sign_message: global___BTCSignMessageRequest | None = ..., + antiklepto_signature: antiklepto_pb2.AntiKleptoSignatureRequest | None = ..., + payment_request: global___BTCPaymentRequestRequest | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["antiklepto_signature", b"antiklepto_signature", "is_script_config_registered", b"is_script_config_registered", "payment_request", b"payment_request", "prevtx_init", b"prevtx_init", "prevtx_input", b"prevtx_input", "prevtx_output", b"prevtx_output", "register_script_config", b"register_script_config", "request", b"request", "sign_message", b"sign_message"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["antiklepto_signature", b"antiklepto_signature", "is_script_config_registered", b"is_script_config_registered", "payment_request", b"payment_request", "prevtx_init", b"prevtx_init", "prevtx_input", b"prevtx_input", "prevtx_output", b"prevtx_output", "register_script_config", b"register_script_config", "request", b"request", "sign_message", b"sign_message"]) -> None: ... + def WhichOneof(self, oneof_group: typing.Literal["request", b"request"]) -> typing.Literal["is_script_config_registered", "register_script_config", "prevtx_init", "prevtx_input", "prevtx_output", "sign_message", "antiklepto_signature", "payment_request"] | None: ... + global___BTCRequest = BTCRequest +@typing.final class BTCResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + SUCCESS_FIELD_NUMBER: builtins.int IS_SCRIPT_CONFIG_REGISTERED_FIELD_NUMBER: builtins.int SIGN_NEXT_FIELD_NUMBER: builtins.int @@ -690,15 +879,17 @@ class BTCResponse(google.protobuf.message.Message): def sign_message(self) -> global___BTCSignMessageResponse: ... @property def antiklepto_signer_commitment(self) -> antiklepto_pb2.AntiKleptoSignerCommitment: ... - def __init__(self, + def __init__( + self, *, - success: typing.Optional[global___BTCSuccess] = ..., - is_script_config_registered: typing.Optional[global___BTCIsScriptConfigRegisteredResponse] = ..., - sign_next: typing.Optional[global___BTCSignNextResponse] = ..., - sign_message: typing.Optional[global___BTCSignMessageResponse] = ..., - antiklepto_signer_commitment: typing.Optional[antiklepto_pb2.AntiKleptoSignerCommitment] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["antiklepto_signer_commitment",b"antiklepto_signer_commitment","is_script_config_registered",b"is_script_config_registered","response",b"response","sign_message",b"sign_message","sign_next",b"sign_next","success",b"success"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["antiklepto_signer_commitment",b"antiklepto_signer_commitment","is_script_config_registered",b"is_script_config_registered","response",b"response","sign_message",b"sign_message","sign_next",b"sign_next","success",b"success"]) -> None: ... - def WhichOneof(self, oneof_group: typing_extensions.Literal["response",b"response"]) -> typing.Optional[typing_extensions.Literal["success","is_script_config_registered","sign_next","sign_message","antiklepto_signer_commitment"]]: ... + success: global___BTCSuccess | None = ..., + is_script_config_registered: global___BTCIsScriptConfigRegisteredResponse | None = ..., + sign_next: global___BTCSignNextResponse | None = ..., + sign_message: global___BTCSignMessageResponse | None = ..., + antiklepto_signer_commitment: antiklepto_pb2.AntiKleptoSignerCommitment | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["antiklepto_signer_commitment", b"antiklepto_signer_commitment", "is_script_config_registered", b"is_script_config_registered", "response", b"response", "sign_message", b"sign_message", "sign_next", b"sign_next", "success", b"success"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["antiklepto_signer_commitment", b"antiklepto_signer_commitment", "is_script_config_registered", b"is_script_config_registered", "response", b"response", "sign_message", b"sign_message", "sign_next", b"sign_next", "success", b"success"]) -> None: ... + def WhichOneof(self, oneof_group: typing.Literal["response", b"response"]) -> typing.Literal["success", "is_script_config_registered", "sign_next", "sign_message", "antiklepto_signer_commitment"] | None: ... + global___BTCResponse = BTCResponse diff --git a/hwilib/devices/bitbox02_lib/communication/generated/cardano_pb2.py b/hwilib/devices/bitbox02_lib/communication/generated/cardano_pb2.py index ecacbeeef..7996c1187 100644 --- a/hwilib/devices/bitbox02_lib/communication/generated/cardano_pb2.py +++ b/hwilib/devices/bitbox02_lib/communication/generated/cardano_pb2.py @@ -14,15 +14,15 @@ from . import common_pb2 as common__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\rcardano.proto\x12\x14shiftcrypto.bitbox02\x1a\x0c\x63ommon.proto\"F\n\x13\x43\x61rdanoXpubsRequest\x12/\n\x08keypaths\x18\x01 \x03(\x0b\x32\x1d.shiftcrypto.bitbox02.Keypath\"%\n\x14\x43\x61rdanoXpubsResponse\x12\r\n\x05xpubs\x18\x01 \x03(\x0c\"\x9e\x01\n\x13\x43\x61rdanoScriptConfig\x12\x43\n\x07pkh_skh\x18\x01 \x01(\x0b\x32\x30.shiftcrypto.bitbox02.CardanoScriptConfig.PkhSkhH\x00\x1a\x38\n\x06PkhSkh\x12\x17\n\x0fkeypath_payment\x18\x01 \x03(\r\x12\x15\n\rkeypath_stake\x18\x02 \x03(\rB\x08\n\x06\x63onfig\"\xa1\x01\n\x15\x43\x61rdanoAddressRequest\x12\x35\n\x07network\x18\x01 \x01(\x0e\x32$.shiftcrypto.bitbox02.CardanoNetwork\x12\x0f\n\x07\x64isplay\x18\x02 \x01(\x08\x12@\n\rscript_config\x18\x03 \x01(\x0b\x32).shiftcrypto.bitbox02.CardanoScriptConfig\"\x8e\n\n\x1d\x43\x61rdanoSignTransactionRequest\x12\x35\n\x07network\x18\x01 \x01(\x0e\x32$.shiftcrypto.bitbox02.CardanoNetwork\x12I\n\x06inputs\x18\x02 \x03(\x0b\x32\x39.shiftcrypto.bitbox02.CardanoSignTransactionRequest.Input\x12K\n\x07outputs\x18\x03 \x03(\x0b\x32:.shiftcrypto.bitbox02.CardanoSignTransactionRequest.Output\x12\x0b\n\x03\x66\x65\x65\x18\x04 \x01(\x04\x12\x0b\n\x03ttl\x18\x05 \x01(\x04\x12U\n\x0c\x63\x65rtificates\x18\x06 \x03(\x0b\x32?.shiftcrypto.bitbox02.CardanoSignTransactionRequest.Certificate\x12S\n\x0bwithdrawals\x18\x07 \x03(\x0b\x32>.shiftcrypto.bitbox02.CardanoSignTransactionRequest.Withdrawal\x12\x1f\n\x17validity_interval_start\x18\x08 \x01(\x04\x12\x16\n\x0e\x61llow_zero_ttl\x18\t \x01(\x08\x1aG\n\x05Input\x12\x0f\n\x07keypath\x18\x01 \x03(\r\x12\x15\n\rprev_out_hash\x18\x02 \x01(\x0c\x12\x16\n\x0eprev_out_index\x18\x03 \x01(\r\x1a\xa1\x01\n\nAssetGroup\x12\x11\n\tpolicy_id\x18\x01 \x01(\x0c\x12T\n\x06tokens\x18\x02 \x03(\x0b\x32\x44.shiftcrypto.bitbox02.CardanoSignTransactionRequest.AssetGroup.Token\x1a*\n\x05Token\x12\x12\n\nasset_name\x18\x01 \x01(\x0c\x12\r\n\x05value\x18\x02 \x01(\x04\x1a\xc8\x01\n\x06Output\x12\x17\n\x0f\x65ncoded_address\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x04\x12@\n\rscript_config\x18\x03 \x01(\x0b\x32).shiftcrypto.bitbox02.CardanoScriptConfig\x12T\n\x0c\x61sset_groups\x18\x04 \x03(\x0b\x32>.shiftcrypto.bitbox02.CardanoSignTransactionRequest.AssetGroup\x1a\xb8\x02\n\x0b\x43\x65rtificate\x12;\n\x12stake_registration\x18\x01 \x01(\x0b\x32\x1d.shiftcrypto.bitbox02.KeypathH\x00\x12=\n\x14stake_deregistration\x18\x02 \x01(\x0b\x32\x1d.shiftcrypto.bitbox02.KeypathH\x00\x12k\n\x10stake_delegation\x18\x03 \x01(\x0b\x32O.shiftcrypto.bitbox02.CardanoSignTransactionRequest.Certificate.StakeDelegationH\x00\x1a\x38\n\x0fStakeDelegation\x12\x0f\n\x07keypath\x18\x01 \x03(\r\x12\x14\n\x0cpool_keyhash\x18\x02 \x01(\x0c\x42\x06\n\x04\x63\x65rt\x1a,\n\nWithdrawal\x12\x0f\n\x07keypath\x18\x01 \x03(\r\x12\r\n\x05value\x18\x02 \x01(\x04\"\xb9\x01\n\x1e\x43\x61rdanoSignTransactionResponse\x12^\n\x11shelley_witnesses\x18\x01 \x03(\x0b\x32\x43.shiftcrypto.bitbox02.CardanoSignTransactionResponse.ShelleyWitness\x1a\x37\n\x0eShelleyWitness\x12\x12\n\npublic_key\x18\x01 \x01(\x0c\x12\x11\n\tsignature\x18\x02 \x01(\x0c\"\xe8\x01\n\x0e\x43\x61rdanoRequest\x12:\n\x05xpubs\x18\x01 \x01(\x0b\x32).shiftcrypto.bitbox02.CardanoXpubsRequestH\x00\x12>\n\x07\x61\x64\x64ress\x18\x02 \x01(\x0b\x32+.shiftcrypto.bitbox02.CardanoAddressRequestH\x00\x12O\n\x10sign_transaction\x18\x03 \x01(\x0b\x32\x33.shiftcrypto.bitbox02.CardanoSignTransactionRequestH\x00\x42\t\n\x07request\"\xde\x01\n\x0f\x43\x61rdanoResponse\x12;\n\x05xpubs\x18\x01 \x01(\x0b\x32*.shiftcrypto.bitbox02.CardanoXpubsResponseH\x00\x12\x30\n\x03pub\x18\x02 \x01(\x0b\x32!.shiftcrypto.bitbox02.PubResponseH\x00\x12P\n\x10sign_transaction\x18\x03 \x01(\x0b\x32\x34.shiftcrypto.bitbox02.CardanoSignTransactionResponseH\x00\x42\n\n\x08response*8\n\x0e\x43\x61rdanoNetwork\x12\x12\n\x0e\x43\x61rdanoMainnet\x10\x00\x12\x12\n\x0e\x43\x61rdanoTestnet\x10\x01\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\rcardano.proto\x12\x14shiftcrypto.bitbox02\x1a\x0c\x63ommon.proto\"F\n\x13\x43\x61rdanoXpubsRequest\x12/\n\x08keypaths\x18\x01 \x03(\x0b\x32\x1d.shiftcrypto.bitbox02.Keypath\"%\n\x14\x43\x61rdanoXpubsResponse\x12\r\n\x05xpubs\x18\x01 \x03(\x0c\"\x9e\x01\n\x13\x43\x61rdanoScriptConfig\x12\x43\n\x07pkh_skh\x18\x01 \x01(\x0b\x32\x30.shiftcrypto.bitbox02.CardanoScriptConfig.PkhSkhH\x00\x1a\x38\n\x06PkhSkh\x12\x17\n\x0fkeypath_payment\x18\x01 \x03(\r\x12\x15\n\rkeypath_stake\x18\x02 \x03(\rB\x08\n\x06\x63onfig\"\xa1\x01\n\x15\x43\x61rdanoAddressRequest\x12\x35\n\x07network\x18\x01 \x01(\x0e\x32$.shiftcrypto.bitbox02.CardanoNetwork\x12\x0f\n\x07\x64isplay\x18\x02 \x01(\x08\x12@\n\rscript_config\x18\x03 \x01(\x0b\x32).shiftcrypto.bitbox02.CardanoScriptConfig\"\xb0\r\n\x1d\x43\x61rdanoSignTransactionRequest\x12\x35\n\x07network\x18\x01 \x01(\x0e\x32$.shiftcrypto.bitbox02.CardanoNetwork\x12I\n\x06inputs\x18\x02 \x03(\x0b\x32\x39.shiftcrypto.bitbox02.CardanoSignTransactionRequest.Input\x12K\n\x07outputs\x18\x03 \x03(\x0b\x32:.shiftcrypto.bitbox02.CardanoSignTransactionRequest.Output\x12\x0b\n\x03\x66\x65\x65\x18\x04 \x01(\x04\x12\x0b\n\x03ttl\x18\x05 \x01(\x04\x12U\n\x0c\x63\x65rtificates\x18\x06 \x03(\x0b\x32?.shiftcrypto.bitbox02.CardanoSignTransactionRequest.Certificate\x12S\n\x0bwithdrawals\x18\x07 \x03(\x0b\x32>.shiftcrypto.bitbox02.CardanoSignTransactionRequest.Withdrawal\x12\x1f\n\x17validity_interval_start\x18\x08 \x01(\x04\x12\x16\n\x0e\x61llow_zero_ttl\x18\t \x01(\x08\x12\x15\n\rtag_cbor_sets\x18\n \x01(\x08\x1aG\n\x05Input\x12\x0f\n\x07keypath\x18\x01 \x03(\r\x12\x15\n\rprev_out_hash\x18\x02 \x01(\x0c\x12\x16\n\x0eprev_out_index\x18\x03 \x01(\r\x1a\xa1\x01\n\nAssetGroup\x12\x11\n\tpolicy_id\x18\x01 \x01(\x0c\x12T\n\x06tokens\x18\x02 \x03(\x0b\x32\x44.shiftcrypto.bitbox02.CardanoSignTransactionRequest.AssetGroup.Token\x1a*\n\x05Token\x12\x12\n\nasset_name\x18\x01 \x01(\x0c\x12\r\n\x05value\x18\x02 \x01(\x04\x1a\xc8\x01\n\x06Output\x12\x17\n\x0f\x65ncoded_address\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x04\x12@\n\rscript_config\x18\x03 \x01(\x0b\x32).shiftcrypto.bitbox02.CardanoScriptConfig\x12T\n\x0c\x61sset_groups\x18\x04 \x03(\x0b\x32>.shiftcrypto.bitbox02.CardanoSignTransactionRequest.AssetGroup\x1a\xc3\x05\n\x0b\x43\x65rtificate\x12;\n\x12stake_registration\x18\x01 \x01(\x0b\x32\x1d.shiftcrypto.bitbox02.KeypathH\x00\x12=\n\x14stake_deregistration\x18\x02 \x01(\x0b\x32\x1d.shiftcrypto.bitbox02.KeypathH\x00\x12k\n\x10stake_delegation\x18\x03 \x01(\x0b\x32O.shiftcrypto.bitbox02.CardanoSignTransactionRequest.Certificate.StakeDelegationH\x00\x12i\n\x0fvote_delegation\x18\n \x01(\x0b\x32N.shiftcrypto.bitbox02.CardanoSignTransactionRequest.Certificate.VoteDelegationH\x00\x1a\x38\n\x0fStakeDelegation\x12\x0f\n\x07keypath\x18\x01 \x03(\r\x12\x14\n\x0cpool_keyhash\x18\x02 \x01(\x0c\x1a\x9d\x02\n\x0eVoteDelegation\x12\x0f\n\x07keypath\x18\x01 \x03(\r\x12l\n\x04type\x18\x02 \x01(\x0e\x32^.shiftcrypto.bitbox02.CardanoSignTransactionRequest.Certificate.VoteDelegation.CardanoDRepType\x12\x1a\n\rdrep_credhash\x18\x03 \x01(\x0cH\x00\x88\x01\x01\"^\n\x0f\x43\x61rdanoDRepType\x12\x0c\n\x08KEY_HASH\x10\x00\x12\x0f\n\x0bSCRIPT_HASH\x10\x01\x12\x12\n\x0e\x41LWAYS_ABSTAIN\x10\x02\x12\x18\n\x14\x41LWAYS_NO_CONFIDENCE\x10\x03\x42\x10\n\x0e_drep_credhashB\x06\n\x04\x63\x65rt\x1a,\n\nWithdrawal\x12\x0f\n\x07keypath\x18\x01 \x03(\r\x12\r\n\x05value\x18\x02 \x01(\x04\"\xb9\x01\n\x1e\x43\x61rdanoSignTransactionResponse\x12^\n\x11shelley_witnesses\x18\x01 \x03(\x0b\x32\x43.shiftcrypto.bitbox02.CardanoSignTransactionResponse.ShelleyWitness\x1a\x37\n\x0eShelleyWitness\x12\x12\n\npublic_key\x18\x01 \x01(\x0c\x12\x11\n\tsignature\x18\x02 \x01(\x0c\"\xe8\x01\n\x0e\x43\x61rdanoRequest\x12:\n\x05xpubs\x18\x01 \x01(\x0b\x32).shiftcrypto.bitbox02.CardanoXpubsRequestH\x00\x12>\n\x07\x61\x64\x64ress\x18\x02 \x01(\x0b\x32+.shiftcrypto.bitbox02.CardanoAddressRequestH\x00\x12O\n\x10sign_transaction\x18\x03 \x01(\x0b\x32\x33.shiftcrypto.bitbox02.CardanoSignTransactionRequestH\x00\x42\t\n\x07request\"\xde\x01\n\x0f\x43\x61rdanoResponse\x12;\n\x05xpubs\x18\x01 \x01(\x0b\x32*.shiftcrypto.bitbox02.CardanoXpubsResponseH\x00\x12\x30\n\x03pub\x18\x02 \x01(\x0b\x32!.shiftcrypto.bitbox02.PubResponseH\x00\x12P\n\x10sign_transaction\x18\x03 \x01(\x0b\x32\x34.shiftcrypto.bitbox02.CardanoSignTransactionResponseH\x00\x42\n\n\x08response*8\n\x0e\x43\x61rdanoNetwork\x12\x12\n\x0e\x43\x61rdanoMainnet\x10\x00\x12\x12\n\x0e\x43\x61rdanoTestnet\x10\x01\x62\x06proto3') _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'cardano_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None - _CARDANONETWORK._serialized_start=2434 - _CARDANONETWORK._serialized_end=2490 + _CARDANONETWORK._serialized_start=2852 + _CARDANONETWORK._serialized_end=2908 _CARDANOXPUBSREQUEST._serialized_start=53 _CARDANOXPUBSREQUEST._serialized_end=123 _CARDANOXPUBSRESPONSE._serialized_start=125 @@ -34,27 +34,31 @@ _CARDANOADDRESSREQUEST._serialized_start=326 _CARDANOADDRESSREQUEST._serialized_end=487 _CARDANOSIGNTRANSACTIONREQUEST._serialized_start=490 - _CARDANOSIGNTRANSACTIONREQUEST._serialized_end=1784 - _CARDANOSIGNTRANSACTIONREQUEST_INPUT._serialized_start=985 - _CARDANOSIGNTRANSACTIONREQUEST_INPUT._serialized_end=1056 - _CARDANOSIGNTRANSACTIONREQUEST_ASSETGROUP._serialized_start=1059 - _CARDANOSIGNTRANSACTIONREQUEST_ASSETGROUP._serialized_end=1220 - _CARDANOSIGNTRANSACTIONREQUEST_ASSETGROUP_TOKEN._serialized_start=1178 - _CARDANOSIGNTRANSACTIONREQUEST_ASSETGROUP_TOKEN._serialized_end=1220 - _CARDANOSIGNTRANSACTIONREQUEST_OUTPUT._serialized_start=1223 - _CARDANOSIGNTRANSACTIONREQUEST_OUTPUT._serialized_end=1423 - _CARDANOSIGNTRANSACTIONREQUEST_CERTIFICATE._serialized_start=1426 - _CARDANOSIGNTRANSACTIONREQUEST_CERTIFICATE._serialized_end=1738 - _CARDANOSIGNTRANSACTIONREQUEST_CERTIFICATE_STAKEDELEGATION._serialized_start=1674 - _CARDANOSIGNTRANSACTIONREQUEST_CERTIFICATE_STAKEDELEGATION._serialized_end=1730 - _CARDANOSIGNTRANSACTIONREQUEST_WITHDRAWAL._serialized_start=1740 - _CARDANOSIGNTRANSACTIONREQUEST_WITHDRAWAL._serialized_end=1784 - _CARDANOSIGNTRANSACTIONRESPONSE._serialized_start=1787 - _CARDANOSIGNTRANSACTIONRESPONSE._serialized_end=1972 - _CARDANOSIGNTRANSACTIONRESPONSE_SHELLEYWITNESS._serialized_start=1917 - _CARDANOSIGNTRANSACTIONRESPONSE_SHELLEYWITNESS._serialized_end=1972 - _CARDANOREQUEST._serialized_start=1975 - _CARDANOREQUEST._serialized_end=2207 - _CARDANORESPONSE._serialized_start=2210 - _CARDANORESPONSE._serialized_end=2432 + _CARDANOSIGNTRANSACTIONREQUEST._serialized_end=2202 + _CARDANOSIGNTRANSACTIONREQUEST_INPUT._serialized_start=1008 + _CARDANOSIGNTRANSACTIONREQUEST_INPUT._serialized_end=1079 + _CARDANOSIGNTRANSACTIONREQUEST_ASSETGROUP._serialized_start=1082 + _CARDANOSIGNTRANSACTIONREQUEST_ASSETGROUP._serialized_end=1243 + _CARDANOSIGNTRANSACTIONREQUEST_ASSETGROUP_TOKEN._serialized_start=1201 + _CARDANOSIGNTRANSACTIONREQUEST_ASSETGROUP_TOKEN._serialized_end=1243 + _CARDANOSIGNTRANSACTIONREQUEST_OUTPUT._serialized_start=1246 + _CARDANOSIGNTRANSACTIONREQUEST_OUTPUT._serialized_end=1446 + _CARDANOSIGNTRANSACTIONREQUEST_CERTIFICATE._serialized_start=1449 + _CARDANOSIGNTRANSACTIONREQUEST_CERTIFICATE._serialized_end=2156 + _CARDANOSIGNTRANSACTIONREQUEST_CERTIFICATE_STAKEDELEGATION._serialized_start=1804 + _CARDANOSIGNTRANSACTIONREQUEST_CERTIFICATE_STAKEDELEGATION._serialized_end=1860 + _CARDANOSIGNTRANSACTIONREQUEST_CERTIFICATE_VOTEDELEGATION._serialized_start=1863 + _CARDANOSIGNTRANSACTIONREQUEST_CERTIFICATE_VOTEDELEGATION._serialized_end=2148 + _CARDANOSIGNTRANSACTIONREQUEST_CERTIFICATE_VOTEDELEGATION_CARDANODREPTYPE._serialized_start=2036 + _CARDANOSIGNTRANSACTIONREQUEST_CERTIFICATE_VOTEDELEGATION_CARDANODREPTYPE._serialized_end=2130 + _CARDANOSIGNTRANSACTIONREQUEST_WITHDRAWAL._serialized_start=2158 + _CARDANOSIGNTRANSACTIONREQUEST_WITHDRAWAL._serialized_end=2202 + _CARDANOSIGNTRANSACTIONRESPONSE._serialized_start=2205 + _CARDANOSIGNTRANSACTIONRESPONSE._serialized_end=2390 + _CARDANOSIGNTRANSACTIONRESPONSE_SHELLEYWITNESS._serialized_start=2335 + _CARDANOSIGNTRANSACTIONRESPONSE_SHELLEYWITNESS._serialized_end=2390 + _CARDANOREQUEST._serialized_start=2393 + _CARDANOREQUEST._serialized_end=2625 + _CARDANORESPONSE._serialized_start=2628 + _CARDANORESPONSE._serialized_end=2850 # @@protoc_insertion_point(module_scope) diff --git a/hwilib/devices/bitbox02_lib/communication/generated/cardano_pb2.pyi b/hwilib/devices/bitbox02_lib/communication/generated/cardano_pb2.pyi deleted file mode 100644 index f85c4668a..000000000 --- a/hwilib/devices/bitbox02_lib/communication/generated/cardano_pb2.pyi +++ /dev/null @@ -1,340 +0,0 @@ -""" -@generated by mypy-protobuf. Do not edit manually! -isort:skip_file -""" -import builtins -from . import common_pb2 -import google.protobuf.descriptor -import google.protobuf.internal.containers -import google.protobuf.internal.enum_type_wrapper -import google.protobuf.message -import typing -import typing_extensions - -DESCRIPTOR: google.protobuf.descriptor.FileDescriptor - -class _CardanoNetwork: - ValueType = typing.NewType('ValueType', builtins.int) - V: typing_extensions.TypeAlias = ValueType -class _CardanoNetworkEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_CardanoNetwork.ValueType], builtins.type): - DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor - CardanoMainnet: _CardanoNetwork.ValueType # 0 - CardanoTestnet: _CardanoNetwork.ValueType # 1 -class CardanoNetwork(_CardanoNetwork, metaclass=_CardanoNetworkEnumTypeWrapper): - pass - -CardanoMainnet: CardanoNetwork.ValueType # 0 -CardanoTestnet: CardanoNetwork.ValueType # 1 -global___CardanoNetwork = CardanoNetwork - - -class CardanoXpubsRequest(google.protobuf.message.Message): - DESCRIPTOR: google.protobuf.descriptor.Descriptor - KEYPATHS_FIELD_NUMBER: builtins.int - @property - def keypaths(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[common_pb2.Keypath]: ... - def __init__(self, - *, - keypaths: typing.Optional[typing.Iterable[common_pb2.Keypath]] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["keypaths",b"keypaths"]) -> None: ... -global___CardanoXpubsRequest = CardanoXpubsRequest - -class CardanoXpubsResponse(google.protobuf.message.Message): - DESCRIPTOR: google.protobuf.descriptor.Descriptor - XPUBS_FIELD_NUMBER: builtins.int - @property - def xpubs(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.bytes]: ... - def __init__(self, - *, - xpubs: typing.Optional[typing.Iterable[builtins.bytes]] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["xpubs",b"xpubs"]) -> None: ... -global___CardanoXpubsResponse = CardanoXpubsResponse - -class CardanoScriptConfig(google.protobuf.message.Message): - DESCRIPTOR: google.protobuf.descriptor.Descriptor - class PkhSkh(google.protobuf.message.Message): - DESCRIPTOR: google.protobuf.descriptor.Descriptor - KEYPATH_PAYMENT_FIELD_NUMBER: builtins.int - KEYPATH_STAKE_FIELD_NUMBER: builtins.int - @property - def keypath_payment(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]: ... - @property - def keypath_stake(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]: ... - def __init__(self, - *, - keypath_payment: typing.Optional[typing.Iterable[builtins.int]] = ..., - keypath_stake: typing.Optional[typing.Iterable[builtins.int]] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["keypath_payment",b"keypath_payment","keypath_stake",b"keypath_stake"]) -> None: ... - - PKH_SKH_FIELD_NUMBER: builtins.int - @property - def pkh_skh(self) -> global___CardanoScriptConfig.PkhSkh: - """Shelley PaymentKeyHash & StakeKeyHash""" - pass - def __init__(self, - *, - pkh_skh: typing.Optional[global___CardanoScriptConfig.PkhSkh] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["config",b"config","pkh_skh",b"pkh_skh"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["config",b"config","pkh_skh",b"pkh_skh"]) -> None: ... - def WhichOneof(self, oneof_group: typing_extensions.Literal["config",b"config"]) -> typing.Optional[typing_extensions.Literal["pkh_skh"]]: ... -global___CardanoScriptConfig = CardanoScriptConfig - -class CardanoAddressRequest(google.protobuf.message.Message): - DESCRIPTOR: google.protobuf.descriptor.Descriptor - NETWORK_FIELD_NUMBER: builtins.int - DISPLAY_FIELD_NUMBER: builtins.int - SCRIPT_CONFIG_FIELD_NUMBER: builtins.int - network: global___CardanoNetwork.ValueType - display: builtins.bool - @property - def script_config(self) -> global___CardanoScriptConfig: ... - def __init__(self, - *, - network: global___CardanoNetwork.ValueType = ..., - display: builtins.bool = ..., - script_config: typing.Optional[global___CardanoScriptConfig] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["script_config",b"script_config"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["display",b"display","network",b"network","script_config",b"script_config"]) -> None: ... -global___CardanoAddressRequest = CardanoAddressRequest - -class CardanoSignTransactionRequest(google.protobuf.message.Message): - """Max allowed transaction size is 16384 bytes according to - https://github.com/cardano-foundation/CIPs/blob/master/CIP-0009/CIP-0009.md. Unlike with BTC, we - can fit the whole request in RAM and don't need to stream. - - See also: https://github.com/input-output-hk/cardano-ledger-specs/blob/d0aa86ded0b973b09b629e5aa62aa1e71364d088/eras/alonzo/test-suite/cddl-files/alonzo.cddl#L50 - """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor - class Input(google.protobuf.message.Message): - DESCRIPTOR: google.protobuf.descriptor.Descriptor - KEYPATH_FIELD_NUMBER: builtins.int - PREV_OUT_HASH_FIELD_NUMBER: builtins.int - PREV_OUT_INDEX_FIELD_NUMBER: builtins.int - @property - def keypath(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]: ... - prev_out_hash: builtins.bytes - prev_out_index: builtins.int - def __init__(self, - *, - keypath: typing.Optional[typing.Iterable[builtins.int]] = ..., - prev_out_hash: builtins.bytes = ..., - prev_out_index: builtins.int = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["keypath",b"keypath","prev_out_hash",b"prev_out_hash","prev_out_index",b"prev_out_index"]) -> None: ... - - class AssetGroup(google.protobuf.message.Message): - """https://github.com/input-output-hk/cardano-ledger/blob/d0aa86ded0b973b09b629e5aa62aa1e71364d088/eras/alonzo/test-suite/cddl-files/alonzo.cddl#L358""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - class Token(google.protobuf.message.Message): - DESCRIPTOR: google.protobuf.descriptor.Descriptor - ASSET_NAME_FIELD_NUMBER: builtins.int - VALUE_FIELD_NUMBER: builtins.int - asset_name: builtins.bytes - value: builtins.int - """Number of tokens transacted of this asset.""" - - def __init__(self, - *, - asset_name: builtins.bytes = ..., - value: builtins.int = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["asset_name",b"asset_name","value",b"value"]) -> None: ... - - POLICY_ID_FIELD_NUMBER: builtins.int - TOKENS_FIELD_NUMBER: builtins.int - policy_id: builtins.bytes - @property - def tokens(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___CardanoSignTransactionRequest.AssetGroup.Token]: ... - def __init__(self, - *, - policy_id: builtins.bytes = ..., - tokens: typing.Optional[typing.Iterable[global___CardanoSignTransactionRequest.AssetGroup.Token]] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["policy_id",b"policy_id","tokens",b"tokens"]) -> None: ... - - class Output(google.protobuf.message.Message): - DESCRIPTOR: google.protobuf.descriptor.Descriptor - ENCODED_ADDRESS_FIELD_NUMBER: builtins.int - VALUE_FIELD_NUMBER: builtins.int - SCRIPT_CONFIG_FIELD_NUMBER: builtins.int - ASSET_GROUPS_FIELD_NUMBER: builtins.int - encoded_address: typing.Text - value: builtins.int - @property - def script_config(self) -> global___CardanoScriptConfig: - """Optional. If provided, this is validated as a change output.""" - pass - @property - def asset_groups(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___CardanoSignTransactionRequest.AssetGroup]: ... - def __init__(self, - *, - encoded_address: typing.Text = ..., - value: builtins.int = ..., - script_config: typing.Optional[global___CardanoScriptConfig] = ..., - asset_groups: typing.Optional[typing.Iterable[global___CardanoSignTransactionRequest.AssetGroup]] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["script_config",b"script_config"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["asset_groups",b"asset_groups","encoded_address",b"encoded_address","script_config",b"script_config","value",b"value"]) -> None: ... - - class Certificate(google.protobuf.message.Message): - """See https://github.com/input-output-hk/cardano-ledger-specs/blob/d0aa86ded0b973b09b629e5aa62aa1e71364d088/eras/alonzo/test-suite/cddl-files/alonzo.cddl#L150""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - class StakeDelegation(google.protobuf.message.Message): - DESCRIPTOR: google.protobuf.descriptor.Descriptor - KEYPATH_FIELD_NUMBER: builtins.int - POOL_KEYHASH_FIELD_NUMBER: builtins.int - @property - def keypath(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]: ... - pool_keyhash: builtins.bytes - def __init__(self, - *, - keypath: typing.Optional[typing.Iterable[builtins.int]] = ..., - pool_keyhash: builtins.bytes = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["keypath",b"keypath","pool_keyhash",b"pool_keyhash"]) -> None: ... - - STAKE_REGISTRATION_FIELD_NUMBER: builtins.int - STAKE_DEREGISTRATION_FIELD_NUMBER: builtins.int - STAKE_DELEGATION_FIELD_NUMBER: builtins.int - @property - def stake_registration(self) -> common_pb2.Keypath: ... - @property - def stake_deregistration(self) -> common_pb2.Keypath: ... - @property - def stake_delegation(self) -> global___CardanoSignTransactionRequest.Certificate.StakeDelegation: ... - def __init__(self, - *, - stake_registration: typing.Optional[common_pb2.Keypath] = ..., - stake_deregistration: typing.Optional[common_pb2.Keypath] = ..., - stake_delegation: typing.Optional[global___CardanoSignTransactionRequest.Certificate.StakeDelegation] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["cert",b"cert","stake_delegation",b"stake_delegation","stake_deregistration",b"stake_deregistration","stake_registration",b"stake_registration"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["cert",b"cert","stake_delegation",b"stake_delegation","stake_deregistration",b"stake_deregistration","stake_registration",b"stake_registration"]) -> None: ... - def WhichOneof(self, oneof_group: typing_extensions.Literal["cert",b"cert"]) -> typing.Optional[typing_extensions.Literal["stake_registration","stake_deregistration","stake_delegation"]]: ... - - class Withdrawal(google.protobuf.message.Message): - DESCRIPTOR: google.protobuf.descriptor.Descriptor - KEYPATH_FIELD_NUMBER: builtins.int - VALUE_FIELD_NUMBER: builtins.int - @property - def keypath(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]: ... - value: builtins.int - def __init__(self, - *, - keypath: typing.Optional[typing.Iterable[builtins.int]] = ..., - value: builtins.int = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["keypath",b"keypath","value",b"value"]) -> None: ... - - NETWORK_FIELD_NUMBER: builtins.int - INPUTS_FIELD_NUMBER: builtins.int - OUTPUTS_FIELD_NUMBER: builtins.int - FEE_FIELD_NUMBER: builtins.int - TTL_FIELD_NUMBER: builtins.int - CERTIFICATES_FIELD_NUMBER: builtins.int - WITHDRAWALS_FIELD_NUMBER: builtins.int - VALIDITY_INTERVAL_START_FIELD_NUMBER: builtins.int - ALLOW_ZERO_TTL_FIELD_NUMBER: builtins.int - network: global___CardanoNetwork.ValueType - @property - def inputs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___CardanoSignTransactionRequest.Input]: ... - @property - def outputs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___CardanoSignTransactionRequest.Output]: ... - fee: builtins.int - ttl: builtins.int - @property - def certificates(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___CardanoSignTransactionRequest.Certificate]: ... - @property - def withdrawals(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___CardanoSignTransactionRequest.Withdrawal]: ... - validity_interval_start: builtins.int - allow_zero_ttl: builtins.bool - """include ttl even if it is zero""" - - def __init__(self, - *, - network: global___CardanoNetwork.ValueType = ..., - inputs: typing.Optional[typing.Iterable[global___CardanoSignTransactionRequest.Input]] = ..., - outputs: typing.Optional[typing.Iterable[global___CardanoSignTransactionRequest.Output]] = ..., - fee: builtins.int = ..., - ttl: builtins.int = ..., - certificates: typing.Optional[typing.Iterable[global___CardanoSignTransactionRequest.Certificate]] = ..., - withdrawals: typing.Optional[typing.Iterable[global___CardanoSignTransactionRequest.Withdrawal]] = ..., - validity_interval_start: builtins.int = ..., - allow_zero_ttl: builtins.bool = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["allow_zero_ttl",b"allow_zero_ttl","certificates",b"certificates","fee",b"fee","inputs",b"inputs","network",b"network","outputs",b"outputs","ttl",b"ttl","validity_interval_start",b"validity_interval_start","withdrawals",b"withdrawals"]) -> None: ... -global___CardanoSignTransactionRequest = CardanoSignTransactionRequest - -class CardanoSignTransactionResponse(google.protobuf.message.Message): - DESCRIPTOR: google.protobuf.descriptor.Descriptor - class ShelleyWitness(google.protobuf.message.Message): - DESCRIPTOR: google.protobuf.descriptor.Descriptor - PUBLIC_KEY_FIELD_NUMBER: builtins.int - SIGNATURE_FIELD_NUMBER: builtins.int - public_key: builtins.bytes - signature: builtins.bytes - def __init__(self, - *, - public_key: builtins.bytes = ..., - signature: builtins.bytes = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["public_key",b"public_key","signature",b"signature"]) -> None: ... - - SHELLEY_WITNESSES_FIELD_NUMBER: builtins.int - @property - def shelley_witnesses(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___CardanoSignTransactionResponse.ShelleyWitness]: ... - def __init__(self, - *, - shelley_witnesses: typing.Optional[typing.Iterable[global___CardanoSignTransactionResponse.ShelleyWitness]] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["shelley_witnesses",b"shelley_witnesses"]) -> None: ... -global___CardanoSignTransactionResponse = CardanoSignTransactionResponse - -class CardanoRequest(google.protobuf.message.Message): - DESCRIPTOR: google.protobuf.descriptor.Descriptor - XPUBS_FIELD_NUMBER: builtins.int - ADDRESS_FIELD_NUMBER: builtins.int - SIGN_TRANSACTION_FIELD_NUMBER: builtins.int - @property - def xpubs(self) -> global___CardanoXpubsRequest: ... - @property - def address(self) -> global___CardanoAddressRequest: ... - @property - def sign_transaction(self) -> global___CardanoSignTransactionRequest: ... - def __init__(self, - *, - xpubs: typing.Optional[global___CardanoXpubsRequest] = ..., - address: typing.Optional[global___CardanoAddressRequest] = ..., - sign_transaction: typing.Optional[global___CardanoSignTransactionRequest] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["address",b"address","request",b"request","sign_transaction",b"sign_transaction","xpubs",b"xpubs"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["address",b"address","request",b"request","sign_transaction",b"sign_transaction","xpubs",b"xpubs"]) -> None: ... - def WhichOneof(self, oneof_group: typing_extensions.Literal["request",b"request"]) -> typing.Optional[typing_extensions.Literal["xpubs","address","sign_transaction"]]: ... -global___CardanoRequest = CardanoRequest - -class CardanoResponse(google.protobuf.message.Message): - DESCRIPTOR: google.protobuf.descriptor.Descriptor - XPUBS_FIELD_NUMBER: builtins.int - PUB_FIELD_NUMBER: builtins.int - SIGN_TRANSACTION_FIELD_NUMBER: builtins.int - @property - def xpubs(self) -> global___CardanoXpubsResponse: ... - @property - def pub(self) -> common_pb2.PubResponse: ... - @property - def sign_transaction(self) -> global___CardanoSignTransactionResponse: ... - def __init__(self, - *, - xpubs: typing.Optional[global___CardanoXpubsResponse] = ..., - pub: typing.Optional[common_pb2.PubResponse] = ..., - sign_transaction: typing.Optional[global___CardanoSignTransactionResponse] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["pub",b"pub","response",b"response","sign_transaction",b"sign_transaction","xpubs",b"xpubs"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["pub",b"pub","response",b"response","sign_transaction",b"sign_transaction","xpubs",b"xpubs"]) -> None: ... - def WhichOneof(self, oneof_group: typing_extensions.Literal["response",b"response"]) -> typing.Optional[typing_extensions.Literal["xpubs","pub","sign_transaction"]]: ... -global___CardanoResponse = CardanoResponse diff --git a/hwilib/devices/bitbox02_lib/communication/generated/common_pb2.pyi b/hwilib/devices/bitbox02_lib/communication/generated/common_pb2.pyi index 93864b54f..4e73c7e3e 100644 --- a/hwilib/devices/bitbox02_lib/communication/generated/common_pb2.pyi +++ b/hwilib/devices/bitbox02_lib/communication/generated/common_pb2.pyi @@ -1,49 +1,78 @@ """ @generated by mypy-protobuf. Do not edit manually! isort:skip_file +Copyright 2019 Shift Cryptosecurity AG + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. """ + import builtins +import collections.abc import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message import typing -import typing_extensions DESCRIPTOR: google.protobuf.descriptor.FileDescriptor +@typing.final class PubResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + PUB_FIELD_NUMBER: builtins.int - pub: typing.Text - def __init__(self, + pub: builtins.str + def __init__( + self, *, - pub: typing.Text = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["pub",b"pub"]) -> None: ... + pub: builtins.str = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["pub", b"pub"]) -> None: ... + global___PubResponse = PubResponse +@typing.final class RootFingerprintRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor - def __init__(self, - ) -> None: ... + + def __init__( + self, + ) -> None: ... + global___RootFingerprintRequest = RootFingerprintRequest +@typing.final class RootFingerprintResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + FINGERPRINT_FIELD_NUMBER: builtins.int fingerprint: builtins.bytes - def __init__(self, + def __init__( + self, *, fingerprint: builtins.bytes = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["fingerprint",b"fingerprint"]) -> None: ... + ) -> None: ... + def ClearField(self, field_name: typing.Literal["fingerprint", b"fingerprint"]) -> None: ... + global___RootFingerprintResponse = RootFingerprintResponse +@typing.final class XPub(google.protobuf.message.Message): """See https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki. version field dropped as it will set dynamically based on the context (xpub, ypub, etc.). """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + DEPTH_FIELD_NUMBER: builtins.int PARENT_FINGERPRINT_FIELD_NUMBER: builtins.int CHILD_NUM_FIELD_NUMBER: builtins.int @@ -54,32 +83,41 @@ class XPub(google.protobuf.message.Message): child_num: builtins.int chain_code: builtins.bytes public_key: builtins.bytes - def __init__(self, + def __init__( + self, *, depth: builtins.bytes = ..., parent_fingerprint: builtins.bytes = ..., child_num: builtins.int = ..., chain_code: builtins.bytes = ..., public_key: builtins.bytes = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["chain_code",b"chain_code","child_num",b"child_num","depth",b"depth","parent_fingerprint",b"parent_fingerprint","public_key",b"public_key"]) -> None: ... + ) -> None: ... + def ClearField(self, field_name: typing.Literal["chain_code", b"chain_code", "child_num", b"child_num", "depth", b"depth", "parent_fingerprint", b"parent_fingerprint", "public_key", b"public_key"]) -> None: ... + global___XPub = XPub +@typing.final class Keypath(google.protobuf.message.Message): """This message exists for use in oneof or repeated fields, where one can't inline `repeated uint32` due to protobuf rules.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + KEYPATH_FIELD_NUMBER: builtins.int @property def keypath(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]: ... - def __init__(self, + def __init__( + self, *, - keypath: typing.Optional[typing.Iterable[builtins.int]] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["keypath",b"keypath"]) -> None: ... + keypath: collections.abc.Iterable[builtins.int] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["keypath", b"keypath"]) -> None: ... + global___Keypath = Keypath +@typing.final class KeyOriginInfo(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + ROOT_FINGERPRINT_FIELD_NUMBER: builtins.int KEYPATH_FIELD_NUMBER: builtins.int XPUB_FIELD_NUMBER: builtins.int @@ -88,12 +126,14 @@ class KeyOriginInfo(google.protobuf.message.Message): def keypath(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]: ... @property def xpub(self) -> global___XPub: ... - def __init__(self, + def __init__( + self, *, root_fingerprint: builtins.bytes = ..., - keypath: typing.Optional[typing.Iterable[builtins.int]] = ..., - xpub: typing.Optional[global___XPub] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["xpub",b"xpub"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["keypath",b"keypath","root_fingerprint",b"root_fingerprint","xpub",b"xpub"]) -> None: ... + keypath: collections.abc.Iterable[builtins.int] | None = ..., + xpub: global___XPub | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["xpub", b"xpub"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["keypath", b"keypath", "root_fingerprint", b"root_fingerprint", "xpub", b"xpub"]) -> None: ... + global___KeyOriginInfo = KeyOriginInfo diff --git a/hwilib/devices/bitbox02_lib/communication/generated/eth_pb2.py b/hwilib/devices/bitbox02_lib/communication/generated/eth_pb2.py index c871b3589..ce8cd4012 100644 --- a/hwilib/devices/bitbox02_lib/communication/generated/eth_pb2.py +++ b/hwilib/devices/bitbox02_lib/communication/generated/eth_pb2.py @@ -15,45 +15,47 @@ from . import antiklepto_pb2 as antiklepto__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\teth.proto\x12\x14shiftcrypto.bitbox02\x1a\x0c\x63ommon.proto\x1a\x10\x61ntiklepto.proto\"\xf4\x01\n\rETHPubRequest\x12\x0f\n\x07keypath\x18\x01 \x03(\r\x12+\n\x04\x63oin\x18\x02 \x01(\x0e\x32\x1d.shiftcrypto.bitbox02.ETHCoin\x12\x43\n\x0boutput_type\x18\x03 \x01(\x0e\x32..shiftcrypto.bitbox02.ETHPubRequest.OutputType\x12\x0f\n\x07\x64isplay\x18\x04 \x01(\x08\x12\x18\n\x10\x63ontract_address\x18\x05 \x01(\x0c\x12\x10\n\x08\x63hain_id\x18\x06 \x01(\x04\"#\n\nOutputType\x12\x0b\n\x07\x41\x44\x44RESS\x10\x00\x12\x08\n\x04XPUB\x10\x01\"\x99\x02\n\x0e\x45THSignRequest\x12+\n\x04\x63oin\x18\x01 \x01(\x0e\x32\x1d.shiftcrypto.bitbox02.ETHCoin\x12\x0f\n\x07keypath\x18\x02 \x03(\r\x12\r\n\x05nonce\x18\x03 \x01(\x0c\x12\x11\n\tgas_price\x18\x04 \x01(\x0c\x12\x11\n\tgas_limit\x18\x05 \x01(\x0c\x12\x11\n\trecipient\x18\x06 \x01(\x0c\x12\r\n\x05value\x18\x07 \x01(\x0c\x12\x0c\n\x04\x64\x61ta\x18\x08 \x01(\x0c\x12R\n\x15host_nonce_commitment\x18\t \x01(\x0b\x32\x33.shiftcrypto.bitbox02.AntiKleptoHostNonceCommitment\x12\x10\n\x08\x63hain_id\x18\n \x01(\x04\"\x9b\x02\n\x15\x45THSignEIP1559Request\x12\x10\n\x08\x63hain_id\x18\x01 \x01(\x04\x12\x0f\n\x07keypath\x18\x02 \x03(\r\x12\r\n\x05nonce\x18\x03 \x01(\x0c\x12 \n\x18max_priority_fee_per_gas\x18\x04 \x01(\x0c\x12\x17\n\x0fmax_fee_per_gas\x18\x05 \x01(\x0c\x12\x11\n\tgas_limit\x18\x06 \x01(\x0c\x12\x11\n\trecipient\x18\x07 \x01(\x0c\x12\r\n\x05value\x18\x08 \x01(\x0c\x12\x0c\n\x04\x64\x61ta\x18\t \x01(\x0c\x12R\n\x15host_nonce_commitment\x18\n \x01(\x0b\x32\x33.shiftcrypto.bitbox02.AntiKleptoHostNonceCommitment\"\xc8\x01\n\x15\x45THSignMessageRequest\x12+\n\x04\x63oin\x18\x01 \x01(\x0e\x32\x1d.shiftcrypto.bitbox02.ETHCoin\x12\x0f\n\x07keypath\x18\x02 \x03(\r\x12\x0b\n\x03msg\x18\x03 \x01(\x0c\x12R\n\x15host_nonce_commitment\x18\x04 \x01(\x0b\x32\x33.shiftcrypto.bitbox02.AntiKleptoHostNonceCommitment\x12\x10\n\x08\x63hain_id\x18\x05 \x01(\x04\"$\n\x0f\x45THSignResponse\x12\x11\n\tsignature\x18\x01 \x01(\x0c\"\xfb\x05\n\x1a\x45THSignTypedMessageRequest\x12\x10\n\x08\x63hain_id\x18\x01 \x01(\x04\x12\x0f\n\x07keypath\x18\x02 \x03(\r\x12J\n\x05types\x18\x03 \x03(\x0b\x32;.shiftcrypto.bitbox02.ETHSignTypedMessageRequest.StructType\x12\x14\n\x0cprimary_type\x18\x04 \x01(\t\x12R\n\x15host_nonce_commitment\x18\x05 \x01(\x0b\x32\x33.shiftcrypto.bitbox02.AntiKleptoHostNonceCommitment\x1a\xc9\x01\n\nMemberType\x12G\n\x04type\x18\x01 \x01(\x0e\x32\x39.shiftcrypto.bitbox02.ETHSignTypedMessageRequest.DataType\x12\x0c\n\x04size\x18\x02 \x01(\r\x12\x13\n\x0bstruct_name\x18\x03 \x01(\t\x12O\n\narray_type\x18\x04 \x01(\x0b\x32;.shiftcrypto.bitbox02.ETHSignTypedMessageRequest.MemberType\x1a\x61\n\x06Member\x12\x0c\n\x04name\x18\x01 \x01(\t\x12I\n\x04type\x18\x02 \x01(\x0b\x32;.shiftcrypto.bitbox02.ETHSignTypedMessageRequest.MemberType\x1a\x64\n\nStructType\x12\x0c\n\x04name\x18\x01 \x01(\t\x12H\n\x07members\x18\x02 \x03(\x0b\x32\x37.shiftcrypto.bitbox02.ETHSignTypedMessageRequest.Member\"o\n\x08\x44\x61taType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\t\n\x05\x42YTES\x10\x01\x12\x08\n\x04UINT\x10\x02\x12\x07\n\x03INT\x10\x03\x12\x08\n\x04\x42OOL\x10\x04\x12\x0b\n\x07\x41\x44\x44RESS\x10\x05\x12\n\n\x06STRING\x10\x06\x12\t\n\x05\x41RRAY\x10\x07\x12\n\n\x06STRUCT\x10\x08\"\xb4\x01\n\x1c\x45THTypedMessageValueResponse\x12R\n\x0broot_object\x18\x01 \x01(\x0e\x32=.shiftcrypto.bitbox02.ETHTypedMessageValueResponse.RootObject\x12\x0c\n\x04path\x18\x02 \x03(\r\"2\n\nRootObject\x12\x0b\n\x07UNKNOWN\x10\x00\x12\n\n\x06\x44OMAIN\x10\x01\x12\x0b\n\x07MESSAGE\x10\x02\",\n\x1b\x45THTypedMessageValueRequest\x12\r\n\x05value\x18\x01 \x01(\x0c\"\xf3\x03\n\nETHRequest\x12\x32\n\x03pub\x18\x01 \x01(\x0b\x32#.shiftcrypto.bitbox02.ETHPubRequestH\x00\x12\x34\n\x04sign\x18\x02 \x01(\x0b\x32$.shiftcrypto.bitbox02.ETHSignRequestH\x00\x12?\n\x08sign_msg\x18\x03 \x01(\x0b\x32+.shiftcrypto.bitbox02.ETHSignMessageRequestH\x00\x12P\n\x14\x61ntiklepto_signature\x18\x04 \x01(\x0b\x32\x30.shiftcrypto.bitbox02.AntiKleptoSignatureRequestH\x00\x12J\n\x0esign_typed_msg\x18\x05 \x01(\x0b\x32\x30.shiftcrypto.bitbox02.ETHSignTypedMessageRequestH\x00\x12L\n\x0ftyped_msg_value\x18\x06 \x01(\x0b\x32\x31.shiftcrypto.bitbox02.ETHTypedMessageValueRequestH\x00\x12\x43\n\x0csign_eip1559\x18\x07 \x01(\x0b\x32+.shiftcrypto.bitbox02.ETHSignEIP1559RequestH\x00\x42\t\n\x07request\"\xab\x02\n\x0b\x45THResponse\x12\x30\n\x03pub\x18\x01 \x01(\x0b\x32!.shiftcrypto.bitbox02.PubResponseH\x00\x12\x35\n\x04sign\x18\x02 \x01(\x0b\x32%.shiftcrypto.bitbox02.ETHSignResponseH\x00\x12X\n\x1c\x61ntiklepto_signer_commitment\x18\x03 \x01(\x0b\x32\x30.shiftcrypto.bitbox02.AntiKleptoSignerCommitmentH\x00\x12M\n\x0ftyped_msg_value\x18\x04 \x01(\x0b\x32\x32.shiftcrypto.bitbox02.ETHTypedMessageValueResponseH\x00\x42\n\n\x08response*2\n\x07\x45THCoin\x12\x07\n\x03\x45TH\x10\x00\x12\x0e\n\nRopstenETH\x10\x01\x12\x0e\n\nRinkebyETH\x10\x02\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\teth.proto\x12\x14shiftcrypto.bitbox02\x1a\x0c\x63ommon.proto\x1a\x10\x61ntiklepto.proto\"\xf4\x01\n\rETHPubRequest\x12\x0f\n\x07keypath\x18\x01 \x03(\r\x12+\n\x04\x63oin\x18\x02 \x01(\x0e\x32\x1d.shiftcrypto.bitbox02.ETHCoin\x12\x43\n\x0boutput_type\x18\x03 \x01(\x0e\x32..shiftcrypto.bitbox02.ETHPubRequest.OutputType\x12\x0f\n\x07\x64isplay\x18\x04 \x01(\x08\x12\x18\n\x10\x63ontract_address\x18\x05 \x01(\x0c\x12\x10\n\x08\x63hain_id\x18\x06 \x01(\x04\"#\n\nOutputType\x12\x0b\n\x07\x41\x44\x44RESS\x10\x00\x12\x08\n\x04XPUB\x10\x01\"\xd5\x02\n\x0e\x45THSignRequest\x12+\n\x04\x63oin\x18\x01 \x01(\x0e\x32\x1d.shiftcrypto.bitbox02.ETHCoin\x12\x0f\n\x07keypath\x18\x02 \x03(\r\x12\r\n\x05nonce\x18\x03 \x01(\x0c\x12\x11\n\tgas_price\x18\x04 \x01(\x0c\x12\x11\n\tgas_limit\x18\x05 \x01(\x0c\x12\x11\n\trecipient\x18\x06 \x01(\x0c\x12\r\n\x05value\x18\x07 \x01(\x0c\x12\x0c\n\x04\x64\x61ta\x18\x08 \x01(\x0c\x12R\n\x15host_nonce_commitment\x18\t \x01(\x0b\x32\x33.shiftcrypto.bitbox02.AntiKleptoHostNonceCommitment\x12\x10\n\x08\x63hain_id\x18\n \x01(\x04\x12:\n\x0c\x61\x64\x64ress_case\x18\x0b \x01(\x0e\x32$.shiftcrypto.bitbox02.ETHAddressCase\"\xd7\x02\n\x15\x45THSignEIP1559Request\x12\x10\n\x08\x63hain_id\x18\x01 \x01(\x04\x12\x0f\n\x07keypath\x18\x02 \x03(\r\x12\r\n\x05nonce\x18\x03 \x01(\x0c\x12 \n\x18max_priority_fee_per_gas\x18\x04 \x01(\x0c\x12\x17\n\x0fmax_fee_per_gas\x18\x05 \x01(\x0c\x12\x11\n\tgas_limit\x18\x06 \x01(\x0c\x12\x11\n\trecipient\x18\x07 \x01(\x0c\x12\r\n\x05value\x18\x08 \x01(\x0c\x12\x0c\n\x04\x64\x61ta\x18\t \x01(\x0c\x12R\n\x15host_nonce_commitment\x18\n \x01(\x0b\x32\x33.shiftcrypto.bitbox02.AntiKleptoHostNonceCommitment\x12:\n\x0c\x61\x64\x64ress_case\x18\x0b \x01(\x0e\x32$.shiftcrypto.bitbox02.ETHAddressCase\"\xc8\x01\n\x15\x45THSignMessageRequest\x12+\n\x04\x63oin\x18\x01 \x01(\x0e\x32\x1d.shiftcrypto.bitbox02.ETHCoin\x12\x0f\n\x07keypath\x18\x02 \x03(\r\x12\x0b\n\x03msg\x18\x03 \x01(\x0c\x12R\n\x15host_nonce_commitment\x18\x04 \x01(\x0b\x32\x33.shiftcrypto.bitbox02.AntiKleptoHostNonceCommitment\x12\x10\n\x08\x63hain_id\x18\x05 \x01(\x04\"$\n\x0f\x45THSignResponse\x12\x11\n\tsignature\x18\x01 \x01(\x0c\"\xfb\x05\n\x1a\x45THSignTypedMessageRequest\x12\x10\n\x08\x63hain_id\x18\x01 \x01(\x04\x12\x0f\n\x07keypath\x18\x02 \x03(\r\x12J\n\x05types\x18\x03 \x03(\x0b\x32;.shiftcrypto.bitbox02.ETHSignTypedMessageRequest.StructType\x12\x14\n\x0cprimary_type\x18\x04 \x01(\t\x12R\n\x15host_nonce_commitment\x18\x05 \x01(\x0b\x32\x33.shiftcrypto.bitbox02.AntiKleptoHostNonceCommitment\x1a\xc9\x01\n\nMemberType\x12G\n\x04type\x18\x01 \x01(\x0e\x32\x39.shiftcrypto.bitbox02.ETHSignTypedMessageRequest.DataType\x12\x0c\n\x04size\x18\x02 \x01(\r\x12\x13\n\x0bstruct_name\x18\x03 \x01(\t\x12O\n\narray_type\x18\x04 \x01(\x0b\x32;.shiftcrypto.bitbox02.ETHSignTypedMessageRequest.MemberType\x1a\x61\n\x06Member\x12\x0c\n\x04name\x18\x01 \x01(\t\x12I\n\x04type\x18\x02 \x01(\x0b\x32;.shiftcrypto.bitbox02.ETHSignTypedMessageRequest.MemberType\x1a\x64\n\nStructType\x12\x0c\n\x04name\x18\x01 \x01(\t\x12H\n\x07members\x18\x02 \x03(\x0b\x32\x37.shiftcrypto.bitbox02.ETHSignTypedMessageRequest.Member\"o\n\x08\x44\x61taType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\t\n\x05\x42YTES\x10\x01\x12\x08\n\x04UINT\x10\x02\x12\x07\n\x03INT\x10\x03\x12\x08\n\x04\x42OOL\x10\x04\x12\x0b\n\x07\x41\x44\x44RESS\x10\x05\x12\n\n\x06STRING\x10\x06\x12\t\n\x05\x41RRAY\x10\x07\x12\n\n\x06STRUCT\x10\x08\"\xb4\x01\n\x1c\x45THTypedMessageValueResponse\x12R\n\x0broot_object\x18\x01 \x01(\x0e\x32=.shiftcrypto.bitbox02.ETHTypedMessageValueResponse.RootObject\x12\x0c\n\x04path\x18\x02 \x03(\r\"2\n\nRootObject\x12\x0b\n\x07UNKNOWN\x10\x00\x12\n\n\x06\x44OMAIN\x10\x01\x12\x0b\n\x07MESSAGE\x10\x02\",\n\x1b\x45THTypedMessageValueRequest\x12\r\n\x05value\x18\x01 \x01(\x0c\"\xf3\x03\n\nETHRequest\x12\x32\n\x03pub\x18\x01 \x01(\x0b\x32#.shiftcrypto.bitbox02.ETHPubRequestH\x00\x12\x34\n\x04sign\x18\x02 \x01(\x0b\x32$.shiftcrypto.bitbox02.ETHSignRequestH\x00\x12?\n\x08sign_msg\x18\x03 \x01(\x0b\x32+.shiftcrypto.bitbox02.ETHSignMessageRequestH\x00\x12P\n\x14\x61ntiklepto_signature\x18\x04 \x01(\x0b\x32\x30.shiftcrypto.bitbox02.AntiKleptoSignatureRequestH\x00\x12J\n\x0esign_typed_msg\x18\x05 \x01(\x0b\x32\x30.shiftcrypto.bitbox02.ETHSignTypedMessageRequestH\x00\x12L\n\x0ftyped_msg_value\x18\x06 \x01(\x0b\x32\x31.shiftcrypto.bitbox02.ETHTypedMessageValueRequestH\x00\x12\x43\n\x0csign_eip1559\x18\x07 \x01(\x0b\x32+.shiftcrypto.bitbox02.ETHSignEIP1559RequestH\x00\x42\t\n\x07request\"\xab\x02\n\x0b\x45THResponse\x12\x30\n\x03pub\x18\x01 \x01(\x0b\x32!.shiftcrypto.bitbox02.PubResponseH\x00\x12\x35\n\x04sign\x18\x02 \x01(\x0b\x32%.shiftcrypto.bitbox02.ETHSignResponseH\x00\x12X\n\x1c\x61ntiklepto_signer_commitment\x18\x03 \x01(\x0b\x32\x30.shiftcrypto.bitbox02.AntiKleptoSignerCommitmentH\x00\x12M\n\x0ftyped_msg_value\x18\x04 \x01(\x0b\x32\x32.shiftcrypto.bitbox02.ETHTypedMessageValueResponseH\x00\x42\n\n\x08response*2\n\x07\x45THCoin\x12\x07\n\x03\x45TH\x10\x00\x12\x0e\n\nRopstenETH\x10\x01\x12\x0e\n\nRinkebyETH\x10\x02*d\n\x0e\x45THAddressCase\x12\x1a\n\x16\x45TH_ADDRESS_CASE_MIXED\x10\x00\x12\x1a\n\x16\x45TH_ADDRESS_CASE_UPPER\x10\x01\x12\x1a\n\x16\x45TH_ADDRESS_CASE_LOWER\x10\x02\x62\x06proto3') _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'eth_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None - _ETHCOIN._serialized_start=2924 - _ETHCOIN._serialized_end=2974 + _ETHCOIN._serialized_start=3044 + _ETHCOIN._serialized_end=3094 + _ETHADDRESSCASE._serialized_start=3096 + _ETHADDRESSCASE._serialized_end=3196 _ETHPUBREQUEST._serialized_start=68 _ETHPUBREQUEST._serialized_end=312 _ETHPUBREQUEST_OUTPUTTYPE._serialized_start=277 _ETHPUBREQUEST_OUTPUTTYPE._serialized_end=312 _ETHSIGNREQUEST._serialized_start=315 - _ETHSIGNREQUEST._serialized_end=596 - _ETHSIGNEIP1559REQUEST._serialized_start=599 - _ETHSIGNEIP1559REQUEST._serialized_end=882 - _ETHSIGNMESSAGEREQUEST._serialized_start=885 - _ETHSIGNMESSAGEREQUEST._serialized_end=1085 - _ETHSIGNRESPONSE._serialized_start=1087 - _ETHSIGNRESPONSE._serialized_end=1123 - _ETHSIGNTYPEDMESSAGEREQUEST._serialized_start=1126 - _ETHSIGNTYPEDMESSAGEREQUEST._serialized_end=1889 - _ETHSIGNTYPEDMESSAGEREQUEST_MEMBERTYPE._serialized_start=1374 - _ETHSIGNTYPEDMESSAGEREQUEST_MEMBERTYPE._serialized_end=1575 - _ETHSIGNTYPEDMESSAGEREQUEST_MEMBER._serialized_start=1577 - _ETHSIGNTYPEDMESSAGEREQUEST_MEMBER._serialized_end=1674 - _ETHSIGNTYPEDMESSAGEREQUEST_STRUCTTYPE._serialized_start=1676 - _ETHSIGNTYPEDMESSAGEREQUEST_STRUCTTYPE._serialized_end=1776 - _ETHSIGNTYPEDMESSAGEREQUEST_DATATYPE._serialized_start=1778 - _ETHSIGNTYPEDMESSAGEREQUEST_DATATYPE._serialized_end=1889 - _ETHTYPEDMESSAGEVALUERESPONSE._serialized_start=1892 - _ETHTYPEDMESSAGEVALUERESPONSE._serialized_end=2072 - _ETHTYPEDMESSAGEVALUERESPONSE_ROOTOBJECT._serialized_start=2022 - _ETHTYPEDMESSAGEVALUERESPONSE_ROOTOBJECT._serialized_end=2072 - _ETHTYPEDMESSAGEVALUEREQUEST._serialized_start=2074 - _ETHTYPEDMESSAGEVALUEREQUEST._serialized_end=2118 - _ETHREQUEST._serialized_start=2121 - _ETHREQUEST._serialized_end=2620 - _ETHRESPONSE._serialized_start=2623 - _ETHRESPONSE._serialized_end=2922 + _ETHSIGNREQUEST._serialized_end=656 + _ETHSIGNEIP1559REQUEST._serialized_start=659 + _ETHSIGNEIP1559REQUEST._serialized_end=1002 + _ETHSIGNMESSAGEREQUEST._serialized_start=1005 + _ETHSIGNMESSAGEREQUEST._serialized_end=1205 + _ETHSIGNRESPONSE._serialized_start=1207 + _ETHSIGNRESPONSE._serialized_end=1243 + _ETHSIGNTYPEDMESSAGEREQUEST._serialized_start=1246 + _ETHSIGNTYPEDMESSAGEREQUEST._serialized_end=2009 + _ETHSIGNTYPEDMESSAGEREQUEST_MEMBERTYPE._serialized_start=1494 + _ETHSIGNTYPEDMESSAGEREQUEST_MEMBERTYPE._serialized_end=1695 + _ETHSIGNTYPEDMESSAGEREQUEST_MEMBER._serialized_start=1697 + _ETHSIGNTYPEDMESSAGEREQUEST_MEMBER._serialized_end=1794 + _ETHSIGNTYPEDMESSAGEREQUEST_STRUCTTYPE._serialized_start=1796 + _ETHSIGNTYPEDMESSAGEREQUEST_STRUCTTYPE._serialized_end=1896 + _ETHSIGNTYPEDMESSAGEREQUEST_DATATYPE._serialized_start=1898 + _ETHSIGNTYPEDMESSAGEREQUEST_DATATYPE._serialized_end=2009 + _ETHTYPEDMESSAGEVALUERESPONSE._serialized_start=2012 + _ETHTYPEDMESSAGEVALUERESPONSE._serialized_end=2192 + _ETHTYPEDMESSAGEVALUERESPONSE_ROOTOBJECT._serialized_start=2142 + _ETHTYPEDMESSAGEVALUERESPONSE_ROOTOBJECT._serialized_end=2192 + _ETHTYPEDMESSAGEVALUEREQUEST._serialized_start=2194 + _ETHTYPEDMESSAGEVALUEREQUEST._serialized_end=2238 + _ETHREQUEST._serialized_start=2241 + _ETHREQUEST._serialized_end=2740 + _ETHRESPONSE._serialized_start=2743 + _ETHRESPONSE._serialized_end=3042 # @@protoc_insertion_point(module_scope) diff --git a/hwilib/devices/bitbox02_lib/communication/generated/eth_pb2.pyi b/hwilib/devices/bitbox02_lib/communication/generated/eth_pb2.pyi index e29bbbad7..4bb6e8533 100644 --- a/hwilib/devices/bitbox02_lib/communication/generated/eth_pb2.pyi +++ b/hwilib/devices/bitbox02_lib/communication/generated/eth_pb2.pyi @@ -1,57 +1,92 @@ """ @generated by mypy-protobuf. Do not edit manually! isort:skip_file +Copyright 2019 Shift Cryptosecurity AG + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. """ + from . import antiklepto_pb2 import builtins +import collections.abc from . import common_pb2 import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message +import sys import typing -import typing_extensions + +if sys.version_info >= (3, 10): + import typing as typing_extensions +else: + import typing_extensions DESCRIPTOR: google.protobuf.descriptor.FileDescriptor class _ETHCoin: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType + class _ETHCoinEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_ETHCoin.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor ETH: _ETHCoin.ValueType # 0 RopstenETH: _ETHCoin.ValueType # 1 """Removed in v9.14.0 - deprecated""" - RinkebyETH: _ETHCoin.ValueType # 2 """Removed in v9.14.0 - deprecated""" class ETHCoin(_ETHCoin, metaclass=_ETHCoinEnumTypeWrapper): """Kept for backwards compatibility. Use chain_id instead, introduced in v9.10.0.""" - pass ETH: ETHCoin.ValueType # 0 RopstenETH: ETHCoin.ValueType # 1 """Removed in v9.14.0 - deprecated""" - RinkebyETH: ETHCoin.ValueType # 2 """Removed in v9.14.0 - deprecated""" - global___ETHCoin = ETHCoin +class _ETHAddressCase: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + +class _ETHAddressCaseEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_ETHAddressCase.ValueType], builtins.type): + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + ETH_ADDRESS_CASE_MIXED: _ETHAddressCase.ValueType # 0 + ETH_ADDRESS_CASE_UPPER: _ETHAddressCase.ValueType # 1 + ETH_ADDRESS_CASE_LOWER: _ETHAddressCase.ValueType # 2 + +class ETHAddressCase(_ETHAddressCase, metaclass=_ETHAddressCaseEnumTypeWrapper): ... +ETH_ADDRESS_CASE_MIXED: ETHAddressCase.ValueType # 0 +ETH_ADDRESS_CASE_UPPER: ETHAddressCase.ValueType # 1 +ETH_ADDRESS_CASE_LOWER: ETHAddressCase.ValueType # 2 +global___ETHAddressCase = ETHAddressCase + +@typing.final class ETHPubRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + class _OutputType: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType + class _OutputTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ETHPubRequest._OutputType.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor ADDRESS: ETHPubRequest._OutputType.ValueType # 0 XPUB: ETHPubRequest._OutputType.ValueType # 1 - class OutputType(_OutputType, metaclass=_OutputTypeEnumTypeWrapper): - pass + class OutputType(_OutputType, metaclass=_OutputTypeEnumTypeWrapper): ... ADDRESS: ETHPubRequest.OutputType.ValueType # 0 XPUB: ETHPubRequest.OutputType.ValueType # 1 @@ -61,32 +96,35 @@ class ETHPubRequest(google.protobuf.message.Message): DISPLAY_FIELD_NUMBER: builtins.int CONTRACT_ADDRESS_FIELD_NUMBER: builtins.int CHAIN_ID_FIELD_NUMBER: builtins.int - @property - def keypath(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]: ... coin: global___ETHCoin.ValueType """Deprecated: use chain_id instead.""" - output_type: global___ETHPubRequest.OutputType.ValueType display: builtins.bool contract_address: builtins.bytes chain_id: builtins.int """If non-zero, `coin` is ignored and `chain_id` is used to identify the network.""" - - def __init__(self, + @property + def keypath(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]: ... + def __init__( + self, *, - keypath: typing.Optional[typing.Iterable[builtins.int]] = ..., + keypath: collections.abc.Iterable[builtins.int] | None = ..., coin: global___ETHCoin.ValueType = ..., output_type: global___ETHPubRequest.OutputType.ValueType = ..., display: builtins.bool = ..., contract_address: builtins.bytes = ..., chain_id: builtins.int = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["chain_id",b"chain_id","coin",b"coin","contract_address",b"contract_address","display",b"display","keypath",b"keypath","output_type",b"output_type"]) -> None: ... + ) -> None: ... + def ClearField(self, field_name: typing.Literal["chain_id", b"chain_id", "coin", b"coin", "contract_address", b"contract_address", "display", b"display", "keypath", b"keypath", "output_type", b"output_type"]) -> None: ... + global___ETHPubRequest = ETHPubRequest +@typing.final class ETHSignRequest(google.protobuf.message.Message): """TX payload for "legacy" (EIP-155) transactions: https://eips.ethereum.org/EIPS/eip-155""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + COIN_FIELD_NUMBER: builtins.int KEYPATH_FIELD_NUMBER: builtins.int NONCE_FIELD_NUMBER: builtins.int @@ -97,52 +135,53 @@ class ETHSignRequest(google.protobuf.message.Message): DATA_FIELD_NUMBER: builtins.int HOST_NONCE_COMMITMENT_FIELD_NUMBER: builtins.int CHAIN_ID_FIELD_NUMBER: builtins.int + ADDRESS_CASE_FIELD_NUMBER: builtins.int coin: global___ETHCoin.ValueType """Deprecated: use chain_id instead.""" - - @property - def keypath(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]: ... nonce: builtins.bytes """smallest big endian serialization, max. 16 bytes""" - gas_price: builtins.bytes """smallest big endian serialization, max. 16 bytes""" - gas_limit: builtins.bytes """smallest big endian serialization, max. 16 bytes""" - recipient: builtins.bytes """20 byte recipient""" - value: builtins.bytes """smallest big endian serialization, max. 32 bytes""" - data: builtins.bytes - @property - def host_nonce_commitment(self) -> antiklepto_pb2.AntiKleptoHostNonceCommitment: ... chain_id: builtins.int """If non-zero, `coin` is ignored and `chain_id` is used to identify the network.""" - - def __init__(self, + address_case: global___ETHAddressCase.ValueType + @property + def keypath(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]: ... + @property + def host_nonce_commitment(self) -> antiklepto_pb2.AntiKleptoHostNonceCommitment: ... + def __init__( + self, *, coin: global___ETHCoin.ValueType = ..., - keypath: typing.Optional[typing.Iterable[builtins.int]] = ..., + keypath: collections.abc.Iterable[builtins.int] | None = ..., nonce: builtins.bytes = ..., gas_price: builtins.bytes = ..., gas_limit: builtins.bytes = ..., recipient: builtins.bytes = ..., value: builtins.bytes = ..., data: builtins.bytes = ..., - host_nonce_commitment: typing.Optional[antiklepto_pb2.AntiKleptoHostNonceCommitment] = ..., + host_nonce_commitment: antiklepto_pb2.AntiKleptoHostNonceCommitment | None = ..., chain_id: builtins.int = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["host_nonce_commitment",b"host_nonce_commitment"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["chain_id",b"chain_id","coin",b"coin","data",b"data","gas_limit",b"gas_limit","gas_price",b"gas_price","host_nonce_commitment",b"host_nonce_commitment","keypath",b"keypath","nonce",b"nonce","recipient",b"recipient","value",b"value"]) -> None: ... + address_case: global___ETHAddressCase.ValueType = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["host_nonce_commitment", b"host_nonce_commitment"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["address_case", b"address_case", "chain_id", b"chain_id", "coin", b"coin", "data", b"data", "gas_limit", b"gas_limit", "gas_price", b"gas_price", "host_nonce_commitment", b"host_nonce_commitment", "keypath", b"keypath", "nonce", b"nonce", "recipient", b"recipient", "value", b"value"]) -> None: ... + global___ETHSignRequest = ETHSignRequest +@typing.final class ETHSignEIP1559Request(google.protobuf.message.Message): """TX payload for an EIP-1559 (type 2) transaction: https://eips.ethereum.org/EIPS/eip-1559""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + CHAIN_ID_FIELD_NUMBER: builtins.int KEYPATH_FIELD_NUMBER: builtins.int NONCE_FIELD_NUMBER: builtins.int @@ -153,34 +192,31 @@ class ETHSignEIP1559Request(google.protobuf.message.Message): VALUE_FIELD_NUMBER: builtins.int DATA_FIELD_NUMBER: builtins.int HOST_NONCE_COMMITMENT_FIELD_NUMBER: builtins.int + ADDRESS_CASE_FIELD_NUMBER: builtins.int chain_id: builtins.int - @property - def keypath(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]: ... nonce: builtins.bytes """smallest big endian serialization, max. 16 bytes""" - max_priority_fee_per_gas: builtins.bytes """smallest big endian serialization, max. 16 bytes""" - max_fee_per_gas: builtins.bytes """smallest big endian serialization, max. 16 bytes""" - gas_limit: builtins.bytes """smallest big endian serialization, max. 16 bytes""" - recipient: builtins.bytes """20 byte recipient""" - value: builtins.bytes """smallest big endian serialization, max. 32 bytes""" - data: builtins.bytes + address_case: global___ETHAddressCase.ValueType + @property + def keypath(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]: ... @property def host_nonce_commitment(self) -> antiklepto_pb2.AntiKleptoHostNonceCommitment: ... - def __init__(self, + def __init__( + self, *, chain_id: builtins.int = ..., - keypath: typing.Optional[typing.Iterable[builtins.int]] = ..., + keypath: collections.abc.Iterable[builtins.int] | None = ..., nonce: builtins.bytes = ..., max_priority_fee_per_gas: builtins.bytes = ..., max_fee_per_gas: builtins.bytes = ..., @@ -188,14 +224,18 @@ class ETHSignEIP1559Request(google.protobuf.message.Message): recipient: builtins.bytes = ..., value: builtins.bytes = ..., data: builtins.bytes = ..., - host_nonce_commitment: typing.Optional[antiklepto_pb2.AntiKleptoHostNonceCommitment] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["host_nonce_commitment",b"host_nonce_commitment"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["chain_id",b"chain_id","data",b"data","gas_limit",b"gas_limit","host_nonce_commitment",b"host_nonce_commitment","keypath",b"keypath","max_fee_per_gas",b"max_fee_per_gas","max_priority_fee_per_gas",b"max_priority_fee_per_gas","nonce",b"nonce","recipient",b"recipient","value",b"value"]) -> None: ... + host_nonce_commitment: antiklepto_pb2.AntiKleptoHostNonceCommitment | None = ..., + address_case: global___ETHAddressCase.ValueType = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["host_nonce_commitment", b"host_nonce_commitment"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["address_case", b"address_case", "chain_id", b"chain_id", "data", b"data", "gas_limit", b"gas_limit", "host_nonce_commitment", b"host_nonce_commitment", "keypath", b"keypath", "max_fee_per_gas", b"max_fee_per_gas", "max_priority_fee_per_gas", b"max_priority_fee_per_gas", "nonce", b"nonce", "recipient", b"recipient", "value", b"value"]) -> None: ... + global___ETHSignEIP1559Request = ETHSignEIP1559Request +@typing.final class ETHSignMessageRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + COIN_FIELD_NUMBER: builtins.int KEYPATH_FIELD_NUMBER: builtins.int MSG_FIELD_NUMBER: builtins.int @@ -203,45 +243,51 @@ class ETHSignMessageRequest(google.protobuf.message.Message): CHAIN_ID_FIELD_NUMBER: builtins.int coin: global___ETHCoin.ValueType """Deprecated: use chain_id instead.""" - + msg: builtins.bytes + chain_id: builtins.int + """If non-zero, `coin` is ignored and `chain_id` is used to identify the network.""" @property def keypath(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]: ... - msg: builtins.bytes @property def host_nonce_commitment(self) -> antiklepto_pb2.AntiKleptoHostNonceCommitment: ... - chain_id: builtins.int - """If non-zero, `coin` is ignored and `chain_id` is used to identify the network.""" - - def __init__(self, + def __init__( + self, *, coin: global___ETHCoin.ValueType = ..., - keypath: typing.Optional[typing.Iterable[builtins.int]] = ..., + keypath: collections.abc.Iterable[builtins.int] | None = ..., msg: builtins.bytes = ..., - host_nonce_commitment: typing.Optional[antiklepto_pb2.AntiKleptoHostNonceCommitment] = ..., + host_nonce_commitment: antiklepto_pb2.AntiKleptoHostNonceCommitment | None = ..., chain_id: builtins.int = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["host_nonce_commitment",b"host_nonce_commitment"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["chain_id",b"chain_id","coin",b"coin","host_nonce_commitment",b"host_nonce_commitment","keypath",b"keypath","msg",b"msg"]) -> None: ... + ) -> None: ... + def HasField(self, field_name: typing.Literal["host_nonce_commitment", b"host_nonce_commitment"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["chain_id", b"chain_id", "coin", b"coin", "host_nonce_commitment", b"host_nonce_commitment", "keypath", b"keypath", "msg", b"msg"]) -> None: ... + global___ETHSignMessageRequest = ETHSignMessageRequest +@typing.final class ETHSignResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + SIGNATURE_FIELD_NUMBER: builtins.int signature: builtins.bytes """65 bytes, last byte is the recid""" - - def __init__(self, + def __init__( + self, *, signature: builtins.bytes = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["signature",b"signature"]) -> None: ... + ) -> None: ... + def ClearField(self, field_name: typing.Literal["signature", b"signature"]) -> None: ... + global___ETHSignResponse = ETHSignResponse +@typing.final class ETHSignTypedMessageRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + class _DataType: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType + class _DataTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ETHSignTypedMessageRequest._DataType.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor UNKNOWN: ETHSignTypedMessageRequest._DataType.ValueType # 0 @@ -253,9 +299,8 @@ class ETHSignTypedMessageRequest(google.protobuf.message.Message): STRING: ETHSignTypedMessageRequest._DataType.ValueType # 6 ARRAY: ETHSignTypedMessageRequest._DataType.ValueType # 7 STRUCT: ETHSignTypedMessageRequest._DataType.ValueType # 8 - class DataType(_DataType, metaclass=_DataTypeEnumTypeWrapper): - pass + class DataType(_DataType, metaclass=_DataTypeEnumTypeWrapper): ... UNKNOWN: ETHSignTypedMessageRequest.DataType.ValueType # 0 BYTES: ETHSignTypedMessageRequest.DataType.ValueType # 1 UINT: ETHSignTypedMessageRequest.DataType.ValueType # 2 @@ -266,59 +311,67 @@ class ETHSignTypedMessageRequest(google.protobuf.message.Message): ARRAY: ETHSignTypedMessageRequest.DataType.ValueType # 7 STRUCT: ETHSignTypedMessageRequest.DataType.ValueType # 8 + @typing.final class MemberType(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + TYPE_FIELD_NUMBER: builtins.int SIZE_FIELD_NUMBER: builtins.int STRUCT_NAME_FIELD_NUMBER: builtins.int ARRAY_TYPE_FIELD_NUMBER: builtins.int type: global___ETHSignTypedMessageRequest.DataType.ValueType size: builtins.int - struct_name: typing.Text + struct_name: builtins.str """if type==STRUCT, name of struct type.""" - @property def array_type(self) -> global___ETHSignTypedMessageRequest.MemberType: """if type==ARRAY, type of elements""" - pass - def __init__(self, + + def __init__( + self, *, type: global___ETHSignTypedMessageRequest.DataType.ValueType = ..., size: builtins.int = ..., - struct_name: typing.Text = ..., - array_type: typing.Optional[global___ETHSignTypedMessageRequest.MemberType] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["array_type",b"array_type"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["array_type",b"array_type","size",b"size","struct_name",b"struct_name","type",b"type"]) -> None: ... + struct_name: builtins.str = ..., + array_type: global___ETHSignTypedMessageRequest.MemberType | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["array_type", b"array_type"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["array_type", b"array_type", "size", b"size", "struct_name", b"struct_name", "type", b"type"]) -> None: ... + @typing.final class Member(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int TYPE_FIELD_NUMBER: builtins.int - name: typing.Text + name: builtins.str @property def type(self) -> global___ETHSignTypedMessageRequest.MemberType: ... - def __init__(self, + def __init__( + self, *, - name: typing.Text = ..., - type: typing.Optional[global___ETHSignTypedMessageRequest.MemberType] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["type",b"type"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["name",b"name","type",b"type"]) -> None: ... + name: builtins.str = ..., + type: global___ETHSignTypedMessageRequest.MemberType | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["type", b"type"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["name", b"name", "type", b"type"]) -> None: ... + @typing.final class StructType(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int MEMBERS_FIELD_NUMBER: builtins.int - name: typing.Text + name: builtins.str @property def members(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___ETHSignTypedMessageRequest.Member]: ... - def __init__(self, + def __init__( + self, *, - name: typing.Text = ..., - members: typing.Optional[typing.Iterable[global___ETHSignTypedMessageRequest.Member]] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["members",b"members","name",b"name"]) -> None: ... + name: builtins.str = ..., + members: collections.abc.Iterable[global___ETHSignTypedMessageRequest.Member] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["members", b"members", "name", b"name"]) -> None: ... CHAIN_ID_FIELD_NUMBER: builtins.int KEYPATH_FIELD_NUMBER: builtins.int @@ -326,38 +379,42 @@ class ETHSignTypedMessageRequest(google.protobuf.message.Message): PRIMARY_TYPE_FIELD_NUMBER: builtins.int HOST_NONCE_COMMITMENT_FIELD_NUMBER: builtins.int chain_id: builtins.int + primary_type: builtins.str @property def keypath(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]: ... @property def types(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___ETHSignTypedMessageRequest.StructType]: ... - primary_type: typing.Text @property def host_nonce_commitment(self) -> antiklepto_pb2.AntiKleptoHostNonceCommitment: ... - def __init__(self, + def __init__( + self, *, chain_id: builtins.int = ..., - keypath: typing.Optional[typing.Iterable[builtins.int]] = ..., - types: typing.Optional[typing.Iterable[global___ETHSignTypedMessageRequest.StructType]] = ..., - primary_type: typing.Text = ..., - host_nonce_commitment: typing.Optional[antiklepto_pb2.AntiKleptoHostNonceCommitment] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["host_nonce_commitment",b"host_nonce_commitment"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["chain_id",b"chain_id","host_nonce_commitment",b"host_nonce_commitment","keypath",b"keypath","primary_type",b"primary_type","types",b"types"]) -> None: ... + keypath: collections.abc.Iterable[builtins.int] | None = ..., + types: collections.abc.Iterable[global___ETHSignTypedMessageRequest.StructType] | None = ..., + primary_type: builtins.str = ..., + host_nonce_commitment: antiklepto_pb2.AntiKleptoHostNonceCommitment | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["host_nonce_commitment", b"host_nonce_commitment"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["chain_id", b"chain_id", "host_nonce_commitment", b"host_nonce_commitment", "keypath", b"keypath", "primary_type", b"primary_type", "types", b"types"]) -> None: ... + global___ETHSignTypedMessageRequest = ETHSignTypedMessageRequest +@typing.final class ETHTypedMessageValueResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + class _RootObject: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType + class _RootObjectEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ETHTypedMessageValueResponse._RootObject.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor UNKNOWN: ETHTypedMessageValueResponse._RootObject.ValueType # 0 DOMAIN: ETHTypedMessageValueResponse._RootObject.ValueType # 1 MESSAGE: ETHTypedMessageValueResponse._RootObject.ValueType # 2 - class RootObject(_RootObject, metaclass=_RootObjectEnumTypeWrapper): - pass + class RootObject(_RootObject, metaclass=_RootObjectEnumTypeWrapper): ... UNKNOWN: ETHTypedMessageValueResponse.RootObject.ValueType # 0 DOMAIN: ETHTypedMessageValueResponse.RootObject.ValueType # 1 MESSAGE: ETHTypedMessageValueResponse.RootObject.ValueType # 2 @@ -367,27 +424,35 @@ class ETHTypedMessageValueResponse(google.protobuf.message.Message): root_object: global___ETHTypedMessageValueResponse.RootObject.ValueType @property def path(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]: ... - def __init__(self, + def __init__( + self, *, root_object: global___ETHTypedMessageValueResponse.RootObject.ValueType = ..., - path: typing.Optional[typing.Iterable[builtins.int]] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["path",b"path","root_object",b"root_object"]) -> None: ... + path: collections.abc.Iterable[builtins.int] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["path", b"path", "root_object", b"root_object"]) -> None: ... + global___ETHTypedMessageValueResponse = ETHTypedMessageValueResponse +@typing.final class ETHTypedMessageValueRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + VALUE_FIELD_NUMBER: builtins.int value: builtins.bytes - def __init__(self, + def __init__( + self, *, value: builtins.bytes = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["value",b"value"]) -> None: ... + ) -> None: ... + def ClearField(self, field_name: typing.Literal["value", b"value"]) -> None: ... + global___ETHTypedMessageValueRequest = ETHTypedMessageValueRequest +@typing.final class ETHRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + PUB_FIELD_NUMBER: builtins.int SIGN_FIELD_NUMBER: builtins.int SIGN_MSG_FIELD_NUMBER: builtins.int @@ -409,23 +474,27 @@ class ETHRequest(google.protobuf.message.Message): def typed_msg_value(self) -> global___ETHTypedMessageValueRequest: ... @property def sign_eip1559(self) -> global___ETHSignEIP1559Request: ... - def __init__(self, + def __init__( + self, *, - pub: typing.Optional[global___ETHPubRequest] = ..., - sign: typing.Optional[global___ETHSignRequest] = ..., - sign_msg: typing.Optional[global___ETHSignMessageRequest] = ..., - antiklepto_signature: typing.Optional[antiklepto_pb2.AntiKleptoSignatureRequest] = ..., - sign_typed_msg: typing.Optional[global___ETHSignTypedMessageRequest] = ..., - typed_msg_value: typing.Optional[global___ETHTypedMessageValueRequest] = ..., - sign_eip1559: typing.Optional[global___ETHSignEIP1559Request] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["antiklepto_signature",b"antiklepto_signature","pub",b"pub","request",b"request","sign",b"sign","sign_eip1559",b"sign_eip1559","sign_msg",b"sign_msg","sign_typed_msg",b"sign_typed_msg","typed_msg_value",b"typed_msg_value"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["antiklepto_signature",b"antiklepto_signature","pub",b"pub","request",b"request","sign",b"sign","sign_eip1559",b"sign_eip1559","sign_msg",b"sign_msg","sign_typed_msg",b"sign_typed_msg","typed_msg_value",b"typed_msg_value"]) -> None: ... - def WhichOneof(self, oneof_group: typing_extensions.Literal["request",b"request"]) -> typing.Optional[typing_extensions.Literal["pub","sign","sign_msg","antiklepto_signature","sign_typed_msg","typed_msg_value","sign_eip1559"]]: ... + pub: global___ETHPubRequest | None = ..., + sign: global___ETHSignRequest | None = ..., + sign_msg: global___ETHSignMessageRequest | None = ..., + antiklepto_signature: antiklepto_pb2.AntiKleptoSignatureRequest | None = ..., + sign_typed_msg: global___ETHSignTypedMessageRequest | None = ..., + typed_msg_value: global___ETHTypedMessageValueRequest | None = ..., + sign_eip1559: global___ETHSignEIP1559Request | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["antiklepto_signature", b"antiklepto_signature", "pub", b"pub", "request", b"request", "sign", b"sign", "sign_eip1559", b"sign_eip1559", "sign_msg", b"sign_msg", "sign_typed_msg", b"sign_typed_msg", "typed_msg_value", b"typed_msg_value"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["antiklepto_signature", b"antiklepto_signature", "pub", b"pub", "request", b"request", "sign", b"sign", "sign_eip1559", b"sign_eip1559", "sign_msg", b"sign_msg", "sign_typed_msg", b"sign_typed_msg", "typed_msg_value", b"typed_msg_value"]) -> None: ... + def WhichOneof(self, oneof_group: typing.Literal["request", b"request"]) -> typing.Literal["pub", "sign", "sign_msg", "antiklepto_signature", "sign_typed_msg", "typed_msg_value", "sign_eip1559"] | None: ... + global___ETHRequest = ETHRequest +@typing.final class ETHResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + PUB_FIELD_NUMBER: builtins.int SIGN_FIELD_NUMBER: builtins.int ANTIKLEPTO_SIGNER_COMMITMENT_FIELD_NUMBER: builtins.int @@ -438,14 +507,16 @@ class ETHResponse(google.protobuf.message.Message): def antiklepto_signer_commitment(self) -> antiklepto_pb2.AntiKleptoSignerCommitment: ... @property def typed_msg_value(self) -> global___ETHTypedMessageValueResponse: ... - def __init__(self, + def __init__( + self, *, - pub: typing.Optional[common_pb2.PubResponse] = ..., - sign: typing.Optional[global___ETHSignResponse] = ..., - antiklepto_signer_commitment: typing.Optional[antiklepto_pb2.AntiKleptoSignerCommitment] = ..., - typed_msg_value: typing.Optional[global___ETHTypedMessageValueResponse] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["antiklepto_signer_commitment",b"antiklepto_signer_commitment","pub",b"pub","response",b"response","sign",b"sign","typed_msg_value",b"typed_msg_value"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["antiklepto_signer_commitment",b"antiklepto_signer_commitment","pub",b"pub","response",b"response","sign",b"sign","typed_msg_value",b"typed_msg_value"]) -> None: ... - def WhichOneof(self, oneof_group: typing_extensions.Literal["response",b"response"]) -> typing.Optional[typing_extensions.Literal["pub","sign","antiklepto_signer_commitment","typed_msg_value"]]: ... + pub: common_pb2.PubResponse | None = ..., + sign: global___ETHSignResponse | None = ..., + antiklepto_signer_commitment: antiklepto_pb2.AntiKleptoSignerCommitment | None = ..., + typed_msg_value: global___ETHTypedMessageValueResponse | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["antiklepto_signer_commitment", b"antiklepto_signer_commitment", "pub", b"pub", "response", b"response", "sign", b"sign", "typed_msg_value", b"typed_msg_value"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["antiklepto_signer_commitment", b"antiklepto_signer_commitment", "pub", b"pub", "response", b"response", "sign", b"sign", "typed_msg_value", b"typed_msg_value"]) -> None: ... + def WhichOneof(self, oneof_group: typing.Literal["response", b"response"]) -> typing.Literal["pub", "sign", "antiklepto_signer_commitment", "typed_msg_value"] | None: ... + global___ETHResponse = ETHResponse diff --git a/hwilib/devices/bitbox02_lib/communication/generated/hww_pb2.py b/hwilib/devices/bitbox02_lib/communication/generated/hww_pb2.py index 4606d1d94..15b352409 100644 --- a/hwilib/devices/bitbox02_lib/communication/generated/hww_pb2.py +++ b/hwilib/devices/bitbox02_lib/communication/generated/hww_pb2.py @@ -14,6 +14,7 @@ from . import common_pb2 as common__pb2 from . import backup_commands_pb2 as backup__commands__pb2 from . import bitbox02_system_pb2 as bitbox02__system__pb2 +from . import bluetooth_pb2 as bluetooth__pb2 from . import btc_pb2 as btc__pb2 from . import cardano_pb2 as cardano__pb2 from . import eth_pb2 as eth__pb2 @@ -23,19 +24,19 @@ from . import perform_attestation_pb2 as perform__attestation__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\thww.proto\x12\x14shiftcrypto.bitbox02\x1a\x0c\x63ommon.proto\x1a\x15\x62\x61\x63kup_commands.proto\x1a\x15\x62itbox02_system.proto\x1a\tbtc.proto\x1a\rcardano.proto\x1a\teth.proto\x1a\x0ekeystore.proto\x1a\x0emnemonic.proto\x1a\x0csystem.proto\x1a\x19perform_attestation.proto\"&\n\x05\x45rror\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07message\x18\x02 \x01(\t\"\t\n\x07Success\"\xfd\r\n\x07Request\x12\x41\n\x0b\x64\x65vice_name\x18\x02 \x01(\x0b\x32*.shiftcrypto.bitbox02.SetDeviceNameRequestH\x00\x12I\n\x0f\x64\x65vice_language\x18\x03 \x01(\x0b\x32..shiftcrypto.bitbox02.SetDeviceLanguageRequestH\x00\x12>\n\x0b\x64\x65vice_info\x18\x04 \x01(\x0b\x32\'.shiftcrypto.bitbox02.DeviceInfoRequestH\x00\x12@\n\x0cset_password\x18\x05 \x01(\x0b\x32(.shiftcrypto.bitbox02.SetPasswordRequestH\x00\x12\x42\n\rcreate_backup\x18\x06 \x01(\x0b\x32).shiftcrypto.bitbox02.CreateBackupRequestH\x00\x12\x42\n\rshow_mnemonic\x18\x07 \x01(\x0b\x32).shiftcrypto.bitbox02.ShowMnemonicRequestH\x00\x12\x36\n\x07\x62tc_pub\x18\x08 \x01(\x0b\x32#.shiftcrypto.bitbox02.BTCPubRequestH\x00\x12\x41\n\rbtc_sign_init\x18\t \x01(\x0b\x32(.shiftcrypto.bitbox02.BTCSignInitRequestH\x00\x12\x43\n\x0e\x62tc_sign_input\x18\n \x01(\x0b\x32).shiftcrypto.bitbox02.BTCSignInputRequestH\x00\x12\x45\n\x0f\x62tc_sign_output\x18\x0b \x01(\x0b\x32*.shiftcrypto.bitbox02.BTCSignOutputRequestH\x00\x12O\n\x14insert_remove_sdcard\x18\x0c \x01(\x0b\x32/.shiftcrypto.bitbox02.InsertRemoveSDCardRequestH\x00\x12@\n\x0c\x63heck_sdcard\x18\r \x01(\x0b\x32(.shiftcrypto.bitbox02.CheckSDCardRequestH\x00\x12\x64\n\x1fset_mnemonic_passphrase_enabled\x18\x0e \x01(\x0b\x32\x39.shiftcrypto.bitbox02.SetMnemonicPassphraseEnabledRequestH\x00\x12@\n\x0clist_backups\x18\x0f \x01(\x0b\x32(.shiftcrypto.bitbox02.ListBackupsRequestH\x00\x12\x44\n\x0erestore_backup\x18\x10 \x01(\x0b\x32*.shiftcrypto.bitbox02.RestoreBackupRequestH\x00\x12N\n\x13perform_attestation\x18\x11 \x01(\x0b\x32/.shiftcrypto.bitbox02.PerformAttestationRequestH\x00\x12\x35\n\x06reboot\x18\x12 \x01(\x0b\x32#.shiftcrypto.bitbox02.RebootRequestH\x00\x12@\n\x0c\x63heck_backup\x18\x13 \x01(\x0b\x32(.shiftcrypto.bitbox02.CheckBackupRequestH\x00\x12/\n\x03\x65th\x18\x14 \x01(\x0b\x32 .shiftcrypto.bitbox02.ETHRequestH\x00\x12\x33\n\x05reset\x18\x15 \x01(\x0b\x32\".shiftcrypto.bitbox02.ResetRequestH\x00\x12Q\n\x15restore_from_mnemonic\x18\x16 \x01(\x0b\x32\x30.shiftcrypto.bitbox02.RestoreFromMnemonicRequestH\x00\x12\x43\n\x0b\x66ingerprint\x18\x18 \x01(\x0b\x32,.shiftcrypto.bitbox02.RootFingerprintRequestH\x00\x12/\n\x03\x62tc\x18\x19 \x01(\x0b\x32 .shiftcrypto.bitbox02.BTCRequestH\x00\x12U\n\x17\x65lectrum_encryption_key\x18\x1a \x01(\x0b\x32\x32.shiftcrypto.bitbox02.ElectrumEncryptionKeyRequestH\x00\x12\x37\n\x07\x63\x61rdano\x18\x1b \x01(\x0b\x32$.shiftcrypto.bitbox02.CardanoRequestH\x00\x12\x33\n\x05\x62ip85\x18\x1c \x01(\x0b\x32\".shiftcrypto.bitbox02.BIP85RequestH\x00\x42\t\n\x07requestJ\x04\x08\x01\x10\x02J\x04\x08\x17\x10\x18\"\xbf\x07\n\x08Response\x12\x30\n\x07success\x18\x01 \x01(\x0b\x32\x1d.shiftcrypto.bitbox02.SuccessH\x00\x12,\n\x05\x65rror\x18\x02 \x01(\x0b\x32\x1b.shiftcrypto.bitbox02.ErrorH\x00\x12?\n\x0b\x64\x65vice_info\x18\x04 \x01(\x0b\x32(.shiftcrypto.bitbox02.DeviceInfoResponseH\x00\x12\x30\n\x03pub\x18\x05 \x01(\x0b\x32!.shiftcrypto.bitbox02.PubResponseH\x00\x12\x42\n\rbtc_sign_next\x18\x06 \x01(\x0b\x32).shiftcrypto.bitbox02.BTCSignNextResponseH\x00\x12\x41\n\x0clist_backups\x18\x07 \x01(\x0b\x32).shiftcrypto.bitbox02.ListBackupsResponseH\x00\x12\x41\n\x0c\x63heck_backup\x18\x08 \x01(\x0b\x32).shiftcrypto.bitbox02.CheckBackupResponseH\x00\x12O\n\x13perform_attestation\x18\t \x01(\x0b\x32\x30.shiftcrypto.bitbox02.PerformAttestationResponseH\x00\x12\x41\n\x0c\x63heck_sdcard\x18\n \x01(\x0b\x32).shiftcrypto.bitbox02.CheckSDCardResponseH\x00\x12\x30\n\x03\x65th\x18\x0b \x01(\x0b\x32!.shiftcrypto.bitbox02.ETHResponseH\x00\x12\x44\n\x0b\x66ingerprint\x18\x0c \x01(\x0b\x32-.shiftcrypto.bitbox02.RootFingerprintResponseH\x00\x12\x30\n\x03\x62tc\x18\r \x01(\x0b\x32!.shiftcrypto.bitbox02.BTCResponseH\x00\x12V\n\x17\x65lectrum_encryption_key\x18\x0e \x01(\x0b\x32\x33.shiftcrypto.bitbox02.ElectrumEncryptionKeyResponseH\x00\x12\x38\n\x07\x63\x61rdano\x18\x0f \x01(\x0b\x32%.shiftcrypto.bitbox02.CardanoResponseH\x00\x12\x34\n\x05\x62ip85\x18\x10 \x01(\x0b\x32#.shiftcrypto.bitbox02.BIP85ResponseH\x00\x42\n\n\x08responseJ\x04\x08\x03\x10\x04\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\thww.proto\x12\x14shiftcrypto.bitbox02\x1a\x0c\x63ommon.proto\x1a\x15\x62\x61\x63kup_commands.proto\x1a\x15\x62itbox02_system.proto\x1a\x0f\x62luetooth.proto\x1a\tbtc.proto\x1a\rcardano.proto\x1a\teth.proto\x1a\x0ekeystore.proto\x1a\x0emnemonic.proto\x1a\x0csystem.proto\x1a\x19perform_attestation.proto\"&\n\x05\x45rror\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0f\n\x07message\x18\x02 \x01(\t\"\t\n\x07Success\"\xba\x0e\n\x07Request\x12\x41\n\x0b\x64\x65vice_name\x18\x02 \x01(\x0b\x32*.shiftcrypto.bitbox02.SetDeviceNameRequestH\x00\x12I\n\x0f\x64\x65vice_language\x18\x03 \x01(\x0b\x32..shiftcrypto.bitbox02.SetDeviceLanguageRequestH\x00\x12>\n\x0b\x64\x65vice_info\x18\x04 \x01(\x0b\x32\'.shiftcrypto.bitbox02.DeviceInfoRequestH\x00\x12@\n\x0cset_password\x18\x05 \x01(\x0b\x32(.shiftcrypto.bitbox02.SetPasswordRequestH\x00\x12\x42\n\rcreate_backup\x18\x06 \x01(\x0b\x32).shiftcrypto.bitbox02.CreateBackupRequestH\x00\x12\x42\n\rshow_mnemonic\x18\x07 \x01(\x0b\x32).shiftcrypto.bitbox02.ShowMnemonicRequestH\x00\x12\x36\n\x07\x62tc_pub\x18\x08 \x01(\x0b\x32#.shiftcrypto.bitbox02.BTCPubRequestH\x00\x12\x41\n\rbtc_sign_init\x18\t \x01(\x0b\x32(.shiftcrypto.bitbox02.BTCSignInitRequestH\x00\x12\x43\n\x0e\x62tc_sign_input\x18\n \x01(\x0b\x32).shiftcrypto.bitbox02.BTCSignInputRequestH\x00\x12\x45\n\x0f\x62tc_sign_output\x18\x0b \x01(\x0b\x32*.shiftcrypto.bitbox02.BTCSignOutputRequestH\x00\x12O\n\x14insert_remove_sdcard\x18\x0c \x01(\x0b\x32/.shiftcrypto.bitbox02.InsertRemoveSDCardRequestH\x00\x12@\n\x0c\x63heck_sdcard\x18\r \x01(\x0b\x32(.shiftcrypto.bitbox02.CheckSDCardRequestH\x00\x12\x64\n\x1fset_mnemonic_passphrase_enabled\x18\x0e \x01(\x0b\x32\x39.shiftcrypto.bitbox02.SetMnemonicPassphraseEnabledRequestH\x00\x12@\n\x0clist_backups\x18\x0f \x01(\x0b\x32(.shiftcrypto.bitbox02.ListBackupsRequestH\x00\x12\x44\n\x0erestore_backup\x18\x10 \x01(\x0b\x32*.shiftcrypto.bitbox02.RestoreBackupRequestH\x00\x12N\n\x13perform_attestation\x18\x11 \x01(\x0b\x32/.shiftcrypto.bitbox02.PerformAttestationRequestH\x00\x12\x35\n\x06reboot\x18\x12 \x01(\x0b\x32#.shiftcrypto.bitbox02.RebootRequestH\x00\x12@\n\x0c\x63heck_backup\x18\x13 \x01(\x0b\x32(.shiftcrypto.bitbox02.CheckBackupRequestH\x00\x12/\n\x03\x65th\x18\x14 \x01(\x0b\x32 .shiftcrypto.bitbox02.ETHRequestH\x00\x12\x33\n\x05reset\x18\x15 \x01(\x0b\x32\".shiftcrypto.bitbox02.ResetRequestH\x00\x12Q\n\x15restore_from_mnemonic\x18\x16 \x01(\x0b\x32\x30.shiftcrypto.bitbox02.RestoreFromMnemonicRequestH\x00\x12\x43\n\x0b\x66ingerprint\x18\x18 \x01(\x0b\x32,.shiftcrypto.bitbox02.RootFingerprintRequestH\x00\x12/\n\x03\x62tc\x18\x19 \x01(\x0b\x32 .shiftcrypto.bitbox02.BTCRequestH\x00\x12U\n\x17\x65lectrum_encryption_key\x18\x1a \x01(\x0b\x32\x32.shiftcrypto.bitbox02.ElectrumEncryptionKeyRequestH\x00\x12\x37\n\x07\x63\x61rdano\x18\x1b \x01(\x0b\x32$.shiftcrypto.bitbox02.CardanoRequestH\x00\x12\x33\n\x05\x62ip85\x18\x1c \x01(\x0b\x32\".shiftcrypto.bitbox02.BIP85RequestH\x00\x12;\n\tbluetooth\x18\x1d \x01(\x0b\x32&.shiftcrypto.bitbox02.BluetoothRequestH\x00\x42\t\n\x07requestJ\x04\x08\x01\x10\x02J\x04\x08\x17\x10\x18\"\xfd\x07\n\x08Response\x12\x30\n\x07success\x18\x01 \x01(\x0b\x32\x1d.shiftcrypto.bitbox02.SuccessH\x00\x12,\n\x05\x65rror\x18\x02 \x01(\x0b\x32\x1b.shiftcrypto.bitbox02.ErrorH\x00\x12?\n\x0b\x64\x65vice_info\x18\x04 \x01(\x0b\x32(.shiftcrypto.bitbox02.DeviceInfoResponseH\x00\x12\x30\n\x03pub\x18\x05 \x01(\x0b\x32!.shiftcrypto.bitbox02.PubResponseH\x00\x12\x42\n\rbtc_sign_next\x18\x06 \x01(\x0b\x32).shiftcrypto.bitbox02.BTCSignNextResponseH\x00\x12\x41\n\x0clist_backups\x18\x07 \x01(\x0b\x32).shiftcrypto.bitbox02.ListBackupsResponseH\x00\x12\x41\n\x0c\x63heck_backup\x18\x08 \x01(\x0b\x32).shiftcrypto.bitbox02.CheckBackupResponseH\x00\x12O\n\x13perform_attestation\x18\t \x01(\x0b\x32\x30.shiftcrypto.bitbox02.PerformAttestationResponseH\x00\x12\x41\n\x0c\x63heck_sdcard\x18\n \x01(\x0b\x32).shiftcrypto.bitbox02.CheckSDCardResponseH\x00\x12\x30\n\x03\x65th\x18\x0b \x01(\x0b\x32!.shiftcrypto.bitbox02.ETHResponseH\x00\x12\x44\n\x0b\x66ingerprint\x18\x0c \x01(\x0b\x32-.shiftcrypto.bitbox02.RootFingerprintResponseH\x00\x12\x30\n\x03\x62tc\x18\r \x01(\x0b\x32!.shiftcrypto.bitbox02.BTCResponseH\x00\x12V\n\x17\x65lectrum_encryption_key\x18\x0e \x01(\x0b\x32\x33.shiftcrypto.bitbox02.ElectrumEncryptionKeyResponseH\x00\x12\x38\n\x07\x63\x61rdano\x18\x0f \x01(\x0b\x32%.shiftcrypto.bitbox02.CardanoResponseH\x00\x12\x34\n\x05\x62ip85\x18\x10 \x01(\x0b\x32#.shiftcrypto.bitbox02.BIP85ResponseH\x00\x12<\n\tbluetooth\x18\x11 \x01(\x0b\x32\'.shiftcrypto.bitbox02.BluetoothResponseH\x00\x42\n\n\x08responseJ\x04\x08\x03\x10\x04\x62\x06proto3') _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'hww_pb2', globals()) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None - _ERROR._serialized_start=205 - _ERROR._serialized_end=243 - _SUCCESS._serialized_start=245 - _SUCCESS._serialized_end=254 - _REQUEST._serialized_start=257 - _REQUEST._serialized_end=2046 - _RESPONSE._serialized_start=2049 - _RESPONSE._serialized_end=3008 + _ERROR._serialized_start=222 + _ERROR._serialized_end=260 + _SUCCESS._serialized_start=262 + _SUCCESS._serialized_end=271 + _REQUEST._serialized_start=274 + _REQUEST._serialized_end=2124 + _RESPONSE._serialized_start=2127 + _RESPONSE._serialized_end=3148 # @@protoc_insertion_point(module_scope) diff --git a/hwilib/devices/bitbox02_lib/communication/generated/hww_pb2.pyi b/hwilib/devices/bitbox02_lib/communication/generated/hww_pb2.pyi index df9aeacf1..b5b008f32 100644 --- a/hwilib/devices/bitbox02_lib/communication/generated/hww_pb2.pyi +++ b/hwilib/devices/bitbox02_lib/communication/generated/hww_pb2.pyi @@ -1,9 +1,24 @@ """ @generated by mypy-protobuf. Do not edit manually! isort:skip_file +Copyright 2019 Shift Cryptosecurity AG + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. """ + from . import backup_commands_pb2 from . import bitbox02_system_pb2 +from . import bluetooth_pb2 from . import btc_pb2 import builtins from . import cardano_pb2 @@ -16,32 +31,41 @@ from . import mnemonic_pb2 from . import perform_attestation_pb2 from . import system_pb2 import typing -import typing_extensions DESCRIPTOR: google.protobuf.descriptor.FileDescriptor +@typing.final class Error(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + CODE_FIELD_NUMBER: builtins.int MESSAGE_FIELD_NUMBER: builtins.int code: builtins.int - message: typing.Text - def __init__(self, + message: builtins.str + def __init__( + self, *, code: builtins.int = ..., - message: typing.Text = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["code",b"code","message",b"message"]) -> None: ... + message: builtins.str = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["code", b"code", "message", b"message"]) -> None: ... + global___Error = Error +@typing.final class Success(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor - def __init__(self, - ) -> None: ... + + def __init__( + self, + ) -> None: ... + global___Success = Success +@typing.final class Request(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + DEVICE_NAME_FIELD_NUMBER: builtins.int DEVICE_LANGUAGE_FIELD_NUMBER: builtins.int DEVICE_INFO_FIELD_NUMBER: builtins.int @@ -68,10 +92,11 @@ class Request(google.protobuf.message.Message): ELECTRUM_ENCRYPTION_KEY_FIELD_NUMBER: builtins.int CARDANO_FIELD_NUMBER: builtins.int BIP85_FIELD_NUMBER: builtins.int + BLUETOOTH_FIELD_NUMBER: builtins.int @property def device_name(self) -> bitbox02_system_pb2.SetDeviceNameRequest: """removed: RandomNumberRequest random_number = 1;""" - pass + @property def device_language(self) -> bitbox02_system_pb2.SetDeviceLanguageRequest: ... @property @@ -115,7 +140,7 @@ class Request(google.protobuf.message.Message): @property def fingerprint(self) -> common_pb2.RootFingerprintRequest: """removed: BitBoxBaseRequest bitboxbase = 23;""" - pass + @property def btc(self) -> btc_pb2.BTCRequest: ... @property @@ -124,42 +149,49 @@ class Request(google.protobuf.message.Message): def cardano(self) -> cardano_pb2.CardanoRequest: ... @property def bip85(self) -> keystore_pb2.BIP85Request: ... - def __init__(self, + @property + def bluetooth(self) -> bluetooth_pb2.BluetoothRequest: ... + def __init__( + self, *, - device_name: typing.Optional[bitbox02_system_pb2.SetDeviceNameRequest] = ..., - device_language: typing.Optional[bitbox02_system_pb2.SetDeviceLanguageRequest] = ..., - device_info: typing.Optional[bitbox02_system_pb2.DeviceInfoRequest] = ..., - set_password: typing.Optional[bitbox02_system_pb2.SetPasswordRequest] = ..., - create_backup: typing.Optional[backup_commands_pb2.CreateBackupRequest] = ..., - show_mnemonic: typing.Optional[mnemonic_pb2.ShowMnemonicRequest] = ..., - btc_pub: typing.Optional[btc_pb2.BTCPubRequest] = ..., - btc_sign_init: typing.Optional[btc_pb2.BTCSignInitRequest] = ..., - btc_sign_input: typing.Optional[btc_pb2.BTCSignInputRequest] = ..., - btc_sign_output: typing.Optional[btc_pb2.BTCSignOutputRequest] = ..., - insert_remove_sdcard: typing.Optional[bitbox02_system_pb2.InsertRemoveSDCardRequest] = ..., - check_sdcard: typing.Optional[bitbox02_system_pb2.CheckSDCardRequest] = ..., - set_mnemonic_passphrase_enabled: typing.Optional[mnemonic_pb2.SetMnemonicPassphraseEnabledRequest] = ..., - list_backups: typing.Optional[backup_commands_pb2.ListBackupsRequest] = ..., - restore_backup: typing.Optional[backup_commands_pb2.RestoreBackupRequest] = ..., - perform_attestation: typing.Optional[perform_attestation_pb2.PerformAttestationRequest] = ..., - reboot: typing.Optional[system_pb2.RebootRequest] = ..., - check_backup: typing.Optional[backup_commands_pb2.CheckBackupRequest] = ..., - eth: typing.Optional[eth_pb2.ETHRequest] = ..., - reset: typing.Optional[bitbox02_system_pb2.ResetRequest] = ..., - restore_from_mnemonic: typing.Optional[mnemonic_pb2.RestoreFromMnemonicRequest] = ..., - fingerprint: typing.Optional[common_pb2.RootFingerprintRequest] = ..., - btc: typing.Optional[btc_pb2.BTCRequest] = ..., - electrum_encryption_key: typing.Optional[keystore_pb2.ElectrumEncryptionKeyRequest] = ..., - cardano: typing.Optional[cardano_pb2.CardanoRequest] = ..., - bip85: typing.Optional[keystore_pb2.BIP85Request] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["bip85",b"bip85","btc",b"btc","btc_pub",b"btc_pub","btc_sign_init",b"btc_sign_init","btc_sign_input",b"btc_sign_input","btc_sign_output",b"btc_sign_output","cardano",b"cardano","check_backup",b"check_backup","check_sdcard",b"check_sdcard","create_backup",b"create_backup","device_info",b"device_info","device_language",b"device_language","device_name",b"device_name","electrum_encryption_key",b"electrum_encryption_key","eth",b"eth","fingerprint",b"fingerprint","insert_remove_sdcard",b"insert_remove_sdcard","list_backups",b"list_backups","perform_attestation",b"perform_attestation","reboot",b"reboot","request",b"request","reset",b"reset","restore_backup",b"restore_backup","restore_from_mnemonic",b"restore_from_mnemonic","set_mnemonic_passphrase_enabled",b"set_mnemonic_passphrase_enabled","set_password",b"set_password","show_mnemonic",b"show_mnemonic"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["bip85",b"bip85","btc",b"btc","btc_pub",b"btc_pub","btc_sign_init",b"btc_sign_init","btc_sign_input",b"btc_sign_input","btc_sign_output",b"btc_sign_output","cardano",b"cardano","check_backup",b"check_backup","check_sdcard",b"check_sdcard","create_backup",b"create_backup","device_info",b"device_info","device_language",b"device_language","device_name",b"device_name","electrum_encryption_key",b"electrum_encryption_key","eth",b"eth","fingerprint",b"fingerprint","insert_remove_sdcard",b"insert_remove_sdcard","list_backups",b"list_backups","perform_attestation",b"perform_attestation","reboot",b"reboot","request",b"request","reset",b"reset","restore_backup",b"restore_backup","restore_from_mnemonic",b"restore_from_mnemonic","set_mnemonic_passphrase_enabled",b"set_mnemonic_passphrase_enabled","set_password",b"set_password","show_mnemonic",b"show_mnemonic"]) -> None: ... - def WhichOneof(self, oneof_group: typing_extensions.Literal["request",b"request"]) -> typing.Optional[typing_extensions.Literal["device_name","device_language","device_info","set_password","create_backup","show_mnemonic","btc_pub","btc_sign_init","btc_sign_input","btc_sign_output","insert_remove_sdcard","check_sdcard","set_mnemonic_passphrase_enabled","list_backups","restore_backup","perform_attestation","reboot","check_backup","eth","reset","restore_from_mnemonic","fingerprint","btc","electrum_encryption_key","cardano","bip85"]]: ... + device_name: bitbox02_system_pb2.SetDeviceNameRequest | None = ..., + device_language: bitbox02_system_pb2.SetDeviceLanguageRequest | None = ..., + device_info: bitbox02_system_pb2.DeviceInfoRequest | None = ..., + set_password: bitbox02_system_pb2.SetPasswordRequest | None = ..., + create_backup: backup_commands_pb2.CreateBackupRequest | None = ..., + show_mnemonic: mnemonic_pb2.ShowMnemonicRequest | None = ..., + btc_pub: btc_pb2.BTCPubRequest | None = ..., + btc_sign_init: btc_pb2.BTCSignInitRequest | None = ..., + btc_sign_input: btc_pb2.BTCSignInputRequest | None = ..., + btc_sign_output: btc_pb2.BTCSignOutputRequest | None = ..., + insert_remove_sdcard: bitbox02_system_pb2.InsertRemoveSDCardRequest | None = ..., + check_sdcard: bitbox02_system_pb2.CheckSDCardRequest | None = ..., + set_mnemonic_passphrase_enabled: mnemonic_pb2.SetMnemonicPassphraseEnabledRequest | None = ..., + list_backups: backup_commands_pb2.ListBackupsRequest | None = ..., + restore_backup: backup_commands_pb2.RestoreBackupRequest | None = ..., + perform_attestation: perform_attestation_pb2.PerformAttestationRequest | None = ..., + reboot: system_pb2.RebootRequest | None = ..., + check_backup: backup_commands_pb2.CheckBackupRequest | None = ..., + eth: eth_pb2.ETHRequest | None = ..., + reset: bitbox02_system_pb2.ResetRequest | None = ..., + restore_from_mnemonic: mnemonic_pb2.RestoreFromMnemonicRequest | None = ..., + fingerprint: common_pb2.RootFingerprintRequest | None = ..., + btc: btc_pb2.BTCRequest | None = ..., + electrum_encryption_key: keystore_pb2.ElectrumEncryptionKeyRequest | None = ..., + cardano: cardano_pb2.CardanoRequest | None = ..., + bip85: keystore_pb2.BIP85Request | None = ..., + bluetooth: bluetooth_pb2.BluetoothRequest | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["bip85", b"bip85", "bluetooth", b"bluetooth", "btc", b"btc", "btc_pub", b"btc_pub", "btc_sign_init", b"btc_sign_init", "btc_sign_input", b"btc_sign_input", "btc_sign_output", b"btc_sign_output", "cardano", b"cardano", "check_backup", b"check_backup", "check_sdcard", b"check_sdcard", "create_backup", b"create_backup", "device_info", b"device_info", "device_language", b"device_language", "device_name", b"device_name", "electrum_encryption_key", b"electrum_encryption_key", "eth", b"eth", "fingerprint", b"fingerprint", "insert_remove_sdcard", b"insert_remove_sdcard", "list_backups", b"list_backups", "perform_attestation", b"perform_attestation", "reboot", b"reboot", "request", b"request", "reset", b"reset", "restore_backup", b"restore_backup", "restore_from_mnemonic", b"restore_from_mnemonic", "set_mnemonic_passphrase_enabled", b"set_mnemonic_passphrase_enabled", "set_password", b"set_password", "show_mnemonic", b"show_mnemonic"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["bip85", b"bip85", "bluetooth", b"bluetooth", "btc", b"btc", "btc_pub", b"btc_pub", "btc_sign_init", b"btc_sign_init", "btc_sign_input", b"btc_sign_input", "btc_sign_output", b"btc_sign_output", "cardano", b"cardano", "check_backup", b"check_backup", "check_sdcard", b"check_sdcard", "create_backup", b"create_backup", "device_info", b"device_info", "device_language", b"device_language", "device_name", b"device_name", "electrum_encryption_key", b"electrum_encryption_key", "eth", b"eth", "fingerprint", b"fingerprint", "insert_remove_sdcard", b"insert_remove_sdcard", "list_backups", b"list_backups", "perform_attestation", b"perform_attestation", "reboot", b"reboot", "request", b"request", "reset", b"reset", "restore_backup", b"restore_backup", "restore_from_mnemonic", b"restore_from_mnemonic", "set_mnemonic_passphrase_enabled", b"set_mnemonic_passphrase_enabled", "set_password", b"set_password", "show_mnemonic", b"show_mnemonic"]) -> None: ... + def WhichOneof(self, oneof_group: typing.Literal["request", b"request"]) -> typing.Literal["device_name", "device_language", "device_info", "set_password", "create_backup", "show_mnemonic", "btc_pub", "btc_sign_init", "btc_sign_input", "btc_sign_output", "insert_remove_sdcard", "check_sdcard", "set_mnemonic_passphrase_enabled", "list_backups", "restore_backup", "perform_attestation", "reboot", "check_backup", "eth", "reset", "restore_from_mnemonic", "fingerprint", "btc", "electrum_encryption_key", "cardano", "bip85", "bluetooth"] | None: ... + global___Request = Request +@typing.final class Response(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + SUCCESS_FIELD_NUMBER: builtins.int ERROR_FIELD_NUMBER: builtins.int DEVICE_INFO_FIELD_NUMBER: builtins.int @@ -175,6 +207,7 @@ class Response(google.protobuf.message.Message): ELECTRUM_ENCRYPTION_KEY_FIELD_NUMBER: builtins.int CARDANO_FIELD_NUMBER: builtins.int BIP85_FIELD_NUMBER: builtins.int + BLUETOOTH_FIELD_NUMBER: builtins.int @property def success(self) -> global___Success: ... @property @@ -182,7 +215,7 @@ class Response(google.protobuf.message.Message): @property def device_info(self) -> bitbox02_system_pb2.DeviceInfoResponse: """removed: RandomNumberResponse random_number = 3;""" - pass + @property def pub(self) -> common_pb2.PubResponse: ... @property @@ -207,25 +240,30 @@ class Response(google.protobuf.message.Message): def cardano(self) -> cardano_pb2.CardanoResponse: ... @property def bip85(self) -> keystore_pb2.BIP85Response: ... - def __init__(self, + @property + def bluetooth(self) -> bluetooth_pb2.BluetoothResponse: ... + def __init__( + self, *, - success: typing.Optional[global___Success] = ..., - error: typing.Optional[global___Error] = ..., - device_info: typing.Optional[bitbox02_system_pb2.DeviceInfoResponse] = ..., - pub: typing.Optional[common_pb2.PubResponse] = ..., - btc_sign_next: typing.Optional[btc_pb2.BTCSignNextResponse] = ..., - list_backups: typing.Optional[backup_commands_pb2.ListBackupsResponse] = ..., - check_backup: typing.Optional[backup_commands_pb2.CheckBackupResponse] = ..., - perform_attestation: typing.Optional[perform_attestation_pb2.PerformAttestationResponse] = ..., - check_sdcard: typing.Optional[bitbox02_system_pb2.CheckSDCardResponse] = ..., - eth: typing.Optional[eth_pb2.ETHResponse] = ..., - fingerprint: typing.Optional[common_pb2.RootFingerprintResponse] = ..., - btc: typing.Optional[btc_pb2.BTCResponse] = ..., - electrum_encryption_key: typing.Optional[keystore_pb2.ElectrumEncryptionKeyResponse] = ..., - cardano: typing.Optional[cardano_pb2.CardanoResponse] = ..., - bip85: typing.Optional[keystore_pb2.BIP85Response] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["bip85",b"bip85","btc",b"btc","btc_sign_next",b"btc_sign_next","cardano",b"cardano","check_backup",b"check_backup","check_sdcard",b"check_sdcard","device_info",b"device_info","electrum_encryption_key",b"electrum_encryption_key","error",b"error","eth",b"eth","fingerprint",b"fingerprint","list_backups",b"list_backups","perform_attestation",b"perform_attestation","pub",b"pub","response",b"response","success",b"success"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["bip85",b"bip85","btc",b"btc","btc_sign_next",b"btc_sign_next","cardano",b"cardano","check_backup",b"check_backup","check_sdcard",b"check_sdcard","device_info",b"device_info","electrum_encryption_key",b"electrum_encryption_key","error",b"error","eth",b"eth","fingerprint",b"fingerprint","list_backups",b"list_backups","perform_attestation",b"perform_attestation","pub",b"pub","response",b"response","success",b"success"]) -> None: ... - def WhichOneof(self, oneof_group: typing_extensions.Literal["response",b"response"]) -> typing.Optional[typing_extensions.Literal["success","error","device_info","pub","btc_sign_next","list_backups","check_backup","perform_attestation","check_sdcard","eth","fingerprint","btc","electrum_encryption_key","cardano","bip85"]]: ... + success: global___Success | None = ..., + error: global___Error | None = ..., + device_info: bitbox02_system_pb2.DeviceInfoResponse | None = ..., + pub: common_pb2.PubResponse | None = ..., + btc_sign_next: btc_pb2.BTCSignNextResponse | None = ..., + list_backups: backup_commands_pb2.ListBackupsResponse | None = ..., + check_backup: backup_commands_pb2.CheckBackupResponse | None = ..., + perform_attestation: perform_attestation_pb2.PerformAttestationResponse | None = ..., + check_sdcard: bitbox02_system_pb2.CheckSDCardResponse | None = ..., + eth: eth_pb2.ETHResponse | None = ..., + fingerprint: common_pb2.RootFingerprintResponse | None = ..., + btc: btc_pb2.BTCResponse | None = ..., + electrum_encryption_key: keystore_pb2.ElectrumEncryptionKeyResponse | None = ..., + cardano: cardano_pb2.CardanoResponse | None = ..., + bip85: keystore_pb2.BIP85Response | None = ..., + bluetooth: bluetooth_pb2.BluetoothResponse | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["bip85", b"bip85", "bluetooth", b"bluetooth", "btc", b"btc", "btc_sign_next", b"btc_sign_next", "cardano", b"cardano", "check_backup", b"check_backup", "check_sdcard", b"check_sdcard", "device_info", b"device_info", "electrum_encryption_key", b"electrum_encryption_key", "error", b"error", "eth", b"eth", "fingerprint", b"fingerprint", "list_backups", b"list_backups", "perform_attestation", b"perform_attestation", "pub", b"pub", "response", b"response", "success", b"success"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["bip85", b"bip85", "bluetooth", b"bluetooth", "btc", b"btc", "btc_sign_next", b"btc_sign_next", "cardano", b"cardano", "check_backup", b"check_backup", "check_sdcard", b"check_sdcard", "device_info", b"device_info", "electrum_encryption_key", b"electrum_encryption_key", "error", b"error", "eth", b"eth", "fingerprint", b"fingerprint", "list_backups", b"list_backups", "perform_attestation", b"perform_attestation", "pub", b"pub", "response", b"response", "success", b"success"]) -> None: ... + def WhichOneof(self, oneof_group: typing.Literal["response", b"response"]) -> typing.Literal["success", "error", "device_info", "pub", "btc_sign_next", "list_backups", "check_backup", "perform_attestation", "check_sdcard", "eth", "fingerprint", "btc", "electrum_encryption_key", "cardano", "bip85", "bluetooth"] | None: ... + global___Response = Response diff --git a/hwilib/devices/bitbox02_lib/communication/generated/keystore_pb2.pyi b/hwilib/devices/bitbox02_lib/communication/generated/keystore_pb2.pyi index 8159aee00..c88caa801 100644 --- a/hwilib/devices/bitbox02_lib/communication/generated/keystore_pb2.pyi +++ b/hwilib/devices/bitbox02_lib/communication/generated/keystore_pb2.pyi @@ -1,51 +1,67 @@ """ @generated by mypy-protobuf. Do not edit manually! isort:skip_file +This function can be used to get an identifying xpub at the keypath m/4541509'/1112098098'" +The keypath argument has to be m/4541509'/1112098098' """ + import builtins +import collections.abc import google.protobuf.descriptor import google.protobuf.empty_pb2 import google.protobuf.internal.containers import google.protobuf.message import typing -import typing_extensions DESCRIPTOR: google.protobuf.descriptor.FileDescriptor +@typing.final class ElectrumEncryptionKeyRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + KEYPATH_FIELD_NUMBER: builtins.int @property def keypath(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]: ... - def __init__(self, + def __init__( + self, *, - keypath: typing.Optional[typing.Iterable[builtins.int]] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["keypath",b"keypath"]) -> None: ... + keypath: collections.abc.Iterable[builtins.int] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["keypath", b"keypath"]) -> None: ... + global___ElectrumEncryptionKeyRequest = ElectrumEncryptionKeyRequest +@typing.final class ElectrumEncryptionKeyResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + KEY_FIELD_NUMBER: builtins.int - key: typing.Text - def __init__(self, + key: builtins.str + def __init__( + self, *, - key: typing.Text = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["key",b"key"]) -> None: ... + key: builtins.str = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["key", b"key"]) -> None: ... + global___ElectrumEncryptionKeyResponse = ElectrumEncryptionKeyResponse +@typing.final class BIP85Request(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + + @typing.final class AppLn(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + ACCOUNT_NUMBER_FIELD_NUMBER: builtins.int account_number: builtins.int - def __init__(self, + def __init__( + self, *, account_number: builtins.int = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["account_number",b"account_number"]) -> None: ... + ) -> None: ... + def ClearField(self, field_name: typing.Literal["account_number", b"account_number"]) -> None: ... BIP39_FIELD_NUMBER: builtins.int LN_FIELD_NUMBER: builtins.int @@ -53,29 +69,35 @@ class BIP85Request(google.protobuf.message.Message): def bip39(self) -> google.protobuf.empty_pb2.Empty: ... @property def ln(self) -> global___BIP85Request.AppLn: ... - def __init__(self, + def __init__( + self, *, - bip39: typing.Optional[google.protobuf.empty_pb2.Empty] = ..., - ln: typing.Optional[global___BIP85Request.AppLn] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["app",b"app","bip39",b"bip39","ln",b"ln"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["app",b"app","bip39",b"bip39","ln",b"ln"]) -> None: ... - def WhichOneof(self, oneof_group: typing_extensions.Literal["app",b"app"]) -> typing.Optional[typing_extensions.Literal["bip39","ln"]]: ... + bip39: google.protobuf.empty_pb2.Empty | None = ..., + ln: global___BIP85Request.AppLn | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["app", b"app", "bip39", b"bip39", "ln", b"ln"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["app", b"app", "bip39", b"bip39", "ln", b"ln"]) -> None: ... + def WhichOneof(self, oneof_group: typing.Literal["app", b"app"]) -> typing.Literal["bip39", "ln"] | None: ... + global___BIP85Request = BIP85Request +@typing.final class BIP85Response(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + BIP39_FIELD_NUMBER: builtins.int LN_FIELD_NUMBER: builtins.int + ln: builtins.bytes @property def bip39(self) -> google.protobuf.empty_pb2.Empty: ... - ln: builtins.bytes - def __init__(self, + def __init__( + self, *, - bip39: typing.Optional[google.protobuf.empty_pb2.Empty] = ..., + bip39: google.protobuf.empty_pb2.Empty | None = ..., ln: builtins.bytes = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["app",b"app","bip39",b"bip39","ln",b"ln"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["app",b"app","bip39",b"bip39","ln",b"ln"]) -> None: ... - def WhichOneof(self, oneof_group: typing_extensions.Literal["app",b"app"]) -> typing.Optional[typing_extensions.Literal["bip39","ln"]]: ... + ) -> None: ... + def HasField(self, field_name: typing.Literal["app", b"app", "bip39", b"bip39", "ln", b"ln"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["app", b"app", "bip39", b"bip39", "ln", b"ln"]) -> None: ... + def WhichOneof(self, oneof_group: typing.Literal["app", b"app"]) -> typing.Literal["bip39", "ln"] | None: ... + global___BIP85Response = BIP85Response diff --git a/hwilib/devices/bitbox02_lib/communication/generated/mnemonic_pb2.pyi b/hwilib/devices/bitbox02_lib/communication/generated/mnemonic_pb2.pyi index 60dc3568c..a3c988fc1 100644 --- a/hwilib/devices/bitbox02_lib/communication/generated/mnemonic_pb2.pyi +++ b/hwilib/devices/bitbox02_lib/communication/generated/mnemonic_pb2.pyi @@ -1,41 +1,67 @@ """ @generated by mypy-protobuf. Do not edit manually! isort:skip_file +Copyright 2019 Shift Cryptosecurity AG + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. """ + import builtins import google.protobuf.descriptor import google.protobuf.message -import typing_extensions +import typing DESCRIPTOR: google.protobuf.descriptor.FileDescriptor +@typing.final class ShowMnemonicRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor - def __init__(self, - ) -> None: ... + + def __init__( + self, + ) -> None: ... + global___ShowMnemonicRequest = ShowMnemonicRequest +@typing.final class RestoreFromMnemonicRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + TIMESTAMP_FIELD_NUMBER: builtins.int TIMEZONE_OFFSET_FIELD_NUMBER: builtins.int timestamp: builtins.int timezone_offset: builtins.int - def __init__(self, + def __init__( + self, *, timestamp: builtins.int = ..., timezone_offset: builtins.int = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["timestamp",b"timestamp","timezone_offset",b"timezone_offset"]) -> None: ... + ) -> None: ... + def ClearField(self, field_name: typing.Literal["timestamp", b"timestamp", "timezone_offset", b"timezone_offset"]) -> None: ... + global___RestoreFromMnemonicRequest = RestoreFromMnemonicRequest +@typing.final class SetMnemonicPassphraseEnabledRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + ENABLED_FIELD_NUMBER: builtins.int enabled: builtins.bool - def __init__(self, + def __init__( + self, *, enabled: builtins.bool = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["enabled",b"enabled"]) -> None: ... + ) -> None: ... + def ClearField(self, field_name: typing.Literal["enabled", b"enabled"]) -> None: ... + global___SetMnemonicPassphraseEnabledRequest = SetMnemonicPassphraseEnabledRequest diff --git a/hwilib/devices/bitbox02_lib/communication/generated/perform_attestation_pb2.pyi b/hwilib/devices/bitbox02_lib/communication/generated/perform_attestation_pb2.pyi index 830918a3e..2178082b6 100644 --- a/hwilib/devices/bitbox02_lib/communication/generated/perform_attestation_pb2.pyi +++ b/hwilib/devices/bitbox02_lib/communication/generated/perform_attestation_pb2.pyi @@ -2,30 +2,38 @@ @generated by mypy-protobuf. Do not edit manually! isort:skip_file """ + import builtins import google.protobuf.descriptor import google.protobuf.message -import typing_extensions +import typing DESCRIPTOR: google.protobuf.descriptor.FileDescriptor +@typing.final class PerformAttestationRequest(google.protobuf.message.Message): """Deprecated, last used in v1.0.0""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + CHALLENGE_FIELD_NUMBER: builtins.int challenge: builtins.bytes """32 bytes challenge.""" - - def __init__(self, + def __init__( + self, *, challenge: builtins.bytes = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["challenge",b"challenge"]) -> None: ... + ) -> None: ... + def ClearField(self, field_name: typing.Literal["challenge", b"challenge"]) -> None: ... + global___PerformAttestationRequest = PerformAttestationRequest +@typing.final class PerformAttestationResponse(google.protobuf.message.Message): """Deprecated, last used in v1.0.0""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + BOOTLOADER_HASH_FIELD_NUMBER: builtins.int DEVICE_PUBKEY_FIELD_NUMBER: builtins.int CERTIFICATE_FIELD_NUMBER: builtins.int @@ -36,13 +44,15 @@ class PerformAttestationResponse(google.protobuf.message.Message): certificate: builtins.bytes root_pubkey_identifier: builtins.bytes challenge_signature: builtins.bytes - def __init__(self, + def __init__( + self, *, bootloader_hash: builtins.bytes = ..., device_pubkey: builtins.bytes = ..., certificate: builtins.bytes = ..., root_pubkey_identifier: builtins.bytes = ..., challenge_signature: builtins.bytes = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["bootloader_hash",b"bootloader_hash","certificate",b"certificate","challenge_signature",b"challenge_signature","device_pubkey",b"device_pubkey","root_pubkey_identifier",b"root_pubkey_identifier"]) -> None: ... + ) -> None: ... + def ClearField(self, field_name: typing.Literal["bootloader_hash", b"bootloader_hash", "certificate", b"certificate", "challenge_signature", b"challenge_signature", "device_pubkey", b"device_pubkey", "root_pubkey_identifier", b"root_pubkey_identifier"]) -> None: ... + global___PerformAttestationResponse = PerformAttestationResponse diff --git a/hwilib/devices/bitbox02_lib/communication/generated/system_pb2.pyi b/hwilib/devices/bitbox02_lib/communication/generated/system_pb2.pyi index a23b8693a..a21c31d80 100644 --- a/hwilib/devices/bitbox02_lib/communication/generated/system_pb2.pyi +++ b/hwilib/devices/bitbox02_lib/communication/generated/system_pb2.pyi @@ -1,36 +1,59 @@ """ @generated by mypy-protobuf. Do not edit manually! isort:skip_file +Copyright 2019 Shift Cryptosecurity AG + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. """ + import builtins import google.protobuf.descriptor import google.protobuf.internal.enum_type_wrapper import google.protobuf.message +import sys import typing -import typing_extensions + +if sys.version_info >= (3, 10): + import typing as typing_extensions +else: + import typing_extensions DESCRIPTOR: google.protobuf.descriptor.FileDescriptor +@typing.final class RebootRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + class _Purpose: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType + class _PurposeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[RebootRequest._Purpose.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor UPGRADE: RebootRequest._Purpose.ValueType # 0 SETTINGS: RebootRequest._Purpose.ValueType # 1 - class Purpose(_Purpose, metaclass=_PurposeEnumTypeWrapper): - pass + class Purpose(_Purpose, metaclass=_PurposeEnumTypeWrapper): ... UPGRADE: RebootRequest.Purpose.ValueType # 0 SETTINGS: RebootRequest.Purpose.ValueType # 1 PURPOSE_FIELD_NUMBER: builtins.int purpose: global___RebootRequest.Purpose.ValueType - def __init__(self, + def __init__( + self, *, purpose: global___RebootRequest.Purpose.ValueType = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["purpose",b"purpose"]) -> None: ... + ) -> None: ... + def ClearField(self, field_name: typing.Literal["purpose", b"purpose"]) -> None: ... + global___RebootRequest = RebootRequest diff --git a/hwilib/devices/bitbox02_lib/communication/u2fhid/u2fhid.py b/hwilib/devices/bitbox02_lib/communication/u2fhid/u2fhid.py index 3e6e84db8..3b41c5c3d 100644 --- a/hwilib/devices/bitbox02_lib/communication/u2fhid/u2fhid.py +++ b/hwilib/devices/bitbox02_lib/communication/u2fhid/u2fhid.py @@ -101,7 +101,7 @@ def write(self, data: bytes, endpoint: int, cid: int) -> None: b"\0" + struct.pack(">IBH", cid, endpoint, data_len) + buf - + b"\xEE" * (USB_REPORT_SIZE - 7 - len(buf)) + + b"\xee" * (USB_REPORT_SIZE - 7 - len(buf)) ) else: # CONT frame @@ -110,7 +110,7 @@ def write(self, data: bytes, endpoint: int, cid: int) -> None: b"\0" + struct.pack(">IB", cid, seq) + buf - + b"\xEE" * (USB_REPORT_SIZE - 5 - len(buf)) + + b"\xee" * (USB_REPORT_SIZE - 5 - len(buf)) ) seq += 1 idx += len(buf) From 48e5b9a16369de3ef8b6ed6f3d29e265b8a32f4b Mon Sep 17 00:00:00 2001 From: Marko Bencun Date: Fri, 29 Aug 2025 16:57:17 +0200 Subject: [PATCH 28/31] bitbox02: fix path to simulator --- .github/workflows/ci.yml | 2 +- test/run_tests.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5e6150af4..c58a2112e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -183,7 +183,7 @@ jobs: matrix: device: - { name: 'bitbox01', archive: 'mcu', paths: 'test/work/mcu' } - - { name: 'bitbox02', archive: 'bitbox02', paths: 'test/work/bitbox02-firmware/build-build/bin/simulator' } + - { name: 'bitbox02', archive: 'bitbox02', paths: 'test/work/bitbox02-firmware/build-build-noasan/bin/simulator' } steps: - uses: actions/checkout@v4 diff --git a/test/run_tests.py b/test/run_tests.py index 42384b117..80300db1f 100755 --- a/test/run_tests.py +++ b/test/run_tests.py @@ -63,7 +63,7 @@ parser.add_argument('--bitbox01-path', dest='bitbox01_path', help='Path to Digital Bitbox simulator', default='work/mcu/build/bin/simulator') parser.add_argument('--ledger-path', dest='ledger_path', help='Path to Ledger emulator', default='work/speculos/speculos.py') parser.add_argument('--jade-path', dest='jade_path', help='Path to Jade qemu emulator', default='work/jade/simulator') -parser.add_argument('--bitbox02-path', dest='bitbox02_path', help='Path to BitBox02 simulator', default='work/bitbox02-firmware/build-build/bin/simulator') +parser.add_argument('--bitbox02-path', dest='bitbox02_path', help='Path to BitBox02 simulator', default='work/bitbox02-firmware/build-build-noasan/bin/simulator') parser.add_argument('--all', help='Run tests on all existing simulators', default=False, action='store_true') parser.add_argument('--bitcoind', help='Path to bitcoind', default='work/bitcoin/build/bin/bitcoind') From 6b923c801a389c9b8685086507e09b5318fe3c1c Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Fri, 29 Aug 2025 14:56:38 +0200 Subject: [PATCH 29/31] ci: combine dist and test jobs Also fixes indentation. --- .github/actions/test-device/action.yml | 2 +- .github/actions/test-dist/action.yml | 12 +- .github/workflows/ci.yml | 321 +++++++++---------------- 3 files changed, 115 insertions(+), 220 deletions(-) diff --git a/.github/actions/test-device/action.yml b/.github/actions/test-device/action.yml index 4bf20a7b1..2fc72beda 100644 --- a/.github/actions/test-device/action.yml +++ b/.github/actions/test-device/action.yml @@ -23,7 +23,7 @@ runs: - name: Run tests shell: bash run: | - cd test; poetry run ./run_tests.py --${{ matrix.device }} --interface=${{ matrix.interface }} --device-only; cd .. + cd test; poetry run ./run_tests.py --${{ matrix.device }} --interface=${{ matrix.test.interface }} --device-only; cd .. - if: failure() shell: bash diff --git a/.github/actions/test-dist/action.yml b/.github/actions/test-dist/action.yml index 99fab7e96..2330d8cfb 100644 --- a/.github/actions/test-dist/action.yml +++ b/.github/actions/test-dist/action.yml @@ -13,19 +13,19 @@ runs: path: dist/ - name: Install (Wheel) - if: matrix.script == 'Wheel' + if: matrix.test.script == 'Wheel' shell: bash run: | pip install dist/*.whl - name: Install (Sdist) - if: matrix.script == 'Sdist' + if: matrix.test.script == 'Sdist' shell: bash run: | pip install $(find dist -name "*.tar.gz" -a -not -name "*linux*") - name: Install (Bindist) - if: matrix.script == 'Bindist' + if: matrix.test.script == 'Bindist' shell: bash run: | poetry install; cd dist; tar -xvf hwi*linux*.tar.gz; cd .. @@ -43,19 +43,19 @@ runs: device: ${{ matrix.device }} - name: Run tests (Wheel) - if: matrix.script == 'Wheel' + if: matrix.test.script == 'Wheel' shell: bash run: | cd test; ./run_tests.py $DEVICE --interface=cli --device-only; cd .. - name: Run tests (Sdist) - if: matrix.script == 'Sdist' + if: matrix.test.script == 'Sdist' shell: bash run: | cd test; ./run_tests.py $DEVICE --interface=cli --device-only; cd .. - name: Run tests (Bindist) - if: matrix.script == 'Bindist' + if: matrix.test.script == 'Bindist' shell: bash run: | cd test; poetry run ./run_tests.py $DEVICE --interface=bindist --device-only; cd .. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c58a2112e..8d23e21fe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -272,13 +272,11 @@ jobs: - uses: actions/checkout@v4 - uses: ./.github/actions/build-bitcoind - test-trezor-dist: - name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.script }} + test-trezor: + name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.test.script || matrix.test.interface }} runs-on: ubuntu-latest - needs: - - dist-builder - - sim-builder-trezor - - bitcoind-builder + needs: [ sim-builder-trezor, bitcoind-builder, dist-builder ] + timeout-minutes: 45 strategy: fail-fast: false @@ -287,166 +285,124 @@ jobs: device: - 'trezor-1' - 'trezor-t' - script: - - 'Wheel' - - 'Sdist' - - 'Bindist' - - env: - DEVICE: '--${{ matrix.device }}' - - container: python:${{ matrix.python-version }} - - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/test-dist - - test-coldcard-dist: - name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.script.name }} - runs-on: ubuntu-latest - needs: - - dist-builder - - sim-builder-coldcard - - bitcoind-builder - - strategy: - fail-fast: false - matrix: - python-version: [ '3.9', '3.10', '3.11', '3.12' ] - device: - - 'coldcard' - script: - - 'Wheel' - - 'Sdist' - - 'Bindist' - - env: - DEVICE: '--${{ matrix.device }}' - - container: python:${{ matrix.python-version }} - - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/test-dist - - test-bitbox-dist: - name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.script.name }} - runs-on: ubuntu-latest - needs: - - dist-builder - - sim-builder-bitbox - - bitcoind-builder - - strategy: - fail-fast: false - matrix: - python-version: [ '3.9', '3.10', '3.11', '3.12' ] - device: - - 'bitbox01' - - 'bitbox02' - script: - - 'Wheel' - - 'Sdist' - - 'Bindist' - - env: - DEVICE: '--${{ matrix.device }}' + test: + - {interface: 'library'} + - {interface: 'cli'} + - {interface: 'stdin'} + - {script: 'Wheel'} + - {script: 'Sdist'} + - {script: 'Bindist'} container: python:${{ matrix.python-version }} steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/test-dist + - name: run test + if: ${{ matrix.test.interface }} + uses: ./.github/actions/test-device + - name: run dist test + if: ${{ matrix.test.script }} + uses: ./.github/actions/test-dist - test-jade-dist: - name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.script.name }} + test-ledger: + name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.test.script || matrix.test.interface }} runs-on: ubuntu-latest - needs: - - dist-builder - - sim-builder-jade - - bitcoind-builder + needs: [ sim-builder-ledger, ledger-s-app-builder, ledger-x-app-builder, bitcoind-builder ] + timeout-minutes: 45 strategy: fail-fast: false matrix: python-version: [ '3.9', '3.10', '3.11', '3.12' ] device: - - 'jade' - script: - - 'Wheel' - - 'Sdist' - - 'Bindist' - - env: - DEVICE: '--${{ matrix.device }}' + - 'ledger' + - 'ledger-legacy' + test: + - {interface: 'library'} + - {interface: 'cli'} + - {interface: 'stdin'} + - {script: 'Wheel'} + - {script: 'Sdist'} + - {script: 'Bindist'} container: python:${{ matrix.python-version }} steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/test-dist + - name: run test + if: ${{ matrix.test.interface }} + uses: ./.github/actions/test-device + - name: run dist test + if: ${{ matrix.test.script }} + uses: ./.github/actions/test-dist - test-ledger-dist: - name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.script.name }} - runs-on: ubuntu-latest - needs: - - dist-builder - - sim-builder-ledger - - bitcoind-builder + test-coldcard: + name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.test.script || matrix.test.interface }} + runs-on: ubuntu-22.04 + needs: [ sim-builder-coldcard, bitcoind-builder ] + timeout-minutes: 45 strategy: fail-fast: false matrix: python-version: [ '3.9', '3.10', '3.11', '3.12' ] device: - - 'ledger' - - 'ledger-legacy' - script: - - 'Wheel' - - 'Sdist' - - 'Bindist' - - env: - DEVICE: '--${{ matrix.device }}' + - 'coldcard' + test: + - {interface: 'library'} + - {interface: 'cli'} + - {interface: 'stdin'} + - {script: 'Wheel'} + - {script: 'Sdist'} + - {script: 'Bindist'} container: python:${{ matrix.python-version }} steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/test-dist + - name: run test + if: ${{ matrix.test.interface }} + uses: ./.github/actions/test-device + - name: run dist test + if: ${{ matrix.test.script }} + uses: ./.github/actions/test-dist - test-keepkey-dist: - name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.script.name }} + test-bitbox: + name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.test.script || matrix.test.interface }} runs-on: ubuntu-latest - needs: - - dist-builder - - sim-builder-keepkey - - bitcoind-builder + needs: [ sim-builder-bitbox, bitcoind-builder ] + timeout-minutes: 45 strategy: fail-fast: false matrix: python-version: [ '3.9', '3.10', '3.11', '3.12' ] device: - - 'keepkey' - script: - - 'Wheel' - - 'Sdist' - - 'Bindist' - - env: - DEVICE: '--${{ matrix.device }}' + - 'bitbox01' + - 'bitbox02' + test: + - {interface: 'library'} + - {interface: 'cli'} + - {interface: 'stdin'} + - {script: 'Wheel'} + - {script: 'Sdist'} + - {script: 'Bindist'} container: python:${{ matrix.python-version }} steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/test-dist + - name: run test + if: ${{ matrix.test.interface }} + uses: ./.github/actions/test-device + - name: run dist test + if: ${{ matrix.test.script }} + uses: ./.github/actions/test-dist - test-trezor: - name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.interface }} + test-jade: + name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.test.script || matrix.test.interface }} runs-on: ubuntu-latest - needs: [ sim-builder-trezor, bitcoind-builder ] + needs: [ sim-builder-jade, bitcoind-builder ] timeout-minutes: 45 strategy: @@ -454,20 +410,30 @@ jobs: matrix: python-version: [ '3.9', '3.10', '3.11', '3.12' ] device: - - 'trezor-1' - - 'trezor-t' - interface: [ 'library', 'cli', 'stdin' ] + - 'jade' + test: + - {interface: 'library'} + - {interface: 'cli'} + - {interface: 'stdin'} + - {script: 'Wheel'} + - {script: 'Sdist'} + - {script: 'Bindist'} container: python:${{ matrix.python-version }} steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/test-device + - name: run test + if: ${{ matrix.test.interface }} + uses: ./.github/actions/test-device + - name: run dist test + if: ${{ matrix.test.script }} + uses: ./.github/actions/test-dist - test-ledger: - name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.interface }} + test-keepkey: + name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.test.script || matrix.test.interface }} runs-on: ubuntu-latest - needs: [ sim-builder-ledger, ledger-s-app-builder, ledger-x-app-builder, bitcoind-builder ] + needs: [ sim-builder-keepkey, bitcoind-builder ] timeout-minutes: 45 strategy: @@ -475,94 +441,23 @@ jobs: matrix: python-version: [ '3.9', '3.10', '3.11', '3.12' ] device: - - 'ledger' - - 'ledger-legacy' - interface: [ 'library', 'cli', 'stdin' ] + - 'keepkey' + test: + - {interface: 'library'} + - {interface: 'cli'} + - {interface: 'stdin'} + - {script: 'Wheel'} + - {script: 'Sdist'} + - {script: 'Bindist'} container: python:${{ matrix.python-version }} steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/test-device - - test-coldcard: - name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.interface }} - runs-on: ubuntu-22.04 - needs: [ sim-builder-coldcard, bitcoind-builder ] - timeout-minutes: 45 - - strategy: - fail-fast: false - matrix: - python-version: [ '3.9', '3.10', '3.11', '3.12' ] - device: - - 'coldcard' - interface: [ 'library', 'cli', 'stdin' ] - - container: python:${{ matrix.python-version }} - - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/test-device - - test-bitbox: - name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.interface }} - runs-on: ubuntu-latest - needs: [ sim-builder-bitbox, bitcoind-builder ] - timeout-minutes: 45 - - strategy: - fail-fast: false - matrix: - python-version: [ '3.9', '3.10', '3.11', '3.12' ] - device: - - 'bitbox01' - - 'bitbox02' - interface: [ 'library', 'cli', 'stdin' ] - - container: python:${{ matrix.python-version }} - - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/test-device - - test-jade: - name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.interface }} - runs-on: ubuntu-latest - needs: [ sim-builder-jade, bitcoind-builder ] - timeout-minutes: 45 - - strategy: - fail-fast: false - matrix: - python-version: [ '3.9', '3.10', '3.11', '3.12' ] - device: - - 'jade' - interface: [ 'library', 'cli', 'stdin' ] - - container: python:${{ matrix.python-version }} - - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/test-device - - test-keepkey: - name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.interface }} - runs-on: ubuntu-latest - needs: [ sim-builder-keepkey, bitcoind-builder ] - timeout-minutes: 45 - - strategy: - fail-fast: false - matrix: - python-version: [ '3.9', '3.10', '3.11', '3.12' ] - device: - - 'keepkey' - interface: [ 'library', 'cli', 'stdin' ] - - container: python:${{ matrix.python-version }} - - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/test-device + - name: run test + if: ${{ matrix.test.interface }} + uses: ./.github/actions/test-device + - name: run dist test + if: ${{ matrix.test.script }} + uses: ./.github/actions/test-dist From b2e14059b4f09ee0490c5920818ff08554f9a40c Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Fri, 29 Aug 2025 15:49:21 +0200 Subject: [PATCH 30/31] ci: use Device Test Template Co-authored-by: Claude --- .github/workflows/ci.yml | 229 +++++++----------------------- .github/workflows/device-test.yml | 38 +++++ 2 files changed, 86 insertions(+), 181 deletions(-) create mode 100644 .github/workflows/device-test.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8d23e21fe..4178500b8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -273,191 +273,58 @@ jobs: - uses: ./.github/actions/build-bitcoind test-trezor: - name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.test.script || matrix.test.interface }} - runs-on: ubuntu-latest - needs: [ sim-builder-trezor, bitcoind-builder, dist-builder ] - timeout-minutes: 45 - - strategy: - fail-fast: false - matrix: - python-version: [ '3.9', '3.10', '3.11', '3.12' ] - device: - - 'trezor-1' - - 'trezor-t' - test: - - {interface: 'library'} - - {interface: 'cli'} - - {interface: 'stdin'} - - {script: 'Wheel'} - - {script: 'Sdist'} - - {script: 'Bindist'} - - container: python:${{ matrix.python-version }} - - steps: - - uses: actions/checkout@v4 - - name: run test - if: ${{ matrix.test.interface }} - uses: ./.github/actions/test-device - - name: run dist test - if: ${{ matrix.test.script }} - uses: ./.github/actions/test-dist - - test-ledger: - name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.test.script || matrix.test.interface }} - runs-on: ubuntu-latest - needs: [ sim-builder-ledger, ledger-s-app-builder, ledger-x-app-builder, bitcoind-builder ] - timeout-minutes: 45 - - strategy: - fail-fast: false - matrix: - python-version: [ '3.9', '3.10', '3.11', '3.12' ] - device: - - 'ledger' - - 'ledger-legacy' - test: - - {interface: 'library'} - - {interface: 'cli'} - - {interface: 'stdin'} - - {script: 'Wheel'} - - {script: 'Sdist'} - - {script: 'Bindist'} - - container: python:${{ matrix.python-version }} - - steps: - - uses: actions/checkout@v4 - - name: run test - if: ${{ matrix.test.interface }} - uses: ./.github/actions/test-device - - name: run dist test - if: ${{ matrix.test.script }} - uses: ./.github/actions/test-dist + uses: ./.github/workflows/device-test.yml + needs: [sim-builder-trezor, bitcoind-builder, dist-builder] + with: + device: trezor + runs-on: ubuntu-latest + + test-ledger-s: + uses: ./.github/workflows/device-test.yml + needs: [sim-builder-ledger, ledger-s-app-builder, bitcoind-builder, dist-builder] + with: + device: ledger-legacy + runs-on: ubuntu-latest + + test-ledger-x: + uses: ./.github/workflows/device-test.yml + needs: [sim-builder-ledger, ledger-x-app-builder, bitcoind-builder, dist-builder] + with: + device: ledger + runs-on: ubuntu-latest test-coldcard: - name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.test.script || matrix.test.interface }} - runs-on: ubuntu-22.04 - needs: [ sim-builder-coldcard, bitcoind-builder ] - timeout-minutes: 45 - - strategy: - fail-fast: false - matrix: - python-version: [ '3.9', '3.10', '3.11', '3.12' ] - device: - - 'coldcard' - test: - - {interface: 'library'} - - {interface: 'cli'} - - {interface: 'stdin'} - - {script: 'Wheel'} - - {script: 'Sdist'} - - {script: 'Bindist'} - - container: python:${{ matrix.python-version }} - - steps: - - uses: actions/checkout@v4 - - name: run test - if: ${{ matrix.test.interface }} - uses: ./.github/actions/test-device - - name: run dist test - if: ${{ matrix.test.script }} - uses: ./.github/actions/test-dist - - test-bitbox: - name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.test.script || matrix.test.interface }} - runs-on: ubuntu-latest - needs: [ sim-builder-bitbox, bitcoind-builder ] - timeout-minutes: 45 - - strategy: - fail-fast: false - matrix: - python-version: [ '3.9', '3.10', '3.11', '3.12' ] - device: - - 'bitbox01' - - 'bitbox02' - test: - - {interface: 'library'} - - {interface: 'cli'} - - {interface: 'stdin'} - - {script: 'Wheel'} - - {script: 'Sdist'} - - {script: 'Bindist'} - - container: python:${{ matrix.python-version }} - - steps: - - uses: actions/checkout@v4 - - name: run test - if: ${{ matrix.test.interface }} - uses: ./.github/actions/test-device - - name: run dist test - if: ${{ matrix.test.script }} - uses: ./.github/actions/test-dist + uses: ./.github/workflows/device-test.yml + needs: [sim-builder-coldcard, bitcoind-builder, dist-builder] + with: + device: coldcard + runs-on: ubuntu-22.04 + + test-bitbox01: + uses: ./.github/workflows/device-test.yml + needs: [sim-builder-bitbox, bitcoind-builder, dist-builder] + with: + device: bitbox01 + runs-on: ubuntu-latest + + test-bitbox02: + uses: ./.github/workflows/device-test.yml + needs: [sim-builder-bitbox, bitcoind-builder, dist-builder] + with: + device: bitbox02 + runs-on: ubuntu-latest test-jade: - name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.test.script || matrix.test.interface }} - runs-on: ubuntu-latest - needs: [ sim-builder-jade, bitcoind-builder ] - timeout-minutes: 45 - - strategy: - fail-fast: false - matrix: - python-version: [ '3.9', '3.10', '3.11', '3.12' ] - device: - - 'jade' - test: - - {interface: 'library'} - - {interface: 'cli'} - - {interface: 'stdin'} - - {script: 'Wheel'} - - {script: 'Sdist'} - - {script: 'Bindist'} - - container: python:${{ matrix.python-version }} - - steps: - - uses: actions/checkout@v4 - - name: run test - if: ${{ matrix.test.interface }} - uses: ./.github/actions/test-device - - name: run dist test - if: ${{ matrix.test.script }} - uses: ./.github/actions/test-dist + uses: ./.github/workflows/device-test.yml + needs: [sim-builder-jade, bitcoind-builder, dist-builder] + with: + device: jade + runs-on: ubuntu-latest test-keepkey: - name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.test.script || matrix.test.interface }} - runs-on: ubuntu-latest - needs: [ sim-builder-keepkey, bitcoind-builder ] - timeout-minutes: 45 - - strategy: - fail-fast: false - matrix: - python-version: [ '3.9', '3.10', '3.11', '3.12' ] - device: - - 'keepkey' - test: - - {interface: 'library'} - - {interface: 'cli'} - - {interface: 'stdin'} - - {script: 'Wheel'} - - {script: 'Sdist'} - - {script: 'Bindist'} - - container: python:${{ matrix.python-version }} - - steps: - - uses: actions/checkout@v4 - - name: run test - if: ${{ matrix.test.interface }} - uses: ./.github/actions/test-device - - name: run dist test - if: ${{ matrix.test.script }} - uses: ./.github/actions/test-dist + uses: ./.github/workflows/device-test.yml + needs: [sim-builder-keepkey, bitcoind-builder, dist-builder] + with: + device: keepkey + runs-on: ubuntu-latest diff --git a/.github/workflows/device-test.yml b/.github/workflows/device-test.yml new file mode 100644 index 000000000..13972f158 --- /dev/null +++ b/.github/workflows/device-test.yml @@ -0,0 +1,38 @@ +name: Device Test Template +on: + workflow_call: + inputs: + device: + required: true + type: string + runs-on: + required: false + type: string + default: ubuntu-latest + +jobs: + test-device: + name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.test.script || matrix.test.interface }} + runs-on: ${{ inputs.runs-on }} + timeout-minutes: 45 + strategy: + fail-fast: false + matrix: + python-version: ['3.9', '3.10', '3.11', '3.12'] + device: ${{ inputs.device }} + test: + - {interface: 'library'} + - {interface: 'cli'} + - {interface: 'stdin'} + - {script: 'Wheel'} + - {script: 'Sdist'} + - {script: 'Bindist'} + container: python:${{ matrix.python-version }} + steps: + - uses: actions/checkout@v4 + - name: run test + if: ${{ matrix.test.interface }} + uses: ./.github/actions/test-device + - name: run dist test + if: ${{ matrix.test.script }} + uses: ./.github/actions/test-dist From 70e14aa712b04be6f1aaae14d9a6ef330a96baa0 Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Fri, 29 Aug 2025 17:34:37 +0200 Subject: [PATCH 31/31] ci: move type check and simbuilds to own file Co-authored-by: Claude Co-authored-by: GPT-5 (Preview) --- .github/actions/build-sim/action.yml | 26 ++- .github/sim-build-map.json | 22 +++ .github/workflows/ci.yml | 198 +++++++-------------- .github/workflows/device-test.yml | 3 +- .github/workflows/ledger-app-builder.yml | 26 +++ .github/workflows/prepare-sim-matrices.yml | 50 ++++++ .github/workflows/sim-builder.yml | 30 ++++ .github/workflows/type-check.yml | 43 +++++ 8 files changed, 253 insertions(+), 145 deletions(-) create mode 100644 .github/sim-build-map.json create mode 100644 .github/workflows/ledger-app-builder.yml create mode 100644 .github/workflows/prepare-sim-matrices.yml create mode 100644 .github/workflows/sim-builder.yml create mode 100644 .github/workflows/type-check.yml diff --git a/.github/actions/build-sim/action.yml b/.github/actions/build-sim/action.yml index 323eb5f7e..e342ad845 100644 --- a/.github/actions/build-sim/action.yml +++ b/.github/actions/build-sim/action.yml @@ -1,5 +1,15 @@ name: Build sim description: Build device simulator(s) +inputs: + name: + description: Device name from matrix (e.g. trezor-1, coldcard, jade) + required: true + archive: + description: Archive base name (e.g. trezor-firmware) + required: true + paths: + description: Space-separated paths to include in the archive + required: true runs: using: composite steps: @@ -16,13 +26,17 @@ runs: - name: Build simulator shell: bash run: | - git config --global user.email "ci@ci.com" - git config --global user.name "ci" - cd test; ./setup_environment.sh --${{ matrix.device.name }}; cd .. - tar -czf ${{ matrix.device.archive }}.tar.gz ${{ matrix.device.paths }} + set -euxo pipefail + git config --global user.email 'ci@ci.com' + git config --global user.name 'ci' + git config --global --add safe.directory "$GITHUB_WORKSPACE" + cd test + ./setup_environment.sh --"${{ inputs.name }}" + cd .. + tar -czf "${{ inputs.archive }}.tar.gz" ${{ inputs.paths }} - uses: actions/upload-artifact@v4 with: - name: ${{ matrix.device.name }}-sim - path: ${{ matrix.device.archive }}.tar.gz + name: ${{ inputs.name }}-sim + path: ${{ inputs.archive }}.tar.gz diff --git a/.github/sim-build-map.json b/.github/sim-build-map.json new file mode 100644 index 000000000..24874d212 --- /dev/null +++ b/.github/sim-build-map.json @@ -0,0 +1,22 @@ +{ + "trezor": [ + { "name": "trezor-1", "archive": "trezor-firmware", "paths": "test/work/trezor-firmware" }, + { "name": "trezor-t", "archive": "trezor-firmware", "paths": "test/work/trezor-firmware" } + ], + "coldcard": [ + { "name": "coldcard", "archive": "coldcard-mpy", "paths": "test/work/firmware/external/micropython/ports/unix/coldcard-mpy test/work/firmware/unix/coldcard-mpy test/work/firmware/unix/l-mpy test/work/firmware/unix/l-port" } + ], + "bitbox": [ + { "name": "bitbox01", "archive": "mcu", "paths": "test/work/mcu" }, + { "name": "bitbox02", "archive": "bitbox02", "paths": "test/work/bitbox02-firmware/build-build-noasan/bin/simulator" } + ], + "jade": [ + { "name": "jade", "archive": "jade", "paths": "test/work/jade/simulator" } + ], + "ledger": [ + { "name": "ledger", "archive": "speculos", "paths": "test/work/speculos" } + ], + "keepkey": [ + { "name": "keepkey", "archive": "keepkey-firmware", "paths": "test/work/keepkey-firmware/bin" } + ] +} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4178500b8..b6cc8fb07 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,45 +19,6 @@ env: LANGUAGE: 'C.UTF-8' jobs: - type-check: - name: Type check - runs-on: ubuntu-latest - container: python:3.12 - steps: - - uses: actions/checkout@v4 - - - run: | - pip install poetry - poetry install - - - name: Run check - run: > - poetry run - mypy - hwi.py - hwilib/_base58.py - hwilib/_bech32.py - hwilib/_cli.py - hwilib/commands.py - hwilib/common.py - hwilib/descriptor.py - hwilib/devices/bitbox02.py - hwilib/devices/coldcard.py - hwilib/devices/digitalbitbox.py - hwilib/devices/jade.py - hwilib/devices/__init__.py - hwilib/devices/keepkey.py - hwilib/devices/ledger.py - hwilib/devices/trezor.py - hwilib/errors.py - hwilib/_script.py - hwilib/_serialize.py - hwilib/tx.py - hwilib/hwwclient.py - hwilib/__init__.py - hwilib/key.py - hwilib/udevinstaller.py - non-device-tests: name: Non-device tests runs-on: ubuntu-latest @@ -142,126 +103,80 @@ jobs: name: dist path: dist/ + prepare-sim-matrices: + name: Prepare sim matrices + uses: ./.github/workflows/prepare-sim-matrices.yml + sim-builder-trezor: name: Trezor sim builder - # Ubuntu 22.04 ships with glibc 2.35, which is needed to keep Trezor 1 - # binaries compatible with Debian Bookworm (glibc 2.36) Python containers. - # Trezor T binaries don't need this. - runs-on: ubuntu-22.04 - - strategy: - fail-fast: false - matrix: - device: - - { name: 'trezor-1', archive: 'trezor-firmware', paths: 'test/work/trezor-firmware' } - - { name: 'trezor-t', archive: 'trezor-firmware', paths: 'test/work/trezor-firmware' } - - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/build-sim + needs: prepare-sim-matrices + uses: ./.github/workflows/sim-builder.yml + with: + sim: trezor + include: ${{ needs.prepare-sim-matrices.outputs.trezor }} + # Ubuntu 22.04 ships with glibc 2.35, which is needed to keep Trezor 1 + # binaries compatible with Debian Bookworm (glibc 2.36) Python containers. + # Trezor T binaries don't need this. + runs-on: ubuntu-22.04 sim-builder-coldcard: name: Coldcard sim builder - runs-on: ubuntu-22.04 - - strategy: - fail-fast: false - matrix: - device: - - { name: 'coldcard', archive: 'coldcard-mpy', paths: 'test/work/firmware/external/micropython/ports/unix/coldcard-mpy test/work/firmware/unix/coldcard-mpy test/work/firmware/unix/l-mpy test/work/firmware/unix/l-port' } - - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/build-sim + needs: prepare-sim-matrices + uses: ./.github/workflows/sim-builder.yml + with: + sim: coldcard + include: ${{ needs.prepare-sim-matrices.outputs.coldcard }} + runs-on: ubuntu-22.04 sim-builder-bitbox: name: Bitbox sim builder - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - device: - - { name: 'bitbox01', archive: 'mcu', paths: 'test/work/mcu' } - - { name: 'bitbox02', archive: 'bitbox02', paths: 'test/work/bitbox02-firmware/build-build-noasan/bin/simulator' } - - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/build-sim + needs: prepare-sim-matrices + uses: ./.github/workflows/sim-builder.yml + with: + sim: bitbox + include: ${{ needs.prepare-sim-matrices.outputs.bitbox }} + runs-on: ubuntu-latest sim-builder-jade: name: Jade sim builder - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - device: - - { name: 'jade', archive: 'jade', paths: 'test/work/jade/simulator' } - - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/build-sim + needs: prepare-sim-matrices + uses: ./.github/workflows/sim-builder.yml + with: + sim: jade + include: ${{ needs.prepare-sim-matrices.outputs.jade }} + runs-on: ubuntu-latest sim-builder-ledger: name: Ledger sim builder - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - device: - - { name: 'ledger', archive: 'speculos', paths: 'test/work/speculos' } - - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/build-sim + needs: prepare-sim-matrices + uses: ./.github/workflows/sim-builder.yml + with: + sim: ledger + include: ${{ needs.prepare-sim-matrices.outputs.ledger }} + runs-on: ubuntu-latest sim-builder-keepkey: name: Keepkey sim builder - runs-on: ubuntu-22.04 - - strategy: - fail-fast: false - matrix: - device: - - { name: 'keepkey', archive: 'keepkey-firmware', paths: 'test/work/keepkey-firmware/bin' } - - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/build-sim - + needs: prepare-sim-matrices + uses: ./.github/workflows/sim-builder.yml + with: + sim: keepkey + include: ${{ needs.prepare-sim-matrices.outputs.keepkey }} + runs-on: ubuntu-22.04 ledger-s-app-builder: name: Ledger Nano S Bitcoin App builder - runs-on: ubuntu-latest - container: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest - steps: - - run: | - git clone https://github.com/LedgerHQ/app-bitcoin-new.git - cd app-bitcoin-new - make DEBUG=1 - - - uses: actions/upload-artifact@v4 - with: - name: ledger_app_nano_s - path: app-bitcoin-new/bin/app.elf - + uses: ./.github/workflows/ledger-app-builder.yml + with: + app: nano_s + runs-on: ubuntu-latest ledger-x-app-builder: name: Ledger Nano X Bitcoin App builder - runs-on: ubuntu-latest - container: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest - steps: - - run: | - git clone https://github.com/LedgerHQ/app-bitcoin-new.git - cd app-bitcoin-new - make DEBUG=1 BOLOS_SDK=$NANOX_SDK - - - uses: actions/upload-artifact@v4 - with: - name: ledger_app_nano_x - path: app-bitcoin-new/bin/app.elf + uses: ./.github/workflows/ledger-app-builder.yml + with: + app: nano_x + runs-on: ubuntu-latest bitcoind-builder: name: bitcoind builder @@ -272,11 +187,18 @@ jobs: - uses: actions/checkout@v4 - uses: ./.github/actions/build-bitcoind - test-trezor: + test-trezor-1: + uses: ./.github/workflows/device-test.yml + needs: [sim-builder-trezor, bitcoind-builder, dist-builder] + with: + device: trezor-1 + runs-on: ubuntu-latest + + test-trezor-t: uses: ./.github/workflows/device-test.yml needs: [sim-builder-trezor, bitcoind-builder, dist-builder] with: - device: trezor + device: trezor-t runs-on: ubuntu-latest test-ledger-s: diff --git a/.github/workflows/device-test.yml b/.github/workflows/device-test.yml index 13972f158..5232314e7 100644 --- a/.github/workflows/device-test.yml +++ b/.github/workflows/device-test.yml @@ -19,7 +19,8 @@ jobs: fail-fast: false matrix: python-version: ['3.9', '3.10', '3.11', '3.12'] - device: ${{ inputs.device }} + device: + - ${{ inputs.device }} test: - {interface: 'library'} - {interface: 'cli'} diff --git a/.github/workflows/ledger-app-builder.yml b/.github/workflows/ledger-app-builder.yml new file mode 100644 index 000000000..b64a33e3e --- /dev/null +++ b/.github/workflows/ledger-app-builder.yml @@ -0,0 +1,26 @@ +name: Ledger App Builder +on: + workflow_call: + inputs: + app: + required: true # 'nano_s' or 'nano_x' + type: string + runs-on: + required: false + type: string + default: ubuntu-latest + +jobs: + build: + name: Build ${{ inputs.app }} + runs-on: ${{ inputs.runs-on }} + container: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest + steps: + - run: | + git clone https://github.com/LedgerHQ/app-bitcoin-new.git + cd app-bitcoin-new + make DEBUG=1 ${{ inputs.app == 'nano_x' && 'BOLOS_SDK=$NANOX_SDK' || '' }} + - uses: actions/upload-artifact@v4 + with: + name: ${{ inputs.app == 'nano_x' && 'ledger_app_nano_x' || 'ledger_app_nano_s' }} + path: app-bitcoin-new/bin/app.elf diff --git a/.github/workflows/prepare-sim-matrices.yml b/.github/workflows/prepare-sim-matrices.yml new file mode 100644 index 000000000..4f2d71841 --- /dev/null +++ b/.github/workflows/prepare-sim-matrices.yml @@ -0,0 +1,50 @@ +name: Prepare Sim Matrices +on: + workflow_call: + outputs: + trezor: + description: JSON include array for trezor + value: ${{ jobs.prepare.outputs.trezor }} + coldcard: + description: JSON include array for coldcard + value: ${{ jobs.prepare.outputs.coldcard }} + bitbox: + description: JSON include array for bitbox + value: ${{ jobs.prepare.outputs.bitbox }} + jade: + description: JSON include array for jade + value: ${{ jobs.prepare.outputs.jade }} + ledger: + description: JSON include array for ledger + value: ${{ jobs.prepare.outputs.ledger }} + keepkey: + description: JSON include array for keepkey + value: ${{ jobs.prepare.outputs.keepkey }} + +jobs: + prepare: + name: Prepare sim matrices + runs-on: ubuntu-latest + outputs: + trezor: ${{ steps.gen.outputs.trezor }} + coldcard: ${{ steps.gen.outputs.coldcard }} + bitbox: ${{ steps.gen.outputs.bitbox }} + jade: ${{ steps.gen.outputs.jade }} + ledger: ${{ steps.gen.outputs.ledger }} + keepkey: ${{ steps.gen.outputs.keepkey }} + steps: + - uses: actions/checkout@v4 + - id: gen + shell: bash + run: | + set -euo pipefail + sudo apt-get install -y jq + map_file=".github/sim-build-map.json" + for sim in trezor coldcard bitbox jade ledger keepkey; do + include=$(jq -c --arg s "$sim" '.[$s]' "$map_file") + if [[ -z "$include" || "$include" == "null" ]]; then + echo "Missing entry for $sim in $map_file" >&2 + exit 1 + fi + echo "$sim=$include" >> "$GITHUB_OUTPUT" + done diff --git a/.github/workflows/sim-builder.yml b/.github/workflows/sim-builder.yml new file mode 100644 index 000000000..708ec61b8 --- /dev/null +++ b/.github/workflows/sim-builder.yml @@ -0,0 +1,30 @@ +name: Simulator Builder +on: + workflow_call: + inputs: + sim: + required: true + type: string + include: + required: true # Precomputed JSON array for matrix.include + type: string + runs-on: + required: false + type: string + default: ubuntu-latest + +jobs: + build-simulator: + name: "Sim builder: ${{ matrix.name }}" + runs-on: ${{ inputs.runs-on }} + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(inputs.include) }} + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/build-sim + with: + name: ${{ matrix.name }} + archive: ${{ matrix.archive }} + paths: ${{ matrix.paths }} diff --git a/.github/workflows/type-check.yml b/.github/workflows/type-check.yml new file mode 100644 index 000000000..09a04c08c --- /dev/null +++ b/.github/workflows/type-check.yml @@ -0,0 +1,43 @@ +name: Type Check +on: + workflow_call: + +jobs: + type-check: + name: Type check + runs-on: ubuntu-latest + container: python:3.12 + steps: + - uses: actions/checkout@v4 + + - run: | + pip install poetry + poetry install + + - name: Run check + run: > + poetry run + mypy + hwi.py + hwilib/_base58.py + hwilib/_bech32.py + hwilib/_cli.py + hwilib/commands.py + hwilib/common.py + hwilib/descriptor.py + hwilib/devices/bitbox02.py + hwilib/devices/coldcard.py + hwilib/devices/digitalbitbox.py + hwilib/devices/jade.py + hwilib/devices/__init__.py + hwilib/devices/keepkey.py + hwilib/devices/ledger.py + hwilib/devices/trezor.py + hwilib/errors.py + hwilib/_script.py + hwilib/_serialize.py + hwilib/tx.py + hwilib/hwwclient.py + hwilib/__init__.py + hwilib/key.py + hwilib/udevinstaller.py