The Stellar Demo Wallet is our newly rebuilt application for interactively testing anchor services.
If you would like to automate testing of your anchor service, check out the SDF's anchor tests suite viewable at https://anchor-tests.stellar.org/.
This repository was originally created for the Build a Stellar Wallet tutorial series. (That project has since moved over here).
If you want to use parts or all of the project to kickstart your own wallet, feel free to clone or copy any pieces that may be helpful.
This application defaults to using Stellar's testnet.
This application can be used on Stellar's mainnet by setting
HORIZON_PASSPHRASE & HORIZON_URL on window._env_
object (this project
uses packages/demo-wallet-client/public/settings/env-config.js file).
window._env_ = {
HORIZON_PASSPHRASE: "Public Global Stellar Network ; September 2015",
HORIZON_URL: "https://horizon.stellar.org",
};
All accounts on mainnet that are used with this application should be considered compromised. If you want to test services on mainnet with this tool, make sure to create a new account and fund it with the minimum assets required.
You can use the demo wallet to interact with the following anchor services:
- Regulated Assets API (SEP-8)
- Hosted Deposit and Withdrawals (SEP-24)
- Deposit & Withdrawal API (SEP-6)
- Cross-Border Payments API (SEP-31)
You can connect to any domain that has a Stellar Info File (also known as SEP-1, or a stellar.toml file).
The instructions below are for demo-ing standard integrations supported by Stellar test server, testanchor.stellar.org, or by the SEP-8 reference server, sep8-server.dev.stellar.org. For these integrations, the logs to the right of the screen will show every network call.
Demo-ing a Regulated Asset Payment (SEP-8)
- Click "Generate keypair", and then click "Create account" - this will create a balance of 10,000 XLM.
- Click “Add asset” and add
MYASSET
with the anchor home domainsep8-server.dev.stellar.org
. - Click “Add trustline” - this will allow you to hold MYASSET.
- Click on the "Copy" link on the right of your public key and use that value
to get some unities of MYASSET using the link
https://sep8-server.dev.stellar.org/friendbot?addr=<paste_your_address_here>
. Refresh the demo-wallet page to see funds in your account. - Select "SEP-8 Send" from the dropdown of MYASSET and click "Start" in the modal.
- In the "destination" field, input an address that also has a trustline to MYASSET.
- The modal will display the approval criteria used by the SEP-8 server. Depending on the conditions described there your payment can be automatically approved or you may be required to undergo an additional KYC step.
- After your payment gets revised and signed by the SEP-8 reference server you'll need to review the updated transaction before the demo wallet submits the payment.
- If the payment has been successfully sent you'll see "SEP-8 send payment completed 🎉" in the logs.
Demo-ing a Deposit on Testnet with Hosted Deposit and Withdrawal (SEP-24)
- Click "Generate keypair", and then click "Create account" - this will create a balance of 10,000 XLM.
- Click “Add asset” and add
SRT
(this stands for Stellar Reference Token, it’s our representation of XLM for the test server) with the anchor home domaintestanchor.stellar.org
. - Click “Add trustline” - this will allow you to hold SRT.
- Select “SEP-24 deposit” from the dropdown for your SRT asset and click "Start" in the modal.
- If your browser doesn't already, make sure it allows pop-ups - this is how the demo wallet requests KYC info.
- Enter your name and email in the pop-up - this information doesn't need to be real, but the interface will want a valid email.
- Click “Skip confirmation” - skipping it won't be possible in live integrations but helps the process move ahead in the demo.
- Select the asset you would like to provide to the anchor. Note that there is no real asset you actually need to provide off-chain, it's just for demonstration.
- Enter a number into the amount and click "Submit".
- If you opted to provide "USD" in the previous form, you'll be asked to confirm the exchange rate from USD to SRT. Select "Confirm Transaction" to continue.
- Leave the pop-up window open while you wait to see the deposit of SRT made to your account - you can close when you see “Status” is complete and you have SRT.
Demo-ing Cross-Border Payments (SEP-31) on Testnet
Note: specifically in the case of demo-ing SEP-31 in the Demo Wallet, notice the public and secret keys don't represent the Sending Client but instead the Sending Anchor's account. In SEP-31, the only Stellar transaction happening is between the Sending and the Receiving anchors.
- Follow the steps above in order to establish an amount of SRT to send.
- Select “SEP-31 Send” from the dropdown for your SRT asset and click "Start" in the modal.
- Enter the requested information in the pop-up - none of the info has to be real for this testanchor.stellar.org demo, this is only to show the fields required. When testing another anchor you may need to adhere to their validation requirements.
- If the payment has been successfully sent you'll see "SEP-31 send payment completed" in the logs.
You can serve stellar.toml
files from localhost
. When using locally hosted
stellar.toml files on demo-wallet.stellar.org, some browsers might block them
for security reasons if you’re not using https
. If you’re running the demo
wallet locally, this is not a problem.
You can run the demo wallet locally, either by installing the application on your machine or by using Docker.
yarn install
Add CLIENT_DOMAIN (where stellar.toml
is hosted) and the wallet backend
WALLET_BACKEND_ENDPOINT to the window._env_
object in
packages/demo-wallet-client/public/settings/env-config.js.
NOTE: if using a locally running test anchor (in docker) use
docker.for.mac.host.internal, this will allow the anchor that's running in a
docker container to access the host network where the client domain (server
hosting the stellar.toml
) is running. ex:
window._env_ = {
CLIENT_DOMAIN: "docker.for.mac.host.internal:7000",
WALLET_BACKEND_ENDPOINT: "https://demo-wallet-server.stellar.org",
};
and run:
yarn start:client
To build the app for production, run:
yarn build:client
If you want to run the demo wallet on testnet, building the project is easy.
docker compose build
Then, launch the containers.
docker compose up
Note that the docker compose file defaults to using SDF's demo wallet server, but you are free to edit the compose file to use a local instance of the server.
- SEP-06 now supported
- SEP-08 now supported
- Fixed a bug when overriding home domain
- Fixed an issue where balance amounts were being overwritten
- Sending to Muxed Accounts is now supported
- Fix for local CORS issue
- Updated Sentry to log exceptions
- Revamped UI
- All SEPs are integrated into one tool
- SEP-24 and SEP-31 are now found in the Asset action drop-down menus
- Ablity to download logs
- Claimable Balances supported