Settle Payments and Close Channels
Closing a channel will settle the balance between you and your peer. This means that both of you will receive your net balance of tokens back on-chain and the balance of the channel will be 0.
You can choose to either:
Close a specific channel
Closing a specific channel is done with a PATCH request to the channels
endpoint that includes:
The token address as a path parameter.
The address of the partner node as a path parameter.
The state set to "closed" in the body parameter.
A successful response will return a normal channel object with the state set to "closed"
.
The settle timeout period will start as soon as a channel is closed and the channel is settled once the settle timeout period is over. The state of the channel will then be changed tosettled
.
Leave a token network and close all channels
If you wish to leave a token network altogether you can do so by making a DELETE request to the connections endpoint with the token address as a path parameter.
Once done, the response will return a list containing the addresses of all closed channels.
Please note that leaving a token network will take some time since you need to wait for the settle timeout to expire for each channel before a settle can happen.
Last updated
Was this helpful?