Skip to content

Commit

Permalink
refactor: rename, remove doctest
Browse files Browse the repository at this point in the history
  • Loading branch information
tejasbadadare committed Jan 30, 2025
1 parent 4160bc8 commit c9f700b
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 43 deletions.
32 changes: 16 additions & 16 deletions lazer/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lazer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
resolver = "2"
members = [
"sdk/rust/protocol",
"sdk/rust/sdk",
"sdk/rust/client",
"contracts/solana/programs/pyth-lazer-solana-contract",
]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "pyth-lazer-sdk"
name = "pyth-lazer-client"
version = "0.1.0"
edition = "2021"
description = "A Rust SDK for Pyth Lazer"
description = "A Rust client for Pyth Lazer"
license = "Apache-2.0"

[dependencies]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use futures_util::StreamExt;
use pyth_lazer_client::LazerClient;
use pyth_lazer_protocol::router::{
Chain, Channel, DeliveryFormat, FixedRate, JsonBinaryEncoding, PriceFeedId, PriceFeedProperty,
SubscriptionParams, SubscriptionParamsRepr,
};
use pyth_lazer_protocol::subscription::{Request, SubscribeRequest, SubscriptionId};
use pyth_lazer_sdk::LazerClient;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
Expand Down
23 changes: 0 additions & 23 deletions lazer/sdk/rust/sdk/src/lib.rs → lazer/sdk/rust/client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,29 +32,6 @@ pub enum BinaryResponse {
/// - Subscribe to price feed updates
/// - Receive updates as a stream of messages
///
/// # Example
/// ```no_run
/// use pyth_lazer_sdk::LazerClient;
/// use pyth_lazer_protocol::subscription::{Request, SubscribeRequest, SubscriptionParams};
///
/// #[tokio::main]
/// async fn main() -> anyhow::Result<()> {
/// let mut client = LazerClient::new("wss://endpoint", "YOUR_ACCESS_TOKEN".to_string())?;
/// let mut stream = client.start().await?;
///
/// // Subscribe to price feeds
/// client.subscribe(Request::Subscribe(SubscribeRequest {
/// subscription_id: SubscriptionId(1),
/// params: SubscriptionParams { /* ... */ },
/// })).await?;
///
/// // Process updates
/// while let Some(msg) = stream.next().await {
/// println!("Received: {:?}", msg?);
/// }
/// Ok(())
/// }
/// ```
pub struct LazerClient {
endpoint: Url,
access_token: String,
Expand Down

0 comments on commit c9f700b

Please sign in to comment.