Exemplo n.º 1
0
 public ENSService(Web3.Web3 web3, string ensRegistryAddress = "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e")
 {
     if (string.IsNullOrEmpty(ensRegistryAddress))
     {
         throw new ArgumentException("ensRegistryAddress cannot be null", nameof(ensRegistryAddress));
     }
     Web3 = web3 ?? throw new ArgumentNullException(nameof(web3));
     EnsRegistryAddress = ensRegistryAddress;
     _ensUtil           = new EnsUtil();
     ENSRegistryService = new ENSRegistryService(Web3, EnsRegistryAddress);
 }
Exemplo n.º 2
0
        public async Task InitialiseAsync()
        {
            ENSRegistryService = new ENSRegistryService(Web3, EnsRegistryAddress);
            TLSRegisterAddress = await ENSRegistryService.OwnerQueryAsync(TLSNameHash).ConfigureAwait(false);

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

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

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