generated from PolymeshAssociation/typescript-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 11
/
types.ts
72 lines (66 loc) · 1.7 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import BigNumber from 'bignumber.js';
import { MultiSigProposalVoteActionEnum } from '~/middleware/types';
import { Account, EventIdentifier, Signer, TxTag } from '~/types';
export enum ProposalStatus {
Invalid = 'Invalid',
Active = 'Active',
Expired = 'Expired',
Successful = 'ExecutionSuccessful',
Failed = 'ExecutionFailed',
Rejected = 'Rejected',
}
/**
* Represents JSON serializable data. Used for cases when the value can take on many types, like args for a MultiSig proposal.
*/
export type AnyJson =
| string
| number
| boolean
| null
| undefined
| AnyJson[]
| {
[index: string]: AnyJson;
};
export interface MultiSigProposalDetails {
/**
* The number of approvals this proposal has received
*/
approvalAmount: BigNumber;
/**
* The number of rejections this proposal has received
*/
rejectionAmount: BigNumber;
/**
* The current status of the proposal
*/
status: ProposalStatus;
/**
* An optional time in which this proposal will expire if a decision isn't reached by then
*/
expiry: Date | null;
/**
* Determines if the proposal will automatically be closed once a threshold of reject votes has been reached
*/
autoClose: boolean;
/**
* The tag for the transaction being proposed for the MultiSig to execute
*/
txTag: TxTag;
/**
* The arguments to be passed to the transaction for this proposal
*/
args: AnyJson;
/**
* Accounts of signing keys that have already voted on this proposal
*/
voted: Account[];
}
export enum MultiSigProposalAction {
Approve = 'approve',
Reject = 'reject',
}
export type MultiSigProposalVote = EventIdentifier & {
signer: Signer;
action: MultiSigProposalVoteActionEnum;
};