dao_interface/query.rs
1use cosmwasm_schema::cw_serde;
2use cosmwasm_std::{Addr, Uint128};
3use cw2::ContractVersion;
4use cw_utils::Expiration;
5
6use crate::state::{Config, ProposalModule};
7
8/// Relevant state for the governance module. Returned by the
9/// `DumpState` query.
10#[cw_serde]
11pub struct DumpStateResponse {
12 /// Optional DAO Admin
13 pub admin: Addr,
14 /// The governance contract's config.
15 pub config: Config,
16 // True if the contract is currently paused.
17 pub pause_info: PauseInfoResponse,
18 /// The governance contract's version.
19 pub version: ContractVersion,
20 /// The governance modules associated with the governance
21 /// contract.
22 pub proposal_modules: Vec<ProposalModule>,
23 /// The voting module associated with the governance contract.
24 pub voting_module: Addr,
25 /// The number of active proposal modules.
26 pub active_proposal_module_count: u32,
27 /// The total number of proposal modules.
28 pub total_proposal_module_count: u32,
29}
30
31/// Information about if the contract is currently paused.
32#[cw_serde]
33pub enum PauseInfoResponse {
34 Paused { expiration: Expiration },
35 Unpaused {},
36}
37
38/// Returned by the `GetItem` query.
39#[cw_serde]
40pub struct GetItemResponse {
41 /// `None` if no item with the provided key was found, `Some`
42 /// otherwise.
43 pub item: Option<String>,
44}
45
46/// Returned by the `Cw20Balances` query.
47#[cw_serde]
48pub struct Cw20BalanceResponse {
49 /// The address of the token.
50 pub addr: Addr,
51 /// The contract's balance.
52 pub balance: Uint128,
53}
54
55/// Returned by the `AdminNomination` query.
56#[cw_serde]
57pub struct AdminNominationResponse {
58 /// The currently nominated admin or None if no nomination is
59 /// pending.
60 pub nomination: Option<Addr>,
61}
62
63#[cw_serde]
64pub struct SubDao {
65 /// The contract address of the SubDAO
66 pub addr: String,
67 /// The purpose/constitution for the SubDAO
68 pub charter: Option<String>,
69}
70
71#[cw_serde]
72pub struct DaoURIResponse {
73 pub dao_uri: Option<String>,
74}
75
76#[cw_serde]
77pub struct ProposalModuleCountResponse {
78 /// The number of active proposal modules.
79 pub active_proposal_module_count: u32,
80 /// The total number of proposal modules.
81 pub total_proposal_module_count: u32,
82}