feat: auto-generate TypeScript bindings for Stellar contracts#29
feat: auto-generate TypeScript bindings for Stellar contracts#29Jopsan-gm wants to merge 1 commit into
Conversation
|
@Jopsan-gm Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
Hi @truthixify, PR ready for review! |
|
The bindings work itself looks solid — The problem is the base — this PR was opened against an older Could you rebase onto git fetch origin
git rebase origin/develop
# resolve conflicts, mainly:
# - .github/workflows/ci.yml (keep both the bindings job AND the stellar-nightly schedule)
# - README.md (keep existing sections, add bindings docs alongside)
# don't delete: EVENT_TOPIC_DESIGN.md, ANNOUNCEMENT_SCHEMA.md, POSTMORTEMS.md, scripts/rescue-stealth-funds.ts, the test_snapshots/ entries, the tests/properties.rs files
git push --force-with-leaseOnce that's clean I'll merge. Thanks @Jopsan-gm — really nice work on the codegen wiring. |
PR Title: feat: auto-generate TypeScript bindings for Stellar contracts
Description
This Pull Request introduces auto-generated, type-safe TypeScript bindings for the four Soroban smart contracts in the
stellar/workspace directory:stealth-announcer,stealth-registry,stealth-sender, andwraith-names.This guarantees strict type safety for downstream consumers (like the SDK) and completely prevents silent API drift.
Closes
Closes #8
🛠️ Summary of Changes
Root Configurations & Dependencies:
package.jsonto expose workspace-level scripts (pnpm bindings:stellarandpnpm build:stellar).tsconfig.jsonfor strict module resolution and type checking.@stellar/stellar-sdkand other developer dependencies.stellar/contract-ids.jsonto configure testnet contract IDs.Automated Generation Script (
stellar/scripts/generate-bindings.ts):stellar-cliis not yet on the active sessionPATH.export default class Client) with modern named exports (export class Client).CI Workflow Drift Detection:
.github/workflows/ci.ymlunder thestellarjob to setup Node, install dependencies, setup Stellar CLI, compile to targetwasm32-unknown-unknown, run bindings generation, and check for uncommitted files usinggit diff --exit-code.Documentation:
README.mdwith a detailed "Generated Bindings" section explaining the script workflows and when to regenerate.🧪 Verification and Type Safety
We have successfully validated the changes locally:
pnpm bindings:stellarcompiles the Rust contracts to WASM and extracts the TS clients perfectly.npx tsc --noEmityields 0 compiler errors, demonstrating complete type-safety.📸 Screenshots / Evidence