Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contract Spec: Add CLI command that generates a TypeScript type from .wasm. #8

Closed
3 of 4 tasks
leighmcculloch opened this issue Jun 3, 2022 · 10 comments
Closed
3 of 4 tasks

Comments

@leighmcculloch
Copy link
Member

leighmcculloch commented Jun 3, 2022

We should:

  • In js-stellar-base, add xdr.ScVal.toJSON(val, spec), and xdr.ScVal.fromJSON(json, spec), inspired by the strval.rs code in this repo
    • Having this in js-stellar-base allows people to use the conversions even without the client binding generation.
  • Add typescript generation in rs-soroban-sdk, similar to how we generate rust, using the above js-stellar-base conversions to do parsing.
  • Add a soroban contract bindings --wasm contract.wasm --output typescript > contract.ts
  • Future: Research other libraries in other ecosystems and figure out a light-weight, but usable way to parse transaction results based on the spec as well. Write a follow-up issue for this.
    (updated 2022-04-06)
@leighmcculloch leighmcculloch transferred this issue from stellar/rs-soroban-sdk Jun 3, 2022
@leighmcculloch leighmcculloch changed the title Add CLI command that generates a TypeScript type from .wasm. Contract Spec: Add CLI command that generates a TypeScript type from .wasm. Jun 7, 2022
@paulbellamy
Copy link
Contributor

@paulbellamy
Copy link
Contributor

@smac711
Copy link

smac711 commented Sep 13, 2022

@paulbellamy is this still blocked and if so. What is the plan for unblocking it?

Does this require a priority update?
Is this required for Meridian?

@paulbellamy
Copy link
Contributor

paulbellamy commented Sep 14, 2022

It was blocked on https://github.com/stellar/rs-stellar-contract-sdk/issues/168, which is closed now, so this is now unblocked.

I'd say it is completion/polish/nice-to-have for meridian. Not strictly necessary, though.

@paulbellamy
Copy link
Contributor

And actually, in the platform sprint @tamirms had marked it as in-progress so I updated that in the soroban sprint to match.

@ire-and-curses
Copy link
Member

DX nice-to-have

@paulbellamy
Copy link
Contributor

@paulbellamy
Copy link
Contributor

Related: I did a little prototype on generating typescript directly from xdrgen in https://github.com/stellar/xdrgen/tree/typescript, but it needs some underlying library support for serialization.

@Shaptic
Copy link
Contributor

Shaptic commented Jun 8, 2023

@paulbellamy this will be closed by stellar/rs-soroban-sdk#871 then #644 afaict, correct?

@paulbellamy
Copy link
Contributor

Yes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

7 participants