Skip to content

PendingTransaction

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

A handle for a submitted transaction.

Mirrors PendingTransaction from the Rust ootle-rs crate.

const pending = watcher.watch(txId, client);
try {
await pending.watch(); // SSE-driven, throws on non-Commit / timeout
} catch (err) {
if (err instanceof TransactionRejectedError) { ... }
}
const receipt = await pending.getReceipt(); // full receipt if needed

new PendingTransaction(txId, watcher, client, timeoutMs): PendingTransaction

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

string

TransactionWatcher

IndexerClient

number

PendingTransaction

cancel(): void

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

Cancels an in-flight watch(). The watch promise rejects with OperationCancelledError. Idempotent; a no-op when no watch is active.

void


getReceipt(): Promise<IndexerGetTransactionResultResponse>

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

Polls the indexer once for the current transaction result and returns the raw response. Useful for fetching full receipt data after watch().

Promise<IndexerGetTransactionResultResponse>


watch(): Promise<CommitOutcome>

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

Waits for the transaction to finalise via SSE, with REST as the verdict source when SSE is ambiguous. Commit and Indeterminate both poll the REST receipt within timeoutMs to classify the final outcome (Commit vs FeeIntentCommit vs Reject, retrying transient errors and waiting if the receipt is not yet finalized); Abort fetches the receipt once to distinguish Reject from FeeIntentCommit; SSE silence falls back to REST polling within timeoutMs + a short grace window.

Promise<CommitOutcome>

on Reject or FeeIntentCommit (FIC’s .reason is prefixed "FeeIntentCommit: ").

when neither SSE nor REST sees finality in time.

when cancel() was called.