Skip to content

Conversation

@lcaresia
Copy link
Collaborator

@lcaresia lcaresia commented Nov 11, 2025

WHY

Summary by CodeRabbit

  • New Features

    • Added three Blocknative actions to fetch chains, gas prices, and oracle data; actions return summaries and results.
    • Blocknative integration now exposes methods to retrieve chains, gas prices, and oracles, plus configurable confidence-levels and chain selection.
  • Chores

    • Bumped Blocknative component version to 0.1.0 and added a platform dependency.
  • Style

    • Minor formatting cleanups (trailing newlines) across several components.

@lcaresia lcaresia self-assigned this Nov 11, 2025
@vercel
Copy link

vercel bot commented Nov 11, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
pipedream-docs Ignored Ignored Nov 12, 2025 4:35pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Nov 12, 2025 4:35pm

@lcaresia lcaresia linked an issue Nov 11, 2025 that may be closed by this pull request
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 11, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Adds three new Blocknative action modules, extends the Blocknative app with HTTP helpers, API methods, and propDefinitions, bumps package version and dependency, and applies EOF newline fixes to multiple component files.

Changes

Cohort / File(s) Summary
New Blocknative action modules
components/blocknative/actions/get-chains/get-chains.mjs, components/blocknative/actions/get-gas-prices/get-gas-prices.mjs, components/blocknative/actions/get-oracles/get-oracles.mjs
Three new action exports with metadata, props, and async run({ $ }) implementations that call the app methods (getChains, getBlockprices, getOracles), export a $summary, and return the API responses.
Blocknative app implementation
components/blocknative/blocknative.app.mjs
Added propDefinitions (confidenceLevels, chainid with async options()), introduced _baseUrl() and _makeRequest() using axios and auth, and implemented getBlockprices(), getChains(), getOracles(). Removed authKeys().
Package metadata
components/blocknative/package.json
Bumped version 0.0.10.1.0 and added dependencies with @pipedream/platform: ^3.1.1.
Formatting / trailing newline fixes
components/browseract/browseract.app.mjs, components/camino_ai/camino_ai.app.mjs, components/clappia/clappia.app.mjs, components/digitalocean_gradient_ai_serverless_inference/digitalocean_gradient_ai_serverless_inference.app.mjs, components/elastic_security/elastic_security.app.mjs, components/postnitro/postnitro.app.mjs, components/redash/redash.app.mjs, components/spike/spike.app.mjs, components/straico/straico.app.mjs, components/straker_verify/straker_verify.app.mjs, components/trackvia/trackvia.app.mjs
Added trailing newline (EOF) to files only; no functional or API changes.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant Action as Action Module
    participant App as blocknative.app
    participant API as Blocknative API

    User->>Action: Trigger action (Get Chains / Get Gas Prices / Get Oracles)
    Action->>Action: Read props (e.g., confidenceLevels, chainid)
    Action->>App: Call corresponding method (getChains/getBlockprices/getOracles)
    App->>App: Build request (base URL + Authorization) via _makeRequest
    App->>API: HTTP GET (e.g., /chains, /gasprices/blockprices, /oracles)
    API-->>App: Return data
    App-->>Action: Response payload
    Action->>Action: $.export("$summary", "Successfully retrieved X results")
    Action-->>User: Return results
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Attention points:
    • components/blocknative/blocknative.app.mjs: verify _makeRequest HTTP options, axios import/use, and Authorization header source.
    • components/blocknative/actions/get-gas-prices/get-gas-prices.mjs: confirm confidenceLevels handling (join) and propDefinitions wiring.
    • components/blocknative/package.json: confirm dependency and version bump correctness.

Possibly related PRs

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description only contains the template header '## WHY' with no additional explanation provided by the author, failing to meet the required documentation standard. Complete the '## WHY' section with a clear explanation of the motivation, goals, and rationale for adding these three new Blocknative actions and the supporting infrastructure changes.
Title check ❓ Inconclusive The title references issue #10918 and the Blocknative component, but is vague and does not clearly describe the specific changes made in this PR. Revise the title to be more descriptive of the main changes, such as 'Add Blocknative actions: Get Chains, Get Gas Prices, and Get Oracles' to better reflect the actual implementation.
✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e8f5e95 and f46d339.

