2

I've been using Blocktrail's API:

https://www.blocktrail.com/api/docs/lang/nodejs#data_overview

to get data for the following unspent address on the testnet:

2N6qMqR9D4BTkD6fS1h6Sq3kRV2FeB1L14j.

Blocktrail's API returns the index as 4, whereas blockexplorer's:

https://testnet.blockexplorer.com/api/addr/2N6qMqR9D4BTkD6fS1h6Sq3kRV2FeB1L14j/utxo

and smartbit's APIs:

https://testnet-api.smartbit.com.au/v1/blockchain/address/2N6qMqR9D4BTkD6fS1h6Sq3kRV2FeB1L14j/unspent

both return an index of 0. Am I missing something here?

2

both return an index of 0.

0 is the correct answer here.

Am I missing something here?

Not sure.

I can't reproduce your problem. I'm querying blocktrail like this:

curl https://api.blocktrail.com/v1/tbtc/address/2N6qMqR9D4BTkD6fS1h6Sq3kRV2FeB1L14j/transactions?api_key=MY_APIKEY

and that returns all of the transactions for the address, none of which have an index of 4.

Can you post the line of code that calls their API?

  • Thanks for taking the time to look into this! It turns out that I was querying for address instead of transaction (js): blocktrailClient.address((2N6qMqR9D4BTkD6fS1h6Sq3kRV2FeB1L14j), (err, address) => {console.log(address)}) – timothyylim Oct 13 '17 at 10:34

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.