-
-
Save ukstv/bb2915784dfe7102eca1c599018f0aaa to your computer and use it in GitHub Desktop.
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 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