@mywebapi.com/sdk - v0.1.0
    Preparing search index...

    Class MT5V2SignalRClient

    SignalR wrapper around /hubs/mt5/v2. Holds a single HubConnection and exposes typed helpers for the MT5 reduced real-time scope.

    Lifecycle:

    1. new MT5V2SignalRClient(opts) — synchronous; resolves the token provider and pre-computes the hub URL but does NOT open a socket.
    2. Register callbacks via onConnectionStatus() — MAY be called before start(). Registering before start() is recommended so the initial post-handshake OnConnectionStatus push is never missed.
    3. await client.start() — opens the WebSocket connection. All callbacks queued before start() are attached to the HubConnection before the socket opens, guaranteeing they are in place before any server push arrives.
    4. Use streamMarginCallUpdates() to consume streams (requires open connection).
    5. await client.stop() — closes the connection.
    Index

    Constructors

    Accessors

    • get hubUrlForTest(): string

      The resolved hub URL including the tradePlatform query parameter. Intended for tests and diagnostic tooling.

      Returns string

    Methods

    • Returns the underlying HubConnection for advanced use (manual .on/.invoke calls not covered by the typed helpers below). Throws if not started yet.

      Returns HubConnection

    • Subscribe to OnConnectionStatus callbacks. The server pushes one such event right after the handshake completes. May be called before or after start() — registering before start() is strongly recommended to avoid missing the initial post-handshake push.

      Parameters

      Returns void

    • Open the SignalR connection. Idempotent — calling twice while already connected resolves without action.

      Returns Promise<void>

    • Close the SignalR connection. Safe to call on a connection that was never started or has already been closed.

      Returns Promise<void>

    • Resolve a token via this client's token provider. Intended for tests to verify that the shared provider is wired correctly.

      Returns Promise<string>