public async Task <bool> TestPrivateApiAsync(ApiPrivateTestContext context) { var api = ApiProviderPrivate.GetApi(context); var r = await api.GetUserInfoAsync().ConfigureAwait(false); return(r != null && r.success); }
public async Task <bool> TestPrivateApiAsync(ApiPrivateTestContext context) { var api = ApiProvider.GetApi(context); var r = await api.GetBalanceAsync().ConfigureAwait(false); return(r != null && r.error == false); }
public async Task <bool> TestPrivateApiAsync(ApiPrivateTestContext context) { var api = ApiProvider.GetApi(context); var r = await api.GetAccountsAsync().ConfigureAwait(false); return(r != null); }
private void TestApiPrivate(INetworkProviderPrivate provider) { var ctx = new ApiPrivateTestContext(UserContext.Current.GetApiKey(provider)); var r = AsyncContext.Run(() => provider.TestPrivateApiAsync(ctx)); Assert.IsTrue(r); }
public async Task <bool> TestPrivateApiAsync(ApiPrivateTestContext context) { throw new NotImplementedException(); var api = ApiProvider.GetApi(context); // var r = await api.GetUserInfoAsync().ConfigureAwait(false); // return r?.data != null; }
public async Task <bool> TestPrivateApiAsync(ApiPrivateTestContext context) { var api = ApiProvider.GetApi(context); var r = await api.GetAllBalancesAsync().ConfigureAwait(false); CheckResponseErrors(r); return(r != null && r.success && r.result != null); }
public async Task <bool> TestPrivateApiAsync(ApiPrivateTestContext context) { var body = CreatePostBody("info"); var api = ApiProvider.GetApi(context); var r = await api.GetUserInfoAsync(body).ConfigureAwait(false); return(r != null && r.success && r.balances.Count > 0); }
public async Task <bool> TestPrivateApiAsync(ApiPrivateTestContext context) { var api = ApiProvider.GetApi(context); var rRaw = await api.GetUserInfoAsync().ConfigureAwait(false); CheckResponseErrors(rRaw); var r = rRaw.GetContent(); return(r.result); }
public async Task <bool> TestPrivateApiAsync(ApiPrivateTestContext context) { var api = ApiProvider.GetApi(context); var rRaw = await api.AuthenticateUserAsync().ConfigureAwait(false); CheckResponseErrors(rRaw); var r = rRaw.GetContent(); return(!string.IsNullOrWhiteSpace(r?.token)); }
public async Task <bool> TestPrivateApiAsync(ApiPrivateTestContext context) { var api = ApiProvider.GetApi(context); var rRaw = await api.GetUserInfoAsync().ConfigureAwait(false); CheckResponseErrors(rRaw); var r = rRaw.GetContent(); return(r != null && string.IsNullOrWhiteSpace(r.email) == false); }
public async Task <bool> TestPrivateApiAsync(ApiPrivateTestContext context) { var api = ApiProvider.GetApi(context); var rRaw = await api.GetBalancesAsync().ConfigureAwait(false); CheckResponseErrors(rRaw); var r = rRaw.GetContent(); return(r != null && r.Length > 0); }
public async Task <bool> TestPrivateApiAsync(ApiPrivateTestContext context) { var api = ApiProvider.GetApi(context); var rRaw = await api.GetAccountInformationAsync().ConfigureAwait(false); CheckResponseErrors(rRaw); var r = rRaw.GetContent(); return(r != null); }
public async Task <bool> TestPrivateApiAsync(ApiPrivateTestContext context) { var api = ApiProvider.GetApi(context); var r = await api.GetUserInfoAsync().ConfigureAwait(false); //CheckResponseErrors(rRaw); //var r = rRaw.GetContent(); return(r != null /* && r.success*/); }
public async Task <bool> TestPrivateApiAsync(ApiPrivateTestContext context) { var api = ApiProvider.GetApi(context); var body = CreateKrakenBody(); var r = await api.GetBalancesAsync(body).ConfigureAwait(false); CheckResponseErrors(r); return(r != null); }
public async Task <bool> TestPrivateApiAsync(ApiPrivateTestContext context) { var api = ApiProviderPrivate.GetApi(context); var body = CreateBody(); var rRaw = await api.GetBalancesAsync(body).ConfigureAwait(false); CheckResponseErrors(rRaw); var r = rRaw.GetContent(); return(r != null && r.success == 1); }
public async Task <bool> TestPrivateApiAsync(ApiPrivateTestContext context) { var api = ApiProvider.GetApi(context); var body = CreatePoloniexBody(PoloniexBodyType.ReturnBalances); var rRaw = await api.GetBalancesAsync(body).ConfigureAwait(false); CheckResponseErrors(rRaw); var r = rRaw.GetContent(); return(r != null && r.Count > 0); }
private void TestApi(INetworkProviderPrivate provider) { var ctx = new ApiPrivateTestContext(UserContext.Current.GetApiKey(provider)); try { var r = AsyncContext.Run(() => provider.TestPrivateApiAsync(ctx)); Assert.IsTrue(r); } catch (Exception e) { Assert.Fail(e.Message); } }
public async Task <bool> TestPrivateApiAsync(ApiPrivateTestContext context) { var timeStamp = (long)(DateTime.UtcNow.ToUnixTimeStamp()); var body = new Dictionary <string, object> { { "method", "getInfo" }, { "nonce", timeStamp } }; var api = ApiProviderPrivate.GetApi(context); var r = await api.GetUserInfoAsync(body).ConfigureAwait(false); return(r != null && r.success); }
public async Task <bool> TestPrivateApiAsync(ApiPrivateTestContext context) { var api = ApiProvider.GetApi(context); var body = CreatePoloniexBody(PoloniexBodyType.ReturnBalances); try { var r = await api.GetBalancesAsync(body).ConfigureAwait(false); return(r != null && r.Count > 0); } catch { return(false); } }
public async Task <bool> TestPrivateApiAsync(ApiPrivateTestContext context) { var body = new Dictionary <string, object> { { "currencies", "ltc,btc" } }; var api = ApiProvider.GetApi(context); var rRaw = await api.GetBalancesAsync(body).ConfigureAwait(false); CheckResponseErrors(rRaw); var r = rRaw.GetContent(); return(r != null && r.Length > 0); }
public void TestApi() { var provider = Networks.I.Providers.OfType <BitMexProvider>().FirstProvider(); var ctx = new ApiPrivateTestContext(UserContext.Current.GetApiKey(provider)); try { var r = AsyncContext.Run(() => provider.TestPrivateApiAsync(ctx)); Console.WriteLine($"Api success: {r}"); } catch (Exception e) { Console.WriteLine(e.Message); } }
public void ApiTest() { var provider = Networks.I.Providers.OfType <PoloniexProvider>().FirstProvider(); var apiTestCtx = new ApiPrivateTestContext(UserContext.Current.GetApiKey(provider)); try { var ok = AsyncContext.Run(() => provider.TestPrivateApiAsync(apiTestCtx)); System.Console.WriteLine($"Api test OK: {ok}"); } catch (Exception e) { System.Console.WriteLine(e.Message); throw; } }
public void TestApi() { var provider = Networks.I.Providers.OfType <KrakenProvider>().FirstProvider(); var ctx = new ApiPrivateTestContext(UserContext.Testing.GetApiKey(provider)); try { var result = AsyncContext.Run(() => provider.TestPrivateApiAsync(ctx)); System.Console.WriteLine($"Api test ok: {result}"); } catch (Exception e) { System.Console.WriteLine(e.Message); throw; } }
public async Task <bool> TestPrivateApiAsync(ApiPrivateTestContext context) { var api = ApiPrivateProvider.GetApi(context); var body = new Dictionary <string, object> { { "MsgType", "U2" }, { "BalanceReqID", 1 } }; var rRaw = await api.GetBalanceAsync(body).ConfigureAwait(false); CheckResponseErrors(rRaw); var r = rRaw.GetContent(); return(r != null); }
public async Task <bool> TestPrivateApiAsync(ApiPrivateTestContext context) { var api = ApiProvider.GetApi(context); var body = new Dictionary <string, object> { { "id", "1" }, { "method", "getAccountInfo" }, { "params", "" } }; var rRaw = await api.GetUserInfoAsync(body).ConfigureAwait(false); CheckResponseErrors(rRaw); var r = rRaw.GetContent(); return(r != null && !string.IsNullOrWhiteSpace(r.profile?.uid)); }
public async Task <bool> TestPrivateApiAsync(ApiPrivateTestContext context) { return(true); }
public static Task <ApiResponse <bool> > TestApiAsync(INetworkProviderPrivate provider, ApiPrivateTestContext context) { return(ApiHelpers.WrapExceptionAsync(() => provider.TestPrivateApiAsync(context), nameof(TestApi), provider, context)); }
public Task <bool> TestPrivateApiAsync(ApiPrivateTestContext context) { throw new NotImplementedException(); }
public static ApiResponse <bool> TestApi(INetworkProviderPrivate provider, ApiPrivateTestContext context) { return(AsyncContext.Run(() => TestApiAsync(provider, context))); }
public async Task <bool> TestPrivateApiAsync(ApiPrivateTestContext context) { var r = await GetBalancesAsync(context).ConfigureAwait(false); return(r != null); }