dump.py 914 B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/usr/bin/env python3
  2. #
  3. # MMGen Wallet, a terminal-based cryptocurrency wallet
  4. # Copyright (C)2013-2025 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-wallet
  9. # https://gitlab.com/mmgen/mmgen-wallet
  10. """
  11. xmrwallet.ops.dump: Monero wallet ops for the MMGen Suite
  12. """
  13. from ...util import msg
  14. from ..file.outputs import MoneroWalletDumpFile
  15. from ..rpc import MoneroWalletRPC
  16. from .wallet import OpWallet
  17. class OpDump(OpWallet):
  18. wallet_offline = True
  19. async def process_wallet(self, d, fn, last):
  20. h = MoneroWalletRPC(self, d)
  21. h.open_wallet('source')
  22. wallet_data = h.get_wallet_data(print=False)
  23. msg('')
  24. MoneroWalletDumpFile.New(
  25. parent = self,
  26. wallet_fn = fn,
  27. data = {'wallet_metadata': wallet_data.addrs_data}
  28. ).write()
  29. return True