texts_cli.py 2.1 KB

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