AuroraDAO / idex-api-docs

IDEX API documentation (work in progress)
81 stars 27 forks source link

Invalid order signature #49

Open GoldRat opened 5 years ago

GoldRat commented 5 years ago

I've tested my algorithm by example you've given at #26. The result is perfect match to your r, s, v values. However the error "Invalid order signature" still appears (not always but sometimes). As well as "Invalid cancel signature"

GoldRat commented 5 years ago

Is there any error in prodiced payload for this wallet, key and parameters?

Wallet: 0x351296f44a5bf3f05eaa7d78a560f50dd736b728
Private key: 0xce8291ae3e3f6db1f7d763fa543c1aa7c76080f69880d695bf131f4ca7bde67a
(just for testing)

Parameters to hash:

contract address: "0x2a0c0dbecc7e4d658f48e01e3fa353f44050c208"
tokenBuy: "0x0000000000000000000000000000000000000000" 
amountBuy: 307221119998007832
tokenSell: "0x3839d8ba312751aa0248fed6a8bacb84308e20ed"
amountSell: 1656000000000000000000
expires: 10000
nonce: 9083778557123208
address: "0x351296f44a5bf3f05eaa7d78a560f50dd736b728"

Produced payload:

{"tokenBuy":"0x0000000000000000000000000000000000000000",
"amountBuy":"307221119998007832",
"tokenSell":"0x3839d8ba312751aa0248fed6a8bacb84308e20ed",
"amountSell":"1656000000000000000000",
"address":"0x351296f44a5bf3f05eaa7d78a560f50dd736b728",
"nonce":9083778557123208,
"expires":10000,
"v":28,
"r":"0x1137e69217ec888358be9a4bacaa239ec09784bdfed14865cdbf9761da3a6300",
"s":"0x634cb43de81fb6ff56b69aa5cb721a8d9d75e49b908119cea0c6a34a73ece3b4"}
cybergogic commented 5 years ago

Hi! When i use the payload with your address, Idex answer "try making a larger order..." {"tokenBuy":"0xcdcfc0f66c522fd086a1b725ea3c0eeb9f9e8814","amountBuy":"139611895000864697098","tokenSell":"0x0000000000000000000000000000000000000000","amountSell":"40000000000000000","address":"0x351296f44a5bf3f05eaa7d78a560f50dd736b728","nonce":"2","expires":"10000","r":"0x50573d44812198c38d03fc815026c8c85669a43bcade519f44440acaaf2ab2be","s":"0x3136be5df241628bcafb845aea2c9b4d6e5d1bb87bc410af228e4d503ec39134","v":28}

But, when i change your address field to my 0x8F8E5665D94B4EaD9978247bA0E9d643be1936f4 ,i get the Invalid order signature, allthough i use Node.js algorihm from API samples.

Maybe do you know the reason?

I think, that "Invalid order signature" means "Any error"

GoldRat commented 5 years ago

You should calculate r, s, v using your address and keys I guess.