rpc static method
Implementation
static Future<dynamic> rpc(String method, List<dynamic> params) async {
final req = RequestBodyEntity();
req.chainId = await ParticleAuth.getChainId();
req.jsonrpc = "2.0";
req.id = getCurrentTimestamp();
req.method = method;
req.params = params;
final result = await SolanaRpcApi.getClient().rpc(req);
RpcResponse response = RpcResponse.fromJson(jsonDecode(result));
if (response.error != null) {
return Future.error(response.error!);
} else {
return response.result;
}
}