txcreate_examples.py 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. help.txcreate_examples: txcreate and txdo help examples for the MMGen Wallet suite
  12. """
  13. from ..cfg import gc
  14. def help(proto, cfg):
  15. mmtype = 'B' if 'B' in proto.mmtypes else proto.mmtypes[0]
  16. from ..tool.coin import tool_cmd
  17. t = tool_cmd(cfg, mmtype=mmtype)
  18. addr = t.privhex2addr('bead' * 16)
  19. sample_addr = addr.views[addr.view_pref]
  20. return f"""
  21. EXAMPLES:
  22. Send 0.123 {proto.coin} to an external {proto.name} address, returning the change to a
  23. specific MMGen address in the tracking wallet:
  24. $ {gc.prog_name} {sample_addr},0.123 01ABCDEF:{mmtype}:7
  25. Same as above, but select the change address automatically:
  26. $ {gc.prog_name} {sample_addr},0.123 01ABCDEF:{mmtype}
  27. Same as above, but select the change address automatically by address type:
  28. $ {gc.prog_name} {sample_addr},0.123 {mmtype}
  29. Same as above, but reduce verbosity and specify fee of 20 satoshis
  30. per byte:
  31. $ {gc.prog_name} -q -f 20s {sample_addr},0.123 {mmtype}
  32. Send entire balance of selected inputs minus fee to an external {proto.name}
  33. address:
  34. $ {gc.prog_name} {sample_addr}
  35. Send entire balance of selected inputs minus fee to first unused wallet
  36. address of specified type:
  37. $ {gc.prog_name} {mmtype}
  38. """ if proto.base_proto == 'Bitcoin' else f"""
  39. EXAMPLES:
  40. Send 0.123 {proto.coin} to an external {proto.name} address:
  41. $ {gc.prog_name} {sample_addr},0.123
  42. Send 0.123 {proto.coin} to another account in wallet 01ABCDEF:
  43. $ {gc.prog_name} 01ABCDEF:{mmtype}:7,0.123
  44. """