/** * Returns the AVAILABLE balance of this wallet. See {@link BalanceType#AVAILABLE} for details on what this * means. */ public Coin getBalance() { return getBalance(BalanceType.AVAILABLE); }
/** * Returns the AVAILABLE balance of this wallet. See {@link BalanceType#AVAILABLE} for details on what this * means. */ public Coin getBalance() { return getBalance(BalanceType.AVAILABLE); }
/** * Returns the AVAILABLE balance of this wallet. See {@link BalanceType#AVAILABLE} for details on what this * means. */ public Coin getBalance() { return getBalance(BalanceType.AVAILABLE); }
/** * Returns the AVAILABLE balance of this wallet. See {@link BalanceType#AVAILABLE} for details on what this * means. */ public Coin getBalance() { return getBalance(BalanceType.AVAILABLE); }
/** @deprecated Use {@link #getBalance(CoinSelector)} instead as including watched balances is now the default behaviour */ @Deprecated public Coin getWatchedBalance(CoinSelector selector) { return getBalance(selector); }
/** @deprecated Use {@link #getBalance()} instead as including watched balances is now the default behaviour */ @Deprecated public Coin getWatchedBalance() { return getBalance(); }
/** @deprecated Use {@link #getBalance(CoinSelector)} instead as including watched balances is now the default behaviour */ @Deprecated public Coin getWatchedBalance(CoinSelector selector) { return getBalance(selector); }
/** @deprecated Use {@link #getBalance()} instead as including watched balances is now the default behaviour */ @Deprecated public Coin getWatchedBalance() { return getBalance(); }
/** @deprecated Use {@link #getBalance(CoinSelector)} instead as including watched balances is now the default behaviour */ @Deprecated public Coin getWatchedBalance(CoinSelector selector) { return getBalance(selector); }
/** @deprecated Use {@link #getBalance()} instead as including watched balances is now the default behaviour */ @Deprecated public Coin getWatchedBalance() { return getBalance(); }
/** @deprecated Use {@link #getBalance(CoinSelector)} instead as including watched balances is now the default behaviour */ @Deprecated public Coin getWatchedBalance(CoinSelector selector) { return getBalance(selector); }
/** @deprecated Use {@link #getBalance()} instead as including watched balances is now the default behaviour */ @Deprecated public Coin getWatchedBalance() { return getBalance(); }
@Override public void run() { Coin balance = wallet.getBalance(Wallet.BalanceType.ESTIMATED); mAddressText.setText(address.toString()); String balanceString = String.valueOf(balance.value / 100000) + " mBTC"; mBalanceText.setText(balanceString); BitmapDrawable bitmapDrawable = new BitmapDrawable(getResources(), bitmap); bitmapDrawable.setFilterBitmap(false); mQrImageView.setImageDrawable(bitmapDrawable); } });
static synchronized void onChange(final CountDownLatch latch) { saveWallet(walletFile); Coin balance = wallet.getBalance(Wallet.BalanceType.ESTIMATED); if (condition.matchBitcoins(balance)) { System.out.println(balance.toFriendlyString()); latch.countDown(); } }
@Override public void refresh() { String myAddress = walletAppKit.wallet().freshReceiveAddress().toBase58(); view.displayMyBalance(walletAppKit.wallet().getBalance().toFriendlyString()); view.displayMyAddress(myAddress); }
@Test public void reset() { sendMoneyToWallet(AbstractBlockChain.NewBlockType.BEST_CHAIN, COIN, myAddress); assertNotEquals(Coin.ZERO, wallet.getBalance(Wallet.BalanceType.ESTIMATED)); assertNotEquals(0, wallet.getTransactions(false).size()); assertNotEquals(0, wallet.getUnspents().size()); wallet.reset(); assertEquals(Coin.ZERO, wallet.getBalance(Wallet.BalanceType.ESTIMATED)); assertEquals(0, wallet.getTransactions(false).size()); assertEquals(0, wallet.getUnspents().size()); }
@Test(expected = InsufficientMoneyException.class) public void watchingScriptsConfirmed() throws Exception { Address watchedAddress = new ECKey().toAddress(PARAMS); wallet.addWatchedAddress(watchedAddress); sendMoneyToWallet(BlockChain.NewBlockType.BEST_CHAIN, CENT, watchedAddress); assertEquals(CENT, wallet.getBalance()); // We can't spend watched balances wallet.createSend(OTHER_ADDRESS, CENT); }
@Test public void receiveCoins() throws Exception { int height = 1; // Quick check that we can actually receive coins. Transaction tx1 = createFakeTx(PARAMS, COIN, wallet.currentReceiveKey().toAddress(PARAMS)); Block b1 = createFakeBlock(blockStore, height, tx1).block; chain.add(b1); assertTrue(wallet.getBalance().signum() > 0); }
@Test public void cleanup() throws Exception { Transaction t = cleanupCommon(OTHER_ADDRESS); // Consider the new pending as risky and remove it from the wallet wallet.setRiskAnalyzer(new TestRiskAnalysis.Analyzer(t)); wallet.cleanup(); assertTrue(wallet.isConsistent()); assertEquals("Wrong number of PENDING", 1, wallet.getPoolSize(WalletTransaction.Pool.PENDING)); assertEquals("Wrong number of UNSPENT", 0, wallet.getPoolSize(WalletTransaction.Pool.UNSPENT)); assertEquals("Wrong number of ALL", 2, wallet.getTransactions(true).size()); assertEquals(valueOf(0, 50), wallet.getBalance(Wallet.BalanceType.ESTIMATED)); }
@Test public void testRoundTripNormalWallet() throws Exception { Wallet wallet1 = roundTrip(myWallet); assertEquals(0, wallet1.getTransactions(true).size()); assertEquals(Coin.ZERO, wallet1.getBalance()); assertArrayEquals(myKey.getPubKey(), wallet1.findKeyFromPubHash(myKey.getPubKeyHash()).getPubKey()); assertArrayEquals(myKey.getPrivKeyBytes(), wallet1.findKeyFromPubHash(myKey.getPubKeyHash()).getPrivKeyBytes()); assertEquals(myKey.getCreationTimeSeconds(), wallet1.findKeyFromPubHash(myKey.getPubKeyHash()).getCreationTimeSeconds()); }