Skip to main content

ic_query/icrc/
mod.rs

1//! Module: icrc
2//!
3//! Responsibility: expose generic ICRC ledger request and report APIs.
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, account and ledger transaction history, block type, and archive reports.
7
8#[cfg(feature = "host")]
9pub(crate) mod ledger;
10#[cfg(feature = "host")]
11mod live;
12mod model;
13mod text;
14
15pub const DEFAULT_ICRC_SOURCE_ENDPOINT: &str = "https://icp-api.io";
16
17#[cfg(feature = "host")]
18pub use live::{
19    IcrcAccountTransactionsSource, IcrcSource, LiveIcrcSource,
20    build_icrc_account_transactions_report, build_icrc_account_transactions_report_with_source,
21    build_icrc_allowance_report, build_icrc_allowance_report_with_source,
22    build_icrc_archives_report, build_icrc_archives_report_with_source, build_icrc_balance_report,
23    build_icrc_balance_report_with_source, build_icrc_block_types_report,
24    build_icrc_block_types_report_with_source, build_icrc_capabilities_report,
25    build_icrc_capabilities_report_with_source, build_icrc_index_report,
26    build_icrc_index_report_with_source, build_icrc_tip_certificate_report,
27    build_icrc_tip_certificate_report_with_source, build_icrc_token_report,
28    build_icrc_token_report_with_source, build_icrc_transactions_report,
29    build_icrc_transactions_report_with_source,
30};
31pub use model::normalize_subaccount_hex;
32pub use model::{
33    IcrcAccountRow, IcrcAccountTransactionRow, IcrcAccountTransactionsError,
34    IcrcAccountTransactionsReport, IcrcAccountTransactionsRequest, IcrcAllowanceReport,
35    IcrcAllowanceRequest, IcrcArchiveFollowErrorRow, IcrcArchiveRow, IcrcArchivedBlocksRow,
36    IcrcArchivedRangeRow, IcrcArchivesReport, IcrcArchivesRequest, IcrcBalanceReport,
37    IcrcBalanceRequest, IcrcBlockTypeRow, IcrcBlockTypesReport, IcrcBlockTypesRequest,
38    IcrcCapabilitiesReport, IcrcCapabilitiesRequest, IcrcCapabilityRow, IcrcError,
39    IcrcFollowedArchiveBlockRow, IcrcIndexReport, IcrcIndexRequest, IcrcTipCertificateReport,
40    IcrcTipCertificateRequest, IcrcTokenMetadataRow, IcrcTokenReport, IcrcTokenRequest,
41    IcrcTokenStandardRow, IcrcTransactionBlockRow, IcrcTransactionsReport, IcrcTransactionsRequest,
42};
43#[cfg(feature = "host")]
44pub use model::{
45    IcrcAccountTransactionsData, IcrcAllowanceData, IcrcArchivesData, IcrcBalanceData,
46    IcrcBlockTypesData, IcrcCapabilitiesData, IcrcIndexData, IcrcTipCertificateData, IcrcTokenData,
47    IcrcTransactionsData,
48};
49pub use text::{
50    icrc_account_transactions_report_text, icrc_allowance_report_text, icrc_archives_report_text,
51    icrc_balance_report_text, icrc_block_types_report_text, icrc_capabilities_report_text,
52    icrc_index_report_text, icrc_tip_certificate_report_text, icrc_token_report_text,
53    icrc_transactions_report_text,
54};
55
56#[cfg(all(test, feature = "host"))]
57mod tests;