Hi,
I'm trying to get all addresses and their transactions for an xpub using Blockchain.com API, and right now pretty much drown drowning under the amount of new information
So hope somebody can clarify this for me.
As a first step, I'm sending a `multiaddr` request like this
GET https://blockchain.info/multiaddr?active=xpub...
And in return, I'm getting a JSON struct with three keys - `addresses`, `wallet` and `txs`
{
"addresses":[
{
"address":"<sample xpub>",
"change_index":10,
"account_index":18,
"final_balance":0,
"n_tx":32,
"total_received": <obfuscated>,
"total_sent":<obfuscated>
}
],
"wallet":{
"final_balance":0,
"n_tx":32,
"n_tx_filtered":32,
"total_received":<obfuscated>,
"total_sent":<obfuscated>
},
"txs":[...]
}
Every item under the `txs` list has inputs and outputs, and that's about the point where I'm stuck right now.
How do I figure out whether this is a "spend" or "receive" transaction in relation to a given xpub and what is the associated address?
Thank you.