diff --git a/src/helper.js b/src/helper.js index 8863ca7e3..e78ac4b16 100644 --- a/src/helper.js +++ b/src/helper.js @@ -213,7 +213,7 @@ export const isLnUri = str => { * @return {boolean} If the uri is valid */ export const isAddress = str => { - return /^[a-km-zA-HJ-NP-Z0-9]{26,90}$/.test(str); + return /^[a-zA-Z0-9]{26,90}$/.test(str); }; /** diff --git a/test/unit/helper.spec.js b/test/unit/helper.spec.js index efd98dfe1..768880d00 100644 --- a/test/unit/helper.spec.js +++ b/test/unit/helper.spec.js @@ -682,6 +682,11 @@ describe('Helpers Unit Tests', () => { expect(helpers.isAddress(address), 'to be', true); }); + it('should accept p2wkh address', () => { + const address = 'tb1q94yln7u75nt580a6s0gvs9wqvmfl4zgcxj78sw'; + expect(helpers.isAddress(address), 'to be', true); + }); + it('should reject invalid bitcoin address', () => { const address = '/INVALID/rfu4i1Mo2NF7TQsN9bMVLFSoj'; expect(helpers.isAddress(address), 'to be', false);