Giter Site home page Giter Site logo

client-ruby's Introduction

OmniTrade API Ruby Client

Build Status

omnitrade_client is an open-source Ruby gem that integrates the OmniTrade API.

You can read the API documentation by visiting https://omnitrade.io/documents/api_v2

Installation

Add omnitrade_client to your Gemfile.

gem 'omnitrade_client', github: 'OmniTrade/client-ruby'

Install by running:

bundle install

Usage

Require the client in your code by adding:

require 'omnitrade_client'

You can use both the public or private API.

Public


Instance your public client by using:

public_client = OmniTradeAPI::Client.new

.get_public

Use .get_public to make a GET request to an URL, as the following example:

client_public.get_public '/api/v2/markets'

Private


When using the private client, you also have to specify your access and private keys in the instantiation:

private_client = OmniTradeAPI::Client.new access_key: 'your_access_key', secret_key: 'your_secret_key'

You can also set a timeout and/or endpoit by adding the arguments:

private_client = OmniTradeAPI::Client.new access_key: 'your_access_key', secret_key: 'your_secret_key', timeout: 60, endpoint: 'https://omnitrade.io/'

.get

Use .get to make a GET request to an URL, you can also set the required arguments, as the following example:

private_client.get '/api/v2/orders', market: 'btcbrl'

.post

Use .post to make a POST request to an URL, you can also set the required arguments, as the following example:

private_client.post '/api/v2/order', market: 'btcbrl', side: 'buy', volume: '0.42', price: '4200.0'

Licence

OmniTrade (C) All Rights Reserved.

omnitrade_client is released under Apache License 2.0.

client-ruby's People

Contributors

adbatista avatar laka3000 avatar davidsilveira avatar

Watchers

James Cloos avatar Luan Gonçalves Barbosa avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.