I am looking at https://0x.org/docs/api#post-orderbookv1order
It talks about sending signed order to the API, but I was unable find the documentation on how to sign the order this api.
Can anyone point me in the right direction ?
I am looking at https://0x.org/docs/api#post-orderbookv1order
It talks about sending signed order to the API, but I was unable find the documentation on how to sign the order this api.
Can anyone point me in the right direction ?
There have been a couple of changes lately related to the 0x API. E.g., the POST/GET urls have changed (i.e. there sra endpoint is no longer available), APIs on Ropsten have been discontinued, and also three additional fields (takerTokenFeeAmount, sender, feeRecipient) are required in the order object. The example on Ropsten that @kimpers shared doesn't work anymore. I have updated my repo which shows some basic examples how to use 0x. I am not part of the 0x team and created those examples myself. There is certainly room for improvement but I hope it's still useful to get you strated.
https://github.com/Walodja1987/0x-fill-order-example/blob/main/src/Sign.js
Here's an updated gist that shows how to sign orders for 0x v4. Do note that it demonstrates via RFQ orders but the method to sign limit orders (orderbook) will be the same, just the payload is different: https://gist.github.com/PirosB3/8141b51fbb307bca265866ef1cef564f
You can refer to this code sandbox as a very basic example of how you can create, sign and submit orders on Ropsten https://codesandbox.io/s/recursing-bell-ydbxb. This is not production ready code but it should be enough to get you started!