quiesceChannel
@totemsdk/omnia-splice / quiesceChannel
Function: quiesceChannel()
quiesceChannel(
channel,leaseProvider,options?):Promise<QuiescedChannel>
Quiesce a channel before splicing.
Quiescing is mandatory before a splice can be proposed or accepted. It:
- Validates the channel is
'active'. - Ensures all in-flight HTLCs have reached a terminal state
(
fulfilledortimed_out). If pending HTLCs exist andoptions.awaitResolutionis provided, the callback is invoked so the caller can drive/await resolution (submit preimages, wait for timeouts, poll a node). After the callback the channel is re-checked. If HTLCs remain pending,PendingHTLCErroris thrown. If the option is absent and pending HTLCs exist,PendingHTLCErroris thrown immediately. - Signs a final state update (via
updateState) that captures the settled balance split atcurrentSequence + 1. This produces a WOTS-signedPartial<SignedChannelState>binding both parties to the pre-splice balance before the splice TX resets the sequence to 0. - Returns a
QuiescedChannelwithstatus: 'quiesced',pendingHTLCs: [](all resolved HTLCs cleared), andquiesceSignedStatecontaining the local party's partial signature over the final balance state.
The caller must exchange quiesceSignedState with the counterparty to obtain
their co-signature, providing a fully signed record of the last pre-splice
balance for any future dispute resolution.
Parameters
channel
OmniaChannel
The active channel to quiesce.
leaseProvider
Provides the local party's signer and WOTS lease.
options?
Optional: awaitResolution callback for HTLC settlement.
Returns
Promise<QuiescedChannel>
A QuiescedChannel with status: 'quiesced', cleared pendingHTLCs,
and the local party's partial signature over the final balance state.
Throws
If channel is not active.
Throws
If HTLCs remain pending after resolution.