本文整理汇总了Java中org.bitcoinj.core.ECKey.toAddress方法的典型用法代码示例。如果您正苦于以下问题:Java ECKey.toAddress方法的具体用法?Java ECKey.toAddress怎么用?Java ECKey.toAddress使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bitcoinj.core.ECKey
的用法示例。
在下文中一共展示了ECKey.toAddress方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAddressesKeys
import org.bitcoinj.core.ECKey; //导入方法依赖的package包/类
/**
*
* @return
*/
@Override
public Map<String, String> getAddressesKeys() {
Map<String, String> addrKeysMap = new HashMap<>();
List<ECKey> allWalletKeys = _coin.getWalletManager().wallet().getImportedKeys();
allWalletKeys.addAll(_coin.getWalletManager().wallet().getIssuedReceiveKeys());
for (ECKey k : allWalletKeys) {
Address addr = k.toAddress(Constants.NETWORK_PARAMETERS);
String hash = WalletUtils.formatAddress(addr, Constants.ADDRESS_FORMAT_GROUP_SIZE, Constants.ADDRESS_FORMAT_LINE_SIZE).toString();
addrKeysMap.put(hash, k.getPrivateKeyAsHex());
}
return addrKeysMap;
}
示例2: updateFragments
import org.bitcoinj.core.ECKey; //导入方法依赖的package包/类
void updateFragments() {
final Wallet wallet = getWalletApplication().getWallet();
final List<ECKey> derivedKeys = wallet.getIssuedReceiveKeys();
Collections.sort(derivedKeys, DeterministicKey.CHILDNUM_ORDER);
final List<ECKey> randomKeys = wallet.getImportedKeys();
final ArrayList<Address> addresses = new ArrayList<Address>(derivedKeys.size() + randomKeys.size());
for (final ECKey key : Iterables.concat(derivedKeys, randomKeys)) {
final Address address = key.toAddress(Constants.NETWORK_PARAMETERS);
addresses.add(address);
}
sendingAddressesFragment.setWalletAddresses(addresses);
}
示例3: rowKey
import org.bitcoinj.core.ECKey; //导入方法依赖的package包/类
private View rowKey(final int position, View row) {
final ECKey key = (ECKey) getItem(position);
final Address address = key.toAddress(Constants.NETWORK_PARAMETERS);
final boolean isRotateKey = wallet.isKeyRotating(key);
if (row == null)
row = inflater.inflate(R.layout.address_book_row, null);
final TextView addressView = (TextView) row.findViewById(R.id.address_book_row_address);
addressView.setText(WalletUtils.formatAddress(address, Constants.ADDRESS_FORMAT_GROUP_SIZE,
Constants.ADDRESS_FORMAT_LINE_SIZE));
addressView.setTextColor(isRotateKey ? colorInsignificant : colorSignificant);
final TextView labelView = (TextView) row.findViewById(R.id.address_book_row_label);
final String label = AddressBookProvider.resolveLabel(context, address.toBase58());
if (label != null) {
labelView.setText(label);
labelView.setTextColor(isRotateKey ? colorInsignificant : colorLessSignificant);
} else {
labelView.setText(R.string.address_unlabeled);
labelView.setTextColor(colorInsignificant);
}
final TextView messageView = (TextView) row.findViewById(R.id.address_book_row_message);
messageView.setVisibility(isRotateKey ? View.VISIBLE : View.GONE);
return row;
}