API Version: v0.2.8 Not using latest version (v0.3.1)

AggregatorInterface v0.2.8 API Reference

AggregatorInterface

Basic price feed interface.

AggregatorInterface

Events

AnswerUpdated

event AnswerUpdated(int256 current, uint256 roundId, uint256 updatedAt)

Emitted when the answer is updated.

Parameters

NameTypeDescription
currentint256- The updated answer.
roundIduint256- The round ID for which the answer was updated.
updatedAtuint256- The timestamp when the answer was updated.

NewRound

event NewRound(uint256 roundId, address startedBy, uint256 startedAt)

Emitted when a new round is started.

Parameters

NameTypeDescription
roundIduint256- The round ID of the new round.
startedByaddress- The address of the account that started the round.
startedAtuint256- The timestamp when the round was started.

Functions

getAnswer

function getAnswer(uint256 roundId) external view returns (int256)

Gets the answer for a specific round ID.

Parameters

NameTypeDescription
roundIduint256- The round ID to get the answer for.

Returns

NameTypeDescription
[0]int256int256 - The answer for the given round ID.

getTimestamp

function getTimestamp(uint256 roundId) external view returns (uint256)

Gets the timestamp for a specific round ID.

Parameters

NameTypeDescription
roundIduint256- The round ID to get the timestamp for.

Returns

NameTypeDescription
[0]uint256uint256 - The timestamp for the given round ID.

latestAnswer

function latestAnswer() external view returns (int256)

Gets the latest answer from the aggregator.

Returns

NameTypeDescription
[0]int256int256 - The latest answer.

latestRound

function latestRound() external view returns (uint256)

Gets the latest round ID from the aggregator.

Returns

NameTypeDescription
[0]uint256uint256 - The latest round ID.

latestTimestamp

function latestTimestamp() external view returns (uint256)

Gets the timestamp of the latest answer from the aggregator.

Returns

NameTypeDescription
[0]uint256uint256 - The timestamp of the latest answer.

Get the latest Chainlink content straight to your inbox.