clique-wasm-sdk 0.1.0

Clique WASM SDK
Documentation
  • Coverage
  • 0%
    0 out of 4 items documented0 out of 4 items with examples
  • Size
  • Source code size: 3.79 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 551.43 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 6s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • clique-crates

Clique WASM SDK

The Clique WASM SDK is a convenient WebAssembly toolkit designed to simplify interactions with the Clique Network.

Quick Start

Add this dependency to your Cargo.toml:

clique-wasm-sdk = { version = "0.1.0", features = ["alloc"] }
#![no_std]
extern crate alloc;

use alloc::format;
use clique_wasm_sdk::{console_log, get_param, set_output, Val};

#[no_mangle]
pub extern "C" fn evaluate() {
    // Get param
    let param: Val = get_param("param").unwrap().unwrap();
    console_log(&format!("{:?}", param));

    // Set output
    set_output("output", &Val::Bytes(b"hello world".to_vec())).unwrap();
}