Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/k4m4/cryptaddress-validator
Validate Bitcoin, Ethereum, Litecoin & other popular cryptocurrency addresses.
https://github.com/k4m4/cryptaddress-validator
address cryptocurrency cryptocurrency-regex regex validation validator
Last synced: 3 months ago
JSON representation
Validate Bitcoin, Ethereum, Litecoin & other popular cryptocurrency addresses.
- Host: GitHub
- URL: https://github.com/k4m4/cryptaddress-validator
- Owner: k4m4
- License: mit
- Created: 2018-04-08T19:51:48.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T01:33:26.000Z (about 2 years ago)
- Last Synced: 2024-10-13T15:52:05.627Z (4 months ago)
- Topics: address, cryptocurrency, cryptocurrency-regex, regex, validation, validator
- Language: JavaScript
- Homepage:
- Size: 251 KB
- Stars: 81
- Watchers: 5
- Forks: 8
- Open Issues: 6
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# cryptaddress-validator [![Build Status](https://travis-ci.org/k4m4/cryptaddress-validator.svg?branch=master)](https://travis-ci.org/k4m4/cryptaddress-validator)
> Validate Bitcoin, Ethereum, Litecoin & other popular cryptocurrency addresses.
## Install
```
~ ❯❯❯ npm install cryptaddress-validator
```## Usage
```js
const cryptaddress = require('cryptaddress-validator');cryptaddress().test('1Ez69SnzzmePmZX3WpEzMKTrcBF2gpNQ55')
//=> truecryptaddress('eth').test('0x281055afc982d96fab65b3a49cac8b878184cb16')
//=> truecryptaddress('btc').test('1dice8EMZmqKvrGE4Qc9bUFf9PX3xaYDp')
//=> truecryptaddress('bch').test('LQL9pVH1LsMfKwt82Y2wGhNGkrjF8vwUst')
//=> falsecryptaddress('md5').test('0x281055afc982d96fab65b3a49cac8b878184cb16')
//=> 'Unsupported cryptocurrency'
```## API
### cryptaddress (cryptocurrency)
Returns the regex of the specified cryptocurrency.
#### cryptocurrency
Type: `string`
Cryptocurrency to build the appropriate validation regex.
## Supported Cryptocurrencies
- [`Bitcoin/BTC`](https://github.com/kevva/bitcoin-regex)
- [`Bitcoin Cash/BCH` (CashAddr addresses)](https://github.com/k4m4/bitcoincash-regex)
- [`Ethereum/ETH`](https://github.com/k4m4/ethereum-regex)
- [`Litecoin/LTC`](https://github.com/k4m4/litecoin-regex)
- [`Monero/XMR`](https://github.com/k4m4/monero-regex)
- [`Dash/DASH`](https://github.com/k4m4/dash-regex)
- [`Ripple/XRP`](https://github.com/k4m4/ripple-regex)
- [`NEO/NEO`](https://github.com/k4m4/neo-regex)
- [`Dogecoin/DOGE`](https://github.com/k4m4/dogecoin-regex)## Related
- [cryptocurrency-address-detector](https://github.com/k4m4/cryptocurrency-address-detector) - Detect which cryptocurrency an address corresponds to.
- [cryptaddress.now](https://github.com/k4m4/cryptaddress.now) - Minimal service to detect which cryptocurrency an address corresponds to.## License
MIT © [Nikolaos Kamarinakis](https://nikolaskama.me)