@q-dev/q-js-sdk
Version:
Typescript Library to interact with Q System Contracts
84 lines (83 loc) • 3.71 kB
TypeScript
import type { ContractTransaction, BigNumberish } from 'ethers';
import { Roots } from '../../../ethers-contracts/Roots';
import { QNonPayableTx, QPayableTx, RootNodesWithdrawalInfo, VotingLockInfo, SignerOrProvider } from '../../../types';
import { TimeLockHelperInstance } from '../../TimeLockHelperInstance';
import { VotingWeightProxyInstance } from '../VotingWeightProxyInstance';
export interface Stake {
root: string;
value: string;
}
/**
* Root nodes instance to interact with Root nodes contract.
* See [onchain documentation](@system-contracts-repo/@network/Roots/) for more details.
* An instance of this class for a deployed network can be obtained via {@link ContractRegistryInstance.rootNodes}
*/
export declare class RootNodesInstance extends TimeLockHelperInstance<Roots> {
static readonly registryKey = "governance.rootNodes";
static readonly abi = "Roots.json";
/**
* VotingWeightProxy instance. Used by local methods.
*/
votingWeightProxy: VotingWeightProxyInstance;
constructor(signerOrProvider: SignerOrProvider, address: string);
/**
* [External documentation](@system-contracts-repo/@network/Roots/#getlockinfo)
*/
getLockInfo(who: string): Promise<VotingLockInfo>;
/**
* [External documentation](@system-contracts-repo/@network/Roots/#getslashingproposalids)
*/
getSlashingProposalIds(root: string): Promise<string[]>;
/**
* [External documentation](@system-contracts-repo/@network/Roots/#applyslashing)
*/
applySlashing(proposalId: BigNumberish, root: string, amountToSlash: BigNumberish, txOptions?: QNonPayableTx): Promise<ContractTransaction>;
/**
* [External documentation](@system-contracts-repo/@network/Roots/#addslashingproposal)
*/
addSlashingProposal(root: string, slashingProposalId: BigNumberish, txOptions?: QNonPayableTx): Promise<ContractTransaction>;
/**
* [External documentation](@system-contracts-repo/@network/Roots/#getmembers)
*/
getMembers(): Promise<string[]>;
/**
* [External documentation](@system-contracts-repo/@network/Roots/#ismember)
*/
isMember(user: string): Promise<boolean>;
/**
* [External documentation](@system-contracts-repo/@network/Roots/#getsize)
*/
getSize(): Promise<string>;
/**
* [External documentation](@system-contracts-repo/@network/Roots/#getlimit)
*/
getLimit(): Promise<string>;
/**
* [External documentation](@system-contracts-repo/@network/Roots/#getrootnodestake)
*/
getRootNodeStake(root: string): Promise<string>;
/**
* [External documentation](@system-contracts-repo/@network/Roots/#getstakes)
*/
getStakes(): Promise<Stake[]>;
/**
* [External documentation](@system-contracts-repo/@network/Roots/#commitstake)
*/
commitStake(txOptions?: QPayableTx): Promise<ContractTransaction>;
/**
* [External documentation](@system-contracts-repo/@network/Roots/#announcewithdrawal)
*/
announceWithdrawal(amount: string, txOptions?: QNonPayableTx): Promise<ContractTransaction>;
/**
* [External documentation](@system-contracts-repo/@network/Roots/#withdraw)
*/
withdraw(amount: string, payTo: string, txOptions?: QNonPayableTx): Promise<ContractTransaction>;
/**
* [External documentation](@system-contracts-repo/@network/Roots/#withdrawals)
*/
getWithdrawalInfo(address: string): Promise<RootNodesWithdrawalInfo>;
/**
* [External documentation](https://q-dev.gitlab.io/system-contracts/latest/Roots/#purgependingslashings)
*/
purgePendingSlashings(root: string, txOptions?: QNonPayableTx): Promise<ContractTransaction>;
}