-
Notifications
You must be signed in to change notification settings - Fork 36
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: add AlchemyProvider class #205
feat: add AlchemyProvider class #205
Conversation
WOW YES. I think it needs an integration test and then it's ready @jtfirek 🙏 Would you be able to include a jest test which pulls in the Etherscan API key for a mainnet account from |
Yea I can work on that now @dawsbot ! |
Something very basic which fetches the current block is plenty to test! |
Wouldn't we need an alchemy api key over an etherscan api key to initialize an alchemy provider instance @dawsbot ? Also I don't see any api keys in the .env, just an RPC_ORIGIN url. |
Codecov ReportPatch coverage:
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more Additional details and impacted files@@ Coverage Diff @@
## master #205 +/- ##
==========================================
+ Coverage 90.67% 90.74% +0.06%
==========================================
Files 40 41 +1
Lines 1019 1026 +7
Branches 289 290 +1
==========================================
+ Hits 924 931 +7
Misses 85 85
Partials 10 10
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
.env
Outdated
@@ -1,2 +1,3 @@ | |||
RPC_ORIGIN=https://free-eth-node.com | |||
# RPC_ORIGIN=http://localhost:3000 | |||
ALCHEMY_API_KEY=kwIkw24q335k05WBuFXBmT3W-P5luv4g |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yikes, this will be botted and spent a ton of $ on immediately @jtfirek
This needs to live in a place that is gitignored, so it never sees the eyes of the public internet. Go cancel this API key immediately. I'll take care of adding it properly to an ignored part of the codebase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for bringing this to my attention @dawsbot! I canceled the API key and will make my own env with the using the .env.example
you created!
src/providers/AlchemyProvider.ts
Outdated
@@ -0,0 +1,37 @@ | |||
import { BaseProvider } from './BaseProvider'; | |||
|
|||
export class AlchemyProvider extends BaseProvider { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can do this entire thing in just 5 lines by extending JsonRpcProvider
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea this was overengineering @jtfirek. This does the same:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted @dawsbot! that's much more simplified
Co |
Closes #186?