Skip to content

dojoengine/dojo.c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Jan 30, 2025
f6f0c14 · Jan 30, 2025
Jan 30, 2025
Jan 22, 2025
Jan 30, 2025
Dec 23, 2024
Jan 22, 2025
Jan 30, 2025
Jan 4, 2024
Jan 24, 2025
Jan 30, 2025
Oct 30, 2023
Oct 25, 2024
Jan 22, 2025
Jan 30, 2025
Jan 30, 2025
Jan 30, 2025
Aug 6, 2024
Oct 25, 2024

Repository files navigation

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

# Build for current platform
cargo build --release

Native platform

rustup target add x86_64-unknown-linux-gnu
cargo build --release --target x86_64-unknown-linux-gnu

Wasm

# Building wasm32 binary
cargo build --release --target wasm32-unknown-unknown
# Building using wasm-pack
cd pkg && bunx wasm-pack build --release

Running

# 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