getOracleData method

Future<OracleUcoPrice> getOracleData({
  1. int timestamp = 0,
})

Returns a value of Oracle Uco_Price in {OracleUcoPrice} from a timestamp.

if timestamp = 0 or not precised, the last price is returned.

Implementation

Future<OracleUcoPrice> getOracleData({int timestamp = 0}) async {
  try {
    final result = await _archethicOracle.getOracleData(timestamp: timestamp);
    _logger.fine('getOracleData: $result');
    return result;
  } catch (e, stack) {
    _logger.severe(
      'getOracleData failed',
      e,
      stack,
    );
    return const OracleUcoPrice();
  }
}