从 sgcWebSockets 2022.1 起,我们的 Binance API 客户端已支持 Binance.us 服务器。支持以下 API:
- WebSocket 数据流:允许订阅某些方法并实时获取数据。服务器主动向订阅者推送事件,使用 WebSocket 协议。
- 用户数据流:订阅的客户端可获取账户详情。需要 API 密钥进行身份验证,使用 WebSocket 协议。
- REST API:客户端可请求服务器的市场和账户数据。需要 API Key 和 Secret 进行身份验证,使用 HTTPS 协议。
配置
Binance 属性中新增了名为 "BinanceUS" 的属性,启用后客户端将连接到 Binance.us 服务器而非 Binance.com 服务器。
Delphi
oClient := TsgcWebSocketClient.Create(nil); oBinance := TsgcWSAPI_Binance.Create(nil); oBinance.Binance.BinanceUS := True; oBinance.Client := oClient; oClient.Active := True;
.NET
TsgcWebSocketClient oClient = new TsgcWebSocketClient(); TsgcWSAPI_Binance oBinance = new TsgcWSAPI_Binance(); oBinance.Binance.BinanceUS := true; oBinance.Client = oClient; oClient.Active = true;
