Skip to content

Conversation

@sergio-eliot-rodriguez
Copy link
Collaborator

@sergio-eliot-rodriguez sergio-eliot-rodriguez commented Sep 5, 2025

Modified getHeaders in bitget.app.mjs to support demo/live environments for Bitget API access. Leverages demo_environment from app auth custom fields

Summary by CodeRabbit

  • New Features

    • Added demo/paper-trading support for Bitget integrations so requests can target a safe demo environment when enabled in your account; a header is sent to indicate demo mode.
  • Chores

    • Bumped metadata versions across many Bitget action modules and updated the Bitget component package version for release consistency.

@vercel
Copy link

vercel bot commented Sep 5, 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 Sep 5, 2025 3:02am
pipedream-docs-redirect-do-not-edit Ignored Ignored Sep 5, 2025 3:02am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 5, 2025

Walkthrough

Adds support for a demo environment flag in Bitget requests by reading demo_environment from this.$auth, mapping it to a paptrading header (1/0), and including it in outgoing request headers. Also bumps the version metadata of many Bitget action modules from 0.0.1 to 0.0.2. No public signatures changed.

Changes

Cohort / File(s) Change Summary
Bitget app auth/header update
components/bitget/bitget.app.mjs
Reads demo_environment from this.$auth (destructured as demoEnvironment), derives paptrading (1 if truthy, else 0), and adds paptrading to request headers. Header construction and signing logic unchanged; public function signatures unaffected.
Bitget actions version bumps
components/bitget/actions/... (e.g. future-market-get-all-symbols-contracts/*, future-market-get-candle-data/*, future-market-get-contracts-oi/*, future-market-get-current-funding-rate/*, future-market-get-discount-rate/*, future-market-get-exchange-rate/*, future-market-get-fills-history/*, future-market-get-history-candle-data/*, future-market-get-history-funding-rate/*, future-market-get-history-index-candle-data/*, future-market-get-history-mark-candle-data/*, future-market-get-interest-rate/*, future-market-get-merge-depth/*, future-market-get-open-interest/*, future-market-get-recent-fills/*, future-market-get-symbol-next-funding-time/*, future-market-get-symbol-price/*, future-market-get-ticker/*, future-market-get-tickers/*, future-market-get-vip-fee-rate/*, spot-market-get-auction/*, spot-market-get-candle-data/*, spot-market-get-coin-list/*, spot-market-get-history-candle-data/*, spot-market-get-market-trades/*, spot-market-get-merge-depth/*, spot-market-get-orderbook/*, spot-market-get-recent-trades/*, spot-market-get-symbols/*, spot-market-get-tickers/*, spot-market-get-vip-fee-rate/*, spot-trade-*/**)
Updated exported action metadata version from "0.0.1" to "0.0.2" across many action modules. No changes to logic, props, control flow, or public signatures.
Package metadata
components/bitget/package.json
Bumped package version from 0.1.0 to 0.1.1.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Client as Caller
  participant App as Bitget App
  participant API as Bitget API

  Client->>App: request(...)
  App->>App: read this.$auth.demo_environment
  alt demo_environment truthy
    App->>App: paptrading = 1
  else
    App->>App: paptrading = 0
  end
  App->>App: build headers (include paptrading) and sign
  App->>API: HTTP request with headers
  API-->>App: response
  App-->>Client: return response
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

I twitch my nose at headers bright,
A tiny flag to guide the flight—
paptrading set, I hop and run,
Sign, send, and watch the API fun.
Carrot crumbs of code at night. 🥕


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 6f681a0 and b5cc803.

📒 Files selected for processing (1)
  • components/bitget/package.json (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • components/bitget/package.json
⏰ 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: Verify TypeScript components
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Lint Code Base
  • GitHub Check: pnpm publish
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@pipedream-component-development
Copy link
Collaborator

Thank you so much for submitting this! We've added it to our backlog to review, and our team has been notified.

@pipedream-component-development
Copy link
Collaborator

Thanks for submitting this PR! When we review PRs, we follow the Pipedream component guidelines. If you're not familiar, here's a quick checklist:

@sergio-eliot-rodriguez sergio-eliot-rodriguez linked an issue Sep 5, 2025 that may be closed by this pull request
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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
components/bitget/bitget.app.mjs (1)

364-371: Fix lint error: add trailing comma in destructuring.

ESLint is failing on comma-dangle at Line 368. Add the trailing comma to unblock the pipeline.

-      const {
+      const {
         secret_key: secretKey,
         api_key: apiKey,
         secret_passphrase: secretPassphrase,
-        demo_environment: demoEnvironment
+        demo_environment: demoEnvironment,
       } = this.$auth;
🧹 Nitpick comments (1)
components/bitget/bitget.app.mjs (1)

387-390: Fix indentation and trailing spaces in headers block.

Conform to 8-space indentation, remove tabs and trailing spaces.

-				paptrading,        
+        paptrading,
         "locale": "en-US",
-        "Content-Type": "application/json",          
+        "Content-Type": "application/json",
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between e3d9866 and 80cab2b.

📒 Files selected for processing (1)
  • components/bitget/bitget.app.mjs (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
components/bitget/bitget.app.mjs (1)
components/livekit/livekit.app.mjs (1)
  • apiKey (46-49)
🪛 GitHub Check: Lint Code Base
components/bitget/bitget.app.mjs

[failure] 370-370:
Trailing spaces not allowed


[failure] 368-368:
Missing trailing comma


[failure] 389-389:
Trailing spaces not allowed


[failure] 387-387:
Trailing spaces not allowed


[failure] 387-387:
Expected indentation of 8 spaces but found 4 tabs


[failure] 380-380:
Trailing spaces not allowed


[failure] 380-380:
Expected newline between consequent and alternate of ternary expression


[failure] 380-380:
Expected newline between test and consequent of ternary expression

🪛 GitHub Actions: Pull Request Checks
components/bitget/bitget.app.mjs

[error] 368-368: ESLint: Missing trailing comma. (comma-dangle) at line 368, column 42. Command: 'pnpm exec eslint components/bitget/bitget.app.mjs'

⏰ 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). (3)
  • GitHub Check: pnpm publish
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
🔇 Additional comments (1)
components/bitget/bitget.app.mjs (1)

380-389: Confirmed ‘paptrading’ header usage
Bitget’s REST API uses the paptrading header (value "1" for demo, "0" for live) to enable paper trading. It’s only required when making requests with a Demo API key; live‐environment calls don’t need it.

Copy link
Collaborator

@michelle0927 michelle0927 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 vunguyenhung merged commit b541381 into PipedreamHQ:master Sep 6, 2025
10 checks passed
@sergio-eliot-rodriguez sergio-eliot-rodriguez deleted the bitget_demo_env branch September 12, 2025 18: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.

Bitget

4 participants