Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: iron888 on March 16, 2018, 10:01:48 AM



Title: JavaScript library for cryptocurrency address validation
Post by: iron888 on March 16, 2018, 10:01:48 AM
Is there any good JS library for cryptocurrency address validation? I've found this one https://github.com/ivands/crypto-address-validator, but it doesn't support a lot of currencies.


Title: Re: JavaScript library for cryptocurrency address validation
Post by: bob123 on March 17, 2018, 02:09:42 PM
You might try this one out: https://github.com/ognus/wallet-address-validator (https://github.com/ognus/wallet-address-validator)
This one supports 21 currencies (the majority are low cap coins). But this should be enough information to build a libary which meets your requirements.
I'm not sure whether you will find a JS libary with every coin you need.


Title: Re: JavaScript library for cryptocurrency address validation
Post by: amargow on September 03, 2018, 11:01:49 AM
wallet-address-validator
Simple wallet address validator for validating Bitcoin and other altcoins addresses in Node.js and browser.

Forked from ryanralph/altcoin-address.

I forked it to remove all Node.js dependencies (crypro, Buffer etc.) to make it usable in the browser as well. I didn't use browserify to achieve smaller footprint, file size is 4.0 kB (minifed and gzipped).

Installation
Node
npm install wallet-address-validator
Browser
<script src="wallet-address-validator.min.js"></script>
Using bower
bower install wallet-address-validator

Read more : https://www.mytectra.com/python-training-in-bangalore.html


Title: Re: JavaScript library for cryptocurrency address validation
Post by: RGBKey on September 04, 2018, 02:33:58 PM
How many currencies are we talking about? If it's not that many, you could probably just write your own library. The checksum or equivalent for most cryptos is not that complicated.


Title: Re: JavaScript library for cryptocurrency address validation
Post by: Initscri on September 12, 2018, 05:28:08 AM
I'd use a switch case, and just use different libraries to support different cryptocurrencies. Default to not validating unless a validation library is found.

Personally what I would do is use ognus's library, and try to code the needed languages yourself; or create an issue for missing languages.
https://github.com/ognus/wallet-address-validator

If you're willing to leverage a backend API for validations: (since these things are mostly verified on the backend for enforcement, you may be able to find more).
https://github.com/murich/php-cryptocurrency-address-validation
https://github.com/LinusU/php-bitcoin-address-validator