Skip to content

Preserve decimal margin borrow amounts - #253

Closed
JMak-Security wants to merge 1 commit into
binance:masterfrom
JMak-Security:publish-fix-margin-borrow-amount-decimal
Closed

JMak-Security wants to merge 1 commit into
binance:masterfrom
JMak-Security:publish-fix-margin-borrow-amount-decimal

Conversation

@JMak-Security

Copy link
Copy Markdown

Summary

MarginAccountNewOrderResponse.marginBuyBorrowAmount was generated as a Long, so Gson could not deserialize fractional borrow amounts such as 0.001. Change the property, fluent setter, getter, and setter to String, matching the decimal representation and the corresponding OCO response model. Update the generated model documentation as well.

This changes the public Java accessor type from Long to String; callers should treat the amount as a decimal string to preserve its exact value and scale.

Validation

  • mvn -f clients/margin-trading/pom.xml test — all 69 module tests passed.
  • Added regression coverage for quoted and numeric fractional JSON values, round-tripping, trailing-zero scale (0.00100), null, and missing values.

Fixes #221.

Fixes binance#221

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@theo-s68

Copy link
Copy Markdown
Collaborator

Hello,

This issue has been fixed in the version 8.0.1.

Thank you for the contribution.

@theo-s68 theo-s68 closed this Nov 17, 2026
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.

api.marginAccountNewOrder Error

2 participants