diff --git a/js/waves.ui.js b/js/waves.ui.js index df2e7ae876..11d1aac423 100644 --- a/js/waves.ui.js +++ b/js/waves.ui.js @@ -547,8 +547,7 @@ var Waves = (function(Waves, $, undefined) { } }); $.validator.addMethod('address', function(value, element){ - return this.optional(element) || Waves.Addressing.validateDisplayAddress(value) || - Waves.Addressing.validateRawAddress(value); + return this.optional(element) || Waves.Addressing.validateDisplayAddress(value); }, "Account number must be a sequence of 35 alphanumeric characters with no spaces, optionally starting with '1W'"); $.validator.addMethod('decimal', function(value, element) { return this.optional(element) || /^(?:-?\d+)?(?:\.\d+)?$/.test(value); diff --git a/js/waves.ui.wallet.js b/js/waves.ui.wallet.js index 4fc226e154..4d34f09e68 100644 --- a/js/waves.ui.wallet.js +++ b/js/waves.ui.wallet.js @@ -106,7 +106,7 @@ var Waves = (function(Waves, $, undefined) { maxSend = maxSend / Math.pow(10,8); var sendAmount = Number($("#wavessendamount").val().replace(/\s+/g, '')); - if(sendAmount > maxSend) { + if (sendAmount > maxSend) { $.growl.error({ message: 'Error: Not enough funds' }); return; } @@ -118,16 +118,8 @@ var Waves = (function(Waves, $, undefined) { var senderPublic = Base58.decode(Waves.publicKey); var senderPrivate = Base58.decode(Waves.privateKey); var addressText = $("#wavesrecipient").val().replace(/\s+/g, ''); - var recipient = undefined; - if (Waves.Addressing.validateDisplayAddress(addressText)) - recipient = Waves.Addressing.fromDisplayAddress(addressText); - else if (Waves.Addressing.validateRawAddress(addressText)) - recipient = Waves.Addressing.fromRawAddress(addressText); - else { - // we shouldn't see this message, because form is validated - $.growl.error({ message: 'Unknown address format' }); - return; - } + // validate display address knows that the address prefix is optional + var recipient = Waves.Addressing.fromDisplayAddress(addressText); var wavesTime = Number(Waves.getTime()); @@ -138,11 +130,6 @@ var Waves = (function(Waves, $, undefined) { //var verify = Waves.curve25519.verify(senderPublic, signatureData, Base58.decode(signature)); - if(sendAmount > maxSend) { - $.growl.error({ message: 'Error: Not enough funds' }); - return; - } - var data = { "recipient": recipient.getRawAddress(), "timestamp": wavesTime,