1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//! # SagaPay Rust SDK
//!
//! This crate provides a Rust interface to the SagaPay blockchain payment gateway API.
//! SagaPay is the world's first free, non-custodial blockchain payment gateway service provider.
//!
//! ## Example
//!
//! ```rust,no_run
//! use sagapay::{AddressType, Client, Config, CreateDepositParams, NetworkType};
//!
//! #[tokio::main]
//! async fn main() -> Result<(), sagapay::Error> {
//! // Initialize the SagaPay client
//! let client = Client::new(Config {
//! api_key: "your-api-key".to_string(),
//! api_secret: "your-api-secret".to_string(),
//! ..Config::default()
//! });
//!
//! // Create a deposit address
//! let deposit = client.create_deposit(CreateDepositParams {
//! network_type: NetworkType::BEP20,
//! contract_address: "0".to_string(), // '0' for native tokens (BNB)
//! amount: "1.5".to_string(),
//! ipn_url: "https://example.com/webhook".to_string(),
//! udf: Some("order-123".to_string()),
//! address_type: Some(AddressType::Temporary),
//! transfer_balance: None, // defaults to true server side
//! }).await?;
//!
//! println!("Deposit address: {}", deposit.address);
//! println!("Expires at: {:?}", deposit.expires_at);
//!
//! Ok(())
//! }
//! ```
//!
//! ## Notifications (IPN)
//!
//! [`WebhookHandler`] parses incoming notifications and, when you have been
//! issued a platform IPN secret, verifies their `X-Sagapay-Signature` header.
//! [`Client::verify_ipn`] is the primary check: it asks the API to confirm the
//! transaction. Notifications are delivered at least once, so keep your handler
//! idempotent.
pub use Client;
pub use Config;
pub use Error;
pub use *;
pub use WebhookHandler;