2021-06-08 11:29:03 +00:00
|
|
|
from typing import *
|
2022-02-19 12:49:04 +00:00
|
|
|
CONFIRMED: object
|
|
|
|
CANCELLED: object
|
2021-06-08 11:29:03 +00:00
|
|
|
|
|
|
|
|
2022-02-19 12:49:04 +00:00
|
|
|
# rust/src/ui/model_t1/layout.rs
|
|
|
|
def confirm_action(
|
2022-01-18 23:49:18 +00:00
|
|
|
*,
|
|
|
|
title: str,
|
|
|
|
action: str | None = None,
|
|
|
|
description: str | None = None,
|
|
|
|
verb: str | None = None,
|
|
|
|
verb_cancel: str | None = None,
|
|
|
|
hold: bool | None = None,
|
|
|
|
reverse: bool = False,
|
|
|
|
) -> object:
|
2022-02-19 12:49:04 +00:00
|
|
|
"""Confirm action."""
|
2021-10-29 11:06:16 +00:00
|
|
|
|
|
|
|
|
2022-02-19 12:49:04 +00:00
|
|
|
# rust/src/ui/model_t1/layout.rs
|
|
|
|
def confirm_text(
|
|
|
|
*,
|
|
|
|
title: str,
|
|
|
|
data: str,
|
|
|
|
description: str | None,
|
2022-05-01 12:08:31 +00:00
|
|
|
) -> object:
|
|
|
|
"""Confirm text."""
|
|
|
|
CONFIRMED: object
|
|
|
|
CANCELLED: object
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tr/layout.rs
|
|
|
|
def confirm_action(
|
|
|
|
*,
|
|
|
|
title: str,
|
|
|
|
action: str | None = None,
|
|
|
|
description: str | None = None,
|
|
|
|
verb: str | None = None,
|
|
|
|
verb_cancel: str | None = None,
|
|
|
|
hold: bool | None = None,
|
|
|
|
reverse: bool = False,
|
|
|
|
) -> object:
|
|
|
|
"""Confirm action."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tr/layout.rs
|
|
|
|
def confirm_text(
|
|
|
|
*,
|
|
|
|
title: str,
|
|
|
|
data: str,
|
|
|
|
description: str | None,
|
2022-02-19 12:49:04 +00:00
|
|
|
) -> object:
|
|
|
|
"""Confirm text."""
|
|
|
|
CONFIRMED: object
|
|
|
|
CANCELLED: object
|
2022-04-05 12:35:37 +00:00
|
|
|
INFO: object
|
2021-12-13 11:22:52 +00:00
|
|
|
|
|
|
|
|
2022-02-19 12:49:04 +00:00
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def confirm_action(
|
2022-02-07 16:09:39 +00:00
|
|
|
*,
|
2022-02-19 12:49:04 +00:00
|
|
|
title: str,
|
2022-10-25 13:08:19 +00:00
|
|
|
action: str | None,
|
|
|
|
description: str | None,
|
2022-02-19 12:49:04 +00:00
|
|
|
verb: str | None = None,
|
|
|
|
verb_cancel: str | None = None,
|
2022-05-24 10:54:02 +00:00
|
|
|
hold: bool = False,
|
2022-10-20 12:28:29 +00:00
|
|
|
hold_danger: bool = False,
|
2022-02-19 12:49:04 +00:00
|
|
|
reverse: bool = False,
|
2022-02-07 16:09:39 +00:00
|
|
|
) -> object:
|
2022-02-19 12:49:04 +00:00
|
|
|
"""Confirm action."""
|
2022-02-07 16:09:39 +00:00
|
|
|
|
|
|
|
|
2022-05-24 10:54:02 +00:00
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def confirm_blob(
|
|
|
|
*,
|
|
|
|
title: str,
|
2022-10-19 16:06:13 +00:00
|
|
|
data: str | bytes,
|
|
|
|
description: str | None,
|
|
|
|
extra: str | None,
|
2022-05-24 10:54:02 +00:00
|
|
|
verb_cancel: str | None = None,
|
|
|
|
ask_pagination: bool = False,
|
|
|
|
hold: bool = False,
|
|
|
|
) -> object:
|
|
|
|
"""Confirm byte sequence data."""
|
|
|
|
|
|
|
|
|
2022-09-14 21:07:56 +00:00
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def confirm_properties(
|
|
|
|
*,
|
|
|
|
title: str,
|
2022-10-19 16:06:13 +00:00
|
|
|
items: list[tuple[str | None, str | bytes | None, bool]],
|
2022-09-14 21:07:56 +00:00
|
|
|
hold: bool = False,
|
|
|
|
) -> object:
|
|
|
|
"""Confirm list of key-value pairs. The third component in the tuple should be True if
|
2022-10-19 16:06:13 +00:00
|
|
|
the value is to be rendered as binary with monospace font, False otherwise."""
|
2022-09-14 21:07:56 +00:00
|
|
|
|
|
|
|
|
2022-07-07 16:07:07 +00:00
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def confirm_reset_device(
|
|
|
|
*,
|
|
|
|
title: str,
|
|
|
|
prompt: str,
|
|
|
|
) -> object:
|
|
|
|
"""Confirm TOS before device setup."""
|
|
|
|
|
|
|
|
|
2022-05-24 10:54:02 +00:00
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def show_qr(
|
|
|
|
*,
|
|
|
|
title: str,
|
|
|
|
address: str,
|
|
|
|
verb_cancel: str,
|
|
|
|
case_sensitive: bool,
|
|
|
|
) -> object:
|
|
|
|
"""Show QR code."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tt/layout.rs
|
2022-09-13 10:13:04 +00:00
|
|
|
def confirm_value(
|
2022-05-24 10:54:02 +00:00
|
|
|
*,
|
|
|
|
title: str,
|
|
|
|
description: str,
|
|
|
|
value: str,
|
2022-09-13 10:13:04 +00:00
|
|
|
verb: str | None = None,
|
|
|
|
hold: bool = False,
|
2022-05-24 10:54:02 +00:00
|
|
|
) -> object:
|
2022-09-13 10:13:04 +00:00
|
|
|
"""Confirm value. Merge of confirm_total and confirm_output."""
|
2022-05-24 10:54:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def confirm_joint_total(
|
|
|
|
*,
|
|
|
|
spending_amount: str,
|
|
|
|
total_amount: str,
|
|
|
|
) -> object:
|
|
|
|
"""Confirm total if there are external inputs."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def confirm_modify_output(
|
|
|
|
*,
|
|
|
|
address: str,
|
|
|
|
sign: int,
|
|
|
|
amount_change: str,
|
|
|
|
amount_new: str,
|
|
|
|
) -> object:
|
|
|
|
"""Decrease or increase amount for given address."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def confirm_modify_fee(
|
|
|
|
*,
|
|
|
|
sign: int,
|
|
|
|
user_fee_change: str,
|
|
|
|
total_fee_new: str,
|
|
|
|
) -> object:
|
|
|
|
"""Decrease or increase transaction fee."""
|
|
|
|
|
|
|
|
|
2022-10-12 13:30:53 +00:00
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def confirm_fido(
|
|
|
|
*,
|
|
|
|
title: str,
|
|
|
|
app_name: str,
|
|
|
|
icon_name: str | None,
|
|
|
|
accounts: list[str | None],
|
|
|
|
) -> int | object:
|
|
|
|
"""FIDO confirmation.
|
|
|
|
Returns page index in case of confirmation and CANCELLED otherwise.
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
2022-07-07 15:08:53 +00:00
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def show_error(
|
|
|
|
*,
|
|
|
|
title: str,
|
2022-08-30 12:10:30 +00:00
|
|
|
button: str = "CONTINUE",
|
2022-07-07 15:08:53 +00:00
|
|
|
description: str = "",
|
|
|
|
allow_cancel: bool = False,
|
2022-08-30 12:10:30 +00:00
|
|
|
time_ms: int = 0,
|
2022-07-07 15:08:53 +00:00
|
|
|
) -> object:
|
|
|
|
"""Error modal."""
|
|
|
|
|
|
|
|
|
2022-05-24 10:54:02 +00:00
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def show_warning(
|
|
|
|
*,
|
|
|
|
title: str,
|
2022-08-30 12:10:30 +00:00
|
|
|
button: str = "CONTINUE",
|
2022-05-24 10:54:02 +00:00
|
|
|
description: str = "",
|
2022-07-07 15:08:53 +00:00
|
|
|
allow_cancel: bool = False,
|
2022-08-30 12:10:30 +00:00
|
|
|
time_ms: int = 0,
|
2022-05-24 10:54:02 +00:00
|
|
|
) -> object:
|
|
|
|
"""Warning modal."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def show_success(
|
|
|
|
*,
|
|
|
|
title: str,
|
2022-08-30 12:10:30 +00:00
|
|
|
button: str = "CONTINUE",
|
2022-05-24 10:54:02 +00:00
|
|
|
description: str = "",
|
2022-07-07 15:08:53 +00:00
|
|
|
allow_cancel: bool = False,
|
2022-08-30 12:10:30 +00:00
|
|
|
time_ms: int = 0,
|
2022-05-24 10:54:02 +00:00
|
|
|
) -> object:
|
|
|
|
"""Success modal."""
|
|
|
|
|
|
|
|
|
2022-07-07 15:08:53 +00:00
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def show_info(
|
|
|
|
*,
|
|
|
|
title: str,
|
2022-08-30 12:10:30 +00:00
|
|
|
button: str = "CONTINUE",
|
2022-07-07 15:08:53 +00:00
|
|
|
description: str = "",
|
|
|
|
allow_cancel: bool = False,
|
2022-08-30 12:10:30 +00:00
|
|
|
time_ms: int = 0,
|
2022-07-07 15:08:53 +00:00
|
|
|
) -> object:
|
|
|
|
"""Info modal."""
|
|
|
|
|
|
|
|
|
2022-07-12 18:31:34 +00:00
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def show_simple(
|
|
|
|
*,
|
|
|
|
title: str | None,
|
|
|
|
description: str,
|
|
|
|
button: str,
|
|
|
|
) -> object:
|
|
|
|
"""Simple dialog with text and one button."""
|
|
|
|
|
|
|
|
|
2022-05-24 10:54:02 +00:00
|
|
|
# rust/src/ui/model_tt/layout.rs
|
2022-07-15 12:33:17 +00:00
|
|
|
def confirm_with_info(
|
2022-05-24 10:54:02 +00:00
|
|
|
*,
|
2022-07-15 12:33:17 +00:00
|
|
|
title: str,
|
|
|
|
button: str,
|
|
|
|
info_button: str,
|
|
|
|
items: Iterable[str],
|
2022-05-24 10:54:02 +00:00
|
|
|
) -> object:
|
2022-07-15 12:33:17 +00:00
|
|
|
"""Confirm action but with third button."""
|
2022-05-24 10:54:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def confirm_coinjoin(
|
|
|
|
*,
|
|
|
|
max_rounds: str,
|
|
|
|
max_feerate: str,
|
|
|
|
) -> object:
|
|
|
|
"""Confirm coinjoin authorization."""
|
|
|
|
|
|
|
|
|
2022-02-19 12:49:04 +00:00
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def request_pin(
|
2022-03-04 11:56:49 +00:00
|
|
|
*,
|
|
|
|
prompt: str,
|
2022-05-24 10:54:02 +00:00
|
|
|
subprompt: str,
|
2022-02-19 12:49:04 +00:00
|
|
|
allow_cancel: bool = True,
|
|
|
|
warning: str | None = None,
|
|
|
|
) -> str | object:
|
|
|
|
"""Request pin on device."""
|
2022-03-04 11:56:49 +00:00
|
|
|
|
|
|
|
|
2022-02-19 12:49:04 +00:00
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def request_passphrase(
|
2022-03-04 11:56:49 +00:00
|
|
|
*,
|
|
|
|
prompt: str,
|
2022-02-19 12:49:04 +00:00
|
|
|
max_len: int,
|
|
|
|
) -> str | object:
|
|
|
|
"""Passphrase input keyboard."""
|
2022-03-04 11:56:49 +00:00
|
|
|
|
|
|
|
|
2022-02-19 12:49:04 +00:00
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def request_bip39(
|
2022-03-04 11:56:49 +00:00
|
|
|
*,
|
|
|
|
prompt: str,
|
2022-02-19 12:49:04 +00:00
|
|
|
) -> str:
|
|
|
|
"""BIP39 word input keyboard."""
|
2022-03-04 11:56:49 +00:00
|
|
|
|
|
|
|
|
2022-02-19 12:49:04 +00:00
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def request_slip39(
|
2021-12-13 11:22:52 +00:00
|
|
|
*,
|
2022-02-19 12:49:04 +00:00
|
|
|
prompt: str,
|
|
|
|
) -> str:
|
|
|
|
"""SLIP39 word input keyboard."""
|
2022-07-07 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def select_word(
|
|
|
|
*,
|
|
|
|
title: str,
|
|
|
|
description: str,
|
|
|
|
words: Iterable[str],
|
|
|
|
) -> int:
|
|
|
|
"""Select mnemonic word from three possibilities - seed check after backup. The
|
|
|
|
iterable must be of exact size. Returns index in range `0..3`."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def show_share_words(
|
|
|
|
*,
|
|
|
|
title: str,
|
|
|
|
pages: Iterable[str],
|
|
|
|
) -> object:
|
|
|
|
"""Show mnemonic for backup. Expects the words pre-divided into individual pages."""
|
2022-07-12 18:31:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def request_number(
|
|
|
|
*,
|
|
|
|
title: str,
|
|
|
|
count: int,
|
|
|
|
min_count: int,
|
|
|
|
max_count: int,
|
|
|
|
description: Callable[[int], str],
|
|
|
|
) -> object:
|
|
|
|
"""Number input with + and - buttons, description, and info button."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def show_checklist(
|
|
|
|
*,
|
|
|
|
title: str,
|
|
|
|
items: Iterable[str],
|
|
|
|
active: int,
|
|
|
|
button: str,
|
|
|
|
) -> object:
|
|
|
|
"""Checklist of backup steps. Active index is highlighted, previous items have check
|
|
|
|
mark nex to them."""
|
2022-08-30 12:10:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def confirm_recovery(
|
|
|
|
*,
|
|
|
|
title: str,
|
|
|
|
description: str,
|
|
|
|
button: str,
|
|
|
|
dry_run: bool,
|
|
|
|
info_button: bool,
|
|
|
|
) -> object:
|
|
|
|
"""Device recovery homescreen."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def select_word_count(
|
|
|
|
*,
|
|
|
|
dry_run: bool,
|
|
|
|
) -> int | trezorui2.CANCELLED:
|
|
|
|
"""Select mnemonic word count from (12, 18, 20, 24, 33)."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def show_group_share_success(
|
|
|
|
*,
|
|
|
|
lines: Iterable[str]
|
|
|
|
) -> int:
|
|
|
|
"""Shown after successfully finishing a group."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def show_remaining_shares(
|
|
|
|
*,
|
|
|
|
pages: Iterable[tuple[str, str]],
|
|
|
|
) -> int:
|
|
|
|
"""Shows SLIP39 state after info button is pressed on `confirm_recovery`."""
|