def METHOD_NAME(self, method, params):
    rid = self._next_id
    self._next_id += 1
    body = {
        "jsonrpc": "2.0",
        "id": rid,
        "method": method,
        "params": params,
    }
    self._send(body)
    return self.read_message(want=lambda msg: msg.get("id") == rid)