0.0.1 • Published 6 years ago

okex-rest v0.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

OKEX API Wrapper

A node.js wrapper for the REST APIs exposed by bitcoin exchange OKEX. You will need to have a registered account with OKEX and generated API keys to access the private methods.

Please contact support@okcoin.com if you are having trouble opening an account or generating an API key.

This module is forked from okcoin-china.

Install

npm install okex-rest

var OKEX = require('okex-rest');

// 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 OKCoin('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');