Browse Source

server: Add AddressDetails model

scalafmt-draft
Alexis Hernandez 7 years ago
parent
commit
4be4fa0b47
  1. 17
      server/app/com/xsn/explorer/models/AddressDetails.scala

17
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)
}
}
Loading…
Cancel
Save