PendingTransaction
Defined in: ootle-indexer/src/tx-watcher.ts:178
A handle for a submitted transaction.
Mirrors PendingTransaction from the Rust ootle-rs crate.
Example
Section titled “Example”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 neededConstructors
Section titled “Constructors”Constructor
Section titled “Constructor”new PendingTransaction(
txId,watcher,client,timeoutMs):PendingTransaction
Defined in: ootle-indexer/src/tx-watcher.ts:186
Parameters
Section titled “Parameters”string
watcher
Section titled “watcher”client
Section titled “client”IndexerClient
timeoutMs
Section titled “timeoutMs”number
Returns
Section titled “Returns”PendingTransaction
Methods
Section titled “Methods”cancel()
Section titled “cancel()”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.
Returns
Section titled “Returns”void
getReceipt()
Section titled “getReceipt()”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().
Returns
Section titled “Returns”Promise<IndexerGetTransactionResultResponse>
watch()
Section titled “watch()”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.
Returns
Section titled “Returns”Promise<CommitOutcome>
Throws
Section titled “Throws”on Reject or FeeIntentCommit (FIC’s
.reason is prefixed "FeeIntentCommit: ").
Throws
Section titled “Throws”when neither SSE nor REST sees finality in time.
Throws
Section titled “Throws”when cancel() was called.