Skip to content

Commit

Permalink
chore(rpc): generate latest spec
Browse files Browse the repository at this point in the history
  • Loading branch information
0xLucqs committed Apr 18, 2024
1 parent ea3ec65 commit cddf078
Show file tree
Hide file tree
Showing 11 changed files with 8,503 additions and 1 deletion.
14 changes: 14 additions & 0 deletions crates/starknet-types-rpc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
SRC_DIR ?= src/v0_7_1

define generate_spec
echo "Generating types for $(1)";
openrpc-gen --config $(1).toml --document $(1).json --output $(1).rs ;
endef

BASE_NAMES := starknet_api_openrpc starknet_trace_api_openrpc starknet_write_api
# Default target that depends on all generated .rs files
all:
$(foreach file,$(BASE_NAMES),$(call generate_spec,$(SRC_DIR)/$(file)))

# Phony target to avoid conflicts with actual files
.PHONY: all
4 changes: 3 additions & 1 deletion crates/starknet-types-rpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ After having built `openrpc-gen`, you can use the following command to generate
Rust files:

```bash
openrpc-gen --config configs/v0.5.0.toml --document configs/spec_v0.5.0.json --output src/generated/v0.5.0.rs
make all
```

NOTE: Currently the `starknet_trace_api_openrpc` file requires a modification for `starknet_simulateTransactions` (nested `schema` in the result, see previous version for infos)

*Note that this first step is normally already done for you upon cloning the repository.*

### Building the generated files
Expand Down
Loading

0 comments on commit cddf078

Please sign in to comment.