mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-12-05 16:58:01 +00:00
Fix human amount detection in .payment
This commit is contained in:
@@ -517,7 +517,7 @@ Transaction.prototype.payment = function (src, dst, amount) {
|
||||
throw new Error('Payment destination address invalid');
|
||||
}
|
||||
|
||||
if (typeof amount === 'string' && !Number(amount)) {
|
||||
if (/^[\d]+[A-Z]{3}$/.test(amount)) {
|
||||
amount = Amount.from_human(amount);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user