Remember, SEP-24 depends on SEP-10 authentication. Everything below assumes the user has successfully authenticated with the anchor server, and BasicPay has access to an unexpired authentication token to send with its requests.
Find the anchor’s TRANSFER_SERVER_SEP0024
Before we can ask anything about how to make a SEP-24 transfer, we have to figure out where to discover that information. Fortunately, the SEP-1 protocol describes standardized fields to find out what we need.
/src/lib/stellar/sep1.js
Get /info
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.

/src/lib/stellar/sep24.js
The user clicks “deposit” or “withdraw”
Now that we have all the SEP-24 information the anchor has made available to us, it’s up to the user to actually begin the initiation process. In BasicPay, they do that by simply clicking a button that will then trigger thelaunchTransferWindowSep24 function.
This file was pretty heavily covered in the SEP-6 section. We’ll be presenting here the additions we make to this file, though we won’t repeat things we’ve already covered. Remember to check the source files for the full picture.
/src/routes/dashboard/transfers/+page.svelte
Retrieve the interactive URL
BasicPay then initiates a transfer method by sending aPOST request to either the “SEP-24 Deposit” or “SEP-24 Withdraw” endpoint. The anchor then sends an interactive URL that BasicPay will open as a popup for the user to complete and confirm the transfer.
/src/lib/stellar/sep24.js
Launch the popup window and listen for a callback
BasicPay doesn’t really need (or want) to know everything that’s happening between the user and the anchor during a SEP-24 transfer. However, we do want to know when the interaction is over, since we may need to take some action at that point. So, we add a callback to the interactive URL and open the popup window./src/routes/dashboard/transfers/+page.svelte
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 thetransfersStore store (remember, this is just so we can track which anchors to query for transfers later on).
/src/routes/dashboard/transfers/+page.svelte
(Sometimes) Send a Stellar payment
In a withdrawal transaction, BasicPay will also build and present to the user a Stellar transaction for them to sign with their pincode./src/routes/dashboard/transfers/+page.svelte