PythFacade

PythFacade

Git Source

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

State Variables

dataFeed

Interface / Address of a deployed Warlock DataFeed.

IDataFeed public immutable dataFeed;

admin

The address of the approved pair registrar admin.

address public admin;

pairs

mapping(bytes32 => Pair) public pairs;

Functions

constructor

constructor(address _dataFeed);

chainId

function chainId() external view returns (uint256);

registerPair

function registerPair(bytes32 id, address base, address asset) external;

priceFeedExists

function priceFeedExists(bytes32 id) external view returns (bool);

getPrice

function getPrice(bytes32 id) external view returns (PythPrice memory);

getPriceUnsafe

function getPriceUnsafe(bytes32 id) external view returns (PythPrice memory);

getPriceNoOlderThan

function getPriceNoOlderThan(bytes32 id, uint256 maxAge) external view returns (PythPrice memory);

latestPriceInfoPublishTime

function latestPriceInfoPublishTime(bytes32 id) external view returns (uint256);

Authorized

modifier Authorized(address a);

Structs

Pair

struct Pair {
    address asset;
    address base;
}

PythPrice

struct PythPrice {
    int64 price;
    uint64 conf;
    int32 expo;
    uint256 publishTime;
}

Last updated