abstract_sdk/apis/
respond.rs1use abstract_macros::with_abstract_event;
2use cosmwasm_std::{Attribute, Response};
3
4use crate::features::ModuleIdentification;
5
6pub trait AbstractResponse: ModuleIdentification {
9 fn response(&self, action: impl Into<String>) -> Response {
11 self.custom_response(action, Vec::<Attribute>::new())
12 }
13 fn custom_response(
15 &self,
16 action: impl Into<String>,
17 attributes: impl IntoIterator<Item = impl Into<Attribute>>,
18 ) -> Response {
19 let module_id = self.module_id();
20 let response = Response::new();
21 with_abstract_event!(response, module_id, action, attributes)
22 }
23}
24
25impl<T> AbstractResponse for T where T: ModuleIdentification {}