UNPKG

1.1 kBTypeScriptView Raw
1import NamingService from './namingService';
2import { NamicornResolution } from './types';
3export default class Udapi extends NamingService {
4 private url;
5 private headers;
6 constructor();
7 /**
8 * Resolves the domain via UD API mirror
9 * @param domain - domain name to be resolved
10 * @param currencyTicker - currencyTicker such as
11 * - ZIL
12 * - BTC
13 * - ETH
14 */
15 address(domain: string, currencyTicker: string): Promise<string>;
16 /**
17 * Owner of the domain
18 * @param domain - domain name
19 * @returns An owner address of the domain
20 */
21 owner(domain: string): Promise<string | null>;
22 /**
23 * Resolves the domain name via UD API mirror
24 * @param domain - domain name to be resolved
25 */
26 resolve(domain: string): Promise<NamicornResolution>;
27 private findMethod;
28 private findMethodOrThrow;
29 /**
30 * Looks up for an arbitrary key inside the records of certain domain
31 * @param domain - domain name
32 * @param key - key to look for
33 */
34 record(domain: string, key: string): Promise<string>;
35}