diff --git a/src/main/java/com/sparrowwallet/drongo/uri/BitcoinURI.java b/src/main/java/com/sparrowwallet/drongo/uri/BitcoinURI.java index 68d5aa6..055ece0 100644 --- a/src/main/java/com/sparrowwallet/drongo/uri/BitcoinURI.java +++ b/src/main/java/com/sparrowwallet/drongo/uri/BitcoinURI.java @@ -2,6 +2,7 @@ package com.sparrowwallet.drongo.uri; import com.sparrowwallet.drongo.address.Address; import com.sparrowwallet.drongo.address.InvalidAddressException; +import com.sparrowwallet.drongo.wallet.Payment; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -325,6 +326,11 @@ public class BitcoinURI { return builder.toString(); } + public Payment toPayment() { + long amount = getAmount() == null ? -1 : getAmount(); + return new Payment(getAddress(), getLabel(), amount, false); + } + /** * Constructs a new BitcoinURI from the given address. *