2016-10-20 14:40:46 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
import json
|
2016-11-09 13:52:43 +00:00
|
|
|
|
|
|
|
fields = [
|
|
|
|
'coin_name',
|
|
|
|
'coin_shortcut',
|
|
|
|
'address_type',
|
|
|
|
'address_type_p2sh',
|
2017-05-12 20:51:07 +00:00
|
|
|
'maxfee_kb',
|
2016-11-09 13:52:43 +00:00
|
|
|
'signed_message_header',
|
2017-11-09 14:37:22 +00:00
|
|
|
'xpub_magic',
|
|
|
|
'bech32_prefix',
|
2018-05-24 13:18:05 +00:00
|
|
|
'cashaddr_prefix',
|
2018-06-21 11:58:57 +00:00
|
|
|
'slip44',
|
2017-04-26 13:46:08 +00:00
|
|
|
'segwit',
|
2018-05-28 15:43:29 +00:00
|
|
|
'fork_id',
|
2018-02-08 17:58:03 +00:00
|
|
|
'force_bip143',
|
2018-06-05 09:11:21 +00:00
|
|
|
'version_group_id',
|
2018-06-28 12:15:28 +00:00
|
|
|
'bip115',
|
2018-07-01 10:53:30 +00:00
|
|
|
'curve_name',
|
2016-11-09 13:52:43 +00:00
|
|
|
]
|
2016-10-20 14:40:46 +00:00
|
|
|
|
2018-05-28 15:43:29 +00:00
|
|
|
support = json.load(open('../../vendor/trezor-common/defs/support.json', 'r'))
|
|
|
|
coins = support['trezor2'].keys()
|
2016-10-20 14:40:46 +00:00
|
|
|
|
2016-11-11 17:11:37 +00:00
|
|
|
print('COINS = [')
|
2018-05-28 15:43:29 +00:00
|
|
|
|
2016-10-20 14:40:46 +00:00
|
|
|
for c in coins:
|
2018-05-24 13:18:05 +00:00
|
|
|
print(' CoinInfo(')
|
2018-05-28 15:43:29 +00:00
|
|
|
name = c.replace(' ', '_').lower()
|
|
|
|
if name == 'testnet':
|
|
|
|
name = 'bitcoin_testnet'
|
|
|
|
data = json.load(open('../../vendor/trezor-common/defs/coins/%s.json' % name, 'r'))
|
2016-11-09 13:52:43 +00:00
|
|
|
for n in fields:
|
2018-06-05 14:04:23 +00:00
|
|
|
if n in ['xpub_magic', 'version_group_id']:
|
|
|
|
v = '0x%08x' % data[n] if data[n] is not None else 'None'
|
2017-04-24 13:59:30 +00:00
|
|
|
else:
|
2018-06-05 14:04:23 +00:00
|
|
|
v = repr(data[n])
|
2018-07-01 10:53:30 +00:00
|
|
|
if n == 'curve_name':
|
|
|
|
v = v.replace('_', '-')
|
2018-06-05 14:04:23 +00:00
|
|
|
print(' %s=%s,' % (n, v))
|
2016-11-09 13:46:59 +00:00
|
|
|
print(' ),')
|
2018-05-28 15:43:29 +00:00
|
|
|
|
2018-05-28 10:18:54 +00:00
|
|
|
print(']')
|