DrandHttpApi

class DrandHttpApi(baseUrl: String = "https://api.drand.sh", httpClient: HttpClient = createDefaultHttpClient()) : DrandApi

HTTP implementation of the drand API using Ktor client.

Provides access to drand's v2 HTTP API with proper error handling and JSON serialization.

Example:

val api = DrandHttpApi()
val beacon = api.beacons.latest("default").getOrThrow()
api.close()

Parameters

baseUrl

Base URL for the drand API (default: https://api.drand.sh)

httpClient

Custom HttpClient instance (optional, for testing/customization)

Constructors

Link copied to clipboard
constructor(baseUrl: String = "https://api.drand.sh", httpClient: HttpClient = createDefaultHttpClient())

Properties

Link copied to clipboard

Operations for accessing drand networks by beacon ID.

Link copied to clipboard
open override val chains: DrandApi.ChainOperations

Operations for accessing drand networks by chain hash.

Functions

Link copied to clipboard
open override fun close()