etherdelta / etherdelta.github.io

https://etherdelta.com
555 stars 689 forks source link

API for new order #203

Open gwh709394 opened 6 years ago

gwh709394 commented 6 years ago

Hello, I try to write a bot to trade. I got a message as 'failed to parse to JSON' when I post new order. I follow the API Doc and the codes which link is https://gist.github.com/zackcoburn/c29cad5c18785d8308949cbcc26e4f23[https://gist.github.com/zackcoburn/c29cad5c18785d8308949cbcc26e4f23](url)

Could you help me to solve this?

my post data is {"message":{"amountGive":0.01799997,"amountGet":10,"tokenGive":"0x0000000000000000000000000000000000000000","tokenGet":"0x86fa049857e0209aa7d9e616f7eb3b3b78ecfdb0","contractAddr":"0x8d12a197cb00d4747a1fe03395095ce2a5cc6819","expires":5000000,"nonce":1508815145000,"user":"0xF7389cba9D9e0229644c23F252E86551A100ff49","v":28,"r":70141092457980972403388397699554495737499916642062299880029255014525850731079,"s":21692527436854006029041657639240911345488518961006109190928626420638729084729}}

zackcoburn commented 6 years ago

Documentation for the new realtime API, including a working example maker/taker bot will be published on Wednesday. I think this will solve all of your issues.

Zack Coburn

NOTICE: This e-mail transmission (and/or the attachments accompanying it) may contain confidential information belonging to the sender which is protected by law. The information is intended only for the use of the intended recipient. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or the taking of any action in reliance on the contents of this information is strictly prohibited. Any unauthorized interception of this transmission is illegal. If you have received this transmission in error, please promptly notify the sender by reply e-mail, and then destroy all copies of the transmission.

On Tue, Oct 24, 2017 at 12:28 AM, exmooncake notifications@github.com wrote:

Hello, I try to write a bot to trade. I got a message as 'failed to parse to JSON' when I post new order. I follow the API Doc and the codes which link is https://gist.github.com/zackcoburn/c29cad5c18785d8308949cbcc26e4f 23https://gist.github.com/zackcoburn/c29cad5c18785d8308949cbcc26e4f 23

Could you help me to solve this?

my post data is {"message":{"amountGive":0.01799997,"amountGet":10,"tokenGive":" 0x0000000000000000000000000000000000000000","tokenGet":" 0x86fa049857e0209aa7d9e616f7eb3b3b78ecfdb0","contractAddr":" 0x8d12a197cb00d4747a1fe03395095ce2a5cc6819","expires": 5000000,"nonce":1508815145000,"user":"0xF7389cba9D9e0229644c23F252E8 6551A100ff49","v":28,"r":701410924579809724033883976995 54495737499916642062299880029255014525850731079,"s": 216925274368540060290416576392409113454885189610061091909286 26420638729084729}}

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/etherdelta/etherdelta.github.io/issues/203, or mute the thread https://github.com/notifications/unsubscribe-auth/APEqPVHFUBHrXs7Mc1crVBxg38XnujNEks5svWdpgaJpZM4QD1Ax .

gwh709394 commented 6 years ago

Ok. Thanks.

The link https://github.com/etherdelta/etherdelta.github.io/blob/master/bots is not work.

wdashi-hk commented 6 years ago

any develop tools i can user to run the bot example?

zackcoburn commented 6 years ago

All you need is nodejs (https://nodejs.org/en/).

Zack Coburn

NOTICE: This e-mail transmission (and/or the attachments accompanying it) may contain confidential information belonging to the sender which is protected by law. The information is intended only for the use of the intended recipient. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or the taking of any action in reliance on the contents of this information is strictly prohibited. Any unauthorized interception of this transmission is illegal. If you have received this transmission in error, please promptly notify the sender by reply e-mail, and then destroy all copies of the transmission.

On Mon, Oct 30, 2017 at 6:00 AM, waterhkzhong notifications@github.com wrote:

any develop tools i can user to run the bot example?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/etherdelta/etherdelta.github.io/issues/203#issuecomment-340397309, or mute the thread https://github.com/notifications/unsubscribe-auth/APEqPZrRA3nA3ZOsK1CnpMfrWFSPIOLzks5sxZ5XgaJpZM4QD1Ax .

wdashi-hk commented 6 years ago

const [walletETH, walletToken, EtherDeltaETH, EtherDeltaToken] = results; ^

SyntaxError: Unexpected token [

When I run taker.js, I got this failure. Any ploblem with my environment?

zackcoburn commented 6 years ago

Make sure you're running the latest nodejs and that you have the Babel dependencies installed.

Zack Coburn

NOTICE: This e-mail transmission (and/or the attachments accompanying it) may contain confidential information belonging to the sender which is protected by law. The information is intended only for the use of the intended recipient. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or the taking of any action in reliance on the contents of this information is strictly prohibited. Any unauthorized interception of this transmission is illegal. If you have received this transmission in error, please promptly notify the sender by reply e-mail, and then destroy all copies of the transmission.

On Mon, Oct 30, 2017 at 12:23 PM, waterhkzhong notifications@github.com wrote:

const [walletETH, walletToken, EtherDeltaETH, EtherDeltaToken] = results; ^

SyntaxError: Unexpected token [

When I run taker.js, I got this failure. Any ploblem with my environment?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/etherdelta/etherdelta.github.io/issues/203#issuecomment-340499763, or mute the thread https://github.com/notifications/unsubscribe-auth/APEqPRX3eBWnt9rcdKas4rlGmoggdfsiks5sxff4gaJpZM4QD1Ax .

wdashi-hk commented 6 years ago

yes, my nodejs version is the latest. And i have install Babel. But i still face the problem.

BTW, i saw a warning when i installed dependencies, any suggestion may help ?


npm WARN deprecated babel-preset-es2015@6.24.1: 🙌 Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!

wdashi-hk commented 6 years ago

it works when i restart. thanks. :)