DocsDeveloper Guide
Current SDK. The official JavaScript / TypeScript package is @tensorium/sdk on npm. Python SDK and dApp example are planned next.

Current Developer Stack

Package@tensorium/sdk
Installnpm install @tensorium/sdk
RuntimeBrowser-safe and Node.js compatible
TransportHTTP RPC
Address formattxm1... bech32
Smallest unit1 TXM = 100,000,000 atoms

Install

npm
npm install @tensorium/sdk

Package link: npmjs.com/package/@tensorium/sdk

Read Balance

TypeScript
import { TxmRPC, TxmWallet } from '@tensorium/sdk';

const rpc = new TxmRPC('https://rpc.tensoriumlabs.com');
const wallet = TxmWallet.fromPrivateKey(process.env.TXM_PRIVATE_KEY!);

const { utxos } = await rpc.getUtxos(wallet.address);
const mature = utxos.filter((u) => u.mature);
const balanceAtoms = mature.reduce((sum, u) => sum + BigInt(u.value_atoms), 0n);

console.log({ address: wallet.address, balanceAtoms });

Use mature UTXOs only when calculating spendable balance. Coinbase outputs remain locked until maturity is reached.

Send Transaction

TypeScript
import { TxmRPC, TxmWallet, send } from '@tensorium/sdk';

const rpc = new TxmRPC('https://rpc.tensoriumlabs.com');
const wallet = TxmWallet.fromPrivateKey(process.env.TXM_PRIVATE_KEY!);

const txid = await send(
  rpc,
  wallet,
  'txm1qdestinationhere...',
  100_000_000n
);

console.log('broadcast txid:', txid);

The helper handles UTXO selection, transaction build, signing, and RPC broadcast in one flow.

Low-Level Building Blocks

If you need manual control, the SDK also exposes the lower-level primitives used by the high-level helper.

TypeScript
import {
  TxmRPC,
  TxmWallet,
  selectUtxos,
  buildAndSign,
} from '@tensorium/sdk';

const rpc = new TxmRPC('https://rpc.tensoriumlabs.com');
const wallet = TxmWallet.fromPrivateKey(process.env.TXM_PRIVATE_KEY!);

const { utxos } = await rpc.getUtxos(wallet.address);
const chosen = selectUtxos(utxos, 250_000_000n);

const tx = buildAndSign(wallet, chosen, [
  { address: 'txm1qdestinationhere...', value_atoms: 250_000_000n },
]);

const result = await rpc.sendRawTransaction(tx);
console.log(result.txid);

Operational Notes

  • Keep private keys client-side. Do not hardcode or commit them.
  • For production apps, proxy RPC through your own backend or rate-limited gateway.
  • Public RPC should be fronted by nginx or another reverse proxy with method and rate controls.
  • When building wallet UX, show both total UTXO balance and mature spendable balance.