Skip to main content

pyth_lazer_stellar_sdk/
lib.rs

1#![no_std]
2
3//! Rust SDK for consuming [Pyth Lazer](https://docs.pyth.network/lazer) price
4//! updates in Soroban (Stellar) contracts.
5//!
6//! Use [`PythLazerClient`] to cross-contract call a deployed
7//! `pyth-lazer-stellar` verifier and [`parse_payload`] to decode the verified
8//! payload bytes into typed values.
9//!
10//! # Security
11//!
12//! [`parse_payload`] performs **no** signature verification — it decodes
13//! whatever bytes it is handed. Only [`PythLazerClient::verify_update`]
14//! establishes the trust boundary: it verifies the update via the on-chain
15//! verifier contract before parsing and returns a [`VerifiedPayload`]. Passing
16//! unverified, attacker-supplied bytes to [`parse_payload`] produces a
17//! fully-formed but **unsigned** [`Update`] whose values must not be trusted.
18
19extern crate alloc;
20
21mod client;
22mod error;
23mod payload;
24
25pub use client::{PythLazerClient, VerifiedPayload};
26pub use error::ParseError;
27pub use payload::{parse_payload, Channel, Feed, MarketSession, Update};