Commit graph

54 commits

Author SHA1 Message Date
b99ef94b60
autosign.py -> autosign/__init__.py 2026-05-08 13:34:25 +00:00
09e70c4bf3
whitespace (82 files) 2025-10-06 09:40:47 +00:00
a7f0629eba
proto.rune.params: new rpc_swap_params attribute 2025-06-15 09:17:02 +00:00
7cfa87ba6a
class HTTPClient: proto -> network_proto 2025-06-10 17:47:03 +00:00
aaaccc6bad
swaptxcreate: add --router-gas option; proto.eth.tx: new total_gas attr 2025-05-07 18:24:07 +00:00
ff28d39a3c
THORChain ERC20 token swap support
Examples:

    # List available assets:
    $ mmgen-swaptxcreate -S

    # Create a Tether-to-LTC swap transaction for autosigning, connecting to the
    # swap quote server via Tor:
    $ mmgen-swaptxcreate --autosign --proxy=localhost:9050 ETH.USDT 1000 LTC

    # After signing, send the transaction via public Etherscan proxy over Tor:
    $ mmgen-txsend --autosign --quiet --tx-proxy=etherscan --proxy=localhost:9050

    # After sending, check the transaction status and receipt:
    $ mmgen-txsend --autosign --verbose --status

    # Create a Tether-to-DAI swap transaction, with explicit destination account:
    $ mmgen-swaptxcreate ETH.USDT 1000 ETH.DAI E:01234ABC:3

Testing:

    $ test/cmdtest.py -e ethswap
2025-04-27 11:53:49 +00:00
67ef5d3987
mmgen-swaptxcreate: new --list-assets option; related cleanups 2025-04-26 10:38:55 +00:00
38ea93a51f
tx.new_swap: swap to ERC20 token support 2025-04-21 14:01:16 +00:00
1eb0de7938
ETH: transaction sending via Etherscan
- the HTML transaction broadcast form is used, so no API key is required
- the request can be proxied through Tor
- availability of the service can be checked with the --test option

Example:

    # check availability:
    $ mmgen-txsend --autosign --coin=eth --tx-proxy=etherscan --proxy=localhost:9050 --test

    # send:
    $ mmgen-txsend --autosign --coin=eth --tx-proxy=etherscan --proxy=localhost:9050

Testing:

    $ test/cmdtest.py --coin=eth -e -X txsend_etherscan ethdev
2025-03-15 18:24:54 +00:00
70022b04b2
use keyword-only parameters where practicable (103 files changed) 2025-03-15 18:24:52 +00:00
2f65a75f7e
swap: Midgard -> Thornode 2025-03-10 14:28:50 +00:00
85cec5655d
THORChain DEX integration
Cross-chain native asset swaps directly from MMGen Wallet!

Currently supported coins: BTC, LTC, BCH.  Work on ETH support is underway.

All supported asset pairs have undergone thorough testing on mainnet.

Sample workflow for a BTC->LTC swap (assumes offline autosigning is set up and
the removable device inserted on the online machine):

    $ mmgen-swaptxcreate --autosign BTC LTC

    remove device - insert - wait for signing - remove - insert

    $ mmgen-txsend --autosign

Note that other command-line options and arguments will likely be required. For
further information, see:

    $ mmgen-swaptxcreate --help

Be aware that transactions stuck for a long time in the mempool can potentially
lead to loss of funds, so users should first learn how to create replacement
transactions with ‘mmgen-txbump’ before attempting a swap.  In all cases, it’s
advisable to begin with small amounts.  Double-checking the vault address on a
block explorer such as thorchain.net or runescan.io before sending the
transaction is also recommended.

Testing:

    $ test/modtest.py tx.memo
    $ test/cmdtest.py regtest_legacy.main autosign_automount swap
2025-02-24 11:27:49 +00:00
40de553ea5
tx.new: add hooks for multi-proto support 2025-02-15 09:54:19 +00:00
487678bce9
Use Ruff static code analyzer for Github workflows 2024-12-30 13:59:03 +00:00
ce14c1ba79
whitespace: test/overlay 2024-10-18 10:32:13 +00:00
50fc415282
CoinAmt: improvements
- do strict type checking in initializer, forbid double initialization
- add dynamic decimal precision based on protocol
- dunder method fixes, cleanups
- JSON-RPC library now returns floats (i.e. amounts) as strings instead of Decimal,
  eliminating an extra conversion step
