Options
All
  • Public
  • Public/Protected
  • All
Menu

@unstoppabledomains/resolution

Index

Type aliases

API

API: { url: string }

Type declaration

  • url: string

Bip44Constants

Bip44Constants: [number, string, string]

Blockchain

Blockchain: { cns?: NamingServiceSource; ens?: NamingServiceSource; web3Provider?: Provider; zns?: NamingServiceSource }

Main configurational object for Resolution instance

Type declaration

ConfigurationErrorHandler

ConfigurationErrorHandler: (error: ConfigurationErrorOptions) => string

Alias for Resolution error handler function

Type declaration

ConfigurationErrorOptions

ConfigurationErrorOptions: { method?: ResolutionMethod }

Explains Resolution Error options

Type declaration

Dictionary

Dictionary<T>: {}

Type parameters

  • T

Type declaration

  • [k: string]: T

NamingServiceSource

NamingServiceSource: string | boolean | SourceDefinition

NamingServiceSource just an alias

ProviderMethod

ProviderMethod: (payload: JsonRpcPayload, callback: (error: Error | null, result?: JsonRpcResponse) => void) => void

Type declaration

ProviderParams

ProviderParams: unknown[] | object

ResolutionErrorHandler

ResolutionErrorHandler: (error: ResolutionErrorOptions) => string

Alias for Resolution error handler function

Type declaration

ResolutionErrorOptions

ResolutionErrorOptions: { currencyTicker?: undefined | string; domain?: undefined | string; method?: ResolutionMethod; recordName?: undefined | string }

Explains Resolution Error options

Type declaration

  • Optional currencyTicker?: undefined | string
  • Optional domain?: undefined | string
  • Optional method?: ResolutionMethod
  • Optional recordName?: undefined | string

ResolutionMethod

ResolutionMethod: NamingServiceName | "UDAPI"

ResolutionResponse

ResolutionResponse: { addresses: {}; gundb?: undefined | { public_key?: undefined | string; username?: undefined | string }; ipfs?: undefined | { html?: undefined | string; redirect_domain?: undefined | string }; meta: { owner: string | null; ttl: number; type: string }; whois?: undefined | { email?: undefined | string; for_sale?: undefined | false | true } }

ResolutionResulution

property

{Object} addresses - Resolution addresses for various currency addresses attached to the domain

property

{Object} meta - meta information about the owner of the domain

Type declaration

  • addresses: {}
    • [key: string]: string
  • Optional gundb?: undefined | { public_key?: undefined | string; username?: undefined | string }
  • Optional ipfs?: undefined | { html?: undefined | string; redirect_domain?: undefined | string }
  • meta: { owner: string | null; ttl: number; type: string }
    • owner: string | null
    • ttl: number
    • type: string
  • Optional whois?: undefined | { email?: undefined | string; for_sale?: undefined | false | true }

TransactionRequest

TransactionRequest: { chainId?: unknown; data?: unknown; from?: unknown; gasLimit?: unknown; gasPrice?: unknown; nonce?: unknown; to?: unknown; value?: unknown }

Type declaration

  • Optional chainId?: unknown
  • Optional data?: unknown
  • Optional from?: unknown
  • Optional gasLimit?: unknown
  • Optional gasPrice?: unknown
  • Optional nonce?: unknown
  • Optional to?: unknown
  • Optional value?: unknown

ZnsResolution

ZnsResolution: { crypto?: Dictionary<{ address?: undefined | string }>; ttl?: undefined | string }

Default structure of ZnsResolution records

Type declaration

  • [key: string]: any
  • Optional crypto?: Dictionary<{ address?: undefined | string }>
  • Optional ttl?: undefined | string

nodeHash

nodeHash: string

owner

owner: string

ttl

ttl: string

Variables

Const CHARSET

CHARSET: "qpzry9x8gf2tvdw0s3jn54khce6mua7l" = "qpzry9x8gf2tvdw0s3jn54khce6mua7l"

Const DefaultSource

DefaultSource: "https://api.zilliqa.com" = "https://api.zilliqa.com"

Const EthCoinIndex

