feat(python): add type information to the UI object

pull/1882/head
matejcik 3 years ago committed by matejcik
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…
Cancel
Save