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

lnrpc.BatchOpenChannel.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 nodePubkey
  *   The pubkey of the node to open a channel with. When using REST, this
  *   field must be encoded as base64.
  * @param localFundingAmount
  *   The number of satoshis the wallet should commit to the channel.
  * @param pushSat
  *   The number of satoshis to push to the remote side as part of the initial
  *   commitment state.
  * @param private
  *   Whether this channel should be private, not announced to the greater
  *   network.
  * @param minHtlcMsat
  *   The minimum value in millisatoshi we will require for incoming HTLCs on
  *   the channel.
  * @param remoteCsvDelay
  *   The delay we require on the remote's commitment transaction. If this is
  *   not set, it will be scaled automatically with the channel size.
  * @param closeAddress
  *  
  *  Close address is an optional address which specifies the address to which
  *  funds should be paid out to upon cooperative close. This field may only be
  *  set if the peer supports the option upfront feature bit (call listpeers
  *  to check). The remote peer will only accept cooperative closes to this
  *  address if it is set.
  *  
  *  Note: If this value is set on channel creation, you will *not* be able to
  *  cooperatively close out to a different address.
  * @param pendingChanId
  *  
  *  An optional, unique identifier of 32 random bytes that will be used as the
  *  pending channel ID to identify the channel while it is in the pre-pending
  *  state.
  * @param commitmentType
  *  
  *  The explicit commitment type to use. Note this field will only be used if
  *  the remote peer supports explicit channel negotiation.
  * @param remoteMaxValueInFlightMsat
  *  
  *  The maximum amount of coins in millisatoshi that can be pending within
  *  the channel. It only applies to the remote party.
  * @param remoteMaxHtlcs
  *  
  *  The maximum number of concurrent HTLCs we will allow the remote party to add
  *  to the commitment transaction.
  * @param maxLocalCsv
  *  
  *  Max local csv is the maximum csv delay we will allow for our own commitment
  *  transaction.
  * @param zeroConf
  *  
  *  If this is true, then a zero-conf channel open will be attempted.
  * @param scidAlias
  *  
  *  If this is true, then an option-scid-alias channel-type open will be
  *  attempted.
  * @param baseFee
  *  
  *  The base fee charged regardless of the number of milli-satoshis sent.
  * @param feeRate
  *  
  *  The fee rate in ppm (parts per million) that will be charged in
  *  proportion of the value of each forwarded HTLC.
  * @param useBaseFee
  *  
  *  If use_base_fee is true the open channel announcement will update the
  *  channel base fee with the value specified in base_fee. In the case of
  *  a base_fee of 0 use_base_fee is needed downstream to distinguish whether
  *  to use the default base fee value specified in the config or 0.
  * @param useFeeRate
  *  
  *  If use_fee_rate is true the open channel announcement will update the
  *  channel fee rate with the value specified in fee_rate. In the case of
  *  a fee_rate of 0 use_fee_rate is needed downstream to distinguish whether
  *  to use the default fee rate value specified in the config or 0.
  * @param remoteChanReserveSat
  *  
  *  The number of satoshis we require the remote peer to reserve. This value,
  *  if specified, must be above the dust limit and below 20% of the channel
  *  capacity.
  * @param memo
  *  
  *  An optional note-to-self to go along with the channel containing some
  *  useful information. This is only ever stored locally and in no way impacts
  *  the channel's operation.
  */
