Delphi 및 C++ Builder용 MEXC API 클라이언트 | eSeGeCe

MEXC WebSocket API

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

빠른 답변: TsgcWSAPI_MEXC는 Delphi 및 C++ Builder 앱을 MEXC에 연결하는 sgcWebSockets 컴포넌트예요. MEXC의 Protobuf 현물 스트림(deals, kline, depth, bookTicker, miniTicker)을 디코딩하고 listenKey 기반 비공개 계정 데이터 스트림을 열어요.

TsgcWSAPI_MEXC

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

컴포넌트 클래스

TsgcWSAPI_MEXC

프로토콜

MEXC Spot v3 API

플랫폼

Windows, macOS, Linux, iOS, Android

에디션

Standard / Professional / Enterprise

Drop the component, set keys, subscribe

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.

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.

사양 및 참조 문서

Authoritative sources for the APIs this component implements.

문서 및 데모

컴포넌트 참조 문서로 바로 이동하고, 바로 실행 가능한 데모 프로젝트를 받고, 체험판을 다운로드해 보세요.

온라인 도움말 — API_MEXC 이 컴포넌트의 전체 속성, 메서드, 이벤트 참조 문서.
데모 프로젝트 — Demos\05.Crypto\15.MEXC 바로 실행 가능한 예제 프로젝트예요. sgcWebSockets 패키지에 포함되어 있어요 — 아래에서 체험판을 다운로드하세요.
기술 문서 (PDF) 기능, 빠른 시작, Delphi 및 C++ Builder 코드 샘플 및 1차 출처 참고 — 이 컴포넌트 전용.
사용자 설명서 (PDF) 라이브러리의 모든 컴포넌트를 다루는 종합 설명서.

자주 묻는 질문

Delphi 및 C++ Builder용 MEXC API 컴포넌트에 대해 자주 묻는 질문이에요.

폼에 TsgcWebSocketClientTsgcWSAPI_MEXC 컴포넌트를 추가하고, API 컴포넌트의 Client 속성에 클라이언트를 할당하고, 계정 스트림이 필요하면 MEXC.ApiKeyMEXC.ApiSecret을 설정한 다음 WSClient.Active := True로 설정하고 SubscribeDeals, SubscribeDepth, SubscribeKLine 같은 구독 메서드를 호출하세요.
TsgcWSAPI_MEXC 컴포넌트는 MEXC 현물 WebSocket API를 대상으로 해요. Protobuf로 인코딩된 시장 스트림(deals, kline, depth, bookTicker, miniTicker)을 디코딩하고 잔액, 주문, 포지션 업데이트를 위한 listenKey 기반 계정 데이터 스트림을 열어요. TsgcWSAPI_MEXC_Futures 형제 컴포넌트는 MEXC 선물 계약 게이트웨이를 대상으로 해요.
deals, depth, kline, bookTicker 같은 공개 현물 스트림은 자격 증명 없이 작동해요. 비공개 계정 데이터 스트림에만 MEXC API 키와 시크릿이 필요해요. MEXC.ApiKeyMEXC.ApiSecret을 설정하고, StartUserDataStream을 호출해 listenKey를 얻은 다음, SubscribeListenKey로 인증된 채널을 열어요.
sgcWebSockets는 Delphi 7부터 최신 Delphi 13 Florence까지, 그리고 해당하는 C++ Builder 버전을 지원해요. MEXC 컴포넌트는 Windows, macOS, Linux, iOS, Android에서 실행돼요.

Ready to Trade on MEXC?

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