Skip to main content

andromeda_modules/
address_list.rs

1use andromeda_std::{andr_exec, andr_instantiate, andr_query};
2use cosmwasm_schema::{cw_serde, QueryResponses};
3
4#[andr_instantiate]
5#[cw_serde]
6pub struct InstantiateMsg {
7    pub is_inclusive: bool,
8}
9
10#[andr_exec]
11#[cw_serde]
12pub enum ExecuteMsg {
13    /// Add an address to the address list
14    AddAddress { address: String },
15    /// Remove an address from the address list
16    RemoveAddress { address: String },
17    /// Add multiple addresses to the address list
18    AddAddresses { addresses: Vec<String> },
19}
20
21#[andr_query]
22#[cw_serde]
23#[derive(QueryResponses)]
24pub enum QueryMsg {
25    /// Query if address is included
26    #[returns(IncludesAddressResponse)]
27    IncludesAddress { address: String },
28    #[returns(bool)]
29    IsInclusive {},
30}
31
32#[cw_serde]
33pub struct IncludesAddressResponse {
34    /// Whether the address is included in the address list
35    pub included: bool,
36}