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

PropertyValue
Network NameStellar
Native CurrencyXLM (Lumens)
Decimals7 (stroops)
ConsensusStellar Consensus Protocol (SCP)
Ledger Close Time~5 seconds
Base Reserve0.5 XLM
Minimum Balance1 XLM (2 base reserves)
Smart ContractsSoroban

Base URL

https://shared.eu-central-1.getblock.io
https://shared.ap-southeast-1.getblock.io
https://shared.us-east-1.getblock.io

Supported Networks

NetworkJSON RPCRESTNew York, USAFrankfurt, GermanySingapore, Singaporenetwork 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

  1. Set up project

    Create and initialize your project:

    bashmkdir stellar-api-quickstart
    cd stellar-api-quickstart
    npm init --yes
  2. Install Axios

    bashnpm install axios
  3. Create index.js

    Create a new file named index.js. Ensure your package.json has "type": "module" to use ES modules.

  4. Add the code

    Add the following to index.js:

    javascriptimport 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.

  5. Run the script

    bashnode index.js

    Expected output:

    json{
        "jsonrpc": "2.0",
        "id": "getblock.io",
        "result": {
            "status": "healthy",
            "latestLedger": 51583040,
            "oldestLedger": 51565760,
            "ledgerRetentionWindow": 17281
        }
    }

Quickstart with Python and Requests

  1. Set up project directory

    bashmkdir stellar-api-quickstart
    cd stellar-api-quickstart
  2. Create and activate a virtual environment

    bashpython -m venv venv
    source venv/bin/activate
    
    # On Windows, use venv\Scripts\activate
  3. Install requests

    bashpip install requests
  4. Create main.py

    Create a file called main.py with the following content:

    pythonimport 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.

  5. Run the script

    bashpython main.py

Available API Methods

GetBlock provides access to Stellar RPC methods for interacting with the network:

Node Information

MethodDescription
getHealthReturns node health status
getNetworkReturns network configuration
getVersionInfoReturns version information
getFeeStatsReturns fee statistics

Ledger Methods

MethodDescription
getLatestLedgerReturns the latest known ledger
getLedgersReturns a list of ledgers
getLedgerEntriesReturns ledger entries by key

Transaction Methods

MethodDescription
getTransactionReturns transaction details by hash
getTransactionsReturns a list of transactions
sendTransactionSubmits a signed transaction
simulateTransactionSimulates a transaction without submitting

Events

MethodDescription
getEventsReturns contract events

Support

For technical support and questions:

See Also