Esempio 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);
 }
Esempio n. 2
0
        public async Task InitialiseAsync()
        {
            ENSRegistryService = new ENSRegistryService(_ethApiContractService, EnsRegistryAddress);
            TLSRegisterAddress = await ENSRegistryService.OwnerQueryAsync(TLSNameHash).ConfigureAwait(false);

            TLSResolverAddress = await ENSRegistryService.ResolverQueryAsync(TLSNameHash).ConfigureAwait(false);

            TLSResolverService   = new PublicResolverService(_ethApiContractService, TLSResolverAddress);
            TLSControllerAddress = await TLSResolverService.InterfaceImplementerQueryAsync(TLSNameHash, "0x018fac06".HexToByteArray()).ConfigureAwait(false);

            TLSRegistrarControllerService        = new ETHRegistrarControllerService(_ethApiContractService, TLSControllerAddress);
            MinimunDurationRegistrationInSeconds = (int)await TLSRegistrarControllerService.MinRegistrationDurationQueryAsync().ConfigureAwait(false);
        }