AggregatorInterface v0.3.0 API Reference
AggregatorInterface
Basic price feed interface.
Events
AnswerUpdated
Emitted when the answer is updated.
event AnswerUpdated(int256 indexed current, uint256 indexed roundId, uint256 updatedAt);
Parameters
| Name | Type | Description |
|---|---|---|
current | int256 | - The updated answer. |
roundId | uint256 | - The round ID for which the answer was updated. |
updatedAt | uint256 | - The timestamp when the answer was updated. |
NewRound
Emitted when a new round is started.
event NewRound(uint256 indexed roundId, address indexed startedBy, uint256 startedAt);
Parameters
| Name | Type | Description |
|---|---|---|
roundId | uint256 | - The round ID of the new round. |
startedBy | address | - The address of the account that started the round. |
startedAt | uint256 | - The timestamp when the round was started. |
Functions
getAnswer
Gets the answer for a specific round ID.
function getAnswer(uint256 roundId) external view returns (int256);
Parameters
| Name | Type | Description |
|---|---|---|
roundId | uint256 | - The round ID to get the answer for. |
Returns
| Name | Type | Description |
|---|---|---|
<none> | int256 | int256 - The answer for the given round ID. |
getTimestamp
Gets the timestamp for a specific round ID.
function getTimestamp(uint256 roundId) external view returns (uint256);
Parameters
| Name | Type | Description |
|---|---|---|
roundId | uint256 | - The round ID to get the timestamp for. |
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256 | uint256 - The timestamp for the given round ID. |
latestAnswer
Gets the latest answer from the aggregator.
function latestAnswer() external view returns (int256);
Returns
| Name | Type | Description |
|---|---|---|
<none> | int256 | int256 - The latest answer. |
latestRound
Gets the latest round ID from the aggregator.
function latestRound() external view returns (uint256);
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256 | uint256 - The latest round ID. |
latestTimestamp
Gets the timestamp of the latest answer from the aggregator.
function latestTimestamp() external view returns (uint256);
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256 | uint256 - The timestamp of the latest answer. |