Address Validator
Wallet-address validator for Bitcoin, Ethereum, and many altcoins. Works in Node.js and the browser (~17 kB minified + gzipped).
SDK_Files: crypto-address-validator/ · npm @web5nexus/crypto-address-validator (opens in a new tab)
Install
npm install @web5nexus/crypto-address-validatorAPI
validate(address [, currency = 'bitcoin' [, networkType = 'prod']])
| Parameter | Description |
|---|---|
address | Wallet address string |
currency | Name or symbol, e.g. 'bitcoin', 'BTC', 'ethereum' |
networkType | 'prod' (default), 'testnet', or 'both' |
Returns true if the address is valid for that currency/network.
Also: getCurrencies() / findCurrency(nameOrSymbol).
Examples
import validator from '@web5nexus/crypto-address-validator'
validator.validate('1KFzzGtDdnq5hrwxXGjwVnKzRbvf8WVxck', 'BTC')
validator.validate('0xE37c0D48d68da5c5b14E5c1a9f1CFE802776D9FF', 'ETH')
validator.validate('tb1q…', 'bitcoin', 'testnet')
const currency = validator.findCurrency('xrp')Related
- Bitcoin Core — derive addresses
- Auth Modal · Bitcoin — social → BTC addresses
- Web5js — multi-chain account data