mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-18 04:18:10 +00:00
feat(python): add type information to the UI object
This commit is contained in:
parent
f818f4bc23
commit
846eca36ca
@ -15,11 +15,13 @@
|
||||
# If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
|
||||
|
||||
import os
|
||||
from typing import Union
|
||||
|
||||
import click
|
||||
from mnemonic import Mnemonic
|
||||
from typing_extensions import Protocol
|
||||
|
||||
from . import device
|
||||
from . import device, messages
|
||||
from .client import MAX_PIN_LENGTH, PASSPHRASE_ON_DEVICE
|
||||
from .exceptions import Cancelled
|
||||
from .messages import PinMatrixRequestType, WordRequestType
|
||||
@ -53,6 +55,17 @@ WIPE_CODE_NEW = PinMatrixRequestType.WipeCodeFirst
|
||||
WIPE_CODE_CONFIRM = PinMatrixRequestType.WipeCodeSecond
|
||||
|
||||
|
||||
class TrezorClientUI(Protocol):
|
||||
def button_request(self, br: messages.ButtonRequest) -> None:
|
||||
...
|
||||
|
||||
def get_pin(self, code: PinMatrixRequestType) -> str:
|
||||
...
|
||||
|
||||
def get_passphrase(self, available_on_device: bool) -> Union[str, object]:
|
||||
...
|
||||
|
||||
|
||||
def echo(*args, **kwargs):
|
||||
return click.echo(*args, err=True, **kwargs)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user