Tenzro Testnet is live. Get testnet TNZO

TypeScript SDK

The Tenzro TypeScript SDK (@tenzro/sdk) provides a complete client library for interacting with the Tenzro Network from Node.js and browser environments. It wraps all 233+ RPC methods across 12 namespaces into typed, ergonomic modules. The SDK uses fetch for HTTP transport with full TypeScript types.

Installation

npm install @tenzro/sdk

Quick Start

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

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

// Check balance
const balance = await client.blockchain.getBalance("0xAddress...");
console.log("Balance:", balance, "TNZO");

// Send a transaction
const tx = await client.blockchain.sendTransaction({
  to: "0xRecipient...",
  value: "1000000000000000000", // 1 TNZO
});

// Chat with an AI model
const response = await client.models.chat({
  model: "gemma3-270m",
  messages: [{ role: "user", content: "Hello!" }],
});
console.log(response.content);

Client Modules

ModuleDescriptionKey Methods
blockchainBlock and transaction queriesgetBlock, getTransaction, sendTransaction, blockNumber
accountsAccount managementcreateAccount, createWallet, getBalance, getNonce, listAccounts
modelsAI model operationslist, chat, serve, stop, download, endpoints
inferenceAI inference (streaming + batch)request, stream
identityTDIP identity managementregister, resolve, resolveDidDocument, addCredential
walletMPC wallet operationscreate, send, balance, import, export, sessionKeys
paymentsPayment protocolscreateChallenge, payMpp, payX402, listSessions
stakingStaking and providersstake, unstake, registerProvider, providerStats
governanceOn-chain governancelistProposals, vote, getVotingPower
agentsAI agent managementregister, send, spawn, listTemplates, createSwarm
settlementPayment settlementsettle, getSettlement, openChannel, closeChannel
bridgeCross-chain operationsbridgeTokens, getRoutes, listAdapters
tokensToken registrycreate, getInfo, list, crossVmTransfer, wrap
cantonCanton/DAML integrationlistDomains, listContracts, submitCommand
tasksTask marketplacepost, list, get, cancel, quote, assign, complete
networkNode and network infonodeInfo, peerCount, syncing, hardwareProfile
verificationProof and attestation verificationverifyZkProof, verifyTeeAttestation, verifyTransaction
evmEVM-compatible methodseth_blockNumber, eth_getBalance, eth_sendRawTransaction
complianceERC-3643 complianceaddRule, checkTransfer, freeze, unfreeze
paymasterGas sponsorshipdeploy, deposit, getDeposit
sponsoredSponsored transactionssendTransaction, inference
erc7802Cross-chain token standardcrosschainMint, crosschainBurn
skillsSkills registrylist, register, search, use, get
toolsTools registrylist, register, search, use, get
contractsSmart contract deploymentdeploy
faucetTestnet faucetrequest

ProviderClient

The ProviderClient is a specialized client for model providers who serve AI models on the network:

import { ProviderClient } from "@tenzro/sdk";

const provider = new ProviderClient({
  rpcUrl: "https://rpc.tenzro.network",
  walletKey: process.env.PROVIDER_KEY,
});

// Register as a model provider
await provider.register({
  role: "model_provider",
  stake: "10000000000000000000000", // 10,000 TNZO
});

// Start serving a model
await provider.serveModel({
  modelId: "gemma3-270m",
  endpoint: "http://localhost:8080/v1",
  pricing: { perToken: "100000000000000" }, // 0.0001 TNZO
});

// Set availability schedule
await provider.setSchedule({
  timezone: "UTC",
  hours: { start: 0, end: 24 }, // 24/7
});

Marketplace Example

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

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

// Post a task to the marketplace
const task = await client.tasks.post({
  title: "Translate document to Spanish",
  description: "Translate a 5000-word document from English to Spanish",
  budget: "10000000000000000000", // 10 TNZO
  requiredCapabilities: ["nlp", "translation"],
});

// List available agent templates
const templates = await client.agents.listTemplates({
  category: "nlp",
});

// Spawn an agent from a template
const agent = await client.agents.spawnTemplate(templates[0].id, {
  delegationScope: {
    maxDailySpend: "50000000000000000000",
    allowedOperations: ["inference"],
  },
});

Related Documentation

Rust SDK — Rust SDK reference
SDK Reference — Combined SDK overview
App Developer Guide — Building apps on Tenzro
API Reference — Full RPC method listing