UNPKG

@ardier16/q-js-sdk

Version:

Typescript Library to interact with Q System Contracts

58 lines (57 loc) 2.79 kB
import Web3 from 'web3'; import { TransactionReceipt } from 'web3-eth/types'; import { BaseProposal, QNonPayableTx } from '../../types'; import { GeneralUpdateVoting } from '../../web3-contracts/GeneralUpdateVoting'; import { VotingWeightInfo } from '../QthVotingHelperInstance'; import { SystemVotingVetoableInstance } from '../SystemVotingVetoableInstance'; import { VotingWeightProxyInstance } from './VotingWeightProxyInstance'; export interface GeneralProposal { base: BaseProposal; } /** * General update voting instance to interact with General update voting contract. * See [onchain documentation](@system-contracts-repo/@network/GeneralUpdateVoting/) for more details. * An instance of this class for a deployed network can be obtained via {@link ContractRegistryInstance.generalUpdateVoting} */ export declare class GeneralUpdateVotingInstance extends SystemVotingVetoableInstance<GeneralUpdateVoting, GeneralProposal> { static readonly registryKey = "governance.generalUpdateVoting"; static readonly abi = "GeneralUpdateVoting.json"; /** * VotingWeightProxy instance. Used by local methods. */ votingWeightProxy: VotingWeightProxyInstance; private qthVotingHelper; constructor(web3: Web3, address: string); /** * [External documentation](@system-contracts-repo/@network/GeneralUpdateVoting/#proposalcount) */ proposalCount(): Promise<string>; /** * [External documentation](@system-contracts-repo/@network/GeneralUpdateVoting/#hasrootvetoed) */ hasRootVetoed(proposalId: number | string, address: string): Promise<boolean>; /** * [External documentation](@system-contracts-repo/@network/GeneralUpdateVoting/#hasuservoted) */ hasUserVoted(proposalId: string | number, address: string): Promise<boolean>; /** * [External documentation](@system-contracts-repo/@network/GeneralUpdateVoting/#createproposal) */ createProposal(remark: string, txOptions?: QNonPayableTx): Promise<TransactionReceipt>; /** * [External documentation](@system-contracts-repo/@network/GeneralUpdateVoting/#getvotesfor) */ getVotesFor(proposalId: number | string): Promise<string>; /** * [External documentation](@system-contracts-repo/@network/GeneralUpdateVoting/#getvotesagainst) */ getVotesAgainst(proposalId: number | string): Promise<string>; /** * [External documentation](@system-contracts-repo/@network/GeneralUpdateVoting/#proposals) */ getProposal(proposalId: string | number): Promise<GeneralProposal>; /** * [External documentation](@system-contracts-repo/@network/GeneralUpdateVoting/#getvotingweightinfo) */ getVotingWeightInfo(proposalId: string | number, address: string): Promise<VotingWeightInfo>; }