Tenzro Testnet is live —request testnet TNZO

SDK Overview

Tenzro provides two official SDKs for building applications on the network: a comprehensive Rust SDK and a TypeScript SDK for web and server-side applications. Both SDKs include the AppClient pattern for developer-funded applications with master wallets and gas sponsorship.

Available SDKs

AppClient Pattern

The AppClient is the top-level developer entry point for building applications. It wraps a master wallet and provides methods to create user sub-wallets, sponsor gas, manage spending policies, and track usage:

use tenzro_sdk::AppClient;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Initialize with master wallet private key
    let app = AppClient::new(
        "https://rpc.tenzro.network",
        "your-master-wallet-private-key",
    ).await?;

    // Or initialize with API key
    let app = AppClient::from_api_key(
        "https://rpc.tenzro.network",
        "your-api-key",
    ).await?;

    // Create a user wallet (funded from master)
    let user = app.create_user_wallet("alice", 100_000_000_000_000_000).await?;

    // Sponsor an inference request for the user
    let result = app.sponsor_inference(
        &user.address,
        "gemma3-270m",
        "Hello, how are you?",
    ).await?;

    // Check usage stats
    let stats = app.get_usage_stats().await?;
    println!("Total gas spent: {} wei", stats.total_gas_spent);
    Ok(())
}

SDK Modules

Both SDKs provide client modules for every major subsystem:

ModuleDescription
appAppClient with master wallet, user sub-wallets, gas sponsorship
walletWallet creation, balance queries, transfers
custodyMPC wallets, session keys, spending policies, key rotation
identityTDIP identity registration, DID resolution, credentials
inferenceModel listing, chat completion, streaming inference
agentAgent registration, messaging, templates, swarms
bridgeCross-chain transfers via LayerZero, CCIP, deBridge
paymentMPP and x402 payment protocol clients
stakingStake, unstake, provider registration
governanceProposals, voting, voting power queries
tokenToken creation, registry, cross-VM transfers
cryptoSigning, verification, encryption, hashing
teeTEE attestation, seal/unseal, provider queries
zkZK proof generation and verification

ProviderClient

Both SDKs include a ProviderClient for making direct HTTP requests to the JSON-RPC endpoint. The Rust SDK uses reqwest and the TypeScript SDK uses fetch:

// TypeScript
import { TenzroClient } from "@tenzro/sdk";

const client = new TenzroClient("https://rpc.tenzro.network");

// All modules available as properties
const balance = await client.wallet.getBalance("0x...");
const models = await client.inference.listModels();
const identity = await client.identity.register("human", "Alice");