v0.2.11-pre.002

This commit is contained in:
2026-08-25 19:45:06 +02:00
parent f42fa8f4f1
commit 4f92fb03f1
17 changed files with 1610 additions and 44 deletions

View File

@@ -0,0 +1,75 @@
// file: crates/ksp-offchain-transport-lib/src/lib.rs
// version: 1
#![warn(missing_docs)]
#![deny(unreachable_pub)]
#![forbid(unsafe_code)]
//! KSP-owned off-chain transport foundation.
//!
//! `0.2.11-pre.002` opens the first deliberately narrow public surface: exact SOL/USD price values, provider-neutral observations, provider descriptors,
//! common provider settings and generic availability/rate-limit metadata. No provider wire type, HTTP client, provider SDK, Config dependency or active
//! rate limiter is introduced by this tranche.
mod decimal;
mod error;
mod observation;
mod provider;
mod settings;
/// Maximum accepted byte length for one textual decimal input.
pub use self::decimal::PRICE_DECIMAL_MAX_INPUT_BYTES;
/// Maximum decimal scale retained by the canonical SOL/USD price representation.
pub use self::decimal::PRICE_DECIMAL_MAX_SCALE;
/// Exact positive decimal value used by the public off-chain price contract.
pub use self::decimal::PriceDecimal;
/// Stable error code for an invalid exact decimal price.
pub use self::error::ERROR_CODE_PRICE_DECIMAL_INVALID;
/// Stable error code for an invalid provider descriptor.
pub use self::error::ERROR_CODE_PROVIDER_DESCRIPTOR_INVALID;
/// Stable error code for an invalid provider identifier.
pub use self::error::ERROR_CODE_PROVIDER_ID_INVALID;
/// Stable error code for an invalid provider-neutral observation.
pub use self::error::ERROR_CODE_PROVIDER_OBSERVATION_INVALID;
/// Stable error code for invalid common provider settings.
pub use self::error::ERROR_CODE_PROVIDER_SETTINGS_INVALID;
/// Maximum safe provenance length attached to one normalized observation.
pub use self::observation::PRICE_PROVENANCE_MAX_BYTES;
/// Safe bounded provenance supplied by one provider adapter.
pub use self::observation::PriceProvenance;
/// Millisecond UTC timestamp used for request, receipt, provider and cooldown projections.
pub use self::observation::PriceTimestamp;
/// Public V1 SOL/USD observation normalized by Off-chain Transport.
pub use self::observation::SolUsdPriceObservation;
/// Maximum provider display-name length accepted by descriptors.
pub use self::provider::PRICE_PROVIDER_DISPLAY_NAME_MAX_BYTES;
/// Maximum opaque provider identifier length accepted by the public contract.
pub use self::provider::PRICE_PROVIDER_ID_MAX_BYTES;
/// Only price pair exposed by the `0.2.11` V1 public contract.
pub use self::provider::PricePair;
/// Generic authentication capability exposed by a configured provider descriptor.
pub use self::provider::PriceProviderAuthMode;
/// Generic runtime availability state exposed without provider-specific error parsing.
pub use self::provider::PriceProviderAvailability;
/// Provider capability and presentation descriptor consumed by provider-agnostic callers.
pub use self::provider::PriceProviderDescriptor;
/// Opaque validated provider identifier owned by Off-chain Transport.
pub use self::provider::PriceProviderId;
/// Long-term provider quota descriptor that is informational rather than an authoritative local counter.
pub use self::provider::PriceProviderLongTermQuota;
/// Period used by a documented long-term provider quota.
pub use self::provider::PriceProviderQuotaPeriod;
/// Unit used by a documented long-term provider quota.
pub use self::provider::PriceProviderQuotaUnit;
/// Generic provider request-limit capability.
pub use self::provider::PriceProviderRateLimit;
/// Shape of one generic provider request-limit capability.
pub use self::provider::PriceProviderRateLimitKind;
/// Scope to which a provider documents one request limit.
pub use self::provider::PriceProviderRateLimitScope;
/// Current provider-neutral runtime state projection.
pub use self::provider::PriceProviderState;
/// Price semantics retained so consumers never assume all providers report equivalent market values.
pub use self::provider::PriceSemantics;
/// Common provider settings shared by provider-specific runtime settings.
pub use self::settings::PriceProviderCommonSettings;