
Code: Select all
#!/bin/bash
# Set your Stellar wallet address (public key)
STELLAR_ADDRESS="Your Wallet"
# API endpoint for Stellar public network
STELLAR_API="https://horizon.stellar.org/accounts/$STELLAR_ADDRESS"
# Function to fetch balance
get_balance() {
curl -s "$STELLAR_API" | jq -r '.balances[] | select(.asset_type == "native>
}
# Get initial balance
LAST_BALANCE=$(get_balance)
echo "Checking Stellar wallet: $STELLAR_ADDRESS"
echo "Current Balance: $LAST_BALANCE XLM"