Skip to content

feat: add contract ABI documentation generator to CI #427

@sanmipaul

Description

@sanmipaul

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

  1. `soroban contract bindings typescript` generates TypeScript type definitions from the deployed contract ABI
  2. Generated types are committed to `frontend/src/generated/` and updated on every contract change
  3. 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

  • `soroban contract bindings typescript` step added to CI
  • Generated bindings for all 3 contracts committed to `frontend/src/generated/`
  • CI fails if bindings are stale
  • Frontend `contracts.ts` is updated to import from generated bindings
  • `CONTRIBUTING.md` documents how to regenerate bindings locally

References

  • `contracts/invoice/src/lib.rs`
  • `contracts/pool/src/lib.rs`
  • `contracts/credit_score/src/lib.rs`
  • `frontend/lib/contracts.ts`

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave programdevopsCI/CD and infrastructuredocumentationImprovements or additions to documentation

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions