Crate hyperstack_interpreter

Crate hyperstack_interpreter 

Source
Expand description

§hyperstack-interpreter

AST transformation runtime and VM for HyperStack streaming pipelines.

This crate provides the core components for processing Solana blockchain events into typed state projections:

  • AST Definition - Type-safe schemas for state and event handlers
  • Bytecode Compiler - Compiles specs into optimized bytecode
  • Virtual Machine - Executes bytecode to process events
  • TypeScript Generation - Generate client SDKs automatically

§Example

use hyperstack_interpreter::{TypeScriptCompiler, TypeScriptConfig};

let config = TypeScriptConfig::default();
let compiler = TypeScriptCompiler::new(config);
let typescript = compiler.compile(&spec)?;

§Feature Flags

  • otel - OpenTelemetry integration for distributed tracing and metrics

Re-exports§

pub use typescript::TypeScriptCompiler;
pub use typescript::TypeScriptConfig;
pub use typescript::write_typescript_to_file;
pub use resolvers::ResolveContext;
pub use resolvers::InstructionContext;
pub use resolvers::KeyResolution;
pub use resolvers::ReverseLookupUpdater;
pub use vm::PendingAccountUpdate;
pub use vm::PendingQueueStats;
pub use vm::UpdateContext;
pub use metrics_context::MetricsContext;
pub use metrics_context::FieldAccessor;
pub use metrics_context::FieldRef;

Modules§

ast
compiler
metrics_context
proto_router
resolvers
spec_trait
typescript
vm

Macros§

define_accessor
field
Creates a field reference for direct struct field access (LEGACY API)
field_accessor
Macro to define type-safe field accessors (LEGACY API)
impl_field_descriptors
Macro to implement field descriptors for struct fields

Structs§

CaptureWrapper
Generic wrapper for account capture data that includes context metadata This ensures type safety for accounts captured with #[capture] in entity specs
EventWrapper
Generic wrapper for event data that includes context metadata This ensures type safety for events captured in entity specs
Mutation