use of org.bitcoinj.core.PrefixedChecksummedBytes in project bitcoin-wallet by bitcoin-wallet.
the class SendCoinsFragment method initStateFromBitcoinUri.
private void initStateFromBitcoinUri(final Uri bitcoinUri) {
final String input = bitcoinUri.toString();
new StringInputParser(input) {
@Override
protected void handlePaymentIntent(final PaymentIntent paymentIntent) {
updateStateFrom(paymentIntent);
}
@Override
protected void handlePrivateKey(final PrefixedChecksummedBytes key) {
throw new UnsupportedOperationException();
}
@Override
protected void handleDirectTransaction(final Transaction transaction) throws VerificationException {
throw new UnsupportedOperationException();
}
@Override
protected void error(final int messageResId, final Object... messageArgs) {
final DialogBuilder dialog = DialogBuilder.dialog(activity, 0, messageResId, messageArgs);
dialog.singleDismissButton(activityDismissListener);
dialog.show();
}
}.parse();
}
use of org.bitcoinj.core.PrefixedChecksummedBytes in project bitcoin-wallet by bitcoin-wallet.
the class SweepWalletFragment method onActivityResult.
@Override
public void onActivityResult(final int requestCode, final int resultCode, final Intent intent) {
if (requestCode == REQUEST_CODE_SCAN) {
if (resultCode == Activity.RESULT_OK) {
final String input = intent.getStringExtra(ScanActivity.INTENT_EXTRA_RESULT);
new StringInputParser(input) {
@Override
protected void handlePrivateKey(final PrefixedChecksummedBytes key) {
viewModel.privateKeyToSweep.setValue(key);
setState(SweepWalletViewModel.State.DECODE_KEY);
maybeDecodeKey();
}
@Override
protected void handlePaymentIntent(final PaymentIntent paymentIntent) {
cannotClassify(input);
}
@Override
protected void handleDirectTransaction(final Transaction transaction) throws VerificationException {
cannotClassify(input);
}
@Override
protected void error(final int messageResId, final Object... messageArgs) {
viewModel.showDialog.setValue(DialogEvent.dialog(R.string.button_scan, messageResId, messageArgs));
}
}.parse();
}
}
}
Aggregations