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
- 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
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
- 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
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.