Skip to main content
Kimia does not publish an npm SDK. Instead, each program’s Anchor IDL is run through Codama and the result is committed to frontend/app/generated/<program>/. If you want to use these clients from another project, copy the folder — the only runtime dependency is @solana/kit. Every generated client has the same shape.

Client layout

Fetching an account

Every fetch returns a { exists, address, data, executable, lamports, ... } shape. fetchMaybeMarket is the non-throwing variant.

Resolving PDAs

The helper knows the seeds from the IDL and does the derivation for you.

Building an instruction

Each builder takes TransactionSigner, Address, and primitive types. The return is an IInstruction that fits directly into @solana/kit’s appendTransactionMessageInstruction.

Decoding events

Only kimia-perp and intent-router emit Anchor #[event] structs today — see the events reference. For those programs, Codama generates decoders under types/:
The other programs (delta-vault, split-engine, yield-amm, kusd-mint) log via msg! rather than emitting events. To observe them, read tx.meta.logMessages after confirmation.

Sending a transaction

The repo’s frontend/app/lib/send-transaction.ts is the reference helper:
It handles:
  • Recent blockhash fetching
  • Wallet-standard signing via frontend/app/lib/wallet
  • preflight simulation + surfacing program logs
  • Typed error parsing via frontend/app/lib/errors.ts

Regenerating after a program change

Pin one program to regenerate only its client:
Every regeneration overwrites app/generated/<program>/. Never hand-edit files inside that directory.