File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3434 </ItemGroup >
3535
3636 <ItemGroup >
37- <PackageReference Include =" Microsoft.AspNetCore.Components.WebAssembly" Version =" 5 .0.10 " />
38- <PackageReference Include =" Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version =" 5 .0.10 " PrivateAssets =" all" />
39- <PackageReference Include =" System.Net.Http.Json" Version =" 5 .0.0" />
37+ <PackageReference Include =" Microsoft.AspNetCore.Components.WebAssembly" Version =" 6 .0.1 " />
38+ <PackageReference Include =" Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version =" 6 .0.1 " PrivateAssets =" all" />
39+ <PackageReference Include =" System.Net.Http.Json" Version =" 6 .0.0" />
4040 </ItemGroup >
4141
4242 <ItemGroup >
Original file line number Diff line number Diff line change 427427 await Task .Delay (1000 );
428428
429429 await ApiCredentialsModal .Open ();
430+
431+ ApiService .Error += exception => Console .Error .WriteLine ($" API Service Exception: {exception }" );
430432 }
431433
432434 private async Task Connect ()
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ public static class ApiInfo
77
88 public const int Port = 5035 ;
99
10- public const string AuthUrl = "https://connect.spotware .com/apps/" ;
10+ public const string AuthUrl = "https://openapi.ctrader .com/apps/" ;
1111
1212 public static string GetHost ( Mode mode ) => mode == Mode . Live ? LiveHost : DemoHost ;
1313 }
Original file line number Diff line number Diff line change @@ -162,7 +162,15 @@ public async Task<IEnumerable<ProtoOACtidTraderAccount>> GetAccounts(string acce
162162
163163 await LogoutAccounts ( accounts . Where ( iAccount => _accounts . ContainsKey ( Convert . ToInt64 ( iAccount . CtidTraderAccountId ) ) ) ) ;
164164
165- await AuthorizeAccounts ( accounts , accessToken ) ;
165+ foreach ( var account in accounts )
166+ {
167+ var accountId = Convert . ToInt64 ( account . CtidTraderAccountId ) ;
168+
169+ await _apiService . AuthorizeAccount ( accountId , account . IsLive , accessToken ) ;
170+
171+ _accounts . TryAdd ( accountId , account ) ;
172+ _accountIds . TryAdd ( account . TraderLogin , accountId ) ;
173+ }
166174
167175 return accounts ;
168176 }
@@ -644,16 +652,6 @@ private void OnExecutionEvent(ProtoOAExecutionEvent executionEvent)
644652 }
645653 }
646654
647- private Task AuthorizeAccounts ( IEnumerable < ProtoOACtidTraderAccount > accounts , string accessToken ) => Task . WhenAll ( accounts . Select ( async account =>
648- {
649- var accountId = Convert . ToInt64 ( account . CtidTraderAccountId ) ;
650-
651- await _apiService . AuthorizeAccount ( accountId , account . IsLive , accessToken ) ;
652-
653- _accounts . TryAdd ( accountId , account ) ;
654- _accountIds . TryAdd ( account . TraderLogin , accountId ) ;
655- } ) . ToArray ( ) ) ;
656-
657655 private Task LogoutAccounts ( IEnumerable < ProtoOACtidTraderAccount > accounts ) => Task . WhenAll ( accounts . Select ( async account =>
658656 {
659657 var accountId = Convert . ToInt64 ( account . CtidTraderAccountId ) ;
You can’t perform that action at this time.
0 commit comments