Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/k4m4/cryptocurrency-address-detector
Detect which cryptocurrency an address corresponds to.
https://github.com/k4m4/cryptocurrency-address-detector
address cryptocurrency cryptocurrency-regex detector matcher regex regex-match wallet
Last synced: about 1 month ago
JSON representation
Detect which cryptocurrency an address corresponds to.
- Host: GitHub
- URL: https://github.com/k4m4/cryptocurrency-address-detector
- Owner: k4m4
- License: mit
- Created: 2018-02-28T22:50:43.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T01:32:25.000Z (almost 2 years ago)
- Last Synced: 2024-08-09T05:38:54.946Z (5 months ago)
- Topics: address, cryptocurrency, cryptocurrency-regex, detector, matcher, regex, regex-match, wallet
- Language: JavaScript
- Size: 259 KB
- Stars: 45
- Watchers: 8
- Forks: 10
- Open Issues: 8
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# cryptocurrency-address-detector [![Build Status](https://travis-ci.org/k4m4/cryptocurrency-address-detector.svg?branch=master)](https://travis-ci.org/k4m4/cryptocurrency-address-detector)
> Detect which cryptocurrency an address corresponds to.
## Install
```
~ ❯❯❯ npm install cryptocurrency-address-detector
```## Usage
```js
const addressDetect = require('cryptocurrency-address-detector');addressDetect('0x281055afc982d96fab65b3a49cac8b878184cb16').then(cryptocurrency => {
console.log(cryptocurrency);
//=> 'ETH'
});addressDetect('1dice8EMZmqKvrGE4Qc9bUFf9PX3xaYDp').then(cryptocurrency => {
console.log(cryptocurrency);
//=> 'BTC/BCH'
});addressDetect('LQL9pVH1LsMfKwt82Y2wGhNGkrjF8vwUst').then(cryptocurrency => {
console.log(cryptocurrency);
//=> 'LTC'
});addressDetect('0xsfdlffsjksldfj[IPv6:2001:db8::2]').then(cryptocurrency => {
console.log(cryptocurrency);
//=> 'Cryptocurrency could not be detected'
});
```## API
### addressDetect(address, [options])
Returns the cryptocurrency that an address corresponds to.
#### address
Type: `string`
Address to check for popular cryptocurrencies.
#### options
##### timeout
Type: `number`
Timeout in milliseconds after which a request is considered failed. Default: `5000`.
## Supported Cryptocurrencies
- [`Bitcoin/BTC`](https://github.com/kevva/bitcoin-regex)
- [`Bitcoin Cash/BCH`](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
- [cryptaddress.now](https://github.com/k4m4/cryptaddress.now) - Minimal service to detect what cryptocurrency an address corresponds to.
## License
MIT © [Nikolaos Kamarinakis](https://nikolaskama.me)