oID - Oracle recipe
1
pragma solidity 0.5.16;
2
3
/// @title Opium.Interface.IOracleId contract is an interface that every oracleId should implement
4
interface IOracleId {
5
/// @notice Requests data from `oracleId` one time
6
/// @param timestamp uint256 Timestamp at which data are needed
7
function fetchData(uint256 timestamp) external payable;
8
9
/// @notice Requests data from `oracleId` multiple times
10
/// @param timestamp uint256 Timestamp at which data are needed for the first time
11
/// @param period uint256 Period in seconds between multiple timestamps
12
/// @param times uint256 How many timestamps are requested
13
function recursivelyFetchData(uint256 timestamp, uint256 period, uint256 times) external payable;
14
15
/// @notice Requests and returns price in ETH for one request. This function could be called as `view` function. Oraclize API for price calculations restricts making this function as view.
16
/// @return fetchPrice uint256 Price of one data request in ETH
17
function calculateFetchPrice() external returns (uint256 fetchPrice);
18
19
// Event with oracleId metadata JSON string (for DIB.ONE derivative explorer)
20
event MetadataSet(string metadata);
21
}
22
Copied!
Last modified 1yr ago
Copy link