I use the following demo to create a new account on testnet:
import requests
from stellar_sdk import Keypair, Server
# Generate random keypair
keypair = Keypair.random()
print("Public Key: " + keypair.public_key)
print("Secret Seed: " + keypair.secret)
# Call the Api to create a test account via Friendbot
response = requests.get(f"https://friendbot.stellar.org?addr={keypair.public_key}")
if response.status_code == 200:
print(f"SUCCESS! You have a new account :)\n{response.text}")
else:
print(f"ERROR! Response: \n{response.text}")
According to the official documentation I'd have expected that the account_id equals the privatepublic key used to create the account, but it does not.
What do I miss?