cowprotocol / cow-sdk

CoW protocol SDK
https://docs.cow.fi/cow-protocol/reference/sdks/cow-sdk
Other
31 stars 9 forks source link

feat: upload appData, get data, surplus, version, and solver competition #131

Closed anxolin closed 1 year ago

anxolin commented 1 year ago

This PR updates the SDK with the latest methods from the API. It also adds the respective tests.

Adds the verified option for the PriceQuality in the Quote endpoint

This is autogenerated. This PR adds the option

Get Version

I don't think is a new method, but we didn't have it in the SDK and it is convenient. We should consider showing it in the footer.

Get total surplus

It's not new, and I'm not sure why we didn't add it before, but better late than never

Get App Data

Allows you to get the fullAppData for a given App Data hash

Upload App Data

Allows you to upload the fullAppData for a given App Data hash and its content (fullAppData)

Get solver competition by auctionId

Gives you information about the solver competition given an auction Id

Get solver competition by tx hash

Gives you information about the solver competition given a transaction hash

Context

https://cowservices.slack.com/archives/C0375NV72SC/p1690297997334099

DO NOT MERGE YET

This PR assumes this change is applied: https://cowservices.slack.com/archives/C0375NV72SC/p1690808436607429?thread_ts=1690297997.334099&cid=C0375NV72SC

It needs to be tested as a RC in CoW Swap before we officially close the release

github-actions[bot] commented 1 year ago

CLA Assistant Lite bot:
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request

coveralls commented 1 year ago

Coverage Status

coverage: 71.565% (+1.4%) from 70.169% when pulling 033ce1560a6a06e36556948d65b6373d6b19d3fc on update-sdk into b0abac180aa4ba860baeec19e4a402e6de31dc0d on main.

socket-security[bot] commented 1 year ago

Removed dependencies detected. Learn more about Socket for GitHub ↗︎

🚮 Removed packages: @cowprotocol/cow-sdk@2.2.1

alfetopito commented 1 year ago

Get total surplus

It's not new, and I'm not sure why we didn't add it before, but better late than never

That's on me, as I added as a TODO on CoWSwap but did not get back to it

https://github.com/cowprotocol/cowswap/blob/develop/src/api/gnosisProtocol/api.ts#L231C22-L231C22