Skip to content
Tenzro
Documentation menu
Build and operate

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 as u128.
  • 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

ts
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();
rust
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.

TypeScriptRustReturns
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

ClientMethodsAccess
walletgetBalance, getTokenBalance, getNonceopen
walletsendSelfCustody({ signer, to, value }): builds the transaction hash, gets the hybrid signature from your signer, submits with eth_sendRawTransactionowner (signed)
passkeyRpcenroll, sign, addPasskey, listPasskeys, removePasskey, setPolicy, getPolicy, addGuardian, getSmartAccountowner, except reads
identityregisterHuman, registerMachine, resolve, resolveDidDocument, setUsername, resolveUsername, listJwks, getJwkresolve and list open; writes owner
authonboardHuman, onboardDelegatedAgent, onboardAutonomousAgent, refreshToken, listPendingApprovals, decideApproval, introspectToken, oauthDiscoveryreturns DPoP-bound tokens
device()listBoundDevices, walletReadiness (open); bindDevice, revokeBoundDevice, transferMachineOwnershipadmin 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

ClientMethodsAccess
inferencelistModels, getModelHash, listModelHashes, listModelEndpoints, getGeneration, listInferenceUsageopen
inferencerequest(modelId, input), routeIntent, chatByIntent, orchestrateopen or paid, as the model's provider sets
providerchat(modelId, messages), chatWith(modelId, messages, options), listProviders, getProviderPricing, getProviderScheduleopen or paid
multimodal()forecast, imageEmbed, imageTextSimilarity, textEmbed, segment, textSegment, detect, transcribe, videoEmbed, plus list...Catalog and list...Models per modalityopen or paid
cortexreason, listWorkerspaid

Model lifecycle on your own node (provider.downloadModel, serveModel, stopModel, deleteModel, setProviderPricing, setProviderSchedule, registerModelEndpoint) is admin. See Model serving.

Payments and settlement

ClientMethodsAccess
paymentcreateChallenge, payX402(url), payMpp(url), getReceipt, listSessions, gatewayInfo, listX402Schemespay calls are owner
settlementgetSettlement, getEscrow, listEscrowsByPayer, listEscrowsByPayee, prepaidBalance, getDisputeopen
settlementcreateEscrow, releaseEscrow, refundEscrow, prepaidDeposit, prepaidWithdraw, openPaymentChannel, closePaymentChannelowner

See Payments, x402 and MPP.

Agents

ClientMethodsAccess
agentregister, sendMessageSigned, spawnAgent, runAgentTask, createSwarm, terminateSwarm, fundAgent, suspendAgent, resumeAgent, discoverAgents, findBestAgentForCapabilitydiscovery open; everything else owner
memory()grant, recall, archive, listRecordsowner
task()postTask, listTasks, getTask, quoteTask, assignTask, completeTask, cancelTasklists open; poster or assignee signs the rest
marketplace()listAgentTemplates, getAgentTemplate, searchAgentTemplates, registerAgentTemplate, updateAgentTemplate, spawnAgentFromTemplate, rateAgentTemplatereads open; writes owner
skill, toolregister..., list..., search..., use..., get..., update...updates signed by the creator
erc8004()encoders and decoders for the ERC-8004 identity, reputation and validation registriesopen

Storage, data and compute

ClientMethodsAccess
filesupload, list, get, download, delete, usageAPI key with storage scope
databaselistEngines (open); create, get, list, query, issueConnection, rescale, dropAPI key with database scope
storageopenDeal, getDeal, statusowner
computebookRental, getRental, statusowner
sla()getParams, listOutstandingProbes, issueProbereads open

See Decentralized storage, Databases and Compute rental.

Network, trust and operations

ClientMethodsAccess
validators()list, listActive, getStateopen
stakinggetStakingBalance, getRewards, getUnbondingopen
stakingstake(amount, providerType), unstake(amount)admin (the operator's own bond)
governancelistProposals, getProposal, getVotingPower (open); createProposal, vote, delegateVotingPowerowner
teedetectTee, getAttestation, verifyAttestation, listTeeProvidersopen
zkcreateProof, verifyProof, listCircuitsopen
events()getEvents, subscribeEvents, registerWebhook, listWebhooks, deleteWebhookwebhooks owner
trainingInspection()listRuns, getRun, getReceipt, daemonStatusopen
apiKeycreate, list, revokeadmin
apiKeylistMine, revokeMinethe key holder
gatewaymethods({ 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:

CodeMeaning
-32001Missing or invalid admin token, or a missing signature on an owner method
-32002The controller of a delegated agent must approve this call; retry with the returned approval_id
-32004API key missing, revoked or without the required scope
-32005API key over its rate budget; data.retry_after_ms says when to retry
-32602Invalid parameters