Skip to content

Commit 0da7fda

Browse files
author
Ahmad Noman Musleh
committed
Fixed an issue on GetPayloadType method
1 parent ea057a7 commit 0da7fda

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

src/Console.Sample/Program.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ private static async Task Main()
113113
ClientSecret = _app.Secret,
114114
};
115115

116-
await _client.SendMessage(applicationAuthReq, ProtoOAPayloadType.ProtoOaApplicationAuthReq);
116+
await _client.SendMessage(applicationAuthReq);
117117

118118
await Task.Delay(5000);
119119

@@ -278,7 +278,7 @@ private static async void RefreshToken()
278278
RefreshToken = _token.RefreshToken
279279
};
280280

281-
await _client.SendMessage(refreshTokenReq, ProtoOAPayloadType.ProtoOaRefreshTokenReq);
281+
await _client.SendMessage(refreshTokenReq);
282282
}
283283

284284
private static async void SubscribeToSymbolTrendBar(string[] commandSplit)
@@ -292,7 +292,7 @@ private static async void SubscribeToSymbolTrendBar(string[] commandSplit)
292292
SymbolId = long.Parse(commandSplit[4]),
293293
};
294294

295-
await _client.SendMessage(subscribeLiveTrendbarReq, ProtoOAPayloadType.ProtoOaSubscribeLiveTrendbarReq);
295+
await _client.SendMessage(subscribeLiveTrendbarReq);
296296
}
297297

298298
private static async void SubscribeToSymbolSpot(string[] commandSplit)
@@ -306,7 +306,7 @@ private static async void SubscribeToSymbolSpot(string[] commandSplit)
306306

307307
subscribeSpotsReq.SymbolId.AddRange(commandSplit.Skip(3).Select(iSymbolId => long.Parse(iSymbolId)));
308308

309-
await _client.SendMessage(subscribeSpotsReq, ProtoOAPayloadType.ProtoOaSubscribeSpotsReq);
309+
await _client.SendMessage(subscribeSpotsReq);
310310
}
311311

312312
private static async void SymbolListRequest(string[] commandSplit)
@@ -320,7 +320,7 @@ private static async void SymbolListRequest(string[] commandSplit)
320320
CtidTraderAccountId = accountId,
321321
};
322322

323-
await _client.SendMessage(symbolsListReq, ProtoOAPayloadType.ProtoOaSymbolsListReq);
323+
await _client.SendMessage(symbolsListReq);
324324
}
325325

326326
private static async void ReconcileRequest(string[] commandSplit)
@@ -334,7 +334,7 @@ private static async void ReconcileRequest(string[] commandSplit)
334334
CtidTraderAccountId = accountId,
335335
};
336336

337-
await _client.SendMessage(reconcileReq, ProtoOAPayloadType.ProtoOaReconcileReq);
337+
await _client.SendMessage(reconcileReq);
338338
}
339339

340340
private static async void AccountListRequest()
@@ -346,7 +346,7 @@ private static async void AccountListRequest()
346346
AccessToken = _token.AccessToken,
347347
};
348348

349-
await _client.SendMessage(accountListByAccessTokenReq, ProtoOAPayloadType.ProtoOaGetAccountsByAccessTokenReq);
349+
await _client.SendMessage(accountListByAccessTokenReq);
350350
}
351351

352352
private static async void AccountAuthRequest(string[] commandSplit)
@@ -361,7 +361,7 @@ private static async void AccountAuthRequest(string[] commandSplit)
361361
AccessToken = _token.AccessToken
362362
};
363363

364-
await _client.SendMessage(accountAuthReq, ProtoOAPayloadType.ProtoOaAccountAuthReq);
364+
await _client.SendMessage(accountAuthReq);
365365
}
366366

367367
private static void GetCommand()

src/OpenAPI.Net/Helpers/MessagePayloadTypeExtension.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public static uint GetPayloadType<T>(this T message) where T : IMessage
2626
throw new InvalidOperationException($"Couldn't get the PayloadType of the message {message}", ex);
2727
}
2828

29-
return (uint)property.GetValue(message);
29+
return Convert.ToUInt32(property.GetValue(message));
3030
}
3131
}
3232
}

src/OpenAPI.Net/OpenAPI.Net.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<PackageTags>cTrader, Open API, Spotware</PackageTags>
1010
<Description>A .NET RX library for Spotware Open API</Description>
1111
<PackageId>Spotware.OpenAPI.Net</PackageId>
12-
<Version>1.3.6-rc1</Version>
12+
<Version>1.3.6-rc2</Version>
1313
<Platforms>AnyCPU</Platforms>
1414
<Company>Spotware</Company>
1515
<Authors>Spotware</Authors>

0 commit comments

Comments
 (0)