Allow additional command types
OptionalaccountId?: stringAccount ID in format 'meta1_{accountNumber}'
Server endpoint (usually 'meta1')
OptionalgetAndSubscribeElement?: { eid: number; keys?: string[] }Get current data and subscribe to updates
OptionallogonWithServiceTicket?: { serviceTicket: string }Login with service ticket - second step in auth flow
Optionalping?: Record<string, never>Ping command for latency testing
OptionalregisterClientInfo?: { clientInfo: ClientInfo }Register client info - first step in auth flow
OptionalsubscribeElement?: { eid: number; keys?: string[] }Subscribe to an element ID
OptionaltradeTransaction?: { newMarketOrder: INewMarketOrderEvent }Execute a trade transaction
OptionalunsubscribeElement?: { eid: number; keys?: string[] }Unsubscribe from an element ID
CoreAPI command payload sent via WebSocket.
Wraps all WebSocket commands in the standard CoreAPI format used by XTB. Each command includes an endpoint and account information, plus the specific command payload (subscription, trade, auth, etc.).
Example