Skip to main content

Construction

Construction is synchronous and never makes a network call. Call .health() to verify the API is reachable.

Constructor signature

lumina.health()

Returns API status, on-chain block height, and the canonical contract address book. Public — no API key required.

lumina.getContracts()

Cached, health-derived address book. First call hits /health; subsequent calls return the cached map for the lifetime of the LuminaClient instance.
Introduced in 0.5.2; unchanged in 0.6.0. Prefer this over hard-coding addresses in your bot — redeployments propagate without an SDK bump.

Sub-resources

Errors

Every non-2xx response throws LuminaError:
Network-level errors (connection refused, timeout) are also wrapped as LuminaError with status === 0 and code === 'network_error'.

Custom fetch (advanced)

Both Node 18+ and modern browsers ship globalThis.fetch, which is what the SDK uses. There’s no override hook on the client itself; if you need to intercept requests (for instrumentation, mock-in-test, etc.) overwrite globalThis.fetch before constructing the client.