Skip to content

Instantly share code, notes, and snippets.

@smk762
Last active October 18, 2021 12:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smk762/9fba27654f6da105c72f9a67d31b0d89 to your computer and use it in GitHub Desktop.
Save smk762/9fba27654f6da105c72f9a67d31b0d89 to your computer and use it in GitHub Desktop.
AtomicDEX-Desktop Supported Coins Report
#!/usr/bin/env python3
import sys
import csv
import requests
VERSION = "0.5.2"
BRANCH = "master"
protocols = []
wallet_only = 0
if len(sys.argv) > 1:
VERSION = sys.argv[1]
if len(sys.argv) > 2:
BRANCH = sys.argv[2]
r = requests.get(f"https://raw.githubusercontent.com/KomodoPlatform/atomicDEX-Desktop/{BRANCH}/assets/config/{VERSION}-coins.json")
resp = r.json()
ordered_coins = list(resp.keys())
ordered_coins.sort()
output_filename = f"atomicdex_desktop_{VERSION}_{BRANCH}_coins_report.csv"
with open(output_filename, 'w', newline='') as file:
writer = csv.writer(file)
headers = ["Ticker", "Name", "Protocol", "Trading enabled"]
# print(",".join(headers))
writer.writerow(headers)
for coin in ordered_coins:
tradable = "tradable"
if "wallet_only" in resp[coin]:
if resp[coin]["wallet_only"]:
tradable = "wallet only"
wallet_only += 1
row = [resp[coin]["coin"], resp[coin]["name"], resp[coin]["type"], tradable]
# print(",".join(row))
writer.writerow(row)
if resp[coin]["type"] not in protocols:
protocols.append(resp[coin]["type"])
print("------------------------------")
print(f"AtomicDEX-Desktop v{VERSION} ({BRANCH} branch)")
print(f"Wallet coins count: {len(ordered_coins)} (multiprotocol coins count as one for each protocol)")
print(f"Tradable coins count: {len(ordered_coins)-wallet_only} (multiprotocol coins count as one for each protocol)")
print(f"Protocols: {protocols}")
print(f"CSV file output to: {output_filename}")
print("------------------------------")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment