How To Access Soroban API

Learn how to access Soroban API.

Step 1: To access the available Soroban methods, use the following native access endpoint:

  • Network: Stellar Mainnet
  • Request Type: GET / POST
https://svc.blockdaemon.com/stellar/mainnet/native/soroban-rpc
  • Network: Stellar Testnet
  • Request Type: GET / POST
https://svc.blockdaemon.com/stellar/testnet/native/soroban-rpc

Step 2: You should authorize your request. Learn more: Authentication Guide

Step 3: Specify a Soroban method in the request body:

{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "YOUR_METHOD",
    "params": []
}

Example Request

Here is a cURL example for retrieving the current latest known ledger. This is a subset of the ledger info from Horizon.

curl --location 'https://svc.blockdaemon.com/stellar/mainnet/native/soroban-rpc' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer SecretYES' \
--data '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getLatestLedger"
}'

Here's what a typical response object will look like:

{
   "jsonrpc":"2.0",
   "id":1,
   "result":{
      "latestLedger":"123456"
   }
}

👋 Need Help?

Contact us through email or our support page for any issues, bugs, or assistance you may need.