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(); }
public async Task <string> ResolveAddressAsync(string fullName) { var fullNameNode = _ensUtil.GetNameHash(fullName).HexToByteArray(); var resolverService = await GetResolverAsync(fullNameNode).ConfigureAwait(false); return(await resolverService.AddrQueryAsync(fullNameNode).ConfigureAwait(false)); }