diff --git a/server/app/com/xsn/explorer/models/LightWalletTransaction.scala b/server/app/com/xsn/explorer/models/LightWalletTransaction.scala index 7f493a0..d01153e 100644 --- a/server/app/com/xsn/explorer/models/LightWalletTransaction.scala +++ b/server/app/com/xsn/explorer/models/LightWalletTransaction.scala @@ -1,6 +1,6 @@ package com.xsn.explorer.models -import com.xsn.explorer.models.values.{Address, Blockhash, Size, TransactionId} +import com.xsn.explorer.models.values.{Address, Blockhash, HexString, Size, TransactionId} case class LightWalletTransaction( id: TransactionId, @@ -13,6 +13,6 @@ case class LightWalletTransaction( object LightWalletTransaction { case class Input(txid: TransactionId, index: Int, value: BigDecimal) - case class Output(index: Int, value: BigDecimal, addresses: List[Address]) + case class Output(index: Int, value: BigDecimal, addresses: List[Address], script: HexString) } diff --git a/server/app/controllers/BlocksController.scala b/server/app/controllers/BlocksController.scala index a0b731f..bdd5cf7 100644 --- a/server/app/controllers/BlocksController.scala +++ b/server/app/controllers/BlocksController.scala @@ -75,7 +75,14 @@ object BlocksController { ) } - implicit val outputWrites: Writes[LightWalletTransaction.Output] = Json.writes[LightWalletTransaction.Output] + implicit val outputWrites: Writes[LightWalletTransaction.Output] = (obj: LightWalletTransaction.Output) => { + Json.obj( + "index" -> obj.index, + "value" -> obj.value, + "addresses" -> obj.addresses, + "script" -> obj.script.string + ) + } implicit val lightWalletTransactionWrites: Writes[LightWalletTransaction] = (obj: LightWalletTransaction) => { Json.obj( "id" -> obj.id,