getConsensusConstants method

Future<ConsensusConstants> getConsensusConstants()

Get consensus constants used by the node

Implementation

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