本文整理汇总了Java中org.bitcoinj.core.Coin.toPlainString方法的典型用法代码示例。如果您正苦于以下问题:Java Coin.toPlainString方法的具体用法?Java Coin.toPlainString怎么用?Java Coin.toPlainString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bitcoinj.core.Coin
的用法示例。
在下文中一共展示了Coin.toPlainString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getBalanceFriendlyStr
import org.bitcoinj.core.Coin; //导入方法依赖的package包/类
/**
*
*/
@Override
public String getBalanceFriendlyStr() {
//send test coins back to : mwCwTceJvYV27KXBc3NJZys6CjsgsoeHmf
Coin balance = _coin.getWalletManager().wallet().getBalance(Wallet.BalanceType.ESTIMATED);
String balanceStatus =
"Friendly balance : " + balance.toFriendlyString()
+ " Estimated : " + _coin.getWalletManager().wallet().getBalance(Wallet.BalanceType.ESTIMATED)
+ " Available : " + _coin.getWalletManager().wallet().getBalance(Wallet.BalanceType.AVAILABLE)
+ " Available Spendable : " + _coin.getWalletManager().wallet().getBalance(Wallet.BalanceType.AVAILABLE_SPENDABLE)
+ " Estimated Spendable : " + _coin.getWalletManager().wallet().getBalance(Wallet.BalanceType.ESTIMATED_SPENDABLE);
return balance.toPlainString();
}
示例2: applyTxFee
import org.bitcoinj.core.Coin; //导入方法依赖的package包/类
/**
*
* @param valueMessage
* @return
*/
@Override
public SpentValueMessage applyTxFee(SpentValueMessage valueMessage) {
Coin amountCoin = Coin.parseCoin(valueMessage.getAmount());
Address addr = Address.fromBase58(_coin.getWalletManager().wallet().getParams(), valueMessage.getAddress());
SendRequest sendRequest = SendRequest.to(addr, amountCoin);
Coin txValue = CalculateFeeTxSizeBytes(sendRequest.tx, sendRequest.feePerKb.getValue());
valueMessage.setTxFee(txValue.toPlainString());
String amountStr = amountCoin.toPlainString();
valueMessage.setAmount(amountStr);
return valueMessage;
}
示例3: getTransactionList
import org.bitcoinj.core.Coin; //导入方法依赖的package包/类
/**
*
*/
@Override
public List<CoinTransaction> getTransactionList() {
List<CoinTransaction> transactions = new ArrayList<>();
Set<Transaction> txs = _coin.getWalletManager().wallet().getTransactions(true);
for (Transaction tx : txs) {
Coin amount = tx.getValue(_coin.getWalletManager().wallet());
String hash = tx.getHash().toString();
String amountStr = amount.toPlainString();
String fee = "";
String confirmationStr = "CONFIRMED";
if (tx.getFee() != null) {
fee = tx.getFee().toPlainString();
}
TransactionConfidence confidence = tx.getConfidence();
if (confidence.getDepthInBlocks() < 6) {
confirmationStr = confidence.getDepthInBlocks() + " CONFIRMATIONS";
}
TransactionConfidence.ConfidenceType cType = confidence.getConfidenceType();
CoinTransaction coinTransaction = new CoinTransaction(fee, hash, amountStr, confirmationStr, tx.getUpdateTime());
transactions.add(coinTransaction);
}
return transactions;
}