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

Add native asset support to SEP-24 #1363

Merged
merged 6 commits into from
Jun 16, 2023
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 18 additions & 10 deletions ecosystem/sep-0024.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Title: Hosted Deposit and Withdrawal
Author: SDF
Status: Active
Created: 2019-09-18
Updated: 2023-02-06
Version 3.0.0
Updated: 2023-06-14
Version 3.1.0
```

## Simple Summary
Expand Down Expand Up @@ -324,8 +324,8 @@ Request Parameters:

| Name | Type | Description |
| ----------------------------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `asset_code` | string | The code of the stellar asset the user wants to receive for their deposit with the anchor. The value passed must match one of the codes listed in the [/info](#info) response's deposit object. |
| `asset_issuer` | string | (optional) The issuer of the stellar asset the user wants to receive for their deposit with the anchor. If asset_issuer is not provided, the anchor should use the asset issued by themselves as described in their TOML file. |
| `asset_code` | string | The code of the stellar asset the user wants to receive for their deposit with the anchor. The value passed must match one of the codes listed in the [/info](#info) response's deposit object. `native` is a special `asset_code` that represents the native XLM token. |
philipliu marked this conversation as resolved.
Show resolved Hide resolved
| `asset_issuer` | string | (optional) The issuer of the stellar asset the user wants to receive for their deposit with the anchor. If asset_issuer is not provided, the anchor should use the asset issued by themselves as described in their TOML file. If `native` is specified as the `asset_code`, `asset_issuer` must be not be set. |
| `amount` | number | (optional) Amount of asset requested to deposit. If this is not provided it will be collected in the interactive flow. |
| `account` | `G...` or `M...` string | (optional) The Stellar or muxed account the client wants to use as the destination of the payment sent by the anchor. Defaults to the account authenticated via SEP-10 if not specified. |
| `memo_type` | string | (optional) Type of memo that anchor should attach to the Stellar transaction, one of `text`, `id` or `hash`. |
Expand Down Expand Up @@ -518,8 +518,8 @@ Request parameters:

| Name | Type | Description |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `asset_code` | string | Code of the asset the user wants to withdraw. The value passed must match one of the codes listed in the [/info](#info) response's withdraw object. |
| `asset_issuer` | string | (optional) The issuer of the stellar asset the user wants to withdraw with the anchor. If asset_issuer is not provided, the anchor should use the asset issued by themselves as described in their TOML file. |
| `asset_code` | string | Code of the asset the user wants to withdraw. The value passed must match one of the codes listed in the [/info](#info) response's withdraw object. `native` is a special `asset_code` that represents the native XLM token. |
| `asset_issuer` | string | (optional) The issuer of the stellar asset the user wants to withdraw with the anchor. If asset_issuer is not provided, the anchor should use the asset issued by themselves as described in their TOML file. If `native` is specified as the `asset_code`, `asset_issuer` must be not be set. |
| `amount` | number | (optional) Amount of asset requested to withdraw. If this is not provided it will be collected in the interactive flow. |
| `account` | `G...` or `M...` string | (optional) The Stellar or muxed account the client will use as the source of the withdrawal payment to the anchor. Defaults to the account authenticated via SEP-10 if not specified. |
| `memo` | string | (**deprecated**, optional) This field was originally intended to differentiate users of the same Stellar account. However, the anchor should use the `sub` value included in the decoded SEP-10 JWT instead. Anchors should still support this parameter to maintain support for outdated clients. See the [Shared Account Authentication](#shared-omnibus-or-pooled-accounts) section for more information. |
Expand Down Expand Up @@ -767,7 +767,7 @@ wallet. For example:

## Info

Allows an anchor to communicate basic info about what their `TRANSFER_SERVER_SEP0024` supports to wallets and clients.
Allows an anchor to communicate basic info about what their `TRANSFER_SERVER_SEP0024` supports to wallets and clients. If an anchor supports XLM, the `native` asset code should be included in the response.

### Request

Expand Down Expand Up @@ -799,6 +799,11 @@ The response should be a JSON object like:
"enabled": true,
"fee_fixed": 0.002,
"fee_percent": 0
},
"native": {
"enabled": true,
"fee_fixed": 0.00001,
"fee_percent": 0
}
},
"withdraw": {
Expand All @@ -811,6 +816,9 @@ The response should be a JSON object like:
},
"ETH": {
"enabled": false
},
"native": {
"enabled": true
}
},
"fee": {
Expand Down Expand Up @@ -942,7 +950,7 @@ Request parameters:

| Name | Type | Description |
| --------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `asset_code` | string | The code of the asset of interest. E.g. BTC, ETH, USD, INR, etc. |
| `asset_code` | string | The code of the asset of interest. E.g. BTC, ETH, USD, INR, native, etc. |
| `no_older_than` | UTC ISO 8601 string | (optional) The response should contain transactions starting on or after this date & time. |
| `limit` | int | (optional) The response should contain at most `limit` transactions. |
| `kind` | string | (optional) The kind of transaction that is desired. Should be either `deposit` or `withdrawal`. |
Expand Down Expand Up @@ -996,7 +1004,7 @@ Each object in the `transactions` array should have the following fields:

| Name | Type | Description |
| ------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `withdraw_anchor_account` | string | If this is a withdrawal, this is the anchor's Stellar account that the user transferred (or will transfer) their issued asset to. |
| `withdraw_anchor_account` | string | If this is a withdrawal, this is the anchor's Stellar account that the user transferred (or will transfer) their asset to. |
| `withdraw_memo` | string | Memo used when the user transferred to `withdraw_anchor_account`. Assigned null if the withdraw is not ready to receive payment, for example if KYC is not completed. |
| `withdraw_memo_type` | string | Memo type for `withdraw_memo`. |
| `from` | string | Stellar address the assets were withdrawn from |
Expand Down Expand Up @@ -1275,7 +1283,7 @@ There is a small set of changes when upgrading from SEP-6 to SEP-24.
- Solar wallet: https://solarwallet.io

## Changelog

- `v3.1.0`: Add XLM support to SEP-24 ([#1363](https://github.com/stellar/stellar-protocol/pull/1363))
philipliu marked this conversation as resolved.
Show resolved Hide resolved
- `v3.0.0`: Make the `account` parameter for `POST /transactions/deposit/interactive` request optional
([#1343](https://github.com/stellar/stellar-protocol/pull/1343))
- `v2.9.2`: Remove confusing statement on `updated_at` matching `completed_at` when `status` is `refunded`
Expand Down