-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[Components] Bitget - new components #17685
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
WalkthroughA 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
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
Estimated code review effort4 (~90 minutes) Assessment against linked issues
Poem
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
components/bitget/actions/future-market-get-all-symbols-contracts/future-market-get-all-symbols-contracts.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/bitget/actions/future-market-get-candle-data/future-market-get-candle-data.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/bitget/actions/future-market-get-contracts-oi/future-market-get-contracts-oi.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
✨ Finishing Touches
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. 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: 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.datainstead of the fullresponseobject, 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: falsedeclaration 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 parameterThe description mentions "Default:
100" but no default value is set in the prop definition. Consider addingdefault: 100to 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 parameterThe 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 informationThe 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
orderTypevalues 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 requiredFor 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
idLessThanmight be confusing. Consider using a more descriptive name likebeforeOrderIdorolderThanto 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
granularityprop 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:
- Consolidating to a single format
- Adding clearer labels to distinguish between formats
- 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}`; + }
.../actions/future-market-get-all-symbols-contracts/future-market-get-all-symbols-contracts.mjs
Show resolved
Hide resolved
components/bitget/actions/future-market-get-candle-data/future-market-get-candle-data.mjs
Show resolved
Hide resolved
components/bitget/actions/future-market-get-candle-data/future-market-get-candle-data.mjs
Show resolved
Hide resolved
components/bitget/actions/future-market-get-candle-data/future-market-get-candle-data.mjs
Show resolved
Hide resolved
...s/bitget/actions/spot-market-get-history-candle-data/spot-market-get-history-candle-data.mjs
Show resolved
Hide resolved
e5ab2dd to
fe74298
Compare
fe74298 to
9f68ab0
Compare
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: 0
♻️ Duplicate comments (1)
components/bitget/bitget.app.mjs (1)
389-400: Consider adding error handling to API requests.The
makeRequestmethod 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
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis 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
additionalPropsmethod 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
runmethod properly destructures all parameters and passes them to the app'splaceSpotTradeOrdermethod. The success message is informative and the response is returned correctly.
9-35: Verify Bitget APIorderTypevalues
Ensure theorderTypeoptions 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-Ordercomponents/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.
9f68ab0 to
0f2f1f4
Compare
|
/approve |
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: 3
♻️ Duplicate comments (1)
components/bitget/bitget.app.mjs (1)
389-400: Consider adding error handling to API requestsThe
makeRequestmethod 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
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis 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
| 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}`); | ||
| } | ||
| }); | ||
| }, |
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.
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.
| 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); |
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.
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.
| 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); |
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.
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.
| 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.
WHY
Resolves #10113
Summary by CodeRabbit
New Features
Chores