Java Code Examples for net.bither.bitherj.utils.Utils#validSplitBitCoinAddress()
The following examples show how to use
net.bither.bitherj.utils.Utils#validSplitBitCoinAddress() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SplitBCCSendActivity.java From bither-android with Apache License 2.0 | 6 votes |
protected void validateValues() { boolean isValidAmounts = false; btcAmount = getAmount(AbstractDb.txProvider.getUnspentOutputByBlockNo(splitCoin.getForkBlockHeight(), address.getAddress())); if (btcAmount > 0) { isValidAmounts = true; } toAddress = etAddress.getText().toString().trim(); boolean isValidAddress = Utils.validSplitBitCoinAddress(toAddress,splitCoin); boolean isValidPassword = true; if (etPassword.getVisibility() == View.VISIBLE) { SecureCharSequence password = new SecureCharSequence(etPassword.getText()); isValidPassword = Utils.validPassword(password) && password.length() >= 6 && password.length() <= getResources().getInteger(R.integer.password_length_max); password.wipe(); } btnSend.setEnabled(isValidAddress && isValidAmounts && isValidPassword); }
Example 2
Source File: SplitBCCHDAccountMonitoredSendActivity.java From bither-android with Apache License 2.0 | 6 votes |
@Override protected void validateValues() { boolean isValidAmounts = false; btcAmount = AddressManager.getInstance().getAmount(AbstractDb. hdAccountAddressProvider.getUnspentOutputByBlockNo(splitCoin.getForkBlockHeight(),AddressManager.getInstance() .getHDAccountMonitored().getHdSeedId())); if (btcAmount > 0) { isValidAmounts = true; } toAddress = etAddress.getText().toString().trim(); boolean isValidAddress = Utils.validSplitBitCoinAddress(toAddress,splitCoin); boolean isValidPassword = true; if (etPassword.getVisibility() == View.VISIBLE) { SecureCharSequence password = new SecureCharSequence(etPassword.getText()); isValidPassword = Utils.validPassword(password) && password.length() >= 6 && password.length() <= getResources().getInteger(R.integer.password_length_max); password.wipe(); } btnSend.setEnabled(isValidAddress && isValidAmounts && isValidPassword); }
Example 3
Source File: SplitBCCHDAccountSendActivity.java From bither-android with Apache License 2.0 | 6 votes |
@Override protected void validateValues() { boolean isValidAmounts = false; btcAmount = getAmount(AbstractDb.hdAccountAddressProvider.getUnspentOutputByBlockNo(splitCoin.getForkBlockHeight(), AddressManager.getInstance().getHDAccountHot().getHdSeedId())); if (btcAmount > 0) { isValidAmounts = true; } toAddress = etAddress.getText().toString().trim(); boolean isValidAddress = Utils.validSplitBitCoinAddress(toAddress,splitCoin); boolean isValidPassword = true; if (etPassword.getVisibility() == View.VISIBLE) { SecureCharSequence password = new SecureCharSequence(etPassword.getText()); isValidPassword = Utils.validPassword(password) && password.length() >= 6 && password.length() <= getResources().getInteger(R.integer.password_length_max); password.wipe(); } btnSend.setEnabled(isValidAddress && isValidAmounts && isValidPassword); }
Example 4
Source File: SplitBccColdWalletSendActivity.java From bither-android with Apache License 2.0 | 6 votes |
@Override protected void validateValues() { boolean isValidAmounts = false; btcAmount = getAmount(AbstractDb.txProvider.getUnspentOutputByBlockNo(splitCoin.getForkBlockHeight(), address.getAddress())); if (btcAmount > 0) { isValidAmounts = true; } toAddress = etAddress.getText().toString().trim(); boolean isValidAddress = Utils.validSplitBitCoinAddress(toAddress,splitCoin); boolean isValidPassword = true; if (etPassword.getVisibility() == View.VISIBLE) { SecureCharSequence password = new SecureCharSequence(etPassword.getText()); isValidPassword = Utils.validPassword(password) && password.length() >= 6 && password.length() <= getResources().getInteger(R.integer.password_length_max); password.wipe(); } btnSend.setEnabled(isValidAddress && isValidAmounts && isValidPassword); }
Example 5
Source File: InputParser.java From bither-android with Apache License 2.0 | 5 votes |
@Override public void parse() { if (input.startsWith("bitcoin:")) { try { final BitcoinURI bitcoinUri = new BitcoinURI(input); final String address = bitcoinUri.getAddress(); final String addressLabel = bitcoinUri.getLabel(); final long amount = bitcoinUri.getAmount(); final String bluetoothMac = (String) bitcoinUri.getParameterByName(Bluetooth .MAC_URI_PARAM); bitcoinRequest(address, addressLabel, amount, bluetoothMac); } catch (final BitcoinURI.BitcoinURIParseException x) { error(R.string.input_parser_invalid_bitcoin_uri, input); } } else if (PATTERN_BITCOIN_ADDRESS.matcher(input).matches() && splitCoin != null) { if (Utils.validSplitBitCoinAddress(input, splitCoin)) { bitcoinRequest(input, null, 0, null); } else { error(R.string.scan_watch_only_address_error); } } else if (PATTERN_BITCOIN_ADDRESS.matcher(input).matches()) { if (Utils.validBicoinAddress(input)) { bitcoinRequest(input, null, 0, null); } else { error(R.string.scan_watch_only_address_error); } } else if (input.toLowerCase().startsWith(BitcoinNewAddressPrefix) && Bech32.decode(input) != null) { if (isColdSendBtc) { error(R.string.cold_no_support_bc1_segwit_address); } else { bitcoinRequest(input.toLowerCase(), null, 0, null); } } else { error(R.string.scan_watch_only_address_error); } }