Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

doichain-wallet-address-validator

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

doichain-wallet-address-validator - npm Package Compare versions

Comparing version 0.2.7 to 0.2.8

2

package.json

@@ -36,3 +36,3 @@ {

],
"version": "0.2.7",
"version": "0.2.8",
"author": "David Reband david.reband@gmail.com",

@@ -39,0 +39,0 @@ "homepage": "https://github.com/Doichain/wallet-address-validator",

@@ -73,4 +73,7 @@ var base58 = require('./crypto/base58');

isValidAddress: function (address, currency, networkType) {
return isValidP2PKHandP2SHAddress(address, currency, networkType) || segwit.isValidAddress(address, currency.segwitHrp);
return (
isValidP2PKHandP2SHAddress(address, currency, networkType) ||
segwit.isValidAddress(address, currency.segwitHrp, networkType)
);
}
};

@@ -22,2 +22,3 @@ // Copyright (c) 2017 Pieter Wuille

var bech32 = require('./bech32');
var DEFAULT_NETWORK_TYPE = "prod";

@@ -74,8 +75,11 @@ function convertbits (data, frombits, tobits, pad) {

function isValidAddress(address, hrp) {
var hrp = hrp || 'bc';
function isValidAddress(address, hrp, networkType) {
networkType = networkType || DEFAULT_NETWORK_TYPE;
var hrp = (hrp && hrp[networkType] ? hrp[networkType] : "") || "bc";
var ret = decode(hrp, address);
if (ret === null) {
hrp = 'tb';
hrp = "tb";
ret = decode(hrp, address);

@@ -82,0 +86,0 @@ }

@@ -72,3 +72,3 @@ var XRPValidator = require('./ripple_validator');

addressTypes: {prod: ['34', '0d'], testnet: ['6f','c4']},
segwitHrp: 'dc',
segwitHrp: {prod: 'dc', testnet: 'td'},
validator: BTCValidator

@@ -89,3 +89,3 @@ },{

addressTypes: {prod: ['0x', '47'], testnet: ['6f', 'c4']},
segwitHrp: 'vtc',
segwitHrp: {prod: 'vtc'},
validator: BTCValidator

@@ -92,0 +92,0 @@ },{

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc