texts_cli.py 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. """A module with all the display info for whallets-cli."""
  2. from tabulate import tabulate
  3. import whallets_cli as cli
  4. def welcome_message():
  5. """welcoming message to the cli"""
  6. msg = \
  7. "WELCOME TO WHALLETS CLI"\
  8. "\n ========================================= \n"
  9. return msg
  10. def _main_menu():
  11. """Displays the CLI main menu"""
  12. line_0 = ("**","Enter the number from the menu:")
  13. line = ("---","------------------------------",)
  14. line_1 = ("1 -","Add a wallet to the your list")
  15. line_2 = ("2 -","Remove a wallet from your list")
  16. line_3 = ("3 -","Display the list of wallets")
  17. line_4 = ("4 -","Display recent whale TXs on your EVM list")
  18. line_5 = ("5 -","Display recent whale TXs on your SPL list")
  19. table = [
  20. line_0,
  21. line,
  22. line_1,
  23. line_2,
  24. line_3,
  25. line_4,
  26. line_5,
  27. ]
  28. return table
  29. def _choose_chain():
  30. msg = \
  31. "\nPlease chose the network for the wallet address:"\
  32. "\n1 - EVM; Etherum main net and any forks (BSC, Poly..)"\
  33. "\n2 - SPL; Solana Program Platform"\
  34. "\n3 - BTC; Bitcoin"
  35. return msg
  36. def _prompt_address():
  37. """Ask or the wallet address"""
  38. msg = "\nEnter the wallet address:\n"
  39. return msg
  40. def _prompt_twitter():
  41. """Ask or the wallet address"""
  42. msg = "\nEnter the twitter link (full address):\n"
  43. return msg
  44. def _prompt_info():
  45. """Ask or the wallet address"""
  46. msg = "\nEnter short info about the user:\n"
  47. return msg
  48. def _prompt_name():
  49. """Ask or the wallet address"""
  50. msg = "\nEnter user/wallet name/tag:\n"
  51. return msg
  52. def _prompt_ens():
  53. """Ask or the wallet address"""
  54. msg = "\nEnter user's ENS:\n"
  55. return msg
  56. def _check_wallet_result(chain, name, addr, twtr, ens):
  57. """Messages informing about existing wallet"""
  58. ix = cli.check_wallet(chain, name, addr, twtr, ens)
  59. if ix < 4:
  60. items = ['name','address','twitter','ens']
  61. item = items[ix]
  62. msg = f"This {item} is already saved in the databse."
  63. else:
  64. msg = "New wallet was saved."
  65. return msg