use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use cosmwasm_std::{CosmosMsg, Empty};
use cw3::Vote;
use cw4::MemberChangedHookMsg;
use cw_utils::{Duration, Expiration, Threshold};
#[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema, Debug)]
pub struct InstantiateMsg {
pub group_addr: String,
pub threshold: Threshold,
pub max_voting_period: Duration,
}
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
Propose {
title: String,
description: String,
msgs: Vec<CosmosMsg<Empty>>,
latest: Option<Expiration>,
},
Vote {
proposal_id: u64,
vote: Vote,
},
Execute {
proposal_id: u64,
},
Close {
proposal_id: u64,
},
MemberChangedHook(MemberChangedHookMsg),
}
#[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema, Debug)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
Threshold {},
Proposal { proposal_id: u64 },
ListProposals {
start_after: Option<u64>,
limit: Option<u32>,
},
ReverseProposals {
start_before: Option<u64>,
limit: Option<u32>,
},
Vote { proposal_id: u64, voter: String },
ListVotes {
proposal_id: u64,
start_after: Option<String>,
limit: Option<u32>,
},
Voter { address: String },
ListVoters {
start_after: Option<String>,
limit: Option<u32>,
},
}