Skip to content

Conversation

@jcortes
Copy link
Collaborator

@jcortes jcortes commented Jul 17, 2025

WHY

Resolves #10113

Summary by CodeRabbit

  • New Features

    • Introduced numerous new actions for Bitget spot and futures markets, including comprehensive data retrieval for symbols, tickers, order books, candles, trades, auctions, funding rates, open interest, fee rates, discount rates, exchange rates, and historical market data.
    • Added advanced spot trading operations such as placing, canceling, batch placing, batch canceling, and cancel-replace orders with detailed input validation and support for up to 50 orders per batch.
    • Implemented dynamic option loaders for various inputs to enhance user experience.
    • Included utility functions for recursive JSON parsing to handle complex nested input data.
    • Delivered a fully functional Bitget app integration with authentication, request signing, and extensive API coverage.
  • Chores

    • Updated package version to 0.1.0 and added platform dependency for improved compatibility.

@jcortes jcortes self-assigned this Jul 17, 2025
@vercel
Copy link

vercel bot commented Jul 17, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Ignored (Inspect) Visit Preview Jul 21, 2025 3:18pm
pipedream-docs ⬜️ Ignored (Inspect) Jul 21, 2025 3:18pm
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Jul 21, 2025 3:18pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 17, 2025

Walkthrough

A comprehensive Bitget app integration was introduced, featuring full property definitions, authentication, and request signing. Numerous new action modules were added for both spot and futures trading, covering market data retrieval, trading operations, batch order management, order details, and fills history. Supporting utility and constants modules were also included.

Changes

File(s) Change Summary
components/bitget/bitget.app.mjs Full Bitget app implementation: propDefinitions, authentication, request signing, and API methods for spot/futures market and trade.
components/bitget/common/constants.mjs New module exporting Bitget API base URL and version path constants.
components/bitget/common/utils.mjs New module with JSON parsing utilities for robust input handling of nested JSON strings and arrays.
components/bitget/package.json Version bumped to 0.1.0, added @pipedream/platform dependency, fixed JSON formatting.
components/bitget/actions/future-market-get-*.mjs 21 new futures market action modules for retrieving market data like symbols, candle data, funding rates, open interest, and more.
components/bitget/actions/spot-market-get-*.mjs 14 new spot market action modules for retrieving market data such as coins, symbols, tickers, orderbooks, auctions, and trades.
components/bitget/actions/spot-trade-*.mjs 7 new spot trade action modules for trading operations including placing, canceling, batch operations, and order info retrieval.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ActionModule
    participant BitgetApp
    participant BitgetAPI

    User->>ActionModule: Provide input parameters
    ActionModule->>BitgetApp: Call API wrapper method with parameters
    BitgetApp->>BitgetAPI: Make authenticated HTTP request
    BitgetAPI-->>BitgetApp: Return API response
    BitgetApp-->>ActionModule: Return processed data
    ActionModule-->>User: Output result and summary message
Loading

Estimated code review effort

4 (~90 minutes)

Assessment against linked issues

