Map<String, dynamic> toJson() { return { 'id': id, 'method': methodToString[method], 'params': params, }; }