Skip to main content

ic_query/icrc/
mod.rs

1//! Module: icrc
2//!
3//! Responsibility: top-level generic ICRC ledger query commands.
4//! Does not own: SNS lookup, NNS registry cache behavior, or release flow.
5//! Boundary: exposes live read-only token metadata, account balance, allowance,
6//! index discovery, transaction history, block type, and archive reports.
7
8#[cfg(feature = "cli")]
9mod commands;
10#[cfg(feature = "host")]
11pub(crate) mod ledger;
12#[cfg(feature = "host")]
13mod live;
14mod model;
15mod text;
16
17pub const DEFAULT_ICRC_SOURCE_ENDPOINT: &str = "https://icp-api.io";
18
19#[cfg(feature = "host")]
20pub use live::{
21    IcrcSource, LiveIcrcSource, build_icrc_allowance_report,
22    build_icrc_allowance_report_with_source, build_icrc_archives_report,
23    build_icrc_archives_report_with_source, build_icrc_balance_report,
24    build_icrc_balance_report_with_source, build_icrc_block_types_report,
25    build_icrc_block_types_report_with_source, build_icrc_capabilities_report,
26    build_icrc_capabilities_report_with_source, build_icrc_index_report,
27    build_icrc_index_report_with_source, build_icrc_tip_certificate_report,
28    build_icrc_tip_certificate_report_with_source, build_icrc_token_report,
29    build_icrc_token_report_with_source, build_icrc_transactions_report,
30    build_icrc_transactions_report_with_source,
31};
32#[cfg(feature = "host")]
33pub use model::{
34    IcrcAllowanceData, IcrcArchivesData, IcrcBalanceData, IcrcBlockTypesData, IcrcCapabilitiesData,
35    IcrcIndexData, IcrcTipCertificateData, IcrcTokenData, IcrcTransactionsData,
36};
37pub use model::{
38    IcrcAllowanceReport, IcrcAllowanceRequest, IcrcArchiveFollowErrorRow, IcrcArchiveRow,
39    IcrcArchivedBlocksRow, IcrcArchivedRangeRow, IcrcArchivesReport, IcrcArchivesRequest,
40    IcrcBalanceReport, IcrcBalanceRequest, IcrcBlockTypeRow, IcrcBlockTypesReport,
41    IcrcBlockTypesRequest, IcrcCapabilitiesReport, IcrcCapabilitiesRequest, IcrcCapabilityRow,
42    IcrcError, IcrcFollowedArchiveBlockRow, IcrcIndexReport, IcrcIndexRequest,
43    IcrcTipCertificateReport, IcrcTipCertificateRequest, IcrcTokenMetadataRow, IcrcTokenReport,
44    IcrcTokenRequest, IcrcTokenStandardRow, IcrcTransactionBlockRow, IcrcTransactionsReport,
45    IcrcTransactionsRequest,
46};
47pub use text::{
48    icrc_allowance_report_text, icrc_archives_report_text, icrc_balance_report_text,
49    icrc_block_types_report_text, icrc_capabilities_report_text, icrc_index_report_text,
50    icrc_tip_certificate_report_text, icrc_token_report_text, icrc_transactions_report_text,
51};
52
53#[cfg(feature = "cli")]
54pub use commands::run;
55
56#[cfg(all(test, feature = "cli", feature = "host"))]
57mod tests;