A node.js wrapper for the REST APIs exposed by bitcoin exchange OKEX.
This module is forked from okex-rest.
Changes:
- Now it's possible to add any request properties
- Header removed
- Callbacks moved to last argument (for promisify compatibility)
npm install okex-rest2
var OKEX = require('okex-rest2');
// Test public data APIs
var publicClient = new OKEX();
// get iota_btc ticker
publicClient.getTicker(console.log, 'iota_btc');
// get iota_btc order book
publicClient.getDepth(console.log, 'iota_btc');
// get trades defaulting to iota_btc
publicClient.getTrades(console.log);
// replace the parameters with your API key and secret
var privateClient = new OKEX('your-api-key', 'your-api-secret');
privateClient.getUserInfo(console.log);
// buy limit order for 1 IOTA at price 00021054 BTC
privateClient.addTrade(console.log, 'iota_btc', 'buy', '1', '00021054');