Skip to main content

Payments and Assets

To send payments and work with assets using the Stellar CLI, follow these steps:

  1. Set your preferred network. For this guide, we will use testnet. A list of available networks can be found here
stellar network use testnet
  1. Fund the accounts:
stellar keys generate alice
stellar keys fund alice
stellar keys generate bob
stellar keys fund bob
  1. Obtain the stellar asset contract ID:
stellar contract id asset --asset native
  1. Get Bob's public key:
stellar keys address bob
  1. Send 100 XLM from Alice to Bob:
stellar keys use alice
stellar contract invoke --id <ASSET_CONTRACT_ID> -- transfer --to bob --from alice --amount 100
  1. Check account balance:
stellar contract invoke --id <ASSET_CONTRACT_ID> -- balance --id bob

For more information on the functions available to the stellar asset contract, see the token interface code.

Guides in this category: