Skip to main content

Module builder

Module builder 

Source
Expand description

§Manifest-driven instruction builder

Turns a ProgramManifest + named instruction + typed args into a raw instruction shape (program_id, data, accounts) ready to be handed to any Solana client crate (solana-sdk, magic-block, anchor-client, etc.) for transaction assembly.

The entire point: the on-chain program’s manifest IS the off-chain IDL. There is no “regenerate the TypeScript types after you redeploy” step, because the source of truth is compiled into the program.

§Design notes

  • Single source of truth: no separate .json IDL file that drifts.
  • Layout-id-verified account lookups: if a caller supplies an account for a slot whose layout_ref names a layout in the manifest, the builder can validate on construction that the passed-in account bytes match the expected fingerprint.
  • Zero serde: args are written to a byte vec using the ArgDescriptor size declarations in the manifest.

Structs§

AccountMeta
A Solana-compatible account meta. Re-defined locally so this crate does not pull in solana-program or solana-sdk. Consumers downshift to their preferred SDK’s AccountMeta after construction.
BuiltInstruction
One built instruction ready for submission.
InstructionBuilder
Fluent builder over a manifest + one instruction.

Enums§

BuildError
Builder error surface.