Skip to content

PendingTransaction

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

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:165

string

TransactionWatcher

IndexerClient

number

PendingTransaction

cancel(): void

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

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:332

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:183

Waits for the transaction to finalise via SSE, with REST as the verdict source when SSE is ambiguous. Commit resolves directly; Abort fetches the receipt once to distinguish Reject from FeeIntentCommit; Indeterminate or SSE silence falls back to REST polling within timeoutMs.

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.