Subscribes to a signature and waits for its terminal notification,
returning the slot it was confirmed in.
This is the push-based counterpart to
confirmTransaction: the node sends the result
as soon as the signature reaches commitment rather than being polled for
it. Because signatureSubscribe cancels itself once that notification is
sent, a successful wait leaves nothing to clean up.
Frames that belong to other subscriptions, and early receivedSignature
notifications, are skipped. The whole exchange -- subscribe, acknowledge,
notify -- is bounded by timeoutSeconds.
Returns the confirming slot, or Left describing a transaction that failed
on-chain, a JSON-RPC error, an unparseable frame, or the timeout. Exceptions
raised by the transport itself (a closed connection, for instance) are not
caught.
A wait that ends in a timeout, a bad frame, or an on-chain failure may leave
the subscription open, because only the terminal notification retires it.
That costs nothing if the connection is about to be closed, which is the
common case; a caller that keeps the connection alive should cancel it with
signatureUnsubscribeRequest. Note also that this reads frames directly
from the transport, so one connection supports one wait at a time —
multiplexing several concurrent subscriptions needs a reader loop
dispatching on parseWsMessage, which this function deliberately is not.