/// <summary> /// sub premium index kline /// </summary> /// <param name="contractCode"></param> /// <param name="period"></param> /// <param name="callbackFun"></param> /// <param name="id"></param> public void SubEstimatedRateKLine(string contractCode, string period, _OnSubEstimatedRateResponse callbackFun, string id = _DEFAULT_ID) { string ch = $"market.{contractCode}.estimated_rate.{period}"; WSSubData subData = new WSSubData() { sub = ch, id = id }; Sub(JsonConvert.SerializeObject(subData), ch, callbackFun, typeof(SubIndexKLineResponse)); }
/// <summary> /// sub premium index kline /// </summary> /// <param name="contractCode"></param> /// <param name="period"></param> /// <param name="callbackFun"></param> /// <param name="id"></param> public void SubEstimatedRateKLine(string contractCode, string period, _OnSubEstimatedRateResponse callbackFun, string id = WebSocketOp.DEFAULT_ID) { string ch = $"market.{contractCode}.estimated_rate.{period}"; WSSubData subData = new WSSubData() { sub = ch, id = id }; string sub_str = JsonConvert.SerializeObject(subData); WebSocketOp wsop = new WebSocketOp(this.path, sub_str, callbackFun, typeof(SubIndexKLineResponse), true, this.host); wsop.Connect(); }