Skip to main content

Module hwi

Module hwi 

Source
Expand description

Python HWI-compatible argument parsing, device operations, and JSON responses.

parse_args and process_request return values without printing a response. run_cli handles command-line streams and prints responses to stdout; device prompts, help text, and usage text go to stderr. On Unix, --stdinpass prompts for the password on the controlling terminal when available, falling back to a stderr prompt and stdin input if terminal password reading fails.

Structs§

HwiCli
The Clap parser for Python HWI-compatible global options and subcommands.
HwiDisplayAddressResponse
The address returned after a device-display request.
HwiEnumeratedDevice
A device record in the Python HWI enumeration response.
HwiError
A Python HWI-compatible JSON error object.
HwiGetDescriptorsResponse
Receive and change descriptors for a device account.
HwiGetKeypoolEntry
A ranged descriptor-import record for Bitcoin Core.
HwiGetXpubResponse
An extended public key and optional expert-mode details.
HwiRequest
A device selector and an operation ready for process_request.
HwiSelector
Device selection as parsed from argv. The device type stays a raw string until device lookup, matching upstream where an unknown type is a lookup failure (-3), or -4 only when get_client is reached via -d.
HwiSignMessageResponse
A Bitcoin message-signing response.
HwiSignTxResponse
A PSBT signing response.
HwiSuccessResponse
A management operation’s success response.

Enums§

HwiAddressType
An HWI address type used for derivation purposes and output descriptors.
HwiCliCommand
Subcommands accepted by the Python HWI-compatible argument parser.
HwiCommand
An executable Python HWI-compatible operation.
HwiDisplayAddressRequest
A path or descriptor identifying an address to display on a device.
HwiErrorCode
Error categories mapped to Python HWI’s negative integer codes.
HwiResponse
An untagged Python HWI-compatible JSON response.
HwiUnsupportedDeviceAction
A management action used to choose a device-specific unsupported-command error.

Constants§

PIN_MATRIX_DESCRIPTION
Instructions for mapping scrambled device PIN positions to the host numeric keypad.
SEND_PIN_INSTRUCTION
Instructions for submitting PIN keypad positions through the sendpin command.

Functions§

parse_args
Parses command-line arguments, including the program name, into an HWI request.
process_request
Executes an HWI request and returns its serializable response.
run_cli
Runs the Python HWI-compatible CLI and returns its process exit status.