Bitso Ruby API
Installation
Add this line to your application's Gemfile:
gem 'bitso'
Create API Key
More info at: https://bitso.com/api_info
Setup
Bitso.setup do |config|
config.key = YOUR_API_KEY
config.secret = YOUR_API_SECRET
config.client_id = YOUR_BITSO_USERNAME
end
If you fail to set your key
or secret
or client_id
a MissingConfigExeception
will be raised.
Bitso ticker
The Bitso ticker. Returns last
, high
, low
, volume
, bid
and ask
Bitso.ticker
It's also possible to query through the Bitso::Ticker
object with
each individual method.
Bitso::Ticker.low # => "109.00"
Fetch your open order
Returns an array with your open orders.
Bitso.orders.all
Create a sell order
Returns an Order
object.
Bitso.orders.sell(amount: 1.0, price: 111)
Create a buy order
Returns an Order
object.
Bitso.orders.buy(amount: 1.0, price: 111)
Fetch your transactions
Returns an Array
of UserTransaction
.
Bitso.user_transactions.all
To be continued!*
Tests
If you'd like to run the tests you need to set the following environment variables:
export BITSO_KEY=xxx
export BITSO_SECRET=yyy
export BITSO_CLIENT_ID=zzz
Contributing
- Fork it
- 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 new Pull Request
Credits
This is a fork of the Bitstamp gem built by kojnapp.