Skip to content
On this page
Reference → dAPIs → Understanding dAPIs
SearchHighlight.vue
FLEX_START_TAG

IProxy interface

For every self-funded dAPI there is a single publicly available proxy contract that reads the dAPI's data (value int224, timestamp uint256). You do not access the proxy contract directly but rather use the IProxy interface. The IProxy interface is part of the npm package @api3/contracts➚.

IProxy interface contracts

For each version of Solidity supported there is an associated IProxy contract. This ensures that the interface can handle any necessary differences in the Solidity releases. You simply import the required IProxy interface contract accordingly.

solidity
// imports for Solidity versions 6x, 7x, and 8x
import "@api3/contracts/v0.6/interfaces/IProxy.sol";
import "@api3/contracts/v0.7/interfaces/IProxy.sol";
import "@api3/contracts/v0.8/interfaces/IProxy.sol";

You can also see the available Solidity specific IProxy contracts in the API3 repo api3dao/contracts➚.

Usage

Use the address of a proxy contract to read dAPIs with IProxy. See the guide Reading a self-funded dAPI proxy for a complete working example. Proxy contract addresses are available on the API3 Market➚.

import "@api3/contracts/v0.8/interfaces/IProxy.sol";
...
(value, timestamp) = IProxy(proxyAddress).read();
FLEX_END_TAG

Released under the MIT License.