1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-18 05:28:40 +00:00
trezor-firmware/tools/coins_gen

30 lines
625 B
Plaintext
Raw Normal View History

#!/usr/bin/env python3
import json
2016-11-09 13:52:43 +00:00
fields = [
'coin_name',
'coin_shortcut',
'address_type',
'maxfee_kb',
'address_type_p2sh',
'address_type_p2wpkh',
'address_type_p2wsh',
'signed_message_header',
'xpub_magic',
'xprv_magic',
'bip44',
2016-11-09 13:52:43 +00:00
]
2016-10-20 15:07:56 +00:00
coins = json.load(open('../../trezor-common/coins.json', 'r'))
2016-11-11 17:11:37 +00:00
print('COINS = [')
for c in coins:
print(' CoinType(')
2016-11-09 13:52:43 +00:00
for n in fields:
if n in ['xpub_magic', 'xprv_magic']:
print(' %s=0x%s,' % (n, c[n]))
else:
print(' %s=%s,' % (n, repr(c[n])))
print(' ),')
print(']\n')