0.7.2 • Published 5 months ago

multichain-address-validator v0.7.2

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

multichain address validator

Simple blockchain address validator for validating Bitcoin and other blockchain addresses Node.js and browser.

Build Status

Installation

NPM

npm install multichain-address-validator

Browser

<script src="dist/multichain-address-validator.bundle.min.js"></script>

API

validate (address, chain)
Parameters
  • address - blockchain address to validate
  • chain - blockchain name or object with networkType (mainnet or testnet)

Returns true if the address is a valid wallet address for the blockchain specified or throws if validator could not be found for chain

Supported blockchains

  • Algorand: algorand
  • Bitcoin: bitcoin, btc, omni
  • Bitcoin Cash: bitcoin-cash, bitcoincash, bitcoin cash, bch
  • Cardano: cardano, ada
  • Dogecoin: dogecoin, doge
  • EOS: eos
  • Etherum: ethereum, eth, erc20, flare, avalanche, avalanche-c, bsc, bnb, binance
  • Litecoin: litecoin, ltc
  • Monero: monero
  • Nano: nano
  • NEM: nem
  • Polkadot: polkadot
  • Ripple: ripple',xrp`
  • Sia: sia
  • Solana: solana, spl
  • Tezos: tezos
  • Tron: tron, trc20
  • XLM: xlm, stellar

Usage example

Node

import { validate } from 'multichain-address-validator'

const valid = validate('1KFzzGtDdnq5hrwxXGjwVnKzRbvf8WVxck', 'BTC');
if (valid)
  console.log('This is a valid address');
else
  console.log('Address INVALID');

// This will log 'This is a valid address' to the console.
import { validate } from 'multichain-address-validator'

const valid = validate('0xdbF03B407c01E7cD3CBea99509d93f8DDDC8C6FB', 'ethereum');
if (valid)
  console.log('This is a valid address');
else
  console.log('Address INVALID');

// This will log 'This is a valid address' to the console.
import { validate } from 'multichain-address-validator'

const valid = validate('1KFzzGtDdnq5hrwxXGjwVnKzRbvf8WVxck', { chain: 'litecoin', networkType: 'testnet' });
if (valid)
  console.log('This is a valid address');
else
  console.log('Address INVALID');

// As this is a invalid litecoin address 'Address INVALID' will be logged to console.
0xzrxAave CoinaaveAlgorandalgoApecoinapeAPI3api3AragonantArbitrumarbAugurrepAugurV2repv2AuroraCoinaurAvalancheavaxAxie InfinityaxsBancorbntBand ProtocolbandBankexbkxBasic Attention TokenbatBeaverCoinbvcBiconomybicoBinancebnbBioCoinbioBitcoinbtcBitcoin SVbsvBitcoinCashbchBitcoinGoldbtgBitcoinPrivatebtcpBitcoinZbtczBlockTradebttBlurblurBonkbonkBTU ProtocolbtuCallistocloCardanoadaCeloceloChainlinklinkChilizchzCiviccvcCompoundcompCredlbaCrypto.com CoincroCurve DAOcrvCUSDcusdDashdashDecentralandmanaDecreddcrDigiBytedgbDistrict0xdntDogeCoindogeEnjin CoinenjEOSeosEthereumethEthereum Name ServiceensEthereumClassicetcEthereumPowethwEtherZeroetzExpanseexpFetch.aifetFirmaChainfctFlareflrFreiCoinfrcGameCreditsgameGarliCoingrlcGnosisgnoGolemglmGolem (GNT)gntHashflowhftHedgeTradehedgHushhushHyperSpacexsciExec RLCrlcIlluviumilvImmutableimxInjectiveinjKomodokmdLBRY CreditslbcLido DAO TokenldoLiteCoinltclokilokiLoom NetworkloomMagicmagicMakermkrMarlinpondMask NetworkmaskMatchpoolgupMaticmaticMegaCoinmecMelonmlnMetalmtlMoneroxmrMulti-collateral DAIdaiNameCoinnmcNanonanoNemxemNeoneoNeoGasgasNumerairenmrOcean ProtocoloceanOdysseyocnOmiseGOomgOnyx ProtocolxcnOptimismopOrigin ProtocolognPaxospaxPayPal USDpyusdPeerCoinppcPIVXpivxPolkadotdotPolymathpolyPrimeCoinxpmProtoSharesptsQtumqtumQuantqntQuantum Resistant LedgerqrlRaiBlocksxrbRipio Credit NetworkrcnRipplexrpSaltsaltServeservSiacoinscSkalesklSnowGemsngSolanasolSolarCoinslrSOLVEsolveSpendcoinspndStatussntStellarxlmStorjstorjStormstormStormXstmxSuperVersesuperSwarm CityswtSynthetix NetworksnxTapxtpTellortrbTEMCOtemcoTenXpayTetherusdtTezosxtzThe GraphgrtThe SandboxsandTrontrxTrueUSDtusdUnifi Protocol DAOunfiUniswap CoinuniUSD CoinusdcVeChainvetVertCoinvtcViberatevibVoteCoinvotVulcan Forged PYRpyrWaveswavesWingswingsYearn.financeyfiZCashzecZClassiczclZenCashzen
0.7.2

5 months ago

0.7.1

5 months ago

0.7.0

5 months ago

0.0.1

10 months ago