-
Notifications
You must be signed in to change notification settings - Fork 308
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
Add SEP-38 support to SEP-24 #1358
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good start!
I don't see any changes to GET /info
though, we wanted to make changes there right?
I think the only other change requested is to explore adding a parameter for pre-populating the off-chain asset, although its not strictly necessary since we have a UI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved with some comments
# Conflicts: # ecosystem/sep-0024.md
ecosystem/sep-0024.md
Outdated
by `SEP-38 POST /quote` and `SEP-38 POST /prices` API. If set to yes, anchor must support `quote_id` parameter in | ||
interactive endpoints and transaction response body. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a merge typo?
ecosystem/sep-0024.md
Outdated
|
||
## Fee | ||
|
||
### This endpoint is deprecated. The [SEP-38] `GET /price` endpoint should be used to fetch fees instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use **bold**
markdown here rather than a header.
### Description If `quote_id` is provided upon receiving the sep24 request, fetch quote details and populate it into sep24txn object Left out the quote validation since it's specified in doc > When `quote_id` is set, `asset_code`, `source_asset` and `amount` must be validated by the anchor, if present. In case of a conflict with the ones used to create the [SEP-38] quote, this request should be rejected with a `400`. ### Context Add `quote_id` and `source_asset_id` to sep24 txn so that quotes can be displayed to users while initiate deposit/withdraw sep24 transaction ### Testing - `./gradlew test` ### Documentation Updated in stellar/stellar-protocol#1358
Abstract
Currently, there is no way for a wallet to get a quote from the anchor in a standardized way. Anchors may have in-house endpoints for the wallet, however, wallet would need to implement a new set of API for each anchor it integrates with.
What's more, current fee endpoint is not flexible enough, and doesn't offer complex functionality SEP-38 fee (part of the quote object body) has.
Having a quote and fees before proceeding to the interactive screen is very important for the user experience, as without it, user would not be able to know this information before initiating a transaction.
Proposal
This proposal is aimed to solve this problem. We add integration of the existing SEP-38 endpoint with the SEP-24. The wallet may now use the existing SEP-38 endpoints implemented by the anchor to query a quote.
Later, wallet may use the quote id (for the firm quote) to exchange the asset on agreed rates.
Changelog summary
Add support for the SEP-38 API. Add optional
quote_id
parameter topost /transactions/deposit/interactive
and
POST /transactions/deposit/interactive
requests. Addquote_id
to the transaction object schema.Use cases
/price
and/prices
endpointsBackward compatibility
This proposal is fully backward compatible