Title: How to get all addresses and associated txs for an XPUB with Blockchain.com API? Post by: ykt on October 16, 2022, 01:45:35 PM 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 Code: GET https://blockchain.info/multiaddr?active=xpub... And in return, I'm getting a JSON struct with three keys - `addresses`, `wallet` and `txs` Code:
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. Title: Re: How to get all addresses and associated txs for an XPUB with Blockchain.com API? Post by: jackg on October 16, 2022, 02:01:06 PM Why didn't you give us an example of what's in the txs?
When testing this with an xpub the two main things I can see that are probably useful are "balance" and "result" that come with each transaction (or seem to). Title: Re: How to get all addresses and associated txs for an XPUB with Blockchain.com API? Post by: nc50lc on October 17, 2022, 04:05:20 AM -snip- 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? Let's use this result as an example: Code: "txs":[ If the result is a negative value, that means that it's a "spend" transaction, "receive" if positive. The associated address(es) are the "addr" in the "inputs" if it's a spend txn, in the "out" if it's a receive txn. |