omnitrade-client is an open-source node JS that integrates the OmniTrade API.
You can read the API documentation by visiting https://omnitrade.io/documents/api_v2
Download the client and place it inside your application.
Require it by using
const OmniTradeApi = require("path/to/omnitrade-client-js/index.js");
You can use both the public or private API.
Instance your public client by using:
const public_api = OmniTradeApi({});
Make requests to the API using the following methods, as the exaple follows:
public_api.get_orders({market: 'btcbrl'}).then(function(data){
foo.bar(data);
});
Makes a GET request to '/api/v2/markets'.
@params market {String} - the desired market (optional)
Makes a GET request to '/api/v2/tickers'. You can also get the tickers for a desired market by passing it as an argument.
@params parameters {Hash} - a hash with the desired parameters
Consult the API Documentation for more information.
Makes a GET request to '/api/v2/order_book'.
@params parameters {Hash} - a hash with the desired parameters
Consult the API Documentation for more information.
Makes a GET request to '/api/v2/trades'.
@params parameters {Hash} - a hash with the desired parameters
Consult the API Documentation for more information.
Makes a GET request to '/api/v2/k'.
@params parameters {Hash} - a hash with the desired parameters
Consult the API Documentation for more information.
Makes a GET request to '/api/v2/k_with_pending_trades'.
@params parameters {Hash} - a hash with the desired parameters
Consult the API Documentation for more information.
Makes a GET request to '/api/v2/depth'.
Makes a GET request to '/api/v2/timestamp'.
Makes a GET request to '/api/v2/trezor/new_challenge'.
You can also use your private client to make requests to the public API, using the methods listed in the previous section.
Instance your private client by using:
const private_api = OmniTradeApi({access_key: "your_access_key", secret: "your_secret_key"});
Make requests to the API using the following methods, as the example follows:
private_api.get_me().then(function(data){
foo.bar(data);
});
Makes a GET request to '/api/v2/members/me'.
@params password {String} - the password to be validated
Makes a GET request to '/api/v2/users/validate_password'.
@params parameters {Hash} - a hash with the desired parameters
Consult the API Documentation for more information. Access key, secret key and signature are not to be specified on this hash.
Makes a GET request to '/api/v2/deposits'.
@params txid {String} - the txid of the deposit
Makes a GET request to '/api/v2/users/deposit'.
@params currency {String} - the currency that will be requested the address for.
Makes a GET request to '/api/v2/users/deposit_address'.
@params parameters {Hash} - a hash with the desired parameters
Consult the API Documentation for more information. Access key, secret key and signature are not to be specified on this hash.
Makes a GET request to '/api/v2/orders'.
@params parameters {Hash} - a hash with the desired parameters
Consult the API Documentation for more information. Access key, secret key and signature are not to be specified on this hash.
Makes a POST request to '/api/v2/orders'.
@params parameters {Hash} - a hash with the desired parameters
Consult the API Documentation for more information. Access key, secret key and signature are not to be specified on this hash.
Makes a POST request to '/api/v2/orders/multi'.
@params parameters {Hash} - a hash with the desired parameters
Consult the API Documentation for more information. Access key, secret key and signature are not to be specified on this hash.
Makes a POST request to '/api/v2/orders/clear'.
@params id {String} - the id of the deposit
Makes a GET request to '/api/v2/order'.
@params id {String} - the id of the deposit
Makes a POST request to '/api/v2/order/delete'.
@params market {String} - the desired market
Makes a GET request to '/api/v2/orderbook'.
@params parameters {Hash} - a hash with the desired parameters
Consult the API Documentation for more information. Access key, secret key and signature are not to be specified on this hash.
Makes a GET request to '/api/v2/trades/my'.
OmniTrade (C) All Rights Reserved.
omnitrade-client
is released under Apache License 2.0.