HomePhabricator

[Cashtab] Validate agora accepts vs user balance

Description

[Cashtab] Validate agora accepts vs user balance

Summary:
Right now, Cashtab does not do this validation. So you can try to buy more than you can afford and expect an error at the tx building step.

This is lazy. We should validate for "can we afford this tx?" before we try to buy it.

We will improve this implementation going forward, but this is a key first step to supporting stuff like a "buy max" button.

The reason this was not implemented from the get go -- we need to calculate the actual price using agora methods after some validation is already done.

Test Plan: npm test

Reviewers: #bitcoin_abc, emack

Reviewed By: #bitcoin_abc, emack

Differential Revision: https://reviews.bitcoinabc.org/D17739

Details

Provenance
bytesofmanAuthored on Mon, Mar 3, 19:03
bytesofmanPushed on Tue, Mar 4, 00:49
Reviewer
Restricted Project
Differential Revision
D17739: [Cashtab] Validate agora accepts vs user balance
Parents
rABC7d9a31f6afb5: [Cashtab] Do not reset forms on fiat price change unless price is unavailable
Branches
Unknown
Tags
Unknown