1 unstable release
0.1.0 | Dec 10, 2024 |
---|
#974 in Magic Beans
141 downloads per month
37KB
675 lines
Reclaim Protocol Rust SDK Integration Guide
This guide will walk you through integrating the Reclaim Protocol Rust SDK into your application. We'll demonstrate how to use the SDK to verify proofs in your Rust applications.
Step 1: Add the dependency
Add the Reclaim Protocol SDK to your Cargo.toml
file:
[dependencies]
reclaim-rust-sdk = "0.1.0"
tokio = { version = "1.0", features = ["full"] }
Step 2: Basic Usage
Here's a simple example demonstrating how to verify proofs using the Reclaim SDK:
use reclaim_rust_sdk::verify_proof;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Initialize the Reclaim client
let proof_json = r#"
{
<!-- your proof data object -->
}"#;
<!-- proof should be a Proof struct data -->
let proof: reclaim_rust_sdk::Proof = serde_json::from_value(proof_json)?;
// Verify the proof
match client.verify_proof(proof).await {
Ok(result) => {
println!("Proof verification successful!");
println!("Extracted data: {:?}", result.extracted_data);
println!("Context: {:?}", result.context);
},
Err(e) => {
println!("Proof verification failed: {}", e);
}
}
Ok(())
}
Best Practices
- Error Handling: Always implement proper error handling for verification failures.
- Async Operations: Use async/await for better performance in production applications.
- Security: Keep your Application Secret secure and never expose it in public repositories.
Next Steps
Explore the Reclaim Protocol documentation for more advanced features and best practices for integrating the SDK into your production applications.
Contributing to Our Project
We welcome contributions to our project! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
Security Note
Always keep your Application Secret secure. Never expose it in client-side code or public repositories.
Code of Conduct
Please read and follow our Code of Conduct to ensure a positive and inclusive environment for all contributors.
Security
If you discover any security-related issues, please refer to our Security Policy for information on how to responsibly disclose vulnerabilities.
Contributor License Agreement
Before contributing to this project, please read and sign our Contributor License Agreement (CLA).
Indie Hackers
For Indie Hackers: Check out our guidelines and potential grant opportunities
License
This project is licensed under a custom license. By contributing to this project, you agree that your contributions will be licensed under its terms.
Thank you for your contributions!
Dependencies
~29–45MB
~849K SLoC