AggregatorV3Interface v0.2.2 API Reference
AggregatorV3Interface
An interface for accessing detailed price feed data and metadata from an aggregator contract, providing enhanced functionality for retrieving round data and contract information.
Functions
decimals
Retrieves the number of decimal places used by the aggregator.
function decimals() external view returns (uint8)
Returns
Parameter | Type | Description |
---|---|---|
(unnamed) | uint8 | The number of decimals |
description
Retrieves the description of the aggregator.
function description() external view returns (string memory)
Returns
Parameter | Type | Description |
---|---|---|
(unnamed) | string | The description of the aggregator |
getRoundData
Retrieves the complete round data for a specific round ID.
function getRoundData(uint80 _roundId) external view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)
Parameters
Parameter | Type | Description |
---|---|---|
_roundId | uint80 | The round ID to get the data for |
Returns
Parameter | Type | Description |
---|---|---|
roundId | uint80 | The round ID |
answer | int256 | The answer for the round |
startedAt | uint256 | The timestamp when the round started |
updatedAt | uint256 | The timestamp when the round was updated |
answeredInRound | uint80 | The round ID in which the answer was computed |
latestRoundData
Retrieves the complete round data for the most recent round.
function latestRoundData() external view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)
Returns
Parameter | Type | Description |
---|---|---|
roundId | uint80 | The latest round ID |
answer | int256 | The latest answer |
startedAt | uint256 | The timestamp when the latest round started |
updatedAt | uint256 | The timestamp when the latest round was updated |
answeredInRound | uint80 | The round ID in which the latest answer was computed |
version
Retrieves the version number of the aggregator.
function version() external view returns (uint256)
Returns
Parameter | Type | Description |
---|---|---|
(unnamed) | uint256 | The version of the aggregator |