qwery-sdk

Crates.ioqwery-sdk
lib.rsqwery-sdk
version0.1.3
created_at2025-11-24 07:44:16.333569+00
updated_at2025-11-24 08:03:51.832988+00
descriptionRust SDK for Qwery x402 Payment Facilitator - Zero fee Solana payments
homepagehttps://qwery.xyz
repositoryhttps://github.com/Qwerydotxyz/qwery-sdk-rust
max_upload_size
id1947510
size155,679
Qwerydotxyz (Qwerydotxyz)

documentation

https://docs.rs/qwery-sdk

README

Qwery SDK Banner

Qwery SDK for Rust

Rust SDK for integrating Qwery x402 Payment Facilitator into your applications.

Crates.io Documentation License: MIT

Installation

Add this to your Cargo.toml:

[dependencies]
qwery-sdk = "0.1"
tokio = { version = "1.0", features = ["full"] }

Quick Start

use qwery_sdk::{QweryClient, PaymentRequest, Network};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Create client
    let client = QweryClient::new(Network::Mainnet)?;

    // Create payment
    let payment = client.create_payment(PaymentRequest {
        amount: 0.01,
        token: "SOL".to_string(),
        recipient: "merchant_wallet_address".to_string(),
        metadata: None,
    }).await?;

    println!("Payment ID: {}", payment.payment_id);
    println!("Transaction: {}", payment.transaction);

    Ok(())
}

Features

  • Zero User Fees - Facilitator pays network costs
  • Instant Settlement - Sub-2 second transaction finality
  • Multi-Token Support - SOL, USDC, USDT on Solana
  • Type-Safe - Full Rust type safety
  • Async/Await - Built on Tokio for async operations

Examples

Sign and Settle Payment

use qwery_sdk::{QweryClient, PaymentRequest, Network};
use solana_sdk::signature::Keypair;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = QweryClient::new(Network::Devnet)?;
    let keypair = Keypair::new();

    // Create payment
    let payment = client.create_payment(PaymentRequest {
        amount: 0.01,
        token: "SOL".to_string(),
        recipient: "recipient_address".to_string(),
        metadata: None,
    }).await?;

    // Sign and settle
    let result = client.sign_and_settle(&payment, &keypair).await?;
    
    if result.success {
        println!("Payment settled! Signature: {:?}", result.signature);
    }

    Ok(())
}

Verify Payment

use qwery_sdk::{QweryClient, Network};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = QweryClient::new(Network::Mainnet)?;

    let result = client.verify_payment("transaction_signature").await?;
    
    println!("Verified: {}", result.verified);
    println!("Status: {}", result.status);

    Ok(())
}

Health Check

use qwery_sdk::{QweryClient, Network};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = QweryClient::new(Network::Mainnet)?;

    let health = client.health().await?;
    
    println!("Status: {}", health.status);
    println!("Version: {}", health.version);

    Ok(())
}

Documentation

License

MIT © Qwery

Commit count: 0

cargo fmt