Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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