@ardier16/q-js-sdk
Version:
Typescript Library to interact with Q System Contracts
255 lines (219 loc) • 6.36 kB
TypeScript
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import BN from "bn.js";
import { ContractOptions } from "web3-eth-contract";
import { EventLog } from "web3-core";
import { EventEmitter } from "events";
import {
Callback,
PayableTransactionObject,
NonPayableTransactionObject,
BlockType,
ContractEventLog,
BaseContract,
} from "./types";
interface EventOptions {
filter?: object;
fromBlock?: BlockType;
topics?: string[];
}
export type ProposalCreated = ContractEventLog<{
_id: string;
_proposal: [
string,
[string, string, string, string, string, string, string, string],
[string, string, string],
boolean
];
0: string;
1: [
string,
[string, string, string, string, string, string, string, string],
[string, string, string],
boolean
];
}>;
export type ProposalExecuted = ContractEventLog<{
_proposalId: string;
_candidate: string;
_amountToSlash: string;
0: string;
1: string;
2: string;
}>;
export type QuorumReached = ContractEventLog<{
id: string;
0: string;
}>;
export type UserVoted = ContractEventLog<{
_proposalId: string;
_votingOption: string;
_amount: string;
0: string;
1: string;
2: string;
}>;
export type VetoOccurred = ContractEventLog<{
id: string;
sender: string;
0: string;
1: string;
}>;
export interface RootNodesSlashingVoting extends BaseContract {
constructor(
jsonInterface: any[],
address?: string,
options?: ContractOptions
): RootNodesSlashingVoting;
clone(): RootNodesSlashingVoting;
methods: {
hasRootVetoed(
arg0: number | string | BN,
arg1: string
): NonPayableTransactionObject<boolean>;
hasUserVoted(
arg0: number | string | BN,
arg1: string
): NonPayableTransactionObject<boolean>;
proposalCount(): NonPayableTransactionObject<string>;
proposals(
arg0: number | string | BN
): NonPayableTransactionObject<{
base: [
string,
[string, string, string, string, string, string, string, string],
[string, string, string],
boolean
];
proposer: string;
candidate: string;
amountToSlash: string;
0: [
string,
[string, string, string, string, string, string, string, string],
[string, string, string],
boolean
];
1: string;
2: string;
3: string;
}>;
initialize(_registry: string): NonPayableTransactionObject<void>;
createProposal(
_remark: string,
_candidate: string,
_percentage: number | string | BN
): NonPayableTransactionObject<string>;
voteFor(
_proposalId: number | string | BN
): NonPayableTransactionObject<void>;
voteAgainst(
_proposalId: number | string | BN
): NonPayableTransactionObject<void>;
execute(
_proposalId: number | string | BN
): NonPayableTransactionObject<void>;
veto(_proposalId: number | string | BN): NonPayableTransactionObject<void>;
skipVetoPhase(
_proposalId: number | string | BN
): NonPayableTransactionObject<void>;
getProposal(
_proposalId: number | string | BN
): NonPayableTransactionObject<
[
string,
[string, string, string, string, string, string, string, string],
[string, string, string],
boolean
]
>;
getSlashingVictim(
_proposalId: number | string | BN
): NonPayableTransactionObject<string>;
getSlashingProposer(
_proposalId: number | string | BN
): NonPayableTransactionObject<string>;
getProposalStats(
_proposalId: number | string | BN
): NonPayableTransactionObject<[string, string, string, string, string]>;
slashingAffectsWithdrawal(
_proposalId: number | string | BN
): NonPayableTransactionObject<boolean>;
getProposalStartTime(
_proposalId: number | string | BN
): NonPayableTransactionObject<string>;
getVetosNumber(
_proposalId: number | string | BN
): NonPayableTransactionObject<string>;
getVetosPercentage(
_proposalId: number | string | BN
): NonPayableTransactionObject<string>;
isOverruleApplied(
_proposalId: number | string | BN
): NonPayableTransactionObject<boolean>;
getVotingWeightInfo(
_proposalId: number | string | BN
): NonPayableTransactionObject<
[boolean, boolean, [string, string, string, string]]
>;
getStatus(
_proposalId: number | string | BN
): NonPayableTransactionObject<string>;
};
events: {
ProposalCreated(cb?: Callback<ProposalCreated>): EventEmitter;
ProposalCreated(
options?: EventOptions,
cb?: Callback<ProposalCreated>
): EventEmitter;
ProposalExecuted(cb?: Callback<ProposalExecuted>): EventEmitter;
ProposalExecuted(
options?: EventOptions,
cb?: Callback<ProposalExecuted>
): EventEmitter;
QuorumReached(cb?: Callback<QuorumReached>): EventEmitter;
QuorumReached(
options?: EventOptions,
cb?: Callback<QuorumReached>
): EventEmitter;
UserVoted(cb?: Callback<UserVoted>): EventEmitter;
UserVoted(options?: EventOptions, cb?: Callback<UserVoted>): EventEmitter;
VetoOccurred(cb?: Callback<VetoOccurred>): EventEmitter;
VetoOccurred(
options?: EventOptions,
cb?: Callback<VetoOccurred>
): EventEmitter;
allEvents(options?: EventOptions, cb?: Callback<EventLog>): EventEmitter;
};
once(event: "ProposalCreated", cb: Callback<ProposalCreated>): void;
once(
event: "ProposalCreated",
options: EventOptions,
cb: Callback<ProposalCreated>
): void;
once(event: "ProposalExecuted", cb: Callback<ProposalExecuted>): void;
once(
event: "ProposalExecuted",
options: EventOptions,
cb: Callback<ProposalExecuted>
): void;
once(event: "QuorumReached", cb: Callback<QuorumReached>): void;
once(
event: "QuorumReached",
options: EventOptions,
cb: Callback<QuorumReached>
): void;
once(event: "UserVoted", cb: Callback<UserVoted>): void;
once(
event: "UserVoted",
options: EventOptions,
cb: Callback<UserVoted>
): void;
once(event: "VetoOccurred", cb: Callback<VetoOccurred>): void;
once(
event: "VetoOccurred",
options: EventOptions,
cb: Callback<VetoOccurred>
): void;
}