public IEnumerable <BfBalanceHistory> GetBalanceHistory(BfCurrencyCode currencyCode, int before, Func <BfBalanceHistory, bool> predicate) { while (true) { var balances = GetBalanceHistory(currencyCode, ReadCountMax, before, 0).GetContent(); if (balances.Length == 0) { break; } foreach (var balance in balances) { if (!predicate(balance)) { yield break; } yield return(balance); } if (balances.Length < ReadCountMax) { break; } before = balances.Last().PagingId; } }
public BitFlyerResponse <BfWithdrawResponse> Withdraw(BfCurrencyCode currencyCode, int bankAccountId, decimal amount, string authenticationCode) { return(Withdraw(new BfWithdrawRequest { CurrencyCode = currencyCode, BankAccountId = bankAccountId, Amount = amount, AuthenticationCode = authenticationCode, })); }
/// <summary> /// Withdrawing Funds /// <see href="https://scrapbox.io/BitFlyerDotNet/Withdraw">Online help</see> /// </summary> /// <param name="currencyCode"></param> /// <param name="bankAccountId"></param> /// <param name="amount"></param> /// <param name="authenticationCode"></param> /// <returns></returns> public Task <BitFlyerResponse <BfWithdrawResponse> > WithdrawAsync(BfCurrencyCode currencyCode, int bankAccountId, decimal amount, string authenticationCode, CancellationToken ct) { return(WithdrawAsync(new () { CurrencyCode = currencyCode, BankAccountId = bankAccountId, Amount = amount, AuthenticationCode = authenticationCode, }, ct)); }
/// <summary> /// List Balance History /// <see href="https://scrapbox.io/BitFlyerDotNet/GetBalanceHistory">Online help</see> /// </summary> /// <param name="currencyCode"></param> /// <param name="count"></param> /// <param name="before"></param> /// <param name="after"></param> /// <returns></returns> public Task <BitFlyerResponse <BfBalanceHistory[]> > GetBalanceHistoryAsync(BfCurrencyCode currencyCode, int count, int before, int after, CancellationToken ct) { var query = string.Format("currency_code={0}{1}{2}{3}", currencyCode.ToEnumString(), (count > 0) ? $"&count={count}" : "", (before > 0) ? $"&before={before}" : "", (after > 0) ? $"&after={after}" : "" ); return(GetPrivateAsync <BfBalanceHistory[]>(nameof(GetBalanceHistory), query, ct)); }
public BitFlyerResponse <BfBalanceHistory[]> GetBalanceHistory(BfCurrencyCode currencyCode, int count = 0, int before = 0, int after = 0) => GetBalanceHistoryAsync(currencyCode, count, before, after, CancellationToken.None).Result;
public BitFlyerResponse <BfWithdrawResponse> Withdraw(BfCurrencyCode currencyCode, int bankAccountId, decimal amount, string authenticationCode) => WithdrawAsync(currencyCode, bankAccountId, amount, authenticationCode, CancellationToken.None).Result;