Objective Addressed Explanation
Implement Bitget app integration with authentication and API connectivity (#10113) Full app implementation including authentication and request signing.
Provide actions for Spot trading: market data and trading operations (#10113) Multiple spot market and spot trade actions added.
Provide actions for Futures trading: market data and trading operations (#10113) Extensive futures market actions added.
Support batch operations and robust input handling for orders (#10113) Batch place, batch cancel, and batch cancel/replace actions with input validation included.

Poem

In a warren deep, where the code rabbits dwell,
Bitget arrived, with APIs to sell.
Spot and futures, orderbooks and trades,
Batch ops and candles, all finely arrayed.
With constants and utils, the groundwork is laid—
Now bunnies can automate, unafraid!
🐇✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

components/bitget/actions/future-market-get-all-symbols-contracts/future-market-get-all-symbols-contracts.mjs

Oops! Something went wrong! :(

ESLint: 8.57.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:801:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:725:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:309:38)
at #link (node:internal/modules/esm/module_job:202:49)

components/bitget/actions/future-market-get-candle-data/future-market-get-candle-data.mjs

Oops! Something went wrong! :(

ESLint: 8.57.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:801:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:725:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:309:38)
at #link (node:internal/modules/esm/module_job:202:49)

components/bitget/actions/future-market-get-contracts-oi/future-market-get-contracts-oi.mjs

Oops! Something went wrong! :(

ESLint: 8.57.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:801:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:725:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:309:38)
at #link (node:internal/modules/esm/module_job:202:49)

  • 42 others
✨ Finishing Touches
  • 📝 Generate Docstrings

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.
    • Explain this complex logic.
    • 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. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai 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

Documentation and Community

  • 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.

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: 14

🧹 Nitpick comments (14)
components/bitget/actions/spot-market-get-tickers/spot-market-get-tickers.mjs (1)

31-34: Consider consistency in return value.

The action returns response.data instead of the full response object, which differs from other actions in the codebase that return the complete response. Consider maintaining consistency across actions.

-return response.data;
+return response;
components/bitget/actions/future-market-get-recent-fills/future-market-get-recent-fills.mjs (2)

11-17: Redundant optional property declaration.

The optional: false declaration for the symbol parameter is redundant since properties are required by default in Pipedream actions.

-symbol: {
-  optional: false,
-  propDefinition: [
-    app,
-    "symbol",
-  ],
-},
+symbol: {
+  propDefinition: [
+    app,
+    "symbol",
+  ],
+},

50-50: Consider enhancing summary message for consistency.

The summary message could be more informative by including the count of records retrieved, similar to other actions in the codebase.

-$.export("$summary", `Successfully retrieved recent fills for \`${symbol}\``);
+$.export("$summary", `Successfully retrieved \`${response?.data?.length}\` recent fills for \`${symbol}\``);
components/bitget/actions/future-market-get-history-candle-data/future-market-get-history-candle-data.mjs (1)

42-49: Consider adding default value for limit parameter

The description mentions "Default: 100" but no default value is set in the prop definition. Consider adding default: 100 to ensure consistency.

limit: {
  type: "integer",
  label: "Limit",
  description: "Default: `100`, maximum: `200`",
  optional: true,
+ default: 100,
  min: 1,
  max: 200,
},
components/bitget/actions/spot-trade-get-unfilled-orders/spot-trade-get-unfilled-orders.mjs (2)

62-69: Add default value for limit parameter

The description mentions "Default: 100" but no default value is set. Consider adding the default value for consistency.

limit: {
  type: "integer",
  label: "Limit",
  description: "Default: `100`, maximum: `500`.",
  optional: true,
+ default: 100,
  min: 1,
  max: 500,
},

100-100: Consider enhancing summary message with more specific information

The current summary message is generic. Based on the retrieved learnings about summary formatting, consider including more specific information such as the symbol or count of orders retrieved.

-$.export("$summary", "Successfully retrieved unfilled spot orders");
+$.export("$summary", `Successfully retrieved unfilled spot orders${symbol ? ` for \`${symbol}\`` : ""}`);
components/bitget/actions/spot-trade-batch-place-orders/spot-trade-batch-place-orders.mjs (1)

32-61: Consider adding orderType validation.

The validation logic is comprehensive, but consider adding validation for valid orderType values to prevent invalid API calls.

          if (!order.orderType) {
            throw new Error("`orderType` is required for each order");
          }
+         if (!["market", "limit", "stop_limit", "stop_market"].includes(order.orderType)) {
+           throw new Error("`orderType` must be one of: market, limit, stop_limit, stop_market");
+         }
components/bitget/actions/spot-trade-get-fills/spot-trade-get-fills.mjs (1)

75-75: Improve summary message specificity.

Based on previous learnings, the summary message should be more specific and include the count of retrieved items when possible.

-    $.export("$summary", "Successfully retrieved spot trade fills");
+    $.export("$summary", `Successfully retrieved ${response?.data?.length || 0} spot trade fills`);
components/bitget/actions/spot-trade-cancel-symbol-orders/spot-trade-cancel-symbol-orders.mjs (1)

11-16: Consider making symbol explicitly required

For consistency with other actions, consider explicitly marking the symbol as required.

 symbol: {
+  optional: false,
   propDefinition: [
     app,
     "symbol",
   ],
 },
components/bitget/actions/spot-market-get-recent-trades/spot-market-get-recent-trades.mjs (1)

18-25: Consider adding default value for limit parameter.

While the description mentions "Default: 100", there's no actual default value specified in the prop definition. Consider adding a default value for better user experience.

  limit: {
    type: "integer",
    label: "Limit",
    description: "Default: `100`, maximum: `500`",
    optional: true,
+   default: 100,
    min: 1,
    max: 500,
  },
components/bitget/actions/spot-trade-get-history-orders/spot-trade-get-history-orders.mjs (2)

29-35: Consider renaming idLessThan prop for clarity.

The prop name idLessThan might be confusing. Consider using a more descriptive name like beforeOrderId or olderThan to better convey its purpose.


100-100: Enhance summary message with more specific information.

Based on the retrieved learnings about proper summary formatting, consider making the summary message more specific and informative. The current message is generic and doesn't provide useful feedback about what was actually retrieved.

-$.export("$summary", "Successfully retrieved spot order history");
+$.export("$summary", `Successfully retrieved ${response?.data?.length || 0} historical orders${symbol ? ` for symbol \`${symbol}\`` : ""}`);
components/bitget/bitget.app.mjs (2)

54-88: Consider consolidating duplicate time interval options.

The granularity prop has duplicate time intervals with different formats (e.g., "1min" vs "1m", "1h" vs "1H"). While the description explains these differences, having both formats as separate options may confuse users. Consider either:

  1. Consolidating to a single format
  2. Adding clearer labels to distinguish between formats
  3. Grouping options by format type

243-245: Use template literals for URL construction.

Replace string concatenation with template literals for better readability.

-      if (queryString) {
-        path += "?" + queryString;
-      }
+      if (queryString) {
+        path += `?${queryString}`;
+      }

lcaresia
lcaresia previously approved these changes Jul 17, 2025
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: 0

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

389-400: Consider adding error handling to API requests.

The makeRequest method doesn't include explicit error handling. While axios will throw errors automatically, consider adding specific error handling for better debugging and user experience.

    makeRequest({
      $ = this, path, ...args
    }) {
+     try {
        return axios($, {
          ...args,
          url: this.getUrl(path),
          headers: this.getHeaders({
            path,
            ...args,
          }),
        });
+     } catch (error) {
+       console.error(`API request failed for ${path}:`, error.message);
+       throw error;
+     }
    },
🧹 Nitpick comments (2)
components/bitget/bitget.app.mjs (2)

26-26: Remove debug console.log statement.

There's a debug console.log statement that should be removed for production code.

-        console.log("response!!!", response);

376-376: Remove debug console.log statement.

Another debug console.log statement that should be removed for production code.

-      console.log("message!!!", message);
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fe74298 and 9f68ab0.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (46)
  • components/bitget/actions/future-market-get-all-symbols-contracts/future-market-get-all-symbols-contracts.mjs (1 hunks)
  • components/bitget/actions/future-market-get-candle-data/future-market-get-candle-data.mjs (1 hunks)
  • components/bitget/actions/future-market-get-contracts-oi/future-market-get-contracts-oi.mjs (1 hunks)
  • components/bitget/actions/future-market-get-current-funding-rate/future-market-get-current-funding-rate.mjs (1 hunks)
  • components/bitget/actions/future-market-get-discount-rate/future-market-get-discount-rate.mjs (1 hunks)
  • components/bitget/actions/future-market-get-exchange-rate/future-market-get-exchange-rate.mjs (1 hunks)
  • components/bitget/actions/future-market-get-fills-history/future-market-get-fills-history.mjs (1 hunks)
  • components/bitget/actions/future-market-get-history-candle-data/future-market-get-history-candle-data.mjs (1 hunks)
  • components/bitget/actions/future-market-get-history-funding-rate/future-market-get-history-funding-rate.mjs (1 hunks)
  • components/bitget/actions/future-market-get-history-index-candle-data/future-market-get-history-index-candle-data.mjs (1 hunks)
  • components/bitget/actions/future-market-get-history-mark-candle-data/future-market-get-history-mark-candle-data.mjs (1 hunks)
  • components/bitget/actions/future-market-get-interest-rate/future-market-get-interest-rate.mjs (1 hunks)
  • components/bitget/actions/future-market-get-merge-depth/future-market-get-merge-depth.mjs (1 hunks)
  • components/bitget/actions/future-market-get-open-interest/future-market-get-open-interest.mjs (1 hunks)
  • components/bitget/actions/future-market-get-recent-fills/future-market-get-recent-fills.mjs (1 hunks)
  • components/bitget/actions/future-market-get-symbol-next-funding-time/future-market-get-symbol-next-funding-time.mjs (1 hunks)
  • components/bitget/actions/future-market-get-symbol-price/future-market-get-symbol-price.mjs (1 hunks)
  • components/bitget/actions/future-market-get-ticker/future-market-get-ticker.mjs (1 hunks)
  • components/bitget/actions/future-market-get-tickers/future-market-get-tickers.mjs (1 hunks)
  • components/bitget/actions/future-market-get-vip-fee-rate/future-market-get-vip-fee-rate.mjs (1 hunks)
  • components/bitget/actions/spot-market-get-auction/spot-market-get-auction.mjs (1 hunks)
  • components/bitget/actions/spot-market-get-candle-data/spot-market-get-candle-data.mjs (1 hunks)
  • components/bitget/actions/spot-market-get-coin-list/spot-market-get-coin-list.mjs (1 hunks)
  • components/bitget/actions/spot-market-get-history-candle-data/spot-market-get-history-candle-data.mjs (1 hunks)
  • components/bitget/actions/spot-market-get-market-trades/spot-market-get-market-trades.mjs (1 hunks)
  • components/bitget/actions/spot-market-get-merge-depth/spot-market-get-merge-depth.mjs (1 hunks)
  • components/bitget/actions/spot-market-get-orderbook/spot-market-get-orderbook.mjs (1 hunks)
  • components/bitget/actions/spot-market-get-recent-trades/spot-market-get-recent-trades.mjs (1 hunks)
  • components/bitget/actions/spot-market-get-symbols/spot-market-get-symbols.mjs (1 hunks)
  • components/bitget/actions/spot-market-get-tickers/spot-market-get-tickers.mjs (1 hunks)
  • components/bitget/actions/spot-market-get-vip-fee-rate/spot-market-get-vip-fee-rate.mjs (1 hunks)
  • components/bitget/actions/spot-trade-batch-cancel-orders/spot-trade-batch-cancel-orders.mjs (1 hunks)
  • components/bitget/actions/spot-trade-batch-cancel-replace-order/spot-trade-batch-cancel-replace-order.mjs (1 hunks)
  • components/bitget/actions/spot-trade-batch-place-orders/spot-trade-batch-place-orders.mjs (1 hunks)
  • components/bitget/actions/spot-trade-cancel-order/spot-trade-cancel-order.mjs (1 hunks)
  • components/bitget/actions/spot-trade-cancel-replace-order/spot-trade-cancel-replace-order.mjs (1 hunks)
  • components/bitget/actions/spot-trade-cancel-symbol-orders/spot-trade-cancel-symbol-orders.mjs (1 hunks)
  • components/bitget/actions/spot-trade-get-fills/spot-trade-get-fills.mjs (1 hunks)
  • components/bitget/actions/spot-trade-get-history-orders/spot-trade-get-history-orders.mjs (1 hunks)
  • components/bitget/actions/spot-trade-get-order-info/spot-trade-get-order-info.mjs (1 hunks)
  • components/bitget/actions/spot-trade-get-unfilled-orders/spot-trade-get-unfilled-orders.mjs (1 hunks)
  • components/bitget/actions/spot-trade-place-order/spot-trade-place-order.mjs (1 hunks)
  • components/bitget/bitget.app.mjs (1 hunks)
  • components/bitget/common/constants.mjs (1 hunks)
  • components/bitget/common/utils.mjs (1 hunks)
  • components/bitget/package.json (2 hunks)
✅ Files skipped from review due to trivial changes (2)
  • components/bitget/actions/future-market-get-tickers/future-market-get-tickers.mjs
  • components/bitget/actions/spot-market-get-symbols/spot-market-get-symbols.mjs
🚧 Files skipped from review as they are similar to previous changes (42)
  • components/bitget/common/constants.mjs
  • components/bitget/package.json
  • components/bitget/actions/future-market-get-contracts-oi/future-market-get-contracts-oi.mjs
  • components/bitget/actions/spot-market-get-tickers/spot-market-get-tickers.mjs
  • components/bitget/actions/future-market-get-discount-rate/future-market-get-discount-rate.mjs
  • components/bitget/actions/spot-market-get-candle-data/spot-market-get-candle-data.mjs
  • components/bitget/actions/spot-trade-cancel-symbol-orders/spot-trade-cancel-symbol-orders.mjs
  • components/bitget/actions/future-market-get-ticker/future-market-get-ticker.mjs
  • components/bitget/actions/future-market-get-fills-history/future-market-get-fills-history.mjs
  • components/bitget/actions/future-market-get-history-index-candle-data/future-market-get-history-index-candle-data.mjs
  • components/bitget/actions/spot-market-get-merge-depth/spot-market-get-merge-depth.mjs
  • components/bitget/actions/spot-trade-cancel-order/spot-trade-cancel-order.mjs
  • components/bitget/actions/future-market-get-interest-rate/future-market-get-interest-rate.mjs
  • components/bitget/actions/spot-trade-batch-cancel-orders/spot-trade-batch-cancel-orders.mjs
  • components/bitget/actions/future-market-get-history-candle-data/future-market-get-history-candle-data.mjs
  • components/bitget/actions/spot-trade-get-unfilled-orders/spot-trade-get-unfilled-orders.mjs
  • components/bitget/actions/spot-market-get-vip-fee-rate/spot-market-get-vip-fee-rate.mjs
  • components/bitget/actions/future-market-get-symbol-next-funding-time/future-market-get-symbol-next-funding-time.mjs
  • components/bitget/actions/spot-market-get-coin-list/spot-market-get-coin-list.mjs
  • components/bitget/actions/spot-market-get-history-candle-data/spot-market-get-history-candle-data.mjs
  • components/bitget/actions/spot-market-get-market-trades/spot-market-get-market-trades.mjs
  • components/bitget/actions/future-market-get-recent-fills/future-market-get-recent-fills.mjs
  • components/bitget/actions/future-market-get-current-funding-rate/future-market-get-current-funding-rate.mjs
  • components/bitget/actions/future-market-get-exchange-rate/future-market-get-exchange-rate.mjs
  • components/bitget/actions/spot-trade-batch-place-orders/spot-trade-batch-place-orders.mjs
  • components/bitget/actions/spot-market-get-auction/spot-market-get-auction.mjs
  • components/bitget/actions/future-market-get-merge-depth/future-market-get-merge-depth.mjs
  • components/bitget/actions/spot-trade-get-fills/spot-trade-get-fills.mjs
  • components/bitget/actions/spot-trade-get-order-info/spot-trade-get-order-info.mjs
  • components/bitget/common/utils.mjs
  • components/bitget/actions/future-market-get-all-symbols-contracts/future-market-get-all-symbols-contracts.mjs
  • components/bitget/actions/spot-market-get-orderbook/spot-market-get-orderbook.mjs
  • components/bitget/actions/spot-market-get-recent-trades/spot-market-get-recent-trades.mjs
  • components/bitget/actions/future-market-get-candle-data/future-market-get-candle-data.mjs
  • components/bitget/actions/future-market-get-open-interest/future-market-get-open-interest.mjs
  • components/bitget/actions/spot-trade-batch-cancel-replace-order/spot-trade-batch-cancel-replace-order.mjs
  • components/bitget/actions/spot-trade-get-history-orders/spot-trade-get-history-orders.mjs
  • components/bitget/actions/spot-trade-cancel-replace-order/spot-trade-cancel-replace-order.mjs
  • components/bitget/actions/future-market-get-history-funding-rate/future-market-get-history-funding-rate.mjs
  • components/bitget/actions/future-market-get-vip-fee-rate/future-market-get-vip-fee-rate.mjs
  • components/bitget/actions/future-market-get-history-mark-candle-data/future-market-get-history-mark-candle-data.mjs
  • components/bitget/actions/future-market-get-symbol-price/future-market-get-symbol-price.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). (4)
  • GitHub Check: Publish TypeScript components
  • GitHub Check: pnpm publish
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Lint Code Base
🔇 Additional comments (8)
components/bitget/actions/spot-trade-place-order/spot-trade-place-order.mjs (4)

1-8: LGTM! Well-structured action module.

The action module follows Pipedream conventions with proper imports, key naming, and metadata. The documentation link and version are appropriately set.


129-158: LGTM! Conditional props implementation is correct.

The additionalProps method properly shows the Time in Force field only for limit orders, which is the correct behavior since market orders are executed immediately. The force options are comprehensive and follow standard trading conventions.


159-204: LGTM! Clean API call implementation.

The run method properly destructures all parameters and passes them to the app's placeSpotTradeOrder method. The success message is informative and the response is returned correctly.


9-35: Verify Bitget API orderType values
Ensure the orderType options in your component align exactly with what the Spot Trade Place-Order endpoint expects.

• Location:
‑ components/bitget/actions/spot-trade-place-order/spot-trade-place-order.mjs
‑ props.orderType.options: ["limit", "market"]

Please manually confirm these values against the official docs:
https://www.bitget.com/api-doc/spot/trade/Place-Order

components/bitget/bitget.app.mjs (4)

1-7: LGTM! Proper imports and app structure.

The imports are appropriate for crypto operations and HTTP requests. The app structure follows Pipedream conventions.


8-329: LGTM! Comprehensive prop definitions with dynamic options.

The prop definitions are well-structured with:

  • Proper type definitions and descriptions
  • Async options loaders for dynamic data
  • Comprehensive option sets for trading parameters
  • Good use of mappers for data transformation

The past review comments about method naming issues appear to have been resolved.


331-400: LGTM! Solid authentication and request infrastructure.

The implementation includes:

  • Proper URL construction
  • HMAC-SHA256 signing with base64 encoding
  • Correct pre-hash string generation
  • Comprehensive header assembly
  • Clean request wrapper methods

The authentication flow follows Bitget's API requirements correctly.


407-661: LGTM! Comprehensive API method coverage.

The API methods provide excellent coverage of Bitget's endpoints:

  • All spot market operations (coins, symbols, tickers, orderbooks, candles, trades)
  • Complete spot trade operations (place, cancel, batch operations, order info, fills)
  • Extensive futures market operations (tickers, candles, funding rates, open interest)

The method naming follows a clear pattern and the endpoint paths are correctly mapped.

@jcortes jcortes force-pushed the bitget-new-components branch from 9f68ab0 to 0f2f1f4 Compare July 21, 2025 15:18
@jcortes
Copy link
Collaborator Author

jcortes commented Jul 21, 2025

/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: 3

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

389-400: Consider adding error handling to API requests

The makeRequest method doesn't include any error handling. Consider wrapping the axios call in a try-catch block to handle API errors gracefully.

 makeRequest({
   $ = this, path, ...args
 }) {
+  try {
     return axios($, {
       ...args,
       url: this.getUrl(path),
       headers: this.getHeaders({
         path,
         ...args,
       }),
     });
+  } catch (error) {
+    // Log error details for debugging
+    console.error(`API request failed for ${path}:`, error.response?.data || error.message);
+    throw error;
+  }
 },
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9f68ab0 and 0f2f1f4.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (46)
  • components/bitget/actions/future-market-get-all-symbols-contracts/future-market-get-all-symbols-contracts.mjs (1 hunks)
  • components/bitget/actions/future-market-get-candle-data/future-market-get-candle-data.mjs (1 hunks)
  • components/bitget/actions/future-market-get-contracts-oi/future-market-get-contracts-oi.mjs (1 hunks)
  • components/bitget/actions/future-market-get-current-funding-rate/future-market-get-current-funding-rate.mjs (1 hunks)
  • components/bitget/actions/future-market-get-discount-rate/future-market-get-discount-rate.mjs (1 hunks)
  • components/bitget/actions/future-market-get-exchange-rate/future-market-get-exchange-rate.mjs (1 hunks)
  • components/bitget/actions/future-market-get-fills-history/future-market-get-fills-history.mjs (1 hunks)
  • components/bitget/actions/future-market-get-history-candle-data/future-market-get-history-candle-data.mjs (1 hunks)
  • components/bitget/actions/future-market-get-history-funding-rate/future-market-get-history-funding-rate.mjs (1 hunks)
  • components/bitget/actions/future-market-get-history-index-candle-data/future-market-get-history-index-candle-data.mjs (1 hunks)
  • components/bitget/actions/future-market-get-history-mark-candle-data/future-market-get-history-mark-candle-data.mjs (1 hunks)
  • components/bitget/actions/future-market-get-interest-rate/future-market-get-interest-rate.mjs (1 hunks)
  • components/bitget/actions/future-market-get-merge-depth/future-market-get-merge-depth.mjs (1 hunks)
  • components/bitget/actions/future-market-get-open-interest/future-market-get-open-interest.mjs (1 hunks)
  • components/bitget/actions/future-market-get-recent-fills/future-market-get-recent-fills.mjs (1 hunks)
  • components/bitget/actions/future-market-get-symbol-next-funding-time/future-market-get-symbol-next-funding-time.mjs (1 hunks)
  • components/bitget/actions/future-market-get-symbol-price/future-market-get-symbol-price.mjs (1 hunks)
  • components/bitget/actions/future-market-get-ticker/future-market-get-ticker.mjs (1 hunks)
  • components/bitget/actions/future-market-get-tickers/future-market-get-tickers.mjs (1 hunks)
  • components/bitget/actions/future-market-get-vip-fee-rate/future-market-get-vip-fee-rate.mjs (1 hunks)
  • components/bitget/actions/spot-market-get-auction/spot-market-get-auction.mjs (1 hunks)
  • components/bitget/actions/spot-market-get-candle-data/spot-market-get-candle-data.mjs (1 hunks)
  • components/bitget/actions/spot-market-get-coin-list/spot-market-get-coin-list.mjs (1 hunks)
  • components/bitget/actions/spot-market-get-history-candle-data/spot-market-get-history-candle-data.mjs (1 hunks)
  • components/bitget/actions/spot-market-get-market-trades/spot-market-get-market-trades.mjs (1 hunks)
  • components/bitget/actions/spot-market-get-merge-depth/spot-market-get-merge-depth.mjs (1 hunks)
  • components/bitget/actions/spot-market-get-orderbook/spot-market-get-orderbook.mjs (1 hunks)
  • components/bitget/actions/spot-market-get-recent-trades/spot-market-get-recent-trades.mjs (1 hunks)
  • components/bitget/actions/spot-market-get-symbols/spot-market-get-symbols.mjs (1 hunks)
  • components/bitget/actions/spot-market-get-tickers/spot-market-get-tickers.mjs (1 hunks)
  • components/bitget/actions/spot-market-get-vip-fee-rate/spot-market-get-vip-fee-rate.mjs (1 hunks)
  • components/bitget/actions/spot-trade-batch-cancel-orders/spot-trade-batch-cancel-orders.mjs (1 hunks)
  • components/bitget/actions/spot-trade-batch-cancel-replace-order/spot-trade-batch-cancel-replace-order.mjs (1 hunks)
  • components/bitget/actions/spot-trade-batch-place-orders/spot-trade-batch-place-orders.mjs (1 hunks)
  • components/bitget/actions/spot-trade-cancel-order/spot-trade-cancel-order.mjs (1 hunks)
  • components/bitget/actions/spot-trade-cancel-replace-order/spot-trade-cancel-replace-order.mjs (1 hunks)
  • components/bitget/actions/spot-trade-cancel-symbol-orders/spot-trade-cancel-symbol-orders.mjs (1 hunks)
  • components/bitget/actions/spot-trade-get-fills/spot-trade-get-fills.mjs (1 hunks)
  • components/bitget/actions/spot-trade-get-history-orders/spot-trade-get-history-orders.mjs (1 hunks)
  • components/bitget/actions/spot-trade-get-order-info/spot-trade-get-order-info.mjs (1 hunks)
  • components/bitget/actions/spot-trade-get-unfilled-orders/spot-trade-get-unfilled-orders.mjs (1 hunks)
  • components/bitget/actions/spot-trade-place-order/spot-trade-place-order.mjs (1 hunks)
  • components/bitget/bitget.app.mjs (1 hunks)
  • components/bitget/common/constants.mjs (1 hunks)
  • components/bitget/common/utils.mjs (1 hunks)
  • components/bitget/package.json (2 hunks)
✅ Files skipped from review due to trivial changes (3)
  • components/bitget/actions/future-market-get-current-funding-rate/future-market-get-current-funding-rate.mjs
  • components/bitget/actions/spot-market-get-candle-data/spot-market-get-candle-data.mjs
  • components/bitget/actions/spot-market-get-recent-trades/spot-market-get-recent-trades.mjs
🚧 Files skipped from review as they are similar to previous changes (41)
  • components/bitget/common/constants.mjs
  • components/bitget/package.json
  • components/bitget/actions/future-market-get-recent-fills/future-market-get-recent-fills.mjs
  • components/bitget/actions/spot-trade-get-unfilled-orders/spot-trade-get-unfilled-orders.mjs
  • components/bitget/actions/spot-market-get-vip-fee-rate/spot-market-get-vip-fee-rate.mjs
  • components/bitget/actions/future-market-get-tickers/future-market-get-tickers.mjs
  • components/bitget/actions/future-market-get-open-interest/future-market-get-open-interest.mjs
  • components/bitget/actions/spot-market-get-tickers/spot-market-get-tickers.mjs
  • components/bitget/actions/future-market-get-symbol-next-funding-time/future-market-get-symbol-next-funding-time.mjs
  • components/bitget/actions/spot-market-get-symbols/spot-market-get-symbols.mjs
  • components/bitget/actions/spot-trade-cancel-order/spot-trade-cancel-order.mjs
  • components/bitget/actions/spot-market-get-market-trades/spot-market-get-market-trades.mjs
  • components/bitget/actions/future-market-get-fills-history/future-market-get-fills-history.mjs
  • components/bitget/actions/spot-trade-cancel-symbol-orders/spot-trade-cancel-symbol-orders.mjs
  • components/bitget/actions/spot-trade-cancel-replace-order/spot-trade-cancel-replace-order.mjs
  • components/bitget/actions/future-market-get-all-symbols-contracts/future-market-get-all-symbols-contracts.mjs
  • components/bitget/actions/future-market-get-contracts-oi/future-market-get-contracts-oi.mjs
  • components/bitget/actions/future-market-get-exchange-rate/future-market-get-exchange-rate.mjs
  • components/bitget/actions/future-market-get-history-candle-data/future-market-get-history-candle-data.mjs
  • components/bitget/actions/spot-trade-batch-cancel-orders/spot-trade-batch-cancel-orders.mjs
  • components/bitget/actions/future-market-get-ticker/future-market-get-ticker.mjs
  • components/bitget/actions/future-market-get-merge-depth/future-market-get-merge-depth.mjs
  • components/bitget/actions/future-market-get-interest-rate/future-market-get-interest-rate.mjs
  • components/bitget/actions/spot-trade-get-order-info/spot-trade-get-order-info.mjs
  • components/bitget/common/utils.mjs
  • components/bitget/actions/future-market-get-vip-fee-rate/future-market-get-vip-fee-rate.mjs
  • components/bitget/actions/spot-market-get-auction/spot-market-get-auction.mjs
  • components/bitget/actions/future-market-get-history-index-candle-data/future-market-get-history-index-candle-data.mjs
  • components/bitget/actions/spot-market-get-history-candle-data/spot-market-get-history-candle-data.mjs
  • components/bitget/actions/spot-market-get-orderbook/spot-market-get-orderbook.mjs
  • components/bitget/actions/future-market-get-history-funding-rate/future-market-get-history-funding-rate.mjs
  • components/bitget/actions/spot-trade-get-history-orders/spot-trade-get-history-orders.mjs
  • components/bitget/actions/spot-trade-place-order/spot-trade-place-order.mjs
  • components/bitget/actions/spot-market-get-coin-list/spot-market-get-coin-list.mjs
  • components/bitget/actions/future-market-get-symbol-price/future-market-get-symbol-price.mjs
  • components/bitget/actions/spot-market-get-merge-depth/spot-market-get-merge-depth.mjs
  • components/bitget/actions/spot-trade-get-fills/spot-trade-get-fills.mjs
  • components/bitget/actions/spot-trade-batch-cancel-replace-order/spot-trade-batch-cancel-replace-order.mjs
  • components/bitget/actions/future-market-get-discount-rate/future-market-get-discount-rate.mjs
  • components/bitget/actions/future-market-get-candle-data/future-market-get-candle-data.mjs
  • components/bitget/actions/future-market-get-history-mark-candle-data/future-market-get-history-mark-candle-data.mjs
🧰 Additional context used
🧬 Code Graph Analysis (1)
components/bitget/actions/spot-trade-batch-place-orders/spot-trade-batch-place-orders.mjs (2)
components/bitget/actions/spot-trade-batch-cancel-replace-order/spot-trade-batch-cancel-replace-order.mjs (2)
  • orderList (49-49)
  • rawOrderList (44-47)
components/bitget/actions/spot-trade-batch-cancel-orders/spot-trade-batch-cancel-orders.mjs (2)
  • orderList (58-58)
  • rawOrderList (51-56)
⏰ 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: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Lint Code Base
  • GitHub Check: pnpm publish

Comment on lines +33 to +61
parseOrderList(orderList) {
return orderList?.map((order) => {
try {
if (this.batchMode === "multiple" && !order.symbol) {
throw new Error("`symbol` is required for each order in multiple mode");
}
if (!order.side) {
throw new Error("`side` is required for each order");
}
if (!order.orderType) {
throw new Error("`orderType` is required for each order");
}
if (!order.force && order.orderType !== "market") {
throw new Error("`force` is required for each order when orderType is not market");
}
if (!order.size) {
throw new Error("`size` is required for each order");
}

if (order.orderType === "limit" && !order.price) {
throw new Error("`price` is required for limit orders");
}

return order;
} catch (error) {
throw new ConfigurationError(`Invalid order JSON: ${error.message}`);
}
});
},
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: Missing JSON parsing in parseOrderList method

The method attempts to validate properties on order objects, but according to the prop definition, each order is a JSON string. You need to parse the JSON string before accessing its properties.

Apply this fix to parse each order:

 parseOrderList(orderList) {
   return orderList?.map((order) => {
     try {
+      const parsedOrder = typeof order === 'string' ? JSON.parse(order) : order;
-      if (this.batchMode === "multiple" && !order.symbol) {
+      if (this.batchMode === "multiple" && !parsedOrder.symbol) {
         throw new Error("`symbol` is required for each order in multiple mode");
       }
-      if (!order.side) {
+      if (!parsedOrder.side) {
         throw new Error("`side` is required for each order");
       }
-      if (!order.orderType) {
+      if (!parsedOrder.orderType) {
         throw new Error("`orderType` is required for each order");
       }
-      if (!order.force && order.orderType !== "market") {
+      if (!parsedOrder.force && parsedOrder.orderType !== "market") {
         throw new Error("`force` is required for each order when orderType is not market");
       }
-      if (!order.size) {
+      if (!parsedOrder.size) {
         throw new Error("`size` is required for each order");
       }

-      if (order.orderType === "limit" && !order.price) {
+      if (parsedOrder.orderType === "limit" && !parsedOrder.price) {
         throw new Error("`price` is required for limit orders");
       }

-      return order;
+      return parsedOrder;
     } catch (error) {
+      if (error.name === 'SyntaxError') {
+        throw new ConfigurationError(`Invalid JSON format: ${error.message}`);
+      }
       throw new ConfigurationError(`Invalid order JSON: ${error.message}`);
     }
   });
 },
📝 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
parseOrderList(orderList) {
return orderList?.map((order) => {
try {
if (this.batchMode === "multiple" && !order.symbol) {
throw new Error("`symbol` is required for each order in multiple mode");
}
if (!order.side) {
throw new Error("`side` is required for each order");
}
if (!order.orderType) {
throw new Error("`orderType` is required for each order");
}
if (!order.force && order.orderType !== "market") {
throw new Error("`force` is required for each order when orderType is not market");
}
if (!order.size) {
throw new Error("`size` is required for each order");
}
if (order.orderType === "limit" && !order.price) {
throw new Error("`price` is required for limit orders");
}
return order;
} catch (error) {
throw new ConfigurationError(`Invalid order JSON: ${error.message}`);
}
});
},
parseOrderList(orderList) {
return orderList?.map((order) => {
try {
const parsedOrder = typeof order === 'string' ? JSON.parse(order) : order;
if (this.batchMode === "multiple" && !parsedOrder.symbol) {
throw new Error("`symbol` is required for each order in multiple mode");
}
if (!parsedOrder.side) {
throw new Error("`side` is required for each order");
}
if (!parsedOrder.orderType) {
throw new Error("`orderType` is required for each order");
}
if (!parsedOrder.force && parsedOrder.orderType !== "market") {
throw new Error("`force` is required for each order when orderType is not market");
}
if (!parsedOrder.size) {
throw new Error("`size` is required for each order");
}
if (parsedOrder.orderType === "limit" && !parsedOrder.price) {
throw new Error("`price` is required for limit orders");
}
return parsedOrder;
} catch (error) {
if (error.name === 'SyntaxError') {
throw new ConfigurationError(`Invalid JSON format: ${error.message}`);
}
throw new ConfigurationError(`Invalid order JSON: ${error.message}`);
}
});
},
🤖 Prompt for AI Agents
In
components/bitget/actions/spot-trade-batch-place-orders/spot-trade-batch-place-orders.mjs
around lines 33 to 61, the parseOrderList method treats each order as an object
but orders are actually JSON strings. Fix this by parsing each order string into
an object using JSON.parse before validating its properties. Wrap the JSON.parse
call in the try block to catch parsing errors and proceed with the existing
validation logic on the parsed object.

optional: true,
async options({ mapper = ({ symbol }) => symbol }) {
const response = await this.getSpotMarketSymbols();
console.log("response!!!", 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

Remove debug console.log statement

Debug logging should not be committed to production code.

-        console.log("response!!!", response);
📝 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
console.log("response!!!", response);
🤖 Prompt for AI Agents
In components/bitget/bitget.app.mjs at line 26, remove the debug console.log
statement that prints the response. This debug logging is not suitable for
production code and should be deleted to keep the code clean.

timestamp,
...args,
});
console.log("message!!!", message);
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

Remove debug console.log statement

Debug logging should not be committed to production code.

-      console.log("message!!!", message);
📝 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
console.log("message!!!", message);
🤖 Prompt for AI Agents
In components/bitget/bitget.app.mjs at line 376, remove the debug console.log
statement that outputs "message!!!" and the message variable, as debug logging
should not be present in production code.

@jcortes jcortes merged commit 8138a13 into master Jul 21, 2025
11 checks passed
@jcortes jcortes deleted the bitget-new-components branch July 21, 2025 17:46
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.

[APP] Bitget

3 participants