Ejemplo n.º 1
0
 public ENSService(IEthApiContractService ethApiContractService, string ensRegistryAddress = "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e")
 {
     if (ethApiContractService == null)
     {
         throw new ArgumentNullException(nameof(ethApiContractService));
     }
     _ethApiContractService = ethApiContractService;
     EnsRegistryAddress     = ensRegistryAddress ?? throw new ArgumentNullException(nameof(ensRegistryAddress));
     _ensUtil           = new EnsUtil();
     ENSRegistryService = new ENSRegistryService(ethApiContractService, EnsRegistryAddress);
 }
Ejemplo n.º 2
0
        public EthTLSService(IEthApiContractService ethApiContractService, string ensRegistryAddress = "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e")
        {
            if (string.IsNullOrEmpty(ensRegistryAddress))
            {
                throw new ArgumentException("ensRegistryAddress cannot be null", nameof(ensRegistryAddress));
            }
            _ethApiContractService = ethApiContractService;

            EnsRegistryAddress = ensRegistryAddress;
            _ensUtil           = new EnsUtil();
            TLS         = "eth";
            TLSNameHash = _ensUtil.GetNameHash(TLS).HexToByteArray();
        }
Ejemplo n.º 3
0
        public Task <PublicResolverService> GetResolverAsync(string fullNameNode)
        {
            var fullNameNodeAsBytes = new EnsUtil().GetNameHash(fullNameNode).HexToByteArray();

            return(GetResolverAsync(fullNameNodeAsBytes));
        }