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

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

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

            • error: Error | null
            • Optional result: JsonRpcResponse

            Returns void

      Returns void

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; methodName?: undefined | string; providerMessage?: undefined | string; recordName?: undefined | string }

Explains Resolution Error options

Type declaration

  • Optional currencyTicker?: undefined | string
  • Optional domain?: undefined | string
  • Optional method?: ResolutionMethod
  • Optional methodName?: undefined | string
  • Optional providerMessage?: undefined | string
  • 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 }; records?: undefined | {}; 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 records?: undefined | {}
  • Optional whois?: undefined | { email?: undefined | string; for_sale?: undefined | false | true }

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 }; records?: undefined | {}; 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 records?: undefined | {}
  • 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

Const secp256k1

secp256k1: any = new elliptic.ec('secp256k1')

Const tHRP

tHRP: "tzil" = "tzil"

Functions

Const UrlNetworkMap

  • UrlNetworkMap(url: string): any

buildResolutionPackage

Const bytesLength

  • bytesLength(a: string): number

Const bytesSlice

  • bytesSlice(i: number, j: number, bs: string): string

Const bytesToNumber

  • bytesToNumber(hex: string): number

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 }

Const decodeSignature

  • decodeSignature(hex: string): string[]

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 }

getEthereumUrl

  • getEthereumUrl(): string

Const hashMessage

  • hashMessage(message: string): string

hexToBytes

  • hexToBytes(hexString: string): number[]

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

isLegacyResolver

  • isLegacyResolver(resolverAddress: string): boolean

isNullAddress

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

    • key: string | null | undefined

    Returns key is undefined | null

Const isValidTwitterSignature

  • isValidTwitterSignature(domain: string, owner: string, twitterHandle: string, validationSignature: string): Promise<boolean>
  • Parameters

    • domain: string
    • owner: string
    • twitterHandle: string
    • validationSignature: string

    Returns Promise<boolean>

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

Const recover

  • recover(message: string, signature: string): string

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 toChecksum

  • toChecksum(address: string): string

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

localnet

localnet: number = 111

mainnet

mainnet: number = 1

testnet

testnet: number = 333

Const ReaderMap

ReaderMap: object

1

1: string = "0x7ea9ee21077f84339eda9c80048ec6db678642b1"

42

42: string = "0xcf4318918fd18aca9bdc11445c01fbada4b448e3"

Const RegistryMap

RegistryMap: object

1

1: 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

1

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

111

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

333

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

Generated using TypeDoc