I am trying to list all the transactions of a given wallet address using
https://blockchain.info/address/. My requirement is to list receive and sent btc separately. But somehow I am not able to understand which values to read. "result" key in json seems consistent as it gives + or - integers but the first result is always 0. Values in "outs" "value" key are correct but no way of knowing whether amount is received or sent.
Any Help is appreciated.
There is no received or sent btc against a certain address. Within a Tx, an address may be in both input & output.
Consider
https://blockchain.info/rawaddr/1EzwoHtiXB4iFwedPr49iywjZn2nnekhoj"out":[{"spent":true,"tx_index":45037626,"type":0,"addr":"1EzwoHtiXB4iFwedPr49iywjZn2nnekhoj","value":2000000,"n":0,"script":"76a914998f169318eb1d8d2a4e53dce2712f5678c6f06e88ac"}
Says 2000000 is input of 1EzwoHtiXB4iFwedPr49iywjZn2nnekhoj
"prev_out":{"tx_index":17584482,"type":0,"addr":"1EzwoHtiXB4iFwedPr49iywjZn2nnekhoj","value":10097213,"n":1,"script":"76a914998f169318eb1d8d2a4e53dce2712f5678c6f06e88ac"}
Says 10097213 Satoshi is output of 1EzwoHtiXB4iFwedPr49iywjZn2nnekhoj
Now u need to properly read the JS to format it against Tx ids and then find out the respective input and output against the given address.