2021-06-08 11:29:03 +00:00
|
|
|
from typing import *
|
2024-03-12 19:15:20 +00:00
|
|
|
from trezor import utils
|
2024-10-18 13:11:58 +00:00
|
|
|
from trezorui_api import *
|
2021-06-08 11:29:03 +00:00
|
|
|
|
2023-07-11 13:05:39 +00:00
|
|
|
|
2024-03-04 11:08:57 +00:00
|
|
|
# rust/src/ui/model_mercury/layout.rs
|
|
|
|
def confirm_emphasized(
|
|
|
|
*,
|
|
|
|
title: str,
|
|
|
|
items: Iterable[str | tuple[bool, str]],
|
|
|
|
verb: str | None = None,
|
2024-03-12 19:15:20 +00:00
|
|
|
) -> LayoutObj[UiResult]:
|
2024-03-04 11:08:57 +00:00
|
|
|
"""Confirm formatted text that has been pre-split in python. For tuples
|
|
|
|
the first component is a bool indicating whether this part is emphasized."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_mercury/layout.rs
|
|
|
|
def confirm_address(
|
|
|
|
*,
|
|
|
|
title: str,
|
|
|
|
data: str | bytes,
|
|
|
|
description: str | None,
|
|
|
|
verb: str | None = "CONFIRM",
|
|
|
|
extra: str | None,
|
|
|
|
chunkify: bool = False,
|
2024-03-12 19:15:20 +00:00
|
|
|
) -> LayoutObj[UiResult]:
|
2024-03-04 11:08:57 +00:00
|
|
|
"""Confirm address. Similar to `confirm_blob` but has corner info button
|
|
|
|
and allows left swipe which does the same thing as the button."""
|
|
|
|
|
|
|
|
|
2024-05-09 16:01:51 +00:00
|
|
|
# rust/src/ui/model_mercury/layout.rs
|
|
|
|
def flow_confirm_set_new_pin(
|
|
|
|
*,
|
|
|
|
title: str,
|
|
|
|
description: str,
|
|
|
|
) -> LayoutObj[UiResult]:
|
|
|
|
"""Confirm new PIN setup with an option to cancel action."""
|
|
|
|
|
|
|
|
|
2024-03-04 11:08:57 +00:00
|
|
|
# rust/src/ui/model_mercury/layout.rs
|
|
|
|
def confirm_total(
|
|
|
|
*,
|
|
|
|
title: str,
|
|
|
|
items: Iterable[tuple[str, str]],
|
|
|
|
info_button: bool = False,
|
|
|
|
cancel_arrow: bool = False,
|
2024-03-12 19:15:20 +00:00
|
|
|
) -> LayoutObj[UiResult]:
|
2024-03-04 11:08:57 +00:00
|
|
|
"""Transaction summary. Always hold to confirm."""
|
|
|
|
|
|
|
|
|
2024-04-21 20:43:12 +00:00
|
|
|
# rust/src/ui/model_mercury/layout.rs
|
2024-10-31 13:21:48 +00:00
|
|
|
def flow_prompt_backup() -> LayoutObj[UiResult]:
|
|
|
|
"""Prompt a user to create backup with an option to skip."""
|
2024-04-21 20:43:12 +00:00
|
|
|
|
|
|
|
|
2024-04-11 22:21:05 +00:00
|
|
|
# rust/src/ui/model_mercury/layout.rs
|
2024-04-30 11:32:48 +00:00
|
|
|
def flow_get_address(
|
|
|
|
*,
|
|
|
|
address: str | bytes,
|
2024-06-06 12:48:56 +00:00
|
|
|
title: str,
|
2024-04-30 11:32:48 +00:00
|
|
|
description: str | None,
|
|
|
|
extra: str | None,
|
|
|
|
chunkify: bool,
|
|
|
|
address_qr: str | None,
|
|
|
|
case_sensitive: bool,
|
|
|
|
account: str | None,
|
|
|
|
path: str | None,
|
|
|
|
xpubs: list[tuple[str, str]],
|
2024-10-02 10:11:40 +00:00
|
|
|
title_success: str,
|
2024-05-20 16:30:57 +00:00
|
|
|
br_code: ButtonRequestType,
|
2024-07-04 14:00:36 +00:00
|
|
|
br_name: str,
|
2024-04-30 11:32:48 +00:00
|
|
|
) -> LayoutObj[UiResult]:
|
2024-04-11 22:21:05 +00:00
|
|
|
"""Get address / receive funds."""
|
2024-04-30 11:32:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_mercury/layout.rs
|
|
|
|
def flow_warning_hi_prio(
|
|
|
|
*,
|
|
|
|
title: str,
|
|
|
|
description: str,
|
|
|
|
value: str = "",
|
2024-11-11 15:59:13 +00:00
|
|
|
verb_cancel: str | None = None,
|
2024-04-30 11:32:48 +00:00
|
|
|
) -> LayoutObj[UiResult]:
|
|
|
|
"""Warning modal with multiple steps to confirm."""
|
2024-05-12 18:37:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_mercury/layout.rs
|
|
|
|
def flow_confirm_output(
|
|
|
|
*,
|
|
|
|
title: str | None,
|
2024-08-30 14:12:38 +00:00
|
|
|
subtitle: str | None,
|
|
|
|
message: str,
|
2024-08-08 13:13:43 +00:00
|
|
|
amount: str | None,
|
2024-05-12 18:37:14 +00:00
|
|
|
chunkify: bool,
|
2024-08-30 14:12:38 +00:00
|
|
|
text_mono: bool,
|
2024-05-12 18:37:14 +00:00
|
|
|
account: str | None,
|
|
|
|
account_path: str | None,
|
2024-05-20 16:30:57 +00:00
|
|
|
br_code: ButtonRequestType,
|
2024-07-04 14:00:36 +00:00
|
|
|
br_name: str,
|
2024-08-30 14:12:38 +00:00
|
|
|
address: str | None,
|
|
|
|
address_title: str | None,
|
2024-08-20 11:57:04 +00:00
|
|
|
summary_items: Iterable[tuple[str, str]] | None = None,
|
|
|
|
fee_items: Iterable[tuple[str, str]] | None = None,
|
|
|
|
summary_title: str | None = None,
|
|
|
|
summary_br_code: ButtonRequestType | None = None,
|
|
|
|
summary_br_name: str | None = None,
|
2024-08-08 13:13:43 +00:00
|
|
|
cancel_text: str | None = None,
|
2024-05-12 18:37:14 +00:00
|
|
|
) -> LayoutObj[UiResult]:
|
2024-08-20 11:57:04 +00:00
|
|
|
"""Confirm the recipient, (optionally) confirm the amount and (optionally) confirm the summary and present a Hold to Sign page."""
|
2024-05-12 18:37:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_mercury/layout.rs
|
|
|
|
def flow_confirm_summary(
|
|
|
|
*,
|
|
|
|
title: str,
|
|
|
|
items: Iterable[tuple[str, str]],
|
|
|
|
account_items: Iterable[tuple[str, str]],
|
2024-10-04 15:17:14 +00:00
|
|
|
account_items_title: str | None,
|
2024-05-12 18:37:14 +00:00
|
|
|
fee_items: Iterable[tuple[str, str]],
|
2024-05-20 16:30:57 +00:00
|
|
|
br_code: ButtonRequestType,
|
2024-07-04 14:00:36 +00:00
|
|
|
br_name: str,
|
2024-08-08 13:13:43 +00:00
|
|
|
cancel_text: str | None = None,
|
2024-05-12 18:37:14 +00:00
|
|
|
) -> LayoutObj[UiResult]:
|
|
|
|
"""Total summary and hold to confirm."""
|
2024-10-18 13:11:58 +00:00
|
|
|
from trezor import utils
|
|
|
|
from trezorui_api import *
|
2024-03-04 11:08:57 +00:00
|
|
|
|
|
|
|
|
2023-05-12 09:19:35 +00:00
|
|
|
# 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
|
2023-10-19 15:29:29 +00:00
|
|
|
verb: str = "CONFIRM",
|
2023-09-14 10:25:13 +00:00
|
|
|
chunkify: bool = False,
|
2023-06-27 14:01:21 +00:00
|
|
|
) -> LayoutObj[UiResult]:
|
2023-05-12 09:19:35 +00:00
|
|
|
"""Confirm address."""
|
|
|
|
|
2023-07-11 13:05:39 +00:00
|
|
|
|
2023-06-26 08:50:28 +00:00
|
|
|
# rust/src/ui/model_tr/layout.rs
|
2023-06-27 14:01:21 +00:00
|
|
|
def confirm_backup() -> LayoutObj[UiResult]:
|
2023-06-26 08:50:28 +00:00
|
|
|
"""Strongly recommend user to do backup."""
|
|
|
|
|
2023-07-11 13:05:39 +00:00
|
|
|
|
2023-05-12 09:19:35 +00:00
|
|
|
# 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]],
|
2023-06-27 14:01:21 +00:00
|
|
|
) -> LayoutObj[UiResult]:
|
2023-05-12 09:19:35 +00:00
|
|
|
"""Show address details - QR code, account, path, cosigner xpubs."""
|
|
|
|
|
2023-07-11 13:05:39 +00:00
|
|
|
|
2023-05-12 09:19:35 +00:00
|
|
|
# rust/src/ui/model_tr/layout.rs
|
|
|
|
def confirm_joint_total(
|
|
|
|
*,
|
|
|
|
spending_amount: str,
|
|
|
|
total_amount: str,
|
2023-06-27 14:01:21 +00:00
|
|
|
) -> LayoutObj[UiResult]:
|
2023-05-12 09:19:35 +00:00
|
|
|
"""Confirm total if there are external inputs."""
|
|
|
|
|
2023-07-11 13:05:39 +00:00
|
|
|
|
2023-05-12 09:19:35 +00:00
|
|
|
# rust/src/ui/model_tr/layout.rs
|
2023-09-14 15:00:50 +00:00
|
|
|
def confirm_output_address(
|
2023-05-12 09:19:35 +00:00
|
|
|
*,
|
|
|
|
address: str,
|
2023-06-20 15:19:56 +00:00
|
|
|
address_label: str,
|
2023-05-12 09:19:35 +00:00
|
|
|
address_title: str,
|
2023-09-14 10:25:13 +00:00
|
|
|
chunkify: bool = False,
|
2023-06-27 14:01:21 +00:00
|
|
|
) -> LayoutObj[UiResult]:
|
2023-09-14 15:00:50 +00:00
|
|
|
"""Confirm output address."""
|
|
|
|
|
|
|
|
|
|
|
|
# rust/src/ui/model_tr/layout.rs
|
|
|
|
def confirm_output_amount(
|
|
|
|
*,
|
|
|
|
amount: str,
|
|
|
|
amount_title: str,
|
2023-06-27 14:01:21 +00:00
|
|
|
) -> LayoutObj[UiResult]:
|
2023-09-14 15:00:50 +00:00
|
|
|
"""Confirm output amount."""
|
2023-05-12 09:19:35 +00:00
|
|
|
|
2023-07-11 13:05:39 +00:00
|
|
|
|
2023-05-12 09:19:35 +00:00
|
|
|
# rust/src/ui/model_tr/layout.rs
|
|
|
|
def confirm_total(
|
|
|
|
*,
|
|
|
|
total_amount: str,
|
|
|
|
fee_amount: str,
|
|
|
|
fee_rate_amount: str | None,
|
2023-06-20 15:19:56 +00:00
|
|
|
account_label: str | None,
|
2023-05-12 09:19:35 +00:00
|
|
|
total_label: str,
|
|
|
|
fee_label: str,
|
2023-06-27 14:01:21 +00:00
|
|
|
) -> LayoutObj[UiResult]:
|
2023-05-12 09:19:35 +00:00
|
|
|
"""Confirm summary of a transaction."""
|
|
|
|
|
2023-07-11 13:05:39 +00:00
|
|
|
|
2023-07-31 15:02:36 +00:00
|
|
|
# rust/src/ui/model_tr/layout.rs
|
2023-12-01 15:18:58 +00:00
|
|
|
def altcoin_tx_summary(
|
2023-07-31 15:02:36 +00:00
|
|
|
*,
|
2023-12-01 15:18:58 +00:00
|
|
|
amount_title: str,
|
|
|
|
amount_value: str,
|
|
|
|
fee_title: str,
|
|
|
|
fee_value: str,
|
2024-10-24 23:53:30 +00:00
|
|
|
items_title: str,
|
2023-07-31 15:02:36 +00:00
|
|
|
items: Iterable[Tuple[str, str]],
|
2023-12-01 15:18:58 +00:00
|
|
|
cancel_cross: bool = False,
|
2023-06-27 14:01:21 +00:00
|
|
|
) -> LayoutObj[UiResult]:
|
2023-12-01 15:18:58 +00:00
|
|
|
"""Confirm details about altcoin transaction."""
|
2023-07-31 15:02:36 +00:00
|
|
|
|
|
|
|
|
2023-06-20 07:25:02 +00:00
|
|
|
# rust/src/ui/model_tr/layout.rs
|
|
|
|
def multiple_pages_texts(
|
|
|
|
*,
|
|
|
|
title: str,
|
|
|
|
verb: str,
|
|
|
|
items: list[str],
|
2023-06-27 14:01:21 +00:00
|
|
|
) -> LayoutObj[UiResult]:
|
2023-06-20 07:25:02 +00:00
|
|
|
"""Show multiple texts, each on its own page."""
|
2024-07-01 11:22:12 +00:00
|
|
|
from trezor import utils
|
2024-10-18 13:11:58 +00:00
|
|
|
from trezorui_api import *
|
2021-12-13 11:22:52 +00:00
|
|
|
|
2023-07-11 13:05: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,
|
2023-06-27 14:01:21 +00:00
|
|
|
) -> LayoutObj[UiResult]:
|
2023-04-28 12:43:59 +00:00
|
|
|
"""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-07-11 13:05:39 +00:00
|
|
|
|
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,
|
2023-10-19 15:29:29 +00:00
|
|
|
verb: str | None = "CONFIRM",
|
2023-02-14 22:47:20 +00:00
|
|
|
extra: str | None,
|
2023-09-14 10:25:13 +00:00
|
|
|
chunkify: bool = False,
|
2023-06-27 14:01:21 +00:00
|
|
|
) -> LayoutObj[UiResult]:
|
2023-02-14 22:47:20 +00:00
|
|
|
"""Confirm address. Similar to `confirm_blob` but has corner info button
|
|
|
|
and allows left swipe which does the same thing as the button."""
|
|
|
|
|
2023-07-11 13:05:39 +00:00
|
|
|
|
2023-02-14 22:47:20 +00:00
|
|
|
# rust/src/ui/model_tt/layout.rs
|
|
|
|
def show_address_details(
|
|
|
|
*,
|
2023-07-26 14:45:10 +00:00
|
|
|
qr_title: str,
|
2023-02-14 22:47:20 +00:00
|
|
|
address: str,
|
|
|
|
case_sensitive: bool,
|
2023-07-26 14:45:10 +00:00
|
|
|
details_title: str,
|
2023-02-14 22:47:20 +00:00
|
|
|
account: str | None,
|
|
|
|
path: str | None,
|
|
|
|
xpubs: list[tuple[str, str]],
|
2023-06-27 14:01:21 +00:00
|
|
|
) -> LayoutObj[UiResult]:
|
2023-02-14 22:47:20 +00:00
|
|
|
"""Show address details - QR code, account, path, cosigner xpubs."""
|
|
|
|
|
2023-07-11 13:05:39 +00:00
|
|
|
|
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-12-01 15:18:58 +00:00
|
|
|
items: Iterable[tuple[str, str]],
|
2023-03-30 22:14:44 +00:00
|
|
|
info_button: bool = False,
|
2023-08-01 14:54:01 +00:00
|
|
|
cancel_arrow: bool = False,
|
2023-06-27 14:01:21 +00:00
|
|
|
) -> LayoutObj[UiResult]:
|
2023-03-30 22:14:44 +00:00
|
|
|
"""Transaction summary. Always hold to confirm."""
|