SIMBA PAY A PAYMENT APP FOR THE STELLAR NETWORK
For the purposes of this guide I shall be using the Stellar Test Network. The purpose of this guide
and accompanying GitHub repository – github.com/SIMBAChain/SIMBAPay – is to provide a
springboard for anyone wanting to develop their own Stellar application in either React or
React Native. Just remember if you do decide to use React Native you will need to rebuild the
UI as it uses different templating languages!
Below is a quick run through of the various features, hopefully it gives you some ideas!
CREATE A STELLAR SMART CONTRACT WITH SIMBA CHAIN
If you would like to learn more about using SIMBA Chain with the Stellar Network, follow the Stellar related steps in this guide – simbachain.com/buildyour- first-app/ – that will help you get set up with a Wallet, a Smart Contract and an Application on SIMBA Chain. The operations you are going to be interested in to get your own version of this app working are: Change Trust and Payment.
INITIAL SET UP
This application is configured to use Auth0. If you already have an Auth0 domain then follow this guide to get set up auth0.com/docs/quickstart/spa/react. If you are new to Auth0 then follow this guide to get set up with Auth0 — auth0.com/docs/getting-started and follow the React quick start afterwards if need be.
CREATING A WALLET
Creating a wallet on SIMBA Pay is easy. Navigate to Wallets via the navigation drawer and press the floating action button in the bottom right. Give your wallet a name and you’re off the races.
ADDING AN EXISTING WALLET
This is very much the same process as creating a new wallet. The only difference is you will need to provide your wallet’s seed.
Any wallet you create or add using SIMBA Pay will be stored locally. Make sure you keep a copy of the seed somewhere, because if you accidentally delete your local storage the wallet will not be able to be recovered.
To send money on SIMBA Pay, navigate to send using the navigation drawer. Once there, you will see two cards. The first - Balance - contains your Lumen (XLM) balance. If you have created a new wallet, you will see 10,000 XLM as this is the amount the bot gives to newly created wallets on the test network. The anchor usd tab, should not have a balance, since we haven’t yet created a trustline for the asset. More on this later.
The send money card will be what we use to make payments. This contains a
simple four-step form. Here I will send 100 XLM from my newly created User
guide wallet, to another wallet, aptly named “Another User Guide Wallet”.
To begin, choose your wallet from the drop down menu in the top right, and
enter the public key of the wallet to which you wish to send XLM to.
Next select XLM from the Asset drop down.
Then enter the amount you wish to send. Here I will send 100 XLM.
Finally add a memo for your transaction. Memo’s are a helpful way of identifying transactions. Some organizations will require a code or ID (for example CoinBase). Here I will just use a text memo.
Finally, hit pay!
Contacts serve as a way to pay regulars more quickly. To add a new contact navigate to contacts via the navigation drawer and press the floating action button in the bottom right. Then simply fill out the form and you’re good to go.
The edit contact button will let you modify your contacts details. Send Money, brings up a small form similar to the one we used earlier, which will let you send XLM to your contacts wallet address.
The assets page serves as a one stop shop for stellar assets currently supported by the app. When I originally did this project we decided to use anchor usd. However, since then anchor usd has removed the ability to trade their USD asset via the web, instead opting to use their mobile app and other trading platforms like Stellar X. That being said I have left the code in the repository, as a guide to how one might interact with an anchor who is compliant with Stellars SEP-0006 protocol. More information re anchor usd can be found here dashboard.anchorusd.com/docs/api#introduction
To trust an asset simply press the Trust Asset button.
Once the asset is trusted the button should change to become green and be labelled Revoke Trust. Naturally pressing this will remove the trustline.
RECEIVE & WALLET QR CODES
These two pages are more of an experimental feature aimed mostly at mobile. Receive allows you to add different parts of a transaction, such as: asset type, amount, memo type, and memo, along with your wallets public key to a QR code. The idea here is sort of like a contactless payment system, whereby you can show someone your QR code and scanning it will initiate a payment.
Wallet QR Code is much the same idea, except this time it’s aimed at sharing your wallet’s public key in a convenient way. The QR Code for your wallet, could be scanned by a mobile, which could then either add you as a contact, or paste your QR Code into a text field.
ISSUING YOUR OWN ASSETS ON THE STELLAR NETWORK
If you plan on issuing your own assets on the Stellar Network I recommend checking out this part of the Stellar documentation (developers.stellar.org/docs/issuing-assets/) and go through the sections regarding issuing assets, it has all the information you need.