| Crates.io | pod-types |
| lib.rs | pod-types |
| version | 0.5.1 |
| created_at | 2025-05-19 10:26:39.881087+00 |
| updated_at | 2026-01-15 15:48:52.130599+00 |
| description | Types of Software Development Kit for the pod Network |
| homepage | https://pod.network/ |
| repository | https://github.com/podnetwork/pod-sdk |
| max_upload_size | |
| id | 1679550 |
| size | 159,697 |
This repository contains the Software Development Kit for the pod Network. It provides a simplified interface for interacting with the pod network.
The SDK provides several key types:
PodProvider: The main entry point for interacting with the pod networkPodProviderBuilder: A builder pattern for creating configured providersHash: A cryptographic hash representing transaction IDs or other hashed dataReceipt: A proof of transaction inclusion in the blockchainCommittee: The current set of validators for the networkVerifiableLog: A log entry that can be cryptographically verifieduse pod_sdk::{PodProvider, PodProviderBuilder};
use alloy_network::EthereumWallet;
use alloy::consensus::TxLegacy;
#[tokio::main]
async fn main() -> Result<()> {
let wallet = EthereumWallet::new(PrivateKeySigner::random());
let ws_url = "ws://127.0.0.1:8546".parse()?;
// Connect to a pod node
let provider = PodProviderBuilder::new()
.wallet(wallet)
.on_ws(ws_url)
.await?;
// Create and send a transaction
let tx = TxLegacy {
// transaction details
};
let tx_hash = provider.send_transaction(tx).await?;
println!("Transaction sent with hash: {tx_hash}");
// Verify receipts with the current committee
let committee = provider.get_committee().await?;
let receipts = provider.get_confirmed_receipts(start_time, None).await?;
for receipt in receipts.items {
if receipt.verify(&committee).unwrap() {
println!("Receipt verified: {:?}", receipt);
}
}
// Subscribe to logs and verify them
let filter = Filter::new()
.address(contract_address)
.event_signature(event_signature);
let sub = provider.subscribe_verifiable_logs(&filter).await?;
let mut stream = sub.into_stream();
while let Some(log) = stream.next().await {
if log.verify(&committee).unwrap() {
println!("Verified event: {:?}", log);
println!("Proof: {:?}", log.generate_multi_proof());
}
}
Ok(())
}
Add the following to your Cargo.toml:
[dependencies]
pod-sdk = "0.1.0"
## ⚠️ Warning
**This is a pre-release version under active development. APIs are subject to change without notice and may contain bugs. Not recommended for production use.**