You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

47 lines
1.3 KiB

syntax = "proto3";
import "api/pub.proto";
option go_package = "./pb";
// 订阅/查询/存储,交易所k线图/热度/深度等基础数据指标
service ExchangeService {
// 订阅实时K线
rpc SubscribeKline(stream ReqStreamSubscribeKline) returns (stream RspStreamSubscribeKline);
// 获取支持的交易所列表
rpc Exchanges(ReqExchanges) returns (RspExchanges);
// 获取交易所交易产品状态
rpc ExchangeInstanceState(ReqExchangeInstanceState) returns (RspExchangeInstanceState);
}
message ReqStreamSubscribeKline {
SubscribeType subType = 1;
repeated ExchangeType exchanges = 2; // 交易所
repeated string instIds = 3;
repeated string intervals = 4;
bool onlyConfirm = 5; // 只要confirm的k线
}
message RspStreamSubscribeKline { StreamKline kline = 1; }
message StreamKline {
repeated Kline klines = 2;
ExchangeType exchange = 3; // 交易所
string instId = 4; // 交易产品id
}
message ReqExchanges {
}
message RspExchanges {
repeated ExchangeType exchanges = 1;
}
message ReqExchangeInstanceState {
repeated string insts = 1;
bool allExchange = 2;
repeated ExchangeType exchanges = 3; // 交易所
}
message RspExchangeInstanceState {
repeated TradeInstanceState instsState = 1; // 交易产品列表
}