Closed jopmiddelkamp closed 1 month ago
I find this proposal as reasonable as we currently rely only on delivery_currency in the case
What do you think about this @JakeUrban?
Hey @jopmiddelkamp, I think we already have solutions to the requirements defined in the issue description.
Because SEP-24 has the interactive web view, all of this can be encompassed in the UX, and we can avoid having to communicate this info via API:
asset_code
and optionally source_asset
If we're trying to avoid using the webview for this, anchors can optionally offer a SEP-38 API to expose information about exchange rates, fees, and deliver methods.
/info
describes which payment methods are supported for each asset. GET /price
and POST /quote
endpoints provide exchange rate and fee information. Using SEP-38 is a more flexible approach than trying to include exchange rate, min/max amounts, and supported payment rails all via SEP-24's GET /info
.
This issue is stale because it has been open for 30 days with no activity. It will be closed in 30 days unless the stale label is removed.
We propose an enhancement to the
POST TRANSFER_SERVER_SEP0024/transactions/deposit/interactive
endpoint, allowing the definition ofdelivery_methods
to restrict user payment methods, similar to howasset_code
operates for specifying asset types.asset_code
: asset_code/info
response’s deposit object. When quote_id is specified,asset_code
must match the quote’sbuy_asset
asset code.delivery_method
: delivery_method/info
response’s deposit object. Possible values include:cash
: The deposit will be delivered in cash.bank
: The deposit will be transferred to a bank account. This can be ACH, IBAN, PIX, etc.card
: The deposit will be made to a prepaid, debit or credit card.crypto
: The deposit will be transferred to a specified cryptocurrency wallet. This parameter ensures that the user can only use the specified delivery method for their deposit, similar to howasset_code
restricts the asset type. This is particularly useful for anchors that support multiple delivery methods for the same asset.To support this, we need to extend the
/info
response with additional data:However, this addition alone isn’t sufficient for many anchors. For instance, some anchors allow users to buy
USDC
with various local fiat currencies, but the delivery method may vary based on the currency. This creates a scenario where multiple local currency options exist, but only oneUSDC
entry can be specified, limiting the granularity of delivery method options.For example,
card
might be supported fromUSD
toUSDC
but not fromARS
toUSDC
. This indicates that SEP-24 was designed with the assumption that anchors distribute stablecoins primarily in their preferred currency.Given this limitation, it appears that SEP-24 might not fully accommodate anchors with such diverse setups without introducing breaking changes. To address this, we need to consider:
We kind of expect something like this for the protocol:
To implement this, we propose the following changes to the interactive endpoint to replace
asset_code
,source_asset
, anddestination_asset
withsending_asset
andreceiving_asset
:/info
response’s deposit object./info
response’s deposit object.Additionally, we would like to include an approximate exchange rate in the /info response to provide users with an estimation of the exchange rate in the deposit/withdrawal option cards:
This allows users to see a close estimation of the exchange rate before initiating the transaction. To handle more complex fee structures, we propose updating the fee structure to allow for advanced configurations:
from
amount,fee_fixed
, andfee_percent
. This allows for flexible and complex fee structures to be defined by the anchors.With these additional improvements, we would expect something like this for the protocol:
We seek feedback on whether such changes can be integrated into SEP-24 or if a new SEP should be created to accommodate anchors with varied delivery method requirements based on local fiat currencies. We hope some people will join the conversation on this topic!