pub struct H33Client { /* private fields */ }Expand description
H33 API client.
Implementations§
Source§impl H33Client
impl H33Client
Sourcepub fn new(base_url: &str) -> Result<Self, Error>
pub fn new(base_url: &str) -> Result<Self, Error>
Create a new H33 client.
ⓘ
let client = H33Client::new("https://api.h33.ai")?;Sourcepub fn with_api_key(base_url: &str, api_key: &str) -> Result<Self, Error>
pub fn with_api_key(base_url: &str, api_key: &str) -> Result<Self, Error>
Create a client with a custom API key.
Sourcepub async fn attest(
&self,
data: &[u8],
computation_type: &str,
) -> Result<AttestationResponse, Error>
pub async fn attest( &self, data: &[u8], computation_type: &str, ) -> Result<AttestationResponse, Error>
Attest data — returns an H33-74 primitive with PQ signatures.
Sourcepub async fn verify_attestation(
&self,
substrate_hex: &str,
) -> Result<VerificationResult, Error>
pub async fn verify_attestation( &self, substrate_hex: &str, ) -> Result<VerificationResult, Error>
Verify an H33-74 attestation.
Sourcepub fn verify_local(substrate_hex: &str) -> Result<VerificationResult, Error>
pub fn verify_local(substrate_hex: &str) -> Result<VerificationResult, Error>
Verify an H33-74 attestation locally (no API call needed). Checks the substrate structure and commitment hash.
Examples found in repository?
examples/quickstart.rs (line 14)
7fn main() {
8 println!("H33 Client SDK — Quickstart\n");
9
10 // Local verification (no API call, no server needed)
11 // This is a real H33-74 BitBond attestation substrate:
12 let substrate_hex = "01409a7df8f7ed4f6ad3382fb173aa4e1dd6c58866aaf8a8375d3e7ffc951bd1d04b0000019dad095df2b71c7fdbebbf1304235886dbf89a8f04";
13
14 match H33Client::verify_local(substrate_hex) {
15 Ok(result) => {
16 println!(" Valid: {}", result.valid);
17 println!(" Type: {}", result.computation_type);
18 println!(" Commitment: {}...", &result.commitment[..32]);
19 println!(" Timestamp: {}", result.timestamp_ms);
20 println!(" Details: {}", result.details);
21 }
22 Err(e) => {
23 println!(" Verification failed: {}", e);
24 }
25 }
26
27 println!("\n For API calls, create a client:");
28 println!(" let client = H33Client::new(\"https://api.h33.ai\")?;");
29 println!(" let attestation = client.attest(data, \"BiometricAuth\").await?;");
30}Sourcepub async fn compute_fhe(
&self,
request: &FheRequest,
) -> Result<FheResponse, Error>
pub async fn compute_fhe( &self, request: &FheRequest, ) -> Result<FheResponse, Error>
Run FHE computation via the API.
Auto Trait Implementations§
impl Freeze for H33Client
impl !RefUnwindSafe for H33Client
impl Send for H33Client
impl Sync for H33Client
impl Unpin for H33Client
impl UnsafeUnpin for H33Client
impl !UnwindSafe for H33Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more