subscribe method
Send arbitrary message to RPC node
Implementation
@override
Future<SubscriptionResponse> subscribe(String method, List<dynamic> params,
{FutureOr<void> Function(String subscription)? onCancel}) async {
final result = await send(method, params);
if (result.error != null) {
throw Exception(result.error.toString());
}
final subscription = result.result as String;
final controller = getOrCreateSubscriptionController(subscription);
return SubscriptionResponse(
id: subscription,
stream: controller.stream,
);
}