Esempio n. 1
0
        public static IEnumerable <string> GetAllElementsSubChains(this BTCPayNetworkProvider networkProvider, BTCPayNetworkProvider unfiltered)
        {
            var elementsBased = networkProvider.GetAll().OfType <ElementsBTCPayNetwork>();
            var parentChains  = elementsBased.Select(network => network.NetworkCryptoCode.ToUpperInvariant()).Distinct();

            return(unfiltered.GetAll().OfType <ElementsBTCPayNetwork>()
                   .Where(network => parentChains.Contains(network.NetworkCryptoCode)).Select(network => network.CryptoCode.ToUpperInvariant()));
        }
        public static IEnumerable <string> GetAllEthereumSubChains(this BTCPayNetworkProvider networkProvider)
        {
            var ethBased = networkProvider.UnfilteredNetworks.GetAll().OfType <EthereumBTCPayNetwork>();
            var chainId  = ethBased.Select(network => network.ChainId).Distinct();

            return(networkProvider.GetAll().OfType <EthereumBTCPayNetwork>()
                   .Where(network => chainId.Contains(network.ChainId))
                   .Select(network => network.CryptoCode.ToUpperInvariant()));
        }
Esempio n. 3
0
 public IEnumerable <(BTCPayNetwork, ExplorerClient)> GetAll()
 {
     foreach (var net in _NetworkProviders.GetAll().OfType <BTCPayNetwork>())
     {
         if (_Clients.TryGetValue(net.NBXplorerNetwork.CryptoCode, out ExplorerClient explorer))
         {
             yield return(net, explorer);
         }
     }
 }
Esempio n. 4
0
 public IEnumerable <(BTCPayNetwork, ExplorerClient)> GetAll()
 {
     foreach (var net in _NetworkProviders.GetAll())
     {
         if (_Options.ExplorerFactories.TryGetValue(net.CryptoCode, out Func <BTCPayNetwork, ExplorerClient> factory))
         {
             yield return(net, factory(net));
         }
     }
 }