Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 3 additions & 15 deletions apps/insights/src/components/PriceFeeds/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,21 +210,9 @@ const filterFeeds = <T extends { symbol: string }>(
feeds: T[],
symbols: string[],
): T[] =>
symbols.map((symbol) => {
const feed = feeds.find((feed) => feed.symbol === symbol);
if (feed) {
return feed;
} else {
throw new NoSuchFeedError(symbol);
}
});
symbols
.map((symbol) => feeds.find((feed) => feed.symbol === symbol))
.filter((feed) => feed !== undefined);

const isActive = (feed: { price: { minPublishers: number } }) =>
feed.price.minPublishers <= 50;

class NoSuchFeedError extends Error {
constructor(symbol: string) {
super(`No feed exists named ${symbol}`);
this.name = "NoSuchFeedError";
}
}
2 changes: 1 addition & 1 deletion apps/insights/src/static-data/price-feeds.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ export const priceFeeds = {
"Commodities.WTI1M",
"Crypto.1INCH/USD",
],
featuredComingSoon: ["Crypto.ION/USD", "Equity.NL.BCOIN/USD"],
featuredComingSoon: ["Rates.US1Y"],
};
Loading