approve
Calling at start of the channel and approving it
await channel.approve();
socket.send(JSON.stringify({
id: i++,
name: 'channel',
args: [channelId, 'approve']
}));
reject
Calling at start of the channel and reject it
await channel.reject();
socket.send(JSON.stringify({
id: i++,
name: 'channel',
args: [channelId, 'reject']
}));
transfer
Transfer moneys inside of the channel to the second side.
Params:
amount - {number} - How much money we transfer?
message - {string|object} - Transfer message
await channel.transfer(100, 'hello!');
socket.send(JSON.stringify({
id: i++,
name: 'channel',
args: [channelId, 'transfer', 100, 'hello!']
}));
closeMutually
Mutually closing the channel
await channel.closeMutually();
socket.send(JSON.stringify({
id: i++,
name: 'channel',
args: [channelId, 'closeMutually']
}));
closeOneSide
Onesided closing of the channel
await channel.closeOneSide();
socket.send(JSON.stringify({
id: i++,
name: 'channel',
args: [channelId, 'closeOneSide']
}));