-
Im trying to get address of utxo or the sender address of the transactions received. I can't find any easy way to get it done. let utxos = wallet.list_unspent()?;
for utxo in utxos {
utxo.txout.address //
utxo.address // expecting API
} |
Beta Was this translation helpful? Give feedback.
Answered by
orar
Nov 12, 2023
Replies: 1 comment
-
After a little digging and finding from bitcoinjs, I realized I needed to approach it from the address module. let utxos = wallet.list_unspent()?;
for utxo in utxos {
let addr = bdk::bitcoin::address::Address::from_script(
utxo.txout.script_pubkey.as_script(),
Network::Testnet
)?;
println!("Address: {:#?}", addr)
} Same as from transaction TxIn & TxOut |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
orar
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
After a little digging and finding from bitcoinjs, I realized I needed to approach it from the address module.
Same as from transaction TxIn & TxOut