getReceivedDocuments static method

Future<List<CommercioDoc>> getReceivedDocuments({
  1. required String address,
  2. required NetworkInfo networkInfo,
  3. Client? client,
})

Returns the list of all the CommercioDoc that the specified address has been received.

Implementation

static Future<List<CommercioDoc>> getReceivedDocuments({
  required String address,
  required NetworkInfo networkInfo,
  http.Client? client,
}) async {
  final url = Uri.parse('${networkInfo.lcdUrl}/docs/$address/received');
  final response = await Network.queryChain(url, client: client) as List;

  return response.map((json) => CommercioDoc.fromJson(json)).toList();
}