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

commonMain.terra.oracle.v1beta1.genesis.kt Maven / Gradle / Ivy

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

package terra.oracle.v1beta1

import kotlin.OptIn
import kotlin.String
import kotlin.ULong
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 = GenesisState.TYPE_URL)
@Serializable(with = GenesisState.KotlinxSerializer::class)
@SerialName(value = GenesisState.TYPE_URL)
public data class GenesisState(
  @ProtobufIndex(index = 1)
  public val params: Params = Params(),
  @ProtobufIndex(index = 2)
  public val feederDelegations: List = emptyList(),
  @ProtobufIndex(index = 3)
  public val exchangeRates: List = emptyList(),
  @ProtobufIndex(index = 4)
  public val missCounters: List = emptyList(),
  @ProtobufIndex(index = 5)
  public val aggregateExchangeRatePrevotes: List = emptyList(),
  @ProtobufIndex(index = 6)
  public val aggregateExchangeRateVotes: List = emptyList(),
  @ProtobufIndex(index = 7)
  public val tobinTaxes: List = emptyList(),
) : TypeProtobufMessage {
  public companion object {
    public const val TYPE_URL: String = "/terra.oracle.v1beta1.GenesisState"
  }

  @OptIn(ExperimentalSerializationApi::class)
  @Serializer(forClass = GenesisState::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`: GenesisState) {
      if (encoder is ProtobufConverterEncoder) {
        encoder.serialize(GenesisStateConverter, value)
        return
      }
      delegator.serialize(encoder, value)
    }

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

@AnnotationProtobufMessage(typeUrl = FeederDelegation.TYPE_URL)
@Serializable(with = FeederDelegation.KotlinxSerializer::class)
@SerialName(value = FeederDelegation.TYPE_URL)
public data class FeederDelegation(
  @ProtobufIndex(index = 1)
  public val feederAddress: String = "",
  @ProtobufIndex(index = 2)
  public val validatorAddress: String = "",
) : TypeProtobufMessage {
  public companion object {
    public const val TYPE_URL: String = "/terra.oracle.v1beta1.FeederDelegation"
  }

  @OptIn(ExperimentalSerializationApi::class)
  @Serializer(forClass = FeederDelegation::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`: FeederDelegation) {
      if (encoder is ProtobufConverterEncoder) {
        encoder.serialize(FeederDelegationConverter, value)
        return
      }
      delegator.serialize(encoder, value)
    }

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

@AnnotationProtobufMessage(typeUrl = MissCounter.TYPE_URL)
@Serializable(with = MissCounter.KotlinxSerializer::class)
@SerialName(value = MissCounter.TYPE_URL)
public data class MissCounter(
  @ProtobufIndex(index = 1)
  public val validatorAddress: String = "",
  @ProtobufIndex(index = 2)
  public val missCounter: ULong = 0uL,
) : TypeProtobufMessage {
  public companion object {
    public const val TYPE_URL: String = "/terra.oracle.v1beta1.MissCounter"
  }

  @OptIn(ExperimentalSerializationApi::class)
  @Serializer(forClass = MissCounter::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`: MissCounter) {
      if (encoder is ProtobufConverterEncoder) {
        encoder.serialize(MissCounterConverter, value)
        return
      }
      delegator.serialize(encoder, value)
    }

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

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

  @OptIn(ExperimentalSerializationApi::class)
  @Serializer(forClass = TobinTax::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`: TobinTax) {
      if (encoder is ProtobufConverterEncoder) {
        encoder.serialize(TobinTaxConverter, value)
        return
      }
      delegator.serialize(encoder, value)
    }

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy