<commit_before># Okcoin API Ruby Wrapper
Unofficial ruby library for Okcoin Bitcoin Exchange

## Installation

Add these gems into your Gemfile:

```ruby
gem 'okcoin-ruby',  :github => 'ilyacherevkov/okcoin-ruby'
gem 'celluloid-websocket-client',  :github => 'ilyacherevkov/celluloid-websocket-client'
```

And then execute:

    $ bundle install

## Usage

### 1. REST Example
```
okcoin = Okcoin::Rest.new api_key: ENV['OKCOIN_APIKEY'], secret_key: ENV['OKCOIN_SECRET']
puts okcoin.userinfo
puts okcoin.orderbook(pair: "btcusd", items_no: 50)
```

### 2. WebSocket Example

```
  okcoin = Okcoin::WS.new api_key: ENV['OKCOIN_APIKEY'], secret_key: ENV['OKCOIN_SECRET']
  okcoin.userinfo
  okcoin.pingpong
  okcoin.price_api("{'event':'addChannel','channel':'ok_btcusd_ticker'}")<commit_msg>Specified gem version in docs<commit_after># Okcoin API Ruby Wrapper
Unofficial ruby library for Okcoin Bitcoin Exchange

## Installation

Add these gems into your Gemfile:

```ruby
gem 'okcoin-ruby', '0.0.4'
gem 'celluloid-websocket-client',  :github => 'ilyacherevkov/celluloid-websocket-client'
```

And then execute:

    $ bundle install

## Usage

### 1. REST Example
```
okcoin = Okcoin::Rest.new api_key: ENV['OKCOIN_APIKEY'], secret_key: ENV['OKCOIN_SECRET']
puts okcoin.userinfo
puts okcoin.orderbook(pair: "btcusd", items_no: 50)
```

### 2. WebSocket Example

```
  okcoin = Okcoin::WS.new api_key: ENV['OKCOIN_APIKEY'], secret_key: ENV['OKCOIN_SECRET']
  okcoin.userinfo
  okcoin.pingpong
  okcoin.price_api("{'event':'addChannel','channel':'ok_btcusd_ticker'}")
{'fraction_non_alphanumeric': 0.1475095785440613, 'fraction_numerical': 0.0070242656449553, 'mean_word_length': 5.8130434782608695, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '388272', 'n_tokens_mistral': 627, 'n_tokens_neox': 580, 'n_words': 126}