PendingTransaction
Defined in: ootle-indexer/src/tx-watcher.ts:158
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:165
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:320
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:332
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: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.
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.