Deprecated
This API is deprecated. Please see API Reference for the latest Price Feed API.
API reference for AggregatorInterface
.
Index
Functions
Name | Description |
---|---|
latestAnswer | Get the latest price. |
latestTimestamp | Get the time that the price feed was last updated. |
latestRound | Get the round id. |
getAnswer | Get the price from a specific round. |
getTimestamp | Get the timestamp of a specific round. |
Events
Name | Description |
---|---|
AnswerUpdated | Emitted when the answer is updated. |
NewRound | Emitted when a new round is started. |
Functions
latestAnswer
Get the latest price.
function latestAnswer() external view returns (int256)
RETURN
: The latest price.
latestTimestamp
Get the time that the price feed was last updated.
function latestTimestamp() external view returns (uint256)
RETURN
: The timestamp of the latest update.
latestRound
Get the round id, an unsigned integer representing that latest update that increments with every update.
function latestRound() external view returns (uint256)
RETURN
: The latest round id.
getAnswer
Get the price from a specific round.
function getAnswer(uint256 roundId) external view returns (int256)
roundId
: The round id.RETURN
: The price from that round.
getTimestamp
Get the timestamp of a specific round.
function getTimestamp(uint256 roundId) external view returns (uint256)
roundId
: The round id.RETURN
: The timestamp from that round.
Events
AnswerUpdated
Emitted when the answer is updated.
event AnswerUpdated(int256 indexed current, uint256 indexed roundId, uint256 timestamp)
current
: The updated price.roundId
: The round id.timestamp
: The time at which the answer was updated.
NewRound
Emitted when a new round is started.
event NewRound(uint256 indexed roundId, address indexed startedBy, uint256 startedAt)
roundId
: The new round id.startedBy
: The address which starts the new round.startedAt
: The time the new round was started.
Updated 6 months ago