Tellor Docs V2
  • The Basics
    • Welcome
    • Fundamentals
    • Contracts Overview
    • Contracts Reference
  • Getting Data
    • Introduction
    • Creating a Query
    • Reading Data
      • Tellor Playground
    • Funding a Feed
    • Tellor Functions
  • Reporting Data
    • Introduction
    • Becoming a Reporter
      • Staking / Unstaking
      • Submitting Values
    • Getting Paid
    • Setting up New Chains
  • Disputing Data
    • Introduction
    • Monitoring
    • How to Dispute
    • Voting/Resolution
  • Vulnerability Disclosure
Powered by GitBook
On this page
Edit on GitHub
  1. Getting Data

Tellor Functions

PreviousFunding a FeedNextIntroduction

Last updated 2 years ago

Available Tellor Functions

When your contract inherits the helper contract, it has access to the following functions:

function retrieveData(bytes32 _queryId, uint256 _timestamp)
        public
        view
        returns (bytes memory);
  • Retrieves a specific value by queryId and timestamp

function isInDispute(bytes32 _queryId, uint256 _timestamp)
        public
        view
        returns (bool);
  • Determines whether a specific value with a given queryId and timestamp has been disputed

function getNewValueCountbyQueryId(bytes32 _queryId)
        public
        view
        returns (uint256);
  • Returns the total number of values submitted for a given queryId

function getTimestampbyQueryIdandIndex(bytes32 _queryId, uint256 _index)
        public
        view
        returns (uint256);
  • Returns the timestamp at a specific index for a given queryId.

  • Values start at the 0 index.

function getCurrentValue(bytes32 _queryId)
        public
        view
        returns (
            bool _ifRetrieve,
            bytes memory _value,
            uint256 _timestampRetrieved
        );
  • Finds the most recent submission for a given queryId and returns three things: a boolean for whether a value was found, the value itself, and the timestamp of the value

  • Note that this function should not be used in most cases since it does not include a dispute buffer time. See below.

function getDataBefore(bytes32 _queryId, uint256 _timestamp)
        public
        view
        returns (
            bool _ifRetrieve,
            bytes memory _value,
            uint256 _timestampRetrieved
        );
  • Finds the most recent submission for a given queryId before a specific timestamp

It is recommended that you use this function with a buffer time when retrieving oracle values. This for bad values to be disputed.

usingtellor
allows time