fix(withdraws): min withdraw amount (#3916)

This commit is contained in:
Art 2023-05-23 18:52:48 +02:00 committed by GitHub
parent 589785ce09
commit 2215864d0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,7 +34,10 @@ export const useWithdrawAsset = (
? new BigNumber(addDecimal(account.balance, asset.decimals))
: new BigNumber(0);
const min = asset
? new BigNumber(addDecimal('1', asset.decimals))
? BigNumber.max(
new BigNumber(addDecimal('1', asset.decimals)),
new BigNumber(addDecimal(asset.quantum, asset.decimals))
)
: new BigNumber(0);
// Query collateral bridge for threshold for selected asset
// and subsequent delay if withdrawal amount is larger than it