ic-query 0.100.0

Internet Computer query library for CloudEngine, NNS, SNS, ICRC, system canisters, and public network metadata
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
//! Cross the canonical Principal/native Agent boundary without selecting Host Tools.

/// Preserve canister-scoped native routing when crossing the owned Principal boundary.
pub fn effective_canister_id(
    principal: &ic_platform::Principal,
) -> ic_platform::agent::EffectiveId {
    ic_platform::agent::EffectiveId::Canister(
        principal
            .as_slice()
            .try_into()
            .expect("canonical principal length fits Agent"),
    )
}