Getting Started
Installation
To begin using the pod Rust SDK, add the following dependency to your project’s Cargo.toml
[dependencies]
pod-sdk = "0.1.0"
Basic Usage
Here’s a simple example demonstrating how to initialize the client and perform basic operations.
use pod_sdk::provider;
use alloy_primitives::B256;
#[tokio::main]
async fn main() -> Result<(), Box> {
let ws_url = Url::parse("ws://127.0.0.1:8545")?;
let ws = WsConnect::new(ws_url);
let pod_client = provider::PodProviderBuilder::new()
.on_ws(ws)
.await?;
// Get transaction by hash
let tx_hash = B256::from_str("0x...")?;
// Get transaction without attestations
let tx = pod_client.get_transaction_by_hash(&tx_hash).await?;
Ok(())
}