Skip to content
This repository was archived by the owner on Nov 30, 2020. It is now read-only.
This repository was archived by the owner on Nov 30, 2020. It is now read-only.

Fix checking the maximum amount user can send #42

Description

@bartekn

https://github.com/stellar/account-viewer/blob/master/controllers/send-widget.controller.es6

        let minimumBalance = 20 + (account.subentry_count) * 10;
        let nativeBalance = _(account.balances).find(balance => balance.asset_type === 'native').balance;
        let maxSend = new BigNumber(nativeBalance).minus(minimumBalance);
        if (maxSend.lt(this.amount)) {
          throw new BasicClientError('InsufficientBalanceError', {maxSend});
        }

We're not subtracting transaction fee from maxSend. Thanks @briangale for catching this!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions