killSession method
Kill the current session. https://docs.walletconnect.com/client-api#kill-session-disconnect
Implementation
Future killSession({String? sessionError}) async {
final message = sessionError ?? 'Session disconnected';
final request = JsonRpcRequest(
id: payloadId,
method: 'wc_sessionUpdate',
params: [
{
'approved': false,
'chainId': null,
'networkId': null,
'accounts': null,
}
],
);
unawaited(_sendRequest(request));
await _handleSessionDisconnect(errorMessage: message, forceClose: true);
}