diff --git a/server/app/com/xsn/explorer/models/AddressDetails.scala b/server/app/com/xsn/explorer/models/AddressDetails.scala new file mode 100644 index 0000000..4e56f79 --- /dev/null +++ b/server/app/com/xsn/explorer/models/AddressDetails.scala @@ -0,0 +1,17 @@ +package com.xsn.explorer.models + +import play.api.libs.json._ + +case class AddressDetails(balance: AddressBalance, transactionCount: Int) + +object AddressDetails { + + implicit val writes: Writes[AddressDetails] = Writes { obj => + val values = Map( + "balance" -> JsNumber(BigDecimal(obj.balance.balance)), + "received" -> JsNumber(BigDecimal(obj.balance.received)), + "transactionCount" -> JsNumber(obj.transactionCount)) + + JsObject.apply(values) + } +}