Registry / other / anchor-lang

anchor-lang

JSON →
library1.0.2rscratesunverified

A Solana Sealevel eDSL (embedded domain-specific language) for building Solana programs.

# Cargo.toml [dependencies] anchor-lang = "1.0.2"
INSTALL
IMPORT
SIG · ANCHOR-LANG
A
anchor-lang
otherrustv1.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Program
use anchor_lang::prelude::*;

Define a minimal Solana program using Anchor with an `initialize` instruction.

use anchor_lang::prelude::*; declare_id!("Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS"); #[program] pub mod my_program { use super::*; pub fn initialize(ctx: Context<Initialize>) -> Result<()> { Ok(()) } } #[derive(Accounts)] pub struct Initialize {}
Debug
Known issues
gotchaRequires Solana toolchain and specific Rust version; not for general-purpose development.
fix
Install Solana CLI and use `anchor init` to scaffold a project.
affects: >=1.0.0
Upgrade
Version history
1.0.2latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
20 hits · last 30 days
node
16
Meta
2
OpenAI (training)
1
Resources
anchor-lang — cargo add anchor-lang · libregistry