btcpayserver/BTCPayServer.Common/Altcoins/Ethereum/EthereumExtensions.cs
XPayServer de755ac0bb Add Ethereum & ERC20 Support
Add Tests
Add Index, XPub to payment data
Add Note on local ETH node
Fix Sync Summary and Race Condition
2020-09-09 08:19:10 +02:00

20 lines
711 B
C#

#if ALTCOINS
using System.Collections.Generic;
using System.Linq;
namespace BTCPayServer
{
public static class EthereumExtensions
{
public static IEnumerable<string> GetAllEthereumSubChains(this BTCPayNetworkProvider networkProvider, BTCPayNetworkProvider unfiltered)
{
var ethBased = networkProvider.GetAll().OfType<EthereumBTCPayNetwork>();
var chainId = ethBased.Select(network => network.ChainId).Distinct();
return unfiltered.GetAll().OfType<EthereumBTCPayNetwork>()
.Where(network => chainId.Contains(network.ChainId))
.Select(network => network.CryptoCode.ToUpperInvariant());
}
}
}
#endif