@ardier16/q-js-sdk
Version:
Typescript Library to interact with Q System Contracts
234 lines (194 loc) • 5.92 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 CommittedStake = ContractEventLog<{
_root: string;
_amount: string;
0: string;
1: string;
}>;
export type DepositedStake = ContractEventLog<{
_sender: string;
_root: string;
_amount: string;
0: string;
1: string;
2: string;
}>;
export type NewTimeLock = ContractEventLog<{
_account: string;
_timelock: [string, string, string];
0: string;
1: [string, string, string];
}>;
export type Purged = ContractEventLog<{
_account: string;
_timelock: [string, string, string];
0: string;
1: [string, string, string];
}>;
export type WithdrawalAnnounced = ContractEventLog<{
_root: string;
_amount: string;
0: string;
1: string;
}>;
export type Withdrawn = ContractEventLog<{
_root: string;
_paidTo: string;
_amount: string;
0: string;
1: string;
2: string;
}>;
export interface Roots extends BaseContract {
constructor(
jsonInterface: any[],
address?: string,
options?: ContractOptions
): Roots;
clone(): Roots;
methods: {
depositOnBehalfOf(
_account: string,
_releaseStart: number | string | BN,
_releaseEnd: number | string | BN
): PayableTransactionObject<void>;
getMinimumBalance(
_account: string,
_timestamp: number | string | BN
): NonPayableTransactionObject<string>;
getTimeLocks(
_account: string
): NonPayableTransactionObject<[string, string, string][]>;
pendingSlashingProposals(
arg0: string,
arg1: number | string | BN
): NonPayableTransactionObject<string>;
purgeTimeLocks(_account: string): NonPayableTransactionObject<void>;
withdrawals(
arg0: string
): NonPayableTransactionObject<{
endTime: string;
amount: string;
0: string;
1: string;
}>;
initialize(
_registry: string,
_roots: string[]
): NonPayableTransactionObject<void>;
addMember(_rootAddress: string): NonPayableTransactionObject<void>;
removeMember(_rootAddress: string): NonPayableTransactionObject<void>;
swapMember(
_rootAddress: string,
_newRootAddress: string
): NonPayableTransactionObject<void>;
commitStake(): PayableTransactionObject<void>;
announceWithdrawal(
_amount: number | string | BN
): NonPayableTransactionObject<void>;
applySlashing(
_proposalId: number | string | BN,
_root: string,
_amountToSlash: number | string | BN
): NonPayableTransactionObject<boolean>;
withdraw(
_amount: number | string | BN,
_payTo: string
): NonPayableTransactionObject<boolean>;
addSlashingProposal(
_root: string,
_slashingProposalId: number | string | BN
): NonPayableTransactionObject<void>;
getSlashingProposalIds(
_root: string
): NonPayableTransactionObject<string[]>;
getMembers(): NonPayableTransactionObject<string[]>;
isMember(_exp: string): NonPayableTransactionObject<boolean>;
getSize(): NonPayableTransactionObject<string>;
getLimit(): NonPayableTransactionObject<string>;
getRootNodeStake(_root: string): NonPayableTransactionObject<string>;
getStakes(): NonPayableTransactionObject<[string, string][]>;
getLockInfo(): NonPayableTransactionObject<
[string, string, string, string]
>;
purgePendingSlashings(_root: string): NonPayableTransactionObject<void>;
};
events: {
CommittedStake(cb?: Callback<CommittedStake>): EventEmitter;
CommittedStake(
options?: EventOptions,
cb?: Callback<CommittedStake>
): EventEmitter;
DepositedStake(cb?: Callback<DepositedStake>): EventEmitter;
DepositedStake(
options?: EventOptions,
cb?: Callback<DepositedStake>
): EventEmitter;
NewTimeLock(cb?: Callback<NewTimeLock>): EventEmitter;
NewTimeLock(
options?: EventOptions,
cb?: Callback<NewTimeLock>
): EventEmitter;
Purged(cb?: Callback<Purged>): EventEmitter;
Purged(options?: EventOptions, cb?: Callback<Purged>): EventEmitter;
WithdrawalAnnounced(cb?: Callback<WithdrawalAnnounced>): EventEmitter;
WithdrawalAnnounced(
options?: EventOptions,
cb?: Callback<WithdrawalAnnounced>
): EventEmitter;
Withdrawn(cb?: Callback<Withdrawn>): EventEmitter;
Withdrawn(options?: EventOptions, cb?: Callback<Withdrawn>): EventEmitter;
allEvents(options?: EventOptions, cb?: Callback<EventLog>): EventEmitter;
};
once(event: "CommittedStake", cb: Callback<CommittedStake>): void;
once(
event: "CommittedStake",
options: EventOptions,
cb: Callback<CommittedStake>
): void;
once(event: "DepositedStake", cb: Callback<DepositedStake>): void;
once(
event: "DepositedStake",
options: EventOptions,
cb: Callback<DepositedStake>
): void;
once(event: "NewTimeLock", cb: Callback<NewTimeLock>): void;
once(
event: "NewTimeLock",
options: EventOptions,
cb: Callback<NewTimeLock>
): void;
once(event: "Purged", cb: Callback<Purged>): void;
once(event: "Purged", options: EventOptions, cb: Callback<Purged>): void;
once(event: "WithdrawalAnnounced", cb: Callback<WithdrawalAnnounced>): void;
once(
event: "WithdrawalAnnounced",
options: EventOptions,
cb: Callback<WithdrawalAnnounced>
): void;
once(event: "Withdrawn", cb: Callback<Withdrawn>): void;
once(
event: "Withdrawn",
options: EventOptions,
cb: Callback<Withdrawn>
): void;
}