Lookup and parse OpenAlias data in Ruby
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
bumi 562e4fac45 Version 0.2.0 2 years ago
bin Openalias ruby wrapper 2 years ago
ext Openalias ruby wrapper 2 years ago
lib Version 0.2.0 2 years ago
spec Add Openalias.lookup as alias to Openalias.addresses 2 years ago
src cleanup 2 years ago
.gitignore Openalias ruby wrapper 2 years ago
.rspec Openalias ruby wrapper 2 years ago
.travis.yml Openalias ruby wrapper 2 years ago
Cargo.lock Openalias ruby wrapper 2 years ago
Cargo.toml Openalias ruby wrapper 2 years ago
Gemfile Openalias ruby wrapper 2 years ago
LICENSE.txt Openalias ruby wrapper 2 years ago
README.md Add Openalias.lookup as alias to Openalias.addresses 2 years ago
Rakefile Specs! \o/ 2 years ago
openalias.gemspec Version 0.2.0 2 years ago

README.md

OpenAlias ruby

This ruby gem allows you to lookup and read OpenAlias data with ruby.

OpenAlias (openalias.org) is an open standard for simpler addresses for any crypto currencies. Read more here

At its most basic, OpenAlias is a TXT DNS record on a FQDN (fully qualified domain name). 
By combining this with DNS-related technologies [it has] created an aliasing standard that is extensible for developers, 
intuitive and familiar for users, and can interoperate with both centralised and decentralised domain systems.

It is using the OpenAlias rust implementation - and is simply a ruby wrapper with a native rust extension.

Maybe this is a bad idea, but I had a few minutes and wanted to try it. It works perfectly (but gem install takes a while to compile the extension) At some point it would probably be awesome to rewrite the whole thing in pure ruby - which is likely very easy.

Installation

(You need rustc installed to build the native rust extension)

Add this line to your application's Gemfile:

gem 'openalias'

Or install it yourself as:

$ gem install openalias

Usage

Openalias.addresses('btc@michaelbumann.com') # or Openalias.lookup('btc@michaelbumann.com')
=> [#<Openalias::CryptoAddress cryptocurrency="btc", address="3MGfEx4iaVEAy8nD4rWdocgrPo8aCR4Zfa", recipient_name="bumi">]

Openalias.addresses('donate.getmonero.org')
=> [#<Openalias::CryptoAddress cryptocurrency="xmr", address="44AFFq5kSiGBoZ4NMDwYtN18obc8AemS33DBLWs3H7otXft3XjrpDtQGv7SqSsaBYBb98uNbr2VBBEt7f2wfn3RVGQBEP3A", recipient_name="Monero Development", tx_description="Donation to Monero Core Team">, #<Openalias::CryptoAddress cryptocurrency="btc", address="1KTexdemPdxSBcG55heUuTjDRYqbC5ZL8H", recipient_name="Monero Development", tx_description="Donation to Monero Core Team">]

Openalias.addresses('donate.getmonero.org').find(&:xmr?)
=> #<Openalias::CryptoAddress cryptocurrency="xmr", address="44AFFq5kSiGBoZ4NMDwYtN18obc8AemS33DBLWs3H7otXft3XjrpDtQGv7SqSsaBYBb98uNbr2VBBEt7f2wfn3RVGQBEP3A", recipient_name="Monero Development", tx_description="Donation to Monero Core Team">

Openalias.addresses('donate.getmonero.org')[0].recipient_name
=> "Monero Development"

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/bumi/openalias-ruby.

License

The gem is available as open source under the terms of the MIT License.