wallets.py 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. """Functions automatizing the monitoring of whale wallets"""
  2. #TODO:
  3. # 1) A program automatizing the dictionary compiling with a given wallet or ens
  4. # Using blockscan etc
  5. # 2) A program scanning through the given block explorers and scraping useful
  6. # data about the wallet actions based on the given parameters of time, amount etc
  7. # 3) A program exporting the data from #2 into a spread sheet and plotting graph
  8. import json
  9. def display_wallets(chain):
  10. """Displays the wallets according the given chain"""
  11. # Chains available 'evm','spl'
  12. # evm shows all the forks
  13. i = _chain_index(chain)
  14. dict = _get_wallets()[i]
  15. print(f"\n\n{chain.upper()} WALLETS:")
  16. for key, value in dict.items():
  17. user = key
  18. wallets = value['wallets']
  19. info = value['info']
  20. twitter = value['twitter']
  21. chains = []
  22. for key, value in wallets.items():
  23. chains.append(key)
  24. print(f"\nUser: {user}")
  25. print(f"Info: {info}")
  26. print(f"Twitter: {twitter}")
  27. print(f"Wallet address: {value}")
  28. print(f"Active networks: {chains}")
  29. def _get_wallets():
  30. ''' Gets the info from the dictionary '''
  31. filename = 'wallets_dict.json'
  32. with open(filename) as f:
  33. all_wallets = json.load(f)
  34. evm_wallets = all_wallets['evm_wallets']
  35. spl_wallets = all_wallets['spl_wallets']
  36. return evm_wallets, spl_wallets
  37. def _chain_index(chain):
  38. '''Asigns an index based on given parameter of the chain'''
  39. if chain.lower() == 'evm':
  40. i = 0
  41. elif chain.lower() == 'spl':
  42. i = 1
  43. return i
  44. def display_all_wallets():
  45. display_wallets('evm')
  46. display_wallets('spl')
  47. display_all_wallets()