SDKs and reference
SDK reference.
Two official SDKs cover the full Tenzro Network surface:
tenzro-sdk (Rust) and tenzro-ts-sdk (TypeScript). Method names match the JSON-RPC names with idiomatic casing — snake_case in Rust, lowerCamelCase in TypeScript. Authorized methods require DPoP + JWT bearer auth bound to a TDIP DID; the SDK manages the token lifecycle.- RUST
- tenzro-sdk
- TYPESCRIPT
- tenzro-ts-sdk
- JSON-RPC
- 640+ methods
01
Construction
// Rust
use tenzro_sdk::TenzroClient;
let client = TenzroClient::new("https://rpc.tenzro.network")
.with_bearer(env_jwt)
.with_dpop(env_dpop);
// TypeScript
import { TenzroClient } from "@tenzro/ts-sdk";
const client = new TenzroClient({
endpoint: "https://rpc.tenzro.network",
bearer: process.env.TENZRO_BEARER_JWT,
dpop: process.env.TENZRO_DPOP_PROOF,
});02
Sub-clients
The root TenzroClient exposes typed sub-clients per namespace. Each sub-client wraps a slice of the RPC surface with idiomatic helpers.
client.wallet() // Wallet, balance, sign, send
client.identity() // TDIP: register, resolve, delegation
client.model() // Model registry, inference, multi-modal
client.agent() // Register, list, send-message, spawn
client.memory() // Per-agent memory grant / recall / archive
client.payments() // MPP, x402, AP2 mandate
client.settlement() // Escrow, channels, batch settlement
client.bridge() // Bridge router, adapters, ERC-7683
client.canton() // Canton command, party, IDP, analytics
client.governance() // Proposals, vote, voting power
client.staking() // Stake, unstake, liquid (stTNZO)
client.train() // Tenzro Train: tasks, runs, gradients
client.zk() // Plonky3 STARK prove / verify
client.vrf() // ECVRF
client.tee() // TEE attestation
client.workflow() // Long-running workflows03
Blockchain and accounts
// Rust // TypeScript
client.block_number() client.blockNumber()
client.get_block(height) client.getBlock(height)
client.get_transaction(hash) client.getTransaction(hash)
client.wallet().get_balance(addr) client.wallet().getBalance(addr)
client.wallet().get_nonce(addr) client.wallet().getNonce(addr)
client.wallet().send(tx) client.wallet().send(tx)
client.wallet().sign_and_send(tx) client.wallet().signAndSend(tx)04
Multi-modal AI
// Chat completion (language)
client.model().chat(model_id, messages)
// Forecast (time-series)
client.model().forecast(model_id, series, horizon, quantiles)
// Vision embedding
client.model().image_embed(model_id, image_bytes)
client.model().image_text_similarity(image_model, text_model, image, text)
// Text embedding
client.model().text_embed(model_id, texts)
// Segmentation
client.model().segment(model_id, image_bytes, prompts)
// Detection
client.model().detect(model_id, image_bytes, score_threshold)
// Transcription (ASR)
client.model().transcribe(model_id, audio_bytes, language)
// Video embedding
client.model().video_embed(model_id, video_bytes)05
Agents and memory
// Identity (TDIP)
client.identity().register_machine(spec)
client.identity().resolve(did)
client.identity().set_delegation_scope(machine_did, scope)
// Agents
client.agent().register(spec)
client.agent().send_message(target_did, msg)
client.agent().spawn(template_id, args)
client.agent().run_task(agent_id, task_spec)
// Per-agent memory (DPoP + JWT required)
client.memory().grant(agent_did, text, kind, source, metadata)
client.memory().recall(agent_did, query, k, mode)
client.memory().archive(record_id, agent_did)
client.memory().list_records(agent_did, limit)06
Payments and AP2
// Payments
client.payments().create_challenge(protocol, resource_url, amount)
client.payments().pay_mpp(challenge_id, credential)
client.payments().pay_x402(resource_url)
client.payments().verify(credential, challenge_id)
// AP2 mandates
client.ap2().sign_mandate(payload, signer_did)
client.ap2().verify_mandate(mandate, signer_did)
client.ap2().validate_mandate_pair(intent_mandate, cart_mandate)
client.ap2().report_violation(mandate_hash, reason)07
Settlement, escrow, capital intent, workflow
// Settlement
client.settlement().settle(req)
client.settlement().get_settlement(id)
client.settlement().update_channel(channel_id, payment_amount, signature)
// Escrow (state reads only; writes go through wallet.sign_and_send)
client.settlement().get_escrow(escrow_id)
client.settlement().list_escrows_by_payer(payer)
client.settlement().list_escrows_by_payee(payee)
// Capital intent
client.capital().open(intent_json)
client.capital().quote(intent_id, quote_json)
client.capital().assign(intent_id, assignee_did)
client.capital().execute(intent_id)
client.capital().settle(intent_id)
// Workflow
client.workflow().open(workflow_json)
client.workflow().step_execute(workflow_id, step_index)
client.workflow().step_verify(workflow_id, step_index)
client.workflow().step_compensate(workflow_id, step_index)
client.workflow().finalize(workflow_id)
client.workflow().mirror_to_canton(workflow_id)08
Bridges, ERC-7683, cross-chain
// Generic bridge router
client.bridge().quote(src, dst, asset, amount)
client.bridge().routes(src, dst)
client.bridge().send(adapter, src, dst, asset, amount, strategy)
client.bridge().status(route_id)
// ERC-7683 intents
client.bridge().open_7683_order(order)
client.bridge().get_7683_order(order_id)
client.bridge().list_7683_orders(filter)
client.bridge().record_fill_7683(fill)
// Specific adapters
client.bridge().wormhole().bridge(...)
client.bridge().wormhole().ntt_list_chains()
client.bridge().cct().list_pools()
client.bridge().cct().get_pool(chain)
client.bridge().debridge().get_chains()
client.bridge().lifi().get_quote(...)09
Canton
client.canton().list_domains()
client.canton().list_contracts(template_ids, party)
client.canton().create_contract(template_id, create_arguments, act_as)
client.canton().exercise_choice(template_id, contract_id, choice, arg, act_as)
client.canton().allocate_party(hint)
client.canton().get_my_user()
client.canton().get_my_analytics()
client.canton().grant_user_rights(user_id, rights)
client.canton().upload_dar(dar_bytes)
client.canton().coin_balance(party)10
Tenzro Train
client.train().post_task(task_spec)
client.train().list_runs(filter)
client.train().get_run(run_id)
client.train().get_receipt(receipt_id)
client.train().enroll_trainer(run_id, attestation, enclave_pubkey)
client.train().submit_outer_gradient(run_id, gradient, signature)
client.train().finalize_round(run_id, round, state_root, witness_sigs)
client.train().install_sealed_manifest(run_id, manifest)11
Auth, governance, staking
// Governance
client.governance().list_proposals(filter)
client.governance().create_proposal(spec)
client.governance().vote(proposal_id, choice)
client.governance().get_voting_power(addr)
// Staking
client.staking().stake(amount, validator)
client.staking().unstake(stake_id)
client.staking().get_stats()
client.staking().liquid_deposit(amount)
client.staking().liquid_redeem(amount)12
Provider client
A separate ProviderClient ships in both SDKs for operators running models or TEE attestation services. It manages registration, heartbeat, inference acceptance, and reputation updates.
// Rust: reqwest-backed
use tenzro_sdk::ProviderClient;
let provider = ProviderClient::new(endpoint, identity_jwt);
provider.register(provider_spec).await?;
provider.start_serving(model_id, config).await?;
// TypeScript: fetch-backed
const provider = new ProviderClient({ endpoint, identityJwt });
await provider.register(providerSpec);
await provider.startServing(modelId, config);Related