EthCoinIndex: 60 = 60

Const GENERATOR

GENERATOR: number[] = [0x3b6a57b2, 0x26508e6d, 0x1ea119fa, 0x3d4233dd, 0x2a1462b3]

Const HRP

HRP: "zil" = "zil"

Const NullAddress

NullAddress: "0x0000000000000000000000000000000000000000" = "0x0000000000000000000000000000000000000000"

Const OldResolverAddresses

OldResolverAddresses: string[] = ['0x5ffc014343cd971b7eb70732021e26c35b744cc4','0x1da022710df5002339274aadee8d58218e9d6ab5','0xda1756bb923af5d1a05e277cb1e54f1d0a127890']

Const UDApiDefaultUrl

UDApiDefaultUrl: "https://unstoppabledomains.com/api/v1" = "https://unstoppabledomains.com/api/v1"

Const UNCLAIMED_DOMAIN_RESPONSE

UNCLAIMED_DOMAIN_RESPONSE: { addresses: {}; gundb?: undefined | { public_key?: undefined | string; username?: undefined | string }; ipfs?: undefined | { html?: undefined | string; redirect_domain?: undefined | string }; meta: { owner: string | null; ttl: number; type: string }; whois?: undefined | { email?: undefined | string; for_sale?: undefined | false | true } } = UnclaimedDomainResponse
deprecated

Use UnclaimedDomainResponse instead (deprecated since 0.3.4)

Type declaration

  • addresses: {}
    • [key: string]: string
  • Optional gundb?: undefined | { public_key?: undefined | string; username?: undefined | string }
  • Optional ipfs?: undefined | { html?: undefined | string; redirect_domain?: undefined | string }
  • meta: { owner: string | null; ttl: number; type: string }
    • owner: string | null
    • ttl: number
    • type: string
  • Optional whois?: undefined | { email?: undefined | string; for_sale?: undefined | false | true }

Const configObject

configObject: { type: string; value: string } = getConfig()

Type declaration

  • type: string
  • value: string

sha3

sha3: any = require('js-sha3').keccak_256

Const tHRP

tHRP: "tzil" = "tzil"

Functions

Const UrlNetworkMap

  • UrlNetworkMap(url: string): any

buildResolutionPackage

Const childhash

  • childhash(parent: nodeHash, label: string, options?: { prefix: boolean }): nodeHash
  • childhash(parent: string, child: string, options?: { prefix: boolean }): string
  • Parameters

    • parent: nodeHash
    • label: string
    • Default value options: { prefix: boolean } = { prefix: true }
      • prefix: boolean

    Returns nodeHash

  • Parameters

    • parent: string
    • child: string
    • Default value options: { prefix: boolean } = { prefix: true }
      • prefix: boolean

    Returns string

commaSeparatedList

  • commaSeparatedList(value: any, dummyPrevious: any): any

convertBits

  • convertBits(data: Buffer, fromWidth: number, toWidth: number, pad?: boolean): null | Buffer
  • convertBits

    groups buffers of a certain width to buffers of the desired width.

    For example, converts byte buffers to buffers of maximum 5 bit numbers, padding those numbers as necessary. Necessary for encoding Ethereum-style addresses as bech32 ones.

    Parameters

    • data: Buffer
    • fromWidth: number
    • toWidth: number
    • Default value pad: boolean = true

    Returns null | Buffer

createChecksum

  • createChecksum(hrp: string, data: Buffer): Buffer

decode

  • decode(bechString: string): null | { data: Buffer; hrp: string }
  • Parameters

    • bechString: string

    Returns null | { data: Buffer; hrp: string }

default

  • default(domain: string, __namedParameters?: { parent: undefined | string; prefix: undefined | false | true }): nodeHash
  • Parameters

    • domain: string
    • Default value __namedParameters: { parent: undefined | string; prefix: undefined | false | true } = { prefix: true }
      • parent: undefined | string
      • prefix: undefined | false | true

    Returns nodeHash

encode

  • encode(hrp: string, data: Buffer): string

