UNPKG

@swaptoshi/governance-module

Version:

Klayr governance on-chain module

22 lines (21 loc) 2.08 kB
import { Modules, StateMachine } from 'klayr-framework'; import { GovernableConfigRegistry } from './registry'; import { BaseGovernableConfig } from './base_governable_config'; import { NextAvailableProposalIdStoreData, ProposalStoreData, StoreInstance } from './types'; import { BoostedAccount, DelegatedVote, Proposal, ProposalQueue } from './stores/instances'; export declare class GovernanceMethod extends Modules.BaseMethod { private _governableConfig; init(governableConfig: GovernableConfigRegistry): void; registerGovernableConfig(args: Modules.ModuleInitArgs, moduleName: string, governableConfig: BaseGovernableConfig<any>): void; unregisterGovernableConfig(moduleName: string, governableConfig: BaseGovernableConfig<any>): void; getGovernableConfig<T extends object>(module: string): BaseGovernableConfig<T>; getConfig(context: StateMachine.MethodContext): Promise<import("./types").GovernanceModuleConfig>; getCastedVote(context: StateMachine.MethodContext, address: Buffer): Promise<import("./types").CastedVoteStoreData>; getBaseVoteScore(context: StateMachine.MethodContext, address: Buffer): Promise<bigint>; createProposal(context: StateMachine.MethodContext, senderAddress: Buffer, height: number, title: string, summary: string, actions: ProposalStoreData['actions'], attributes: ProposalStoreData['attributes']): Promise<void>; getProposalInstance(context: StateMachine.MethodContext, senderAddress: Buffer, height: number, proposalId: number): Promise<StoreInstance<Proposal>>; getProposalQueueInstance(context: StateMachine.MethodContext, senderAddress: Buffer, height: number): Promise<StoreInstance<ProposalQueue>>; getBoostedAccountInstance(context: StateMachine.MethodContext, address: Buffer, height: number): Promise<StoreInstance<BoostedAccount>>; getDelegatedVoteInstance(context: StateMachine.MethodContext, address: Buffer, height: number): Promise<StoreInstance<DelegatedVote>>; getNextAvailableProposalId(context: StateMachine.MethodContext): Promise<NextAvailableProposalIdStoreData>; }