Skip to content
This repository was archived by the owner on Oct 30, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/wallet-address-validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -10526,7 +10526,7 @@ function isValidPayToWitnessPublicKeyHashAddress(address, currency, networkType)
function isValidPayToTaprootAddress(address, currency, networkType) {
try {
const hrp = currency.segwitHrp[networkType];
decoded = bech32.decode(hrp, address, true);
const decoded = bech32.decode(hrp, address, true);
return decoded && decoded.version === 1 && decoded.program.length === 32;
} catch (err) {}
return null;
Expand Down
2 changes: 1 addition & 1 deletion dist/wallet-address-validator.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/bitcoin_validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function isValidPayToWitnessPublicKeyHashAddress(address, currency, networkType)
function isValidPayToTaprootAddress(address, currency, networkType) {
try {
const hrp = currency.segwitHrp[networkType];
decoded = bech32.decode(hrp, address, true);
const decoded = bech32.decode(hrp, address, true);
return decoded && decoded.version === 1 && decoded.program.length === 32;
} catch (err) {}
return null;
Expand Down
1 change: 1 addition & 0 deletions test/wallet_address_validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ describe('WAValidator.validate()', function () {
isValidAddressType('GSa5espVLNseXEfKt46zEdS6jrPkmFghBU', 'bitcoin', 'regtest', addressType.P2SH);
isValidAddressType('bcrt1q8zx9dlztqz9apm7y5gtx8a0tlz57fhncycvun5', 'bitcoin', 'regtest', addressType.P2WPKH);
isValidAddressType('bcrt1pzndg2aenknysnqs0d8gwhg54nqnc6yut2c6as76h4tyqhr8spr6slpjy3x', 'bitcoin', 'regtest', addressType.P2TR);
isValidAddressType('tb1paya5a0xk7aar047qp0uy6f4rvyqaqac2zl7gx8sapu4kseztxspsz6ufa5', 'bitcoin', 'testnet', addressType.P2TR);
});

it('should return true for correct bitcoincash addresses', function () {
Expand Down