IDL GENERATOR

Extract Interface Definition Language (IDL) from deployed Solana programs

â„šī¸ 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
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

📋 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