sendTx function

dynamic sendTx(
  1. dynamic tx,
  2. String endpoint
)

Implementation

dynamic sendTx(tx, String endpoint) async {
  final Map<String, String> requestHeaders = {
    'Content-type': 'application/json',
    'Accept': 'application/json',
  };

  http.Response responseHttp = await http.post(
      Uri.parse(endpoint + "/api/transaction"),
      body: json.encode(tx),
      headers: requestHeaders);

  return json.decode(responseHttp.body);
}