Esempio n. 1
0
async def confirm_payment_op(ctx, op: StellarPaymentOp):
    text = Text("Confirm operation", ui.ICON_CONFIRM, ui.GREEN)
    text.bold("Pay %s" % format_amount(op.amount, ticker=False))
    text.bold("%s to:" % format_asset_code(op.asset))
    text.mono(*split(trim_to_rows(op.destination_account, 3)))
    await require_confirm(ctx, text, ButtonRequestType.ConfirmOutput)
    await confirm_asset_issuer(ctx, op.asset)
Esempio n. 2
0
async def confirm_allow_trust_op(ctx, op: StellarAllowTrustOp):
    if op.is_authorized:
        t = "Allow Trust"
    else:
        t = "Revoke Trust"
    text = Text("Confirm operation", ui.ICON_CONFIRM, ui.GREEN)
    text.bold(t)
    text.normal("of %s by:" % op.asset_code)
    text.mono(*split(trim_to_rows(op.trusted_account, 3)))

    await require_confirm(ctx, text, ButtonRequestType.ConfirmOutput)
Esempio n. 3
0
async def confirm_path_payment_op(ctx, op: StellarPathPaymentOp):
    text = Text("Confirm operation", ui.ICON_CONFIRM, icon_color=ui.GREEN)
    text.bold("Path Pay %s" % format_amount(op.destination_amount, ticker=False))
    text.bold("%s to:" % format_asset_code(op.destination_asset))
    text.mono(*split(trim_to_rows(op.destination_account, 3)))
    await require_confirm(ctx, text, ButtonRequestType.ConfirmOutput)
    await confirm_asset_issuer(ctx, op.destination_asset)
    # confirm what the sender is using to pay
    text = Text("Confirm operation", ui.ICON_CONFIRM, icon_color=ui.GREEN)
    text.normal("Pay using")
    text.bold(format_amount(op.send_max, ticker=False))
    text.bold(format_asset_code(op.send_asset))
    text.normal("This amount is debited")
    text.normal("from your account.")
    await require_confirm(ctx, text, ButtonRequestType.ConfirmOutput)
    await confirm_asset_issuer(ctx, op.send_asset)
Esempio n. 4
0
async def confirm_create_account_op(ctx, op: StellarCreateAccountOp):
    text = Text("Confirm operation", ui.ICON_CONFIRM, ui.GREEN)
    text.bold("Create Account")
    text.normal("with %s" % format_amount(op.starting_balance))
    text.mono(*split(trim_to_rows(op.new_account, 3)))
    await require_confirm(ctx, text, ButtonRequestType.ConfirmOutput)
Esempio n. 5
0
async def confirm_account_merge_op(ctx, op: StellarAccountMergeOp):
    text = Text("Confirm operation", ui.ICON_CONFIRM, ui.GREEN)
    text.bold("Account Merge")
    text.normal("All XLM will be sent to:")
    text.mono(*split(trim_to_rows(op.destination_account, 3)))
    await require_confirm(ctx, text, ButtonRequestType.ConfirmOutput)