ic-query 0.93.2

Internet Computer query library for CloudEngine, NNS, SNS, ICRC, system canisters, and public network metadata
Documentation
//! Module: icrc
//!
//! Responsibility: expose generic ICRC ledger request and report APIs.
//! Does not own: SNS lookup, NNS registry cache behavior, or release flow.
//! Boundary: exposes live read-only token metadata, account balance, allowance,
//! index discovery, account and ledger transaction history, block type, and archive reports.

#[cfg(feature = "icrc-host")]
mod account_transaction_cache;
#[cfg(feature = "icrc-host")]
pub(crate) mod ledger;
#[cfg(feature = "icrc-host")]
mod live;
mod model;

pub const DEFAULT_ICRC_SOURCE_ENDPOINT: &str = "https://icp-api.io";

#[cfg(feature = "icrc-host")]
pub use account_transaction_cache::{
    build_icrc_account_transaction_cache_status_report, build_icrc_account_transaction_list_report,
    icrc_account_transaction_cache_path, icrc_account_transaction_refresh_attempt_path,
    icrc_account_transaction_refresh_lock_path, load_cached_icrc_account_transactions,
    load_or_refresh_missing_icrc_account_transactions,
    load_or_refresh_missing_icrc_account_transactions_with_source,
    load_or_refresh_stale_icrc_account_transactions,
    load_or_refresh_stale_icrc_account_transactions_with_source,
    refresh_icrc_account_transaction_cache,
    refresh_icrc_account_transaction_cache_with_source_and_progress,
};
#[cfg(feature = "icrc-host")]
pub use live::{
    ICRC_ACCOUNT_TRANSACTION_MAX_PAGE_SIZE,
    build::{
        build_icrc_account_transaction_page_report,
        build_icrc_account_transaction_page_report_with_source, build_icrc_allowance_report,
        build_icrc_allowance_report_with_source, build_icrc_archives_report,
        build_icrc_archives_report_with_source, build_icrc_balance_report,
        build_icrc_balance_report_with_source, build_icrc_block_types_report,
        build_icrc_block_types_report_with_source, build_icrc_capabilities_report,
        build_icrc_capabilities_report_with_source, build_icrc_index_report,
        build_icrc_index_report_with_source, build_icrc_tip_certificate_report,
        build_icrc_tip_certificate_report_with_source, build_icrc_token_report,
        build_icrc_token_report_with_source, build_icrc_transactions_report,
        build_icrc_transactions_report_with_source,
    },
    source::{
        IcrcAccountTransactionCollectionSource, IcrcAccountTransactionPageSource,
        IcrcAllowanceSource, IcrcArchivesSource, IcrcBalanceSource, IcrcBlockTypesSource,
        IcrcCapabilitiesSource, IcrcIndexSource, IcrcTipCertificateSource, IcrcTokenSource,
        IcrcTransactionsSource, LiveIcrcSource,
    },
};

pub use model::*;

#[cfg(all(test, feature = "icrc-host"))]
mod tests;