コード例 #1
0
        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;
            }
        }
コード例 #2
0
 public BitFlyerResponse <BfWithdrawResponse> Withdraw(BfCurrencyCode currencyCode, int bankAccountId, decimal amount, string authenticationCode)
 {
     return(Withdraw(new BfWithdrawRequest
     {
         CurrencyCode = currencyCode,
         BankAccountId = bankAccountId,
         Amount = amount,
         AuthenticationCode = authenticationCode,
     }));
 }
コード例 #3
0
ファイル: WithDraw.cs プロジェクト: fiatsasia/BitFlyerDotNet
 /// <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));
 }
コード例 #4
0
        /// <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));
        }
コード例 #5
0
 public BitFlyerResponse <BfBalanceHistory[]> GetBalanceHistory(BfCurrencyCode currencyCode, int count = 0, int before = 0, int after = 0)
 => GetBalanceHistoryAsync(currencyCode, count, before, after, CancellationToken.None).Result;
コード例 #6
0
ファイル: WithDraw.cs プロジェクト: fiatsasia/BitFlyerDotNet
 public BitFlyerResponse <BfWithdrawResponse> Withdraw(BfCurrencyCode currencyCode, int bankAccountId, decimal amount, string authenticationCode)
 => WithdrawAsync(currencyCode, bankAccountId, amount, authenticationCode, CancellationToken.None).Result;