import { DefaultInfoExt, Types } from "../../../declarations"; import { Principal } from "@dfinity/principal"; import { ResolverActor } from "../.."; /** * ICNS Resolver Controller. * This class is responsible for handling all the requests related to the ICNS resolver canister. */ export declare class ICNSResolverController { private resolverActor; DefaultInfo: DefaultInfoExt | null; /** * Create an instance that communicates with icns resolver canister. * Some of the functions uses the actor agent identity to identify the user that is interacting. * @param {ResolverActor} resolverActor actor or an anonymous will be used */ constructor(resolverActor?: ResolverActor); /** * Get the principal of the agent. * It is going to throw if the principal is anonymous. * @internal * @returns {Promise} */ private getAgentPrincipal; /** * Get user default info in resolver canister. * @param {string} domain Represents user domain, such as: 'test.icp'. * @returns {Promise} Return info or null. */ getUserDefaultInfo(domain: string): Promise; /** * Get principal id by name. * @param {string} domain Represents user domain, such as: 'test.icp'. * @returns {Promise} Return Principal id in domain's record. */ getPrincipalId(domain: string): Promise; /** * Get setted coin address. * @param {string} domain Represents domain name. * @param {string} coinType Represents coin type. * @returns {Promise} Return coin address. */ getAddr(domain: string, coinType: string): Promise; /** * Get text info. * @param {string} domain Represents user domain, such as: 'test.icp'. * @param {string} key Represents user info, such as: twitter. * @returns {Promise} Return user info. */ getText(domain: string, key: string): Promise; /** * Get canister id in the record. * @param {string} domain Represents user domain, such as: 'test.icp'. * @param {string} key Represents canister, such as: main. * @returns {Promise} Return canister id in the record. */ getCanister(domain: string, key: string): Promise; /** * Get host record. * @param {string} domain Represents user domain, such as: 'test.icp'. * @returns {Promise} Return host of a domain name. */ getHost(domain: string): Promise; /** * Set default info according to domain. * @param {string} domain Represents user domain, such as: 'test.icp'. * @param {ICNSResolverController.DefaultInfo} type Represents which type info user wants to set. * @param {string} value Represents the value. * @param {string} extensionType Represents the extra type user wants to set. * @returns {Promise} Return void promise. */ setDefaultInfo(domain: string, type: ICNSResolverController.DefaultInfo, value: string, extensionType?: string): Promise; /** * Set coin addresss in user info. * @param {string} domain Represents user domain, such as: 'test.icp'. * @param {string} coinType Represents user domain, such as: 'test.icp'. * @param {string} value Represents coin address. '' is allowed to unset this coinType field. Length must be less than 250. This sdk will varify the value. * @returns {Promise} Return void promise. */ setAddr(domain: string, coinType: string, value: string): Promise; /** * Set text in user info. * @param {string} domain Represents user domain, such as: 'test.icp'. * @param {string} key Represents user domain, such as: 'test.icp'. * @param {string} value Represents info. '' is allowed to unset this info field(if it's an extension field, it will be deleted). Length must be less than 250. * @returns {Promise} Return void promise. */ setText(domain: string, key: string, value: string): Promise; /** * Set canister id in user info. * @param {string} domain Represents user domain, such as: 'test.icp'. * @param {string} key Represents user domain, such as: 'test.icp'. * @param {string} value Represents canister id. * @returns {Promise} Return void promise. */ setCanister(domain: string, key: string, value: string): Promise; /** * Set host record in user info. * @param {string} domain Represents user domain, such as: 'test.icp'. * @param {ICNSResolverController.Host} params Host value. * @returns {Promise} Return void promise. */ setHost(domain: string, params?: Types.Host): Promise; } /** * @internal * Type definition for the ICNSResolverController. */ export declare namespace ICNSResolverController { /** * Type definition for params of the setDefaultInfo function. * @param {DefaultInfo} */ enum DefaultInfo { btc = 0, eth = 1, icp = 2, pid = 3, url = 4, twitter = 5, canisterExtensions = 6, description = 7, email = 8, textExtensions = 9, addrExtensions = 10, discord = 11, mainCanister = 12, telegram = 13, github = 14, avatar = 15 } }