122 lines
6.1 KiB
Rust
122 lines
6.1 KiB
Rust
// file: crates/ksp-core-lib/src/lib.rs
|
|
// version: 8
|
|
|
|
#![warn(missing_docs)]
|
|
#![deny(unreachable_pub)]
|
|
#![forbid(unsafe_code)]
|
|
|
|
//! Core contracts shared by the foundational KSP layers.
|
|
//!
|
|
//! `ksp-core-lib` owns the common KSP error contract, the Solana [`Pubkey`]
|
|
//! primitive used by the project, and the KSP-owned registry of fundamental
|
|
//! Solana Program IDs. Higher-level domains extend these contracts without
|
|
//! introducing reverse dependencies from Core.
|
|
|
|
mod error;
|
|
mod program_ids;
|
|
|
|
/// Common KSP error type used by higher-level crates.
|
|
pub use self::error::Error;
|
|
/// Stable structured code identifying a KSP error category and condition.
|
|
pub use self::error::ErrorCode;
|
|
/// Structured contextual field attached to a KSP error.
|
|
pub use self::error::ErrorContext;
|
|
/// Common KSP result alias using [`Error`].
|
|
pub use self::error::Result;
|
|
/// Canonical Address Lookup Table Program ID as Base58 text.
|
|
pub use self::program_ids::PRGID_SOLANA_ADDRESS_LOOKUP_TABLE;
|
|
/// Canonical Compute Budget Program ID as Base58 text.
|
|
pub use self::program_ids::PRGID_SOLANA_COMPUTE_BUDGET;
|
|
/// Canonical Config Program ID as Base58 text.
|
|
pub use self::program_ids::PRGID_SOLANA_CONFIG;
|
|
/// Canonical Feature Program ID as Base58 text.
|
|
pub use self::program_ids::PRGID_SOLANA_FEATURE;
|
|
/// Canonical upgradeable BPF Loader Program ID as Base58 text.
|
|
pub use self::program_ids::PRGID_SOLANA_LOADER_BPF_UPGRADEABLE;
|
|
/// Canonical deprecated BPF Loader Program ID as Base58 text.
|
|
pub use self::program_ids::PRGID_SOLANA_LOADER_BPF_V1;
|
|
/// Canonical BPF Loader v2 Program ID as Base58 text.
|
|
pub use self::program_ids::PRGID_SOLANA_LOADER_BPF_V2;
|
|
/// Canonical Native Loader Program ID as Base58 text.
|
|
pub use self::program_ids::PRGID_SOLANA_LOADER_NATIVE;
|
|
/// Canonical Loader v4 Program ID as Base58 text.
|
|
pub use self::program_ids::PRGID_SOLANA_LOADER_V4;
|
|
/// Canonical Ed25519 precompile Program ID as Base58 text.
|
|
pub use self::program_ids::PRGID_SOLANA_PRECOMPILE_ED25519;
|
|
/// Canonical Secp256k1 precompile Program ID as Base58 text.
|
|
pub use self::program_ids::PRGID_SOLANA_PRECOMPILE_SECP256K1;
|
|
/// Canonical Secp256r1 precompile Program ID as Base58 text.
|
|
pub use self::program_ids::PRGID_SOLANA_PRECOMPILE_SECP256R1;
|
|
/// Canonical Slashing Program ID as Base58 text.
|
|
pub use self::program_ids::PRGID_SOLANA_SLASHING;
|
|
/// Canonical Stake Program ID as Base58 text.
|
|
pub use self::program_ids::PRGID_SOLANA_STAKE;
|
|
/// Canonical System Program ID as Base58 text.
|
|
pub use self::program_ids::PRGID_SOLANA_SYSTEM;
|
|
/// Canonical Vote Program ID as Base58 text.
|
|
pub use self::program_ids::PRGID_SOLANA_VOTE;
|
|
/// Canonical ZK ElGamal Proof Program ID as Base58 text.
|
|
pub use self::program_ids::PRGID_SOLANA_ZK_ELGAMAL_PROOF;
|
|
/// Canonical ZK Token Proof Program ID as Base58 text.
|
|
pub use self::program_ids::PRGID_SOLANA_ZK_TOKEN_PROOF;
|
|
/// Canonical Address Lookup Table Program ID as a typed [`Pubkey`].
|
|
pub use self::program_ids::PRGIDPK_SOLANA_ADDRESS_LOOKUP_TABLE;
|
|
/// Canonical Compute Budget Program ID as a typed [`Pubkey`].
|
|
pub use self::program_ids::PRGIDPK_SOLANA_COMPUTE_BUDGET;
|
|
/// Canonical Config Program ID as a typed [`Pubkey`].
|
|
pub use self::program_ids::PRGIDPK_SOLANA_CONFIG;
|
|
/// Canonical Feature Program ID as a typed [`Pubkey`].
|
|
pub use self::program_ids::PRGIDPK_SOLANA_FEATURE;
|
|
/// Canonical upgradeable BPF Loader Program ID as a typed [`Pubkey`].
|
|
pub use self::program_ids::PRGIDPK_SOLANA_LOADER_BPF_UPGRADEABLE;
|
|
/// Canonical deprecated BPF Loader Program ID as a typed [`Pubkey`].
|
|
pub use self::program_ids::PRGIDPK_SOLANA_LOADER_BPF_V1;
|
|
/// Canonical BPF Loader v2 Program ID as a typed [`Pubkey`].
|
|
pub use self::program_ids::PRGIDPK_SOLANA_LOADER_BPF_V2;
|
|
/// Canonical Native Loader Program ID as a typed [`Pubkey`].
|
|
pub use self::program_ids::PRGIDPK_SOLANA_LOADER_NATIVE;
|
|
/// Canonical Loader v4 Program ID as a typed [`Pubkey`].
|
|
pub use self::program_ids::PRGIDPK_SOLANA_LOADER_V4;
|
|
/// Canonical Ed25519 precompile Program ID as a typed [`Pubkey`].
|
|
pub use self::program_ids::PRGIDPK_SOLANA_PRECOMPILE_ED25519;
|
|
/// Canonical Secp256k1 precompile Program ID as a typed [`Pubkey`].
|
|
pub use self::program_ids::PRGIDPK_SOLANA_PRECOMPILE_SECP256K1;
|
|
/// Canonical Secp256r1 precompile Program ID as a typed [`Pubkey`].
|
|
pub use self::program_ids::PRGIDPK_SOLANA_PRECOMPILE_SECP256R1;
|
|
/// Canonical Slashing Program ID as a typed [`Pubkey`].
|
|
pub use self::program_ids::PRGIDPK_SOLANA_SLASHING;
|
|
/// Canonical Stake Program ID as a typed [`Pubkey`].
|
|
pub use self::program_ids::PRGIDPK_SOLANA_STAKE;
|
|
/// Canonical System Program ID as a typed [`Pubkey`].
|
|
pub use self::program_ids::PRGIDPK_SOLANA_SYSTEM;
|
|
/// Canonical Vote Program ID as a typed [`Pubkey`].
|
|
pub use self::program_ids::PRGIDPK_SOLANA_VOTE;
|
|
/// Canonical ZK ElGamal Proof Program ID as a typed [`Pubkey`].
|
|
pub use self::program_ids::PRGIDPK_SOLANA_ZK_ELGAMAL_PROOF;
|
|
/// Canonical ZK Token Proof Program ID as a typed [`Pubkey`].
|
|
pub use self::program_ids::PRGIDPK_SOLANA_ZK_TOKEN_PROOF;
|
|
/// Immutable descriptor for one registered Program ID.
|
|
pub use self::program_ids::ProgramIdEntry;
|
|
/// Borrowed multi-axis filter for the canonical Program ID registry.
|
|
pub use self::program_ids::ProgramIdFilter;
|
|
/// Technical classification of one registered Program ID.
|
|
pub use self::program_ids::ProgramIdKind;
|
|
/// Returns the canonical Program ID registry.
|
|
pub use self::program_ids::entries;
|
|
/// Finds one registered Program ID by its Base58 representation.
|
|
pub use self::program_ids::find_program_id;
|
|
/// Finds one registered Program ID by its typed [`Pubkey`] representation.
|
|
pub use self::program_ids::find_program_pubkey;
|
|
/// Returns the Solana core/native Program ID view.
|
|
pub use self::program_ids::native_program_ids;
|
|
/// Returns Program IDs matching a multi-axis filter.
|
|
pub use self::program_ids::program_ids;
|
|
/// Returns Program IDs belonging to one domain.
|
|
pub use self::program_ids::program_ids_by_domain;
|
|
/// Returns Program IDs belonging to one family.
|
|
pub use self::program_ids::program_ids_by_family;
|
|
/// Returns Program IDs belonging to one protocol or project.
|
|
pub use self::program_ids::program_ids_by_protocol;
|
|
/// Solana account address primitive used by KSP Program IDs.
|
|
pub use solana_pubkey::Pubkey;
|