Skip to content

Instantly share code, notes, and snippets.

@plutoegg
Created September 24, 2018 14:35
Show Gist options
  • Save plutoegg/aec853b3279f925a5ac55adc65b04cf7 to your computer and use it in GitHub Desktop.
Save plutoegg/aec853b3279f925a5ac55adc65b04cf7 to your computer and use it in GitHub Desktop.
Trustless Developer Guide - 6
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