sendTx function
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);
}