Skip to content

feat(typescript): add default export for Client class in generated bindings - #2864

Closed
jdjioe5-cpu wants to merge 1 commit into
stellar:mainfrom
jdjioe5-cpu:feat/issue-1153-ts-default-export
Closed

jdjioe5-cpu wants to merge 1 commit into
stellar:mainfrom
jdjioe5-cpu:feat/issue-1153-ts-default-export

Conversation

@jdjioe5-cpu

Copy link
Copy Markdown

Summary

Closes #1153

This PR adds a default export (export default Client;) to the generated TypeScript client package in soroban-spec-typescript.

What Changed

  • In cmd/crates/soroban-spec-typescript/src/lib.rs:
    • Appended export default Client; at the end of generate_class.
    • Added unit test test_generate_includes_export_default_client to verify that generate(...) includes export default Client;.
  • Users can now import the generated client class via either:
    import HelloContract from "bindings/hello-soroban-client";
    or the existing named export:
    import { Client as HelloContract } from "bindings/hello-soroban-client";
    // or
    import * as HelloContract from "bindings/hello-soroban-client";

Testing

  • Ran cargo test --package soroban-spec-typescript (all 26 tests passed).
  • Ran cargo clippy --package soroban-spec-typescript --no-deps -- -D warnings.

@github-project-automation github-project-automation Bot moved this to Backlog (Not Ready) in DevX Oct 23, 2026
@github-project-automation github-project-automation Bot moved this from Backlog (Not Ready) to Done in DevX Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

TS Bindings: Default exports in addition to exporting namespaces

2 participants