1use cosmwasm_schema::{cw_serde, QueryResponses};
2use cosmwasm_std::{CosmosMsg, Empty};
3use cw3::{UncheckedDepositInfo, Vote};
4use cw4::MemberChangedHookMsg;
5use cw_utils::{Duration, Expiration, Threshold};
6
7use crate::state::Executor;
8
9#[cw_serde]
10pub struct InstantiateMsg {
11 pub group_addr: String,
13 pub threshold: Threshold,
14 pub max_voting_period: Duration,
15 pub executor: Option<Executor>,
18 pub proposal_deposit: Option<UncheckedDepositInfo>,
20}
21
22#[cw_serde]
24pub enum ExecuteMsg {
25 Propose {
26 title: String,
27 description: String,
28 msgs: Vec<CosmosMsg<Empty>>,
29 latest: Option<Expiration>,
31 },
32 Vote {
33 proposal_id: u64,
34 vote: Vote,
35 },
36 Execute {
37 proposal_id: u64,
38 },
39 Close {
40 proposal_id: u64,
41 },
42 MemberChangedHook(MemberChangedHookMsg),
44}
45
46#[cw_serde]
48#[derive(QueryResponses)]
49pub enum QueryMsg {
50 #[returns(cw_utils::ThresholdResponse)]
51 Threshold {},
52 #[returns(cw3::ProposalResponse)]
53 Proposal { proposal_id: u64 },
54 #[returns(cw3::ProposalListResponse)]
55 ListProposals {
56 start_after: Option<u64>,
57 limit: Option<u32>,
58 },
59 #[returns(cw3::ProposalListResponse)]
60 ReverseProposals {
61 start_before: Option<u64>,
62 limit: Option<u32>,
63 },
64 #[returns(cw3::VoteResponse)]
65 Vote { proposal_id: u64, voter: String },
66 #[returns(cw3::VoteListResponse)]
67 ListVotes {
68 proposal_id: u64,
69 start_after: Option<String>,
70 limit: Option<u32>,
71 },
72 #[returns(cw3::VoterResponse)]
73 Voter { address: String },
74 #[returns(cw3::VoterListResponse)]
75 ListVoters {
76 start_after: Option<String>,
77 limit: Option<u32>,
78 },
79 #[returns(crate::state::Config)]
81 Config {},
82}