send method
Implementation
Stream<dynamic> send(dynamic data) {
final client = setupClient();
final controller = StreamController(
onCancel: () {
final cancel = {
"jsonrpc": "2.0",
"method": "suix_unsubscribeEvent",
"params": [requestIdToSubscriptionId[data["id"]]]
};
client.sink.add(cancel);
}
);
streams[data['id']] = controller;
final sendData = jsonEncode(data);
client.sink.add(sendData);
return controller.stream;
}