Skip to content

Generate the contract clients at build time - #218

Merged
luchobonatti merged 4 commits into
mainfrom
feat/217-generated-contract-clients
Oct 8, 2026
Merged

luchobonatti merged 4 commits into
mainfrom
feat/217-generated-contract-clients

Conversation

@luchobonatti

Copy link
Copy Markdown
Member

Summary

Closes #217

The generated contract clients are the only contract types; nothing is written by hand.

Changes

  • app's prebuild generates app-lib/clients/<contract>/ from the contract ids and RPC of the selected environment, with Node alone
  • app-lib/contracts.ts re-exports the generated client types; the hand-written interfaces are gone
  • Optional reads are typed T | null, as the generator emits them
  • AGENTS.md describes the flow

Acceptance criteria

  • A prebuild step next to generate-addresses.mjs generates the clients for the selected ADDRESSES_ENV with BindingGenerator.fromContractId
  • app-lib/contracts.ts keeps the connectors and isUserRejection and re-exports the generated types; no hand-written contract interfaces remain
  • A local scaffold build keeps writing the same directory from the WASM
  • AGENTS.md:78-82 describes the new flow
  • npm run test, npm run lint, npm run build --workspace app pass from a clone with no target/ and no Stellar CLI

Test plan

Automated tests

npm run test — 544 passing. npm run build --workspace app from a tree with no generated clients.

Manual verification

  1. Delete app-lib/clients/* and app/src/config/addresses.ts.
  2. npm run build --workspace app: both regenerate, the build succeeds.
  3. The Vercel preview builds.

Breaking changes

None.

Checklist

  • Self-reviewed my own diff
  • Tests added or updated
  • Docs updated (if applicable)
  • No unrelated changes bundled in

Screenshots

None.

Copilot AI balanced review requested due to automatic review settings October 7, 2026 14:58
@luchobonatti luchobonatti self-assigned this Oct 7, 2026
@vercel

vercel Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
strata-vault-kit-app Ready Ready Preview Oct 8, 2026 12:41am UTC

Request Review

@luchobonatti
luchobonatti merged commit dfa1b7e into main Oct 8, 2026
3 checks passed
@luchobonatti
luchobonatti deleted the feat/217-generated-contract-clients branch October 8, 2026 00:50

This branch was successfully deployed

1 active deployment
Preview — 85ca42e5 Deployed Oct 8, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generate the contract clients at build time and drop the hand-written contract types

2 participants