📒 Files selected for processing (1)
  • components/blocknative/blocknative.app.mjs (1 hunks)

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a115429 and 28a3628.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (5)
  • components/blocknative/actions/get-chains/get-chains.mjs (1 hunks)
  • components/blocknative/actions/get-gas-prices/get-gas-prices.mjs (1 hunks)
  • components/blocknative/actions/get-oracles/get-oracles.mjs (1 hunks)
  • components/blocknative/blocknative.app.mjs (1 hunks)
  • components/blocknative/package.json (2 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2024-12-12T19:23:09.039Z
Learnt from: jcortes
Repo: PipedreamHQ/pipedream PR: 14935
File: components/sailpoint/package.json:15-18
Timestamp: 2024-12-12T19:23:09.039Z
Learning: When developing Pipedream components, do not add built-in Node.js modules like `fs` to `package.json` dependencies, as they are native modules provided by the Node.js runtime.

Applied to files:

  • components/blocknative/package.json
📚 Learning: 2025-09-15T22:01:11.472Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 18362
File: components/leonardo_ai/actions/generate-image/generate-image.mjs:103-105
Timestamp: 2025-09-15T22:01:11.472Z
Learning: In Pipedream components, pipedream/platform's axios implementation automatically excludes undefined values from HTTP requests, so there's no need to manually check for truthiness before including properties in request payloads.

Applied to files:

  • components/blocknative/blocknative.app.mjs
🧬 Code graph analysis (4)
components/blocknative/actions/get-chains/get-chains.mjs (2)
components/blocknative/actions/get-oracles/get-oracles.mjs (1)
  • response (18-20)
components/blocknative/blocknative.app.mjs (1)
  • response (17-17)
components/blocknative/actions/get-oracles/get-oracles.mjs (1)
components/blocknative/actions/get-chains/get-chains.mjs (1)
  • response (18-20)
components/blocknative/actions/get-gas-prices/get-gas-prices.mjs (3)
components/blocknative/actions/get-chains/get-chains.mjs (1)
  • response (18-20)
components/blocknative/actions/get-oracles/get-oracles.mjs (1)
  • response (18-20)
components/blocknative/blocknative.app.mjs (1)
  • response (17-17)
components/blocknative/blocknative.app.mjs (3)
components/blocknative/actions/get-chains/get-chains.mjs (1)
  • response (18-20)
components/blocknative/actions/get-gas-prices/get-gas-prices.mjs (1)
  • response (30-36)
components/blocknative/actions/get-oracles/get-oracles.mjs (1)
  • response (18-20)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: pnpm publish
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Lint Code Base
🔇 Additional comments (4)
components/blocknative/package.json (1)

3-16: Dependency bump aligns with new platform usage.

Good call adding the @pipedream/platform dependency with the version bump—this matches the new axios-based helper in the app and keeps everything consistent.

components/blocknative/actions/get-oracles/get-oracles.mjs (1)

3-24: Action wiring looks solid.

The action cleanly delegates to the app helper and returns the raw list, so consumers can decide how to shape the data—looks good.

components/blocknative/actions/get-chains/get-chains.mjs (1)

3-24: Implementation matches the API contract.

This mirrors the oracles action, and the summary reads well—nothing to fix here.

components/blocknative/actions/get-gas-prices/get-gas-prices.mjs (1)

3-39: Gas price action behaves as expected.

The prop wiring and params serialization match Blocknative’s requirements; exporting the estimated price count is a nice touch.

GTFalcao
GTFalcao previously approved these changes Nov 11, 2025
Copy link
Collaborator

@GTFalcao GTFalcao left a comment

Choose a reason for hiding this comment

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

LGTM!

@vunguyenhung
Copy link
Collaborator

Hi everyone, all test cases are passed! Ready for release!

Test reports

@lcaresia
Copy link
Collaborator Author

/approve

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

♻️ Duplicate comments (1)
components/blocknative/blocknative.app.mjs (1)

31-46: Authorization header issue remains unresolved.

The issue flagged in the previous review is still present: Line 42 unconditionally sets the Authorization header to ${this.$auth.api_key}, which results in Authorization: undefined when no API key is provided. This breaks the optional authentication path that Blocknative's public endpoints support.

Please apply the suggested fix from the previous review to make the header conditional:

-      return axios($, {
-        ...otherOpts,
-        url: this._baseUrl() + path,
-        headers: {
-          "Authorization": `${this.$auth.api_key}`,
-          ...headers,
-        },
-      });
+      const authHeader = this.$auth?.api_key
+        ? { Authorization: this.$auth.api_key }
+        : {};
+
+      return axios($, {
+        ...otherOpts,
+        url: this._baseUrl() + path,
+        headers: {
+          ...authHeader,
+          ...headers,
+        },
+      });
📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 06f2ac7 and e8f5e95.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (16)
  • components/blocknative/actions/get-chains/get-chains.mjs (1 hunks)
  • components/blocknative/actions/get-gas-prices/get-gas-prices.mjs (1 hunks)
  • components/blocknative/actions/get-oracles/get-oracles.mjs (1 hunks)
  • components/blocknative/blocknative.app.mjs (1 hunks)
  • components/blocknative/package.json (2 hunks)
  • components/browseract/browseract.app.mjs (1 hunks)
  • components/camino_ai/camino_ai.app.mjs (1 hunks)
  • components/clappia/clappia.app.mjs (1 hunks)
  • components/digitalocean_gradient_ai_serverless_inference/digitalocean_gradient_ai_serverless_inference.app.mjs (1 hunks)
  • components/elastic_security/elastic_security.app.mjs (1 hunks)
  • components/postnitro/postnitro.app.mjs (1 hunks)
  • components/redash/redash.app.mjs (1 hunks)
  • components/spike/spike.app.mjs (1 hunks)
  • components/straico/straico.app.mjs (1 hunks)
  • components/straker_verify/straker_verify.app.mjs (1 hunks)
  • components/trackvia/trackvia.app.mjs (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-09-15T22:01:11.472Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 18362
File: components/leonardo_ai/actions/generate-image/generate-image.mjs:103-105
Timestamp: 2025-09-15T22:01:11.472Z
Learning: In Pipedream components, pipedream/platform's axios implementation automatically excludes undefined values from HTTP requests, so there's no need to manually check for truthiness before including properties in request payloads.

Applied to files:

  • components/blocknative/blocknative.app.mjs
📚 Learning: 2024-12-12T19:23:09.039Z
Learnt from: jcortes
Repo: PipedreamHQ/pipedream PR: 14935
File: components/sailpoint/package.json:15-18
Timestamp: 2024-12-12T19:23:09.039Z
Learning: When developing Pipedream components, do not add built-in Node.js modules like `fs` to `package.json` dependencies, as they are native modules provided by the Node.js runtime.

Applied to files:

  • components/blocknative/package.json
🧬 Code graph analysis (4)
components/blocknative/actions/get-oracles/get-oracles.mjs (1)
components/blocknative/actions/get-chains/get-chains.mjs (1)
  • response (18-20)
components/blocknative/actions/get-gas-prices/get-gas-prices.mjs (3)
components/blocknative/actions/get-chains/get-chains.mjs (1)
  • response (18-20)
components/blocknative/actions/get-oracles/get-oracles.mjs (1)
  • response (18-20)
components/blocknative/blocknative.app.mjs (1)
  • response (17-17)
components/blocknative/blocknative.app.mjs (3)
components/blocknative/actions/get-chains/get-chains.mjs (1)
  • response (18-20)
components/blocknative/actions/get-gas-prices/get-gas-prices.mjs (1)
  • response (30-36)
components/blocknative/actions/get-oracles/get-oracles.mjs (1)
  • response (18-20)
components/blocknative/actions/get-chains/get-chains.mjs (3)
components/blocknative/actions/get-gas-prices/get-gas-prices.mjs (1)
  • response (30-36)
components/blocknative/actions/get-oracles/get-oracles.mjs (1)
  • response (18-20)
components/blocknative/blocknative.app.mjs (1)
  • response (17-17)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: pnpm publish
  • GitHub Check: Lint Code Base
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
🔇 Additional comments (10)
components/straker_verify/straker_verify.app.mjs (1)

11-11: LGTM!

Trailing newline added following best practices.

components/camino_ai/camino_ai.app.mjs (1)

11-11: LGTM!

Trailing newline added following best practices.

components/postnitro/postnitro.app.mjs (1)

11-11: LGTM!

Trailing newline added following best practices.

components/blocknative/package.json (1)

3-3: LGTM!

Version bump to 0.1.0 is appropriate for the new feature additions. The @pipedream/platform dependency correctly supports the axios usage introduced in blocknative.app.mjs.

Also applies to: 15-17

components/blocknative/blocknative.app.mjs (3)

1-2: LGTM!

Import statement correctly brings in axios from the @pipedream/platform dependency added in package.json.


28-30: LGTM!

Base URL method follows standard pattern.


48-65: LGTM!

The API methods (getBlockprices, getChains, getOracles) follow a consistent pattern and correctly delegate to _makeRequest. They properly match the usage patterns in the new action modules.

components/blocknative/actions/get-oracles/get-oracles.mjs (1)

1-16: LGTM!

The action metadata and configuration are well-structured. The annotations correctly indicate this is a read-only, non-destructive operation.

components/blocknative/actions/get-chains/get-chains.mjs (1)

1-16: LGTM!

The action metadata and configuration follow the established pattern and correctly describe a read-only operation.

components/blocknative/actions/get-gas-prices/get-gas-prices.mjs (1)

1-28: LGTM!

The action configuration is well-structured, and the use of propDefinition for reusable props is a good practice.

Comment on lines +17 to +23
async run({ $ }) {
const response = await this.app.getChains({
$,
});
$.export("$summary", "Successfully retrieved " + response.length + " chains");
return response;
},
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Add validation for response structure.

The code accesses response.length without validating that the response is an array, which could cause a runtime error if the API returns an unexpected structure.

Apply this diff to add validation:

 async run({ $ }) {
   const response = await this.app.getChains({
     $,
   });
-  $.export("$summary", "Successfully retrieved " + response.length + " chains");
+  if (!Array.isArray(response)) {
+    throw new Error("Unexpected response format: expected an array");
+  }
+  $.export("$summary", `Successfully retrieved ${response.length} chains`);
   return response;
 },

Additionally, prefer template literals over string concatenation.

🤖 Prompt for AI Agents
In components/blocknative/actions/get-chains/get-chains.mjs around lines 17 to
23, the code assumes response is an array and uses response.length and string
concatenation; update it to validate that response is an array before using
length (e.g., if not an array, log/export a clear error or return an empty
array/throw), ensure downstream returns a predictable value, and change the
summary message to use a template literal for readability (e.g., include the
validated length variable in a backtick string).

Comment on lines +29 to +39
async run({ $ }) {
const response = await this.app.getBlockprices({
$,
params: {
confidenceLevels: this.confidenceLevels.join(","),
chainid: this.chainid,
},
});
$.export("$summary", "Successfully retrieved " + response.blockPrices[0].estimatedPrices.length + " estimated prices");
return response;
},
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Add validation for nested response structure.

Line 37 accesses deeply nested properties (response.blockPrices[0].estimatedPrices.length) without validation. This will throw a runtime error if:

  • response.blockPrices is undefined or not an array
  • response.blockPrices is empty
  • response.blockPrices[0] doesn't have estimatedPrices

Apply this diff to add proper validation:

 async run({ $ }) {
   const response = await this.app.getBlockprices({
     $,
     params: {
       confidenceLevels: this.confidenceLevels.join(","),
       chainid: this.chainid,
     },
   });
-  $.export("$summary", "Successfully retrieved " + response.blockPrices[0].estimatedPrices.length + " estimated prices");
+  if (!response.blockPrices?.length || !response.blockPrices[0]?.estimatedPrices) {
+    throw new Error("Unexpected response format: missing blockPrices or estimatedPrices");
+  }
+  $.export("$summary", `Successfully retrieved ${response.blockPrices[0].estimatedPrices.length} estimated prices`);
   return response;
 },

Additionally, prefer template literals over string concatenation.

🤖 Prompt for AI Agents
In components/blocknative/actions/get-gas-prices/get-gas-prices.mjs around lines
29 to 39, the code assumes response.blockPrices[0].estimatedPrices exists and
reads its length directly; add defensive checks to ensure response is an object,
response.blockPrices is an array with at least one element, and
response.blockPrices[0].estimatedPrices is an array before accessing .length,
falling back to 0 (or a safe default) if any check fails; then use a template
literal for the summary export (e.g. `Successfully retrieved ${count} estimated
prices`) and keep returning the original response.

Comment on lines +17 to +23
async run({ $ }) {
const response = await this.app.getOracles({
$,
});
$.export("$summary", "Successfully retrieved " + response.length + " results");
return response;
},
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Add validation for response structure.

The code accesses response.length without validating that the response is an array. If the API returns an unexpected structure, this will cause a runtime error.

Consider adding validation:

 async run({ $ }) {
   const response = await this.app.getOracles({
     $,
   });
-  $.export("$summary", "Successfully retrieved " + response.length + " results");
+  if (!Array.isArray(response)) {
+    throw new Error("Unexpected response format: expected an array");
+  }
+  $.export("$summary", `Successfully retrieved ${response.length} results`);
   return response;
 },

Additionally, prefer template literals over string concatenation for improved readability.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
async run({ $ }) {
const response = await this.app.getOracles({
$,
});
$.export("$summary", "Successfully retrieved " + response.length + " results");
return response;
},
async run({ $ }) {
const response = await this.app.getOracles({
$,
});
if (!Array.isArray(response)) {
throw new Error("Unexpected response format: expected an array");
}
$.export("$summary", `Successfully retrieved ${response.length} results`);
return response;
},
🤖 Prompt for AI Agents
In components/blocknative/actions/get-oracles/get-oracles.mjs around lines 17 to
23, the code assumes response is an array and uses response.length and string
concatenation; validate the response shape first (e.g. if
(!Array.isArray(response)) handle it by either throwing a descriptive error or
normalizing to an empty array), then use the array's length safely and export
the summary using a template literal (e.g. `\`Successfully retrieved
${results.length} results\``); ensure the function still returns the normalized
value so callers never receive an unexpected structure.

@GTFalcao GTFalcao merged commit fbb6301 into master Nov 12, 2025
9 of 10 checks passed
@GTFalcao GTFalcao deleted the issue-10918 branch November 12, 2025 16:36
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.

[Components] blocknative

4 participants