AggregatorV3Interface v0.2.8 API Reference
AggregatorV3Interface
Extended price feed interface.
Functions
decimals
function decimals() external view returns (uint8)
Gets the number of decimals used by the aggregator.
Returns
| Name | Type | Description |
|---|---|---|
| [0] | uint8 | uint8 - The number of decimals. |
description
function description() external view returns (string)
Gets the description of the aggregator.
Returns
| Name | Type | Description |
|---|---|---|
| [0] | string | string memory - The description of the aggregator. |
getRoundData
function getRoundData(uint80 _roundId) external view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)
Gets the round data for a specific round ID.
This function should raise "No data present" if no data is available for the given round ID.
Parameters
| Name | Type | Description |
|---|---|---|
| _roundId | uint80 | - The round ID to get the data for. |
Returns
| Name | 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
function latestRoundData() external view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)
Gets the latest round data.
This function should raise "No data present" if no data is available.
Returns
| Name | 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
function version() external view returns (uint256)
Gets the version of the aggregator.
Returns
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | uint256 - The version of the aggregator. |