Optional
_channelOptional
_fsmProtected
enqueueOptional
state?: Partial<ChannelState>Leave channel
It is possible to leave a channel and then later reestablish the channel off-chain state and continue operation. When a leave method is called, the channel fsm passes it on to the peer fsm, reports the current mutually signed state and then terminates.
The channel can be reestablished by instantiating another Channel instance with two extra params: existingChannelId and offchainTx (returned from leave method as channelId and signedTx respectively).
channel.leave().then(({ channelId, signedTx }) => {
console.log(channelId)
console.log(signedTx)
})
Remove event listener function
Event name
Callback function
Register event listener function
Possible events:
Event name
Callback function
Trigger mutual close
At any moment after the channel is opened, a closing procedure can be triggered. This can be done by either of the parties. The process is similar to the off-chain updates.
Function which verifies and signs mutual close transaction
channel.shutdown(
async (tx) => await account.signTransaction(tx)
).then(tx => console.log('on_chain_tx', tx))
Get current status
Static
_initializeStatic
initializeChannel params
Static
reconnectGenerated using TypeDoc
Channel
Example