Skip to content

feat: add query margin mode endpoint#101

Open
MolhamHamwi wants to merge 1 commit into
singlesly:mainfrom
MolhamHamwi:fix/query-margin-mode
Open

feat: add query margin mode endpoint#101
MolhamHamwi wants to merge 1 commit into
singlesly:mainfrom
MolhamHamwi:fix/query-margin-mode

Conversation

@MolhamHamwi
Copy link
Copy Markdown

Summary

  • Add BingxQueryMarginModeEndpoint for GET /openApi/swap/v2/trade/marginType
  • Expose it through TradeService.queryMarginMode(...)
  • Export the endpoint and add unit coverage for endpoint metadata/service wiring

Closes #86

Validation

  • npm test -- --runInBand trade.service.spec.ts
  • npm run build
  • ./node_modules/.bin/eslint src/bingx/endpoints/bingx-query-margin-mode-endpoint.ts src/bingx-client/services/trade.service.ts src/bingx-client/services/trade.service.spec.ts

Copilot AI review requested due to automatic review settings May 12, 2026 05:13
Copy link
Copy Markdown

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

Adds support for querying the current swap margin mode via the BingX REST API, wiring a new endpoint into the client TradeService and exporting it for public consumption.

Changes:

  • Added BingxQueryMarginModeEndpoint for GET /openApi/swap/v2/trade/marginType
  • Exposed the endpoint via TradeService.queryMarginMode(symbol, account)
  • Exported the endpoint from the endpoints barrel and added unit tests for endpoint metadata and service wiring

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/bingx/endpoints/index.ts Re-exports the new query margin mode endpoint.
src/bingx/endpoints/bingx-query-margin-mode-endpoint.ts Implements the new signed GET endpoint and response typing.
src/bingx-client/services/trade.service.ts Adds queryMarginMode(...) to execute the new endpoint.
src/bingx-client/services/trade.service.spec.ts Adds unit tests validating endpoint metadata and service dispatch.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +88 to +92
public queryMarginMode(symbol: string, account: AccountInterface) {
return this.requestExecutor.execute(
new BingxQueryMarginModeEndpoint(symbol, account),
);
}
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.

Implement query margin mode endpoint

2 participants