1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-05 14:59:44 +00:00
trezor-firmware/core/src/apps/common/coins.py

23 lines
518 B
Python
Raw Normal View History

from apps.common.coininfo import COINS
def by_shortcut(shortcut):
for c in COINS:
if c.coin_shortcut == shortcut:
return c
2016-11-15 10:57:18 +00:00
raise ValueError('Unknown coin shortcut "%s"' % shortcut)
def by_name(name):
for c in COINS:
if c.coin_name == name:
return c
2016-11-15 10:57:18 +00:00
raise ValueError('Unknown coin name "%s"' % name)
2018-06-21 11:58:57 +00:00
def by_slip44(slip44):
for c in COINS:
if c.slip44 == slip44:
return c
2018-07-03 14:20:58 +00:00
raise ValueError("Unknown coin slip44 index %d" % slip44)