Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: trading API #98

Open
wants to merge 33 commits into
base: main
Choose a base branch
from
Open

feat: trading API #98

wants to merge 33 commits into from

Conversation

shoom3301
Copy link
Contributor

@shoom3301 shoom3301 commented Nov 20, 2024

README https://github.com/cowprotocol/bff/blob/feat/trading-sdk/apps/api/src/app/routes/trading/README.md

/trading API provides a convenient way to use CoW Protocol.
Essencially this API is a facade on top of cowprotocol/cow-sdk#213.

@shoom3301 shoom3301 self-assigned this Nov 20, 2024
Copy link

socket-security bot commented Nov 20, 2024

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report↗︎

@cowprotocol cowprotocol deleted a comment from socket-security bot Nov 20, 2024
@cowprotocol cowprotocol deleted a comment from socket-security bot Nov 20, 2024
@cowprotocol cowprotocol deleted a comment from socket-security bot Nov 25, 2024
@cowprotocol cowprotocol deleted a comment from socket-security bot Nov 26, 2024
@shoom3301 shoom3301 requested a review from a team November 28, 2024 12:23
@shoom3301 shoom3301 marked this pull request as ready for review November 28, 2024 12:23
@cowprotocol cowprotocol deleted a comment from socket-security bot Nov 28, 2024
@cowprotocol cowprotocol deleted a comment from socket-security bot Nov 28, 2024
@cowprotocol cowprotocol deleted a comment from socket-security bot Nov 28, 2024
@cowprotocol cowprotocol deleted a comment from socket-security bot Dec 2, 2024
@cowprotocol cowprotocol deleted a comment from socket-security bot Dec 2, 2024
Copy link
Contributor

@anxolin anxolin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't feel too strong, cause I also don't like my suggestions for the naming, but I tried to get rid of verbs and use a more RESTful naming convention

In our case it sucks a bit we need to use POST for methods that would feel more semantic with GET, but we are limited by the parameters we can pass, so I added the -request suffix to some of them. As I said, I don't love my proposal either, maybe someone else or chat gpt can give you better inspiration.

Anyways, the relevant part of this PR is APPROVEd. I just feel this API would be extremely useful for 3rd parties. It just makes integration 10x easier!

POST /trading/quote-requests - Request a new quote for placing an order
POST /trading/sell-native-currency-requests - returns a transaction details for selling native currency
POST /trading/orders - send an order to the order-book

apps/api/src/app/routes/trading/README.md Outdated Show resolved Hide resolved
apps/api/src/app/routes/trading/README.md Outdated Show resolved Hide resolved
apps/api/src/app/routes/trading/README.md Outdated Show resolved Hide resolved
appDataInfo
})

// ACTION NEEDED: Send <preSignTransaction> from smart-contract wallet
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not adding the code to send the TX onhcain?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It very depends on a smart-contract wallet implementation.
With Safe it requires a lot of code here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For Safe you can go to Transaction build and put the tx data there

@cowprotocol cowprotocol deleted a comment from socket-security bot Dec 3, 2024
@cowprotocol cowprotocol deleted a comment from socket-security bot Dec 13, 2024
@shoom3301 shoom3301 requested a review from a team December 13, 2024 09:14
@cowprotocol cowprotocol deleted a comment from socket-security bot Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants