defs: regenerate coins_details with new tokens

also make slight tweaks to existing coins_details.py, so that the
following diff is prettier
pull/41/head
matejcik 6 years ago
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
def update_marketcap(obj, shortcut):
try:
obj['marketcap_usd'] = int(float(coinmarketcap_info(shortcut)['quotes']['USD']['market_cap']))
except:
pass
def update_marketcap(obj, *shortcuts):
for sym in shortcuts:
try:
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…
Cancel
Save