Skip to content

Commit

Permalink
sep24 tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
briwylde08 committed Aug 18, 2023
1 parent ea945c6 commit 64a71e7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ title: "SEP-24: Hosted Deposit and Withdrawal"
sidebar_position: 40
---

SEP-24 provides a standard way for wallets and anchors to interact by having the user open a webview hosted by an anchor to collect and handle KYC information. In this integration, a user's KYC information is entirely gathered and handled by the anchor. For the most part, after the anchor's webview has opened, BasicPay will have little knowledge about what's going on.
import sep24_transfers from "/assets/sep24_transfers.png";

SEP-24 provides a standard way for wallets and anchors to interact by having the user open a webview hosted by an anchor to collect and handle KYC information. In this integration, a user's KYC information is gathered and handled entirely by the anchor. For the most part, after the anchor's webview has opened, BasicPay will have little knowledge about what's going on.

:::info

Expand All @@ -29,6 +31,8 @@ export async function getTransferServerSep24(domain) {

Our application will request the `/info` endpoint from the anchor's transfer server to understand the supported transfer methods (deposit, withdraw) and available endpoints, as well as additional features that may be available during transfers.

<img src={sep24_transfers} width="70%" />

```js title=/src/lib/stellar/sep24.js
// Fetches and returns basic information about what the SEP-24 transfer server supports.
export async function getSep24Info(domain) {
Expand Down Expand Up @@ -173,7 +177,7 @@ Since BasicPay is an entirely client-side application, we can't provide a callba

## Complete transfer

Once the user is finished with the interactive window from the anchor, they'll be brought back to BasicPay. We store the details of the transfer in the `transfersStore` store (Remember, this is just so we can track which anchors to query for transfers later on.)
Once the user is finished with the interactive window from the anchor, they'll be brought back to BasicPay. We store the details of the transfer in the `transfersStore` store (remember, this is just so we can track which anchors to query for transfers later on).

```html title=/src/routes/dashboard/transfers/+page.svelte
<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ Our integrations will also use the following SEPs:

BasicPay takes care of all the anchor transfer details on the `/dashboard/transfers` page. See it in action here: https://basicpay.pages.dev/dashboard/transfers

We need our application to know how it can communicate with anchors to get asset and infrastructure information. Ultimately, this is done by querying an anchor’s stellar.toml file. Before we can do that, though, we need to figure out where to find that file.

The first thing we'll do is determine whether the user holds trustlines to any assets that have a `home_domain` field set on the Stellar network. The presence of that field on an issuer's account tells us the asset _may_ be plugged into the existing Stellar rails allowing for transfers of the asset. If it's present, we'll display some interactive elements to the user for that asset/domain.
We need our application to know how it can communicate with anchors to get asset and infrastructure information. The first thing we'll do is determine whether the user holds trustlines to any assets that have a `home_domain` field set on the Stellar network. The presence of that field on an issuer's account tells us the asset _may_ be plugged into the existing Stellar rails allowing for transfers of the asset. If it's present, we'll display some interactive elements to the user for that asset/domain.

```js title=/src/routes/dashboard/transfers/+page.js
import { fetchAssetsWithHomeDomains } from "$lib/stellar/horizonQueries";
Expand Down
Binary file added static/assets/sep24_transfers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 64a71e7

Please sign in to comment.