-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathcreators.ts
51 lines (45 loc) · 1.58 KB
/
creators.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
import { ComponentType } from 'react'
import { FieldValues } from 'react-hook-form'
import { TFunction } from 'react-i18next'
import { SupportedChainConfig } from './chain'
import { SecretModuleInstantiateInfo } from './clients'
import { ModuleInstantiateInfo } from './contracts'
import {
DaoCreationGovernanceConfigInputProps,
DaoCreationGovernanceConfigReviewProps,
DaoCreationVotingConfigItem,
NewDao,
} from './dao'
export type DaoCreatorGetInstantiateInfo<Data extends FieldValues = any> =
(options: {
chainConfig: SupportedChainConfig
// Used within voting and proposal module adapters, so the data generic
// passed in may not necessarily be the voting module adapter data. Must use
// `any`.
newDao: NewDao<any>
data: Data
t: TFunction
}) => ModuleInstantiateInfo | SecretModuleInstantiateInfo
export type DaoCreator<Data extends FieldValues = any> = {
id: string
makeDefaultConfig: (chainConfig: SupportedChainConfig) => Data
displayInfo: {
Icon: ComponentType
nameI18nKey: string
descriptionI18nKey: string
suppliesI18nKey: string
membershipI18nKey: string
}
governanceConfig: {
Input: ComponentType<DaoCreationGovernanceConfigInputProps>
Review: ComponentType<DaoCreationGovernanceConfigReviewProps>
}
votingConfig: {
items: DaoCreationVotingConfigItem[]
advancedItems?: DaoCreationVotingConfigItem[]
advancedWarningI18nKeys?: string[]
}
// Modify `msg` to add any additional fields the creator needs to set based on
// its own config.
getInstantiateInfo: DaoCreatorGetInstantiateInfo<Data>
}