I'm actually doing it via Bitcoin API and PHP. I tried gettransaction but it doesn't print the fee amount.
gettransaction will not give you the fee if you received the transaction, only if you sent. You should use getrawtransaction. With that command you can retrieve the vout values of all of the outpoints of the inputs and the output. Then just use those the calculate the fee.
For:
7f502f28ca8d162300a1bbc8cb7dfa6f38533596ac97c29e1d1de9ca614ae350
Total Inputs 11.69569708 tBTC
Total Outputs -11.69563674 tBTC
= 0.00006034 tBTC fees (subtracting total outputs from total inputs)
For the second, total inputs and total outputs are the same: 506.68468049 tBTC
So there are 0.0 fees.
Does that make sense?
If you aren't asking how to calculate the fees for that transaction as it was confirmed, I am not sure what you are asking.
I'm actually doing it via Bitcoin API and PHP. I tried
gettransaction but it doesn't print the fee amount.
Yeah I've figured it out few minutes ago but as I've said in my previous post there's no input value:
{
"hex" : "0100000001e95b2a62cf8885cc269e339cd564d3991fa7c16004231c9d1302876c008b01fd010000006b483045022100f49467a7ce7ace56013da6edda79e0091cc8add647b2085f7d2d3f7fed5b6e8c0220581a2c0a0d6b492a3c31b90cc626b374b7f08c61c61852a620d4d1323055435c012103478900f6438292ae0020d519d48de9dcadb821a154762de7ab3f637c6c1dc8c5feffffff0240e45904000000001976a91441a6de7575fa51462507f74662692093d0dea98088acda3b5c41000000001976a914b8f24e7b733aa6834272fe5b09d2fdcecdc1493e88ac02a80900",
"txid" : "7f502f28ca8d162300a1bbc8cb7dfa6f38533596ac97c29e1d1de9ca614ae350",
"version" : 1,
"locktime" : 632834,
"vin" : [
{
"txid" : "fd018b006c8702139d1c230460c1a71f99d364d59c339e26cc8588cf622a5be9",
"vout" : 1,
"scriptSig" : {
"asm" : "3045022100f49467a7ce7ace56013da6edda79e0091cc8add647b2085f7d2d3f7fed5b6e8c0220581a2c0a0d6b492a3c31b90cc626b374b7f08c61c61852a620d4d1323055435c01 03478900f6438292ae0020d519d48de9dcadb821a154762de7ab3f637c6c1dc8c5",
"hex" : "483045022100f49467a7ce7ace56013da6edda79e0091cc8add647b2085f7d2d3f7fed5b6e8c0220581a2c0a0d6b492a3c31b90cc626b374b7f08c61c61852a620d4d1323055435c012103478900f6438292ae0020d519d48de9dcadb821a154762de7ab3f637c6c1dc8c5"
},
"sequence" : 4294967294
}
],
"vout" : [
{
"value" : 0.73000000,
"n" : 0,
"scriptPubKey" : {
"asm" : "OP_DUP OP_HASH160 41a6de7575fa51462507f74662692093d0dea980 OP_EQUALVERIFY OP_CHECKSIG",
"hex" : "76a91441a6de7575fa51462507f74662692093d0dea98088ac",
"reqSigs" : 1,
"type" : "pubkeyhash",
"addresses" : [
"mmW67nNBnNMkaXfM44NMgtCo7VrXbByP2F"
]
}
},
{
"value" : 10.96563674,
"n" : 1,
"scriptPubKey" : {
"asm" : "OP_DUP OP_HASH160 b8f24e7b733aa6834272fe5b09d2fdcecdc1493e OP_EQUALVERIFY OP_CHECKSIG",
"hex" : "76a914b8f24e7b733aa6834272fe5b09d2fdcecdc1493e88ac",
"reqSigs" : 1,
"type" : "pubkeyhash",
"addresses" : [
"mxNru78e56ysyGwdsT6UY3iHZrsDLXiStM"
]
}
}
],
"blockhash" : "000000000000186eec98d20a64afe351562f4805c26e6a688705895e77c1138e",
"confirmations" : 10,
"time" : 1452630788,
"blocktime" : 1452630788
}