Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Zns

Class to support connection with Zilliqa naming service

param

network string such as

  • mainnet
  • ropsten
param

main api url such as

param

address for a registry contract

Hierarchy

Index

Constructors

constructor

  • Source object describing the network naming service operates on

    throws

    ConfigurationError - when either network or url is setup incorrectly

    Parameters

    • Default value source: string | boolean | SourceDefinition = true

      if specified as a string will be used as main url, if omitted then defaults are used

    Returns Zns

Properties

name

name: string

network

network: string

Optional registryAddress

registryAddress: string

url

url: string

Methods

Resolution

  • Resolves a domain

    Parameters

    • domain: string

      domain name to be resolved

    Returns Promise<ZnsResolution>

    Everything what is stored on specified domain

address

  • address(domain: string, currencyTicker: string): Promise<string>
  • Resolves domain name to a particular crypto address associated with it

    throws

    ResolutionError

    Parameters

    • domain: string

      domain name to be resolved

    • currencyTicker: string

      specific currency ticker such as

      • ZIL
      • BTC
      • ETH

    Returns Promise<string>

    A promise that resolves in a string

Protected ensureSupportedDomain

  • ensureSupportedDomain(domain: string): void

Protected fetch

  • fetch(url: any, options: any): Promise<Response | Response>

Protected isNode

  • isNode(): boolean

isSupportedDomain

  • isSupportedDomain(domain: string): boolean

isSupportedNetwork

  • isSupportedNetwork(): boolean

namehash

  • namehash(domain: string): string
  • Produces ZNS namehash of a domain

    Parameters

    • domain: string

      domain name to be hashed

    Returns string

    ZNS namehash

Protected normalizeSource

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

record

  • record(domain: string, field: string): Promise<string>
  • Resolves a specific field from domain's record

    Parameters

    • domain: string

      domain name

    • field: string

      resolver record name to be queried

    Returns Promise<string>

    Record field associated with the domain

records

  • records(domain: string): Promise<Dictionary<string>>
  • Resolver Records

    Parameters

    • domain: string

      domain name to be resolved

    Returns Promise<Dictionary<string>>

    ZNS resolver records in an plain key-value format

resolve

Generated using TypeDoc