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

lnrpc.ChannelFeeReport.scala Maven / Gradle / Ivy

The newest version!
// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO3

package lnrpc
import org.bitcoins.lnd.rpc.LndUtils._

/** @param chanId
  *   The short channel id that this fee report belongs to.
  * @param channelPoint
  *   The channel that this fee report belongs to.
  * @param baseFeeMsat
  *   The base fee charged regardless of the number of milli-satoshis sent.
  * @param feePerMil
  *   The amount charged per milli-satoshis transferred expressed in
  *   millionths of a satoshi.
  * @param feeRate
  *   The effective fee rate in milli-satoshis. Computed by dividing the
  *   fee_per_mil value by 1 million.
  */
@SerialVersionUID(0L)
final case class ChannelFeeReport(
    chanId: org.bitcoins.core.number.UInt64 = lnrpc.ChannelFeeReport._typemapper_chanId.toCustom(0L),
    channelPoint: _root_.scala.Predef.String = "",
    baseFeeMsat: _root_.scala.Long = 0L,
    feePerMil: _root_.scala.Long = 0L,
    feeRate: _root_.scala.Double = 0.0,
    unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
    ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[ChannelFeeReport] {
    @transient
    private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
    private[this] def __computeSerializedSize(): _root_.scala.Int = {
      var __size = 0
      
      {
        val __value = lnrpc.ChannelFeeReport._typemapper_chanId.toBase(chanId)
        if (__value != 0L) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt64Size(5, __value)
        }
      };
      
      {
        val __value = channelPoint
        if (!__value.isEmpty) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(1, __value)
        }
      };
      
      {
        val __value = baseFeeMsat
        if (__value != 0L) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeInt64Size(2, __value)
        }
      };
      
      {
        val __value = feePerMil
        if (__value != 0L) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeInt64Size(3, __value)
        }
      };
      
      {
        val __value = feeRate
        if (__value != 0.0) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeDoubleSize(4, __value)
        }
      };
      __size += unknownFields.serializedSize
      __size
    }
    override def serializedSize: _root_.scala.Int = {
      var __size = __serializedSizeMemoized
      if (__size == 0) {
        __size = __computeSerializedSize() + 1
        __serializedSizeMemoized = __size
      }
      __size - 1
      
    }
    def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = {
      {
        val __v = channelPoint
        if (!__v.isEmpty) {
          _output__.writeString(1, __v)
        }
      };
      {
        val __v = baseFeeMsat
        if (__v != 0L) {
          _output__.writeInt64(2, __v)
        }
      };
      {
        val __v = feePerMil
        if (__v != 0L) {
          _output__.writeInt64(3, __v)
        }
      };
      {
        val __v = feeRate
        if (__v != 0.0) {
          _output__.writeDouble(4, __v)
        }
      };
      {
        val __v = lnrpc.ChannelFeeReport._typemapper_chanId.toBase(chanId)
        if (__v != 0L) {
          _output__.writeUInt64(5, __v)
        }
      };
      unknownFields.writeTo(_output__)
    }
    def withChanId(__v: org.bitcoins.core.number.UInt64): ChannelFeeReport = copy(chanId = __v)
    def withChannelPoint(__v: _root_.scala.Predef.String): ChannelFeeReport = copy(channelPoint = __v)
    def withBaseFeeMsat(__v: _root_.scala.Long): ChannelFeeReport = copy(baseFeeMsat = __v)
    def withFeePerMil(__v: _root_.scala.Long): ChannelFeeReport = copy(feePerMil = __v)
    def withFeeRate(__v: _root_.scala.Double): ChannelFeeReport = copy(feeRate = __v)
    def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v)
    def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty)
    def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = {
      (__fieldNumber: @_root_.scala.unchecked) match {
        case 5 => {
          val __t = lnrpc.ChannelFeeReport._typemapper_chanId.toBase(chanId)
          if (__t != 0L) __t else null
        }
        case 1 => {
          val __t = channelPoint
          if (__t != "") __t else null
        }
        case 2 => {
          val __t = baseFeeMsat
          if (__t != 0L) __t else null
        }
        case 3 => {
          val __t = feePerMil
          if (__t != 0L) __t else null
        }
        case 4 => {
          val __t = feeRate
          if (__t != 0.0) __t else null
        }
      }
    }
    def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = {
      _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor)
      (__field.number: @_root_.scala.unchecked) match {
        case 5 => _root_.scalapb.descriptors.PLong(lnrpc.ChannelFeeReport._typemapper_chanId.toBase(chanId))
        case 1 => _root_.scalapb.descriptors.PString(channelPoint)
        case 2 => _root_.scalapb.descriptors.PLong(baseFeeMsat)
        case 3 => _root_.scalapb.descriptors.PLong(feePerMil)
        case 4 => _root_.scalapb.descriptors.PDouble(feeRate)
      }
    }
    def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
    def companion: lnrpc.ChannelFeeReport.type = lnrpc.ChannelFeeReport
    // @@protoc_insertion_point(GeneratedMessage[lnrpc.ChannelFeeReport])
}