2024-10-18 10:32:05 +00:00
4a3c393c24
Autosign: run blkid as user 2024-09-06 12:20:19 +00:00
a9e6f0a79b
autosign [Linux]: use blkid to test for device insertion 2024-09-02 09:43:48 +00:00
a24eed0826
macOS: support autosign/automount for BTC
Testing:

    $ test/cmdtest.py autosign_clean autosign_automount autosign_btc
2024-08-26 14:44:09 +00:00
ca343e2097
autosign, test suite autosign: cleanups 2024-08-26 13:47:02 +00:00
03e392c158
minor cleanups, deterministic testing improvements 2024-03-08 14:13:22 +00:00
ea4dd0a074
autosign: use fakemod for test cfg initialization 2024-02-22 12:48:42 +00:00
66f318b4ef
use relative imports wherever possible 2023-11-08 08:11:28 +00:00
f2bf16bbdb
minor fixes and cleanups 2023-10-13 09:51:13 +00:00
775e596dda
pylint (test suite) - unused variables 2023-10-11 12:58:52 +00:00
7b32c412d5
pylint (test suite) - imports 2023-10-11 12:58:51 +00:00
01430166e5
whitespace, comments, docstrings (test suite) 2023-10-11 12:58:51 +00:00
cd0d2e4ab3
crypto.py: deterministic testing fix 2023-05-23 12:12:32 +00:00
c7adb56e38
Config API, Part I
This patch eliminates the global configuration variables `opt` and `g`, making
all functions and class instances locally configurable.  Configuration data is
passed to functions and constructors via the `cfg` parameter and made available
to methods in `self.cfg`.

Local configuration free from dependence on the command line will enable the
creation of multiple, independently configured instances of MMGen’s data
objects within a single process.

Potential applications include testing (tracking wallets configured to interact
with spawned processes, for example) and the use of MMGen as a library for
other projects.

This patch completes most of the work required to enable the API.  The full
implementation will appear in a forthcoming commit.
2023-03-28 18:14:37 +00:00
78e882143c
whitespace, cleanups, imports throughout [73 files changed] 2023-03-27 10:49:04 +00:00
2ac746f1ed
tw.view.action: remove post_view() method 2022-12-09 13:16:09 +00:00
3e76617650
tw.view: create fake versions of CUR_* vars in overlay 2022-12-08 15:14:00 +00:00
20d35ea637
minor fixes 2022-11-16 17:56:05 +00:00
68caeb3130
mmgen-txcreate: warn user if change address is a used address 2022-11-16 17:56:04 +00:00
14fb60bc67
tracking wallet: TwCommon -> TwView 2022-11-12 13:34:34 +00:00
b21864fd08
mmgen.tw.{ctl,common,txhistory,unspent}: cleanups 2022-11-09 13:05:09 +00:00
5d3ed7d976
mmgen.tw.common: new format(), header(), subheader() methods 2022-11-09 13:05:09 +00:00
2b026f1ae7
mmgen.tw.{common,addrs,txhistory,unspent}: cleanups 2022-11-09 13:05:08 +00:00
23214cf9bb
test suite: deterministic testing fixes 2022-10-31 15:42:10 +00:00
7d2531b7b3
test.overlay: fake module cleanups
1) attempt to add as few names to the module's namespace as possible
2) all names added to the namespace must begin with 'overlay_fake_'
2022-10-24 16:50:05 +00:00
b6f58af8c3
test.overlay: support multiple repositories/packages 2022-10-24 16:50:05 +00:00
f06e48ec27
base_proto.bitcoin -> proto.btc, ... [git mv] 2022-10-03 10:00:00 +00:00
15f4e1405f
minor changes and fixes 2022-05-28 19:41:43 +00:00
1c0c1e4552
tw/unspent.py: variable and method renames 2022-05-23 16:28:51 +00:00
0fef35f567
move tracking wallet modules to tw and base_proto/{name}/tw 2022-02-10 12:51:41 +00:00
1fb022d151
finish modularization of tracking wallet classes
- protocol-independent base classes remain in `tw*.py`
- protocol-dependent subclasses are in `base_proto/{name}/tw*.py`
2022-02-06 13:28:45 +00:00
71d7986391
minor fixes and cleanups 2022-02-06 13:28:44 +00:00
d6872ddb87
fixes and cleanups throughout 2022-02-03 20:40:42 +00:00
5d6e79783f
test overlay fixes 2022-01-22 14:26:12 +00:00
4819c97f8a
util.py: move file utilities to fileutil.py 2022-01-21 11:23:46 +00:00