MEXC WebSocket API
Subscribe to MEXC spot WebSocket streams (deals, kline, depth, bookTicker, miniTicker) and authenticated account channels with HMAC signing.
Subscribe to MEXC spot WebSocket streams (deals, kline, depth, bookTicker, miniTicker) and authenticated account channels with HMAC signing.
MEXC spot WebSocket client — deals, kline, depth, bookTicker and miniTicker plus the listenKey-based private account stream.
TsgcWSAPI_MEXC
Windows, macOS, Linux, iOS, Android
Standard / Professional / Enterprise
Pair with a TsgcWebSocketClient and call SubscribeDeals / SubscribeKLine / SubscribeDepth — the component handles MEXC's Protobuf framing.
uses
sgcWebSocket, sgcWebSocket_API_MEXC;
var
WSClient: TsgcWebSocketClient;
MEXC: TsgcWSAPI_MEXC;
begin
WSClient := TsgcWebSocketClient.Create(nil);
MEXC := TsgcWSAPI_MEXC.Create(nil);
MEXC.Client := WSClient;
MEXC.MEXC.ApiKey := 'your-api-key';
MEXC.MEXC.ApiSecret := 'your-api-secret';
WSClient.Active := True;
MEXC.SubscribeDeals('BTCUSDT');
MEXC.SubscribeDepth('BTCUSDT');
MEXC.SubscribeKLine('BTCUSDT', mki5m);
end;
// uses: sgcWebSocket, sgcWebSocket_API_MEXC
TsgcWebSocketClient *WSClient = new TsgcWebSocketClient(this);
TsgcWSAPI_MEXC *MEXC = new TsgcWSAPI_MEXC(this);
MEXC->Client = WSClient;
WSClient->Active = true;
MEXC->SubscribeDeals("BTCUSDT");
MEXC->SubscribeDepth("BTCUSDT");
Protobuf payload decoding, spot market streams, account-data stream with automatic listenKey refresh.
MEXC v3 ships market data as Protobuf-encoded binary frames; the component decodes them and surfaces typed events.
SubscribeDeals, SubscribeDepth, SubscribeKLine, SubscribeBookTicker, SubscribeMiniTicker cover the spot public surface.
StartUserDataStream returns a listenKey; SubscribeListenKey opens the account-data WebSocket for balance / order / position updates.
MEXC sends ping frames; the component answers automatically. WatchDog re-subscribes after reconnect.
One TsgcWSAPI_MEXC instance can handle hundreds of symbols by chaining subscribe calls — routing is internal.
TsgcWSAPI_MEXC_Futures targets the MEXC futures contract gateway with the same component surface.
Fontes autoritativas das APIs que este componente implementa.
Acesse direto a referência do componente, baixe o projeto de demonstração pronto para rodar e baixe a versão de avaliação.
| Ajuda online — API_MEXC Referência completa de propriedades, métodos e eventos deste componente. | Abrir | |
| Projeto de demonstração — Demos\05.Crypto\15.MEXC Projeto de exemplo pronto para rodar. Acompanha o pacote sgcWebSockets — baixe a versão de avaliação abaixo. | Abrir | |
| Documento técnico (PDF) Features, quick start, code samples for Delphi & C++ Builder and primary-source references — this component only. | Abrir | |
| Manual do usuário (PDF) Manual abrangente cobrindo todos os componentes da biblioteca. | Abrir |