import BN from 'bn.js'; import { ethers } from 'ethers'; import Web3 from 'web3'; import { Address, Client, Contracts } from '.'; import { GatewayUser, GatewayVersion } from './gateway-user'; import { IValidator, ICandidate, IDelegation, LockTimeTier, ITotalDelegation, ICandidateDelegations, IDelegatorDelegations } from './contracts/dpos2'; import { EthereumGatewayV2 as EthereumGatewayV2Contract } from './mainnet-contracts/EthereumGatewayV2'; import { ERC20 } from './mainnet-contracts/ERC20'; import { ValidatorManagerV2 as ValidatorManagerV2Contract } from './mainnet-contracts/ValidatorManagerV2'; export declare class DPOSUser extends GatewayUser { private _dappchainDPOS; static createOfflineUserAsync(endpoint: string, privateKey: string, dappchainEndpoint: string, dappchainKey: string, chainId: string, gatewayAddress: string, version?: GatewayVersion): Promise; static createMetamaskUserAsync(web3: Web3, dappchainEndpoint: string, dappchainKey: string, chainId: string, gatewayAddress: string, version?: GatewayVersion): Promise; static createEthSignMetamaskUserAsync(web3: Web3, dappchainEndpoint: string, chainId: string, gatewayAddress: string, version?: GatewayVersion): Promise; static createUserAsync(wallet: ethers.Signer, dappchainEndpoint: string, dappchainKey: string, chainId: string, gatewayAddress: string, version?: GatewayVersion): Promise; constructor(wallet: ethers.Signer, client: Client, loomAddress: Address, ethAddress: string, gateway: EthereumGatewayV2Contract, loomToken: ERC20, vmc: ValidatorManagerV2Contract | undefined, dappchainGateway: Contracts.LoomCoinTransferGateway, dappchainLoom: Contracts.Coin, dappchainDPOS: Contracts.DPOS2, dappchainMapper: Contracts.AddressMapper | null, version?: GatewayVersion); get dappchainDPOS(): Contracts.DPOS2; listValidatorsAsync(): Promise; listCandidatesAsync(): Promise; listAllDelegationsAsync(): Promise>; listDelegationsAsync(candidate: string): Promise; listDelegatorDelegations(delegator?: string): Promise; getTimeUntilElectionsAsync(): Promise; /** * Delegates an amount of LOOM tokens to a candidate/validator * * @param candidate The candidate's hex address * @param amount The amount delegated */ delegateAsync(candidate: string, amount: BN, tier: LockTimeTier): Promise; /** * Redelegates an amount of LOOM tokens from a validator to another * * @param formerValidator The candidate's hex address * @param newValidator The candidate's hex address * @param amount The amount delegated */ redelegateAsync(formerValidator: string, validator: string, amount: BN): Promise; /** * Undelegates an amount of LOOM tokens from a candidate/validator * * @param candidate The candidate's hex address * @param amount The amount to undelegate */ undelegateAsync(candidate: string, amount: BN): Promise; claimDelegationsAsync(withdrawalAddress?: string): Promise; /** * Returns the stake a delegator has delegated to a candidate/validator * * @param validator The validator's hex address * @param delegator The delegator's hex address */ checkDelegationsAsync(validator: string, delegator?: string): Promise; /** * Returns the total stake a delegator has delegated to all validators * * @param delegator The delegator's hex address. If not supplied, will use the current account as a delegator. */ getTotalDelegationAsync(delegator?: string): Promise; checkRewardsAsync(owner?: string): Promise; }