Constructors

Accessors

Methods

  • Enter reconciliation: the connection dropped or a gap was seen, so our picture may be behind. Nothing is concluded here; call onReconnect with the fresh book to conclude anything. An AMBIGUOUS row is left alone, since only the broker can take it out of that state.

    Returns void

  • Client ids of a provider bracket's legs.

    Parameters

    • clientId: string

    Returns undefined | { stopLoss?: string; takeProfit?: string }

  • The broker's own last word. Undefined means the broker has said nothing about this order yet, however far state has advanced on transport results.

    Parameters

    • clientId: string

    Returns undefined | OrderStatus

  • Force-send any pending modify (e.g. on drag end).

    Parameters

    • clientId: string

    Returns Promise<void>

  • Link two orders as OCO: when one fills/cancels, the other is cancelled.

    Parameters

    • clientIdA: string
    • clientIdB: string

    Returns void

  • An order row from the broker's stream or book, matched by broker id or, failing that, by the client token the broker echoes. The token is the only handle on a write whose answer was lost: it is how an AMBIGUOUS row learns its broker id and its outcome from the broker rather than from a guess. Rows may come in any order: a bracket leg that names an entry not yet bound is held, and applied when the entry binds.

    Parameters

    Returns void

  • Authoritative state from the broker: an order-stream push or a poll of the book. This is the ONLY input that writes brokerStatus; place, modify and cancel resolving never do.

    Parameters

    Returns void

  • Broker fill event (by broker id). Advances state and triggers OCO.

    Parameters

    • brokerId: string
    • full: boolean

    Returns void

  • Apply a fresh order-book snapshot. Absence is not death: state still goes to stale for existing consumers, but the intent becomes AMBIGUOUS, because an order missing from one snapshot means our picture is incomplete, not that the broker cancelled it. Such a row is never pruned. (v2 drops stale entirely; that removal has to wait for the contract bump.)

    Parameters

    • presentBrokerIds: ReadonlySet<string>

    Returns void

  • The account an order or command was sent for, fixed when it was sent.

    Parameters

    • clientId: string

    Returns undefined | string

  • Drop an AMBIGUOUS row and free its token, after the host has established from the broker's complete book that the request never arrived. Nothing here can decide that on its own, which is why it is a separate call. Any other row is left alone and the call returns false.

    Parameters

    • clientId: string

    Returns boolean

  • Rate-limited modify (drag): coalesces to the latest, sends at most every minModifyMs. An invalid price (tick/band/freeze) is NOT enqueued or sent: it surfaces via onValidationError so the UI can snap the line back.

    Parameters

    Returns void