Crates.io | clique-wasm-sdk |
lib.rs | clique-wasm-sdk |
version | 0.1.2 |
source | src |
created_at | 2024-11-01 03:22:59.186622 |
updated_at | 2024-11-07 07:49:45.395831 |
description | Clique WASM SDK |
homepage | |
repository | |
max_upload_size | |
id | 1431249 |
size | 3,487 |
The Clique WASM SDK is a convenient WebAssembly toolkit designed to simplify interactions with the Clique Network.
Add this dependency to your Cargo.toml
:
clique-wasm-sdk = "0.1"
#![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()));
}