Ejemplo n.º 1
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;
     }));
 }
Ejemplo n.º 2
0
 public static string ShowMoney(this IMoney money, BTCPayNetwork network)
 {
     return(money.GetValue(network).ShowMoney(network.Divisibility));
 }