diff options
author | jeffro256 <jeffro256@tutanota.com> | 2023-05-14 11:41:59 -0500 |
---|---|---|
committer | jeffro256 <jeffro256@tutanota.com> | 2024-02-20 17:08:06 -0600 |
commit | b13c5f6669f9612bef7cba18be7189bf6dfa6e61 (patch) | |
tree | 12e25936d4682f5c783dffddce0c7e32361a0d41 /utils/python-rpc | |
parent | Merge pull request #9126 (diff) | |
download | monero-b13c5f6669f9612bef7cba18be7189bf6dfa6e61.tar.xz |
wallet: feature: transfer amount with fee included
To transfer ~5 XMR to an address such that your balance drops by exactly 5 XMR, provide a `subtractfeefrom` flag to the `transfer` command. For example:
transfer 76bDHojqFYiFCCYYtzTveJ8oFtmpNp3X1TgV2oKP7rHmZyFK1RvyE4r8vsJzf7SyNohMnbKT9wbcD3XUTgsZLX8LU5JBCfm 5 subtractfeefrom=all
If my walet balance was exactly 30 XMR before this transaction, it will be exactly 25 XMR afterwards and the destination address will receive slightly
less than 5 XMR. You can manually select which destinations fund the transaction fee and which ones do not by providing the destination index.
For example:
transfer 75sr8AAr... 3 74M7W4eg... 4 7AbWqDZ6... 5 subtractfeefrom=0,2
This will drop your balance by exactly 12 XMR including fees and will spread the fee cost proportionally (3:5 ratio) over destinations with addresses
`75sr8AAr...` and `7AbWqDZ6...`, respectively.
Disclaimer: This feature was paid for by @LocalMonero.
Diffstat (limited to 'utils/python-rpc')
-rw-r--r-- | utils/python-rpc/framework/wallet.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/utils/python-rpc/framework/wallet.py b/utils/python-rpc/framework/wallet.py index 1c42f7f04..18af4edc4 100644 --- a/utils/python-rpc/framework/wallet.py +++ b/utils/python-rpc/framework/wallet.py @@ -38,13 +38,14 @@ class Wallet(object): self.port = port self.rpc = JSONRPC('{protocol}://{host}:{port}'.format(protocol=protocol, host=host, port=port if port else 18090+idx)) - def transfer(self, destinations, account_index = 0, subaddr_indices = [], priority = 0, ring_size = 0, unlock_time = 0, payment_id = '', get_tx_key = True, do_not_relay = False, get_tx_hex = False, get_tx_metadata = False): + def transfer(self, destinations, account_index = 0, subaddr_indices = [], priority = 0, ring_size = 0, unlock_time = 0, payment_id = '', get_tx_key = True, do_not_relay = False, get_tx_hex = False, get_tx_metadata = False, subtract_fee_from_outputs = []): transfer = { 'method': 'transfer', 'params': { 'destinations': destinations, 'account_index': account_index, 'subaddr_indices': subaddr_indices, + 'subtract_fee_from_outputs': subtract_fee_from_outputs, 'priority': priority, 'ring_size' : ring_size, 'unlock_time' : unlock_time, |