custom json encoder for transactions