provwasm_std/types/cosmos/sanction/
v1beta1.rs

1use provwasm_proc_macro::CosmwasmExt;
2/// EventAddressSanctioned is an event emitted when an address is sanctioned.
3#[allow(clippy::derive_partial_eq_without_eq)]
4#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
5#[proto_message(type_url = "/cosmos.sanction.v1beta1.EventAddressSanctioned")]
6pub struct EventAddressSanctioned {
7    #[prost(string, tag = "1")]
8    pub address: ::prost::alloc::string::String,
9}
10/// EventAddressUnsanctioned is an event emitted when an address is unsanctioned.
11#[allow(clippy::derive_partial_eq_without_eq)]
12#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
13#[proto_message(type_url = "/cosmos.sanction.v1beta1.EventAddressUnsanctioned")]
14pub struct EventAddressUnsanctioned {
15    #[prost(string, tag = "1")]
16    pub address: ::prost::alloc::string::String,
17}
18/// EventTempAddressSanctioned is an event emitted when an address is temporarily sanctioned.
19#[allow(clippy::derive_partial_eq_without_eq)]
20#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
21#[proto_message(type_url = "/cosmos.sanction.v1beta1.EventTempAddressSanctioned")]
22pub struct EventTempAddressSanctioned {
23    #[prost(string, tag = "1")]
24    pub address: ::prost::alloc::string::String,
25}
26/// EventTempAddressUnsanctioned is an event emitted when an address is temporarily unsanctioned.
27#[allow(clippy::derive_partial_eq_without_eq)]
28#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
29#[proto_message(type_url = "/cosmos.sanction.v1beta1.EventTempAddressUnsanctioned")]
30pub struct EventTempAddressUnsanctioned {
31    #[prost(string, tag = "1")]
32    pub address: ::prost::alloc::string::String,
33}
34/// EventParamsUpdated is an event emitted when the sanction module params are updated.
35#[allow(clippy::derive_partial_eq_without_eq)]
36#[derive(Clone, Copy, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
37#[proto_message(type_url = "/cosmos.sanction.v1beta1.EventParamsUpdated")]
38pub struct EventParamsUpdated {}
39/// Params defines the configurable parameters of the sanction module.
40#[allow(clippy::derive_partial_eq_without_eq)]
41#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
42#[proto_message(type_url = "/cosmos.sanction.v1beta1.Params")]
43pub struct Params {
44    /// immediate_sanction_min_deposit is the minimum deposit for a sanction to happen immediately.
45    /// If this is zero, immediate sanctioning is not available.
46    /// Otherwise, if a sanction governance proposal is issued with a deposit at least this large, a temporary sanction
47    /// will be immediately issued that will expire when voting ends on the governance proposal.
48    #[prost(message, repeated, tag = "1")]
49    pub immediate_sanction_min_deposit: ::prost::alloc::vec::Vec<super::super::base::v1beta1::Coin>,
50    /// immediate_unsanction_min_deposit is the minimum deposit for an unsanction to happen immediately.
51    /// If this is zero, immediate unsanctioning is not available.
52    /// Otherwise, if an unsanction governance proposal is issued with a deposit at least this large, a temporary
53    /// unsanction will be immediately issued that will expire when voting ends on the governance proposal.
54    #[prost(message, repeated, tag = "2")]
55    pub immediate_unsanction_min_deposit:
56        ::prost::alloc::vec::Vec<super::super::base::v1beta1::Coin>,
57}
58/// TemporaryEntry defines the information involved in a temporary sanction or unsanction.
59#[allow(clippy::derive_partial_eq_without_eq)]
60#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
61#[proto_message(type_url = "/cosmos.sanction.v1beta1.TemporaryEntry")]
62pub struct TemporaryEntry {
63    /// address is the address of this temporary entry.
64    #[prost(string, tag = "1")]
65    pub address: ::prost::alloc::string::String,
66    /// proposal_id is the governance proposal id associated with this temporary entry.
67    #[prost(uint64, tag = "2")]
68    pub proposal_id: u64,
69    /// status is whether the entry is a sanction or unsanction.
70    #[prost(enumeration = "TempStatus", tag = "3")]
71    pub status: i32,
72}
73/// TempStatus is whether a temporary entry is a sanction or unsanction.
74#[derive(
75    Clone,
76    Copy,
77    Debug,
78    PartialEq,
79    Eq,
80    Hash,
81    PartialOrd,
82    Ord,
83    ::prost::Enumeration,
84    ::schemars::JsonSchema,
85)]
86#[repr(i32)]
87pub enum TempStatus {
88    /// TEMP_STATUS_UNSPECIFIED represents and unspecified status value.
89    Unspecified = 0,
90    /// TEMP_STATUS_SANCTIONED indicates a sanction is in place.
91    Sanctioned = 1,
92    /// TEMP_STATUS_UNSANCTIONED indicates an unsanctioned is in place.
93    Unsanctioned = 2,
94}
95impl TempStatus {
96    /// String value of the enum field names used in the ProtoBuf definition.
97    ///
98    /// The values are not transformed in any way and thus are considered stable
99    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
100    pub fn as_str_name(&self) -> &'static str {
101        match self {
102            TempStatus::Unspecified => "TEMP_STATUS_UNSPECIFIED",
103            TempStatus::Sanctioned => "TEMP_STATUS_SANCTIONED",
104            TempStatus::Unsanctioned => "TEMP_STATUS_UNSANCTIONED",
105        }
106    }
107    /// Creates an enum from field names used in the ProtoBuf definition.
108    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
109        match value {
110            "TEMP_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
111            "TEMP_STATUS_SANCTIONED" => Some(Self::Sanctioned),
112            "TEMP_STATUS_UNSANCTIONED" => Some(Self::Unsanctioned),
113            _ => None,
114        }
115    }
116}
117/// GenesisState defines the sanction module's genesis state.
118#[allow(clippy::derive_partial_eq_without_eq)]
119#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
120#[proto_message(type_url = "/cosmos.sanction.v1beta1.GenesisState")]
121pub struct GenesisState {
122    /// params are the sanction module parameters.
123    #[prost(message, optional, tag = "1")]
124    pub params: ::core::option::Option<Params>,
125    /// sanctioned_addresses defines account addresses that are sanctioned.
126    #[prost(string, repeated, tag = "2")]
127    pub sanctioned_addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
128    /// temporary_entries defines the temporary entries associated with on-going governance proposals.
129    #[prost(message, repeated, tag = "3")]
130    pub temporary_entries: ::prost::alloc::vec::Vec<TemporaryEntry>,
131}
132/// QueryIsSanctionedRequest defines the RPC request for checking if an account is sanctioned.
133#[allow(clippy::derive_partial_eq_without_eq)]
134#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
135#[proto_message(type_url = "/cosmos.sanction.v1beta1.QueryIsSanctionedRequest")]
136#[proto_query(
137    path = "/cosmos.sanction.v1beta1.Query/IsSanctioned",
138    response_type = QueryIsSanctionedResponse
139)]
140pub struct QueryIsSanctionedRequest {
141    #[prost(string, tag = "1")]
142    pub address: ::prost::alloc::string::String,
143}
144/// QueryIsSanctionedResponse defines the RPC response of an IsSanctioned query.
145#[allow(clippy::derive_partial_eq_without_eq)]
146#[derive(Clone, Copy, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
147#[proto_message(type_url = "/cosmos.sanction.v1beta1.QueryIsSanctionedResponse")]
148pub struct QueryIsSanctionedResponse {
149    /// is_sanctioned is true if the address is sanctioned.
150    #[prost(bool, tag = "1")]
151    pub is_sanctioned: bool,
152}
153/// QuerySanctionedAddressesRequest defines the RPC request for listing sanctioned accounts.
154#[allow(clippy::derive_partial_eq_without_eq)]
155#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
156#[proto_message(type_url = "/cosmos.sanction.v1beta1.QuerySanctionedAddressesRequest")]
157#[proto_query(
158    path = "/cosmos.sanction.v1beta1.Query/SanctionedAddresses",
159    response_type = QuerySanctionedAddressesResponse
160)]
161pub struct QuerySanctionedAddressesRequest {
162    /// pagination defines an optional pagination for the request.
163    #[prost(message, optional, tag = "99")]
164    pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
165}
166/// QuerySanctionedAddressesResponse defines the RPC response of a SanctionedAddresses query.
167#[allow(clippy::derive_partial_eq_without_eq)]
168#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
169#[proto_message(type_url = "/cosmos.sanction.v1beta1.QuerySanctionedAddressesResponse")]
170pub struct QuerySanctionedAddressesResponse {
171    /// addresses is the list of sanctioned account addresses.
172    #[prost(string, repeated, tag = "1")]
173    pub addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
174    /// pagination defines the pagination in the response.
175    #[prost(message, optional, tag = "99")]
176    pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageResponse>,
177}
178/// QueryTemporaryEntriesRequest defines the RPC request for listing temporary sanction/unsanction entries.
179#[allow(clippy::derive_partial_eq_without_eq)]
180#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
181#[proto_message(type_url = "/cosmos.sanction.v1beta1.QueryTemporaryEntriesRequest")]
182#[proto_query(
183    path = "/cosmos.sanction.v1beta1.Query/TemporaryEntries",
184    response_type = QueryTemporaryEntriesResponse
185)]
186pub struct QueryTemporaryEntriesRequest {
187    /// address is an optional address to restrict results to.
188    #[prost(string, tag = "1")]
189    pub address: ::prost::alloc::string::String,
190    /// pagination defines an optional pagination for the request.
191    #[prost(message, optional, tag = "99")]
192    pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
193}
194/// QueryTemporaryEntriesResponse defines the RPC response of a TemporaryEntries query.
195#[allow(clippy::derive_partial_eq_without_eq)]
196#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
197#[proto_message(type_url = "/cosmos.sanction.v1beta1.QueryTemporaryEntriesResponse")]
198pub struct QueryTemporaryEntriesResponse {
199    #[prost(message, repeated, tag = "1")]
200    pub entries: ::prost::alloc::vec::Vec<TemporaryEntry>,
201    /// pagination defines the pagination in the response.
202    #[prost(message, optional, tag = "99")]
203    pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageResponse>,
204}
205/// QueryParamsRequest defines the RPC request for getting the sanction module params.
206#[allow(clippy::derive_partial_eq_without_eq)]
207#[derive(Clone, Copy, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
208#[proto_message(type_url = "/cosmos.sanction.v1beta1.QueryParamsRequest")]
209#[proto_query(
210    path = "/cosmos.sanction.v1beta1.Query/Params",
211    response_type = QueryParamsResponse
212)]
213pub struct QueryParamsRequest {}
214/// QueryParamsResponse defines the RPC response of a Params query.
215#[allow(clippy::derive_partial_eq_without_eq)]
216#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
217#[proto_message(type_url = "/cosmos.sanction.v1beta1.QueryParamsResponse")]
218pub struct QueryParamsResponse {
219    /// params are the sanction module parameters.
220    #[prost(message, optional, tag = "1")]
221    pub params: ::core::option::Option<Params>,
222}
223/// MsgSanction represents a message for the governance operation of sanctioning addresses.
224#[allow(clippy::derive_partial_eq_without_eq)]
225#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
226#[proto_message(type_url = "/cosmos.sanction.v1beta1.MsgSanction")]
227pub struct MsgSanction {
228    /// addresses are the addresses to sanction.
229    #[prost(string, repeated, tag = "1")]
230    pub addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
231    /// authority is the address of the account with the authority to enact sanctions (most likely the governance module
232    /// account).
233    #[prost(string, tag = "2")]
234    pub authority: ::prost::alloc::string::String,
235}
236/// MsgOptInResponse defines the Msg/Sanction response type.
237#[allow(clippy::derive_partial_eq_without_eq)]
238#[derive(Clone, Copy, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
239#[proto_message(type_url = "/cosmos.sanction.v1beta1.MsgSanctionResponse")]
240pub struct MsgSanctionResponse {}
241/// MsgSanction represents a message for the governance operation of unsanctioning addresses.
242#[allow(clippy::derive_partial_eq_without_eq)]
243#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
244#[proto_message(type_url = "/cosmos.sanction.v1beta1.MsgUnsanction")]
245pub struct MsgUnsanction {
246    /// addresses are the addresses to unsanction.
247    #[prost(string, repeated, tag = "1")]
248    pub addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
249    /// authority is the address of the account with the authority to retract sanctions (most likely the governance module
250    /// account).
251    #[prost(string, tag = "2")]
252    pub authority: ::prost::alloc::string::String,
253}
254/// MsgOptInResponse defines the Msg/Unsanction response type.
255#[allow(clippy::derive_partial_eq_without_eq)]
256#[derive(Clone, Copy, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
257#[proto_message(type_url = "/cosmos.sanction.v1beta1.MsgUnsanctionResponse")]
258pub struct MsgUnsanctionResponse {}
259/// MsgUpdateParams represents a message for the governance operation of updating the sanction module params.
260#[allow(clippy::derive_partial_eq_without_eq)]
261#[derive(Clone, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
262#[proto_message(type_url = "/cosmos.sanction.v1beta1.MsgUpdateParams")]
263pub struct MsgUpdateParams {
264    /// params are the sanction module parameters.
265    #[prost(message, optional, tag = "1")]
266    pub params: ::core::option::Option<Params>,
267    /// authority is the address of the account with the authority to update params (most likely the governance module
268    /// account).
269    #[prost(string, tag = "2")]
270    pub authority: ::prost::alloc::string::String,
271}
272/// MsgUpdateParamsResponse defined the Msg/UpdateParams response type.
273#[allow(clippy::derive_partial_eq_without_eq)]
274#[derive(Clone, Copy, PartialEq, Eq, ::prost::Message, ::schemars::JsonSchema, CosmwasmExt)]
275#[proto_message(type_url = "/cosmos.sanction.v1beta1.MsgUpdateParamsResponse")]
276pub struct MsgUpdateParamsResponse {}
277pub struct SanctionQuerier<'a, Q: cosmwasm_std::CustomQuery> {
278    querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>,
279}
280impl<'a, Q: cosmwasm_std::CustomQuery> SanctionQuerier<'a, Q> {
281    pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self {
282        Self { querier }
283    }
284    pub fn is_sanctioned(
285        &self,
286        address: ::prost::alloc::string::String,
287    ) -> Result<QueryIsSanctionedResponse, cosmwasm_std::StdError> {
288        QueryIsSanctionedRequest { address }.query(self.querier)
289    }
290    pub fn sanctioned_addresses(
291        &self,
292        pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
293    ) -> Result<QuerySanctionedAddressesResponse, cosmwasm_std::StdError> {
294        QuerySanctionedAddressesRequest { pagination }.query(self.querier)
295    }
296    pub fn temporary_entries(
297        &self,
298        address: ::prost::alloc::string::String,
299        pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
300    ) -> Result<QueryTemporaryEntriesResponse, cosmwasm_std::StdError> {
301        QueryTemporaryEntriesRequest {
302            address,
303            pagination,
304        }
305        .query(self.querier)
306    }
307    pub fn params(&self) -> Result<QueryParamsResponse, cosmwasm_std::StdError> {
308        QueryParamsRequest {}.query(self.querier)
309    }
310}