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())); }
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); } } }
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)); } } }