https://github.com/dojoengine/dojo.c
C bindings for the Torii Client SDK
https://github.com/dojoengine/dojo.c
Last synced: 2 months ago
JSON representation
C bindings for the Torii Client SDK
- Host: GitHub
- URL: https://github.com/dojoengine/dojo.c
- Owner: dojoengine
- License: mit
- Created: 2023-10-30T19:07:47.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-10-06T21:27:43.000Z (2 months ago)
- Last Synced: 2025-10-06T22:29:51.799Z (2 months ago)
- Language: Rust
- Homepage:
- Size: 1.24 MB
- Stars: 13
- Watchers: 2
- Forks: 13
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dojo.c
This package provides C and low-level Wasm32 bindings for the Torii Client SDK, as well as for the starknet-rs library.
The approach is to generate a C client using `cbindgen` and a wasm module using `wasm-bindgen` that are interropeable in applications exporting to both native platforms and web browsers.
## Building
```bash
# Build for current platform
cargo build --release
```
### Native platform
```bash
rustup target add x86_64-unknown-linux-gnu
cargo build --release --target x86_64-unknown-linux-gnu
```
### Wasm
```bash
# Building wasm32 binary
cargo build --release --target wasm32-unknown-unknown
# Building using wasm-pack
cd pkg && bunx wasm-pack build --release
```
## Running
```bash
# Building dojo.c
cargo build --release
# Linking dojo.c and building example
clang example/main.c target/release/libdojo_c.dylib
# Running example
./a.out
```