mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-29 00:31:02 +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,11 +53,13 @@ def coinmarketcap_info(shortcut):
|
|||||||
return coin
|
return coin
|
||||||
|
|
||||||
|
|
||||||
def update_marketcap(obj, shortcut):
|
def update_marketcap(obj, *shortcuts):
|
||||||
try:
|
for sym in shortcuts:
|
||||||
obj['marketcap_usd'] = int(float(coinmarketcap_info(shortcut)['quotes']['USD']['market_cap']))
|
try:
|
||||||
except:
|
obj['marketcap_usd'] = int(float(coinmarketcap_info(sym)['quotes']['USD']['market_cap']))
|
||||||
pass
|
return
|
||||||
|
except:
|
||||||
|
pass
|
||||||
# print("Marketcap info not found for", shortcut)
|
# print("Marketcap info not found for", shortcut)
|
||||||
|
|
||||||
|
|
||||||
@ -133,6 +135,7 @@ def update_coins(details):
|
|||||||
set_default(out, 'links', {})
|
set_default(out, 'links', {})
|
||||||
set_default(out['links'], 'Homepage', coin['website'])
|
set_default(out['links'], 'Homepage', coin['website'])
|
||||||
set_default(out['links'], 'Github', coin['github'])
|
set_default(out['links'], 'Github', coin['github'])
|
||||||
|
set_default(out, 'wallet', {})
|
||||||
update_marketcap(out, coin.get('coinmarketcap_alias', coin['coin_label']))
|
update_marketcap(out, coin.get('coinmarketcap_alias', coin['coin_label']))
|
||||||
|
|
||||||
check_unsupported(details, 'coin:', supported)
|
check_unsupported(details, 'coin:', supported)
|
||||||
@ -181,12 +184,12 @@ def update_erc20(details):
|
|||||||
out['wallet']['MyCrypto'] = 'https://mycrypto.com'
|
out['wallet']['MyCrypto'] = 'https://mycrypto.com'
|
||||||
out['wallet']['MyEtherWallet'] = 'https://www.myetherwallet.com'
|
out['wallet']['MyEtherWallet'] = 'https://www.myetherwallet.com'
|
||||||
|
|
||||||
if t['website']:
|
if t.get('website'):
|
||||||
out['links']['Homepage'] = t['website']
|
out['links']['Homepage'] = t['website']
|
||||||
if t.get('social', {}).get('github', None):
|
if t.get('social', {}).get('github', None):
|
||||||
out['links']['Github'] = t['social']['github']
|
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)
|
check_unsupported(details, 'erc20:', supported)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user