Skip to content

LUMOS Documentation

Illuminate your Solana development with type-safe cross-language code generation

LUMOS is a powerful code generation framework that bridges TypeScript and Rust, eliminating the pain of maintaining duplicate type definitions across your full-stack Solana applications.

Write your data structures once in LUMOS syntax, and automatically generate perfectly synchronized code for both languages with guaranteed Borsh serialization compatibility.

🎯 Single Source of Truth

Define your data structures once in .lumos syntax. Generate production-ready code for both Rust and TypeScript with guaranteed synchronization.

🔐 100% Type Safety

Complete type mapping ensures your Rust structs and TypeScript interfaces are always compatible. No more runtime deserialization errors.

⚓ Anchor Integration

First-class support for Anchor programs. LUMOS understands #[account] attributes and generates appropriate code without derive conflicts.

📦 Borsh Compatible

Automatic Borsh schema generation for both languages. Field order, type sizes, and serialization format guaranteed to match.

Write once in LUMOS:

#[solana]
#[account]
struct PlayerAccount {
wallet: PublicKey,
level: u16,
experience: u64,
}

Get perfect code in both languages:

Rust (Anchor)

use anchor_lang::prelude::*;
#[account]
pub struct PlayerAccount {
pub wallet: Pubkey,
pub level: u16,
pub experience: u64,
}

TypeScript (SDK)

import { PublicKey } from '@solana/web3.js';
import * as borsh from '@coral-xyz/borsh';
export interface PlayerAccount {
wallet: PublicKey;
level: number;
experience: number;
}
export const PlayerAccountBorshSchema = borsh.struct([
borsh.publicKey('wallet'),
borsh.u16('level'),
borsh.u64('experience'),
]);

Building full-stack Solana applications requires maintaining identical type definitions in two languages. This manual synchronization is:

  • ❌ Error-prone (type drift causes runtime failures)
  • ❌ Time-consuming (write everything twice)
  • ❌ Frustrating (refactoring breaks in multiple places)

LUMOS provides a custom DSL with powerful code generators that bridge TypeScript and Rust seamlessly.

  • ✅ Define once, generate everywhere
  • ✅ Types always in sync
  • ✅ Refactor in one place
  • ✅ Borsh auto-generated
  • ✅ Production-ready code

Installation

Install LUMOS CLI and start generating code in minutes.

Install Now →

Quick Start

Write your first schema and see the magic happen.

Quick Start →

Examples

Explore real-world Solana schemas for gaming, NFTs, DeFi, and more.

View Examples →

Type Mapping

Learn how LUMOS maps types between Rust and TypeScript.

Type Mapping →


Built with ❤️ for the Solana community

Star us on GitHub • 📦 View on crates.io • 🐦 Follow us on Twitter