You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
513 B
20 lines
513 B
package com.xsn.explorer.models
|
|
|
|
import com.xsn.explorer.models.rpc.TransactionVOUT
|
|
import play.api.libs.json.{Json, Writes}
|
|
|
|
case class TransactionValue(address: Address, value: BigDecimal)
|
|
|
|
object TransactionValue {
|
|
|
|
def from(vout: TransactionVOUT): Option[TransactionValue] = {
|
|
val value = vout.value
|
|
val addressMaybe = vout.address
|
|
|
|
addressMaybe.map { address =>
|
|
TransactionValue(address, value)
|
|
}
|
|
}
|
|
|
|
implicit val writes: Writes[TransactionValue] = Json.writes[TransactionValue]
|
|
}
|
|
|