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

commonMain.org.ton.api.dht.functions.DhtQuery.kt Maven / Gradle / Ivy

package org.ton.api.dht.functions

import io.ktor.utils.io.core.*
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import org.ton.api.dht.DhtNode
import org.ton.tl.*

public interface DhtQueryFunction {
    public fun query(node: DhtNode)
}

@SerialName("dht.query")
@Serializable
public data class DhtQuery(
    val node: DhtNode
) {
    public companion object : TlCodec by DhtQueryTlConstructor
}

private object DhtQueryTlConstructor : TlConstructor(
    schema = "dht.query node:dht.node = True"
) {
    override fun decode(reader: TlReader): DhtQuery {
        val node = reader.read(DhtNode)
        return DhtQuery(node)
    }

    override fun encode(writer: TlWriter, value: DhtQuery) {
        writer.write(DhtNode, value.node)
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy