예제 #1
0
async def require_confirm_tx(ctx, to_bytes, value, chain_id, token=None, tx_type=None):
    if to_bytes:
        to_str = address_from_bytes(to_bytes, networks.by_chain_id(chain_id))
    else:
        to_str = "new contract?"
    text = Text("Confirm sending", ui.ICON_SEND, ui.GREEN, new_lines=False)
    text.bold(format_ethereum_amount(value, token, chain_id, tx_type))
    text.normal(ui.GREY, "to", ui.FG)
    for to_line in split_address(to_str):
        text.br()
        text.mono(to_line)
    # we use SignTx, not ConfirmOutput, for compatibility with T1
    await require_confirm(ctx, text, ButtonRequestType.SignTx)
예제 #2
0
async def require_confirm_tx(ctx,
                             to,
                             value,
                             chain_id,
                             token=None,
                             tx_type=None):
    if to:
        to_str = _ethereum_address_hex(to, networks.by_chain_id(chain_id))
    else:
        to_str = "new contract?"
    text = Text("Confirm sending", ui.ICON_SEND, icon_color=ui.GREEN)
    text.bold(format_ethereum_amount(value, token, chain_id, tx_type))
    text.normal("to")
    text.mono(*split_address(to_str))
    # we use SignTx, not ConfirmOutput, for compatibility with T1
    await require_confirm(ctx, text, ButtonRequestType.SignTx)
예제 #3
0
async def require_confirm_tx(ctx,
                             to,
                             value,
                             chain_id,
                             token=None,
                             tx_type=None):
    if to:
        str_to = _ethereum_address_hex(to, networks.by_chain_id(chain_id))
    else:
        str_to = 'new contract?'
    content = Text('Confirm sending',
                   ui.ICON_SEND,
                   ui.BOLD,
                   format_ethereum_amount(value, token, chain_id, tx_type),
                   ui.NORMAL,
                   'to',
                   ui.MONO,
                   *split_address(str_to),
                   icon_color=ui.GREEN)
    await require_confirm(
        ctx, content, ButtonRequestType.SignTx
    )  # we use SignTx, not ConfirmOutput, for compatibility with T1
예제 #4
0
 async def handler_chain_id(ctx, msg, keychain):
     network = by_chain_id(msg.chain_id)
     # standard tests
     self._check_keychain(keychain, network.slip44)
     # provided address should succeed too
     keychain.derive(msg.address_n)