Skip to content
This repository has been archived by the owner on May 15, 2023. It is now read-only.

Latest commit

 

History

History
38 lines (25 loc) · 854 Bytes

README.md

File metadata and controls

38 lines (25 loc) · 854 Bytes

okcoin-api

Basic Javascript wrapper for OKCoin & OKEx's WebSocket API.

Example

See index.html for a live working example.

function handleIndex(message) {
    // ...
}

function handleDepth(message) {
    // ...
}

new OKCoin('wss://real.okex.com:10441/websocket')
.addChannelHandler('ok_sub_futureusd_btc_index', handleIndex)
.addChannelHandler('ok_sub_futureusd_btc_depth_quarter_60', handleDepth)
.start()

Use

jsDelivr can be used to serve a specific version (see tags for version numbers):

<script src="https://cdn.jsdelivr.net/gh/nyg/okcoin-api@x.y.z/okcoin-api.js"></script>

Dependency

Requires pako.

Note

Doesn't support version 3 of the API.