jekatigr / okex-rest

okex rest wrapper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OKEX API Wrapper 2

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)

Install

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');

About

okex rest wrapper


Languages

Language:JavaScript 100.0%