Interface OpenAlgoLiveConfig

interface OpenAlgoLiveConfig {
    apiKey: string;
    auth?: { ackTimeoutMs?: number; requireAck?: boolean };
    baseUrl: string;
    depthLevel?: number;
    fetchImpl?: (
        input: URL | RequestInfo,
        init?: RequestInit,
    ) => Promise<Response>;
    heartbeat?: { probeMs?: number; timeoutMs?: number };
    reconnect?: {
        baseDelayMs?: number;
        enabled?: boolean;
        jitter?: boolean;
        maxAttempts?: number;
        maxDelayMs?: number;
        random?: () => number;
    };
    socketFactory?: SocketFactory;
    timezone?: string;
    volumeMode?: VolumeMode;
    wsUrl: string;
}

Hierarchy (View Summary)

Properties

apiKey: string
auth?: { ackTimeoutMs?: number; requireAck?: boolean }

Type declaration

  • OptionalackTimeoutMs?: number

    Wait for the acknowledgement this long before failing the connection (default 5000).

  • OptionalrequireAck?: boolean

    Require a positive acknowledgement (default true). Set false only for a proxy build known to answer nothing: the connection then counts as authenticated on transport open, and one AUTH_UNACKNOWLEDGED warning is raised per connection so the missing guarantee is visible rather than silently assumed.

baseUrl: string
depthLevel?: number

Default book depth for subscribeDepth, broker-dependent (5/20/30/50). Omitted leaves it to the broker, which is what this feed always did. A per-call opts.depthLevel overrides it.

fetchImpl?: (input: URL | RequestInfo, init?: RequestInit) => Promise<Response>

Injectable fetch (defaults to global fetch); lets the adapter be tested offline.

Type declaration

    • (input: URL | RequestInfo, init?: RequestInit): Promise<Response>
    • Parameters

      • input: URL | RequestInfo
      • Optionalinit: RequestInit

      Returns Promise<Response>

heartbeat?: { probeMs?: number; timeoutMs?: number }
reconnect?: {
    baseDelayMs?: number;
    enabled?: boolean;
    jitter?: boolean;
    maxAttempts?: number;
    maxDelayMs?: number;
    random?: () => number;
}

Socket policy, passed straight to OpenAlgoWsFeed. Present because the handshake gate, the liveness watchdog and the backoff all have escape hatches that were otherwise unreachable through this composed feed: a proxy build that answers nothing needs auth: { requireAck: false }, and a host with no way to say so would just see a chart that never receives a tick.

Type declaration

  • OptionalbaseDelayMs?: number
  • Optionalenabled?: boolean
  • Optionaljitter?: boolean

    Full jitter on each delay (default true). Off gives the old lockstep timing.

  • OptionalmaxAttempts?: number
  • OptionalmaxDelayMs?: number
  • Optionalrandom?: () => number

    Injectable [0,1) source, so a test pins the delay instead of guessing it.

socketFactory?: SocketFactory

Inject a custom socket (tests, React Native, non-browser runtimes).

timezone?: string

Zone calendar intervals bucket in (default IST). Should be the chart's configured timezone: a monthly bar opens at local midnight on the first, and that instant differs by exchange.

volumeMode?: VolumeMode

Volume accounting for the live candle builder (default 'ltq-sum').

'day-delta' also selects the wire mode: a cumulative day volume only exists on the Quote stream, so this feed subscribes Quote rather than LTP for it.

wsUrl: string

WS proxy URL, e.g. ws://127.0.0.1:8765.