Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get Multiple Address Balances #583

Open
MelbourneDeveloper opened this issue Jun 11, 2018 · 1 comment
Open

Get Multiple Address Balances #583

MelbourneDeveloper opened this issue Jun 11, 2018 · 1 comment

Comments

@MelbourneDeveloper
Copy link

MelbourneDeveloper commented Jun 11, 2018

Currently, it's possible to get "Unspent Outputs for Multiple Addresses". But, it's not possible to get the balances for multiple addresses with a transaction count or total received.

I'm building an app that sits across multiple coins. Many of the coins' API are Insight based which is great because the protocol the same for all coins. However, I have to retrieve address balances one by one which is very chatty, and some APIs have a rate limit so it's easy to eat that up with multiple addresses.

My app is based on Trezor. For each coin, It gets three addresses from the Trezor. That's six addresses in total because change addresses are also checked. If at least one of those addresses is not unused, it will move to the next three addresses. The app will continue until it has checked three addresses in a row that have been proven to be empty (no transactions at all). This means that there will be at least six calls to insight-api/addr - usually twelve.

The good news is that insight-api/addr returns pointers to transaction ids. So, this means that even if the balance of the address is zero, I can see if the address has ever been used. It also has totalReceived and totalSent which tells me if the address has been used or not.

It would be good if the API implemented something like this:

https://[address]/insight-api/addrs/[address1],[address2]/addressinfo

The call would not have to include all the same information that insight-api/addr already returns. All it needs is:

  • Balance and
  • Transaction Count

or

  • Balance and
  • Total received
@dan-da
Copy link

dan-da commented Jul 23, 2018

I need this for hd-wallet-addrs also. The tool presently supports using insight as a data provider but is dog slow. The default is to query up to gap-limit (20) for both receive and change addresses, so that's minimum 40 requests to /addr.

fyi, at least two other api providers already provide multi-addr lookups: blockchain.info and btc.com. But they are not open source to my knowledge, and thus users must sacrifice privacy to use them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants