v0.2.1-pre.002
This commit is contained in:
97
crates/ksp-onchain-transport-lib/src/lib.rs
Normal file
97
crates/ksp-onchain-transport-lib/src/lib.rs
Normal file
@@ -0,0 +1,97 @@
|
||||
// file: crates/ksp-onchain-transport-lib/src/lib.rs
|
||||
// version: 1
|
||||
#![warn(missing_docs)]
|
||||
#![deny(unreachable_pub)]
|
||||
#![forbid(unsafe_code)]
|
||||
|
||||
//! KSP-owned Solana on-chain transport foundation.
|
||||
//!
|
||||
//! This crate owns runtime HTTP transport settings, Solana HTTP JSON-RPC envelopes and the audited standard method registry. It deliberately remains
|
||||
//! independent from `ksp-config-lib`, Store and Program layers. Config may later construct these public settings through a one-way adapter, while network
|
||||
//! clients, pools, resilience and typed Solana method adapters are introduced by subsequent `0.2.1` prereleases.
|
||||
|
||||
mod error;
|
||||
mod json_rpc;
|
||||
mod rpc_method;
|
||||
mod settings;
|
||||
|
||||
/// Error code used when no logical endpoint can satisfy a request.
|
||||
pub use self::error::ERROR_CODE_ENDPOINT_SELECTION_FAILED;
|
||||
/// Error code used when an HTTP connection cannot be established.
|
||||
pub use self::error::ERROR_CODE_HTTP_CONNECTION_FAILED;
|
||||
/// Error code used when an HTTP request fails after connection establishment.
|
||||
pub use self::error::ERROR_CODE_HTTP_REQUEST_FAILED;
|
||||
/// Error code used when a decoded response cannot satisfy the expected KSP transport contract.
|
||||
pub use self::error::ERROR_CODE_INVALID_RESPONSE;
|
||||
/// Error code used when HTTP transport runtime settings are invalid.
|
||||
pub use self::error::ERROR_CODE_INVALID_SETTINGS;
|
||||
/// Error code used when an HTTP JSON-RPC payload cannot be decoded as JSON.
|
||||
pub use self::error::ERROR_CODE_JSON_DECODE_FAILED;
|
||||
/// Error code used when a JSON-RPC request cannot be encoded.
|
||||
pub use self::error::ERROR_CODE_JSON_ENCODE_FAILED;
|
||||
/// Error code used when a decoded JSON-RPC envelope violates protocol invariants.
|
||||
pub use self::error::ERROR_CODE_JSON_RPC_PROTOCOL_INVALID;
|
||||
/// Error code used when a historically documented RPC method has been removed from the targeted runtime.
|
||||
pub use self::error::ERROR_CODE_METHOD_REMOVED;
|
||||
/// Error code used when an endpoint or provider rate-limits a request.
|
||||
pub use self::error::ERROR_CODE_RATE_LIMITED;
|
||||
/// Error code used when a remote endpoint returns an application-level JSON-RPC error.
|
||||
pub use self::error::ERROR_CODE_RPC_APPLICATION_ERROR;
|
||||
/// Error code used when a transport deadline expires.
|
||||
pub use self::error::ERROR_CODE_TIMEOUT;
|
||||
/// JSON-RPC 2.0 error payload returned by a remote Solana endpoint.
|
||||
pub use self::json_rpc::JsonRpcErrorObject;
|
||||
/// Validated JSON-RPC 2.0 error response.
|
||||
pub use self::json_rpc::JsonRpcErrorResponse;
|
||||
/// JSON-RPC 2.0 HTTP request envelope emitted by KSP.
|
||||
pub use self::json_rpc::JsonRpcRequest;
|
||||
/// Validated JSON-RPC 2.0 HTTP response.
|
||||
pub use self::json_rpc::JsonRpcResponse;
|
||||
/// Validated JSON-RPC 2.0 success response.
|
||||
pub use self::json_rpc::JsonRpcSuccessResponse;
|
||||
/// Parses and validates a JSON-RPC HTTP response from UTF-8 JSON text.
|
||||
pub use self::json_rpc::parse_json_rpc_response_text;
|
||||
/// Validates a decoded JSON value as one JSON-RPC HTTP response.
|
||||
pub use self::json_rpc::parse_json_rpc_response_value;
|
||||
/// Functional category used by the audited Solana HTTP JSON-RPC registry.
|
||||
pub use self::rpc_method::HttpRpcCategory;
|
||||
/// Release that owns typed KSP coverage for one audited HTTP RPC method.
|
||||
pub use self::rpc_method::HttpRpcCoverageRelease;
|
||||
/// Immutable audited descriptor for one Solana HTTP JSON-RPC method.
|
||||
pub use self::rpc_method::HttpRpcMethodDescriptor;
|
||||
/// Documentation lifecycle status of one audited RPC method.
|
||||
pub use self::rpc_method::RpcDocumentationStatus;
|
||||
/// Technical operation kind used to separate reads, simulations and submissions.
|
||||
pub use self::rpc_method::RpcOperationKind;
|
||||
/// Request-form policy attached to a stable RPC method.
|
||||
pub use self::rpc_method::RpcRequestFormStatus;
|
||||
/// Runtime availability status of one audited RPC method.
|
||||
pub use self::rpc_method::RpcRuntimeStatus;
|
||||
/// HTTP transport retry classification attached to an RPC method descriptor.
|
||||
pub use self::rpc_method::TransportRetryClass;
|
||||
/// Returns all current Solana HTTP RPC method descriptors audited for the `0.2.1`–`0.2.4` coverage sequence.
|
||||
pub use self::rpc_method::current_http_rpc_methods;
|
||||
/// Finds a current or historical standard Solana HTTP RPC descriptor by exact method name.
|
||||
pub use self::rpc_method::find_http_rpc_method;
|
||||
/// Returns historically documented deprecated HTTP RPC descriptors retained for compliance history.
|
||||
pub use self::rpc_method::historical_http_rpc_methods;
|
||||
/// Open cluster or network descriptor used by HTTP endpoint settings.
|
||||
pub use self::settings::HttpClusterName;
|
||||
/// Runtime settings for one role declared by an HTTP endpoint.
|
||||
pub use self::settings::HttpEndpointRoleSettings;
|
||||
/// Runtime settings for one named Solana HTTP endpoint.
|
||||
pub use self::settings::HttpEndpointSettings;
|
||||
/// Runtime HTTP endpoint URL with redacted diagnostics.
|
||||
pub use self::settings::HttpEndpointUrl;
|
||||
/// Open provider descriptor used by HTTP endpoint settings.
|
||||
pub use self::settings::HttpProviderName;
|
||||
/// Open request-kind descriptor used by logical endpoint capabilities.
|
||||
pub use self::settings::HttpRequestKind;
|
||||
/// Bounded retry settings owned by the HTTP transport runtime.
|
||||
pub use self::settings::HttpRetrySettings;
|
||||
/// Local limits attached to one logical HTTP endpoint role.
|
||||
pub use self::settings::HttpRoleLimits;
|
||||
/// Open logical endpoint role descriptor.
|
||||
pub use self::settings::HttpRoleName;
|
||||
/// Complete runtime settings consumed by the Solana HTTP transport foundation.
|
||||
pub use self::settings::HttpTransportSettings;
|
||||
Reference in New Issue
Block a user