UNPKG

1.35 kBTypeScriptView Raw
1import type { AnyJson, Registry } from '@polkadot/types-codec/types';
2import type { Conviction } from '../interfaces/democracy';
3import type { AllConvictions } from '../interfaces/democracy/definitions';
4import type { ArrayElementType } from '../types';
5import { U8aFixed } from '@polkadot/types-codec';
6interface VoteType {
7 aye: boolean;
8 conviction?: number | ArrayElementType<typeof AllConvictions>;
9}
10declare type InputTypes = boolean | number | Boolean | Uint8Array | VoteType;
11/**
12 * @name GenericVote
13 * @description
14 * A number of lock periods, plus a vote, one way or the other.
15 */
16export declare class GenericVote extends U8aFixed {
17 #private;
18 constructor(registry: Registry, value?: InputTypes);
19 /**
20 * @description returns a V2 conviction
21 */
22 get conviction(): Conviction;
23 /**
24 * @description true if the wrapped value is a positive vote
25 */
26 get isAye(): boolean;
27 /**
28 * @description true if the wrapped value is a negative vote
29 */
30 get isNay(): boolean;
31 /**
32 * @description Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information
33 */
34 toHuman(isExpanded?: boolean): AnyJson;
35 /**
36 * @description Returns the base runtime type name for this instance
37 */
38 toRawType(): string;
39}
40export {};