Options
All
  • Public
  • Public/Protected
  • All
Menu

An interface that defines functions for resolving names and addresses.

Hierarchy

  • NameResolver

Implemented by

Index

Methods

clearCache

  • clearCache(): void
  • Clears the cache. Only applies if caching is enabled.

    Returns void

resolveAddressToName

  • resolveAddressToName(address: string): Promise<string | null>
  • 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
    example
    const name = await resolver.resolveAddressToName('tz1...');
    console.log(name); // 'alice.tez'

    Parameters

    • address: string

    Returns Promise<string | null>

resolveDomainRecord

  • resolveDomainRecord(name: string): Promise<DomainInfo | null>
  • Gets all information about a domain by it's name. If you only need to resolve the address, use resolveNameToAddress instead.

    Parameters

    • name: string

    Returns Promise<DomainInfo | null>

resolveNameToAddress

  • resolveNameToAddress(name: string): Promise<string | null>
  • 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
    example
    const address = await resolver.resolveNameToAddress('alice.tez');
    console.log(address); // 'tz1...'

    Parameters

    • name: string

    Returns Promise<string | null>

resolveReverseRecord

  • Gets all information about a reverse record by it's address. If you only need to resolve the name, use resolveAddressToName instead.

    Parameters

    • address: string

    Returns Promise<ReverseRecordDomainInfo | null>

Generated using TypeDoc