8 : Use the native Stellar Lumens (XLM) the classic way.
Token Playground Chapter 8 : Use the native Stellar Lumens (XLM) the classic way.
Check this guide in https://token-playground.gitbook.io/
Edit this guide in it's repo: https://github.com/esteblock/token-playground/
Contribute to this guide in the ./docs folder of the repo
1. Introduction
What about when we want to use XLM inside a Soroban smart contract? How do we trigger those transactions? Can we trigger transactions on behalf the user using the require_auth
method?
In this chapter we will start using XLM, asking for our balance the classic way (without Soroban). In the next chapter we will use Soroban!
2. Check your XLM's own balance using the classic way
Let's do our first experiment with the native XLM contract. We will create a new account, fund it with friendbot and check our balance in the classic way.
0.- Run the quickstart.sh
script and enter into the soroban-preview container. Read chapter 1 and 2.
1.- Create a new account:
2.- Fund it with friendbot. Here I'll assume you are inside the soroban-preview containter
3.- Check your balance with the classic way Using javascript and node, and assuming that MY_ACCOUNT_ADDRESS="GC6IYOXRAGMVSUDCAHBGBP2ZCAMZVNIF7CZCBY6545EQMIDNQQZCOY5G"
You'll get a result like this:
3. Use our code
If you want to use our code in the Token Playground's Repo, you can just call our script with the soroban-preview-10
docker containter
You can run it by:
Check all the code in the repo!
What is next?
In this chapter we created a new Stellar account and we fund it with 10000
XLM and we managed to check it's balance in the classic way. In the next chapter we will check its balance using smart contracts in Soroban!
Are you ready?
This Playground chapter has been written by @esteblock
Last updated