use of com.samourai.wallet.send.MyTransactionOutPoint in project samourai-wallet-android by Samourai-Wallet.
the class AndroidWhirlpoolDataService method toUnspentOutput.
private UnspentResponse.UnspentOutput toUnspentOutput(UTXO utxo) {
UnspentResponse.UnspentOutput u = new UnspentResponse.UnspentOutput();
MyTransactionOutPoint o = utxo.getOutpoints().iterator().next();
u.addr = o.getAddress();
u.confirmations = o.getConfirmations();
// TODO ?
u.script = null;
u.tx_hash = o.getTxHash().toString();
u.tx_output_n = o.getTxOutputN();
u.value = o.getValue().value;
u.xpub = new UnspentResponse.UnspentOutput.Xpub();
u.xpub.path = utxo.getPath();
return u;
}
use of com.samourai.wallet.send.MyTransactionOutPoint in project sparrow by sparrowwallet.
the class SparrowCahootsWallet method addUtxo.
public void addUtxo(WalletNode node, BlockTransaction blockTransaction, int index) {
if (node.getWallet().getScriptType() != ScriptType.P2WPKH) {
return;
}
UnspentOutput unspentOutput = Whirlpool.getUnspentOutput(node, blockTransaction, index);
MyTransactionOutPoint myTransactionOutPoint = unspentOutput.computeOutpoint(getParams());
CahootsUtxo cahootsUtxo;
if (node.getWallet().isBip47()) {
try {
String strPaymentCode = node.getWallet().getKeystores().get(0).getExternalPaymentCode().toString();
HD_Address hdAddress = getBip47Wallet().getAccount(getBip47Account()).addressAt(node.getIndex());
PaymentAddress paymentAddress = Bip47UtilJava.getInstance().getPaymentAddress(new PaymentCode(strPaymentCode), 0, hdAddress, getParams());
cahootsUtxo = new CahootsUtxo(myTransactionOutPoint, node.getDerivationPath(), paymentAddress.getReceiveECKey());
} catch (Exception e) {
throw new IllegalStateException("Cannot add BIP47 UTXO", e);
}
} else {
HD_Address hdAddress = getBip84Wallet().getAddressAt(account, unspentOutput);
cahootsUtxo = new CahootsUtxo(myTransactionOutPoint, node.getDerivationPath(), hdAddress.getECKey());
}
addUtxo(account, cahootsUtxo);
}
Aggregations