@tari-project/ootle-indexer
v0.1.0
Published
Indexer REST `Provider` for the Tari Ootle network — reads chain state, submits transactions, and watches for finality via SSE.
Readme
@tari-project/ootle-indexer
Indexer REST Provider for the Tari Ootle network — reads chain state, submits
transactions, and watches for finality via SSE.
Runtime support
| Package | Browser | Node ≥ 22 | Notes |
| ----------------------------- | ------- | --------- | ---------------------------- |
| @tari-project/ootle-indexer | ✓ | ✓ | fetch + SSE native in both |
This package has no DOM-specific code. fetch and SSE
(response.body.getReader() + TextDecoder) are native in both browsers and
Node ≥ 22, so the same artifact runs in either environment.
Node note: Node ≥ 22 currently requires
NODE_OPTIONS=--experimental-wasm-moduleswhen running undertsxor plainnodebecause@tari-project/ootle(a peer in the SDK) loads@tari-project/ootle-wasmas an ES module. Seeexamples/node/README.mdfor the rationale and forward plan.
Install
pnpm add @tari-project/ootle-indexerHello world
Connect to the Esmeralda testnet and read a substate:
import { ProviderBuilder, Network } from "@tari-project/ootle-indexer";
const provider = await ProviderBuilder.new().withNetwork(Network.Esmeralda).connect();
const substate = await provider.getSubstate("component_0x…");
console.log(substate);For LocalNet, pass Network.LocalNet; the builder falls back to
defaultIndexerUrl(Network.LocalNet) (http://localhost:12500) when no URL is
configured.
Deep dive
For ProviderBuilder, IndexerProvider, TransactionWatcher /
PendingTransaction, and the lazy WantInput / resolveWantInputs flow, see
the root README's "@tari-project/ootle-indexer" section.
Examples
Runnable browser apps and Node scripts live under
examples/ — the
indexer-explorer/ React app browses
substates, transactions, and templates via this provider, and
examples/node/ drives it from headless
TypeScript.
