diff --git a/src/components/send/send.js b/src/components/send/send.js index 7f9d35ab4..84cd6ee5d 100644 --- a/src/components/send/send.js +++ b/src/components/send/send.js @@ -26,7 +26,7 @@ class Send extends React.Component { ...authStatePrefill(), }; this.inputValidationRegexps = { - recipient: /^\d{1,21}[L|l]$/, + recipient: /^\d{1,21}L$/, amount: /^\d+(\.\d{1,8})?$/, }; } diff --git a/src/utils/api/account.js b/src/utils/api/account.js index 02d726000..5a841232e 100644 --- a/src/utils/api/account.js +++ b/src/utils/api/account.js @@ -1,7 +1,7 @@ import Lisk from 'lisk-elements'; export const getAccount = (activePeer, address) => - new Promise((resolve) => { + new Promise((resolve, reject) => { activePeer.accounts.get({ address }).then((res) => { if (res.data.length > 0) { resolve({ @@ -16,21 +16,21 @@ export const getAccount = (activePeer, address) => balance: 0, }); } - }); + }).catch(reject); }); export const setSecondPassphrase = (activePeer, secondPassphrase, publicKey, passphrase) => - new Promise((resolve) => { + new Promise((resolve, reject) => { const transaction = Lisk.transaction .registerSecondPassphrase({ passphrase, secondPassphrase }); activePeer.transactions.broadcast(transaction).then(() => { resolve(transaction); - }); + }).catch(reject); }); export const send = (activePeer, recipientId, amount, passphrase, secondPassphrase = null, data = null) => - new Promise((resolve) => { + new Promise((resolve, reject) => { const transaction = Lisk.transaction .transfer({ recipientId, @@ -41,7 +41,7 @@ export const send = (activePeer, recipientId, amount, }); activePeer.transactions.broadcast(transaction).then(() => { resolve(transaction); - }); + }).catch(reject); }); export const transactions = (activePeer, address, limit = 20, offset = 0, sort = 'timestamp:desc') => diff --git a/src/utils/api/delegate.js b/src/utils/api/delegate.js index 3fb36d211..2b69cd5c8 100644 --- a/src/utils/api/delegate.js +++ b/src/utils/api/delegate.js @@ -48,7 +48,7 @@ export const unvoteAutocomplete = (username, votedDict) => ); export const registerDelegate = (activePeer, username, passphrase, secondPassphrase = null) => - new Promise((resolve) => { + new Promise((resolve, reject) => { const transaction = Lisk.transaction .registerDelegate({ username, @@ -56,5 +56,5 @@ export const registerDelegate = (activePeer, username, passphrase, secondPassphr secondPassphrase }); activePeer.transactions.broadcast(transaction).then(() => { resolve(transaction); - }); + }).catch(reject); });