object ChannelFeeReport extends scalapb.GeneratedMessageCompanion[lnrpc.ChannelFeeReport] {
  implicit def messageCompanion: scalapb.GeneratedMessageCompanion[lnrpc.ChannelFeeReport] = this
  def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): lnrpc.ChannelFeeReport = {
    var __chanId: _root_.scala.Long = 0L
    var __channelPoint: _root_.scala.Predef.String = ""
    var __baseFeeMsat: _root_.scala.Long = 0L
    var __feePerMil: _root_.scala.Long = 0L
    var __feeRate: _root_.scala.Double = 0.0
    var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null
    var _done__ = false
    while (!_done__) {
      val _tag__ = _input__.readTag()
      _tag__ match {
        case 0 => _done__ = true
        case 40 =>
          __chanId = _input__.readUInt64()
        case 10 =>
          __channelPoint = _input__.readStringRequireUtf8()
        case 16 =>
          __baseFeeMsat = _input__.readInt64()
        case 24 =>
          __feePerMil = _input__.readInt64()
        case 33 =>
          __feeRate = _input__.readDouble()
        case tag =>
          if (_unknownFields__ == null) {
            _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
          }
          _unknownFields__.parseField(tag, _input__)
      }
    }
    lnrpc.ChannelFeeReport(
        chanId = lnrpc.ChannelFeeReport._typemapper_chanId.toCustom(__chanId),
        channelPoint = __channelPoint,
        baseFeeMsat = __baseFeeMsat,
        feePerMil = __feePerMil,
        feeRate = __feeRate,
        unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
    )
  }
  implicit def messageReads: _root_.scalapb.descriptors.Reads[lnrpc.ChannelFeeReport] = _root_.scalapb.descriptors.Reads{
    case _root_.scalapb.descriptors.PMessage(__fieldsMap) =>
      _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.")
      lnrpc.ChannelFeeReport(
        chanId = lnrpc.ChannelFeeReport._typemapper_chanId.toCustom(__fieldsMap.get(scalaDescriptor.findFieldByNumber(5).get).map(_.as[_root_.scala.Long]).getOrElse(0L)),
        channelPoint = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
        baseFeeMsat = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Long]).getOrElse(0L),
        feePerMil = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).map(_.as[_root_.scala.Long]).getOrElse(0L),
        feeRate = __fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).map(_.as[_root_.scala.Double]).getOrElse(0.0)
      )
    case _ => throw new RuntimeException("Expected PMessage")
  }
  def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = LightningProto.javaDescriptor.getMessageTypes().get(152)
  def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = LightningProto.scalaDescriptor.messages(152)
  def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = throw new MatchError(__number)
  lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty
  def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber)
  lazy val defaultInstance = lnrpc.ChannelFeeReport(
    chanId = lnrpc.ChannelFeeReport._typemapper_chanId.toCustom(0L),
    channelPoint = "",
    baseFeeMsat = 0L,
    feePerMil = 0L,
    feeRate = 0.0
  )
  implicit class ChannelFeeReportLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, lnrpc.ChannelFeeReport]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, lnrpc.ChannelFeeReport](_l) {
    def chanId: _root_.scalapb.lenses.Lens[UpperPB, org.bitcoins.core.number.UInt64] = field(_.chanId)((c_, f_) => c_.copy(chanId = f_))
    def channelPoint: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.channelPoint)((c_, f_) => c_.copy(channelPoint = f_))
    def baseFeeMsat: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Long] = field(_.baseFeeMsat)((c_, f_) => c_.copy(baseFeeMsat = f_))
    def feePerMil: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Long] = field(_.feePerMil)((c_, f_) => c_.copy(feePerMil = f_))
    def feeRate: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Double] = field(_.feeRate)((c_, f_) => c_.copy(feeRate = f_))
  }
  final val CHAN_ID_FIELD_NUMBER = 5
  final val CHANNEL_POINT_FIELD_NUMBER = 1
  final val BASE_FEE_MSAT_FIELD_NUMBER = 2
  final val FEE_PER_MIL_FIELD_NUMBER = 3
  final val FEE_RATE_FIELD_NUMBER = 4
  @transient
  private[lnrpc] val _typemapper_chanId: _root_.scalapb.TypeMapper[_root_.scala.Long, org.bitcoins.core.number.UInt64] = implicitly[_root_.scalapb.TypeMapper[_root_.scala.Long, org.bitcoins.core.number.UInt64]]
  def of(
    chanId: org.bitcoins.core.number.UInt64,
    channelPoint: _root_.scala.Predef.String,
    baseFeeMsat: _root_.scala.Long,
    feePerMil: _root_.scala.Long,
    feeRate: _root_.scala.Double
  ): _root_.lnrpc.ChannelFeeReport = _root_.lnrpc.ChannelFeeReport(
    chanId,
    channelPoint,
    baseFeeMsat,
    feePerMil,
    feeRate
  )
  // @@protoc_insertion_point(GeneratedMessageCompanion[lnrpc.ChannelFeeReport])
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy