import DwebContractWrapper from '../DwebContractWrapper'; import { BigNumber, ethers, providers, Signer } from 'ethers'; import DecentrawebAPI from '../api'; import { DwebConfig, Network } from '../types/common'; import { StakingState } from './types/StakingState'; /** * Configuration for the registrar * @property signer - Ethers.js Ethereum signer for writing data to the blockchain (required) */ export interface RegistrarConfig extends DwebConfig { signer: Signer; } /** * Base class for all registrars */ declare abstract class BaseRegistrar extends DwebContractWrapper { /** Current network name */ readonly network: Network; /** DecentraWeb API wrapper instance */ readonly api: DecentrawebAPI; /** Ethers.js Ethereum signer for writing data to the blockchain */ readonly signer: Signer; /** DWEB token contract */ readonly dwebToken: ethers.Contract; /** WETH token contract, only available on the Polygon network */ readonly wethToken?: ethers.Contract; constructor(options: RegistrarConfig); /** * Is the registrar on the Polygon network */ get isMatic(): boolean; /** * Approve the DWEB/WETH token amount that can be used by the registrar contract * @param token - token name. WETH is only supported on the Polygon network * @param amount - amount in wei */ setTokenAllowance(token: 'WETH' | 'DWEB', amount: BigNumber): Promise; /** * Get DWEB/WETH token amount that can be used by the registrar contract * @param token - token name. WETH is only supported on the Polygon network */ getTokenAllowance(token: 'WETH' | 'DWEB'): Promise; /** * Get DWEB/WETH token balance of the signer * @param token - token name. WETH is only supported on the Polygon network */ getTokenBalance(token: 'DWEB' | 'WETH'): Promise; /** * Approve unlimited token usage by the registrar contract, so no further approvals are needed * @param token - token name. WETH is only supported on the Polygon network */ allowTokenUsage(token: 'WETH' | 'DWEB'): Promise; /** * Check staking status of a list of domains * @param domains - list of domains to check */ stakingStatus(domains: string[]): Promise; } export default BaseRegistrar;