glassnode-api - v0.29.3
    Preparing search index...

    Interface CallMetricOptions<S>

    Options of GlassnodeAPI.callMetric when validating the response: the per-call options plus the Zod schema the response body must match. The result is typed as the schema's output (z.output<S>, so transforms apply), and a mismatch rejects with a GlassnodeValidationError. Use the exported TimeSeriesResponseSchema / TimeSeriesObjectResponseSchema, or any Zod schema of your own.

    interface CallMetricOptions<S extends ZodType = ZodType> {
        schema: S;
        signal?: AbortSignal;
        timeout?: number;
    }

    Type Parameters

    • S extends ZodType = ZodType

    Hierarchy (View Summary)

    Index
    schema: S

    Zod schema the response body must match.

    signal?: AbortSignal

    Cancels the call: the in-flight attempt, any retry wait, and every further retry. The call then rejects with a GlassnodeAbortError (never retried) whose .cause is the signal's reason. An already-aborted signal rejects before any request is sent.

    For a deadline on the whole call (all attempts and retry waits together), pass AbortSignal.timeout(ms) here; timeout below applies to each attempt separately.

    With x402, an abort after a signed payment was sent surfaces as the fetch's GlassnodePaymentError (paymentMayHaveSettled: true) instead, since the payment may have settled. A custom fetch must honor init.signal for an in-flight request to be cancelled.

    timeout?: number

    Per-attempt timeout in ms for this call, overriding the config timeout (same semantics: each attempt is aborted after this many ms; the failure is a retryable GlassnodeNetworkError with timedOut: true). A positive integer up to 2147483647.