mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-16 02:10:55 +00:00
defs: regenerate coins_details with new tokens
also make slight tweaks to existing coins_details.py, so that the following diff is prettier
This commit is contained in:
parent
105fbeb16d
commit
57021f9080
File diff suppressed because it is too large
Load Diff
@ -1 +1 @@
|
||||
Subproject commit 0b7f34d48de1376f39e10adbeb5a0191cdffd73c
|
||||
Subproject commit 56d9c3c9324e30d7f53eda7b8dc3cae76a4da143
|
@ -53,9 +53,11 @@ def coinmarketcap_info(shortcut):
|
||||
return coin
|
||||
|
||||
|
||||
def update_marketcap(obj, shortcut):
|
||||
def update_marketcap(obj, *shortcuts):
|
||||
for sym in shortcuts:
|
||||
try:
|
||||
obj['marketcap_usd'] = int(float(coinmarketcap_info(shortcut)['quotes']['USD']['market_cap']))
|
||||
obj['marketcap_usd'] = int(float(coinmarketcap_info(sym)['quotes']['USD']['market_cap']))
|
||||
return
|
||||
except:
|
||||
pass
|
||||
# print("Marketcap info not found for", shortcut)
|
||||
@ -133,6 +135,7 @@ def update_coins(details):
|
||||
set_default(out, 'links', {})
|
||||
set_default(out['links'], 'Homepage', coin['website'])
|
||||
set_default(out['links'], 'Github', coin['github'])
|
||||
set_default(out, 'wallet', {})
|
||||
update_marketcap(out, coin.get('coinmarketcap_alias', coin['coin_label']))
|
||||
|
||||
check_unsupported(details, 'coin:', supported)
|
||||
@ -181,12 +184,12 @@ def update_erc20(details):
|
||||
out['wallet']['MyCrypto'] = 'https://mycrypto.com'
|
||||
out['wallet']['MyEtherWallet'] = 'https://www.myetherwallet.com'
|
||||
|
||||
if t['website']:
|
||||
if t.get('website'):
|
||||
out['links']['Homepage'] = t['website']
|
||||
if t.get('social', {}).get('github', None):
|
||||
out['links']['Github'] = t['social']['github']
|
||||
|
||||
update_marketcap(out, out.get('coinmarketcap_alias', t['symbol']))
|
||||
update_marketcap(out, out.get('coinmarketcap_alias'), t['name'], t['symbol'])
|
||||
|
||||
check_unsupported(details, 'erc20:', supported)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user