ChainlinkFacade

ChainlinkFacade

Git Source

A facade for the integrators expecting the interfaces of a Chainlink data feed.

This facade also covers the interfaces of Redstone's data feed (which are Chainlink compatible).

State Variables

dataFeed

Interface / Address of a deployed Warlock DataFeed.

IDataFeed public immutable dataFeed;

base

The base asset address.

address public immutable base;

asset

The asset address.

address public immutable asset;

Functions

constructor

constructor(address _dataFeed, address _base, address _asset);

latestTimestamp

Returns the latest updated timestamp.

function latestTimestamp() external view returns (uint256);

Returns

Name
Type
Description

<none>

uint256

The latest updated timestamp

latestRound

Returns the latest round's nonce.

function latestRound() external view returns (uint80);

Returns

Name
Type
Description

<none>

uint80

The latest round's nonce

latestAnswer

Returns the latest price.

function latestAnswer() external view returns (int256);

Returns

Name
Type
Description

<none>

int256

The latest price

latestRoundData

Returns the latest price data.

function latestRoundData() external view returns (uint80, int256, uint256, uint256, uint80);

Returns

Name
Type
Description

roundId

uint80

The round ID

answer

int256

The latest price

startedAt

uint256

Timestamp of when the round started

updatedAt

uint256

Timestamp of when the round was updated

answeredInRound

uint80

Previously used when answers could take multiple rounds to be computed

getAnswer

Returns the historic price for a given nonce.

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

Parameters

Name
Type
Description

roundId

uint256

The nonce of the historic price

Returns

Name
Type
Description

<none>

int256

The historic price data

getTimestamp

Returns the timestamp for a given nonce.

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

Parameters

Name
Type
Description

roundId

uint256

The nonce of the historic price data

Returns

Name
Type
Description

<none>

uint256

The timestamp for a given nonce

getRoundData

Returns the historic price data for a given nonce.

function getRoundData(uint128 roundId) external view returns (uint80, int256, uint256, uint256, uint80);

Parameters

Name
Type
Description

roundId

uint128

The nonce of the historic price data

Returns

Name
Type
Description

roundId

uint80

he round ID

answer

int256

The historic price data

startedAt

uint256

Timestamp of when the round started

updatedAt

uint256

Timestamp of when the round was updated

answeredInRound

uint80

Previously used when answers could take multiple rounds to be computed

Last updated