Project

volabit

0.0
No commit activity in last 3 years
No release in over 3 years
Integrate the Volabit services in your app with ease.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0.5.3, ~> 0.5
~> 1.7
~> 10.0
~> 3.2
~> 0.36
~> 0.11

Runtime

~> 1.0
 Project Readme

Gem Version Build Status

Volabit

Volabit's API library for Ruby. Integrate the Volabit services in your apps with ease.

You can see the available methods on the project wiki. Details of the API use can be found on the official page.

Installation

Add this line to your application's Gemfile:

gem 'volabit'

And then execute:

$ bundle

Or install it yourself as:

$ git clone https://github.com/coincovemx/ruby-api-client.git
$ cd ruby-api-client
$ bundle
$ gem build volabit.gemspec
$ gem install volabit-[version].gem

Usage

  1. Instance a new Volabit client object.
app_id   = 'The registered API for your APP.'
secret   = 'The registered secret for your APP.'
callback = 'The registered callback URL for your APP'

volabit_client = Volabit::Client.new(app_id, secret, callback)

Note that by default the Volabit client uses the production environment. If you want to use the test environment, set the sandbox flag to true before requesting the authorization code.

volabit_client.sandbox true

You can also provide this parameter upon client instantiation.

environment    = 'sandbox'
volabit_client = Volabit::Client.new(app_id, secret, callback, environment)
  1. Get the URL that will allow the user to authorize your app to use his/her account. (It should be opened in a browser.)
auth_url = volabit_client.authorize
  1. After you get the authorization code (sent at the callback URL that you provided), you'll use it to get the refresh and access tokens. This code can be used only once, so be sure to store the token object for later use or your app will have to be reauthorized.
volabit_client.request_tokens 'The given authorization code.'

Or, if you already have an access_token and a refresh_token from the last call, you can use:

tokens = {
  access_token: 'access_token',
  refresh_token: 'refresh_token'
}
volabit_client.use_tokens(tokens)
  1. You're ready to use our API. Just call any method listed here.
tickers = volabit_client.tickers
# => {
#       "btc_usd_buy":"226.06",
#       "btc_usd_sell":"226.56",
#       "usd_mxn_buy":"14.53",
#       "usd_mxn_sell":"15.13",
#       "btc_mxn_buy":"3285.63",
#       "btc_mxn_sell":"3427.3"
#    }

Note: You can obtain the current tokens used by the client with the method Client#tokens. Be sure to keep them safe withing your application for later use.

Contributing

  1. Fork it ( https://github.com/[my-github-username]/ruby-api-client/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Bitdeli Badge