Skip to main content

ic_platform/
lib.rs

1//! Controlled dependencies for IC runtime integration and required IC Candid interfaces.
2//!
3//! All owned application endpoints use IC Wire, including public endpoints.
4//! Candid adapts required management/system, NNS/SNS, ledger and other Candid
5//! interfaces; caller location does not select the codec. Existing Candid
6//! checkpoints remain a legacy persisted-data compatibility exception.
7//!
8//! `principal` selects Principal and Account; `candid-codec` selects owned binary encoding.
9//! Legacy Candid decoder, parser and printer exports are removed.
10//! `agent` selects native IC transport and identities, with consumer-owned policy.
11//! `ic-protocol` selects native typed packet codecs without Agent or runtime.
12//! `ic-protocol-fixtures` additionally selects native development protocol fixtures.
13//! `bls` selects BLS keys, signatures and verification with upstream allocation support.
14//! `canister-sig-creation` selects canister public-key formats and hashing.
15//! `signature-verification` selects owned canister-signature protocol checks with external BLS.
16//! `runtime` selects raw adapters and prepared `call` requests; ordinary entrypoints select Runtime directly.
17//! `ic0` selects qualified raw system calls without Candid or an executor.
18//! `raw-rand` selects the dependency-free management entropy codec, without transport.
19//! `candid-args` selects small, dependency-free external argument encoders.
20//! `candid-codec` selects the owned typed binary codec without registry Candid.
21//! `management-canister-types` selects external management HTTP/history/snapshot/status DTOs.
22//! `icrc-ledger-types` selects external ledger DTOs without storage integration.
23//! Consumers retain protocol schemas, resource limits and lifecycle policy.
24
25#![forbid(unsafe_code)]
26
27#[cfg(feature = "principal")]
28pub mod account;
29#[cfg(feature = "principal")]
30pub use account::{Account, AccountError, Subaccount};
31
32#[cfg(feature = "principal")]
33pub mod principal;
34#[cfg(feature = "raw-rand")]
35pub mod raw_rand;
36#[cfg(feature = "principal")]
37pub use principal::{Principal, PrincipalError};
38
39#[cfg(all(feature = "agent", not(target_family = "wasm")))]
40pub mod agent;
41
42#[cfg(all(feature = "ic-protocol", not(target_family = "wasm")))]
43pub mod ic_protocol;
44
45#[cfg(feature = "bls")]
46pub mod bls;
47#[cfg(feature = "runtime")]
48pub use ic_platform_runtime::call;
49#[cfg(feature = "candid-args")]
50pub mod candid_args;
51#[cfg(feature = "candid-codec")]
52pub mod candid_codec;
53#[cfg(feature = "canister-sig-creation")]
54pub mod canister_sig_creation;
55#[cfg(feature = "runtime")]
56pub mod cdk;
57#[cfg(feature = "certification")]
58pub mod certification;
59#[cfg(all(feature = "certified-assets-types", not(target_family = "wasm")))]
60pub mod certified_assets_types;
61#[cfg(feature = "cmc-types")]
62pub mod cmc_types;
63#[cfg(feature = "cycles-ledger-types")]
64pub mod cycles_ledger_types;
65#[cfg(feature = "ecdsa")]
66pub mod ecdsa;
67#[cfg(feature = "ed25519")]
68pub mod ed25519;
69#[cfg(feature = "executor")]
70pub use ic_platform_runtime::executor;
71#[cfg(feature = "ic0")]
72pub use ic_platform_runtime::ic0;
73#[cfg(feature = "icp-ledger-types")]
74pub mod icp_ledger_types;
75#[cfg(feature = "nns-registry-types")]
76pub mod nns_registry_types;
77
78#[cfg(feature = "icrc-ledger-types")]
79pub mod icrc_ledger_types;
80#[cfg(feature = "management-canister-types")]
81pub mod management_canister_types;
82#[cfg(feature = "signature-verification")]
83pub mod signature_verification;
84
85#[cfg(feature = "runtime")]
86#[doc(hidden)]
87pub use ic_platform_runtime::__platform_println;
88
89#[cfg(test)]
90mod tests;