Summary
The Soroban contracts expose a public ABI (methods, parameters, return types, errors) but there is no automated documentation generation. SDK authors and frontend developers must read the Rust source to understand the API, which is error-prone and becomes stale as the contracts evolve.
Desired Behavior
- `soroban contract bindings typescript` generates TypeScript type definitions from the deployed contract ABI
- Generated types are committed to `frontend/src/generated/` and updated on every contract change
- CI fails if the generated bindings are out of sync with the current contract source
CI Step
```yaml
- name: Generate contract bindings
run: |
soroban contract bindings typescript
--wasm target/wasm32-unknown-unknown/release/invoice.wasm
--output frontend/src/generated/invoice.ts
git diff --exit-code frontend/src/generated/
```
The `git diff --exit-code` step fails CI if the generated file differs from what's committed.
Acceptance Criteria
References
- `contracts/invoice/src/lib.rs`
- `contracts/pool/src/lib.rs`
- `contracts/credit_score/src/lib.rs`
- `frontend/lib/contracts.ts`
Summary
The Soroban contracts expose a public ABI (methods, parameters, return types, errors) but there is no automated documentation generation. SDK authors and frontend developers must read the Rust source to understand the API, which is error-prone and becomes stale as the contracts evolve.
Desired Behavior
CI Step
```yaml
run: |
soroban contract bindings typescript
--wasm target/wasm32-unknown-unknown/release/invoice.wasm
--output frontend/src/generated/invoice.ts
git diff --exit-code frontend/src/generated/
```
The `git diff --exit-code` step fails CI if the generated file differs from what's committed.
Acceptance Criteria
References