Search in sources :

Example 1 with KeyChainGroup

use of org.bitcoinj.wallet.KeyChainGroup in project bitcoin-wallet by bitcoin-wallet.

the class SweepWalletFragment method askConfirmSweep.

private void askConfirmSweep(final ECKey key) {
    // create non-HD wallet
    final KeyChainGroup group = new KeyChainGroup(Constants.NETWORK_PARAMETERS);
    group.importKeys(key);
    walletToSweep = new Wallet(Constants.NETWORK_PARAMETERS, group);
    setState(State.CONFIRM_SWEEP);
    // delay until fragment is resumed
    handler.post(requestWalletBalanceRunnable);
}
Also used : Wallet(org.bitcoinj.wallet.Wallet) KeyChainGroup(org.bitcoinj.wallet.KeyChainGroup)

Example 2 with KeyChainGroup

use of org.bitcoinj.wallet.KeyChainGroup in project bitcoin-wallet by bitcoin-wallet.

the class WalletUtils method restorePrivateKeysFromBase58.

public static Wallet restorePrivateKeysFromBase58(final InputStream is, final NetworkParameters expectedNetworkParameters) throws IOException {
    final BufferedReader keyReader = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8));
    // create non-HD wallet
    final KeyChainGroup group = new KeyChainGroup(expectedNetworkParameters);
    group.importKeys(WalletUtils.readKeys(keyReader, expectedNetworkParameters));
    return new Wallet(expectedNetworkParameters, group);
}
Also used : InputStreamReader(java.io.InputStreamReader) Wallet(org.bitcoinj.wallet.Wallet) KeyChainGroup(org.bitcoinj.wallet.KeyChainGroup) BufferedReader(java.io.BufferedReader)

Aggregations

KeyChainGroup (org.bitcoinj.wallet.KeyChainGroup)2 Wallet (org.bitcoinj.wallet.Wallet)2 BufferedReader (java.io.BufferedReader)1 InputStreamReader (java.io.InputStreamReader)1