OpenViSTAI · Agents · Blockchain · Crypto
Menu
Developer Tools

Solana Idl Parser

Solana Idl Parser is a Rust procedural macro that reads Solana Anchor IDL JSON during compilation and generates Rust code for instructions, accounts, arguments, custom types and discriminator constants. Its generated types support Borsh serialization and deserialization.

Independent OpenViST project profile, based on linked sources.

Solana Idl Parser — OpenViST project profile in Developer Tools.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use it when a Rust project needs compile-time-generated representations of a Solana program’s Anchor IDL, rather than manually maintaining those types and parsing structures.

Who it is for

  • Rust developers working with Solana programs described by Anchor IDL files.
  • Developers building Rust code that needs typed instruction-data parsing or generated account and argument structures.

Documented uses

  • Generate Rust instruction, account, argument and custom-type definitions from an Anchor IDL.
  • Deserialize instruction data into generated instruction variants and argument structures.
  • Convert account metadata into generated account structs using the documented helper.
  • Use generated Borsh-compatible types for serialization and deserialization.
Before you choose

Requirements & limits

The project is published as a public GitHub repository. The README includes MIT license text.

  • The input is an Anchor IDL JSON file referenced by the procedural macro.
  • The documented interface is Rust compile-time code generation, not a hosted parsing service.
  • Generated output includes instruction enums, account and argument structs, custom types and discriminator constants.
  • The README documents mappings for primitives, strings, public keys, bytes, options, vectors, fixed arrays and defined custom types.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Generate Rust types from an Anchor IDL

Use the documented procedural macro to generate Rust representations from an IDL file.

Before you start

  • A Rust project using the solana_idl_parser crate.
  • An Anchor IDL JSON file in the project, such as idl/program.json.

Steps

  1. Import parse_idl from solana_idl_parser.

  2. Invoke parse_idl!("idl/program.json") with the IDL path.

  3. Use the generated instruction, account and argument types; the README demonstrates deserializing instruction data with ProgramInstructions::deserialize(accounts, data).

Expected outcome

The macro generates typed instruction and account representations, discriminator constants and custom IDL types for use in the Rust project.

Guide limitations

  • The documented example does not specify dependency-version requirements or cover compatibility across all IDL schemas.
  • The README shows example usage; it is not a compatibility guarantee.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
17 October 2026
Original website title
shubhexists/solana_idl_parser · Official homepage title · retained in its source language