getJsonRPCResult method

dynamic getJsonRPCResult(
  1. String body
)
inherited

Implementation

dynamic getJsonRPCResult(String body) {
  final jsonResponse = json.decode(body);
  if (jsonResponse.containsKey('error')) {
    throw ArchethicJsonRPCException(
      code: jsonResponse['error']['code'] ?? jsonResponse['error']['code'],
      message: jsonResponse['error']['message'] ??
          jsonResponse['error']['message'],
      data: jsonResponse['error']['data'] ?? jsonResponse['error']['data'],
    );
  }
  return jsonResponse['result'];
}