Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/StrongSquirrel/crptwav
A useful library for validation of Bitcoin, Litecoin, Ethereum and other cryptocoin addresses
https://github.com/StrongSquirrel/crptwav
Last synced: 2 months ago
JSON representation
A useful library for validation of Bitcoin, Litecoin, Ethereum and other cryptocoin addresses
- Host: GitHub
- URL: https://github.com/StrongSquirrel/crptwav
- Owner: StrongSquirrel
- License: mit
- Created: 2018-07-31T15:43:16.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-08-28T07:03:51.000Z (over 6 years ago)
- Last Synced: 2024-08-04T01:13:44.272Z (6 months ago)
- Language: Go
- Homepage:
- Size: 56.6 KB
- Stars: 16
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-bitcloud-btdx - crptwav
README
# crptwav
Simple wallet address validator for validating Bitcoin and other altcoins addresses.
It is a port of JavaScript library [https://github.com/ognus/wallet-address-validator](https://github.com/ognus/wallet-address-validator).
## Documentation
[https://godoc.org/github.com/StrongSquirrel/crptwav](https://godoc.org/github.com/StrongSquirrel/crptwav)
## Example
```go
package mainimport (
"fmt"
"github.com/StrongSquirrel/crptwav"
)func main() {
fmt.Println(crptwav.IsValidAddress("0xE37c0D48d68da5c5b14E5c1a9f1CFE802776D9FF", "ETH"))
fmt.Println(crptwav.IsValidAddress("12KYrjTdVGjFMtaxERSk3gphreJ5US8aUP", "Bitcoin"))
fmt.Println(crptwav.IsValidProdAddress("12KYrjTdVGjFMtaxERSk3gphreJ5US8aUP", "Bitcoin"))
fmt.Println(crptwav.IsValidTestnetAddress("mzBc4XEFSdzCDcTxAgf6EZXgsZWpztRhef", "BTC"))
fmt.Println(crptwav.IsValidProdAddress("mzBc4XEFSdzCDcTxAgf6EZXgsZWpztRhef", "BTC"))
// Output:
// true
// true
// true
// true
// false
}
```### Supported crypto currencies (todo)
- [x] Auroracoin/AUR, `'auroracoin'` or `'AUR'`
- [x] BeaverCoin/BVC, `'beavercoin'` or `'BVC'`
- [x] Biocoin/BIO, `'biocoin'` or `'BIO'`
- [x] Bitcloud/BTDX, `'bitcloud'` or `'BTDX'`
- [x] Bitcoin/BTC, `'bitcoin'` or `'BTC'`
- [x] BitcoinCash/BCH, `'bitcoincash'` or `'BCH'`
- [x] BitcoinGold/BTG, `'bitcoingold'` or `'BTG'`
- [ ] BitcoinPrivate/BTCP, `'bitcoinprivate'` or `'BTCP'`
- [ ] BitcoinZ/BTCZ, `'bitcoinz'` or `'BTCZ'`
- [x] Bitcore/BTX, `'bitcore'` or `'BTX'`
- [x] Bitsend/BSD, `'bitsend'` or `'BSD'`
- [x] Callisto/CLO, `'callisto'` or `'CLO'`
- [x] Dash, `'dash'` or `'DASH'`
- [ ] Decred/DCR, `'decred'` or `'DCR'`
- [ ] Digibyte/DGB, `'digibyte'` or `'DGB'`
- [x] Dogecoin/DOGE, `'dogecoin'` or `'DOGE'`
- [x] Ethereum/ETH, `'ethereum'` or `'ETH'`
- [x] EthereumClassic/ETH, `'ethereumclassic'` or `'ETC'`
- [x] EthereumZero/ETZ, `'etherzero'` or `'ETZ'`
- [ ] Freicoin/FRC, `'freicoin'` or `'FRC'`
- [ ] Garlicoin/GRLC, `'garlicoin'` or `'GRLC'`
- [ ] Hush/HUSH, `'hush'` or `'HUSH'`
- [ ] Komodo/KMD, `'komodo'` or `'KMD'`
- [x] Litecoin/LTC, `'litecoin'` or `'LTC'`
- [x] Megacoin/MEC, `'megacoin'` or `'MEC'`
- [ ] Namecoin/NMC, `'namecoin'` or `'NMC'`
- [ ] NEO/NEO, `'NEO'` or `'NEO'`
- [ ] NeoGas/GAS, `'neogas'` or `'GAS'`
- [x] Peercoin/PPCoin/PPC, `'peercoin'` or `'PPC'`
- [ ] Primecoin/XPM, `'primecoin'` or `'XPM'`
- [ ] Protoshares/PTS, `'protoshares'` or `'PTS'`
- [ ] Qtum/QTUM, `'qtum'` or `'QTUM'`
- [ ] Ripple/XRP, `'ripple'` or `'XRP'`
- [ ] Snowgem/SNG, `'snowgem'` or `'SNG'`
- [ ] Vertcoin/VTC, `'vertcoin'` or `'VTC'`
- [ ] Votecoin/VTC, `'votecoin'` or `'VOT'`
- [ ] Zcash/ZEC, `'zcash'` or `'ZEC'`
- [ ] Zclassic/ZCL, `'zclassic'` or `'ZCL'`
- [ ] ZenCash/ZEN, `'zencash'` or `'ZEN'`## License
[MIT](LICENSE)