Parsed Events
List IDL Versions
List every IDL version Parsed Events has for a Solana program, with the slot at which each version became active.
GET
/
v1
/
parsed-events
/
idl
/
{programId}
List IDL Versions
curl --request GET \
--url 'https://mainnet.helius-rpc.com/v1/parsed-events/idl/{programId}?api-key='import requests
url = "https://mainnet.helius-rpc.com/v1/parsed-events/idl/{programId}?api-key="
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://mainnet.helius-rpc.com/v1/parsed-events/idl/{programId}?api-key=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://mainnet.helius-rpc.com/v1/parsed-events/idl/{programId}?api-key=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://mainnet.helius-rpc.com/v1/parsed-events/idl/{programId}?api-key="
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://mainnet.helius-rpc.com/v1/parsed-events/idl/{programId}?api-key=")
.asString();require 'uri'
require 'net/http'
url = URI("https://mainnet.helius-rpc.com/v1/parsed-events/idl/{programId}?api-key=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body[
{
"slot": 182747476,
"sources": [
"anchor"
]
},
{
"slot": 205509752,
"sources": [
"anchor"
]
},
{
"slot": 206074074,
"sources": [
"anchor"
]
}
]{
"error": "invalid program id: notanaddress: String is the wrong size"
}Unauthorized{
"error": "no IDLs found for program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
}The path parameters, response schema, and examples on this page are generated from the OpenAPI definition.
List IDL Versions returns the history of a program’s interface from the IDL catalog that Parsed Events and Parsed Streams use to decode instructions. Each item is one version, identified by the slot at which it became active. Items are sorted oldest first, so the last item is the current version.
Pass any
To detect changes over time, store the
Other errors return a JSON body with an
slot from the response to Get IDL to fetch that version’s IDL document. The Orb explorer uses these endpoints to show program IDLs.
Use Cases
- Track interface changes. Poll List IDL Versions for a program you depend on. When a new version appears, fetch it and the previous one with Get IDL and compare their
instructions. A new admin or authority instruction is worth a security review. - Check catalog coverage. A
404means the catalog has no IDL for the program. Programs such as SPL Token are decoded by built-in decoders instead and also return404.
Example: Detect a New IDL Version
This script lists a program’s IDL versions, fetches the latest two, and prints the instructions that were added or removed:diff-idl-versions.js
const API_KEY = process.env.HELIUS_API_KEY;
if (!API_KEY) {
console.error("Missing HELIUS_API_KEY.");
process.exit(1);
}
const BASE = "https://mainnet.helius-rpc.com/v1/parsed-events/idl";
const PROGRAM_ID = "KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD";
async function get(path) {
const response = await fetch(`${BASE}/${path}?api-key=${API_KEY}`);
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${await response.text()}`);
}
return response.json();
}
const versions = await get(PROGRAM_ID);
if (versions.length < 2) {
console.log("Fewer than two IDL versions; nothing to compare.");
process.exit(0);
}
const [previous, latest] = versions.slice(-2);
const [before, after] = await Promise.all([
get(`${PROGRAM_ID}/${previous.slot}`),
get(`${PROGRAM_ID}/${latest.slot}`),
]);
const names = (idl) => new Set(idl.instructions.map((ix) => ix.name));
const beforeNames = names(before);
const afterNames = names(after);
console.log(`Comparing slot ${previous.slot} with slot ${latest.slot}`);
console.log("Added:", [...afterNames].filter((name) => !beforeNames.has(name)));
console.log("Removed:", [...beforeNames].filter((name) => !afterNames.has(name)));
slot of the last version you have seen and compare against it on each poll.
Credits
Each request costs 10 credits and is available on all plans. The example above makes three requests, so it costs 30 credits. See Credits.Errors
| Status | When |
|---|---|
400 | programId isn’t a valid base58 address. |
401 | The API key is missing or invalid. The body is plain text: Unauthorized. |
404 | The catalog has no IDL for the program. |
error message, such as {"error": "no IDLs found for program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"}.
Request Parameters
string
required
Program address, base58-encoded.
Authorizations
Path Parameters
Program address, base58-encoded.
Example:
"KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD"
Response
The program's IDL versions, sorted by slot ascending.
Was this page helpful?
⌘I
List IDL Versions
curl --request GET \
--url 'https://mainnet.helius-rpc.com/v1/parsed-events/idl/{programId}?api-key='import requests
url = "https://mainnet.helius-rpc.com/v1/parsed-events/idl/{programId}?api-key="
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://mainnet.helius-rpc.com/v1/parsed-events/idl/{programId}?api-key=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://mainnet.helius-rpc.com/v1/parsed-events/idl/{programId}?api-key=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://mainnet.helius-rpc.com/v1/parsed-events/idl/{programId}?api-key="
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://mainnet.helius-rpc.com/v1/parsed-events/idl/{programId}?api-key=")
.asString();require 'uri'
require 'net/http'
url = URI("https://mainnet.helius-rpc.com/v1/parsed-events/idl/{programId}?api-key=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body[
{
"slot": 182747476,
"sources": [
"anchor"
]
},
{
"slot": 205509752,
"sources": [
"anchor"
]
},
{
"slot": 206074074,
"sources": [
"anchor"
]
}
]{
"error": "invalid program id: notanaddress: String is the wrong size"
}Unauthorized{
"error": "no IDLs found for program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
}