You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trezor-firmware/src/apps/common/coins.py

23 lines
548 B

from apps.common.coininfo import COINS
def by_shortcut(shortcut):
for c in COINS:
if c.coin_shortcut == shortcut:
return c
raise ValueError('Unknown coin shortcut "%s"' % shortcut)
def by_name(name):
for c in COINS:
if c.coin_name == name:
return c
raise ValueError('Unknown coin name "%s"' % name)
def by_address_type(address_type):
for c in COINS:
if c.address_type == address_type:
return c
raise ValueError('Unknown coin address type %d' % address_type)