diff --git a/ton-kotlin-liteclient/src/commonMain/kotlin/org/ton/lite/client/LiteClient.kt b/ton-kotlin-liteclient/src/commonMain/kotlin/org/ton/lite/client/LiteClient.kt index 04d3099d..11a6aa24 100644 --- a/ton-kotlin-liteclient/src/commonMain/kotlin/org/ton/lite/client/LiteClient.kt +++ b/ton-kotlin-liteclient/src/commonMain/kotlin/org/ton/lite/client/LiteClient.kt @@ -36,6 +36,20 @@ public class LiteClient( coroutineContext: CoroutineContext, private val liteClientConfigGlobal: LiteClientConfigGlobal ) : Closeable, CoroutineScope { + public constructor( + coroutineContext: CoroutineContext, + liteServers: List + ) : this(coroutineContext, LiteClientConfigGlobal(liteServers = liteServers)) + + public constructor( + coroutineContext: CoroutineContext, + vararg liteServer: LiteServerDesc + ) : this(coroutineContext, liteServer.toList()) + + init { + require(liteClientConfigGlobal.liteServers.isNotEmpty()) { "No lite servers provided" } + } + private val logger: Logger = PrintLnLogger("LiteClient") override val coroutineContext: CoroutineContext = coroutineContext + CoroutineName("LiteClient") private val knownBlockIds: ArrayDeque = ArrayDeque(100)