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

commonMain.terra.vesting.v1beta1.vesting.kt Maven / Gradle / Ivy

There is a newer version: 3.1.6-4
Show newest version
// Transform from terra/vesting/v1beta1/vesting.proto
@file:GeneratorVersion(version = "0.5.2")

package terra.vesting.v1beta1

import cosmos.vesting.v1beta1.BaseVestingAccount
import kotlin.Long
import kotlin.OptIn
import kotlin.String
import kotlin.collections.List
import kotlin.collections.emptyList
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.KSerializer
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import kotlinx.serialization.Serializer
import kotlinx.serialization.descriptors.SerialDescriptor
import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder
import kr.jadekim.protobuf.`annotation`.GeneratorVersion
import kr.jadekim.protobuf.`annotation`.ProtobufIndex
import kr.jadekim.protobuf.kotlinx.ProtobufConverterDecoder
import kr.jadekim.protobuf.kotlinx.ProtobufConverterEncoder
import kr.jadekim.protobuf.`annotation`.ProtobufMessage as AnnotationProtobufMessage
import kr.jadekim.protobuf.type.ProtobufMessage as TypeProtobufMessage

@AnnotationProtobufMessage(typeUrl = LazyGradedVestingAccount.TYPE_URL)
@Serializable(with = LazyGradedVestingAccount.KotlinxSerializer::class)
@SerialName(value = LazyGradedVestingAccount.TYPE_URL)
public data class LazyGradedVestingAccount(
  @ProtobufIndex(index = 1)
  public val baseVestingAccount: BaseVestingAccount = BaseVestingAccount(),
  @ProtobufIndex(index = 2)
  public val vestingSchedules: List = emptyList(),
) : TypeProtobufMessage {
  public companion object {
    public const val TYPE_URL: String = "/terra.vesting.v1beta1.LazyGradedVestingAccount"
  }

  @OptIn(ExperimentalSerializationApi::class)
  @Serializer(forClass = LazyGradedVestingAccount::class)
  private object ReflectSerializer

  public object KotlinxSerializer : KSerializer {
    private val delegator: KSerializer = ReflectSerializer

    override val descriptor: SerialDescriptor = delegator.descriptor

    override fun serialize(encoder: Encoder, `value`: LazyGradedVestingAccount) {
      if (encoder is ProtobufConverterEncoder) {
        encoder.serialize(LazyGradedVestingAccountConverter, value)
        return
      }
      delegator.serialize(encoder, value)
    }

    override fun deserialize(decoder: Decoder): LazyGradedVestingAccount {
      if (decoder is ProtobufConverterDecoder) {
        return decoder.deserialize(LazyGradedVestingAccountConverter)
      }
      return delegator.deserialize(decoder)
    }
  }
}

@AnnotationProtobufMessage(typeUrl = Schedule.TYPE_URL)
@Serializable(with = Schedule.KotlinxSerializer::class)
@SerialName(value = Schedule.TYPE_URL)
public data class Schedule(
  @ProtobufIndex(index = 1)
  public val startTime: Long = 0L,
  @ProtobufIndex(index = 2)
  public val endTime: Long = 0L,
  @ProtobufIndex(index = 3)
  public val ratio: String = "",
) : TypeProtobufMessage {
  public companion object {
    public const val TYPE_URL: String = "/terra.vesting.v1beta1.Schedule"
  }

  @OptIn(ExperimentalSerializationApi::class)
  @Serializer(forClass = Schedule::class)
  private object ReflectSerializer

  public object KotlinxSerializer : KSerializer {
    private val delegator: KSerializer = ReflectSerializer

    override val descriptor: SerialDescriptor = delegator.descriptor

    override fun serialize(encoder: Encoder, `value`: Schedule) {
      if (encoder is ProtobufConverterEncoder) {
        encoder.serialize(ScheduleConverter, value)
        return
      }
      delegator.serialize(encoder, value)
    }

    override fun deserialize(decoder: Decoder): Schedule {
      if (decoder is ProtobufConverterDecoder) {
        return decoder.deserialize(ScheduleConverter)
      }
      return delegator.deserialize(decoder)
    }
  }
}

@AnnotationProtobufMessage(typeUrl = VestingSchedule.TYPE_URL)
@Serializable(with = VestingSchedule.KotlinxSerializer::class)
@SerialName(value = VestingSchedule.TYPE_URL)
public data class VestingSchedule(
  @ProtobufIndex(index = 1)
  public val denom: String = "",
  @ProtobufIndex(index = 2)
  public val schedules: List = emptyList(),
) : TypeProtobufMessage {
  public companion object {
    public const val TYPE_URL: String = "/terra.vesting.v1beta1.VestingSchedule"
  }

  @OptIn(ExperimentalSerializationApi::class)
  @Serializer(forClass = VestingSchedule::class)
  private object ReflectSerializer

  public object KotlinxSerializer : KSerializer {
    private val delegator: KSerializer = ReflectSerializer

    override val descriptor: SerialDescriptor = delegator.descriptor

    override fun serialize(encoder: Encoder, `value`: VestingSchedule) {
      if (encoder is ProtobufConverterEncoder) {
        encoder.serialize(VestingScheduleConverter, value)
        return
      }
      delegator.serialize(encoder, value)
    }

    override fun deserialize(decoder: Decoder): VestingSchedule {
      if (decoder is ProtobufConverterDecoder) {
        return decoder.deserialize(VestingScheduleConverter)
      }
      return delegator.deserialize(decoder)
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy