Skip to content

TransactionWatcher

Defined in: ootle-indexer/src/tx-watcher.ts:59

Subscribes to the indexer’s SSE /events stream and routes TransactionFinalized events to waiting callers.

The stream is paused (abort + reconnect deferred) when no transactions are being watched, and resumed on the first new watch() call. Mirrors TransactionWatcher from the Rust ootle-rs crate.

Lifecycle: call start() once (idempotent), then obtain PendingTransaction handles via watch(). Call stop() to shut down.

new TransactionWatcher(baseUrl): TransactionWatcher

Defined in: ootle-indexer/src/tx-watcher.ts:65

string

TransactionWatcher

register(txId): Promise<SseFinalizedDecision>

Defined in: ootle-indexer/src/tx-watcher.ts:105

Internal: register a waiter for a transaction ID.

string

Promise<SseFinalizedDecision>


start(): void

Defined in: ootle-indexer/src/tx-watcher.ts:73

Starts the background SSE loop (idempotent — safe to call multiple times).

void


stop(): void

Defined in: ootle-indexer/src/tx-watcher.ts:84

Stops the background loop and rejects any still-parked waiters with IndexerClientError("TransactionWatcher stopped"). In normal use PendingTransaction self-unregisters, so a hit here means a leaked handle.

void


unregister(txId): void

Defined in: ootle-indexer/src/tx-watcher.ts:112

Internal: remove a pending waiter.

string

void


watch(txId, client, timeoutMs?): PendingTransaction

Defined in: ootle-indexer/src/tx-watcher.ts:99

Returns a PendingTransaction that resolves when the network finalises the given transaction ID, throwing on Reject / FeeIntentCommit / timeout.

Automatically starts the watcher loop if it isn’t running yet.

string

IndexerClient

number = 32_000

PendingTransaction