mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-10 00:28:07 +00:00
21 lines
657 B
Python
21 lines
657 B
Python
from apps.common import seed
|
|
from apps.common.display_address import show_address, show_qr
|
|
from trezor.messages.RippleAddress import RippleAddress
|
|
from trezor.messages.RippleGetAddress import RippleGetAddress
|
|
from . import helpers
|
|
|
|
|
|
async def get_address(ctx, msg: RippleGetAddress):
|
|
node = await seed.derive_node(ctx, msg.address_n)
|
|
pubkey = node.public_key()
|
|
address = helpers.address_from_public_key(pubkey)
|
|
|
|
if msg.show_display:
|
|
while True:
|
|
if await show_address(ctx, address):
|
|
break
|
|
if await show_qr(ctx, address.upper()):
|
|
break
|
|
|
|
return RippleAddress(address=address)
|