Multicoin address validator for Bitcoin and other Altcoins ported to TypeScript.
npm install @dartess/multicoin-address-validatorSimple wallet address validator for validating Bitcoin and other altcoins addresses in Node.js and browser.
Forked from christsim/multicoin-address-validator which was
forked from ryanralph/altcoin-address.
* The library is completely rewritten to the TypeScript.
* The library offers api for importing individual validators, which will have a positive effect on the bundle size in case of partial use.
* Other size optimizations and test improvements.
```
npm install @dartess/multicoin-address-validator
`html`
Returns true if the address (string) is a valid wallet address for the crypto currency specified, see below for supported currencies.
#### Parameters
* address - Wallet address to validate.
* currency - Currency name or symbol, e.g. 'bitcoin', 'litecoin' or 'LTC'networkType
* options - Optional. Usually (string) or { networkType: string }.
###### option networkType
Use 'prod' (default) to enforce standard address, 'testnet' to enforce testnet address and 'both' to enforce nothing.
###### extra options
* xmr (Monero) also support stagenet as options.networkType;usdt
* (Tether) also support 'erc20' | 'omni' as options.chainType;
`
import { validate } from '@dartess/multicoin-address-validator';
// or const { validate } = require('@dartess/multicoin-address-validator');
const isValid = validate('1KFzzGtDdnq5hrwxXGjwVnKzRbvf8WVxck', 'BTC');
`
When connected via a script, it is available as a global variable window.WAValidator.
The same, but due to the use of a separate validator, there is no need to send the currency.
This connection can be useful if you only need to use some validators and want to save on the size of your bundle.
Not available when connecting through a script.
`
import { adaValidate } from '@dartess/multicoin-address-validator/currencies/ada');
// or const { adaValidate } = require('@dartess/multicoin-address-validator/currencies/ada');
const isValid = adaValidate('Ae2tdPwUPEYzs5BRbGcoS3DXvK8mwgggmESz4HqUwMyaS9eNksZGz1LMS9v');
`
* 0x/zrx '0x' or 'zrx''Aave Coin'
* Aave Coin/aave or 'aave''Algorand'
* Algorand/algo or 'algo''Aragon'
* Aragon/ant or 'ant''Augur'
* Augur/rep or 'rep''AugurV2'
* AugurV2/repv2 or 'repv2''AuroraCoin'
* AuroraCoin/aur or 'aur''Bancor'
* Bancor/bnt or 'bnt''Bankex'
* Bankex/bkx or 'bkx''Basic Attention Token'
* Basic Attention Token/bat or 'bat''BeaverCoin'
* BeaverCoin/bvc or 'bvc''BioCoin'
* BioCoin/bio or 'bio''Bitcoin'
* Bitcoin/btc or 'btc''Bitcoin SV'
* Bitcoin SV/bsv or 'bsv''BitcoinCash'
* BitcoinCash/bch or 'bch''BitcoinGold'
* BitcoinGold/btg or 'btg''BitcoinPrivate'
* BitcoinPrivate/btcp or 'btcp''BitcoinZ'
* BitcoinZ/btcz or 'btcz''BlockTrade'
* BlockTrade/btt or 'btt''BTU Protocol'
* BTU Protocol/btu or 'btu''Callisto'
* Callisto/clo or 'clo''Cardano'
* Cardano/ada or 'ada''Chainlink'
* Chainlink/link or 'link''Civic'
* Civic/cvc or 'cvc''Compound'
* Compound/comp or 'comp''Cred'
* Cred/lba or 'lba''Crypto.com Coin'
* Crypto.com Coin/cro or 'cro''CUSD'
* CUSD/cusd or 'cusd''Dash'
* Dash/dash or 'dash''Decentraland'
* Decentraland/mana or 'mana''Decred'
* Decred/dcr or 'dcr''DigiByte'
* DigiByte/dgb or 'dgb''District0x'
* District0x/dnt or 'dnt''DogeCoin'
* DogeCoin/doge or 'doge''Enjin Coin'
* Enjin Coin/enj or 'enj''EOS'
* EOS/eos or 'eos''Ethereum'
* Ethereum/eth or 'eth''EthereumClassic'
* EthereumClassic/etc or 'etc''EtherZero'
* EtherZero/etz or 'etz''Expanse'
* Expanse/exp or 'exp''FirmaChain'
* FirmaChain/fct or 'fct''FreiCoin'
* FreiCoin/frc or 'frc''GameCredits'
* GameCredits/game or 'game''GarliCoin'
* GarliCoin/grlc or 'grlc''Gnosis'
* Gnosis/gno or 'gno''Golem'
* Golem/glm or 'glm''Golem (GNT)'
* Golem (GNT)/gnt or 'gnt''HedgeTrade'
* HedgeTrade/hedg or 'hedg''Hush'
* Hush/hush or 'hush''HyperSpace'
* HyperSpace/xsc or 'xsc''iExec RLC'
* iExec RLC/rlc or 'rlc''Komodo'
* Komodo/kmd or 'kmd''LBRY Credits'
* LBRY Credits/lbc or 'lbc''Lisk'
* Lisk/lsk or 'lsk''LiteCoin'
* LiteCoin/ltc or 'ltc''loki'
* loki/loki or 'loki''Loom Network'
* Loom Network/loom or 'loom''Maker'
* Maker/mkr or 'mkr''Matchpool'
* Matchpool/gup or 'gup''Matic'
* Matic/matic or 'matic''MegaCoin'
* MegaCoin/mec or 'mec''Melon'
* Melon/mln or 'mln''Metal'
* Metal/mtl or 'mtl''MonaCoin'
* MonaCoin/mona or 'mona''Monero'
* Monero/xmr or 'xmr''Multi-collateral DAI'
* Multi-collateral DAI/dai or 'dai''NameCoin'
* NameCoin/nmc or 'nmc''Nano'
* Nano/nano or 'nano''Nem'
* Nem/xem or 'xem''Neo'
* Neo/neo or 'neo''NeoGas'
* NeoGas/gas or 'gas''Numeraire'
* Numeraire/nmr or 'nmr''Ocean Protocol'
* Ocean Protocol/ocean or 'ocean''Odyssey'
* Odyssey/ocn or 'ocn''OmiseGO'
* OmiseGO/omg or 'omg''Paxos'
* Paxos/pax or 'pax''PeerCoin'
* PeerCoin/ppc or 'ppc''PIVX'
* PIVX/pivx or 'pivx''Polkadot'
* Polkadot/dot or 'dot''Polymath'
* Polymath/poly or 'poly''PrimeCoin'
* PrimeCoin/xpm or 'xpm''ProtoShares'
* ProtoShares/pts or 'pts''Qtum'
* Qtum/qtum or 'qtum''Quant'
* Quant/qnt or 'qnt''Quantum Resistant Ledger'
* Quantum Resistant Ledger/qrl or 'qrl''RaiBlocks'
* RaiBlocks/xrb or 'xrb''Ripio Credit Network'
* Ripio Credit Network/rcn or 'rcn''Ripple'
* Ripple/xrp or 'xrp''Salt'
* Salt/salt or 'salt''Serve'
* Serve/serv or 'serv''Siacoin'
* Siacoin/sc or 'sc''SnowGem'
* SnowGem/sng or 'sng''Solana'
* Solana/sol or 'sol''SolarCoin'
* SolarCoin/slr or 'slr''SOLVE'
* SOLVE/solve or 'solve''Spendcoin'
* Spendcoin/spnd or 'spnd''Status'
* Status/snt or 'snt''Stellar'
* Stellar/xlm or 'xlm''Storj'
* Storj/storj or 'storj''Storm'
* Storm/storm or 'storm''StormX'
* StormX/stmx or 'stmx''Swarm City'
* Swarm City/swt or 'swt''Synthetix Network'
* Synthetix Network/snx or 'snx''Tap'
* Tap/xtp or 'xtp''TEMCO'
* TEMCO/temco or 'temco''TenX'
* TenX/pay or 'pay''Tether'
* Tether/usdt or 'usdt''Tezos'
* Tezos/xtz or 'xtz''Tron'
* Tron/trx or 'trx''TrueUSD'
* TrueUSD/tusd or 'tusd''Uniswap Coin'
* Uniswap Coin/uni or 'uni''USD Coin'
* USD Coin/usdc or 'usdc''VeChain'
* VeChain/vet or 'vet''VertCoin'
* VertCoin/vtc or 'vtc''Viberate'
* Viberate/vib or 'vib''VoteCoin'
* VoteCoin/vot or 'vot''Waves'
* Waves/waves or 'waves''Wings'
* Wings/wings or 'wings''ZCash'
* ZCash/zec or 'zec''ZClassic'
* ZClassic/zcl or 'zcl''ZenCash'
* ZenCash/zen or 'zen'`