API Version: v0.2.2 Not using latest version (v0.2.3)

AggregatorInterface v0.2.2 API Reference

AggregatorInterface

An interface that defines the standard methods for accessing price feed data from an aggregator contract.

AggregatorInterface

Events

AnswerUpdated

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

Parameters

ParameterTypeDescription
currentint256The updated answer
roundIduint256The round ID for which the answer was updated
updatedAtuint256The timestamp when the answer was updated

NewRound

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

Parameters

ParameterTypeDescription
roundIduint256The round ID of the new round
startedByaddressThe address of the account that started the round
startedAtuint256The timestamp when the round was started

Functions

getAnswer

Retrieves the price answer for a specific round.

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

Parameters

ParameterTypeDescription
roundIduint256The round ID to get the answer for

Returns

ParameterTypeDescription
(unnamed)int256The answer for the given round ID

getTimestamp

Retrieves the timestamp for a specific round.

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

Parameters

ParameterTypeDescription
roundIduint256The round ID to get the timestamp for

Returns

ParameterTypeDescription
(unnamed)uint256The timestamp for the given round ID

latestAnswer

Retrieves the most recent price answer.

function latestAnswer() external view returns (int256)

Returns

ParameterTypeDescription
(unnamed)int256The latest answer

latestRound

Retrieves the most recent round ID.

function latestRound() external view returns (uint256)

Returns

ParameterTypeDescription
(unnamed)uint256The latest round ID

latestTimestamp

Retrieves the timestamp of the most recent answer.

function latestTimestamp() external view returns (uint256)

Returns

ParameterTypeDescription
(unnamed)uint256The timestamp of the latest answer

Get the latest Chainlink content straight to your inbox.