Skip to main content

circle_user_controlled_wallets/
lib.rs

1//! Rust client for the Circle Web3 Services User-Controlled Wallets API.
2//!
3//! This crate provides a typed, async HTTP client for the
4//! [Circle W3S User-Controlled Wallets API](https://developers.circle.com/api-reference/w3s/user-controlled-wallets),
5//! where end-users own their signing keys through a PIN-protected security model.
6//!
7//! ## Covered Endpoints
8//!
9//! | Module | Functionality |
10//! |--------|---------------|
11//! | [`models::user`] | Create and retrieve end-user accounts |
12//! | [`models::challenge`] | Initiate and retrieve PIN / security-factor challenges |
13//! | [`models::wallet`] | List wallets and query balances and NFTs |
14//! | [`models::transaction`] | Initiate and track on-chain transactions |
15//! | [`models::signing`] | Sign messages and typed data |
16//! | [`models::token`] | Look up token metadata |
17//!
18//! ## Quick Start
19//!
20//! ```no_run
21//! use circle_user_controlled_wallets::{UserWalletsClient, models::user::CreateUserRequest};
22//!
23//! #[tokio::main]
24//! async fn main() -> Result<(), circle_user_controlled_wallets::Error> {
25//!     let client = UserWalletsClient::new("your_api_key");
26//!     let req = CreateUserRequest { user_id: "user-123".to_string() };
27//!     let user = client.create_user(&req).await?;
28//!     println!("Created user: {:?}", user.data);
29//!     Ok(())
30//! }
31//! ```
32//!
33//! ## Authentication
34//!
35//! All requests require a Circle API key, which can be created in the
36//! [Circle Developer Console](https://console.circle.com).
37//!
38//! ## Error Handling
39//!
40//! Every fallible operation returns [`Error`], which captures both HTTP-level
41//! transport failures and API-level error responses from Circle.
42
43#![deny(missing_docs)]
44
45pub mod client;
46pub mod error;
47pub mod models;
48
49pub use client::UserWalletsClient;
50pub use error::Error;