Expand description
§jiminy-schema
Layout Manifest v1 for Jiminy account schemas.
This crate provides structured descriptions of Jiminy account layouts, enabling cross-language tooling, TypeScript decoder generation, indexer integration, and schema validation.
§Workflow
zero_copy_layout! ──▶ LayoutManifest ──▶ export_json() ──▶ TS / indexerszero_copy_layout!defines your on-chain struct and computesLAYOUT_ID.- Build a
LayoutManifestdescribing the same struct. export_json()emits a JSON manifest (no serde).- Off-chain tooling (
@jiminy/ts, indexers, explorers) consumes the manifest.
§Layout Manifest v1
A layout manifest describes one account type:
use jiminy_schema::*;
let manifest = LayoutManifest {
name: "Vault",
version: 1,
discriminator: 1,
layout_id: [0xAB, 0xCD, 0xEF, 0x01, 0x23, 0x45, 0x67, 0x89],
fields: &[
FieldDescriptor { name: "header", canonical_type: CanonicalType::Header, size: 16 },
FieldDescriptor { name: "balance", canonical_type: CanonicalType::U64, size: 8 },
FieldDescriptor { name: "authority", canonical_type: CanonicalType::Pubkey, size: 32 },
],
segments: &[],
};
assert_eq!(manifest.total_size(), 56);
assert_eq!(manifest.field_offset("balance"), Some(16));§Canonical Types
The canonical type system normalizes Rust types to a fixed set of
language-independent names. This matches the types used in
LAYOUT_ID hash computation (see LAYOUT_CONVENTION.md).
Modules§
Macros§
- layout_
manifest - Macro to generate a
LayoutManifestfrom azero_copy_layout!struct.
Structs§
- Field
Descriptor - Describes a single field in a Jiminy account layout.
- Layout
Manifest - A complete account layout manifest (v1).
- Segment
Field Descriptor - Describes a dynamic segment in a segmented Jiminy account.
Enums§
- Canonical
Type - Canonical type identifiers for Jiminy account fields.
Constants§
- MANIFEST_
VERSION - Manifest format version string.