Search in sources :

Example 1 with AddressConfidenceListener

use of io.bitsquare.btc.listeners.AddressConfidenceListener in project bitsquare by bitsquare.

the class BalanceWithConfirmationTextField method setup.

public void setup(Address address, BSFormatter formatter) {
    this.formatter = formatter;
    confidenceListener = new AddressConfidenceListener(address) {

        @Override
        public void onTransactionConfidenceChanged(TransactionConfidence confidence) {
            updateConfidence(confidence);
        }
    };
    walletService.addAddressConfidenceListener(confidenceListener);
    updateConfidence(walletService.getConfidenceForAddress(address));
    balanceListener = new BalanceListener(address) {

        @Override
        public void onBalanceChanged(Coin balance, Transaction tx) {
            updateBalance(balance);
        }
    };
    walletService.addBalanceListener(balanceListener);
    updateBalance(walletService.getBalanceForAddress(address));
}
Also used : Coin(org.bitcoinj.core.Coin) AddressConfidenceListener(io.bitsquare.btc.listeners.AddressConfidenceListener) BalanceListener(io.bitsquare.btc.listeners.BalanceListener) Transaction(org.bitcoinj.core.Transaction) TransactionConfidence(org.bitcoinj.core.TransactionConfidence)

Aggregations

AddressConfidenceListener (io.bitsquare.btc.listeners.AddressConfidenceListener)1 BalanceListener (io.bitsquare.btc.listeners.BalanceListener)1 Coin (org.bitcoinj.core.Coin)1 Transaction (org.bitcoinj.core.Transaction)1 TransactionConfidence (org.bitcoinj.core.TransactionConfidence)1