code: function leave () {
    return new Promise((resolve, reject) => {
      enqueueAction(
        this,
        (channel, state) => state.handler === handlers.channelOpen,
        (channel, state) => {
          send(channel, { jsonrpc: '2.0', method: 'channels.leave', params: {} })
          return {
            handler: handlers.awaitingLeave,
            state: { resolve, reject }
          }
        })
    })
  }
docs: 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).
  
  @return {Promise<Object>}
  @example channel.leave().then(({ channelId, signedTx }) => {
  console.log(channelId)
  console.log(signedTx)
  })