Skip to content

Conversation

carlosmiei
Copy link
Collaborator

No description provided.

@carlosmiei carlosmiei requested a review from Copilot September 23, 2025 15:41
@carlosmiei carlosmiei self-assigned this Sep 23, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds demo trading functionality to the Binance API client, providing an alternative to the existing testnet support. The implementation introduces a new demo configuration option that routes API calls to Binance's demo trading environment instead of production or testnet endpoints.

  • Added demo boolean configuration option to enable demo trading mode
  • Implemented URL routing logic to use demo endpoints when demo mode is enabled
  • Refactored WebSocket connection logic to use centralized URL getter methods

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/types.ts Added demo boolean property to the IConstructorArgs interface
src/node-binance-api.ts Added demo endpoint URLs, configuration handling, URL getter methods, and refactored WebSocket connections to use demo endpoints
README.md Updated feature list to include demo trading support and marked testnet as deprecated

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines 247 to 251
getSpotUrl() {
if (this.Options.demo) return this.baseDemo;
if (this.Options.test) return this.baseTest;
return this.base;
}
Copy link

Copilot AI Sep 23, 2025

Choose a reason for hiding this comment

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

The demo and test options can both be enabled simultaneously, but the current logic prioritizes demo over test. Consider adding validation to prevent both options from being enabled at the same time, or document the precedence behavior clearly.

Copilot uses AI. Check for mistakes.

Comment on lines +5702 to +5703
// const url = (this.Options.test) ? this.fapiTest : this.fapi;
const url = this.getFapiUrl();
Copy link

Copilot AI Sep 23, 2025

Choose a reason for hiding this comment

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

Remove the commented-out code. Dead code should be deleted rather than commented out.

Copilot uses AI. Check for mistakes.

@carlosmiei carlosmiei merged commit 78865fc into master Sep 24, 2025
1 check failed
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.

1 participant