- 
                Notifications
    
You must be signed in to change notification settings  - Fork 5.5k
 
added 'paptrading' header to support demo_environment custom field #18287
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
added 'paptrading' header to support demo_environment custom field #18287
Conversation
| 
           The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
  | 
    
          
WalkthroughAdds support for a demo environment flag in Bitget requests by reading  Changes
 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
    Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
 📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration: 
 You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (1)
 ✅ Files skipped from review due to trivial changes (1)
 ⏰ 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)
 ✨ Finishing Touches🧪 Generate unit tests
 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit: 
 SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type  Other keywords and placeholders
 CodeRabbit Configuration File (
 | 
    
| 
           Thank you so much for submitting this! We've added it to our backlog to review, and our team has been notified.  | 
    
| 
           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: 
  | 
    
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: 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.
📒 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 thepaptradingheader (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.
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.
LGTM!
Modified
getHeadersinbitget.app.mjsto support demo/live environments for Bitget API access. Leveragesdemo_environmentfrom app auth custom fieldsSummary by CodeRabbit
New Features
Chores