import { RecordExt, Types } from "../../../declarations"; import { Principal } from '@dfinity/principal'; import { RegistryActor } from '../..'; /** * ICNS Registry Controller. * This class is responsible for handling all the requests related to the ICNS registry canister. */ export declare class ICNSRegistryController { private registryActor; /** * Create an instance that communicates with icns registry canister. * Some of the functions uses the actor agent identity to identify the user that is interacting. * @param {RegistryActor} registryActor actor or an anonymous will be used */ constructor(registryActor?: RegistryActor); /** * Get the principal of the agent. * It is going to throw if the principal is anonymous. * @internal * @returns {Promise} Return Principal stored in agent */ private getAgentPrincipal; /** * Get record in registry canister. * @param {string} domain Represents user domain, such as: 'test.icp' * @returns {Promise} Return record data object. Return null if not set. */ getRecord(domain: string): Promise; /** * Get user's all registed domains in registry canister. * @param {Principal} user Represents the Principal id of the user. * @returns {Promise} Return record data object. */ getUserNames(user: Principal): Promise; /** * Get domain resolver in registry canister. * @param {string} domain Represents user domain, such as: 'test.icp' * @returns {Promise} Return the Principal id resolved from this domain name, return null if not set. */ getResolver(domain: string): Promise; /** * Get domain owner in registry canister. * @param {string} domain Represents user domain, such as: 'test.icp' * @returns {Promise} Return the Principal id of this name's owner, return null if not set. */ getOwner(domain: string): Promise; /** * Get domain controller in registry canister. * @param {string} domain Represents user domain, such as: 'test.icp' * @returns {Promise} Return the Principal id of this name's controller, return null if not set. */ getController(domain: string): Promise; /** * Get domain ttl in registry canister. * @param {string} domain Represents user domain, such as: 'test.icp'. * @returns {Promise} Return TTL value. */ getTTL(domain: string): Promise; /** * Get domain expiry in registry canister. * @param {string} domain Represents user domain, such as: 'test.icp'. * @returns {Promise} Return the expiry time of this domain name, return null if not timed. */ getExpiry(domain: string): Promise; /** * Check if domain record exist in registry canister. * @param {string} domain Represents user domain, such as: 'test.icp' * @returns {Promise} Return whether its record exists */ recordExists(domain: string): Promise; /** * Set record according to domain. * @param {Types.RecordParams} params The data of the record. * @returns {Promise} Return void promise. */ setRecord(params: Types.RecordParams): Promise; /** * Set subnoderecord according to domain. * @param {Types.RecordParams} params The data of the record. * @returns {Promise} Return void promise. */ setSubnodeRecord(params: Types.RecordParams): Promise; /** * Set domain owner according to domain. * @param {string} domain Represents user domain, such as: 'test.icp'. * @param {Principal} owner Represents the Principal id of the new owner. * @returns {Promise} Return void promise */ setOwner(domain: string, owner: Principal): Promise; /** * Set domain controller according to domain. * @param {Principal} domain Represents user domain, such as: 'test.icp'. * @param {Principal} controller Represents new controller. * @returns {Promise} Return void promise. */ setController(domain: string, controller: Principal): Promise; /** * Set domain's resolver according to domain. * @param {string} domain Represents user domain, such as: 'test.icp'. * @param {Principal} resolver Represents new resolver. * @returns {Promise} Return void promise. */ setResolver(domain: string, resolver: Principal): Promise; /** * set domain ttl according to domain. * @param {string} domain Represents the domain name, such as: 'test.icp'. * @param {bigint} ttl Represents the new ttl. * @returns {Promise} Return void promise. */ setTTL(domain: string, ttl: bigint): Promise; /** * Set sub domain owner according to domain. * @param {string} domain Represents user domain, such as: 'test.icp'. * @param {string} sublabel Represents sublabel, such as: 'hello.test.icp'. * @param {Principal} owner Represents the Principal id of the thenew owner. * @returns {Promise} Return void promise. */ setSubDomainOwner(domain: string, sublabel: string, owner: Principal): Promise; /** * Set subdomain expiry. * @param {string} domain Represents user domain, such as: 'test.icp'. * @param {string} sublabel Represents sublabel, such as: 'hello.test.icp'. * @param {bigint} newExpiry Represents the new expiry. * @returns {Promise} Return void promise. */ setSubDomainExpiry(domain: string, sublabel: string, newExpiry: bigint): Promise; /** * Get whether someone is approved for all domains of an owner. * @param {Principal} owner Represents the Principal id of the owner. * @param {Principal} operator Represents the principal id of the one to get checked. * @returns {Promise} */ isApprovedForAll(owner: Principal, operator: Principal): Promise; /** * Get whether someone is approved for specific domain. * @param {string} domain Represents domain name. * @param {Principal} who Represents the principal id of the one to get checked. * @returns {Promise} */ isApproved(domain: string, who: Principal): Promise; /** * get approved operator of a domain. * @param {string} domain Represents domain name. * @returns {Promise} Return Principal id of the approved operator. Return null if no one got approved. */ getApproved(domain: string): Promise; /** * get user's domain. * @param {owner} Represents user identity * @returns {Promise} */ balanceOf(owner: Principal): Promise; /** * Approve transfers domian from registrar canister. * This function uses the actor agent identity. * This function needs to be called before operate with registry canister. * @param {string} domain Represents domain name to be approved. * @param {Principal} operator Represents approve who can operate owner's domain. * @returns {Promise} Return void promise. */ approve(domain: string, operator: Principal): Promise; /** * Approve transfers domain from registrar canister. * This function uses the actor agent identity. * This function needs to be called before operate with registry canister. * @param {boolean} approved Represents whether the approve operator are approved for all domians. * @param {Principal} operator Represents the Principal id of the operator. * @returns {Promise} Return void promise. */ setApprovalForAll(approved: boolean, operator: Principal): Promise; /** * transfers domain from owner to others. * This function uses the actor agent identity. * This function needs to be called before operate with registry canister. * @param {string} domain Represents domain name * @param {Principal} to Represents who will get the domain * @returns {Promise} Return void promise */ transfer(domain: string, to: Principal): Promise; /** * allow operator transfers domain from owner to others. * This function uses the actor agent identity. * This function needs to be called before operate with registry canister. * @param {string} domain Represents domain name. * @param {Principal} from Represents the domain's owner. * @param {Principal} to Represents who will get the domain. * @returns {Promise} Return void promise. */ transferFrom(domain: string, from: Principal, to: Principal): Promise; }