getBids function

Future<String> getBids(
  1. int slotNum,
  2. String bidderAddr,
  3. int fromItem
)

GET request to the /bids endpoint. Returns a list of bids @param {int} slotNum - Filter by slot @param {String} bidderAddr - Filter by coordinator @param {int} fromItem - Item from where to start the request @returns {Object} Response data with the list of slots

Implementation

Future<String> getBids(int slotNum, String bidderAddr, int fromItem) async {
  Map<String, String> params = {};
  params.putIfAbsent('slotNum', () => slotNum > 0 ? slotNum.toString() : '');
  params.putIfAbsent(
      'bidderAddr', () => bidderAddr.isNotEmpty ? bidderAddr : '');
  params.putIfAbsent('fromItem', () => fromItem > 0 ? fromItem.toString() : '');

  return extractJSON(await get(baseApiUrl, BIDS_URL, queryParameters: params));
}