public ProtoMessage CreateReconcileRequest(long accountId, string clientMsgId = null) { var _msg = ProtoOAReconcileReq.CreateBuilder(); _msg.SetCtidTraderAccountId(accountId); return(CreateMessage((uint)_msg.PayloadType, _msg.Build().ToByteString(), clientMsgId)); }
public async Task <ProtoOAReconcileRes> GetAccountOrders(long accountId, bool isLive) { VerifyConnection(); var client = GetClient(isLive); using var cancelationTokenSource = new CancellationTokenSource(); ProtoOAReconcileRes result = null; using var disposable = client.OfType <ProtoOAReconcileRes>().Where(response => response.CtidTraderAccountId == accountId) .Subscribe(response => { result = response; cancelationTokenSource.Cancel(); }); var requestMessage = new ProtoOAReconcileReq { CtidTraderAccountId = accountId }; await SendMessage(requestMessage, ProtoOAPayloadType.ProtoOaReconcileReq, client, cancelationTokenSource, () => result is not null); return(result); }
private async static void ReconcileRequest(string[] commandSplit) { var accountId = long.Parse(commandSplit[1]); Console.WriteLine("Sending reconcile req..."); var reconcileReq = new ProtoOAReconcileReq { CtidTraderAccountId = accountId, }; await _client.SendMessage(reconcileReq, ProtoOAPayloadType.ProtoOaReconcileReq); }
public static ProtoMessage Reconcile_Req(long ctidTraderAccountId) { ProtoOAReconcileReq message = new ProtoOAReconcileReq { payloadType = ProtoOAPayloadType.ProtoOaReconcileReq, ctidTraderAccountId = ctidTraderAccountId }; Log.Info("ProtoOAReconcileReq:: " + $"ctidTraderAccountId: {ctidTraderAccountId}"); InnerMemoryStream.SetLength(0); Serializer.Serialize(InnerMemoryStream, message); return(Encode((uint)message.payloadType, InnerMemoryStream.ToArray())); }