From 7573f4dca1ec57e873eb1c6e38d7bf3f01797951 Mon Sep 17 00:00:00 2001 From: Marko Bencun Date: Thu, 17 Jul 2025 15:43:17 +0200 Subject: [PATCH 1/2] 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 9b37d8b271e997faf15fe401b05e4f1e9d913912 Mon Sep 17 00:00:00 2001 From: Marko Bencun Date: Fri, 29 Aug 2025 15:50:35 +0200 Subject: [PATCH 2/2] bitbox02: fix path to simulator --- test/run_tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/run_tests.py b/test/run_tests.py index cd502a6c0..b78e789ca 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/src/bitcoind')