texts_cli.py 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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. "\n=========================================\n"\
  8. "WELCOME TO WHALLETS CLI"\
  9. "\n========================================="
  10. return msg
  11. def _main_menu():
  12. """Displays the CLI main menu"""
  13. line_0 = ("**","Chose an operation from the menu:")
  14. line = ("---","---------------------------------",)
  15. line_1 = ("1 -","Add a wallet to the your list")
  16. line_2 = ("2 -","Remove a wallet from your list")
  17. line_3 = ("3 -","Display your wallet list")
  18. line_4 = ("4 -","Display recent whale TXs on your EVM list")
  19. line_5 = ("5 -","Display recent whale TXs on your SPL list")
  20. line_q = ("q -","Quit!")
  21. table = [
  22. line_0,
  23. line,
  24. line_1,
  25. line_2,
  26. line_3,
  27. line_4,
  28. line_5,
  29. line_q
  30. ]
  31. return table
  32. def _menu_choice():
  33. """Sentence asking user for the next step"""
  34. msg = "\nEnter number and press Enter: "
  35. return msg
  36. def _missing_operation():
  37. """Inform about non-existing users choice"""
  38. msg = "Sorry, but you had either choosen an unexisting option, "\
  39. "or this operation has not been developped yet."
  40. return msg
  41. def _ask_new_choice():
  42. """Message offering a new choice or quit"""
  43. msg = \
  44. "\n\n=========================================\n"\
  45. "Do you have another choice?\n1 - YES\n2 - NO (quit)\n"
  46. return msg
  47. def _choose_network():
  48. """Gives a choice of networks to work with"""
  49. line_0 = ("\nPlease chose the network for the wallet address:",)
  50. line_1 = ("1 -","EVM; Etherum main net and any forks (BSC, Poly..)")
  51. line_2 = ("2 -","SPL; Solana Program Platform")
  52. line_3 = ("3 -","BTC; Bitcoin")
  53. table = [ line_0, line_1, line_2, line_3]
  54. return table
  55. def _prompt_address():
  56. """Ask or the wallet address"""
  57. msg = "\nEnter the wallet address:\n"
  58. return msg
  59. def _prompt_twitter():
  60. """Ask or the wallet address"""
  61. msg = "\nEnter the twitter link (full address):\n"
  62. return msg
  63. def _prompt_info():
  64. """Ask or the wallet address"""
  65. msg = "\nEnter short info about the user:\n"
  66. return msg
  67. def _prompt_name():
  68. """Ask or the wallet address"""
  69. msg = "\nEnter user/wallet name/tag:\n"
  70. return msg
  71. def _prompt_ens():
  72. """Ask or the wallet address"""
  73. msg = "\nEnter user's ENS:\n"
  74. return msg
  75. def _check_wallet_result(chain, name, addr, twtr, ens):
  76. """Messages informing about existing wallet"""
  77. ix = cli.check_wallet(chain, name, addr, twtr, ens)
  78. if ix < 4:
  79. items = ['name','address','twitter','ens']
  80. item = items[ix]
  81. msg = f"This {item} is already saved in the databse."
  82. else:
  83. msg = "New wallet was saved."
  84. return msg