Blockr
Ruby SDK for Blockr.io
Installation
Add this line to your application's Gemfile:
gem 'blockr-ruby'
And then execute:
$ bundle
Or install it yourself as:
$ gem install blockr-ruby
Usage
Initialize the library
blockr_api = Blockr::API.new(network:BLOCK_CHAIN, api_version:API_VERSION)
Where BLOCK_CHAIN
can be one of btc, tbtc, ltc, dgc, qrk, ppc, mec or any of the blockchains supported by in https://blockr.io
And API_VERSION
is v1 for now (optional)
You can also change the Blockchain using:
blockr_api.network = 'tbtc'
Or if you're using Blockr gem withut an instance you can do:
Blockr.network = 'tbtc'
Posible Methods
You can use any of these methods with the initialized object or simply by calling:
Blockr.block(hash)
Blockr.latest_block
Blockr.latest_block_raw
Blockr.transaction(hash)
Blockr.raw_transaction(hash)
Blockr.decode_transaction(hex)
Blockr.push_transaction(hex)
Blockr.address(address)
Blockr.address_balance(address)
Blockr.address_unspent_transactions(address, params)
Blockr.address_unconfirmed
Contributing
To bump the version you can use the ./bump
python script, just write it in the terminal to see the options.
- Fork it ( https://github.com/[my-github-username]/blockr-ruby/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