Skip to main content

canic_core/workflow/icrc/
query.rs

1//! Module: workflow::icrc::query
2//!
3//! Responsibility: expose ICRC-10 supported standards and ICRC-21 consent-message queries.
4//! Does not own: endpoint authorization, dispatcher internals, or standards DTO schemas.
5//! Boundary: workflow query facade over the standards projection and dispatcher services.
6
7use crate::{
8    dispatch::icrc21::Icrc21Dispatcher,
9    domain::icrc::icrc10::supported_standards,
10    dto::icrc21::{ConsentMessageRequest, ConsentMessageResponse},
11    ops::config::ConfigOps,
12};
13
14///
15/// Icrc10Query
16///
17
18pub struct Icrc10Query;
19
20impl Icrc10Query {
21    #[must_use]
22    pub fn supported_standards() -> Vec<(String, String)> {
23        supported_standards(ConfigOps::current_icrc21_enabled())
24    }
25}
26
27///
28/// Icrc21Query
29///
30
31pub struct Icrc21Query;
32
33impl Icrc21Query {
34    #[must_use]
35    pub fn consent_message(req: ConsentMessageRequest) -> ConsentMessageResponse {
36        Icrc21Dispatcher::consent_message(req)
37    }
38}