UNPKG

efx-api-node

Version:

<img src="https://avatars3.githubusercontent.com/u/33315316?s=200&v=4" align="right" />

34 lines (22 loc) 688 B
// Please check ../test/index.js for all examples and tests const EFX = require('..') work = async () => { // assuming you have a provider running at: // http://localhost:8545 efx = await EFX() // unlock wallet so we can sign transactions await efx.account.unlock('password') // check how much ETH is already locked let response console.log("") // submit an order to SELL 0.01 ETH for 200 USD console.log("efx.submitOrder('ETHUSD', -0.02, 100)") response = await efx.submitOrder('ETHUSD', -0.02, 100) if(response.length){ console.log(` - Submitted Order: #${response[0]}`) } else { console.log("Error:") console.log(response) } } work()