# Gavin Andresen # 2010-07-30 13:18:06 # https://bitcointalk.org/index.php?topic=611.msg6642#msg6642 Couple of quick suggestions: @p{par} Using the key name "class" will cause problems for, at least, JavaScript, and probably other languages where "class" is a reserved word. "type" or "variety" or some other synonym will cause fewer problems later. @p{par} Or, maybe better, get rid of that field and just report credits as positive numbers and debits as negative. And add a separate "generated" field (boolean true or false). @p{par} Since each entry refers to a transaction, I'd suggest adding a "tx_id" SHA256 hex-encoded transaction id. Then listtransactions would play nicely with the refundtransaction JSON-RPC extension (and maybe a future gettransactiondetails that let you get transaction parents, which block the transaction was in, and so on). @p{par} Code to get that would look something like: @p{brk} Code: uint256 tx_hash = transaction.GetHash(); @p{brk} string tx_id = tx_hash.GetHex(); @p{brk} mapJSONResponse.push_back(Pair("tx_id", tx_id)); @p{brk}