mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-12 17:48:09 +00:00
23 lines
548 B
Python
23 lines
548 B
Python
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)
|