ChainOperations

interface ChainOperations

Operations for accessing drand networks by chain hash.

All methods in this interface accept a chain hash (hex-encoded, 64 characters) and return Result types for safe error handling.

Chain hashes are more explicit than beacon IDs and cannot be reassigned, making them suitable for applications requiring maximum reliability.

Functions

Link copied to clipboard
abstract suspend fun atRound(chainHash: String, round: Long): Result<RandomnessBeacon>

Gets a specific randomness beacon by round number.

Link copied to clipboard
abstract suspend fun health(chainHash: String): Result<HealthStatus>

Gets the health status of a drand network by chain hash.

Link copied to clipboard
abstract suspend fun info(chainHash: String): Result<ChainInfo>

Gets the chain configuration information by chain hash.

Link copied to clipboard
abstract suspend fun latest(chainHash: String): Result<RandomnessBeacon>

Gets the most recent randomness beacon from a network by chain hash.

Link copied to clipboard
abstract suspend fun list(): Result<List<String>>

Lists all available chain hashes on this drand API endpoint.

Link copied to clipboard
abstract suspend fun next(chainHash: String): Result<RandomnessBeacon>

Waits for and returns the next randomness beacon (long polling).