I am groot

[Proof of Concept] Rust code generator from OpenRPC spec

OpenRPC spec

JSON-RPC spec

StarkNet OpenRPC spec

Usage

```

git restore examples/gen.rs

manually remove mod gen from the examples/gen.rs (generated code is commited now)

cargo run -- CODE ./api/starknetapiopenrpc.json ./api/starknetwriteapi.json ./api/starknettraceapi_openrpc.json >> examples/gen.rs && cargo fmt cargo run --example gen ```

cargo run -- CODE ./api/eth.json >> examples/eth.rs && cargo fmt cargo run --example eth

cargo run -- TREE ./api/starknet_api_openrpc.json ./api/starknet_write_api.json > tree.txt

cargo run -- JSON ./api/test/input.openrpc 2>/dev/null | jq . > debug.json diff <(jq --sort-keys . ./api/test/input.openrpc) <(jq --sort-keys . debug.json)

TODO

  1. [ ] async version of the Rpc trait
  2. [ ] Seamless inclusion into a build process

DONE

Misc

Total lines of code: find . -type f -name "*.rs" | xargs grep . | wc -l