Pay on Stellar using Stellar Burrito
What is StellarBurrito?
StellarBurrito is a package available on npm.
This package’s aim is to simplify the use of stellar-sdk thanks simplified calls to the core library.
This project is open source and opens to PR so if you want to help take a look at the GitHub project!
This tutorial works on test-net, currently this library isn’t suitable for production use.
First of all, we need to create the project
chinaski@XPS:~/Desktop$ mkdir Medium-Pay
chinaski@XPS:~/Desktop$ cd Medium-Pay/
chinaski@XPS:~/Desktop/Medium-Pay$ touch index.js
chinaski@XPS:~/Desktop/Medium-Pay$ npm init
Then install stellar burrito package from npm
chinaski@XPS:~/Desktop/Medium-Pay$ npm i stellarburrito --save
Now our project should be initialized properly!
Do you already have two accounts for making this payment? If you don’t have these follow this tutorial
Let’s start coding!
First of all, we need to import stellar burrito in our project
Now we need 2 accounts for this payment:
Alice: the sender of our payment.
Bob: the receiver of the payment.
We need Alice’s Private Key for signing the transaction and Bob Public Key as the receiver address
Now let’s call and handle the response of Pay function, passing
sender (Alice’s Private Key)
receiver (Bob’s Public Key)
amount (in this case 10 XLM)
as shown here
So your code should look like this
chinaski@XPS:~/Desktop/Medium-Pay$ node index.js
You can verify the transaction simply copying the printed hash and pasting it on stellar.expert
Thanks for your attention!
If you want to collaborate for writing this library just contact me on Keybase @andreaborio !