inventory method

Future inventory(
  1. Map<String, dynamic> inventoryItem
)

The inventory method is used to submit transactions.

Implementation

Future<dynamic> inventory(Map<String, dynamic> inventoryItem) async {
  try {
    var response = await sendMessage(
            formatRequest(method: 'inventory', params: inventoryItem))
        .then((Map<String, dynamic> data) {
      if (data.containsKey('error')) {
        throw NodeException.fromJson(data['error']);
      }
    });
    return response;
  } on NodeException catch (e) {
    print("${e.message}");
    return false;
  }
}