@patract/ceres-browser
v0.1.4
Published
Run ink! contract in browser!
Downloads
7
Readme
Ceres
Run ink! contract anywhere
A browser implementation of ceres
Example
import Flipper from "./flipper.json";
(async () => {
const wasm = await import("@patract/ceres-browser").catch(console.error);
const { Runtime } = wasm && (await wasm.default);
// create monitor
console.log("hello, this is a template of ceres");
// load contract
const contract = new Runtime(JSON.stringify(Flipper));
console.log("...init contract to storage");
// deploy contract
(contract as any).deploy("default", "[]", null);
console.log("...deploy contract");
// call contract
const res = contract.call("get", "[]", null);
console.log(`call contract...${res}`);
})();
LICENSE
Apache-2.0