texts_cli.py 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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 = ("**","Chose an operation 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 _menu_choice():
  32. """Sentence asking user for the next step"""
  33. msg = "\nEnter number and press Enter:"
  34. return msg
  35. def _missing_operation():
  36. """Inform about non-existing users choice"""
  37. msg = "Sorry, but you had either choosen an unexisting option, "\
  38. "or this operation has not been developped yet."
  39. return msg
  40. def _ask_new_choice():
  41. """Message offering a new choice or quit"""
  42. msg = "Do you have another choice?\n1 - YES\n2 - NO (quit)"
  43. return msg
  44. def _choose_chain():
  45. msg = \
  46. "\nPlease chose the network for the wallet address:"\
  47. "\n1 - EVM; Etherum main net and any forks (BSC, Poly..)"\
  48. "\n2 - SPL; Solana Program Platform"\
  49. "\n3 - BTC; Bitcoin"
  50. return msg
  51. def _prompt_address():
  52. """Ask or the wallet address"""
  53. msg = "\nEnter the wallet address:\n"
  54. return msg
  55. def _prompt_twitter():
  56. """Ask or the wallet address"""
  57. msg = "\nEnter the twitter link (full address):\n"
  58. return msg
  59. def _prompt_info():
  60. """Ask or the wallet address"""
  61. msg = "\nEnter short info about the user:\n"
  62. return msg
  63. def _prompt_name():
  64. """Ask or the wallet address"""
  65. msg = "\nEnter user/wallet name/tag:\n"
  66. return msg
  67. def _prompt_ens():
  68. """Ask or the wallet address"""
  69. msg = "\nEnter user's ENS:\n"
  70. return msg
  71. def _check_wallet_result(chain, name, addr, twtr, ens):
  72. """Messages informing about existing wallet"""
  73. ix = cli.check_wallet(chain, name, addr, twtr, ens)
  74. if ix < 4:
  75. items = ['name','address','twitter','ens']
  76. item = items[ix]
  77. msg = f"This {item} is already saved in the databse."
  78. else:
  79. msg = "New wallet was saved."
  80. return msg