forked from DA0-DA0/dao-dao-ui
-
Notifications
You must be signed in to change notification settings - Fork 1
/
utils.ts
81 lines (72 loc) · 2.02 KB
/
utils.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
73
74
75
76
77
78
79
80
81
export enum ProcessedTQType {
Majority,
Absolute,
Percent,
}
export type ProcessedTQ = { display: string } & (
| { type: ProcessedTQType.Majority }
| { type: ProcessedTQType.Absolute | ProcessedTQType.Percent; value: number }
)
export type ProcessedThresholdQuorum = {
threshold: ProcessedTQ
quorum?: ProcessedTQ
}
export type ProcessedQuorum = {
quorum: ProcessedTQ
}
export type CodeIdConfig = {
// https://github.com/CosmWasm/cw-plus
Cw4Group: number
// https://github.com/CosmWasm/cw-nfts
Cw721Base?: number
// https://github.com/DA0-DA0/dao-contracts
CwPayrollFactory: number
CwTokenSwap: number
CwTokenfactoryIssuer: number
CwVesting: number
DaoCore: number
DaoMigrator: number
DaoPreProposeMultiple: number
DaoPreProposeSingle: number
DaoProposalMultiple: number
DaoProposalSingle: number
DaoVotingCw4: number
DaoVotingCw721Staked: number
DaoVotingTokenStaked: number
// v2.1.0 and below, for migrating v1 to v2 DAOs
Cw20Stake?: number
DaoVotingCw20Staked?: number
}
export type PolytoneConnection = {
// Contract address of note on the local/current chain.
note: string
// Contract address of the note's listener on the local/current chain.
listener: string
// Contract address of the note's voice on the remote chain.
voice: string
// IBC connection IDs
localConnection: string
remoteConnection: string
// IBC channel IDs
localChannel: string
remoteChannel: string
// Whether or not the user needs to self-relay an execution. This should be
// true if no relayers are running on the established connection. If using an
// existing active connection, the relayers will automatically perform the
// relay.
needsSelfRelay?: boolean
}
// Map chain ID to polytone connection information.
export type PolytoneConfig = Record<string, PolytoneConnection>
export type ParametersExceptFirst<F> = F extends (
arg0: any,
...rest: infer R
) => any
? R
: never
export type DecodedStargateMsg<Value = any> = {
stargate: {
typeUrl: string
value: Value
}
}