Skip to content

Instantly share code, notes, and snippets.

@ukstv

ukstv/check.js Secret

Created November 15, 2017 12:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ukstv/bb2915784dfe7102eca1c599018f0aaa to your computer and use it in GitHub Desktop.
Save ukstv/bb2915784dfe7102eca1c599018f0aaa to your computer and use it in GitHub Desktop.
const sender = '0x7847ae348404694757f6e059174cfc0aa7b27c29'
const Web3 = require('web3');
const Machinomy = require('machinomy').default;
const provider = new Web3.providers.HttpProvider("http://localhost:8545")
let web3 = new Web3(provider);
let machinomy = new Machinomy(sender, web3, {engine: 'nedb'});
const price = Number(web3.toWei(1, 'ether'));
const receiver = '0xebeab176c2ca2ae72f11abb1cecad5df6ccb8dfe'
const result = machinomy.buy({
receiver: receiver,
price: price,
gateway: 'http://localhost:3001/machinomy'
})
let channelId = result.channelId
machinomy.close(channelId)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment