mod account;
mod capabilities;
mod history;
pub(super) use account::{account_from_parts, query_token_display_fields};
pub(super) use history::validate_transactions_data;
use crate::icrc::{ledger::principal_from_text, model::IcrcError};
use ic_platform::Principal;
use ic_platform::agent::Agent;
pub(super) fn live_query_context(
source: &crate::icrc::LiveIcrcSource,
source_endpoint: &str,
ledger_canister_id: &str,
) -> Result<(Agent, Principal), IcrcError> {
Ok((
crate::agent::endpoint_agent(
&source.agent,
source_endpoint,
crate::agent::MAX_IC_AGENT_RESPONSE_BODY_BYTES,
|reason| IcrcError::AgentBuild {
endpoint: source_endpoint.to_owned(),
reason,
},
)?
.clone(),
principal_from_text(ledger_canister_id, "ledger_canister_id")?,
))
}