view.py 935 B

12345678910111213141516171819202122232425262728293031
  1. #!/usr/bin/env python3
  2. #
  3. # mmgen = Multi-Mode GENerator, a command-line cryptocurrency wallet
  4. # Copyright (C)2013-2023 The MMGen Project <mmgen@tuta.io>
  5. # Licensed under the GNU General Public License, Version 3:
  6. # https://www.gnu.org/licenses
  7. # Public project repositories:
  8. # https://github.com/mmgen/mmgen
  9. # https://gitlab.com/mmgen/mmgen
  10. """
  11. proto.eth.tw.view: Ethereum base protocol base class for tracking wallet view classes
  12. """
  13. from ....globalvars import g
  14. from ....tw.view import TwView
  15. class EthereumTwView(TwView):
  16. def age_disp(self,o,age_fmt): # TODO
  17. pass
  18. def get_disp_prec(self,wide):
  19. return self.proto.coin_amt.max_prec if wide else 8
  20. def gen_subheader(self,cw,color):
  21. if self.disp_prec == 8:
  22. yield 'Balances truncated to 8 decimal points'
  23. if g.cached_balances:
  24. from ....color import nocolor,yellow
  25. yield (nocolor,yellow)[color]('WARNING: Using cached balances. These may be out of date!')