Project

quadrigacx

0.01
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Ruby wrapper for the QuadrigaCX API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
~> 5.0
~> 10.0
~> 3.1
~> 2.9
~> 3.2.0

Runtime

~> 1.8
~> 2.0.2
 Project Readme

Gem Version Build Status Maintainability Test Coverage

Quadrigacx

Ruby wrapper for the QuadrigaCX API.

Installation

Add this line to your application's Gemfile:

gem 'quadrigacx'

And then execute:

$ bundle

Or install it yourself as:

$ gem install quadrigacx

Usage

require 'quadrigacx'

QuadrigaCX.configure do |config|
  config.client_id  = 'your-client-id'
  config.api_key    = 'your-api-key'
  config.api_secret = 'your-api-secret'
end

client = QuadrigaCX::Client.new

Public Methods

Ticker

Return trading information.

ticker = client.ticker

Order Book

List all open orders.

order_book = client.order_book
order_book_ungrouped = client.order_book(group: 0)

Transactions

Return descending JSON list of recent trades.

transactions = client.transactions

Private Methods

Balance

List all account balances.

balance = client.balance

Limit Buy

Place a limit buy order. Returns JSON describing the order.

order = client.limit_buy(price: 200, amount: 1)

Limit Sell

Place a limit sell order. Returns JSON describing the order.

order = client.limit_sell(price: 200, amount: 1)

Market Buy

Place a market order. Returns JSON describing the order.

order = client.market_buy(amount: 5.00)

Market Sell

Place a market order. Returns JSON describing the order.

order = client.market_sell(amount: 0.01)

Cancel Order

Cancel an order.

client.cancel_order(id: order.id)

Open Orders

Return a JSON list of open orders.

response = client.open_orders

Lookup Order

Returns a JSON list of details about 1 or more orders.

response = client.lookup_order(id: order.id)

Withdraw Coins

Withdraw coins (i.e., bitcoin).

response = client.withdraw(QuadrigaCX::Coin::BITCOIN, amount: 1, address: '1FAs1ywa3pqS6S5mvypXjCtHAzwCkymNUX')

Deposit Address

Return a deposit address (i.e., bitcoin).

response = client.deposit_address(QuadrigaCX::Coin::BITCOIN)

User Transactions

Return a list of user transactions.

response = client.user_transactions

Contributing

  1. Fork it ( https://github.com/[my-github-username]/quadrigacx/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