import { providers } from 'ethers'; import { ApprovedRegistration, OnDemandEntry, SelfRegEntry, SubdomainBalanceVerificationResult, SubdomainEntry, SubdomainFees } from '../types/Subdomain'; import BaseRegistrar from '../BaseRegistrar'; import { SubdomainApproval } from '../../api'; /** * Class that handles subdomain registration. * Registration is done in 2 steps: * 1. Calling {@link approveSelfRegistration} or {@link approveOndemandRegistration} to get registration approval. * 2. Calling {@link finishRegistration} to finish registration. * @example * Register subdomain "john" for domain "wallet" owned by signer and pay in ETH * ```ts * const subdomainRegistrar = new SubdomainRegistrar({ * network: network, * provider: provider, * signer: signer * }); * const registration = await subdomainRegistrar.approveSelfRegistration({ name: 'wallet', label: 'john' }); * const tx = await subdomainRegistrar.finishRegistration(registration); * await tx.wait(1); * ``` */ declare class SubdomainRegistrar extends BaseRegistrar { /** * Get subdomain registration approval for domain names owned by signer * @param {SelfRegEntry | Array} entry - list of domains and subdomains to register * @param {string} owner - ETH address of the owner of created subdomains, defaults to signer address * @param {boolean} isFeeInDWEB - if true, registration fee will be paid in DWEB tokens, otherwise in ETH */ approveSelfRegistration(entry: SelfRegEntry | Array, isFeeInDWEB?: boolean, owner?: string | null): Promise; /** * Get subdomain registration approval for staked domain names * @param entry * @param owner * @param isFeeInDWEB - if true, registration fee will be paid in DWEB tokens, otherwise in ETH */ approveOndemandRegistration(entry: OnDemandEntry | Array, isFeeInDWEB?: boolean, owner?: string | null): Promise; finishRegistration({ approval, owner, isFeeInDWEB }: ApprovedRegistration): Promise; /** * Verify that signer has enough balance to pay for registration * @param approval * @param isFeeInDWEB */ verifySignerBalance(approval: SubdomainApproval, isFeeInDWEB?: boolean): Promise; /** * Calculate total owner and service fee for approved subdomain registration * @param approval * @param isFeeInDWEB */ calculateTotalFee(approval: SubdomainApproval, isFeeInDWEB?: boolean): Promise; normalizeEntries(entry: SubdomainEntry | Array): Promise>; /** * Get service fee for subdomain registration * @returns - fee in USD */ getServiceFee(): Promise; /** * Get service fee for subdomain renewal. * @returns - fee in USD */ getRenewalServiceFee(): Promise; } export default SubdomainRegistrar;