Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Cns

Class to support connection with Crypto 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: NamingServiceSource = true

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

    Returns Cns

Properties

NetworkNameMap

NetworkNameMap: object = invert(this.NetworkIdMap)

Type declaration

name

name: string = "CNS"

network

network: string

Optional registryAddress

registryAddress: string

url

url: string

Methods

address

  • address(domain: string, currencyTicker: string): Promise<string>
  • Resolves domain to a specific cryptoAddress

    Parameters

    • domain: string

      domain name to be resolved

    • currencyTicker: string

      currency ticker such as

      • ZIL
      • BTC
      • ETH

    Returns Promise<string>

    • A promise that resolves in a string

Protected callMethod

  • callMethod(contract: Contract, methodname: string, params: any): Promise<any>
  • Internal wrapper for ens method. Used to throw an error when ens is down @param method - method to be called @throws ResolutionError -> When blockchain is down

    Parameters

    • contract: Contract
    • methodname: string
    • params: any

    Returns Promise<any>

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

Protected normalizeSource

owner

  • owner(tokenId: any): Promise<string>

record

  • record(domain: string, key: string): Promise<string>

resolve

  • Resolves the given domain. [DEPRECATED]

    async
    returns-

    Returns a promise that resolves in an object

    Parameters

    • domain: string

      domain name to be resolved

    Returns Promise<ResolutionResponse>

Object literals

NetworkIdMap

NetworkIdMap: object

1

1: string = "mainnet"

3

3: string = "ropsten"

4

4: string = "kovan"

42

42: string = "rinkeby"

5

5: string = "goerli"

RegistryMap

RegistryMap: object
internal

mainnet

mainnet: string = "0xD1E5b0FF1287aA9f9A268759062E4Ab08b9Dacbe"

UrlMap

UrlMap: object

goerli

goerli: string = "https://goerli.infura.io"

kovan

kovan: string = "https://kovan.infura.io"

mainnet

mainnet: string = "https://mainnet.infura.io"

rinkeby

rinkeby: string = "https://rinkeby.infura.io"

ropsten

ropsten: string = "https://ropsten.infura.io"

Generated using TypeDoc