Browse Source

Merge JoinMarket-Org/joinmarket-clientserver#1316: Allow `bitcoin:` prefix for addresses with `sendpayment.py`

83c6bc053a Allow bitcoin: prefix for addresses with sendpayment.py (Kristaps Kaupe)

Pull request description:

  Before this change there were two ways of using `sendpayment.py` - you could either specify amount as a first argument and destination address as a second argument or just provide BIP21 URI. This allows to also specify amount as a first argument and BIP21 URI as a second argument, unless it contains amount. Useful, because a lots of wallets (in my case it was Blue Wallet) will give you BIP21 URI instead of pure Bitcoin address when using "Receive" even if you don't specify amount. And when you double click that URI, it will select all of it, not just address. So, basically, this allows to just paste adress with `bitcoin:` prefix too. Was already possible with Qt GUI after BIP21 / BIP78 payjoin functionality was added.

Top commit has no ACKs.

Tree-SHA512: c463a90eb99855fe4bb8f4646318bf1feb0c5b90027328d8e61b52fdb5ec9b3cf106be5b0bec520ca8c46d733b7dd0ad9a2565d7a0a37c6609e4e9f30d7be3ef
master
Kristaps Kaupe 3 years ago
parent
commit
23dd98c2ef
No known key found for this signature in database
GPG Key ID: 33E472FE870C7E5D
  1. 6
      scripts/sendpayment.py

6
scripts/sendpayment.py

@ -96,6 +96,12 @@ def main():
sweeping = True
destaddr = args[2]
mixdepth = options.mixdepth
if btc.is_bip21_uri(args[2]):
parsed = btc.decode_bip21_uri(args[2])
if 'amount' in parsed:
parser.error("Specify amount as a separate argument or amount in BIP21 URI, not both.")
sys.exit(EXIT_ARGERROR)
destaddr = parsed['address']
addr_valid, errormsg = validate_address(destaddr)
command_to_burn = (is_burn_destination(destaddr) and sweeping and
options.makercount == 0)

Loading…
Cancel
Save