Stellar (XLM)
Stellar is a decentralized Layer-1 blockchain designed for fast, low-cost cross-border payments and asset tokenization. Built on the Stellar Consensus Protocol (SCP), it achieves consensus through federated Byzantine agreement rather than mining, enabling near-instant transaction finality with minimal energy consumption. Stellar supports the Soroban smart contract platform for building decentralized applications.
Key Features
- Stellar Consensus Protocol (SCP): Proof of Agreement consensus for fast, energy-efficient finality
- Native Currency XLM: Lumens power transaction fees and serve as a bridge currency
- ~5 Second Ledger Close: Near-instant transaction confirmation
- Minimal Transaction Fees: Fractions of a cent per transaction
- Soroban Smart Contracts: WebAssembly-based smart contract platform
- Built-in DEX: Native decentralized exchange for asset trading
- Asset Tokenization: Issue and manage custom assets on-chain
- Cross-Border Payments: Designed for global financial infrastructure
TECHNICAL DISCLAIMER: AUTHORITATIVE JSON-RPC API SPECIFICATION.
GetBlock's RPC API reference documentation is provided exclusively for informational purposes and streamlined developer experience optimization. The canonical and normative specification for Stellar RPC methods is solely maintained and published through the official Stellar Development Foundation documentation portal at developers.stellar.org. This resource constitutes the sole authoritative reference implementation of the JSON-RPC 2.0 protocol interface for Stellar nodes.
Network Information
| Property | Value |
|---|---|
| Network Name | Stellar |
| Native Currency | XLM (Lumens) |
| Decimals | 7 (stroops) |
| Consensus | Stellar Consensus Protocol (SCP) |
| Ledger Close Time | ~5 seconds |
| Base Reserve | 0.5 XLM |
| Minimum Balance | 1 XLM (2 base reserves) |
| Smart Contracts | Soroban |
Base URL
https://shared.eu-central-1.getblock.iohttps://shared.ap-southeast-1.getblock.iohttps://shared.us-east-1.getblock.ioSupported Networks
| Network | JSON RPC | REST | New York, USA | Frankfurt, Germany | Singapore, Singapore | network passphrases |
|---|---|---|---|---|---|---|
| Mainnet | ✅ | ✅ | ✅ | ✅ | ✅ | Public Global Stellar Network ; September 2015 |
Quickstart
In this section, you will learn how to make your first call with either:
- Axios
- Python
Quickstart with Axios
Set up project
Create and initialize your project:
bash
mkdir stellar-api-quickstart cd stellar-api-quickstart npm init --yesInstall Axios
bash
npm install axiosCreate index.js
Create a new file named
index.js. Ensure yourpackage.jsonhas"type": "module"to use ES modules.Add the code
Add the following to
index.js:javascript
import axios from 'axios'; const data = JSON.stringify({ "jsonrpc": "2.0", "method": "getHealth", "id": "getblock.io" }); const config = { method: 'post', url: 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/', headers: { 'Content-Type': 'application/json' }, data: data }; axios(config) .then(response => console.log(JSON.stringify(response.data))) .catch(error => console.log(error));Replace
<ACCESS-TOKEN>with your actual access token from GetBlock.Run the script
bash
node index.jsExpected output:
json
{ "jsonrpc": "2.0", "id": "getblock.io", "result": { "status": "healthy", "latestLedger": 51583040, "oldestLedger": 51565760, "ledgerRetentionWindow": 17281 } }
Quickstart with Python and Requests
Set up project directory
bash
mkdir stellar-api-quickstart cd stellar-api-quickstartCreate and activate a virtual environment
bash
python -m venv venv source venv/bin/activate # On Windows, use venv\Scripts\activateInstall requests
bash
pip install requestsCreate main.py
Create a file called
main.pywith the following content:python
import requests import json url = "https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/" payload = json.dumps({ "jsonrpc": "2.0", "method": "getHealth", "id": "getblock.io" }) headers = { 'Content-Type': 'application/json' } response = requests.post(url, headers=headers, data=payload) print(response.text)Replace
<ACCESS-TOKEN>with your actual access token from GetBlock.Run the script
bash
python main.py
Available API Methods
GetBlock provides access to Stellar RPC methods for interacting with the network:
Node Information
| Method | Description |
|---|---|
| getHealth | Returns node health status |
| getNetwork | Returns network configuration |
| getVersionInfo | Returns version information |
| getFeeStats | Returns fee statistics |
Ledger Methods
| Method | Description |
|---|---|
| getLatestLedger | Returns the latest known ledger |
| getLedgers | Returns a list of ledgers |
| getLedgerEntries | Returns ledger entries by key |
Transaction Methods
| Method | Description |
|---|---|
| getTransaction | Returns transaction details by hash |
| getTransactions | Returns a list of transactions |
| sendTransaction | Submits a signed transaction |
| simulateTransaction | Simulates a transaction without submitting |
Events
| Method | Description |
|---|---|
| getEvents | Returns contract events |
Support
For technical support and questions:
- Support: support@getblock.io