Klient API MEXC dla Delphi & C++ Builder | eSeGeCe

MEXC WebSocket API

Subscribe to MEXC spot WebSocket streams (deals, kline, depth, bookTicker, miniTicker) and authenticated account channels with HMAC signing.

Szybka odpowiedź: TsgcWSAPI_MEXC to komponent sgcWebSockets, który łączy aplikacje Delphi i C++ Builder z MEXC. Dekoduje strumienie spot MEXC zakodowane w Protobuf (deals, kline, depth, bookTicker, miniTicker) i otwiera prywatny strumień danych konta oparty na listenKey.

TsgcWSAPI_MEXC

MEXC spot WebSocket client — deals, kline, depth, bookTicker and miniTicker plus the listenKey-based private account stream.

Klasa komponentu

TsgcWSAPI_MEXC

Protokół

MEXC Spot v3 API

Platformy

Windows, macOS, Linux, iOS, Android

Edycja

Standard / Professional / Enterprise

Upuść komponent, ustaw klucze, subskrybuj

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");

Co jest w środku

Protobuf payload decoding, spot market streams, account-data stream with automatic listenKey refresh.

Protobuf payloads

MEXC v3 ships market data as Protobuf-encoded binary frames; the component decodes them and surfaces typed events.

Spot streams

SubscribeDeals, SubscribeDepth, SubscribeKLine, SubscribeBookTicker, SubscribeMiniTicker cover the spot public surface.

Account-data stream

StartUserDataStream returns a listenKey; SubscribeListenKey opens the account-data WebSocket for balance / order / position updates.

Heartbeat

MEXC sends ping frames; the component answers automatically. WatchDog re-subscribes after reconnect.

Single-component routing

One TsgcWSAPI_MEXC instance can handle hundreds of symbols by chaining subscribe calls — routing is internal.

Futures sibling

TsgcWSAPI_MEXC_Futures targets the MEXC futures contract gateway with the same component surface.

Specyfikacje i źródła

Autorytatywne źródła API implementowanych przez ten komponent.

Dokumentacja i wersje demo

Deep-link do dokumentacji komponentu, gotowy do uruchomienia projekt demonstracyjny i pobranie wersji próbnej.

Pomoc online — API_MEXC Pełna dokumentacja właściwości, metod i zdarzeń tego komponentu.
Projekt demonstracyjny — Demos\05.Crypto\15.MEXC Gotowy do uruchomienia projekt przykładowy. Dostarczany wewnątrz pakietu sgcWebSockets — pobierz wersję próbną poniżej.
Dokument techniczny (PDF) Funkcje, szybki start, przykłady kodu dla Delphi i C++ Builder oraz odniesienia do źródeł pierwotnych — tylko ten komponent.
Podręcznik użytkownika (PDF) Kompleksowy podręcznik obejmujący każdy komponent biblioteki.

Najczęściej zadawane pytania

Częste pytania o komponent API MEXC dla Delphi i C++ Builder.

Upuść na formularz komponenty TsgcWebSocketClient i TsgcWSAPI_MEXC, przypisz klienta do właściwości Client komponentu API, ustaw MEXC.ApiKey i MEXC.ApiSecret, jeśli potrzebujesz strumienia konta, a następnie ustaw WSClient.Active := True i wywołuj metody subskrypcji takie jak SubscribeDeals, SubscribeDepth czy SubscribeKLine.
Komponent TsgcWSAPI_MEXC obsługuje spot WebSocket API MEXC. Dekoduje zakodowane w Protobuf strumienie rynkowe (deals, kline, depth, bookTicker, miniTicker) i otwiera strumień danych konta oparty na listenKey dla aktualizacji salda, zleceń i pozycji. Komponent siostrzany TsgcWSAPI_MEXC_Futures obsługuje bramę kontraktów futures MEXC.
Publiczne strumienie spot takie jak deals, depth, kline i bookTicker działają bez danych uwierzytelniających. Klucza API i sekretu MEXC potrzebujesz tylko do prywatnego strumienia danych konta: ustaw MEXC.ApiKey i MEXC.ApiSecret, wywołaj StartUserDataStream, aby uzyskać listenKey, a następnie SubscribeListenKey otwiera uwierzytelniony kanał.
sgcWebSockets obsługuje Delphi 7 aż po najnowsze Delphi 13 Florence oraz odpowiadające im wersje C++ Builder. Komponent MEXC działa w systemach Windows, macOS, Linux, iOS i Android.

Ready to Trade on MEXC?

Download the free trial and stream MEXC market data and account events from Delphi.