updateSession method

Future<void> updateSession({
  1. List<String>? accounts,
  2. int? chainId,
  3. bool approved = true,
})

Implementation

Future<void> updateSession({
  List<String>? accounts,
  int? chainId,
  bool approved = true,
}) async {
  _chainId = chainId ?? _chainId;
  final param = WCSessionUpdate(
    approved: approved,
    chainId: _chainId,
    accounts: accounts,
  );
  final request = JsonRpcRequest(
    id: DateTime.now().millisecondsSinceEpoch,
    method: WCMethod.SESSION_UPDATE,
    params: [param.toJson()],
  );
  return _encryptAndSend(jsonEncode(request.toJson()));
}