chore(price-feed): added update parameters as a column in each table for EVM#739
chore(price-feed): added update parameters as a column in each table for EVM#739nidhi-singh02 merged 10 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
| Update Parameters for BOLD: **1 hour heartbeat or 0.5% price deviation** | ||
|
|
||
| Update Parameters for the other assets: **1 hour heartbeat or 2% price deviation** |
There was a problem hiding this comment.
This is redundant now and can be removed. Same applies to other places in the file.
Signed-off-by: nidhi-singh02 <nidhi2894@gmail.com>
f5d8d43 to
0a723fc
Compare
Signed-off-by: nidhi-singh02 <nidhi2894@gmail.com>
cprussin
left a comment
There was a problem hiding this comment.
important stuff LGTM, mostly nits / minor suggestions that I think may make the code a bit easier to maintain
| const paramCounts = feeds.reduce((acc, feed) => { | ||
| acc[feed.updateParameters] = (acc[feed.updateParameters] || 0) + 1; | ||
| return acc; | ||
| }, {} as Record<string, number>); |
There was a problem hiding this comment.
Super minor nit but I tend to find this kind of thing is more easy to understand when implemented as:
const paramCounts = Object.fromEntries(
Object
.entries(Object.groupBy(feeds, feed => feed.updateParameters))
.map(([updateParameters, feeds]) => [updateParameters, feeds.length])
)I will also typically create a mapValues helper (which really should be in the ES standard IMO and probably will be eventually) which I use all the time and makes the code more concise:
const paramCounts = mapValues(
Object.groupBy(feeds, feed => feed.updateParameters)),
feeds => feeds.length
)For some reason, reduce seems to be a hard operation for a lot of folks to easily grok so I've started to move away from using it except in very specific scenarios. Here is a decent writeup for an eslint rule that I use nowadays that has some links to some threads on the topic.
There was a problem hiding this comment.
Interesting, I have created a utility file for object called "ObjectHelpers" in the utils folder so can be used across.
I will see to add a linter rule as well, good idea and thanks for sharing the reference that really helps.
for ensuring Object.groupBy can be used, had to increase the typescript version as it was not present in older versions.
There was a problem hiding this comment.
For what it's worth, I maintain canned eslint and typescript configs which we use across most node packages here, and I try to keep things in the main monorepo up to date, which applies to a pretty large bulk of our Node work. However, this docs repo is just an old repo and we've been planning to replace the docs app for a long time, so it's in a bit of a weird state.
There was a problem hiding this comment.
Perfect! Thanks a lot for sharing this. Yeah, I will import these config in my local and gonna make sure if we have these same config applicable to this documentation repo.
Signed-off-by: nidhi-singh02 <nidhi2894@gmail.com>
Description
Earlier the update parameters were mentioned at the top for each of the chain, which was not easy to refer if you are at a particular asset in the list and the table is large.
Added a new column for "Update parameters" makes it easy for developers to access it readily.
Type of Change
Areas Affected
This page is being modified https://docs.pyth.network/price-feeds/sponsored-feeds/evm
Checklist
pre-commit run --all-filesto check for linting errorsRelated Issues
Closes #
Additional Notes
Contributor Information
Screenshots
Updated one:
