Package-level declarations

Types

Link copied to clipboard

Indexer API version mismatch or unsupported feature.

Link copied to clipboard
sealed interface BlockHashLookup

The outcome of asking the indexer for the block hash at a specific height — IndexerClient.getBlockHashAtHeight. The three cases are kept apart because ChainResetGuard must react to them differently: a block that isn't on the chain is a reset signal, while a query that simply failed is a "can't tell, skip" signal. Collapsing both to null would let a transient indexer failure look identical to a genuinely-shorter chain.

Link copied to clipboard

Certificate pinning exception.

Link copied to clipboard
class GraphQLException(val errors: List<String>, message: String) : IndexerException

GraphQL error in response.

Link copied to clipboard

GraphQL queries and subscriptions for Midnight Indexer API.

Link copied to clipboard
class HttpException(val statusCode: Int, message: String, cause: Throwable? = null) : IndexerException

HTTP error from indexer API (4xx or 5xx status).

Link copied to clipboard
interface IndexerClient

Client for the Midnight indexer GraphQL API.

Link copied to clipboard
class IndexerClientImpl(httpClient: HttpClient, baseUrl: String = NetworkConfig.forNetwork(MidnightNetwork.PREVIEW).indexerBaseUrl, pinnedCertificates: List<String> = emptyList(), developmentMode: Boolean = false) : IndexerClient

Ktor-based implementation of IndexerClient for the Midnight indexer GraphQL API.

Link copied to clipboard

Base exception for all indexer-related errors.

Link copied to clipboard
class InvalidResponseException(message: String, cause: Throwable? = null) : IndexerException

Invalid or malformed response from indexer.

Link copied to clipboard
class NetworkException(message: String, cause: Throwable? = null) : IndexerException

Network connectivity error (no internet, DNS failure, etc).

Link copied to clipboard
class RetryExhaustedException(message: String, val attempts: Int, cause: Throwable? = null) : IndexerException

Maximum retry attempts exceeded.

Link copied to clipboard
data class RetryPolicy(val maxAttempts: Int = 3, val initialDelayMs: Long = 1000, val maxDelayMs: Long = 16000, val backoffMultiplier: Double = 2.0)

Retry policy for indexer API calls with exponential backoff.

Link copied to clipboard
class TimeoutException(message: String, cause: Throwable? = null) : IndexerException

Request timeout error.

Link copied to clipboard
data class TlsConfiguration(val pinnedCertificates: List<String> = emptyList(), val allowLocalhostHttp: Boolean = false, val minTlsVersion: TlsVersion = TlsVersion.TLS_1_2)

TLS/SSL configuration for secure indexer communication.

Link copied to clipboard

TLS protocol versions.

Functions

Link copied to clipboard
suspend fun <T> retryWithPolicy(policy: RetryPolicy = RetryPolicy(), block: suspend () -> T): T

Execute a suspending function with retry logic.