Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: coingecko pricing provider #3

Merged
merged 3 commits into from
Oct 8, 2024
Merged

Conversation

0xnigir1
Copy link
Collaborator

@0xnigir1 0xnigir1 commented Oct 8, 2024

🤖 Linear

Closes GIT-67

Description

  • add pricing package with CoingeckoProvider
  • generic interface IPricingProvider for future extensibility

Checklist before requesting a review

  • I have conducted a self-review of my code.
  • I have conducted a QA.
  • If it is a core feature, I have included comprehensive tests.

Copy link

linear bot commented Oct 8, 2024

0xkenj1
0xkenj1 previously approved these changes Oct 8, 2024
Copy link
Collaborator

@0xyaco 0xyaco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! Just one minor comment and some miscellaneous ones

"scripts": {
"build": "tsc -p tsconfig.build.json",
"check-types": "tsc --noEmit -p ./tsconfig.json",
"clean": "rm -rf dist",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just as a bonus, if you add a trailing slash you are forcing rm to remove a dist folder (if it's a dist file it's not removed):

Suggested change
"clean": "rm -rf dist",
"clean": "rm -rf dist/",

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can add this to the boilerplate

baseURL,
headers: {
common: {
[authHeader]: apiKey,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just in case asking, does the apiKey expire?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noup, it's long lived

Comment on lines +92 to +93
const startTimestampSecs = Math.floor(startTimestampMs / 1000);
const endTimestampSecs = Math.floor(endTimestampMs / 1000);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if start > end? No results? API failure?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aaa good catch, will add that validation

@0xnigir1 0xnigir1 merged commit b4efee3 into dev Oct 8, 2024
6 checks passed
@0xnigir1 0xnigir1 deleted the feat/coingecko-pricing-provider branch October 8, 2024 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants