IRedstonePriceFeedsAdapter
Title: IRedstonePriceFeedsAdapter
Author: Vendored minimal subset of RedStone (https://github.com/redstone-finance/redstone-oracles-monorepo).
Upstream license: unknown (no matching file in the linked monorepo, whose root license is BUSL-1.1).
Minimal interface for a RedStone Push PriceFeedsAdapter contract.
Vendored subset — do not add a redstone dependency. RedStone's Push model stores signed values
on-chain (updated in batches); a consumer reads the stored value for a dataFeedId and the
timestamps of the latest update. Values are reported with 8 decimals; dataTimestamp is in
milliseconds (the off-chain data time) while blockTimestamp is in seconds (the on-chain update
time used for staleness).
Functions
getValueForDataFeed
Returns the latest stored value for a RedStone data feed.
function getValueForDataFeed(bytes32 dataFeedId) external view returns (uint256 value);Parameters
| Name | Type | Description |
|---|---|---|
| dataFeedId | bytes32 | The RedStone data-feed id (e.g. bytes32("ETH")). |
Returns
| Name | Type | Description |
|---|---|---|
| value | uint256 | The stored value, scaled to 8 decimals. |
getTimestampsFromLatestUpdate
Returns the timestamps of the latest batch update.
function getTimestampsFromLatestUpdate() external view returns (uint128 dataTimestamp, uint128 blockTimestamp);Returns
| Name | Type | Description |
|---|---|---|
| dataTimestamp | uint128 | The off-chain data timestamp, in milliseconds. |
| blockTimestamp | uint128 | The on-chain update timestamp, in seconds. |