2016-11-09 13:46:59 +00:00
|
|
|
from trezor.messages.CoinType import CoinType
|
|
|
|
|
2016-10-20 15:07:56 +00:00
|
|
|
# the following list is generated using tools/coins-gen.py
|
2016-11-09 13:46:59 +00:00
|
|
|
# do not edit manually!
|
2016-11-11 10:26:38 +00:00
|
|
|
COINS = [
|
2016-11-09 13:46:59 +00:00
|
|
|
CoinType(
|
|
|
|
coin_name='Bitcoin',
|
|
|
|
coin_shortcut='BTC',
|
|
|
|
address_type=0,
|
|
|
|
address_type_p2sh=5,
|
2017-05-12 23:29:49 +00:00
|
|
|
maxfee_kb=500000,
|
2016-11-09 13:46:59 +00:00
|
|
|
signed_message_header='Bitcoin Signed Message:\n',
|
2017-04-24 13:59:30 +00:00
|
|
|
xpub_magic=0x0488b21e,
|
|
|
|
xprv_magic=0x0488ade4,
|
|
|
|
bip44=0,
|
2017-04-26 13:46:08 +00:00
|
|
|
segwit=False,
|
2016-11-09 13:46:59 +00:00
|
|
|
),
|
|
|
|
CoinType(
|
|
|
|
coin_name='Testnet',
|
|
|
|
coin_shortcut='TEST',
|
|
|
|
address_type=111,
|
|
|
|
address_type_p2sh=196,
|
2017-05-12 20:51:07 +00:00
|
|
|
maxfee_kb=10000000,
|
2016-11-09 13:46:59 +00:00
|
|
|
signed_message_header='Bitcoin Signed Message:\n',
|
2017-04-24 13:59:30 +00:00
|
|
|
xpub_magic=0x043587cf,
|
|
|
|
xprv_magic=0x04358394,
|
|
|
|
bip44=1,
|
2017-04-26 13:46:08 +00:00
|
|
|
segwit=True,
|
2016-11-09 13:46:59 +00:00
|
|
|
),
|
|
|
|
CoinType(
|
|
|
|
coin_name='Namecoin',
|
|
|
|
coin_shortcut='NMC',
|
|
|
|
address_type=52,
|
|
|
|
address_type_p2sh=5,
|
2017-05-12 20:51:07 +00:00
|
|
|
maxfee_kb=10000000,
|
2016-11-09 13:46:59 +00:00
|
|
|
signed_message_header='Namecoin Signed Message:\n',
|
2017-04-24 13:59:30 +00:00
|
|
|
xpub_magic=0x019da462,
|
|
|
|
xprv_magic=0x019d9cfe,
|
|
|
|
bip44=7,
|
2017-04-26 13:46:08 +00:00
|
|
|
segwit=False,
|
2016-11-09 13:46:59 +00:00
|
|
|
),
|
|
|
|
CoinType(
|
|
|
|
coin_name='Litecoin',
|
|
|
|
coin_shortcut='LTC',
|
|
|
|
address_type=48,
|
2017-05-12 20:51:07 +00:00
|
|
|
address_type_p2sh=50,
|
2016-11-09 13:46:59 +00:00
|
|
|
maxfee_kb=1000000,
|
|
|
|
signed_message_header='Litecoin Signed Message:\n',
|
2017-04-24 13:59:30 +00:00
|
|
|
xpub_magic=0x019da462,
|
|
|
|
xprv_magic=0x019d9cfe,
|
|
|
|
bip44=2,
|
2017-04-26 13:46:08 +00:00
|
|
|
segwit=True,
|
2016-11-09 13:46:59 +00:00
|
|
|
),
|
|
|
|
CoinType(
|
|
|
|
coin_name='Dogecoin',
|
|
|
|
coin_shortcut='DOGE',
|
|
|
|
address_type=30,
|
|
|
|
address_type_p2sh=22,
|
2017-05-12 20:51:07 +00:00
|
|
|
maxfee_kb=1000000000,
|
2016-11-09 13:46:59 +00:00
|
|
|
signed_message_header='Dogecoin Signed Message:\n',
|
2017-04-24 13:59:30 +00:00
|
|
|
xpub_magic=0x02facafd,
|
|
|
|
xprv_magic=0x02fac398,
|
|
|
|
bip44=3,
|
2017-04-26 13:46:08 +00:00
|
|
|
segwit=False,
|
2016-11-09 13:46:59 +00:00
|
|
|
),
|
|
|
|
CoinType(
|
|
|
|
coin_name='Dash',
|
|
|
|
coin_shortcut='DASH',
|
|
|
|
address_type=76,
|
|
|
|
address_type_p2sh=16,
|
2017-05-12 20:51:07 +00:00
|
|
|
maxfee_kb=100000,
|
2016-11-09 13:46:59 +00:00
|
|
|
signed_message_header='DarkCoin Signed Message:\n',
|
2017-04-24 13:59:30 +00:00
|
|
|
xpub_magic=0x02fe52cc,
|
|
|
|
xprv_magic=0x02fe52f8,
|
|
|
|
bip44=5,
|
2017-04-26 13:46:08 +00:00
|
|
|
segwit=False,
|
2016-11-09 13:46:59 +00:00
|
|
|
),
|
|
|
|
CoinType(
|
|
|
|
coin_name='Zcash',
|
|
|
|
coin_shortcut='ZEC',
|
|
|
|
address_type=7352,
|
|
|
|
address_type_p2sh=7357,
|
2017-05-12 20:51:07 +00:00
|
|
|
maxfee_kb=1000000,
|
2016-11-09 13:46:59 +00:00
|
|
|
signed_message_header='Zcash Signed Message:\n',
|
2017-04-24 13:59:30 +00:00
|
|
|
xpub_magic=0x0488b21e,
|
|
|
|
xprv_magic=0x0488ade4,
|
|
|
|
bip44=133,
|
2017-04-26 13:46:08 +00:00
|
|
|
segwit=False,
|
2016-11-09 13:46:59 +00:00
|
|
|
),
|
|
|
|
CoinType(
|
|
|
|
coin_name='Zcash Testnet',
|
|
|
|
coin_shortcut='TAZ',
|
|
|
|
address_type=7461,
|
|
|
|
address_type_p2sh=7354,
|
2017-05-12 20:51:07 +00:00
|
|
|
maxfee_kb=10000000,
|
2016-11-09 13:46:59 +00:00
|
|
|
signed_message_header='Zcash Signed Message:\n',
|
2017-04-24 13:59:30 +00:00
|
|
|
xpub_magic=0x043587cf,
|
|
|
|
xprv_magic=0x04358394,
|
|
|
|
bip44=1,
|
2017-04-26 13:46:08 +00:00
|
|
|
segwit=False,
|
2016-11-09 13:46:59 +00:00
|
|
|
),
|
2016-10-20 14:40:46 +00:00
|
|
|
]
|
|
|
|
|
2016-11-08 17:49:58 +00:00
|
|
|
|
2016-10-20 14:40:46 +00:00
|
|
|
def by_shortcut(shortcut):
|
2016-11-11 10:26:38 +00:00
|
|
|
for c in COINS:
|
2016-11-09 13:46:59 +00:00
|
|
|
if c.coin_shortcut == shortcut:
|
2016-10-20 14:40:46 +00:00
|
|
|
return c
|
2016-11-15 10:57:18 +00:00
|
|
|
raise ValueError('Unknown coin shortcut "%s"' % shortcut)
|
2016-10-20 14:40:46 +00:00
|
|
|
|
2016-11-08 17:49:58 +00:00
|
|
|
|
2016-10-20 14:40:46 +00:00
|
|
|
def by_name(name):
|
2016-11-11 10:26:38 +00:00
|
|
|
for c in COINS:
|
2016-11-09 13:46:59 +00:00
|
|
|
if c.coin_name == name:
|
2016-10-20 14:40:46 +00:00
|
|
|
return c
|
2016-11-15 10:57:18 +00:00
|
|
|
raise ValueError('Unknown coin name "%s"' % name)
|
2016-10-20 14:40:46 +00:00
|
|
|
|
2016-11-08 17:49:58 +00:00
|
|
|
|
2016-10-20 14:40:46 +00:00
|
|
|
def by_address_type(version):
|
2016-11-11 10:26:38 +00:00
|
|
|
for c in COINS:
|
2016-11-09 13:46:59 +00:00
|
|
|
if c.address_type == version:
|
2016-10-20 14:40:46 +00:00
|
|
|
return c
|
2016-11-15 10:57:18 +00:00
|
|
|
raise ValueError('Unknown coin address type %d' % version)
|