Created
September 24, 2018 14:35
-
-
Save plutoegg/aec853b3279f925a5ac55adc65b04cf7 to your computer and use it in GitHub Desktop.
Trustless Developer Guide - 6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ethUtils = require('ethereumjs-utils') | |
const privKey = /* Your Private Key */ | |
const nonce = ((Date.now() / 1000) + 10800) + '' | |
const hash = ethUtils.hashPersonalMessage(ethUtils.toBuffer(nonce.toString(16))) | |
const signature = ethUtils.ecsign(hash, privKey) | |
// Get all open orders | |
const openOrders = await efx.getOrders(null, null, nonce, signature) | |
// Get all historical orders | |
const historicalOrders = await efx.getOrderHist(null, null, nonce, signature) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment