This gem allows you to check if virtual coin address is valid and retrieve information about it.
Supported coins:
- Bitcoin (BTC),
- DASH (DASH),
- Dogecoin (DOGE),
- Litecoin (LTC),
- Namecoin (NMC),
- Peercoin (PPC),
- Primecoin (XPM)
If you find this gem useful please send few coins for coffee:
- BTC: 1HRqmR2dbuHKeNWp478W77NxLzPi63QoKi
- LTC: LUzmQEYEMHxh7Q8JWh3vjW2BYCGd8VxANF
- DASH: XtPu4gA71zMdp37x3XiYdG2U25UA85Gq1w
Thank you! :)
Add this line to your application's Gemfile:
gem 'coins_address_validator'
And then execute:
$ bundle
Or install it yourself as:
$ gem install coins_address_validator
This gem has two public methods:
is_address_valid?()
which checks if address passed as a parameter is valid BASE58 string, has correct length and checksum from decoded address is equal to first four bytes of SHA256(SHA256(h160))
Second one:
get_address_info()
returns information about network (Bitcoin, Litecoin, etc.), network symbol and type of address.
- Fork it ( https://github.com/Hothza/coins_address_validator/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request