Last active
November 29, 2017 22:11
-
-
Save nuevoalex/730c2dbcb58e289e15bfd2e09aaa901e to your computer and use it in GitHub Desktop.
Create Order
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
var Augur = require("augur.js"); | |
var augur = new Augur(); | |
var ethereumNode = { http: "http://127.0.0.1:8545", ws: "ws://127.0.0.1:8546" }; | |
augur.connect({ ethereumNode }); | |
augur.api.Cash.approve({ | |
_spender: augur.contracts.addresses[augur.rpc.getNetworkID()].Augur, | |
_value: augur.constants.ETERNAL_APPROVAL_VALUE, | |
onFailed: function (err) { console.error(err); }, | |
onSent: function(res) { console.log("SENT", res); }, | |
onSuccess: function(res) { console.log("SUCCESS", res); | |
} | |
}); | |
var txObj = { tx: { value: '0x470de4df820000' }, | |
_type: 0, | |
_attoshares: '0x9184e72a000', | |
_displayPrice: '0x7d0', | |
_market: '0x272a4c898e8c292de91467f6a5047bdbb687fdda', | |
_outcome: 0, | |
_betterOrderId: 0, | |
_worseOrderId: 0, | |
_tradeGroupId: 0, | |
onSent: function (res) { console.log("buy sent:", res.callReturn, res.hash); }, | |
onSuccess: function (res) { console.log("buy success:", res.callReturn, res.hash); }, | |
onFailed: function (err) { console.error("buy failed", err); } | |
}; | |
augur.api.CreateOrder.publicCreateOrder(txObj) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment