es/channel/index.js
function shutdown (sign) {
  return new Promise((resolve, reject) => {
    enqueueAction(
      this,
      (channel, state) => state.handler === handlers.channelOpen,
      (channel, state) => {
        send(channel, { jsonrpc: '2.0', method: 'channels.shutdown', params: {} })
        return {
          handler: handlers.awaitingShutdownTx,
          state: {
            sign,
            resolve,
            reject
          }
        }
      }
    )
  })
}
function shutdown (sign) {
  return new Promise((resolve, reject) => {
    enqueueAction(
      this,
      (channel, state) => state.handler === handlers.channelOpen,
      (channel, state) => {
        send(channel, { jsonrpc: '2.0', method: 'channels.shutdown', params: {} })
        return {
          handler: handlers.awaitingShutdownTx,
          state: {
            sign,
            resolve,
            reject
          }
        }
      }
    )
  })
}
function shutdown ( sign ) { return new Promise ( ( resolve , reject ) => { enqueueAction ( this , ( channel , state ) => state . handler === handlers . channelOpen , ( channel , state ) => { send ( channel , { jsonrpc : '2.0' , method : 'channels.shutdown' , params : { } } ) return { handler : handlers . awaitingShutdownTx , state : { sign , resolve , reject } } } ) } ) }
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.

@param {Function} sign - Function which verifies and signs mutual close transaction
@return {Promise<String>}
@example channel.shutdown(
async (tx) => await account.signTransaction(tx)
).then(tx => console.log('on_chain_tx', tx))
Trigger mutual close