Skip to content

Conversation

ap211unitech
Copy link
Member

@ap211unitech ap211unitech commented Aug 14, 2025

📝 Description

This PR fixes the calculation of the transferable balance in the derive method. The incorrect calculation was causing issues such as polkadot-js/apps#11739.

This change is inspired by the implementation in

availableBalance: api.registry.createType('Balance', allLocked ? 0 : bnMax(new BN(0), data?.freeBalance ? data.freeBalance.sub(lockedBalance) : new BN(0))),
, specifically how the available balance is calculated there.

Copy link
Contributor

@valentinfernandez1 valentinfernandez1 left a comment

Choose a reason for hiding this comment

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

🚀

@ap211unitech ap211unitech merged commit b848c5c into master Aug 19, 2025
4 checks passed
@ap211unitech ap211unitech deleted the fix/transferrable-balance branch August 19, 2025 08:25
@polkadot-js-bot
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@polkadot-js polkadot-js locked as resolved and limited conversation to collaborators Aug 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants