evilsocket / openbank

OpenBank - Your BTC realtime tracker.
Other
73 stars 24 forks source link

Blockonomics API only allows 50 addresses #2

Closed xqus closed 8 years ago

xqus commented 8 years ago

The Blockonomics API fails when adding an xPub key with more than 50 addresses, and therefore Openbank shows an balance of 0 BTC. I have failed to locate an API that does the same, but with unlimited addresses.

evilsocket commented 8 years ago

good to know, I'm using an xpub with only 15 addresses so I didn't notice it ... i'd need another API or download the whole blockchain, which is undoable.

xqus commented 8 years ago

If a feature to specify an API key, you can trough the Wallet Watcher service on Blockonomics upgrade to up to 500 addresses.

https://www.blockonomics.co/views/api.html#apikey

evilsocket commented 8 years ago

Mmm interesting, so I could just put an "api_key" user_setting and that should work ... thanks

evilsocket commented 8 years ago

Can you try now putting your API key in the settings panel?

xqus commented 8 years ago

I have spplied for an upgrade for my account. Seems like there is no automatic process. However I do think it requires a bit more work. The endpoint for the WalletWatcher is different, and so is the response:

GET https://www.blockonomics.co/api/address

[{"createdon": 1424097689.582884, "balance": 0, "tag": "mining", "address": "1AraZwQD3euXSeEJSTEiy8m2GSCvRMVkLY"}, {"createdon": 1442657078.386882, "balance": 5000000000, "tag": "", "address": "1BW18n7MfpU35q4MTBSk8pse3XzQF8XvzT"}]

When my account is upgraded I will test and create a Pull Request.

evilsocket commented 8 years ago

Mmmm shouldn't it be the /api/balance call instead?

xqus commented 8 years ago

As far as I can see the balance endpoint is used without API key, and if you have an API key you use the address endpoint.

shivaenigma commented 8 years ago

Hi, Got here from google, Nice Project !

api_key not working with /api/balance endpoint is a bug in blockonomics, which has now been fixed. Also its no longer necessary to add xpub in address watcher to get the balance.

Feel free to contact us on webmaster at blockonomics.co for any api related issues. -Thanks and Regards

evilsocket commented 8 years ago

@shivaenigma so /api/balance will work the same way with or without a key now?

shivaenigma commented 8 years ago

@evilsocket Yes, /api/balance, will work the same way with/without api key

If the user with provided api key has upgraded to higher number of a address. balance would return correct results as expected.

evilsocket commented 8 years ago

great, thanks for such quick fix! :)

shivaenigma commented 8 years ago

Make sure you add all your addresses/keys to the wallet watcher service or else it will appear with 0 balance.

Also this can be removed from README. Should not be required anymore. Feel free to test and let me know if it doesn't work.