mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-05-15 21:12:14 -04:00
add qr code support and payment url to wallet app
This commit is contained in:
parent
e2bf6ec652
commit
4358268d88
1 changed files with 20 additions and 5 deletions
|
@ -1,10 +1,12 @@
|
||||||
package io.bitsquare.gui.components.btc;
|
package io.bitsquare.gui.components.btc;
|
||||||
|
|
||||||
|
import com.google.bitcoin.core.Coin;
|
||||||
import com.google.bitcoin.uri.BitcoinURI;
|
import com.google.bitcoin.uri.BitcoinURI;
|
||||||
import de.jensd.fx.fontawesome.AwesomeDude;
|
import de.jensd.fx.fontawesome.AwesomeDude;
|
||||||
import de.jensd.fx.fontawesome.AwesomeIcon;
|
import de.jensd.fx.fontawesome.AwesomeIcon;
|
||||||
import io.bitsquare.BitSquare;
|
import io.bitsquare.BitSquare;
|
||||||
import io.bitsquare.gui.components.Popups;
|
import io.bitsquare.gui.components.Popups;
|
||||||
|
import io.bitsquare.gui.util.BitSquareFormatter;
|
||||||
import java.awt.Desktop;
|
import java.awt.Desktop;
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -32,6 +34,7 @@ public class AddressTextField extends AnchorPane
|
||||||
private final Label addressLabel;
|
private final Label addressLabel;
|
||||||
private final Label qrCode;
|
private final Label qrCode;
|
||||||
private String address;
|
private String address;
|
||||||
|
private String amountToPay;
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Constructor
|
// Constructor
|
||||||
|
@ -111,13 +114,9 @@ public class AddressTextField extends AnchorPane
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getBitcoinURI()
|
|
||||||
{
|
|
||||||
return BitcoinURI.convertToBitcoinURI(address, null, BitSquare.getAppName(), null);
|
|
||||||
}
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Setters
|
// Getters/Setters
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
public void setAddress(String address)
|
public void setAddress(String address)
|
||||||
|
@ -126,4 +125,20 @@ public class AddressTextField extends AnchorPane
|
||||||
addressLabel.setText(address);
|
addressLabel.setText(address);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setAmountToPay(String amountToPay)
|
||||||
|
{
|
||||||
|
this.amountToPay = amountToPay;
|
||||||
|
}
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Private
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
private String getBitcoinURI()
|
||||||
|
{
|
||||||
|
Coin d = BitSquareFormatter.parseToCoin(amountToPay);
|
||||||
|
return BitcoinURI.convertToBitcoinURI(address, BitSquareFormatter.parseToCoin(amountToPay), BitSquare.getAppName(), null);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue