SDK reference
Clients and methods in the TypeScript and Rust tenzro-sdk packages, grouped by area, with the access class each call needs.
This page lists the clients in tenzro-sdk and their main methods. Both SDKs share the same layout. Method names follow the JSON-RPC method they call, in lowerCamelCase for TypeScript and snake_case for Rust. For installation, configuration and signing, start with SDKs.
Conventions
- TypeScript exposes most clients as properties (
client.wallet,client.inference) and a few as methods (client.task(),client.multimodal()). Rust exposes every client as a method (client.wallet(),client.inference()). - Amounts are in wei, the smallest TNZO unit (18 decimals). TypeScript returns balances as
bigint, Rust asu128. - Every method is in one of three access classes. Open needs no credentials. Owner needs a signature, a DPoP-bound session or an API key held by the account that owns or pays for the change. Admin needs the operator token of the node you are calling and only makes sense against your own node. See RPC access.
- Anything the typed clients do not cover is reachable through
client.gateway, which lists and calls every method the node serves.
Construction
import { TenzroClient } from "tenzro-sdk";
const client = new TenzroClient({
endpoint: "https://rpc.tenzro.xyz", // JSON-RPC
apiEndpoint: "https://api.tenzro.xyz", // Web API
timeout: 30_000,
});
// Or use a wallet injected into the page (EIP-6963 discovery):
const injected = await TenzroClient.fromInjected();use tenzro_sdk::{TenzroClient, config::SdkConfig};
let client = TenzroClient::connect(
SdkConfig::builder().endpoint("https://rpc.tenzro.xyz").build()?,
).await?;Chain and node (root client)
All open.
| TypeScript | Rust | Returns |
|---|---|---|
getBlockNumber() | block_number() | Current height |
getFinalizedBlock() | get_finalized_block() | Finalized height |
getBlock(height), getLatestBlock() | get_block(height), get_latest_block() | Block summary |
getBlockRange(start, end, max?) | get_block_range(...) | Up to 256 blocks, with nextHeight and moreAvailable for paging |
getTransaction(hash) | get_transaction(hash) | Transaction, status pending or finalized |
getTransactionHistory(address) | get_transaction_history(...) | Account history |
getBalance(address), getNonce(address) | get_balance(address), get_nonce(address) | Balance in wei, next nonce |
getChainId(), getGasPrice(), getMaxPriorityFeePerGas(), getFeeHistory(...) | get_chain_id(), gas_price(), max_priority_fee_per_gas(), fee_history(...) | EIP-1559 fee data |
nodeInfo(), peerCount(), getNetworkStats(), isSyncing(), totalSupply() | node_info(), peer_count(), network_stats(), syncing(), total_supply() | Node and network state |
health(), getStatus() | get_status() | Web API calls |
Wallet, identity and keys
| Client | Methods | Access |
|---|---|---|
wallet | getBalance, getTokenBalance, getNonce | open |
wallet | sendSelfCustody({ signer, to, value }): builds the transaction hash, gets the hybrid signature from your signer, submits with eth_sendRawTransaction | owner (signed) |
passkeyRpc | enroll, sign, addPasskey, listPasskeys, removePasskey, setPolicy, getPolicy, addGuardian, getSmartAccount | owner, except reads |
identity | registerHuman, registerMachine, resolve, resolveDidDocument, setUsername, resolveUsername, listJwks, getJwk | resolve and list open; writes owner |
auth | onboardHuman, onboardDelegatedAgent, onboardAutonomousAgent, refreshToken, listPendingApprovals, decideApproval, introspectToken, oauthDiscovery | returns DPoP-bound tokens |
device() | listBoundDevices, walletReadiness (open); bindDevice, revokeBoundDevice, transferMachineOwnership | admin on the machine's own node |
Browser helpers: createPasskeyWallet, signWithPasskey, BrowserWebAuthnAuthenticator, and the DPoP helpers generateDpopKeyPair, computeJkt, mintDpopProof. The Rust recovery methods initiate_recovery, submit_recovery_signature and finalize_recovery are on client.passkey_rpc(). See Device linking and recovery.
Inference
| Client | Methods | Access |
|---|---|---|
inference | listModels, getModelHash, listModelHashes, listModelEndpoints, getGeneration, listInferenceUsage | open |
inference | request(modelId, input), routeIntent, chatByIntent, orchestrate | open or paid, as the model's provider sets |
provider | chat(modelId, messages), chatWith(modelId, messages, options), listProviders, getProviderPricing, getProviderSchedule | open or paid |
multimodal() | forecast, imageEmbed, imageTextSimilarity, textEmbed, segment, textSegment, detect, transcribe, videoEmbed, plus list...Catalog and list...Models per modality | open or paid |
cortex | reason, listWorkers | paid |
Model lifecycle on your own node (provider.downloadModel, serveModel, stopModel, deleteModel, setProviderPricing, setProviderSchedule, registerModelEndpoint) is admin. See Model serving.
Payments and settlement
| Client | Methods | Access |
|---|---|---|
payment | createChallenge, payX402(url), payMpp(url), getReceipt, listSessions, gatewayInfo, listX402Schemes | pay calls are owner |
settlement | getSettlement, getEscrow, listEscrowsByPayer, listEscrowsByPayee, prepaidBalance, getDispute | open |
settlement | createEscrow, releaseEscrow, refundEscrow, prepaidDeposit, prepaidWithdraw, openPaymentChannel, closePaymentChannel | owner |
Agents
| Client | Methods | Access |
|---|---|---|
agent | register, sendMessageSigned, spawnAgent, runAgentTask, createSwarm, terminateSwarm, fundAgent, suspendAgent, resumeAgent, discoverAgents, findBestAgentForCapability | discovery open; everything else owner |
memory() | grant, recall, archive, listRecords | owner |
task() | postTask, listTasks, getTask, quoteTask, assignTask, completeTask, cancelTask | lists open; poster or assignee signs the rest |
marketplace() | listAgentTemplates, getAgentTemplate, searchAgentTemplates, registerAgentTemplate, updateAgentTemplate, spawnAgentFromTemplate, rateAgentTemplate | reads open; writes owner |
skill, tool | register..., list..., search..., use..., get..., update... | updates signed by the creator |
erc8004() | encoders and decoders for the ERC-8004 identity, reputation and validation registries | open |
Storage, data and compute
| Client | Methods | Access |
|---|---|---|
files | upload, list, get, download, delete, usage | API key with storage scope |
database | listEngines (open); create, get, list, query, issueConnection, rescale, drop | API key with database scope |
storage | openDeal, getDeal, status | owner |
compute | bookRental, getRental, status | owner |
sla() | getParams, listOutstandingProbes, issueProbe | reads open |
See Decentralized storage, Databases and Compute rental.
Network, trust and operations
| Client | Methods | Access |
|---|---|---|
validators() | list, listActive, getState | open |
staking | getStakingBalance, getRewards, getUnbonding | open |
staking | stake(amount, providerType), unstake(amount) | admin (the operator's own bond) |
governance | listProposals, getProposal, getVotingPower (open); createProposal, vote, delegateVotingPower | owner |
tee | detectTee, getAttestation, verifyAttestation, listTeeProviders | open |
zk | createProof, verifyProof, listCircuits | open |
events() | getEvents, subscribeEvents, registerWebhook, listWebhooks, deleteWebhook | webhooks owner |
trainingInspection() | listRuns, getRun, getReceipt, daemonStatus | open |
apiKey | create, list, revoke | admin |
apiKey | listMine, revokeMine | the key holder |
gateway | methods({ namespace?, contains? }), supports(method), call(method, params) | whatever the method needs |
In Rust the training write path (post_task, enroll_trainer, submit_outer_gradient, finalize_round) is on client.training(). See Tenzro Train.
Errors
JSON-RPC errors surface as RpcCallError in TypeScript (with code, message and data) and SdkError in Rust. The codes you will see most:
| Code | Meaning |
|---|---|
-32001 | Missing or invalid admin token, or a missing signature on an owner method |
-32002 | The controller of a delegated agent must approve this call; retry with the returned approval_id |
-32004 | API key missing, revoked or without the required scope |
-32005 | API key over its rate budget; data.retry_after_ms says when to retry |
-32602 | Invalid parameters |