send method
Send arbitrary message to RPC node
Implementation
@override
Future<RpcResponse> send(String method, List<dynamic> params) async {
final response = await http.post(url,
body: jsonEncode(
{
'id': (++_sequence).toString(),
'jsonrpc': '2.0',
'method': method,
'params': params,
},
),
headers: {'Content-Type': 'application/json'});
final data = jsonDecode(response.body);
return RpcResponse(
id: int.tryParse(data['id'].toString()) ?? -1,
result: data['result'],
error: data['error'],
);
}