@SerialVersionUID(0L)
final case class BatchOpenChannel(
    nodePubkey: _root_.com.google.protobuf.ByteString = _root_.com.google.protobuf.ByteString.EMPTY,
    localFundingAmount: _root_.scala.Long = 0L,
    pushSat: _root_.scala.Long = 0L,
    `private`: _root_.scala.Boolean = false,
    minHtlcMsat: _root_.scala.Long = 0L,
    remoteCsvDelay: org.bitcoins.core.number.UInt32 = lnrpc.BatchOpenChannel._typemapper_remoteCsvDelay.toCustom(0),
    closeAddress: _root_.scala.Predef.String = "",
    pendingChanId: _root_.com.google.protobuf.ByteString = _root_.com.google.protobuf.ByteString.EMPTY,
    commitmentType: lnrpc.CommitmentType = lnrpc.CommitmentType.UNKNOWN_COMMITMENT_TYPE,
    remoteMaxValueInFlightMsat: org.bitcoins.core.number.UInt64 = lnrpc.BatchOpenChannel._typemapper_remoteMaxValueInFlightMsat.toCustom(0L),
    remoteMaxHtlcs: org.bitcoins.core.number.UInt32 = lnrpc.BatchOpenChannel._typemapper_remoteMaxHtlcs.toCustom(0),
    maxLocalCsv: org.bitcoins.core.number.UInt32 = lnrpc.BatchOpenChannel._typemapper_maxLocalCsv.toCustom(0),
    zeroConf: _root_.scala.Boolean = false,
    scidAlias: _root_.scala.Boolean = false,
    baseFee: org.bitcoins.core.number.UInt64 = lnrpc.BatchOpenChannel._typemapper_baseFee.toCustom(0L),
    feeRate: org.bitcoins.core.number.UInt64 = lnrpc.BatchOpenChannel._typemapper_feeRate.toCustom(0L),
    useBaseFee: _root_.scala.Boolean = false,
    useFeeRate: _root_.scala.Boolean = false,
    remoteChanReserveSat: org.bitcoins.core.number.UInt64 = lnrpc.BatchOpenChannel._typemapper_remoteChanReserveSat.toCustom(0L),
    memo: _root_.scala.Predef.String = "",
    unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
    ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[BatchOpenChannel] {
    @transient
    private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
    private[this] def __computeSerializedSize(): _root_.scala.Int = {
      var __size = 0
      
      {
        val __value = nodePubkey
        if (!__value.isEmpty) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeBytesSize(1, __value)
        }
      };
      
      {
        val __value = localFundingAmount
        if (__value != 0L) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeInt64Size(2, __value)
        }
      };
      
      {
        val __value = pushSat
        if (__value != 0L) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeInt64Size(3, __value)
        }
      };
      
      {
        val __value = `private`
        if (__value != false) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeBoolSize(4, __value)
        }
      };
      
      {
        val __value = minHtlcMsat
        if (__value != 0L) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeInt64Size(5, __value)
        }
      };
      
      {
        val __value = lnrpc.BatchOpenChannel._typemapper_remoteCsvDelay.toBase(remoteCsvDelay)
        if (__value != 0) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt32Size(6, __value)
        }
      };
      
      {
        val __value = closeAddress
        if (!__value.isEmpty) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(7, __value)
        }
      };
      
      {
        val __value = pendingChanId
        if (!__value.isEmpty) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeBytesSize(8, __value)
        }
      };
      
      {
        val __value = commitmentType.value
        if (__value != 0) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeEnumSize(9, __value)
        }
      };
      
      {
        val __value = lnrpc.BatchOpenChannel._typemapper_remoteMaxValueInFlightMsat.toBase(remoteMaxValueInFlightMsat)
        if (__value != 0L) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt64Size(10, __value)
        }
      };
      
      {
        val __value = lnrpc.BatchOpenChannel._typemapper_remoteMaxHtlcs.toBase(remoteMaxHtlcs)
        if (__value != 0) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt32Size(11, __value)
        }
      };
      
      {
        val __value = lnrpc.BatchOpenChannel._typemapper_maxLocalCsv.toBase(maxLocalCsv)
        if (__value != 0) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt32Size(12, __value)
        }
      };
      
      {
        val __value = zeroConf
        if (__value != false) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeBoolSize(13, __value)
        }
      };
      
      {
        val __value = scidAlias
        if (__value != false) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeBoolSize(14, __value)
        }
      };
      
      {
        val __value = lnrpc.BatchOpenChannel._typemapper_baseFee.toBase(baseFee)
        if (__value != 0L) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt64Size(15, __value)
        }
      };
      
      {
        val __value = lnrpc.BatchOpenChannel._typemapper_feeRate.toBase(feeRate)
        if (__value != 0L) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt64Size(16, __value)
        }
      };
      
      {
        val __value = useBaseFee
        if (__value != false) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeBoolSize(17, __value)
        }
      };
      
      {
        val __value = useFeeRate
        if (__value != false) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeBoolSize(18, __value)
        }
      };
      
      {
        val __value = lnrpc.BatchOpenChannel._typemapper_remoteChanReserveSat.toBase(remoteChanReserveSat)
        if (__value != 0L) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt64Size(19, __value)
        }
      };
      
      {
        val __value = memo
        if (!__value.isEmpty) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(20, __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 = nodePubkey
        if (!__v.isEmpty) {
          _output__.writeBytes(1, __v)
        }
      };
      {
        val __v = localFundingAmount
        if (__v != 0L) {
          _output__.writeInt64(2, __v)
        }
      };
      {
        val __v = pushSat
        if (__v != 0L) {
          _output__.writeInt64(3, __v)
        }
      };
      {
        val __v = `private`
        if (__v != false) {
          _output__.writeBool(4, __v)
        }
      };
      {
        val __v = minHtlcMsat
        if (__v != 0L) {
          _output__.writeInt64(5, __v)
        }
      };
      {
        val __v = lnrpc.BatchOpenChannel._typemapper_remoteCsvDelay.toBase(remoteCsvDelay)
        if (__v != 0) {
          _output__.writeUInt32(6, __v)
        }
      };
      {
        val __v = closeAddress
        if (!__v.isEmpty) {
          _output__.writeString(7, __v)
        }
      };
      {
        val __v = pendingChanId
        if (!__v.isEmpty) {
          _output__.writeBytes(8, __v)
        }
      };
      {
        val __v = commitmentType.value
        if (__v != 0) {
          _output__.writeEnum(9, __v)
        }
      };
      {
        val __v = lnrpc.BatchOpenChannel._typemapper_remoteMaxValueInFlightMsat.toBase(remoteMaxValueInFlightMsat)
        if (__v != 0L) {
          _output__.writeUInt64(10, __v)
        }
      };
      {
        val __v = lnrpc.BatchOpenChannel._typemapper_remoteMaxHtlcs.toBase(remoteMaxHtlcs)
        if (__v != 0) {
          _output__.writeUInt32(11, __v)
        }
      };
      {
        val __v = lnrpc.BatchOpenChannel._typemapper_maxLocalCsv.toBase(maxLocalCsv)
        if (__v != 0) {
          _output__.writeUInt32(12, __v)
        }
      };
      {
        val __v = zeroConf
        if (__v != false) {
          _output__.writeBool(13, __v)
        }
      };
      {
        val __v = scidAlias
        if (__v != false) {
          _output__.writeBool(14, __v)
        }
      };
      {
        val __v = lnrpc.BatchOpenChannel._typemapper_baseFee.toBase(baseFee)
        if (__v != 0L) {
          _output__.writeUInt64(15, __v)
        }
      };
      {
        val __v = lnrpc.BatchOpenChannel._typemapper_feeRate.toBase(feeRate)
        if (__v != 0L) {
          _output__.writeUInt64(16, __v)
        }
      };
      {
        val __v = useBaseFee
        if (__v != false) {
          _output__.writeBool(17, __v)
        }
      };
      {
        val __v = useFeeRate
        if (__v != false) {
          _output__.writeBool(18, __v)
        }
      };
      {
        val __v = lnrpc.BatchOpenChannel._typemapper_remoteChanReserveSat.toBase(remoteChanReserveSat)
        if (__v != 0L) {
          _output__.writeUInt64(19, __v)
        }
      };
      {
        val __v = memo
        if (!__v.isEmpty) {
          _output__.writeString(20, __v)
        }
      };
      unknownFields.writeTo(_output__)
    }
    def withNodePubkey(__v: _root_.com.google.protobuf.ByteString): BatchOpenChannel = copy(nodePubkey = __v)
    def withLocalFundingAmount(__v: _root_.scala.Long): BatchOpenChannel = copy(localFundingAmount = __v)
    def withPushSat(__v: _root_.scala.Long): BatchOpenChannel = copy(pushSat = __v)
    def withPrivate(__v: _root_.scala.Boolean): BatchOpenChannel = copy(`private` = __v)
    def withMinHtlcMsat(__v: _root_.scala.Long): BatchOpenChannel = copy(minHtlcMsat = __v)
    def withRemoteCsvDelay(__v: org.bitcoins.core.number.UInt32): BatchOpenChannel = copy(remoteCsvDelay = __v)
    def withCloseAddress(__v: _root_.scala.Predef.String): BatchOpenChannel = copy(closeAddress = __v)
    def withPendingChanId(__v: _root_.com.google.protobuf.ByteString): BatchOpenChannel = copy(pendingChanId = __v)
    def withCommitmentType(__v: lnrpc.CommitmentType): BatchOpenChannel = copy(commitmentType = __v)
    def withRemoteMaxValueInFlightMsat(__v: org.bitcoins.core.number.UInt64): BatchOpenChannel = copy(remoteMaxValueInFlightMsat = __v)
    def withRemoteMaxHtlcs(__v: org.bitcoins.core.number.UInt32): BatchOpenChannel = copy(remoteMaxHtlcs = __v)
    def withMaxLocalCsv(__v: org.bitcoins.core.number.UInt32): BatchOpenChannel = copy(maxLocalCsv = __v)
    def withZeroConf(__v: _root_.scala.Boolean): BatchOpenChannel = copy(zeroConf = __v)
    def withScidAlias(__v: _root_.scala.Boolean): BatchOpenChannel = copy(scidAlias = __v)
    def withBaseFee(__v: org.bitcoins.core.number.UInt64): BatchOpenChannel = copy(baseFee = __v)
    def withFeeRate(__v: org.bitcoins.core.number.UInt64): BatchOpenChannel = copy(feeRate = __v)
    def withUseBaseFee(__v: _root_.scala.Boolean): BatchOpenChannel = copy(useBaseFee = __v)
    def withUseFeeRate(__v: _root_.scala.Boolean): BatchOpenChannel = copy(useFeeRate = __v)
    def withRemoteChanReserveSat(__v: org.bitcoins.core.number.UInt64): BatchOpenChannel = copy(remoteChanReserveSat = __v)
    def withMemo(__v: _root_.scala.Predef.String): BatchOpenChannel = copy(memo = __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 1 => {
          val __t = nodePubkey
          if (__t != _root_.com.google.protobuf.ByteString.EMPTY) __t else null
        }
        case 2 => {
          val __t = localFundingAmount
          if (__t != 0L) __t else null
        }
        case 3 => {
          val __t = pushSat
          if (__t != 0L) __t else null
        }
        case 4 => {
          val __t = `private`
          if (__t != false) __t else null
        }
        case 5 => {
          val __t = minHtlcMsat
          if (__t != 0L) __t else null
        }
        case 6 => {
          val __t = lnrpc.BatchOpenChannel._typemapper_remoteCsvDelay.toBase(remoteCsvDelay)
          if (__t != 0) __t else null
        }
        case 7 => {
          val __t = closeAddress
          if (__t != "") __t else null
        }
        case 8 => {
          val __t = pendingChanId
          if (__t != _root_.com.google.protobuf.ByteString.EMPTY) __t else null
        }
        case 9 => {
          val __t = commitmentType.javaValueDescriptor
          if (__t.getNumber() != 0) __t else null
        }
        case 10 => {
          val __t = lnrpc.BatchOpenChannel._typemapper_remoteMaxValueInFlightMsat.toBase(remoteMaxValueInFlightMsat)
          if (__t != 0L) __t else null
        }
        case 11 => {
          val __t = lnrpc.BatchOpenChannel._typemapper_remoteMaxHtlcs.toBase(remoteMaxHtlcs)
          if (__t != 0) __t else null
        }
        case 12 => {
          val __t = lnrpc.BatchOpenChannel._typemapper_maxLocalCsv.toBase(maxLocalCsv)
          if (__t != 0) __t else null
        }
        case 13 => {
          val __t = zeroConf
          if (__t != false) __t else null
        }
        case 14 => {
          val __t = scidAlias
          if (__t != false) __t else null
        }
        case 15 => {
          val __t = lnrpc.BatchOpenChannel._typemapper_baseFee.toBase(baseFee)
          if (__t != 0L) __t else null
        }
        case 16 => {
          val __t = lnrpc.BatchOpenChannel._typemapper_feeRate.toBase(feeRate)
          if (__t != 0L) __t else null
        }
        case 17 => {
          val __t = useBaseFee
          if (__t != false) __t else null
        }
        case 18 => {
          val __t = useFeeRate
          if (__t != false) __t else null
        }
        case 19 => {
          val __t = lnrpc.BatchOpenChannel._typemapper_remoteChanReserveSat.toBase(remoteChanReserveSat)
          if (__t != 0L) __t else null
        }
        case 20 => {
          val __t = memo
          if (__t != "") __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 1 => _root_.scalapb.descriptors.PByteString(nodePubkey)
        case 2 => _root_.scalapb.descriptors.PLong(localFundingAmount)
        case 3 => _root_.scalapb.descriptors.PLong(pushSat)
        case 4 => _root_.scalapb.descriptors.PBoolean(`private`)
        case 5 => _root_.scalapb.descriptors.PLong(minHtlcMsat)
        case 6 => _root_.scalapb.descriptors.PInt(lnrpc.BatchOpenChannel._typemapper_remoteCsvDelay.toBase(remoteCsvDelay))
        case 7 => _root_.scalapb.descriptors.PString(closeAddress)
        case 8 => _root_.scalapb.descriptors.PByteString(pendingChanId)
        case 9 => _root_.scalapb.descriptors.PEnum(commitmentType.scalaValueDescriptor)
        case 10 => _root_.scalapb.descriptors.PLong(lnrpc.BatchOpenChannel._typemapper_remoteMaxValueInFlightMsat.toBase(remoteMaxValueInFlightMsat))
        case 11 => _root_.scalapb.descriptors.PInt(lnrpc.BatchOpenChannel._typemapper_remoteMaxHtlcs.toBase(remoteMaxHtlcs))
        case 12 => _root_.scalapb.descriptors.PInt(lnrpc.BatchOpenChannel._typemapper_maxLocalCsv.toBase(maxLocalCsv))
        case 13 => _root_.scalapb.descriptors.PBoolean(zeroConf)
        case 14 => _root_.scalapb.descriptors.PBoolean(scidAlias)
        case 15 => _root_.scalapb.descriptors.PLong(lnrpc.BatchOpenChannel._typemapper_baseFee.toBase(baseFee))
        case 16 => _root_.scalapb.descriptors.PLong(lnrpc.BatchOpenChannel._typemapper_feeRate.toBase(feeRate))
        case 17 => _root_.scalapb.descriptors.PBoolean(useBaseFee)
        case 18 => _root_.scalapb.descriptors.PBoolean(useFeeRate)
        case 19 => _root_.scalapb.descriptors.PLong(lnrpc.BatchOpenChannel._typemapper_remoteChanReserveSat.toBase(remoteChanReserveSat))
        case 20 => _root_.scalapb.descriptors.PString(memo)
      }
    }
    def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
    def companion: lnrpc.BatchOpenChannel.type = lnrpc.BatchOpenChannel
    // @@protoc_insertion_point(GeneratedMessage[lnrpc.BatchOpenChannel])
}

