Skip to content

api3dao/data-feed-reader-example

Repository files navigation

API3 data feed reader example

An example project that reads an API3 data feed

Instructions

  • Install dependencies
yarn
  • Create a .env file similar to example.env
echo 'MNEMONIC="bike north stone..."' > .env
  • Go to market.api3.org and find a data feed you like
  • If the data feed is not already activated, purchase a subscription
  • On the data feed page, click the Integrate button and copy the address of the proxy
  • Deploy DataFeedReaderExample by using the command below with your NETWORK and PROXY values. See the supported networks section for valid NETWORK values.
NETWORK=ethereum-sepolia-testnet PROXY=0x1A4eE81BBbb479f3923f22E315Bc2bD1f6d5d180 yarn deploy
  • Have DataFeedReaderExample read from the proxy by using the command below with your NETWORK value
NETWORK=ethereum-sepolia-testnet yarn read-data-feed

Supported networks

Chains listed on market.api3.org are all supported. You can run the following command to list them.

yarn print-supported-chains

Local development and testing

@api3/contracts provides a MockProxy contract for local development. See the tests for its usage, and run the tests with the following command.

yarn test

More?

See the advanced instructions.

About

An example project for reading API3 data feeds

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published