8 : Use the native Stellar Lumens (XLM) the classic way.
Last updated
Last updated
Check this guide in
Edit this guide in it's repo:
Contribute to this guide in the of the repo
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!
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:
You can run it by:
Check all the code in the repo!
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?
If you want to use our code in the , you can just call our script with the soroban-preview-10
docker containter
This Playground chapter has been written by