Skip to content
This repository was archived by the owner on Jul 28, 2020. It is now read-only.

Repository files navigation

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.newaccess_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.newaccess_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/orders',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.

About

Cliente Ruby para as APIs da OmniTrade

Resources

Stars

1 star

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages