public Task <GetBalanceResponse> GetBalance(DerivationStrategyBase derivationStrategy, CancellationToken cancellation = default(CancellationToken))
 {
     return(_MemoryCache.GetOrCreateAsync("CACHEDBALANCE_" + derivationStrategy.ToString(), async(entry) =>
     {
         var result = await _Client.GetBalanceAsync(derivationStrategy, cancellation);
         entry.AbsoluteExpiration = DateTimeOffset.UtcNow + CacheSpan;
         return result;
     }));
 }
Example #2
0
 public Task <decimal> GetBalance(DerivationStrategyBase derivationStrategy, CancellationToken cancellation = default(CancellationToken))
 {
     return(_MemoryCache.GetOrCreateAsync("CACHEDBALANCE_" + derivationStrategy.ToString(), async(entry) =>
     {
         var result = await _Client.GetBalanceAsync(derivationStrategy, cancellation);
         entry.AbsoluteExpiration = DateTimeOffset.UtcNow + CacheSpan;
         IMoney total = result.Total;
         var value = total.GetValue(_Network);
         return value;
     }));
 }
Example #3
0
        public async Task <decimal> GetBalance(DerivationStrategyBase derivationStrategy, CancellationToken cancellation = default(CancellationToken))
        {
            var result = await _Client.GetBalanceAsync(derivationStrategy, cancellation);

            return(result.Total.GetValue(_Network));
        }