Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
crypto-address-validator-ts
Advanced tools
Readme
Simple wallet address validator for validating Bitcoin and other altcoins addresses in Typescript can be used in for example an Angular project.
Forked from christsim/multicoin-address-validator.
Which is forked from ryanralph/altcoin-address.
npm install crypto-address-validator-ts
'bitcoin'
(default), 'litecoin'
or 'LTC'
{ networkType: 'prod' }
(default) to enforce standard address, { networkType: 'testnet' }
to enforce testnet address and '{ networkType: 'both' }'
to enforce nothing.Returns true if the address (string) is a valid wallet address for the crypto currency specified, see below for supported currencies.
'0x'
or 'zrx'
'1inch Network'
or '1inch'
only erc-20 validation no bep-20, xdai or avalanche c-chain'Aave Coin'
or 'aave'
'Aavegotchi'
or 'ghst'
'Amp'
or 'amp'
'Aragon'
or 'ant'
'Alpha Finance Lab'
or 'alpha'
only erc-20 validation no bep-20'Audius'
or 'audio'
'Augur'
or 'rep'
'AugurV2'
or 'repv2'
'AuroraCoin'
or 'aur'
'Axie Infinity'
or 'axs'
'Baby Ripple'
or 'babyxrp'
'Badger DAO'
or 'badger'
'Balancer'
or 'bal'
'Bancor'
or 'bnt'
'Band Protocol'
or 'band'
only erc-20 validation no bep-20, xdai or fantom'Bankex'
or 'bkx'
'Basic Attention Token'
or 'bat'
'BeaverCoin'
or 'bvc'
'Binance Coin Mainnet'
or 'bnb'
'BioCoin'
or 'bio'
'Bitcoin'
or 'btc'
'Bitcoin SV'
or 'bsv'
'BitcoinCash'
or 'bch'
'BitcoinGold'
or 'btg'
'BitcoinPrivate'
or 'btcp'
'BitcoinZ'
or 'btcz'
'BlockTrade'
or 'btt'
'Bluzelle'
or 'blz'
'BTU Protocol'
or 'btu'
'bZx Protocol'
or 'bzrx'
'Callisto'
or 'clo'
'Cardano'
or 'ada'
'Cartesi'
or 'ctsi'
only erc-20 validation no bep-20, polygon or avalanche c-chain'Celsius'
or 'cel'
'Chiliz'
or 'chz'
only erc-20 validation no bep-20'Chainlink'
or 'link'
'Civic'
or 'cvc'
'Compound'
or 'comp'
'Cream Finance'
or 'cream'
only erc-20 validation no bep-20, xdai or fantom'Cred'
or 'lba'
'Crypto.com Coin'
or 'cro'
'Curve DAO Token'
or 'crv'
'CUSD'
or 'cusd'
'Dash'
or 'dash'
'Decentraland'
or 'mana'
'Decred'
or 'dcr'
'Dent'
or 'dent'
'DigiByte'
or 'dgb'
'District0x'
or 'dnt'
'DogeCoin'
or 'doge'
,'dYdX'
or 'dydx'
'EasyFi'
or 'ez'
'Efinity Token'
or 'efi'
'Enjin Coin'
or 'enj'
'Enzyme'
or 'mln'
'EOS'
or 'eos'
'Ethereum'
or 'eth'
'EthereumClassic'
or 'etc'
'Ethereum Name Service'
or 'ens'
'Ethernity Chain'
or 'ern'
'EtherZero'
or 'etz'
'Expanse'
or 'exp'
'e-Radix'
or 'exrd'
'Fantom'
or 'ftm'
'FirmaChain'
or 'fct'
'FreiCoin'
or 'frc'
'FTX Token'
or 'ftt'
'FreiCoin'
or 'fun'
'GameCredits'
or 'game'
'GarliCoin'
or 'grlc'
'Gnosis'
or 'gno'
'Gods Unchained'
or 'gods'
'Golem'
or 'glm'
'Golem (GNT)'
or 'gnt'
'HedgeTrade'
or 'hedg'
'Hegic'
or 'hegic'
'Holo'
or 'hot'
only erc-20 validation no xdai'Hush'
or 'hush'
'HyperSpace'
or 'xsc'
'ICON'
or 'icx'
'iExec RLC'
or 'rlc'
'Immutable X'
or 'imx'
'Illuvium'
or 'ilv'
'Injective Protocol'
or 'inj'
'IOTA'
or 'miota'
'Komodo'
or 'kmd'
'KeeperDAO'
or 'rook'
'Kyber Network Crystal v2'
or 'knc'
'LBRY Credits'
or 'lbc'
'UNUS SED LEO'
or 'leo'
'Lisk'
or 'lsk'
'LiteCoin'
or 'ltc'
'Loopring'
or 'lrc'
'Loom Network'
or 'loom'
'Maker'
or 'mkr'
'Marlin'
or 'pond'
'Matchpool'
or 'gup'
'Matic'
or 'matic'
'MegaCoin'
or 'mec'
'Melon'
or 'mln'
'Metal'
or 'mtl'
'Mirror Protocol'
or 'mir'
only erc-20 validation no bep-20 or terra'MonaCoin'
or 'mona'
'Monero'
or 'xmr'
'Multi-collateral DAI'
or 'dai'
'MyNeighborAlice'
or 'alice'
only erc-20 validation no bep-20'NameCoin'
or 'nmc'
'Nano'
or 'nano'
'Nem'
or 'xem'
'Neo'
or 'neo'
'NeoGas'
or 'gas'
'Numeraire'
or 'nmr'
'Ocean Protocol'
or 'ocean'
'Odyssey'
or 'ocn'
'OKB'
or 'okb'
'OmiseGO'
or 'omg'
'Orchid'
or 'oxt'
'Origin Protocol'
or 'ogn'
'Orion Protocol'
or 'orn'
'Paxos'
or 'pax'
'PeerCoin'
or 'ppc'
'PeerCoin'
or 'perp'
'Phala Network'
or 'pha'
'PIVX'
or 'pivx'
'Polkadot'
or 'dot'
'Polymath'
or 'poly'
'PrimeCoin'
or 'xpm'
'ProtoShares'
or 'pts'
'Pundi X'
or 'pundix'
'Qtum'
or 'qtum'
'Quant'
or 'qnt'
'Quantstamp'
or 'qsp'
'Quantum Resistant Ledger'
or 'qrl'
'RaiBlocks'
or 'xrb'
'Raiden Network Token'
or 'rdn'
'Rarible'
or 'rari'
'Reef'
or 'reef'
'Reserve Rights'
or 'rsr'
'Ripio Credit Network'
or 'rcn'
'Ripple'
or 'xrp'
'Salt'
or 'salt'
'Selfkey'
or 'key'
'Serum'
or 'srm'
'Serve'
or 'serv'
'SHIBA INU'
or 'shib'
'Siacoin'
or 'sc'
'SingularityNET'
or 'agix'
'SKALE Network'
or 'skl'
'SnowGem'
or 'sng'
'SolarCoin'
or 'slr'
'SOLVE'
or 'solve'
'Spendcoin'
or 'spnd'
'Status'
or 'snt'
'Stellar'
or 'xlm'
'Storj'
or 'storj'
'Storm'
or 'storm'
'StormX'
or 'stmx'
'Streamr'
or 'data'
'SushiSwap'
or 'sushi'
,'SuperFarm'
or 'super'
only erc-20 validation no bep-20 or polygon'SuperRare'
or 'rare'
'Swarm City'
or 'swt'
'Swipe'
or 'sxp'
'Synthetix Network'
or 'snx'
'Tap'
or 'xtp'
'TEMCO'
or 'temco'
'Tellor'
or 'trb'
'TenX'
or 'pay'
'Tether'
or 'usdt'
'Terra Virtua Kolect'
or 'tvk'
'Tezos'
or 'xtz'
'The Graph'
or 'grt'
'The Sandbox'
or 'sand'
'Tornado Cash'
or 'torn'
'Tron'
or 'trx'
'TrueUSD'
or 'tusd'
'Ultra'
or 'uos'
'Uniswap Coin'
or 'uni'
'Universal Market Access'
or 'uma'
'USD Coin'
or 'usdc'
'VeChain'
or 'vet'
'VertCoin'
or 'vtc'
'Verasity'
or 'vra'
'Viberate'
or 'vib'
'VIDT Datalink'
or 'vidt'
'VoteCoin'
or 'vot'
'Waves'
or 'waves'
'Wings'
or 'wings'
'Wrapped Nexus Mutual'
or 'wnxm'
'ZCash'
or 'zec'
'yearn.finance'
or 'yfi'
'Yield Guild Games'
or 'ygg'
'ZClassic'
or 'zcl'
'ZenCash'
or 'zen'
import {Directive, Input} from '@angular/core';
import {AbstractControl, NG_VALIDATORS, ValidationErrors, Validator} from '@angular/forms';
import { validate } from 'crypto-address-validator-ts';
@Directive({
selector: '[ccyCode]',
providers: [{provide: NG_VALIDATORS, useExisting: CryptoAddressValidationDirective, multi: true}]
})
export class CryptoAddressValidationDirective implements Validator {
//For example BTC
@Input() public ccyCode: string;
public validate(field: AbstractControl): ValidationErrors | null {
if (!validate(field.value, this.ccyCode, null)) {
return {messageCode: 'Invalid bitcoin address'};
}
return null;
}
}
<input id="address"
[ccyCode]="currency">
FAQs
Crypto address validator for Bitcoin and other Altcoins, forked to be used with typescript
The npm package crypto-address-validator-ts receives a total of 222 weekly downloads. As such, crypto-address-validator-ts popularity was classified as not popular.
We found that crypto-address-validator-ts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.