2018-06-28 11:15:14 +00:00
|
|
|
from trezor import ui
|
|
|
|
from trezor.messages import ButtonRequestType
|
2019-08-27 14:08:56 +00:00
|
|
|
from trezor.strings import format_amount
|
2018-06-28 11:15:14 +00:00
|
|
|
from trezor.ui.text import Text
|
2018-07-10 14:30:36 +00:00
|
|
|
|
|
|
|
from apps.common.confirm import require_confirm, require_hold_to_confirm
|
2018-08-27 10:13:38 +00:00
|
|
|
from apps.common.layout import split_address
|
2018-07-10 14:30:36 +00:00
|
|
|
|
2020-05-18 11:17:34 +00:00
|
|
|
from . import helpers
|
|
|
|
|
2018-06-28 11:15:14 +00:00
|
|
|
|
|
|
|
async def require_confirm_fee(ctx, fee):
|
2019-05-13 13:06:34 +00:00
|
|
|
text = Text("Confirm fee", ui.ICON_SEND, ui.GREEN)
|
2018-07-10 14:30:36 +00:00
|
|
|
text.normal("Transaction fee:")
|
2019-12-09 16:43:30 +00:00
|
|
|
text.bold(format_amount(fee, helpers.DECIMALS) + " XRP")
|
2018-06-28 11:15:14 +00:00
|
|
|
await require_confirm(ctx, text, ButtonRequestType.ConfirmOutput)
|
|
|
|
|
|
|
|
|
2019-01-07 12:59:29 +00:00
|
|
|
async def require_confirm_destination_tag(ctx, tag):
|
2019-05-13 13:06:34 +00:00
|
|
|
text = Text("Confirm tag", ui.ICON_SEND, ui.GREEN)
|
2019-01-07 12:59:29 +00:00
|
|
|
text.normal("Destination tag:")
|
|
|
|
text.bold(str(tag))
|
|
|
|
await require_confirm(ctx, text, ButtonRequestType.ConfirmOutput)
|
|
|
|
|
|
|
|
|
2018-06-28 11:15:14 +00:00
|
|
|
async def require_confirm_tx(ctx, to, value):
|
2019-05-13 13:06:34 +00:00
|
|
|
text = Text("Confirm sending", ui.ICON_SEND, ui.GREEN)
|
2019-12-09 16:43:30 +00:00
|
|
|
text.bold(format_amount(value, helpers.DECIMALS) + " XRP")
|
2018-07-10 14:30:36 +00:00
|
|
|
text.normal("to")
|
2018-06-28 11:15:14 +00:00
|
|
|
text.mono(*split_address(to))
|
2020-02-19 14:29:53 +00:00
|
|
|
await require_hold_to_confirm(ctx, text, ButtonRequestType.SignTx)
|