âšī¸ ABOUT IDL GENERATION
WHAT IS IDL
âInterface Definition Language describes program structure
âDefines instructions, accounts, and data types
âEnables automatic client code generation
âEssential for program integration
FEATURES
âĄAutomatic IDL extraction from programs
âĄTypeScript interface generation
âĄReverse engineering for unknown programs
âĄSupport for Anchor and custom programs
OUTPUT FORMATS
đStandard JSON IDL format
đTypeScript interfaces and types
đComplete instruction definitions
đAccount structure documentation
HOW TO USE:
1. Enter the program ID you want to analyze
2. Choose generation options (TypeScript, comments, etc.)
3. Click "Extract IDL" to begin analysis
4. Review extracted instructions and types
5. Download IDL JSON or TypeScript files
2. Choose generation options (TypeScript, comments, etc.)
3. Click "Extract IDL" to begin analysis
4. Review extracted instructions and types
5. Download IDL JSON or TypeScript files
LIMITATIONS:
âĸ Some programs may not have embedded IDL
âĸ Reverse engineering provides basic structure only
âĸ Custom programs may need manual analysis
âĸ Complex types might need additional documentation
âĸ Reverse engineering provides basic structure only
âĸ Custom programs may need manual analysis
âĸ Complex types might need additional documentation
đ IDL GENERATOR
Extract Interface Definition Language (IDL) from deployed Solana programs
Quick Select:
đĄ IDL STRUCTURE & EXAMPLES
IDL Structure Overview:
Instructions
Define program entry points with parameters, accounts, and validation rules. Each instruction specifies required accounts (mutable/signer) and input arguments.
Accounts
Data structures stored on-chain. Define fields, types, and serialization format for program state and user data.
Types
Custom data types used by instructions and accounts. Include structs, enums, and complex nested structures.
Errors
Custom error definitions with codes and messages for debugging and user-friendly error handling.
Supported Program Types:
ANCHOR PROGRAMS
Full IDL extraction
Complete type information
Instruction documentation
Error code definitions
NATIVE PROGRAMS
System Program
SPL Token Program
Associated Token Program
Stake Program
CUSTOM PROGRAMS
Reverse engineering
Basic structure detection
Manual analysis required
Best-effort extraction
Example IDL Structure:
{
"name": "example_program",
"version": "0.1.0",
"instructions": [
{
"name": "initialize",
"accounts": [
{
"name": "account",
"isMut": true,
"isSigner": false
},
{
"name": "user",
"isMut": false,
"isSigner": true
}
],
"args": [
{
"name": "data",
"type": "u64"
}
]
}
],
"accounts": [
{
"name": "ExampleAccount",
"type": {
"kind": "struct",
"fields": [
{
"name": "data",
"type": "u64"
},
{
"name": "owner",
"type": "publicKey"
}
]
}
}
],
"types": [],
"errors": [
{
"code": 6000,
"name": "InvalidData",
"msg": "The provided data is invalid"
}
]
}Generated TypeScript Example:
import { PublicKey } from '@solana/web3.js'
import { BN } from '@coral-xyz/anchor'
// Account Interfaces
export interface ExampleAccount {
data: BN
owner: PublicKey
}
// Instruction Interfaces
export interface InitializeArgs {
data: BN
}
export interface InitializeAccounts {
account: PublicKey
user: PublicKey
}
// Error Codes
export enum ProgramError {
InvalidData = 6000
}Common Use Cases:
DEVELOPMENT:
âĸ Generate client SDKs automatically
âĸ Create TypeScript types for frontend
âĸ Understand program interfaces
âĸ Build integration tools
ANALYSIS:
âĸ Reverse engineer unknown programs
âĸ Security auditing and analysis
âĸ Program documentation generation
âĸ Integration planning