No commit activity in last 3 years
No release in over 3 years
Coinbase Exchange ruby client
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 1.1.2, ~> 1.1
 Project Readme

Gem Version

Coinbase Exchange Ruby Client

The library wraps the http request and message signing. Create an account at https://exchange.coinbase.com to get started.

Installation

gem install coinbase_exchange

Or, include this in your gemfile: gem 'coinbase_exchange', '~> 0.0.3'

Example

require "coinbase_exchange"

cbe = CoinbaseExchange.new API_KEY, API_SECRET, API_PASSPHRASE


# Account balance
cbe.get('accounts')
# => [{"id"=>"000ea663...", "currency"=>"USD", "balance"=>"90.0000114750000000", "hold"=>"0.0000000000000000", "available"=>"0.9000114750000000", "profile_id"=>"4409df27..."}, {"id"=>"8bfe", "currency"=>"BTC", "balance"=>"9.4426882700000000", "hold"=>"0.0000000000000000", "available"=>"5.4426882700000000", "profile_id"=>"a8f2d8..."}] 

# Create an order
cbe.post 'orders', {
    "size" => 1.01,
    "price" => 1.100,
    "side" => "buy",
    "product_id" => "BTC-USD"
}

# Product tickers
cbe.get('products/BTC-USD/ticker')
# => {"trade_id"=>125681, "price"=>"226.20000000", "size"=>"0.01570000", "time"=>"2015-02-08T04:46:17.352746Z"}

Block syntax is fully supported

cbe.get('accounts') do |response|
  puts response
end

cbe.post('orders', {
    "size" => 1.01,
    "price" => 1.100,
    "side" => "buy",
    "product_id" => "BTC-USD"
}) do |response|
  puts response
end

Use at your own risk. I assume no liability for gains or losses you incur while using this gem.