2021-06-08 11:29:03 +00:00
|
|
|
from typing import *
|
2022-02-19 12:49:04 +00:00
|
|
|
CONFIRMED: object
|
|
|
|
CANCELLED: object
|
2023-05-12 09:19:35 +00:00
|
|
|
INFO: object
|
2021-06-08 11:29:03 +00:00
|
|
|
|
|
|
|
|
2022-11-03 10:51:04 +00:00
|
|
|
# rust/src/ui/model_tr/layout.rs
|
|
|
|
def disable_animation(disable: bool) -> None:
|
|
|
|
"""Disable animations, debug builds only."""
|
|
|
|
|
|
|
|
|
2023-05-12 09:19:35 +00:00
|
|
|
# rust/src/ui/model_tr/layout.rs
|
|
|
|
def toif_info(data: bytes) -> tuple[int, int, bool]:
|
|
|
|
"""Get TOIF image dimensions and format (width: int, height: int, is_grayscale: bool)."""
|
|
|
|
|
|
|
|
|
2022-05-01 12:08:31 +00:00
|
|
|
# rust/src/ui/model_tr/layout.rs
|
|
|
|
def confirm_action(
|
|
|
|
*,
|
|
|
|
title: str,
|
2023-05-12 09:19:35 +00:00
|
|
|
action: str | None,
|
|
|
|
description: str | None,
|
|
|
|
verb: str = "CONFIRM",
|
2022-05-01 12:08:31 +00:00
|
|
|
verb_cancel: str | None = None,
|
2023-01-12 13:48:50 +00:00
|
|
|
hold: bool = False,
|
|
|
|
hold_danger: bool = False, # unused on TR
|
2022-05-01 12:08:31 +00:00
|
|
|
reverse: bool = False,
|
|
|
|
) -> object:
|
|
|
|
"""Confirm action."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tr/layout.rs
|
2023-05-12 09:19:35 +00:00
|
|
|
def confirm_blob(
|
2022-05-01 12:08:31 +00:00
|
|
|
*,
|
|
|
|
title: str,
|
2023-05-12 09:19:35 +00:00
|
|
|
data: str | bytes,
|
2022-05-01 12:08:31 +00:00
|
|
|
description: str | None,
|
2023-05-12 09:19:35 +00:00
|
|
|
extra: str | None,
|
|
|
|
verb: str = "CONFIRM",
|
|
|
|
verb_cancel: str | None = None,
|
|
|
|
hold: bool = False,
|
|
|
|
) -> object:
|
|
|
|
"""Confirm byte sequence data."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tr/layout.rs
|
|
|
|
def confirm_address(
|
|
|
|
*,
|
|
|
|
title: str,
|
|
|
|
data: str,
|
|
|
|
description: str | None, # unused on TR
|
|
|
|
extra: str | None, # unused on TR
|
|
|
|
) -> object:
|
|
|
|
"""Confirm address."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tr/layout.rs
|
|
|
|
def confirm_properties(
|
|
|
|
*,
|
|
|
|
title: str,
|
|
|
|
items: list[tuple[str | None, str | bytes | None, bool]],
|
|
|
|
hold: bool = False,
|
|
|
|
) -> object:
|
|
|
|
"""Confirm list of key-value pairs. The third component in the tuple should be True if
|
|
|
|
the value is to be rendered as binary with monospace font, False otherwise.
|
|
|
|
This only concerns the text style, you need to decode the value to UTF-8 in python."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tr/layout.rs
|
|
|
|
def confirm_reset_device(
|
|
|
|
*,
|
|
|
|
title: str,
|
|
|
|
button: str,
|
|
|
|
) -> object:
|
|
|
|
"""Confirm TOS before device setup."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tr/layout.rs
|
|
|
|
def show_address_details(
|
|
|
|
*,
|
|
|
|
address: str,
|
|
|
|
case_sensitive: bool,
|
|
|
|
account: str | None,
|
|
|
|
path: str | None,
|
|
|
|
xpubs: list[tuple[str, str]],
|
|
|
|
) -> object:
|
|
|
|
"""Show address details - QR code, account, path, cosigner xpubs."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tr/layout.rs
|
|
|
|
def confirm_value(
|
|
|
|
*,
|
|
|
|
title: str,
|
|
|
|
description: str,
|
|
|
|
value: str,
|
|
|
|
verb: str | None = None,
|
|
|
|
hold: bool = False,
|
|
|
|
) -> object:
|
|
|
|
"""Confirm value."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tr/layout.rs
|
|
|
|
def confirm_joint_total(
|
|
|
|
*,
|
|
|
|
spending_amount: str,
|
|
|
|
total_amount: str,
|
|
|
|
) -> object:
|
|
|
|
"""Confirm total if there are external inputs."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tr/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_tr/layout.rs
|
|
|
|
def confirm_output(
|
|
|
|
*,
|
|
|
|
address: str,
|
|
|
|
amount: str,
|
|
|
|
address_title: str,
|
|
|
|
amount_title: str,
|
|
|
|
) -> object:
|
|
|
|
"""Confirm output."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tr/layout.rs
|
|
|
|
def confirm_total(
|
|
|
|
*,
|
|
|
|
total_amount: str,
|
|
|
|
fee_amount: str,
|
|
|
|
fee_rate_amount: str | None,
|
|
|
|
total_label: str,
|
|
|
|
fee_label: str,
|
|
|
|
) -> object:
|
|
|
|
"""Confirm summary of a transaction."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tr/layout.rs
|
|
|
|
def tutorial() -> object:
|
|
|
|
"""Show user how to interact with the device."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tr/layout.rs
|
|
|
|
def confirm_modify_fee(
|
|
|
|
*,
|
2023-05-31 11:16:07 +00:00
|
|
|
title: str, # ignored
|
2023-05-12 09:19:35 +00:00
|
|
|
sign: int,
|
|
|
|
user_fee_change: str,
|
|
|
|
total_fee_new: str,
|
|
|
|
fee_rate_amount: str | None,
|
2022-02-19 12:49:04 +00:00
|
|
|
) -> object:
|
2023-05-12 09:19:35 +00:00
|
|
|
"""Decrease or increase transaction fee."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tr/layout.rs
|
|
|
|
def confirm_fido(
|
|
|
|
*,
|
2023-06-14 12:15:36 +00:00
|
|
|
title: str,
|
2023-05-12 09:19:35 +00:00
|
|
|
app_name: str,
|
|
|
|
icon_name: str | None, # unused on TR
|
|
|
|
accounts: list[str | None],
|
|
|
|
) -> int | object:
|
|
|
|
"""FIDO confirmation.
|
|
|
|
Returns page index in case of confirmation and CANCELLED otherwise.
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tr/layout.rs
|
|
|
|
def show_info(
|
|
|
|
*,
|
|
|
|
title: str,
|
|
|
|
description: str = "",
|
|
|
|
time_ms: int = 0,
|
|
|
|
) -> object:
|
|
|
|
"""Info modal."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tr/layout.rs
|
|
|
|
def show_mismatch() -> object:
|
|
|
|
"""Warning modal, receiving address mismatch."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tr/layout.rs
|
|
|
|
def confirm_with_info(
|
|
|
|
*,
|
|
|
|
title: str,
|
|
|
|
button: str, # unused on TR
|
|
|
|
info_button: str, # unused on TR
|
|
|
|
items: Iterable[Tuple[int, str]],
|
|
|
|
) -> object:
|
|
|
|
"""Confirm given items but with third button. Always single page
|
|
|
|
without scrolling."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tr/layout.rs
|
|
|
|
def confirm_coinjoin(
|
|
|
|
*,
|
|
|
|
max_rounds: str,
|
|
|
|
max_feerate: str,
|
|
|
|
) -> object:
|
|
|
|
"""Confirm coinjoin authorization."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tr/layout.rs
|
|
|
|
def request_pin(
|
|
|
|
*,
|
|
|
|
prompt: str,
|
|
|
|
subprompt: str,
|
|
|
|
allow_cancel: bool = True, # unused on TR
|
|
|
|
wrong_pin: bool = False, # unused on TR
|
|
|
|
) -> str | object:
|
|
|
|
"""Request pin on device."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tr/layout.rs
|
|
|
|
def request_passphrase(
|
|
|
|
*,
|
|
|
|
prompt: str,
|
|
|
|
max_len: int, # unused on TR
|
|
|
|
) -> str | object:
|
|
|
|
"""Get passphrase."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tr/layout.rs
|
|
|
|
def request_bip39(
|
|
|
|
*,
|
|
|
|
prompt: str,
|
|
|
|
) -> str:
|
|
|
|
"""Get recovery word for BIP39."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tr/layout.rs
|
|
|
|
def request_slip39(
|
|
|
|
*,
|
|
|
|
prompt: str,
|
|
|
|
) -> str:
|
|
|
|
"""SLIP39 word input keyboard."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tr/layout.rs
|
|
|
|
def select_word(
|
|
|
|
*,
|
|
|
|
title: str, # unused on TR
|
|
|
|
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_tr/layout.rs
|
|
|
|
def show_share_words(
|
|
|
|
*,
|
|
|
|
title: str,
|
|
|
|
share_words: Iterable[str],
|
|
|
|
) -> object:
|
|
|
|
"""Shows a backup seed."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tr/layout.rs
|
|
|
|
def request_number(
|
|
|
|
*,
|
|
|
|
title: str,
|
|
|
|
count: int,
|
|
|
|
min_count: int,
|
|
|
|
max_count: int,
|
|
|
|
description: Callable[[int], str] | None = None, # unused on TR
|
|
|
|
) -> object:
|
|
|
|
"""Number input with + and - buttons, description, and info button."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tr/layout.rs
|
|
|
|
def show_checklist(
|
|
|
|
*,
|
|
|
|
title: str, # unused on TR
|
|
|
|
items: Iterable[str],
|
|
|
|
active: int,
|
|
|
|
button: str,
|
|
|
|
) -> object:
|
|
|
|
"""Checklist of backup steps. Active index is highlighted, previous items have check
|
|
|
|
mark next to them."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tr/layout.rs
|
|
|
|
def confirm_recovery(
|
|
|
|
*,
|
|
|
|
title: str, # unused on TR
|
|
|
|
description: str,
|
|
|
|
button: str,
|
|
|
|
dry_run: bool,
|
|
|
|
info_button: bool, # unused on TR
|
|
|
|
) -> object:
|
|
|
|
"""Device recovery homescreen."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tr/layout.rs
|
|
|
|
def select_word_count(
|
|
|
|
*,
|
|
|
|
dry_run: bool, # unused on TR
|
|
|
|
) -> int | str: # TR returns str
|
|
|
|
"""Select mnemonic word count from (12, 18, 20, 24, 33)."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tr/layout.rs
|
|
|
|
def show_group_share_success(
|
|
|
|
*,
|
|
|
|
lines: Iterable[str],
|
|
|
|
) -> int:
|
|
|
|
"""Shown after successfully finishing a group."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tr/layout.rs
|
|
|
|
def show_progress(
|
|
|
|
*,
|
|
|
|
title: str,
|
|
|
|
indeterminate: bool = False,
|
|
|
|
description: str = "",
|
|
|
|
) -> object:
|
|
|
|
"""Show progress loader. Please note that the number of lines reserved on screen for
|
|
|
|
description is determined at construction time. If you want multiline descriptions
|
|
|
|
make sure the initial description has at least that amount of lines."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tr/layout.rs
|
|
|
|
def show_progress_coinjoin(
|
|
|
|
*,
|
|
|
|
title: str,
|
|
|
|
indeterminate: bool = False,
|
|
|
|
time_ms: int = 0,
|
|
|
|
skip_first_paint: bool = False,
|
|
|
|
) -> object:
|
|
|
|
"""Show progress loader for coinjoin. Returns CANCELLED after a specified time when
|
|
|
|
time_ms timeout is passed."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tr/layout.rs
|
|
|
|
def show_homescreen(
|
|
|
|
*,
|
|
|
|
label: str | None,
|
|
|
|
hold: bool, # unused on TR
|
|
|
|
notification: str | None,
|
|
|
|
notification_level: int = 0,
|
|
|
|
skip_first_paint: bool,
|
|
|
|
) -> CANCELLED:
|
|
|
|
"""Idle homescreen."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tr/layout.rs
|
|
|
|
def show_lockscreen(
|
|
|
|
*,
|
|
|
|
label: str | None,
|
|
|
|
bootscreen: bool,
|
|
|
|
skip_first_paint: bool,
|
|
|
|
) -> CANCELLED:
|
|
|
|
"""Homescreen for locked device."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tr/layout.rs
|
|
|
|
def draw_welcome_screen() -> None:
|
|
|
|
"""Show logo icon with the model name at the bottom and return."""
|
2022-02-19 12:49:04 +00:00
|
|
|
CONFIRMED: object
|
|
|
|
CANCELLED: object
|
2022-04-05 12:35:37 +00:00
|
|
|
INFO: object
|
2021-12-13 11:22:52 +00:00
|
|
|
|
|
|
|
|
2022-11-03 10:51:04 +00:00
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def disable_animation(disable: bool) -> None:
|
|
|
|
"""Disable animations, debug builds only."""
|
|
|
|
|
|
|
|
|
2022-10-13 11:37:02 +00:00
|
|
|
# rust/src/ui/model_tt/layout.rs
|
2023-05-04 12:53:18 +00:00
|
|
|
def jpeg_info(data: bytes) -> tuple[int, int, int]:
|
|
|
|
"""Get JPEG image dimensions (width: int, height: int, mcu_height: int)."""
|
2022-10-13 11:37:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def jpeg_test(data: bytes) -> bool:
|
|
|
|
"""Test JPEG image."""
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
2023-04-28 12:43:59 +00:00
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def confirm_emphasized(
|
|
|
|
*,
|
|
|
|
title: str,
|
|
|
|
items: Iterable[str | tuple[bool, str]],
|
|
|
|
verb: str | None = None,
|
|
|
|
) -> object:
|
|
|
|
"""Confirm formatted text that has been pre-split in python. For tuples
|
|
|
|
the first component is a bool indicating whether this part is emphasized."""
|
|
|
|
|
|
|
|
|
2023-01-03 15:13:30 +00:00
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def confirm_homescreen(
|
|
|
|
*,
|
|
|
|
title: str,
|
|
|
|
image: bytes,
|
|
|
|
) -> object:
|
|
|
|
"""Confirm homescreen."""
|
|
|
|
|
|
|
|
|
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,
|
2023-02-14 22:47:20 +00:00
|
|
|
verb: str | None = None,
|
2022-05-24 10:54:02 +00:00
|
|
|
verb_cancel: str | None = None,
|
|
|
|
hold: bool = False,
|
|
|
|
) -> object:
|
|
|
|
"""Confirm byte sequence data."""
|
|
|
|
|
|
|
|
|
2023-02-14 22:47:20 +00:00
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def confirm_address(
|
|
|
|
*,
|
|
|
|
title: str,
|
|
|
|
data: str | bytes,
|
|
|
|
description: str | None,
|
|
|
|
extra: str | None,
|
|
|
|
) -> object:
|
|
|
|
"""Confirm address. Similar to `confirm_blob` but has corner info button
|
|
|
|
and allows left swipe which does the same thing as the button."""
|
|
|
|
|
|
|
|
|
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,
|
2023-01-13 19:41:58 +00:00
|
|
|
button: str,
|
2022-07-07 16:07:07 +00:00
|
|
|
) -> object:
|
|
|
|
"""Confirm TOS before device setup."""
|
|
|
|
|
|
|
|
|
2023-02-14 22:47:20 +00:00
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def show_address_details(
|
|
|
|
*,
|
|
|
|
address: str,
|
|
|
|
case_sensitive: bool,
|
|
|
|
account: str | None,
|
|
|
|
path: str | None,
|
|
|
|
xpubs: list[tuple[str, str]],
|
|
|
|
) -> object:
|
|
|
|
"""Show address details - QR code, account, path, cosigner xpubs."""
|
|
|
|
|
|
|
|
|
2023-03-30 22:14:44 +00:00
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def show_spending_details(
|
|
|
|
*,
|
2023-05-22 19:07:18 +00:00
|
|
|
title: str = "INFORMATION",
|
|
|
|
account: str | None,
|
2023-05-04 12:53:18 +00:00
|
|
|
fee_rate: str | None,
|
2023-05-22 19:07:18 +00:00
|
|
|
fee_rate_title: str = "Fee rate:",
|
2023-03-30 22:14:44 +00:00
|
|
|
) -> object:
|
|
|
|
"""Show metadata when for outgoing transaction."""
|
|
|
|
|
|
|
|
|
2022-05-24 10:54:02 +00:00
|
|
|
# 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,
|
|
|
|
value: str,
|
2023-05-04 12:53:18 +00:00
|
|
|
description: str | None,
|
|
|
|
subtitle: str | None,
|
2022-09-13 10:13:04 +00:00
|
|
|
verb: str | None = None,
|
2023-03-30 22:14:44 +00:00
|
|
|
verb_cancel: str | None = None,
|
|
|
|
info_button: bool = False,
|
2022-09-13 10:13:04 +00:00
|
|
|
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
|
2023-03-30 22:14:44 +00:00
|
|
|
def confirm_total(
|
2022-05-24 10:54:02 +00:00
|
|
|
*,
|
2023-03-30 22:14:44 +00:00
|
|
|
title: str,
|
2023-04-28 12:43:59 +00:00
|
|
|
items: list[tuple[str, str]],
|
2023-03-30 22:14:44 +00:00
|
|
|
info_button: bool = False,
|
2022-05-24 10:54:02 +00:00
|
|
|
) -> object:
|
2023-03-30 22:14:44 +00:00
|
|
|
"""Transaction summary. Always hold to confirm."""
|
2022-05-24 10:54:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def confirm_modify_output(
|
|
|
|
*,
|
2023-05-31 11:16:07 +00:00
|
|
|
address: str, # ignored
|
2022-05-24 10:54:02 +00:00
|
|
|
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(
|
|
|
|
*,
|
2023-05-22 19:07:18 +00:00
|
|
|
title: str,
|
2022-05-24 10:54:02 +00:00
|
|
|
sign: int,
|
|
|
|
user_fee_change: str,
|
|
|
|
total_fee_new: str,
|
2023-05-31 11:16:07 +00:00
|
|
|
fee_rate_amount: str | None, # ignored
|
2022-05-24 10:54:02 +00:00
|
|
|
) -> 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:
|
2022-10-30 16:59:59 +00:00
|
|
|
"""Error modal. No buttons shown when `button` is empty string."""
|
2022-07-07 15:08:53 +00:00
|
|
|
|
|
|
|
|
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:
|
2022-10-30 16:59:59 +00:00
|
|
|
"""Warning modal. No buttons shown when `button` is empty string."""
|
2022-05-24 10:54:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
# 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:
|
2022-10-30 16:59:59 +00:00
|
|
|
"""Success modal. No buttons shown when `button` is empty string."""
|
2022-05-24 10:54:02 +00:00
|
|
|
|
|
|
|
|
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:
|
2022-10-30 16:59:59 +00:00
|
|
|
"""Info modal. No buttons shown when `button` is empty string."""
|
2022-07-07 15:08:53 +00:00
|
|
|
|
|
|
|
|
2023-02-14 22:47:20 +00:00
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def show_mismatch() -> object:
|
|
|
|
"""Warning modal, receiving address mismatch."""
|
|
|
|
|
|
|
|
|
2022-07-12 18:31:34 +00:00
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def show_simple(
|
|
|
|
*,
|
|
|
|
title: str | None,
|
2023-05-04 12:53:18 +00:00
|
|
|
description: str = "",
|
|
|
|
button: str = "",
|
2022-07-12 18:31:34 +00:00
|
|
|
) -> 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,
|
2023-04-28 12:43:59 +00:00
|
|
|
items: Iterable[tuple[int, str]],
|
2022-05-24 10:54:02 +00:00
|
|
|
) -> object:
|
2022-10-17 15:50:12 +00:00
|
|
|
"""Confirm given items but with third button. Always single page
|
|
|
|
without scrolling."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def confirm_more(
|
|
|
|
*,
|
|
|
|
title: str,
|
|
|
|
button: str,
|
2023-04-28 12:43:59 +00:00
|
|
|
items: Iterable[tuple[int, str]],
|
2022-10-17 15:50:12 +00:00
|
|
|
) -> object:
|
|
|
|
"""Confirm long content with the possibility to go back from any page.
|
|
|
|
Meant to be used with confirm_with_info."""
|
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,
|
2023-01-12 13:48:50 +00:00
|
|
|
wrong_pin: bool = False,
|
2022-02-19 12:49:04 +00:00
|
|
|
) -> 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:
|
2023-05-04 12:53:18 +00:00
|
|
|
"""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:
|
2023-05-04 12:53:18 +00:00
|
|
|
"""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:
|
2023-05-04 12:53:18 +00:00
|
|
|
"""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:
|
2023-05-04 12:53:18 +00:00
|
|
|
"""Select mnemonic word from three possibilities - seed check after backup. The
|
2022-07-07 16:07:07 +00:00
|
|
|
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:
|
2023-05-04 12:53:18 +00:00
|
|
|
"""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,
|
2023-01-12 13:48:50 +00:00
|
|
|
description: Callable[[int], str] | None = None,
|
2022-07-12 18:31:34 +00:00
|
|
|
) -> object:
|
2023-05-04 12:53:18 +00:00
|
|
|
"""Number input with + and - buttons, description, and info button."""
|
2022-07-12 18:31:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def show_checklist(
|
|
|
|
*,
|
|
|
|
title: str,
|
|
|
|
items: Iterable[str],
|
|
|
|
active: int,
|
|
|
|
button: str,
|
|
|
|
) -> object:
|
2023-05-04 12:53:18 +00:00
|
|
|
"""Checklist of backup steps. Active index is highlighted, previous items have check
|
|
|
|
mark next 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,
|
2023-05-04 12:53:18 +00:00
|
|
|
info_button: bool = False,
|
2022-08-30 12:10:30 +00:00
|
|
|
) -> object:
|
2023-05-04 12:53:18 +00:00
|
|
|
"""Device recovery homescreen."""
|
2022-08-30 12:10:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def select_word_count(
|
|
|
|
*,
|
|
|
|
dry_run: bool,
|
2023-05-04 12:53:18 +00:00
|
|
|
) -> int | str: # TT returns int
|
|
|
|
"""Select mnemonic word count from (12, 18, 20, 24, 33)."""
|
2022-08-30 12:10:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def show_group_share_success(
|
|
|
|
*,
|
|
|
|
lines: Iterable[str]
|
|
|
|
) -> int:
|
2023-05-04 12:53:18 +00:00
|
|
|
"""Shown after successfully finishing a group."""
|
2022-08-30 12:10:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def show_remaining_shares(
|
|
|
|
*,
|
|
|
|
pages: Iterable[tuple[str, str]],
|
|
|
|
) -> int:
|
2023-05-04 12:53:18 +00:00
|
|
|
"""Shows SLIP39 state after info button is pressed on `confirm_recovery`."""
|
2022-10-30 16:59:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def show_progress(
|
|
|
|
*,
|
|
|
|
title: str,
|
|
|
|
indeterminate: bool = False,
|
2023-05-04 12:53:18 +00:00
|
|
|
description: str = "",
|
2022-10-30 16:59:59 +00:00
|
|
|
) -> object:
|
2023-05-04 12:53:18 +00:00
|
|
|
"""Show progress loader. Please note that the number of lines reserved on screen for
|
2022-10-30 16:59:59 +00:00
|
|
|
description is determined at construction time. If you want multiline descriptions
|
2023-05-04 12:53:18 +00:00
|
|
|
make sure the initial description has at least that amount of lines."""
|
2022-09-26 21:07:29 +00:00
|
|
|
|
|
|
|
|
2023-03-24 15:54:47 +00:00
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def show_progress_coinjoin(
|
|
|
|
*,
|
|
|
|
title: str,
|
|
|
|
indeterminate: bool = False,
|
|
|
|
time_ms: int = 0,
|
|
|
|
skip_first_paint: bool = False,
|
|
|
|
) -> object:
|
2023-05-04 12:53:18 +00:00
|
|
|
"""Show progress loader for coinjoin. Returns CANCELLED after a specified time when
|
2023-03-24 15:54:47 +00:00
|
|
|
time_ms timeout is passed."""
|
|
|
|
|
|
|
|
|
2022-09-26 21:07:29 +00:00
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def show_homescreen(
|
|
|
|
*,
|
2023-05-12 09:19:35 +00:00
|
|
|
label: str | None,
|
2022-09-26 21:07:29 +00:00
|
|
|
hold: bool,
|
|
|
|
notification: str | None,
|
|
|
|
notification_level: int = 0,
|
|
|
|
skip_first_paint: bool,
|
|
|
|
) -> CANCELLED:
|
|
|
|
"""Idle homescreen."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def show_lockscreen(
|
|
|
|
*,
|
2023-05-12 09:19:35 +00:00
|
|
|
label: str | None,
|
2022-09-26 21:07:29 +00:00
|
|
|
bootscreen: bool,
|
|
|
|
skip_first_paint: bool,
|
|
|
|
) -> CANCELLED:
|
|
|
|
"""Homescreen for locked device."""
|
|
|
|
|
|
|
|
|
2023-02-21 11:30:24 +00:00
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def draw_welcome_screen() -> None:
|
|
|
|
"""Show logo icon with the model name at the bottom and return."""
|