texts_cli.py 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 a 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. line_q = ("q -","Quit!")
  20. table = [
  21. line_0,
  22. line,
  23. line_1,
  24. line_2,
  25. line_3,
  26. line_4,
  27. line_5,
  28. ]
  29. return table
  30. def _choose_chain():
  31. msg = \
  32. "\nPlease chose the network for the wallet address:"\
  33. "\n1 - EVM; Etherum main net and any forks (BSC, Poly..)"\
  34. "\n2 - SPL; Solana Program Platform"\
  35. "\n3 - BTC; Bitcoin"
  36. return msg
  37. def _prompt_address():
  38. """Ask or the wallet address"""
  39. msg = "\nEnter the wallet address:\n"
  40. return msg
  41. def _prompt_twitter():
  42. """Ask or the wallet address"""
  43. msg = "\nEnter the twitter link (full address):\n"
  44. return msg
  45. def _prompt_info():
  46. """Ask or the wallet address"""
  47. msg = "\nEnter short info about the user:\n"
  48. return msg
  49. def _prompt_name():
  50. """Ask or the wallet address"""
  51. msg = "\nEnter user/wallet name/tag:\n"
  52. return msg
  53. def _prompt_ens():
  54. """Ask or the wallet address"""
  55. msg = "\nEnter user's ENS:\n"
  56. return msg
  57. def _check_wallet_result(chain, name, addr, twtr, ens):
  58. """Messages informing about existing wallet"""
  59. ix = cli.check_wallet(chain, name, addr, twtr, ens)
  60. if ix < 4:
  61. items = ['name','address','twitter','ens']
  62. item = items[ix]
  63. msg = f"This {item} is already saved in the databse."
  64. else:
  65. msg = "New wallet was saved."
  66. return msg