@Override public void completeAndSignTx(SendRequest request) throws WalletAccountException { if (request.isCompleted()) { signTransaction(request); } else { completeTransaction(request); } }
private static void applyWalletUpdates(Wallet wallet) { if (wallet.getVersion() < 2) { updateV1toV2(wallet); } if (wallet.getVersion() < 3) { updateV2toV3(wallet); } }
/** * Creates a deterministic key chain that watches the given (public only) root key. You can use this to calculate * balances and generally follow along, but spending is not possible with such a chain. Currently you can't use * this method to watch an arbitrary fragment of some other tree, this limitation may be removed in future. */ public SimpleHDKeyChain(DeterministicKey rootkey) { simpleKeyChain = new SimpleKeyChain(); initializeHierarchyUnencrypted(rootkey); }
public BitAddress getAddress(SimpleHDKeyChain.KeyPurpose purpose, boolean isManualAddressManagement) { BitAddress receiveAddress = null; if (isManualAddressManagement) { receiveAddress = getLastUsedAddress(purpose); } if (receiveAddress == null) { receiveAddress = currentAddress(purpose); } return receiveAddress; }
private void clearDataAndThrow(List<byte[]> bytes, String message) throws KeyFormatException { clearData(bytes); throw new KeyFormatException(message); }
@Override public void run() { registration.listener.onNewBlock(TransactionWatcherWallet.this); registration.listener.onWalletChanged(TransactionWatcherWallet.this); } });
@Override public void run() { if (wallet != null) wallet.saveLater(); } };
@Override public void run() { registration.listener.onNewBalance(balance); registration.listener.onWalletChanged(NxtFamilyWallet.this); } });
@Override public void run() { registration.listener.onConnectivityStatus(newConnectivity); registration.listener.onWalletChanged(TransactionWatcherWallet.this); } });
/** * Returns the key chain found in the given list of keys. Used for unencrypted chains */ public static SimpleHDKeyChain fromProtobuf(List<Protos.Key> keys) throws UnreadableWalletException { return fromProtobuf(keys, null); }
public WalletConnectivityStatus getConnectivityStatus() { if (!isConnected()) { return WalletConnectivityStatus.DISCONNECTED; } else { if (isLoading()) { return WalletConnectivityStatus.LOADING; } else { return WalletConnectivityStatus.CONNECTED; } } }
/** * Sends coins to the given address but does not broadcast the resulting pending transaction. */ public BitSendRequest sendCoinsOffline(BitAddress address, Value amount) throws WalletAccountException { return sendCoinsOffline(address, amount, (KeyParameter) null); }
@Override public void run() { registration.listener.onTransactionBroadcastFailure(TransactionWatcherWallet.this, tx); } });
private static void clearData(List<byte[]> bytes) { for (byte[] b : bytes) { clearData(b); } }
MockBlockchainConnection(CoinType coinType) throws Exception { this.coinType = coinType; statuses = getDummyStatuses(); historyTxs = getDummyHistoryTXs(); unspentTxs = getDummyUnspentTXs(); rawTxs = getDummyRawTXs(); }
private void clearDataAndThrow(byte[] bytes, String message) throws KeyFormatException { clearData(bytes); throw new KeyFormatException(message); }
@Override public void run() { registration.listener.onNewBlock(NxtFamilyWallet.this); registration.listener.onWalletChanged(NxtFamilyWallet.this); } });
@Override public void run() { if (wallet != null) wallet.saveLater(); } };
@Override public void run() { registration.listener.onNewBalance(balance); registration.listener.onWalletChanged(TransactionWatcherWallet.this); } });
@Override public void run() { registration.listener.onConnectivityStatus(connectivity); registration.listener.onWalletChanged(NxtFamilyWallet.this); } });