fromBech32Address

  • fromBech32Address(address: string, testnet?: boolean): string
  • fromBech32Address

    Parameters

    • address: string

      a valid Zilliqa bech32 address

    • Default value testnet: boolean = false

    Returns string

    a canonical 20-byte Ethereum-style address

fromEthersProvider

fromWeb3Version0Provider

fromWeb3Version1Provider

getConfig

  • getConfig(): { type: string; value: string }

getEtheriumUrl

  • getEtheriumUrl(): string

hrpExpand

  • hrpExpand(hrp: string): Buffer

invert

  • invert(object: any): {}
  • Should invert the object (keys becomes values and values becomes keys)

    Parameters

    • object: any

    Returns {}

isAddress

  • isAddress(address: string): boolean

isByteString

  • isByteString(str: string, len: number): boolean

isNullAddress

  • isNullAddress(key: string | null | undefined): key is undefined | null
  • Parameters

    • key: string | null | undefined

    Returns key is undefined | null

Const namehash

  • namehash(name?: string, __namedParameters?: { parent: undefined | string; prefix: undefined | false | true }): string
  • Parameters

    • Default value name: string = ""
    • Default value __namedParameters: { parent: undefined | string; prefix: undefined | false | true } = { prefix: true }
      • parent: undefined | string
      • prefix: undefined | false | true

    Returns string

parseConfig

  • parseConfig(value: string): { type: string; value: string }
  • Parameters

    • value: string

    Returns { type: string; value: string }

    • type: string
    • value: string

polymod

  • polymod(values: Buffer): number

set

  • set(object: any, key: any, value: any): any
  • Parses object in format { "key.key2.key3" : value } into { key: { key2: {key3: value } } }

    Parameters

    • object: any

      object to parse

    • key: any

      string to split

    • value: any

      value to make it equal to

    Returns any

signedInfuraLink

  • signedInfuraLink(infura: string, network?: string): string
  • Parameters

    • infura: string
    • Default value network: string = "mainnet"

    Returns string

storeConfig

  • storeConfig(type: "infura" | "url", value: string): void

toBech32Address

  • toBech32Address(address: string, testnet?: boolean): string
  • toBech32Address

    Encodes a canonical 20-byte Ethereum-style address as a bech32 zilliqa address.

    The expected format is zil1

    where address and checksum are the result of bech32 encoding a Buffer containing the address bytes.

    Parameters

    • address: string
    • Default value testnet: boolean = false

    Returns string

    38 char bech32 encoded zilliqa address

Const toChecksumAddress

  • toChecksumAddress(address: string): string
  • toChecksumAddress

    takes hex-encoded string and returns the corresponding address

    Parameters

    • address: string

    Returns string

tryInfo

  • tryInfo(method: any, response: any, name: string): Promise<boolean>

verifyChecksum

  • verifyChecksum(hrp: string, data: Buffer): boolean

wrapArray

  • wrapArray<T>(params?: T | T[]): T[]

Object literals

Const DefaultAPI

DefaultAPI: object

url

url: string = UDApiDefaultUrl

Const Eip1993Factories

Eip1993Factories: object

fromEthersProvider

fromEthersProvider: fromEthersProvider

fromWeb3Version0Provider

fromWeb3Version0Provider: fromWeb3Version0Provider

fromWeb3Version1Provider

fromWeb3Version1Provider: fromWeb3Version1Provider

Const NetworkIdMap

NetworkIdMap: object

1

1: string = "mainnet"

111

111: string = "localnet"

333

333: string = "testnet"

Const RegistryMap

RegistryMap: object

mainnet

mainnet: string = "zil1jcgu2wlx6xejqk9jw3aaankw6lsjzeunx2j0jz"

Const UnclaimedDomainResponse

UnclaimedDomainResponse: object

addresses

addresses: {}

Type declaration

meta

meta: object

owner

owner: null = null

ttl

ttl: number = 0

type

type: string = ""

Const UrlMap

UrlMap: object

localnet

localnet: string = "http://localhost:4201"

mainnet

mainnet: string = "https://api.zilliqa.com"

testnet

testnet: string = "https://dev-api.zilliqa.com"

Generated using TypeDoc