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.
- HwiDisplay
Address Response - The address returned after a device-display request.
- HwiEnumerated
Device - A device record in the Python HWI enumeration response.
- HwiError
- A Python HWI-compatible JSON error object.
- HwiGet
Descriptors Response - Receive and change descriptors for a device account.
- HwiGet
Keypool Entry - A ranged descriptor-import record for Bitcoin Core.
- HwiGet
Xpub Response - 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-4only whenget_clientis reached via-d. - HwiSign
Message Response - A Bitcoin message-signing response.
- HwiSign
TxResponse - A PSBT signing response.
- HwiSuccess
Response - A management operation’s success response.
Enums§
- HwiAddress
Type - An HWI address type used for derivation purposes and output descriptors.
- HwiCli
Command - Subcommands accepted by the Python HWI-compatible argument parser.
- HwiCommand
- An executable Python HWI-compatible operation.
- HwiDisplay
Address Request - A path or descriptor identifying an address to display on a device.
- HwiError
Code - Error categories mapped to Python HWI’s negative integer codes.
- HwiResponse
- An untagged Python HWI-compatible JSON response.
- HwiUnsupported
Device Action - 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
sendpincommand.
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.