verifier/api/
mod.rs

1//! # API Client for Starknet Contract Verification
2//!
3//! This module provides a comprehensive API client for interacting with Starknet
4//! contract verification services. It handles HTTP requests, response parsing,
5//! and provides type-safe interfaces for all verification operations.
6//!
7//! ## Features
8//!
9//! - **HTTP Client**: Built on `reqwest` with automatic retries and error handling
10//! - **Type Safety**: Strong typing for all requests and responses
11//! - **Polling**: Automatic polling for long-running verification jobs
12//! - **Error Handling**: Comprehensive error types with actionable suggestions
13//! - **Multipart Uploads**: Support for uploading contract source files
14//!
15//! ## Example Usage
16//!
17//! ```rust,no_run
18//! use verifier::api::{ApiClient, FileInfo, ProjectMetadataInfo};
19//! use verifier::class_hash::ClassHash;
20//! use url::Url;
21//! use std::path::PathBuf;
22//!
23//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
24//! // Create API client
25//! let client = ApiClient::new(Url::parse("https://api.voyager.online/beta")?)?;
26//!
27//! // Check if a class exists
28//! let class_hash = ClassHash::new("0x044dc2b3239382230d8b1e943df23b96f52eebcac93efe6e8bde92f9a2f1da18")?;
29//! let exists = client.get_class(&class_hash)?;
30//!
31//! // Get verification job status
32//! let job_status = client.get_job_status("job-id")?;
33//! # Ok(())
34//! # }
35//! ```
36
37// Re-export the API module components
38pub use self::{
39    client::ApiClient,
40    errors::{ApiClientError, VerificationError},
41    models::{FileInfo, ProjectMetadataInfo, VerificationJob, VerificationJobDispatch},
42    polling::poll_verification_status,
43    types::{JobStatus, Status, VerifyJobStatus},
44};
45
46// Module declarations
47mod client;
48mod errors;
49mod models;
50mod polling;
51mod types;