texts_cli.py 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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_chain():
  48. msg = \
  49. "\nPlease chose the network for the wallet address:"\
  50. "\n1 - EVM; Etherum main net and any forks (BSC, Poly..)"\
  51. "\n2 - SPL; Solana Program Platform"\
  52. "\n3 - BTC; Bitcoin"
  53. return msg
  54. def _prompt_address():
  55. """Ask or the wallet address"""
  56. msg = "\nEnter the wallet address:\n"
  57. return msg
  58. def _prompt_twitter():
  59. """Ask or the wallet address"""
  60. msg = "\nEnter the twitter link (full address):\n"
  61. return msg
  62. def _prompt_info():
  63. """Ask or the wallet address"""
  64. msg = "\nEnter short info about the user:\n"
  65. return msg
  66. def _prompt_name():
  67. """Ask or the wallet address"""
  68. msg = "\nEnter user/wallet name/tag:\n"
  69. return msg
  70. def _prompt_ens():
  71. """Ask or the wallet address"""
  72. msg = "\nEnter user's ENS:\n"
  73. return msg
  74. def _check_wallet_result(chain, name, addr, twtr, ens):
  75. """Messages informing about existing wallet"""
  76. ix = cli.check_wallet(chain, name, addr, twtr, ens)
  77. if ix < 4:
  78. items = ['name','address','twitter','ens']
  79. item = items[ix]
  80. msg = f"This {item} is already saved in the databse."
  81. else:
  82. msg = "New wallet was saved."
  83. return msg