Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Resolution

Blockchain domain Resolution library - Resolution.

example
let Resolution = new Resolution({blockchain: {ens: {url: 'https://mainnet.infura.io', network: 'mainnet'}}});
let domain = brad.zil
let Resolution = Resolution.address(domain);

Hierarchy

  • Resolution

Index

Constructors

constructor

  • new Resolution(__namedParameters?: object): Resolution
  • Resolution constructor

    property

    blockchain - main configuration object

    Parameters

    • Default value __namedParameters: object = {}

    Returns Resolution

Properties

blockchain

blockchain: Blockchain | boolean

Methods

address

  • address(domain: string, currencyTicker: string): Promise<string | null>
  • Resolves give domain name to a specific currency address if exists

    async

    Parameters

    • domain: string

      domain name to be resolved

    • currencyTicker: string

      currency ticker like BTC, ETH, ZIL

    Returns Promise<string | null>

    A promise that resolves in an address or null

addressOrThrow

  • addressOrThrow(domain: string, currencyTicker: string): Promise<string>
  • Resolves given domain to a specific currency address or throws an error

    throws

    ResolutionError if address is not found

    Parameters

    • domain: string

      domain name

    • currencyTicker: string

      currency ticker such as

      • ZIL
      • BTC
      • ETH

    Returns Promise<string>

childhash

email

  • email(domain: string): Promise<string>
  • Resolves the ipfs email field from whois configurations

    throws

    ResolutionError

    Parameters

    • domain: string

      domain name

    Returns Promise<string>

    A Promise that resolves in an email address configured for this domain whois

httpUrl

  • httpUrl(domain: string): Promise<string>
  • Resolves the httpUrl attached to domain

    Parameters

    • domain: string

      domain name

    Returns Promise<string>

ipfsHash

  • ipfsHash(domain: string): Promise<string>
  • Resolves the IPFS hash configured for domain records on ZNS

    throws

    ResolutionError

    Parameters

    • domain: string

      domain name

    Returns Promise<string>

ipfsRedirect

  • ipfsRedirect(domain: string): Promise<string>
  • Resolves the ipfs redirect url for a supported domain records

    deprecated
    • use Resolution#httpUrl instead
    throws

    ResolutionError

    Parameters

    • domain: string

      domain name

    Returns Promise<string>

    A Promise that resolves in redirect url

isSupportedDomain

  • isSupportedDomain(domain: string): boolean
  • Checks if the domain is in valid format

    Parameters

    • domain: string

      domain name to be checked

    Returns boolean

isSupportedDomainInNetwork

  • isSupportedDomainInNetwork(domain: string): boolean
  • Checks if the domain is supported by the specified network as well as if it is in valid format

    Parameters

    • domain: string

      domain name to be checked

    Returns boolean

isValidHash

  • isValidHash(domain: string, hash: string): boolean
  • Checks weather the domain name matches the hash

    Parameters

    • domain: string

      domain name to check againt

    • hash: string

      hash obtained from the blockchain

    Returns boolean

namehash

  • namehash(domain: string): string
  • Produce a namehash from supported naming service

    throws

    ResolutionError with UnsupportedDomain error code if domain extension is unknown

    Parameters

    • domain: string

      domain name to be hashed

    Returns string

    Namehash either for ENS or ZNS

owner

  • owner(domain: string): Promise<string | null>
  • Owner of the domain

    Parameters

    • domain: string

      domain name

    Returns Promise<string | null>

    An owner address of the domain

resolve

  • Resolves the given domain

    async

    Parameters

    • domain: string

      domain name to be resolved

    Returns Promise<ResolutionResponse>

    A promise that resolves in an object

reverse

  • reverse(address: string, currencyTicker: string): Promise<string>
  • This method is only for ens at the moment. Reverse the ens address to a ens registered domain name

    async

    Parameters

    • address: string

      address you wish to reverse

    • currencyTicker: string

      currency ticker like BTC, ETH, ZIL

    Returns Promise<string>

    Domain name attached to this address

serviceName

Generated using TypeDoc