@somnia-chain/markets-sdk


@somnia-chain/markets-sdk / react / IndexerQueryState

Interface: IndexerQueryState<T>

Defined in: packages/sdk/src/hooks.ts:606

The state one useIndexerQuery exposes.

Type Parameters

T

T

Properties

data

data: T | undefined

Defined in: packages/sdk/src/hooks.ts:611

Latest successful result — undefined until the first response lands; the previous value is kept while a refetch is in flight or after it fails.


loading

loading: boolean

Defined in: packages/sdk/src/hooks.ts:613

True while a request is in flight (initial load and refetches alike).


error

error: Error | null

Defined in: packages/sdk/src/hooks.ts:615

The most recent request's failure, or null. Cleared when a new request starts.


refetch

refetch: () => void

Defined in: packages/sdk/src/hooks.ts:617

Re-run the query imperatively (e.g. a manual refresh button).

Returns

void


catchUpError?

optional catchUpError?: InvalidInputError | IndexerError

Defined in: packages/sdk/src/hooks.ts:628

Failure of a hook-owned wait for the indexer to catch up, when the hook runs one. Only useFundingRateSeries sets it today, and its wait reads getSyncStatus — so the reachable failures are exactly that member's union (SomniaMarketsClientGetSyncStatusError): IndexerError when the metadata request fails, InvalidInputError when a query variable is invalid. It stays undefined when no wait ran, when the wait succeeded, and when the caller cancelled the wait by unmounting or by changing the pool. It is separate from error, which belongs to the series query itself.