Closed freezepro closed 6 years ago
I found and tried this one previously at etherdelta, and I understand it's quite close to what you suggest to do here, but quick new to ETH library stuff...however approach below is quick complex and I found some error in there(while executing order).
https://github.com/etherdelta/bots/blob/master/js/service.js lines 447 - 520
Freezepro, have you managed to solve this problem and process trades? if yes, d you be so kind and share your solution. Thank you in advance!
Hi guys, who can tell me how to get 'privateKeyBuffer', thanks a lot.
@cheenid new Buffer('privateKeyBuffer', 'hex')
@vicsnow Thanks mate😊
@freezepro Did you get this sorted out? The procedure to generate a signature should be sufficiently explained in the docs under Contract-backed trade functions (https://github.com/AuroraDAO/idex-api-docs#contract-backed-trade-functions). There's a code sample under the "order" section.
Closing this issue; let me know if you need further assistance.
Thanks for the api docs, could you please provide example on how to get nonce and v,r,s values. Thanks!
const salted = hashPersonalMessage(toBuffer(raw)) const { v, r, s } = mapValues(ecsign(salted, privateKeyBuffer), (value, key) => key === 'v' ? value : bufferToHex(value)); // send v, r, s values in payload