|
|
@ -3,12 +3,8 @@ from ubinascii import hexlify
|
|
|
|
|
|
|
|
|
|
|
|
from trezor import ui
|
|
|
|
from trezor import ui
|
|
|
|
from trezor.messages import ButtonRequestType, OutputScriptType
|
|
|
|
from trezor.messages import ButtonRequestType, OutputScriptType
|
|
|
|
from trezor.ui.text import Text
|
|
|
|
|
|
|
|
from trezor.utils import chunks, format_amount
|
|
|
|
from trezor.utils import chunks, format_amount
|
|
|
|
|
|
|
|
|
|
|
|
from apps.common.confirm import confirm, hold_to_confirm
|
|
|
|
|
|
|
|
from apps.wallet.sign_tx import addresses, omni
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_LOCKTIME_TIMESTAMP_MIN_VALUE = const(500000000)
|
|
|
|
_LOCKTIME_TIMESTAMP_MIN_VALUE = const(500000000)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -25,6 +21,10 @@ def split_op_return(data):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async def confirm_output(ctx, output, coin):
|
|
|
|
async def confirm_output(ctx, output, coin):
|
|
|
|
|
|
|
|
from trezor.ui.text import Text
|
|
|
|
|
|
|
|
from apps.common.confirm import confirm
|
|
|
|
|
|
|
|
from apps.wallet.sign_tx import addresses, omni
|
|
|
|
|
|
|
|
|
|
|
|
if output.script_type == OutputScriptType.PAYTOOPRETURN:
|
|
|
|
if output.script_type == OutputScriptType.PAYTOOPRETURN:
|
|
|
|
data = output.op_return_data
|
|
|
|
data = output.op_return_data
|
|
|
|
if omni.is_valid(data):
|
|
|
|
if omni.is_valid(data):
|
|
|
@ -48,7 +48,10 @@ async def confirm_output(ctx, output, coin):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async def confirm_total(ctx, spending, fee, coin):
|
|
|
|
async def confirm_total(ctx, spending, fee, coin):
|
|
|
|
text = Text("Confirm transaction", ui.ICON_SEND, icon_color=ui.GREEN)
|
|
|
|
from trezor.ui.text import Text
|
|
|
|
|
|
|
|
from apps.common.confirm import hold_to_confirm
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
text = Text("Confirm transaction", ui.ICON_SEND, ui.GREEN)
|
|
|
|
text.normal("Total amount:")
|
|
|
|
text.normal("Total amount:")
|
|
|
|
text.bold(format_coin_amount(spending, coin))
|
|
|
|
text.bold(format_coin_amount(spending, coin))
|
|
|
|
text.normal("including fee:")
|
|
|
|
text.normal("including fee:")
|
|
|
@ -57,7 +60,10 @@ async def confirm_total(ctx, spending, fee, coin):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async def confirm_feeoverthreshold(ctx, fee, coin):
|
|
|
|
async def confirm_feeoverthreshold(ctx, fee, coin):
|
|
|
|
text = Text("High fee", ui.ICON_SEND, icon_color=ui.GREEN)
|
|
|
|
from trezor.ui.text import Text
|
|
|
|
|
|
|
|
from apps.common.confirm import confirm
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
text = Text("High fee", ui.ICON_SEND, ui.GREEN)
|
|
|
|
text.normal("The fee of")
|
|
|
|
text.normal("The fee of")
|
|
|
|
text.bold(format_coin_amount(fee, coin))
|
|
|
|
text.bold(format_coin_amount(fee, coin))
|
|
|
|
text.normal("is unexpectedly high.", "Continue?")
|
|
|
|
text.normal("is unexpectedly high.", "Continue?")
|
|
|
@ -65,13 +71,19 @@ async def confirm_feeoverthreshold(ctx, fee, coin):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async def confirm_foreign_address(ctx, address_n, coin):
|
|
|
|
async def confirm_foreign_address(ctx, address_n, coin):
|
|
|
|
text = Text("Confirm sending", ui.ICON_SEND, icon_color=ui.RED)
|
|
|
|
from trezor.ui.text import Text
|
|
|
|
|
|
|
|
from apps.common.confirm import confirm
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
text = Text("Confirm sending", ui.ICON_SEND, ui.RED)
|
|
|
|
text.normal("Trying to spend", "coins from another chain.", "Continue?")
|
|
|
|
text.normal("Trying to spend", "coins from another chain.", "Continue?")
|
|
|
|
return await confirm(ctx, text, ButtonRequestType.SignTx)
|
|
|
|
return await confirm(ctx, text, ButtonRequestType.SignTx)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async def confirm_nondefault_locktime(ctx, lock_time):
|
|
|
|
async def confirm_nondefault_locktime(ctx, lock_time):
|
|
|
|
text = Text("Confirm locktime", ui.ICON_SEND, icon_color=ui.GREEN)
|
|
|
|
from trezor.ui.text import Text
|
|
|
|
|
|
|
|
from apps.common.confirm import confirm
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
text = Text("Confirm locktime", ui.ICON_SEND, ui.GREEN)
|
|
|
|
text.normal("Locktime for this transaction is set to")
|
|
|
|
text.normal("Locktime for this transaction is set to")
|
|
|
|
if lock_time < _LOCKTIME_TIMESTAMP_MIN_VALUE:
|
|
|
|
if lock_time < _LOCKTIME_TIMESTAMP_MIN_VALUE:
|
|
|
|
text.normal("blockheight:")
|
|
|
|
text.normal("blockheight:")
|
|
|
|