getRpcCall static method

Future<Map> getRpcCall(
  1. String endpoint,
  2. Map payload
)

Implementation

static Future<Map> getRpcCall(String endpoint, Map payload) async {
  final url = '$endpoint';
  try {
    final res = await post(Uri.parse(url),
        body: jsonEncode(payload), headers: post_headers);
    return jsonDecode(utf8.decode(res.bodyBytes)) as Map;
  } catch (err) {
    print(err);
    return {};
  }
}