1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-12 09:28:10 +00:00
trezor-firmware/src/apps/ripple/layout.py

26 lines
881 B
Python
Raw Normal View History

from trezor import ui
from trezor.messages import ButtonRequestType
from trezor.ui.text import Text
from trezor.utils import format_amount
2018-07-10 14:30:36 +00:00
from . import helpers
2018-07-10 14:30:36 +00:00
from apps.common.confirm import require_confirm, require_hold_to_confirm
from apps.common.layout import split_address
2018-07-10 14:30:36 +00:00
async def require_confirm_fee(ctx, fee):
2018-07-10 14:30:36 +00:00
text = Text("Confirm fee", ui.ICON_SEND, icon_color=ui.GREEN)
text.normal("Transaction fee:")
text.bold(format_amount(fee, helpers.DIVISIBILITY) + " XRP")
await require_confirm(ctx, text, ButtonRequestType.ConfirmOutput)
async def require_confirm_tx(ctx, to, value):
2018-07-10 14:30:36 +00:00
text = Text("Confirm sending", ui.ICON_SEND, icon_color=ui.GREEN)
text.bold(format_amount(value, helpers.DIVISIBILITY) + " XRP")
text.normal("to")
text.mono(*split_address(to))
return await require_hold_to_confirm(ctx, text, ButtonRequestType.SignTx)