An interface that defines functions for resolving names and addresses.

Implements

Constructors

Methods

  • Clears the cache. Only applies if caching is enabled.

    Returns void

  • Resolves an address to a name.

    Throws an error under following conditions:

    • address is not a valid tezos address

    Returns null under following conditions:

    • reverse record with the specified address does not exist
    • reverse record with the specified address does not specify a name
    • record with the name specified by the reverse record does not exist
    • record with the name specified by the reverse record is expired

    Returns Promise<null | string>

    const name = await resolver.resolveAddressToName('tz1...');
    console.log(name); // 'alice.tez'
  • Gets all information about a domain by it's name. If you only need to resolve the address, use [[resolveNameToAddress]] instead.

    Returns Promise<null | DomainInfo>

  • Resolves a domain name to an address.

    Throws an error under following conditions:

    • name is not a valid domain name

    Returns null under following conditions:

    • record with the specified name does not exist
    • record with the specified name does not specify an address
    • record with the specified name has expired

    Returns Promise<null | string>

    const address = await resolver.resolveNameToAddress('alice.tez');
    console.log(address); // 'tz1...'
  • Gets all information about a reverse record by it's address. If you only need to resolve the name, use [[resolveAddressToName]] instead.

    Returns Promise<null | ReverseRecordDomainInfo>