-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(api): periodically update API feeds from v2 contracts
- Loading branch information
Showing
13 changed files
with
1,175 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { FeedInfo } from '../../types' | ||
|
||
export class FeedsState { | ||
private legacyFeeds: Array<FeedInfo> | ||
private v2Feeds: Array<FeedInfo> | ||
|
||
constructor() { | ||
this.legacyFeeds = [] | ||
this.v2Feeds = [] | ||
} | ||
|
||
setV2Feeds(v2Feeds: Array<FeedInfo>) { | ||
this.v2Feeds = v2Feeds | ||
} | ||
|
||
setLegacyFeeds(legacyFeeds: Array<FeedInfo>) { | ||
this.legacyFeeds = legacyFeeds | ||
} | ||
|
||
getV2Feeds(): Array<FeedInfo> { | ||
return this.v2Feeds | ||
} | ||
|
||
getLegacyFeeds(): Array<FeedInfo> { | ||
return this.legacyFeeds | ||
} | ||
|
||
listFeeds(): Array<FeedInfo> { | ||
return [...this.legacyFeeds, ...this.v2Feeds] | ||
} | ||
} |
Oops, something went wrong.