diff --git a/core/embed/rust/src/ui/api/firmware_micropython.rs b/core/embed/rust/src/ui/api/firmware_micropython.rs index 60e24cc93f..0f1ddbd16f 100644 --- a/core/embed/rust/src/ui/api/firmware_micropython.rs +++ b/core/embed/rust/src/ui/api/firmware_micropython.rs @@ -423,6 +423,8 @@ extern "C" fn new_flow_confirm_output(n_args: usize, args: *const Obj, kwargs: * let block = move |_args: &[Obj], kwargs: &Map| { let title: Option = kwargs.get(Qstr::MP_QSTR_title)?.try_into_option()?; let subtitle: Option = kwargs.get(Qstr::MP_QSTR_subtitle)?.try_into_option()?; + let description: Option = + kwargs.get(Qstr::MP_QSTR_description)?.try_into_option()?; let message: Obj = kwargs.get(Qstr::MP_QSTR_message)?; let amount: Option = kwargs.get(Qstr::MP_QSTR_amount)?.try_into_option()?; let chunkify: bool = kwargs.get_or(Qstr::MP_QSTR_chunkify, false)?; @@ -453,6 +455,7 @@ extern "C" fn new_flow_confirm_output(n_args: usize, args: *const Obj, kwargs: * let layout = ModelUI::flow_confirm_output( title, subtitle, + description, message, amount, chunkify, @@ -1338,6 +1341,7 @@ pub static mp_module_trezorui_api: Module = obj_module! { /// summary_br_code: ButtonRequestType | None = None, /// summary_br_name: str | None = None, /// cancel_text: str | None = None, + /// description: str | None = None, /// ) -> LayoutObj[UiResult]: /// """Confirm the recipient, (optionally) confirm the amount and (optionally) confirm the summary and present a Hold to Sign page.""" Qstr::MP_QSTR_flow_confirm_output => obj_fn_kw!(0, new_flow_confirm_output).as_obj(), diff --git a/core/embed/rust/src/ui/layout_bolt/ui_firmware.rs b/core/embed/rust/src/ui/layout_bolt/ui_firmware.rs index be68f5d192..f292d6cb2e 100644 --- a/core/embed/rust/src/ui/layout_bolt/ui_firmware.rs +++ b/core/embed/rust/src/ui/layout_bolt/ui_firmware.rs @@ -539,6 +539,7 @@ impl FirmwareUI for UIBolt { fn flow_confirm_output( _title: Option>, _subtitle: Option>, + _description: Option>, _message: Obj, _amount: Option, _chunkify: bool, diff --git a/core/embed/rust/src/ui/layout_caesar/ui_firmware.rs b/core/embed/rust/src/ui/layout_caesar/ui_firmware.rs index 2140a4c68c..f9d1173416 100644 --- a/core/embed/rust/src/ui/layout_caesar/ui_firmware.rs +++ b/core/embed/rust/src/ui/layout_caesar/ui_firmware.rs @@ -678,6 +678,7 @@ impl FirmwareUI for UICaesar { fn flow_confirm_output( _title: Option>, _subtitle: Option>, + _description: Option>, _message: Obj, _amount: Option, _chunkify: bool, diff --git a/core/embed/rust/src/ui/layout_delizia/ui_firmware.rs b/core/embed/rust/src/ui/layout_delizia/ui_firmware.rs index 80b25adb44..f5739d283e 100644 --- a/core/embed/rust/src/ui/layout_delizia/ui_firmware.rs +++ b/core/embed/rust/src/ui/layout_delizia/ui_firmware.rs @@ -510,6 +510,7 @@ impl FirmwareUI for UIDelizia { fn flow_confirm_output( title: Option>, subtitle: Option>, + description: Option>, message: Obj, amount: Option, chunkify: bool, @@ -529,13 +530,14 @@ impl FirmwareUI for UIDelizia { ) -> Result { let address_title = address_title.unwrap_or(TR::words__address.into()); - let confirm_main = ConfirmValue::new(title.unwrap_or(TString::empty()), message, None) - .with_subtitle(subtitle) - .with_menu_button() - .with_footer(TR::instructions__swipe_up.into(), None) - .with_chunkify(chunkify) - .with_text_mono(text_mono) - .with_swipe_up(); + let confirm_main = + ConfirmValue::new(title.unwrap_or(TString::empty()), message, description) + .with_subtitle(subtitle) + .with_menu_button() + .with_footer(TR::instructions__swipe_up.into(), None) + .with_chunkify(chunkify) + .with_text_mono(text_mono) + .with_swipe_up(); let confirm_amount = amount.map(|amount| { ConfirmValue::new(TR::words__amount.into(), amount, None) diff --git a/core/embed/rust/src/ui/ui_firmware.rs b/core/embed/rust/src/ui/ui_firmware.rs index 054dd90ae7..32cb2ca2a9 100644 --- a/core/embed/rust/src/ui/ui_firmware.rs +++ b/core/embed/rust/src/ui/ui_firmware.rs @@ -160,6 +160,7 @@ pub trait FirmwareUI { fn flow_confirm_output( title: Option>, subtitle: Option>, + description: Option>, message: Obj, // TODO: replace Obj amount: Option, // TODO: replace Obj chunkify: bool, diff --git a/core/mocks/generated/trezorui_api.pyi b/core/mocks/generated/trezorui_api.pyi index e10e8ae2f6..7575bde7e4 100644 --- a/core/mocks/generated/trezorui_api.pyi +++ b/core/mocks/generated/trezorui_api.pyi @@ -327,6 +327,7 @@ def flow_confirm_output( summary_br_code: ButtonRequestType | None = None, summary_br_name: str | None = None, cancel_text: str | None = None, + description: str | None = None, ) -> LayoutObj[UiResult]: """Confirm the recipient, (optionally) confirm the amount and (optionally) confirm the summary and present a Hold to Sign page.""" diff --git a/core/src/trezor/ui/layouts/delizia/__init__.py b/core/src/trezor/ui/layouts/delizia/__init__.py index 20efee8380..1ba80d5f27 100644 --- a/core/src/trezor/ui/layouts/delizia/__init__.py +++ b/core/src/trezor/ui/layouts/delizia/__init__.py @@ -377,6 +377,7 @@ async def confirm_output( source_account: str | None = None, source_account_path: str | None = None, cancel_text: str | None = None, + description: str | None = None, ) -> None: if address_label is not None: title = address_label @@ -407,6 +408,7 @@ async def confirm_output( summary_br_name=None, summary_br_code=None, cancel_text=cancel_text, + description=description, ), br_name=None, ) @@ -789,6 +791,7 @@ if not utils.BITCOIN_ONLY: summary_br_name="confirm_total", summary_br_code=ButtonRequestType.SignTx, cancel_text=TR.buttons__cancel, + description=None, ), None, ) @@ -835,6 +838,7 @@ if not utils.BITCOIN_ONLY: summary_br_name="confirm_total", summary_br_code=ButtonRequestType.SignTx, cancel_text=TR.buttons__cancel, # cancel staking + description=None, ), br_name=None, ) @@ -877,14 +881,19 @@ if not utils.BITCOIN_ONLY: ) -> None: (address_title, address) = stake_item summary_items = (amount_item, fee_item) + description = message + if vote_account: + description = f"{message}\n{TR.solana__stake_provider}:" + await raise_if_not_confirmed( trezorui_api.flow_confirm_output( title=title, subtitle=None, - message=message, + description=description, + message=vote_account, amount=None, - chunkify=False, - text_mono=False, + chunkify=True, + text_mono=True, account=account, account_path=account_path, br_code=ButtonRequestType.SignTx,