-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New Components - alchemy #14470
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
New Components - alchemy #14470
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
WalkthroughThis pull request introduces significant changes to the Alchemy component, including the addition of new application logic, constants, and a module for handling GraphQL queries. A new file Changes
Assessment against linked issues
Possibly related PRs
Suggested labels
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 6
🧹 Outside diff range and nitpick comments (3)
components/alchemy/common/constants.mjs (2)
1-36
: Consider standardizing network naming conventions and improving organization.The network identifiers could benefit from:
- Consistent naming patterns (e.g.,
ETH_MAINNET
vsMATICMAINNET
)- Grouping related networks together (mainnet/testnet pairs)
Consider reorganizing like this:
const NETWORKS = [ // Ethereum "ETH_MAINNET", "ETH_SEPOLIA", "ETH_HOLESKY", // Arbitrum "ARB_MAINNET", "ARB_SEPOLIA", "ARB_NOVA_MAINNET", // Polygon "MATIC_MAINNET", "MATIC_MUMBAI", // ... continue for other chains ];
38-77
: Add documentation for the GraphQL query template.The
FULL_BLOCK_RECEIPTS
query would benefit from:
- JSDoc comments explaining its purpose and usage
- Documentation for the empty filter arrays in the logs query
- Information about which fields are required vs optional
Consider adding documentation like this:
+/** + * GraphQL query template for retrieving full block receipts with transaction details. + * Used by the Alchemy webhook service to monitor blockchain events. + * + * @remarks + * - The logs filter arrays (addresses and topics) are empty by default + * - Includes comprehensive transaction details including gas metrics and contract creation + */ const FULL_BLOCK_RECEIPTS = `components/alchemy/alchemy.app.mjs (1)
4-6
: Consider adding a version property.Adding a version property to the app definition would help with tracking and maintaining compatibility.
export default { type: "app", app: "alchemy", + version: "0.0.1",
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (6)
components/alchemy/.gitignore
(0 hunks)components/alchemy/alchemy.app.mjs
(1 hunks)components/alchemy/app/alchemy.app.ts
(0 hunks)components/alchemy/common/constants.mjs
(1 hunks)components/alchemy/package.json
(1 hunks)components/alchemy/sources/new-graphql-query-instant/new-graphql-query-instant.mjs
(1 hunks)
💤 Files with no reviewable changes (2)
- components/alchemy/.gitignore
- components/alchemy/app/alchemy.app.ts
🔇 Additional comments (6)
components/alchemy/package.json (2)
3-5
: Version bump and entry point changes look appropriate.
The minor version bump (0.1.0) aligns well with the addition of new webhook functionality. The simplified main entry point is also reasonable.
15-17
: Verify build configuration after dist removal.
The package now depends on @pipedream/platform which is good. However, with the removal of the dist directory reference:
- Ensure the build output location is correctly configured elsewhere
- Verify that the package can be properly imported by consumers
✅ Verification successful
Let me gather more information about the build configuration.
Let me check the component's package.json and the build output configuration in the root tsconfig.json since the component doesn't have its own tsconfig.json.
No build configuration changes needed.
The component is properly configured:
- It's using
.mjs
files which are ES modules and don't require compilation - The package correctly depends on
@pipedream/platform
which provides the runtime environment - No build step is needed as the source files are directly executable
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check if there are any build scripts or configurations
rg -l "build|dist|compile" package.json
# Check if there are any TypeScript configurations
fd "tsconfig.json|tsc"
Length of output: 2657
Script:
#!/bin/bash
# Check package.json content for build related configurations
cat package.json
# Check tsconfig.json content for build output configuration
cat components/alchemy/tsconfig.json
# Check if there are any build related files in the component directory
fd . components/alchemy --type f
Length of output: 2542
Script:
#!/bin/bash
# Check the root tsconfig.json for build configuration
cat tsconfig.json
# Check the component's package.json
cat components/alchemy/package.json
# Check if there are any .js or .mjs files that might be build outputs
fd "\.(js|mjs)$" components/alchemy
Length of output: 47640
components/alchemy/common/constants.mjs (1)
79-82
: LGTM! Export statement is clean and well-structured.
The exports are clearly defined and follow the module pattern correctly.
components/alchemy/alchemy.app.mjs (3)
8-12
: Add secure input masking for the auth token.
The auth token should be masked to prevent accidental exposure in logs or UI.
[security]
authToken: {
type: "string",
label: "Auth Token",
+ secret: true,
description: "Find your [Alchemy auth token](https://docs.alchemy.com/reference/notify-api-faq#where-do-i-find-my-alchemy-auth-token) in the upper-right corner of your Webhooks dashboard by clicking the **AUTH TOKEN** button.",
},
19-29
: Add validation for custom GraphQL queries.
When users input custom GraphQL queries, there should be validation to ensure they are well-formed and safe to execute.
Consider adding:
- Query syntax validation
- Query complexity limits
- Sanitization of user input
Would you like me to provide an implementation for these validations?
1-64
: Verify GraphQL query event handling implementation.
While the webhook infrastructure is in place, we should verify that the implementation supports the specific requirement of emitting events for new GraphQL queries.
components/alchemy/sources/new-graphql-query-instant/new-graphql-query-instant.mjs
Show resolved
Hide resolved
components/alchemy/sources/new-graphql-query-instant/new-graphql-query-instant.mjs
Show resolved
Hide resolved
components/alchemy/sources/new-graphql-query-instant/new-graphql-query-instant.mjs
Show resolved
Hide resolved
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.
Hi @michelle0927, LGTM! Ready for QA!
/approve |
* new component * pnpm-lock.yaml * updates
Resolves #13206
Summary by CodeRabbit
New Features
Bug Fixes
.gitignore
file, allowing for better version control of JavaScript files and directories.Chores