Project

bter-ruby

0.0
No commit activity in last 3 years
No release in over 3 years
Ruby api for the bter.com cryptocurrency exchange
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

>= 10.3.2, ~> 10.3
>= 3.0.0, ~> 3.0

Runtime

>= 0.13.1, ~> 0.13
>= 1.8.1, ~> 1.8
 Project Readme

Bter-Ruby Build StatusGem Version

Ruby api for the bter.com cryptocurrency exchange

Install with

gem install bter-ruby

and then require in your project

require 'bter'

The library has two parts , one for the public api and one for the trading one.

The public api has the following methods

bt = Bter::Public.new
bt.pairs
bt.tickers
bt.ticker(pair)
bt.depth(pair)
bt.info
bt.details
bt.trades(pair, tid) # alias .history

tid parameter is optional on trades method and if omitted will return the most recent 80 trade history records.

To use the trading api , you need to supply your key and secret

bt = Bter::Trade.new

bt.key = "my key"
bt.secret = "my secret"

Then you can use the available methods:

bt.get_info
bt.active_orders
bt.my_trades(pair)
bt.order_status(order_id)
bt.cancel_order(order_id)
bt.buy(pair, amount, rate)
bt.sell(pair, amount, rate)

rate parameter is optional on buy and sell methods and if omitted the current rate will be used.

Also check the two examples in the examples folder.

Tested on:

MRI 2.1.1 MRI 2.1.0 MRI 2.0 MRI 1.93 Rubinius 2.2.6

Contributing

  1. Fork it
  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 new Pull Request

Licensed under MIT.