1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//! # pyth
//!
//! Rust client for the Pyth Network Hermes API.
//!
//! Pyth Network provides real-time price feeds for crypto, equities, FX, and commodities.
//! This crate interfaces with the Hermes REST API to fetch price data.
//!
//! ## Quick Start
//!
//! ```no_run
//! # async fn example() -> pyth::error::Result<()> {
//! use pyth::Client;
//!
//! let client = Client::new()?;
//!
//! // Get ETH/USD price
//! let eth = client.get_latest_price(pyth::feed_ids::ETH_USD).await?;
//! if let Some(feed) = eth {
//! println!("ETH/USD: ${:.2}", feed.price_f64().unwrap_or(0.0));
//! }
//!
//! // Get multiple prices at once
//! let feeds = client.get_latest_prices(&[
//! pyth::feed_ids::BTC_USD,
//! pyth::feed_ids::ETH_USD,
//! ]).await?;
//!
//! for feed in feeds {
//! println!("{}: ${:.2}", feed.id, feed.price_f64().unwrap_or(0.0));
//! }
//! # Ok(())
//! # }
//! ```
//!
//! ## Symbol Lookup
//!
//! ```no_run
//! # async fn example() -> pyth::error::Result<()> {
//! use pyth::{Client, symbol_to_feed_id};
//!
//! let client = Client::new()?;
//!
//! if let Some(feed_id) = symbol_to_feed_id("ETH") {
//! let price = client.get_latest_price(feed_id).await?;
//! println!("{:?}", price);
//! }
//! # Ok(())
//! # }
//! ```
//!
//! ## Search for Feeds
//!
//! ```no_run
//! # async fn example() -> pyth::error::Result<()> {
//! use pyth::Client;
//!
//! let client = Client::new()?;
//!
//! // Search for feeds matching a query
//! let feeds = client.search_feeds("BTC").await?;
//! for feed in feeds {
//! println!("{}: {:?}", feed.id, feed.attributes.symbol);
//! }
//! # Ok(())
//! # }
//! ```
pub use ;
pub use ;
pub use ;
pub use HttpClientConfig;