getState function

Future<StateResponse> getState()

GET request to the /state endpoint. @returns {object} Response data with the current state of the coordinator

Implementation

Future<StateResponse> getState() async {
  final response = await extractJSON(await get(baseApiUrl, STATE_URL));
  final StateResponse stateResponse =
      StateResponse.fromJson(json.decode(response));
  return stateResponse;
  // Remove once hermez-node is ready
  /*state.network.nextForgers = [{
    coordinator: {
      URL: 'http://localhost:8086'
    }
  }];*/

  // state.withdrawalDelayer.emergencyMode = true
  // state.withdrawalDelayer.withdrawalDelay = 60
  // state.rollup.buckets[0].withdrawals = 0
}