UNPKG

@ardier16/q-js-sdk

Version:

Typescript Library to interact with Q System Contracts

73 lines (72 loc) 3.58 kB
import Web3 from 'web3'; import { Classification, Parameter, QNonPayableTx, RawParameter, RawParameterAsArray } from '../../../types'; import { ConstitutionVoting } from '../../../web3-contracts/ConstitutionVoting'; import { VotingWeightInfo } from '../../QthVotingHelperInstance'; import { TransactionReceipt } from 'web3-eth/types'; import { ProposalWithBaseInfo } from '../../../types'; import { SystemVotingVetoableInstance } from '../../SystemVotingVetoableInstance'; import { VotingWeightProxyInstance } from '../VotingWeightProxyInstance'; export interface ConstitutionProposal extends ProposalWithBaseInfo { parametersSize: string; classification: Classification; newConstitutionHash: string; currentConstitutionHash: string; } /** * Constitution voting instance to interact with Constitution voting contract. * See [onchain documentation](@system-contracts-repo/@network/ConstitutionVoting/) for more details. * An instance of this class for a deployed network can be obtained via {@link ContractRegistryInstance.constitutionVoting} */ export declare class ConstitutionVotingInstance extends SystemVotingVetoableInstance<ConstitutionVoting, ConstitutionProposal> { static readonly registryKey = "governance.constitution.parametersVoting"; static readonly abi = "ConstitutionVoting.json"; /** * VotingWeightProxy instance. Used by local methods. */ votingWeightProxy: VotingWeightProxyInstance; private helper; private qthVotingHelper; constructor(web3: Web3, address: string); /** * [External documentation](@system-contracts-repo/@network/ConstitutionVoting/#hasrootvetoed) */ hasRootVetoed(proposalId: number | string, address: string): Promise<boolean>; /** * [External documentation](@system-contracts-repo/@network/ConstitutionVoting/#hasuservoted) */ hasUserVoted(proposalId: string | number, address: string): Promise<boolean>; /** * [External documentation](@system-contracts-repo/@network/ConstitutionVoting/#proposalcounter) */ proposalCount(): Promise<string>; /** * [External documentation](@system-contracts-repo/@network/ConstitutionVoting/#createproposal) */ createProposal(remark: string, classification: Classification, newConstitutionHash: string, parameters: Parameter[], txOptions?: QNonPayableTx): Promise<TransactionReceipt>; /** * [External documentation](@system-contracts-repo/@network/ConstitutionVoting/#proposals) */ getProposal(proposalId: string | number): Promise<ConstitutionProposal>; /** * [External documentation](@system-contracts-repo/@network/ConstitutionVoting/#getparametersarr) */ getParametersArr(proposalId: string | number): Promise<(RawParameter & RawParameterAsArray)[]>; /** * [External documentation](@system-contracts-repo/@network/ConstitutionVoting/#getconstitutionhash) */ getConstitutionHash(proposalId: string | number): Promise<string>; /** * [External documentation](@system-contracts-repo/@network/ConstitutionVoting/#getvotingweightinfo) */ getVotingWeightInfo(proposalId: string | number, address: string): Promise<VotingWeightInfo>; /** * Retrieve proposal parameters. * @param proposalId chosen proposal id * @returns Proposal parameters */ getProposedParameters(proposalId: string | number): Promise<Parameter[]>; /** * [External documentation](@system-contracts-repo/@network/ConstitutionVoting/#constitutionhash) */ constitutionHash(): Promise<string>; }