Closed kyranjamie closed 4 years ago
We have only done [this]((https://https://github.com/coinbase/rosetta-sdk-go) for Golang so far 😢 . You can find our generated code in the types package!
If you are interested in doing the same for JS, TS, or any other language, I'm sure others in the community would use it extensively. We already received 1 question about this in our Discourse (I attached this issue there as well).
I wrote up a little blurb explaining the decision to start with Golang here.
@kyranjamie we are using https://www.npmjs.com/package/dtsgenerator to generate typescript type definitions based on api.json
file, something like dtsgen --out ./types/rosetta-types.d.ts ./rosetta-specifications/api.json
@AlanVerbner Would be cool if you created a Typescript SDK! We'd be happy to post it on the main website and community page!
Great work putting together a blockchain api standard so far @patrick-ogrady and co 👍
One feature I'm particularly interested in would be to generate typing info from the model files. Doing so leverages tooling many are already using, and can facilitate a much better DX.
We're already doing this @blockstack with our api layer that sits atop our code node, and publishing a package of the output types.
It's not a perfect set up. It uses a mash of npm packages, and has ran into some limitations of the JSON Schema standard. Primarily: How should you generate types with
allOf
andoneOf
properties, as well as types with 2 or more discriminating type unions. But otherwise has served us quite well.Would love to hear whether this has already been discussed, and thoughts on how it could fit into the Rosetta project.