starknet-types-rpc

Crates.iostarknet-types-rpc
lib.rsstarknet-types-rpc
version0.7.1
sourcesrc
created_at2024-10-28 09:42:37.484353
updated_at2024-10-28 09:42:37.484353
descriptionStarknet RPC types.
homepagehttps://github.com/starknet-io/types-rs
repositoryhttps://github.com/starknet-io/types-rs
max_upload_size
id1425414
size583,460
Maciej KamiƄski @ StarkWare (maciejka)

documentation

README

starknet-types-rpc

# starknet-types-rpc

`starknet-types-rpc` is a crate dealing with Starknet types used in RPC communication, serde, and transport. This crate is part of an initiative to standardize the representation of the `Felt` type in Rust, reducing code complexity and improving performance across the Starknet Rust ecosystem.

## Usage

Include `starknet-types-rpc` in your library by adding the following to your `Cargo.toml`:

```toml
[dependencies]
starknet-types-rpc = { version = "0.0.2", git = "https://github.com/starknet-io/types-rs" }

Build from source

The crate is built in two steps:

Generating bindings against the Starknet OpenRPC specification

The specification is hosted on Starknet's repository (link).

Bindings are generated using openrpc-gen.

After having built openrpc-gen, you can use the following command to generate the final generated Rust files:

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

Once this is done, you can build the crate with:

cargo build --release

Testing

Clone the repository and navigate to the starknet-types-rpc directory. Then run:

cargo test

Contributing

Contributions are welcome! Please read our contributing guidelines for more information.

License

This repository is licensed under the MIT License, see LICENSE for more information.

Commit count: 80

cargo fmt