Tutorial — Getting started
TypeScript SDK quickstart
Install
tenzro-sdk, build a TenzroClient against the testnet, read the chain ID, and check a TNZO balance — all from Node or the browser.- Level
- Beginner
- Time
- ~10 min
- Prerequisites
- Node 20+, pnpm or npm
- Stack
- TypeScript
01
Install the SDK
The TypeScript SDK ships as an ESM package with full type definitions.
mkdir tenzro-hello && cd tenzro-hello
pnpm init
pnpm add tenzro-sdk
pnpm add -D typescript tsx @types/node02
Connect to the testnet
The RPC endpoint mirrors the Rust SDK — chain ID 1337 on testnet.
import { TenzroClient } from "tenzro-sdk";
const client = new TenzroClient({ endpoint: "https://rpc.tenzro.network" });
const height = await client.getBlockNumber();
console.log("height:", height);03
Read a TNZO balance
The SDK exposes namespaced clients for every subsystem (wallet, inference, staking, payment, …).
const addr = "0x7a4bcb13a6b2b384c284b5caa6e5ef3126527f93";
const balance = await client.wallet.getBalance(addr);
console.log(addr, "balance:", balance, "TNZO base units");04
Request testnet tokens
The faucet drips 100 TNZO per request with a 24-hour cooldown.
await fetch("https://api.tenzro.network/faucet", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({ address: addr }),
});Related