Skip to content

Commit

Permalink
feat(api): add support for witnetPriceFeeds contract
Browse files Browse the repository at this point in the history
Add support for networks using [WitnetFeeds contract](https://github.com/witnet/witnet-solidity-bridge/blob/2.0.x/contracts/apps/WitnetFeeds.sol):
- Implement the NetworkRouter class that handles all the communication with each network.
- Listen to the networks using the `WitnetPriceRouter` with `listenLegacyPriceRouter` and the new network using `WitnetFeeds` with `listenWitnetPriceFeeds`.
- Update the configuration file. The networks still using the old witnet price router are marked using `legacy: true` in the network configuration. Also, the file configuration has been updated to include the feed key. This new key consists of a map with the default values of the existing price feeds. According to that, the price feeds deployed using the default configuration have been deleted from the network feeds section. If a feed configuration appears in the network feeds, it will overwrite the default configuration. Now, we get all the available price feeds in a network called the [supportedFeeds](https://github.com/witnet/witnet-solidity-bridge/blob/2.0.x/contracts/interfaces/IFeeds.sol#L8) method.
  • Loading branch information
Tommytrg committed Apr 4, 2024
1 parent 1d12e23 commit 0d3af93
Show file tree
Hide file tree
Showing 27 changed files with 4,986 additions and 1,579 deletions.
2 changes: 1 addition & 1 deletion packages/api/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require('dotenv/config')
// require('dotenv/config')

module.exports = {
preset: 'ts-jest',
Expand Down
5 changes: 3 additions & 2 deletions packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,14 @@
"axios": "^1.3.6",
"dataloader": "2.2.2",
"dotenv": "^16.0.3",
"graphql": "^15.5.0",
"graphql-tag": "^2.12.6",
"jest": "^29.5.0",
"migrate-mongo": "^8.2.3",
"mongodb": "4.16.0",
"node-cache": "^5.1.2",
"web3": "^1.9.0",
"web3-utils": "^1.9.0",
"graphql": "^15.5.0"
"web3-eth-contract": "^1.10.0",
"web3-utils": "^1.9.0"
}
}
Loading

0 comments on commit 0d3af93

Please sign in to comment.