UNPKG

1.47 kBTypeScriptView Raw
1import type { AnyJson, Registry } from '@polkadot/types-codec/types';
2import type { AllConvictions } from '../interfaces/democracy/definitions.js';
3import type { Conviction } from '../interfaces/democracy/index.js';
4import type { ArrayElementType } from '../types/index.js';
5import { U8aFixed } from '@polkadot/types-codec';
6interface VoteType {
7 aye: boolean;
8 conviction?: number | ArrayElementType<typeof AllConvictions>;
9}
10type 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 Converts the value in a best-fit primitive form
37 */
38 toPrimitive(): any;
39 /**
40 * @description Returns the base runtime type name for this instance
41 */
42 toRawType(): string;
43}
44export {};