All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.plasmalabs.sdk.display.UtxoDisplayOps.scala Maven / Gradle / Ivy

The newest version!
package org.plasmalabs.sdk.display

import org.plasmalabs.sdk.codecs.AddressCodecs
import org.plasmalabs.sdk.display.DisplayOps.DisplayTOps
import org.plasmalabs.sdk.models.LockAddress
import org.plasmalabs.sdk.models.transaction.UnspentTransactionOutput

trait UtxoDisplayOps {

  implicit val utxoDisplay: DisplayOps[UnspentTransactionOutput] = (utxo: UnspentTransactionOutput) =>
    Seq(
      padLabel("LockAddress") + utxo.address.display,
      utxo.value.value.display
    ).mkString("\n")

  implicit val lockAddressDisplay: DisplayOps[LockAddress] = (lockAddress: LockAddress) =>
    AddressCodecs.encodeAddress(lockAddress)

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy