How do I calculate the sum of transaction inputs?
You have to look up the previous unspent transaction output using the hash and txout-index, and this output contains the amount in satoshis which is provided in entirety as input for the transaction.