object BatchOpenChannel extends scalapb.GeneratedMessageCompanion[lnrpc.BatchOpenChannel] {
  implicit def messageCompanion: scalapb.GeneratedMessageCompanion[lnrpc.BatchOpenChannel] = this
  def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): lnrpc.BatchOpenChannel = {
    var __nodePubkey: _root_.com.google.protobuf.ByteString = _root_.com.google.protobuf.ByteString.EMPTY
    var __localFundingAmount: _root_.scala.Long = 0L
    var __pushSat: _root_.scala.Long = 0L
    var __private: _root_.scala.Boolean = false
    var __minHtlcMsat: _root_.scala.Long = 0L
    var __remoteCsvDelay: _root_.scala.Int = 0
    var __closeAddress: _root_.scala.Predef.String = ""
    var __pendingChanId: _root_.com.google.protobuf.ByteString = _root_.com.google.protobuf.ByteString.EMPTY
    var __commitmentType: lnrpc.CommitmentType = lnrpc.CommitmentType.UNKNOWN_COMMITMENT_TYPE
    var __remoteMaxValueInFlightMsat: _root_.scala.Long = 0L
    var __remoteMaxHtlcs: _root_.scala.Int = 0
    var __maxLocalCsv: _root_.scala.Int = 0
    var __zeroConf: _root_.scala.Boolean = false
    var __scidAlias: _root_.scala.Boolean = false
    var __baseFee: _root_.scala.Long = 0L
    var __feeRate: _root_.scala.Long = 0L
    var __useBaseFee: _root_.scala.Boolean = false
    var __useFeeRate: _root_.scala.Boolean = false
    var __remoteChanReserveSat: _root_.scala.Long = 0L
    var __memo: _root_.scala.Predef.String = ""
    var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null
    var _done__ = false
    while (!_done__) {
      val _tag__ = _input__.readTag()
      _tag__ match {
        case 0 => _done__ = true
        case 10 =>
          __nodePubkey = _input__.readBytes()
        case 16 =>
          __localFundingAmount = _input__.readInt64()
        case 24 =>
          __pushSat = _input__.readInt64()
        case 32 =>
          __private = _input__.readBool()
        case 40 =>
          __minHtlcMsat = _input__.readInt64()
        case 48 =>
          __remoteCsvDelay = _input__.readUInt32()
        case 58 =>
          __closeAddress = _input__.readStringRequireUtf8()
        case 66 =>
          __pendingChanId = _input__.readBytes()
        case 72 =>
          __commitmentType = lnrpc.CommitmentType.fromValue(_input__.readEnum())
        case 80 =>
          __remoteMaxValueInFlightMsat = _input__.readUInt64()
        case 88 =>
          __remoteMaxHtlcs = _input__.readUInt32()
        case 96 =>
          __maxLocalCsv = _input__.readUInt32()
        case 104 =>
          __zeroConf = _input__.readBool()
        case 112 =>
          __scidAlias = _input__.readBool()
        case 120 =>
          __baseFee = _input__.readUInt64()
        case 128 =>
          __feeRate = _input__.readUInt64()
        case 136 =>
          __useBaseFee = _input__.readBool()
        case 144 =>
          __useFeeRate = _input__.readBool()
        case 152 =>
          __remoteChanReserveSat = _input__.readUInt64()
        case 162 =>
          __memo = _input__.readStringRequireUtf8()
        case tag =>
          if (_unknownFields__ == null) {
            _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
          }
          _unknownFields__.parseField(tag, _input__)
      }
    }
    lnrpc.BatchOpenChannel(
        nodePubkey = __nodePubkey,
        localFundingAmount = __localFundingAmount,
        pushSat = __pushSat,
        `private` = __private,
        minHtlcMsat = __minHtlcMsat,
        remoteCsvDelay = lnrpc.BatchOpenChannel._typemapper_remoteCsvDelay.toCustom(__remoteCsvDelay),
        closeAddress = __closeAddress,
        pendingChanId = __pendingChanId,
        commitmentType = __commitmentType,
        remoteMaxValueInFlightMsat = lnrpc.BatchOpenChannel._typemapper_remoteMaxValueInFlightMsat.toCustom(__remoteMaxValueInFlightMsat),
        remoteMaxHtlcs = lnrpc.BatchOpenChannel._typemapper_remoteMaxHtlcs.toCustom(__remoteMaxHtlcs),
        maxLocalCsv = lnrpc.BatchOpenChannel._typemapper_maxLocalCsv.toCustom(__maxLocalCsv),
        zeroConf = __zeroConf,
        scidAlias = __scidAlias,
        baseFee = lnrpc.BatchOpenChannel._typemapper_baseFee.toCustom(__baseFee),
        feeRate = lnrpc.BatchOpenChannel._typemapper_feeRate.toCustom(__feeRate),
        useBaseFee = __useBaseFee,
        useFeeRate = __useFeeRate,
        remoteChanReserveSat = lnrpc.BatchOpenChannel._typemapper_remoteChanReserveSat.toCustom(__remoteChanReserveSat),
        memo = __memo,
        unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
    )
  }
  implicit def messageReads: _root_.scalapb.descriptors.Reads[lnrpc.BatchOpenChannel] = _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.BatchOpenChannel(
        nodePubkey = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.com.google.protobuf.ByteString]).getOrElse(_root_.com.google.protobuf.ByteString.EMPTY),
        localFundingAmount = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Long]).getOrElse(0L),
        pushSat = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).map(_.as[_root_.scala.Long]).getOrElse(0L),
        `private` = __fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).map(_.as[_root_.scala.Boolean]).getOrElse(false),
        minHtlcMsat = __fieldsMap.get(scalaDescriptor.findFieldByNumber(5).get).map(_.as[_root_.scala.Long]).getOrElse(0L),
        remoteCsvDelay = lnrpc.BatchOpenChannel._typemapper_remoteCsvDelay.toCustom(__fieldsMap.get(scalaDescriptor.findFieldByNumber(6).get).map(_.as[_root_.scala.Int]).getOrElse(0)),
        closeAddress = __fieldsMap.get(scalaDescriptor.findFieldByNumber(7).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
        pendingChanId = __fieldsMap.get(scalaDescriptor.findFieldByNumber(8).get).map(_.as[_root_.com.google.protobuf.ByteString]).getOrElse(_root_.com.google.protobuf.ByteString.EMPTY),
        commitmentType = lnrpc.CommitmentType.fromValue(__fieldsMap.get(scalaDescriptor.findFieldByNumber(9).get).map(_.as[_root_.scalapb.descriptors.EnumValueDescriptor]).getOrElse(lnrpc.CommitmentType.UNKNOWN_COMMITMENT_TYPE.scalaValueDescriptor).number),
        remoteMaxValueInFlightMsat = lnrpc.BatchOpenChannel._typemapper_remoteMaxValueInFlightMsat.toCustom(__fieldsMap.get(scalaDescriptor.findFieldByNumber(10).get).map(_.as[_root_.scala.Long]).getOrElse(0L)),
        remoteMaxHtlcs = lnrpc.BatchOpenChannel._typemapper_remoteMaxHtlcs.toCustom(__fieldsMap.get(scalaDescriptor.findFieldByNumber(11).get).map(_.as[_root_.scala.Int]).getOrElse(0)),
        maxLocalCsv = lnrpc.BatchOpenChannel._typemapper_maxLocalCsv.toCustom(__fieldsMap.get(scalaDescriptor.findFieldByNumber(12).get).map(_.as[_root_.scala.Int]).getOrElse(0)),
        zeroConf = __fieldsMap.get(scalaDescriptor.findFieldByNumber(13).get).map(_.as[_root_.scala.Boolean]).getOrElse(false),
        scidAlias = __fieldsMap.get(scalaDescriptor.findFieldByNumber(14).get).map(_.as[_root_.scala.Boolean]).getOrElse(false),
        baseFee = lnrpc.BatchOpenChannel._typemapper_baseFee.toCustom(__fieldsMap.get(scalaDescriptor.findFieldByNumber(15).get).map(_.as[_root_.scala.Long]).getOrElse(0L)),
        feeRate = lnrpc.BatchOpenChannel._typemapper_feeRate.toCustom(__fieldsMap.get(scalaDescriptor.findFieldByNumber(16).get).map(_.as[_root_.scala.Long]).getOrElse(0L)),
        useBaseFee = __fieldsMap.get(scalaDescriptor.findFieldByNumber(17).get).map(_.as[_root_.scala.Boolean]).getOrElse(false),
        useFeeRate = __fieldsMap.get(scalaDescriptor.findFieldByNumber(18).get).map(_.as[_root_.scala.Boolean]).getOrElse(false),
        remoteChanReserveSat = lnrpc.BatchOpenChannel._typemapper_remoteChanReserveSat.toCustom(__fieldsMap.get(scalaDescriptor.findFieldByNumber(19).get).map(_.as[_root_.scala.Long]).getOrElse(0L)),
        memo = __fieldsMap.get(scalaDescriptor.findFieldByNumber(20).get).map(_.as[_root_.scala.Predef.String]).getOrElse("")
      )
    case _ => throw new RuntimeException("Expected PMessage")
  }
  def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = LightningProto.javaDescriptor.getMessageTypes().get(70)
  def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = LightningProto.scalaDescriptor.messages(70)
  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[_] = {
    (__fieldNumber: @_root_.scala.unchecked) match {
      case 9 => lnrpc.CommitmentType
    }
  }
  lazy val defaultInstance = lnrpc.BatchOpenChannel(
    nodePubkey = _root_.com.google.protobuf.ByteString.EMPTY,
    localFundingAmount = 0L,
    pushSat = 0L,
    `private` = false,
    minHtlcMsat = 0L,
    remoteCsvDelay = lnrpc.BatchOpenChannel._typemapper_remoteCsvDelay.toCustom(0),
    closeAddress = "",
    pendingChanId = _root_.com.google.protobuf.ByteString.EMPTY,
    commitmentType = lnrpc.CommitmentType.UNKNOWN_COMMITMENT_TYPE,
    remoteMaxValueInFlightMsat = lnrpc.BatchOpenChannel._typemapper_remoteMaxValueInFlightMsat.toCustom(0L),
    remoteMaxHtlcs = lnrpc.BatchOpenChannel._typemapper_remoteMaxHtlcs.toCustom(0),
    maxLocalCsv = lnrpc.BatchOpenChannel._typemapper_maxLocalCsv.toCustom(0),
    zeroConf = false,
    scidAlias = false,
    baseFee = lnrpc.BatchOpenChannel._typemapper_baseFee.toCustom(0L),
    feeRate = lnrpc.BatchOpenChannel._typemapper_feeRate.toCustom(0L),
    useBaseFee = false,
    useFeeRate = false,
    remoteChanReserveSat = lnrpc.BatchOpenChannel._typemapper_remoteChanReserveSat.toCustom(0L),
    memo = ""
  )
  implicit class BatchOpenChannelLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, lnrpc.BatchOpenChannel]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, lnrpc.BatchOpenChannel](_l) {
    def nodePubkey: _root_.scalapb.lenses.Lens[UpperPB, _root_.com.google.protobuf.ByteString] = field(_.nodePubkey)((c_, f_) => c_.copy(nodePubkey = f_))
    def localFundingAmount: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Long] = field(_.localFundingAmount)((c_, f_) => c_.copy(localFundingAmount = f_))
    def pushSat: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Long] = field(_.pushSat)((c_, f_) => c_.copy(pushSat = f_))
    def `private`: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Boolean] = field(_.`private`)((c_, f_) => c_.copy(`private` = f_))
    def minHtlcMsat: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Long] = field(_.minHtlcMsat)((c_, f_) => c_.copy(minHtlcMsat = f_))
    def remoteCsvDelay: _root_.scalapb.lenses.Lens[UpperPB, org.bitcoins.core.number.UInt32] = field(_.remoteCsvDelay)((c_, f_) => c_.copy(remoteCsvDelay = f_))
    def closeAddress: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.closeAddress)((c_, f_) => c_.copy(closeAddress = f_))
    def pendingChanId: _root_.scalapb.lenses.Lens[UpperPB, _root_.com.google.protobuf.ByteString] = field(_.pendingChanId)((c_, f_) => c_.copy(pendingChanId = f_))
    def commitmentType: _root_.scalapb.lenses.Lens[UpperPB, lnrpc.CommitmentType] = field(_.commitmentType)((c_, f_) => c_.copy(commitmentType = f_))
    def remoteMaxValueInFlightMsat: _root_.scalapb.lenses.Lens[UpperPB, org.bitcoins.core.number.UInt64] = field(_.remoteMaxValueInFlightMsat)((c_, f_) => c_.copy(remoteMaxValueInFlightMsat = f_))
    def remoteMaxHtlcs: _root_.scalapb.lenses.Lens[UpperPB, org.bitcoins.core.number.UInt32] = field(_.remoteMaxHtlcs)((c_, f_) => c_.copy(remoteMaxHtlcs = f_))
    def maxLocalCsv: _root_.scalapb.lenses.Lens[UpperPB, org.bitcoins.core.number.UInt32] = field(_.maxLocalCsv)((c_, f_) => c_.copy(maxLocalCsv = f_))
    def zeroConf: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Boolean] = field(_.zeroConf)((c_, f_) => c_.copy(zeroConf = f_))
    def scidAlias: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Boolean] = field(_.scidAlias)((c_, f_) => c_.copy(scidAlias = f_))
    def baseFee: _root_.scalapb.lenses.Lens[UpperPB, org.bitcoins.core.number.UInt64] = field(_.baseFee)((c_, f_) => c_.copy(baseFee = f_))
    def feeRate: _root_.scalapb.lenses.Lens[UpperPB, org.bitcoins.core.number.UInt64] = field(_.feeRate)((c_, f_) => c_.copy(feeRate = f_))
    def useBaseFee: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Boolean] = field(_.useBaseFee)((c_, f_) => c_.copy(useBaseFee = f_))
    def useFeeRate: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Boolean] = field(_.useFeeRate)((c_, f_) => c_.copy(useFeeRate = f_))
    def remoteChanReserveSat: _root_.scalapb.lenses.Lens[UpperPB, org.bitcoins.core.number.UInt64] = field(_.remoteChanReserveSat)((c_, f_) => c_.copy(remoteChanReserveSat = f_))
    def memo: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.memo)((c_, f_) => c_.copy(memo = f_))
  }
  final val NODE_PUBKEY_FIELD_NUMBER = 1
  final val LOCAL_FUNDING_AMOUNT_FIELD_NUMBER = 2
  final val PUSH_SAT_FIELD_NUMBER = 3
  final val PRIVATE_FIELD_NUMBER = 4
  final val MIN_HTLC_MSAT_FIELD_NUMBER = 5
  final val REMOTE_CSV_DELAY_FIELD_NUMBER = 6
  final val CLOSE_ADDRESS_FIELD_NUMBER = 7
  final val PENDING_CHAN_ID_FIELD_NUMBER = 8
  final val COMMITMENT_TYPE_FIELD_NUMBER = 9
  final val REMOTE_MAX_VALUE_IN_FLIGHT_MSAT_FIELD_NUMBER = 10
  final val REMOTE_MAX_HTLCS_FIELD_NUMBER = 11
  final val MAX_LOCAL_CSV_FIELD_NUMBER = 12
  final val ZERO_CONF_FIELD_NUMBER = 13
  final val SCID_ALIAS_FIELD_NUMBER = 14
  final val BASE_FEE_FIELD_NUMBER = 15
  final val FEE_RATE_FIELD_NUMBER = 16
  final val USE_BASE_FEE_FIELD_NUMBER = 17
  final val USE_FEE_RATE_FIELD_NUMBER = 18
  final val REMOTE_CHAN_RESERVE_SAT_FIELD_NUMBER = 19
  final val MEMO_FIELD_NUMBER = 20
  @transient
  private[lnrpc] val _typemapper_remoteCsvDelay: _root_.scalapb.TypeMapper[_root_.scala.Int, org.bitcoins.core.number.UInt32] = implicitly[_root_.scalapb.TypeMapper[_root_.scala.Int, org.bitcoins.core.number.UInt32]]
  @transient
  private[lnrpc] val _typemapper_remoteMaxValueInFlightMsat: _root_.scalapb.TypeMapper[_root_.scala.Long, org.bitcoins.core.number.UInt64] = implicitly[_root_.scalapb.TypeMapper[_root_.scala.Long, org.bitcoins.core.number.UInt64]]
  @transient
  private[lnrpc] val _typemapper_remoteMaxHtlcs: _root_.scalapb.TypeMapper[_root_.scala.Int, org.bitcoins.core.number.UInt32] = implicitly[_root_.scalapb.TypeMapper[_root_.scala.Int, org.bitcoins.core.number.UInt32]]
  @transient
  private[lnrpc] val _typemapper_maxLocalCsv: _root_.scalapb.TypeMapper[_root_.scala.Int, org.bitcoins.core.number.UInt32] = implicitly[_root_.scalapb.TypeMapper[_root_.scala.Int, org.bitcoins.core.number.UInt32]]
  @transient
  private[lnrpc] val _typemapper_baseFee: _root_.scalapb.TypeMapper[_root_.scala.Long, org.bitcoins.core.number.UInt64] = implicitly[_root_.scalapb.TypeMapper[_root_.scala.Long, org.bitcoins.core.number.UInt64]]
  @transient
  private[lnrpc] val _typemapper_feeRate: _root_.scalapb.TypeMapper[_root_.scala.Long, org.bitcoins.core.number.UInt64] = implicitly[_root_.scalapb.TypeMapper[_root_.scala.Long, org.bitcoins.core.number.UInt64]]
  @transient
  private[lnrpc] val _typemapper_remoteChanReserveSat: _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(
    nodePubkey: _root_.com.google.protobuf.ByteString,
    localFundingAmount: _root_.scala.Long,
    pushSat: _root_.scala.Long,
    `private`: _root_.scala.Boolean,
    minHtlcMsat: _root_.scala.Long,
    remoteCsvDelay: org.bitcoins.core.number.UInt32,
    closeAddress: _root_.scala.Predef.String,
    pendingChanId: _root_.com.google.protobuf.ByteString,
    commitmentType: lnrpc.CommitmentType,
    remoteMaxValueInFlightMsat: org.bitcoins.core.number.UInt64,
    remoteMaxHtlcs: org.bitcoins.core.number.UInt32,
    maxLocalCsv: org.bitcoins.core.number.UInt32,
    zeroConf: _root_.scala.Boolean,
    scidAlias: _root_.scala.Boolean,
    baseFee: org.bitcoins.core.number.UInt64,
    feeRate: org.bitcoins.core.number.UInt64,
    useBaseFee: _root_.scala.Boolean,
    useFeeRate: _root_.scala.Boolean,
    remoteChanReserveSat: org.bitcoins.core.number.UInt64,
    memo: _root_.scala.Predef.String
  ): _root_.lnrpc.BatchOpenChannel = _root_.lnrpc.BatchOpenChannel(
    nodePubkey,
    localFundingAmount,
    pushSat,
    `private`,
    minHtlcMsat,
    remoteCsvDelay,
    closeAddress,
    pendingChanId,
    commitmentType,
    remoteMaxValueInFlightMsat,
    remoteMaxHtlcs,
    maxLocalCsv,
    zeroConf,
    scidAlias,
    baseFee,
    feeRate,
    useBaseFee,
    useFeeRate,
    remoteChanReserveSat,
    memo
  )
  // @@protoc_insertion_point(GeneratedMessageCompanion[lnrpc.BatchOpenChannel])
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy