cw3_fixed_multisig/
msg.rs

1use cosmwasm_schema::{cw_serde, QueryResponses};
2use cosmwasm_std::{CosmosMsg, Empty};
3use cw3::Vote;
4use cw_utils::{Duration, Expiration, Threshold};
5
6#[cw_serde]
7pub struct InstantiateMsg {
8    pub voters: Vec<Voter>,
9    pub threshold: Threshold,
10    pub max_voting_period: Duration,
11}
12
13#[cw_serde]
14pub struct Voter {
15    pub addr: String,
16    pub weight: u64,
17}
18
19// TODO: add some T variants? Maybe good enough as fixed Empty for now
20#[cw_serde]
21pub enum ExecuteMsg {
22    Propose {
23        title: String,
24        description: String,
25        msgs: Vec<CosmosMsg<Empty>>,
26        // note: we ignore API-spec'd earliest if passed, always opens immediately
27        latest: Option<Expiration>,
28    },
29    Vote {
30        proposal_id: u64,
31        vote: Vote,
32    },
33    Execute {
34        proposal_id: u64,
35    },
36    Close {
37        proposal_id: u64,
38    },
39}
40
41// We can also add this as a cw3 extension
42#[cw_serde]
43#[derive(QueryResponses)]
44pub enum QueryMsg {
45    #[returns(cw_utils::ThresholdResponse)]
46    Threshold {},
47    #[returns(cw3::ProposalResponse)]
48    Proposal { proposal_id: u64 },
49    #[returns(cw3::ProposalListResponse)]
50    ListProposals {
51        start_after: Option<u64>,
52        limit: Option<u32>,
53    },
54    #[returns(cw3::ProposalListResponse)]
55    ReverseProposals {
56        start_before: Option<u64>,
57        limit: Option<u32>,
58    },
59    #[returns(cw3::VoteResponse)]
60    Vote { proposal_id: u64, voter: String },
61    #[returns(cw3::VoteListResponse)]
62    ListVotes {
63        proposal_id: u64,
64        start_after: Option<String>,
65        limit: Option<u32>,
66    },
67    #[returns(cw3::VoterResponse)]
68    Voter { address: String },
69    #[returns(cw3::VoterListResponse)]
70    ListVoters {
71        start_after: Option<String>,
72        limit: Option<u32>,
73    },
74}