Skip to content

[EOM-2904] Remove pending_deposit and pending_withdrawal from Balance#72

Open
axe-bitso wants to merge 1 commit into
masterfrom
EOM-2904-remove-pending-balance-fields
Open

[EOM-2904] Remove pending_deposit and pending_withdrawal from Balance#72
axe-bitso wants to merge 1 commit into
masterfrom
EOM-2904-remove-pending-balance-fields

Conversation

@axe-bitso

@axe-bitso axe-bitso commented Jul 22, 2026

Copy link
Copy Markdown

Summary

Removes pending_deposit and pending_withdrawal from BitsoBalance.Balance: the two fields, their constructor parameters, four getters/setters, the two Helpers.getBD parse calls, and the entries in the privateAccountBalance.json test fixture.

Why

Pending balances are being removed from the wallet domain (EOM-2904). The /v3/balance API will stop returning these keys. Once absent, the current SDK behaviour is strictly worse than removal: Helpers.getBD logs a stack trace to stderr for every missing key on every balance call and leaves the fields null, so any consumer touching the getters gets an NPE.

Breaking change

Balance's public constructor loses two parameters and the class loses two getter/setter pairs — the next release should be a major version bump, with a changelog note pointing at the API-side removal.

Rollout note

This SDK release should land before (or with) the API-side removal. Consumers pinned to older versions (Maven Central 3.0.3, JitPack tags) will see the null-field + stderr-noise degradation once the API stops emitting the keys — that's driven by the API change, not this PR.

Verification

  • No remaining references to the removed fields anywhere in the repo
  • No other callers of the Balance constructor or the removed getters
  • Verified org-wide that no internal service uses these getters (checked aum-reconciliation-v2, the only internal production consumer of this SDK — it only uses Helpers.parseJson)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Breaking Changes
    • Simplified balance information to include currency, total, locked, and available amounts.
    • Removed pending deposit and pending withdrawal fields from balance results.
    • Updated balance response data to reflect the streamlined format.

Pending balances are being removed from the wallet domain. The /v3/balance
API will stop returning these fields; once absent, Helpers.getBD would log
a stack trace per currency per call and leave the fields null. Removing
them from the SDK model ahead of the API change.

Breaking change for the public SDK API: Balance loses two getters/setters
and two constructor parameters — next release should be a major version.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: b6856805-1a82-4b8d-8035-c57ac4cf255a

📥 Commits

Reviewing files that changed from the base of the PR and between 7d98e2c and 87ae843.

📒 Files selected for processing (2)
  • src/main/java/com/bitso/BitsoBalance.java
  • src/test/java/JSONFiles/privateAccountBalance.json
📜 Recent review details
🧰 Additional context used
📓 Path-based instructions (1)
**/*

⚙️ CodeRabbit configuration file

**/*: IMPORTANT PLATFORM CONTEXT:

  • All development environments are macOS or Linux containers
  • Windows is NOT a supported platform
  • Do NOT suggest Windows-specific fixes or compatibility
  • Do NOT flag issues about Windows path separators, line endings, or file permissions
  • Cross-platform Node.js code should assume POSIX paths
  • Shell scripts target bash/zsh only

When reviewing:

  • Skip Windows compatibility concerns
  • Assume fs.chmodSync works (Unix permissions)
  • Assume forward slashes in paths
  • Assume LF line endings

Files:

  • src/test/java/JSONFiles/privateAccountBalance.json
  • src/main/java/com/bitso/BitsoBalance.java
🔇 Additional comments (3)
src/main/java/com/bitso/BitsoBalance.java (2)

14-25: LGTM!


45-50: 🗄️ Data Integrity & Integration

Verify release metadata for this breaking public API change.

Balance is public; changing its constructor and removing public pending accessors breaks source and binary compatibility. Confirm the full stack bumps the major version and documents the migration in the changelog.

Also applies to: 83-86

src/test/java/JSONFiles/privateAccountBalance.json (1)

8-28: LGTM!


📝 Walkthrough

Walkthrough

The balance parser and nested Balance model now retain only currency, total, locked, and available values. Pending deposit and withdrawal accessors were removed, and the account balance JSON fixture was updated accordingly.

Changes

Balance model simplification

Layer / File(s) Summary
Balance contract and parsing
src/main/java/com/bitso/BitsoBalance.java, src/test/java/JSONFiles/privateAccountBalance.json
The parser and Balance constructor no longer process pending deposit or withdrawal values; the corresponding public accessors were removed, and the fixture payload now contains only the remaining balance fields.

Estimated code review effort: 2 (Simple) | ~10 minutes

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch EOM-2904-remove-pending-balance-fields

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.

🔧 Checkov (3.3.8)
src/test/java/JSONFiles/privateAccountBalance.json

Traceback (most recent call last):
File "/usr/local/bin/checkov", line 2, in
from checkov.main import Checkov
ModuleNotFoundError: No module named 'checkov'


Comment @coderabbitai help to get the list of available commands.

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