MCPcopy Index your code
hub / github.com/cryptonerdcn/wasm-cairo

github.com/cryptonerdcn/wasm-cairo @v0.10.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.10.2 ↗ · + Follow
13 symbols 17 edges 5 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

WASM runtime for Cairo language and Starknet

WASM-Cairo

A suite of development tools and an environment for Cairo, all based on WebAssembly.

Homepage

Github

Built with 🦀🕸 by cryptonerdcn from Starknet Astro

🚴 Usage

How to use: 1. You can download the precompiled wasm file from here. 2. If you want to use WASM-Cairo in your Web App, you can also use npm package wasm-cairo.

If you prefer to build it yourself, you can follow the steps below.

🛠️ Build WASM-bindgen's WASM-Cairo Toolkit

With Modules

wasm-pack build --release --target web --out-dir output/module/pkg --out-name wasm-cairo

No Modules

wasm-pack build --release --target no-modules --out-dir output/no_module/pkg --out-name wasm-cairo

You will find wasm-cairo_bg.wasm and wasm-cairo.js in pkg folder.

Pack & Publish

With Modules

wasm-pack pack output/module
wasm-pack publish  

No Modules

wasm-pack pack output/no_module 

Caution: Do not run wasm-pack publish after wasm-pack pack output/no_module. It will publish the no-modules version.

🛠️ Build WASMTIME's WASM-Cairo Toolkit

cargo build --target wasm32-wasi --release

You can test it by using:

Compile Cairo

./wasmtime_test.sh compileCairoProgram ./cairo_files/HelloStarknetAstro.cairo ./cairo_files/HelloStarknetAstro.sierra

Run

./wasmtime_test.sh runCairoProgram ./cairo_files/HelloStarknetAstro.cairo

Run Tests

./wasmtime_test.sh runTests ./cairo_files/Test.cairo

Compile Contract

./wasmtime_test.sh compileStarknetContract ./cairo_files/storage.cairo ./cairo_files/storage.json  

🔋 Batteries Included

License

  • Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Core symbols most depended-on inside this repo

compile_cairo_program
called by 1
src/cli.rs
run_cairo_program
called by 1
src/cli.rs
compile_starknet_contract
called by 1
src/cli.rs
run_tests
called by 1
src/cli.rs
set_panic_hook
called by 0
src/utils.rs
greet
called by 0
src/lib.rs
compile_cairo_program
called by 0
src/lib.rs
run_cairo_program
called by 0
src/lib.rs

Shape

Function 12
Class 1

Languages

Rust100%

Modules by API surface

src/cli.rs6 symbols
src/lib.rs5 symbols
tests/web.rs1 symbols
src/utils.rs1 symbols

For agents

$ claude mcp add wasm-cairo \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact