xtb-api-unofficial - v0.1.0
    Preparing search index...

    Interface WSResponse

    WebSocket response message format.

    Standard response format received from XTB WebSocket API. Contains either successful response data or error information.

    // Success response
    const success: WSResponse = {
    reqId: 'ping_1640995200_1',
    response: [{ xpong: { time: 1640995200000 } }]
    };

    // Error response
    const error: WSResponse = {
    reqId: 'invalid_1640995200_2',
    error: { code: 'INVALID_COMMAND', message: 'Unknown command' }
    };
    interface WSResponse {
        data?: unknown;
        error?: { code: string; message: string };
        reqId: string;
        response?: unknown[];
    }

    Hierarchy (View Summary)

    Index

    Properties

    data?: unknown

    Alternative response data format

    error?: { code: string; message: string }

    Error information (if failed)

    reqId: string

    Request ID matching the original request

    response?: unknown[]

    Response data array (if successful)