跳至主要内容

Kotlin SDK — zeq

Kotlin 1.9+ client. Coroutines + kotlinx.serialization. Targets JVM, Android, and Kotlin/Native. Shares the same wire envelope as every other SDK.

Install

// build.gradle.kts
dependencies {
implementation("org.zeq:zeq-kotlin:1.287.5")
}

First call — public, no key

import org.zeq.pulse

suspend fun main() {
val p = pulse()
println("Zeqond ${p.zeqond} · phase ${"%.3f".format(p.phase)} · R(t) ${p.rT}")
}

Authed call — zeq.compute()

import org.zeq.ZeqClient
import org.zeq.ComputeRequest

suspend fun main() {
val zeq = ZeqClient.fromEnv() // reads $ZEQ_KEY

val r = zeq.compute(ComputeRequest(
operators = listOf("KO42", "QM5", "GR40"),
domain = "cross",
inputs = mapOf("t" to 0),
))

println("${r.value} ${r.unit} ± ${r.uncertainty}")
println("zeqProof: ${r.zeqProof}")
println("compliance: ${r.compliance.standardsAligned}")
}

The r.compliance field carries the ZeqCompliance v1 envelope.

Why Kotlin here

  • Android apps. Coroutines mean one suspend call per compute — no callback hell.
  • Server-side Ktor or Spring. Drop the SDK into your service handler; the same envelope shape SOC 2 expects flows straight through.
  • Multiplatform projects. The same expect/actual interface compiles for JVM, Android, iOS (via Kotlin/Native), and JS.

Compose with

Source