Gathering detailed insights and metrics for @fordefi/crypto-address-validator-ts
Gathering detailed insights and metrics for @fordefi/crypto-address-validator-ts
Gathering detailed insights and metrics for @fordefi/crypto-address-validator-ts
Gathering detailed insights and metrics for @fordefi/crypto-address-validator-ts
Useful library for validation of Bitcoin, Litecoin, Ethereum and other cryptocoin addresses
npm install @fordefi/crypto-address-validator-ts
Typescript
Module System
Node Version
NPM Version
TypeScript (99.93%)
HTML (0.07%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
2 Stars
277 Commits
3 Forks
2 Branches
1 Contributors
Updated on Apr 20, 2023
Latest Version
0.5.18
Package Id
@fordefi/crypto-address-validator-ts@0.5.18
Unpacked Size
401.07 kB
Size
76.72 kB
File Count
129
NPM Version
8.19.2
Node Version
18.12.1
Published on
Oct 10, 2023
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
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'
1import {Directive, Input} from '@angular/core'; 2import {AbstractControl, NG_VALIDATORS, ValidationErrors, Validator} from '@angular/forms'; 3import { validate } from 'crypto-address-validator-ts'; 4 5@Directive({ 6 selector: '[ccyCode]', 7 providers: [{provide: NG_VALIDATORS, useExisting: CryptoAddressValidationDirective, multi: true}] 8}) 9export class CryptoAddressValidationDirective implements Validator { 10 11 //For example BTC 12 @Input() public ccyCode: string; 13 14 public validate(field: AbstractControl): ValidationErrors | null { 15 if (!validate(field.value, this.ccyCode, null)) { 16 return {messageCode: 'Invalid bitcoin address'}; 17 } 18 return null; 19 } 20}
1<input id="address" 2 [ccyCode]="currency">
No vulnerabilities found.
No security vulnerabilities found.