0.8.8 • Published 2 years ago
@cryptonerdcn/wasm-cairo v0.8.8
WASM runtime for Cairo language and Starknet
A suite of development tools and an environment for Cairo, all based on WebAssembly.
Built with 🦀🕸 by cryptonerdcn from Starknet Astro
🚴 Usage
🛠️ Build WASM-bindgen's WASM-Cairo Toolkit
With Modules
wasm-pack build --release --target web --out-dir output/module/pkg --out-name wasm-cairoNo Modules
wasm-pack build --release --target no-modules --out-dir output/no_module/pkg --out-name wasm-cairoYou 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 🛠️ Build WASMTIME's WASM-Cairo Toolkit
cargo build --target wasm32-wasi --releaseYou can test it by using:
Compile Cairo
./wasmtime_test.sh compileCairoProgram ./cairo_files/HelloStarknetAstro.cairo ./cairo_files/HelloStarknetAstro.sierraRun
./wasmtime_test.sh runCairoProgram ./cairo_files/HelloStarknetAstro.cairoRun Tests
./wasmtime_test.sh runTests ./cairo_files/Test.cairoCompile Contract
./wasmtime_test.sh compileStarknetContract ./cairo_files/erc20.cairo ./cairo_files/erc20.json🔋 Batteries Included
wasm-bindgenfor communicating between WebAssembly and JavaScript.console_error_panic_hookfor logging panic messages to the developer console.wee_alloc, an allocator optimized for small code size.Cairofor Cairo-lang support.LICENSE-APACHEandLICENSE-MIT: most Rust projects are licensed this way, so these are included for you
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.